Forum Discussion
Best place to put JavaScript functions for publishing
Hi, was there any update or progress on adding this as a feature? I would like to be able to add custom JS in the manner recommended by the JavaScript Best Practices page, without having to manually re-add the lines after every time I 'Publish'.
The current (admittedly unsupported) method is also a bit dangerous if you are not paying attention, as Publishing your Story will vaporise any custom .js files you have added to the directory. If you don't have a backup elsewhere it could be a frustrating way to lose work.
No need for adding it after publishing. Several options to set your Storyline files up so each time you get all code as needed...without worrying about it.
- Use a WebObjects to add it to your title. This way it is always available. However when you change anything in your scripts you have to remove and reinsert the Webobject. As i donot like that i figured out a alternative.
- Add the files/scripts to your Programme Folder for Storyline
C:\Program Files (x86)\Articulate\360\Storyline\player\unified
C:\Program Files (x86)\Articulate\360\Storyline\player\unified\html5\lib\scripts
You would need to change the html's added there too, so that on every publish you get your added files. Drawback in this is when you share Story's with coworkers..if they havenot set it up similar... they will miss the files and it wont work. And each time Articulate updates you need to redo it ;-) And offcourse this is not supported by Articulate..
- JonathanRose-cc5 years agoCommunity Member
Hi Math, thanks for the tips. Will try out that second method, which should speed things up a bit. I am currently the only one in my team using Storyline so there is no concern of coworkers missing the files. Cheers.
- MathNotermans-95 years agoCommunity Member
Your welcome...as extra tip... i use 'Symbolic Links' to redirect from the Programme Folder to a local folder. That allows me to easily and quickly add/change parts of the Javascript when needed. Drawback is that when Articulate updates you need to remove all symlinks before updating..else the update fails.