Forum Discussion

ronald-hicks's avatar
ronald-hicks
Community Member
21 hours ago

How do you keep your reusable Storyline JS bits in sync across projects?

My reusable Storyline JavaScript bits live in a plain notepad doc — paste-ready snippets driven through plain variables, so they drop into a project without rework.

 

It works, until it doesn't. A snippet gets improved in one project and the doc still holds the old version. Or two projects end up with slightly different copies and I can't remember which one is current.

 

I'm curious how others handle this. Do you keep a single master doc and copy from it every time? A shared team doc? Something versioned, so an improvement in one project flows back to the master? Or do you just accept a little drift and fix snippets per project?

 

Not looking for a tool pitch — just the habit that actually holds up when the snippet count grows.

2 Replies

  • I should use github but have always used snippetsLab on my Mac.

    Everything has commented out version numbers in case i improve it (try to do iany improvemst so they are a hotfix replacement.

     

     

  • I'm a really big fan of OneNote as a productivity tool, so I use it often. It makes a great library, and I have a small section for snippets or links to snippets.

    I'm the only one on my team who knows any JavaScript. I'm building out first-steps for a few people, but they're at the "what is a boolean?" point still. That also means there's no larger JS development at our company or handing off of major, coded learning projects.

    As long as they don't contain any proprietary information, I've imagined code snippets could live in JSFiddle or something so they can be accessed on any browser, but I never seem to either work on projects that leverage reusable snippets or find ones useful enough to use again much less hang onto.

    To the other end of the spectrum, I've been spending the last couple years really exploring how to create JavaScript engines in Storyline, such as are used in simulations. I have a 2D grid-based movement engine that's coming along nicely and is definitely over 1,000 lines. For that, I simply added a .js in the directory Storyline uses to publish content that I edit in VSC. Ctrl+S to "push" the changes from VSC to Storyline, and then Preview to see them in action.

    I hadn't really thought about it, but with a mature enough implementation, the code could be hosted on Github and retrieved at runtime via CDN. Neat.