Big Spender Posted September 21, 2014 Share Posted September 21, 2014 There is some code which outputs all the scripts automatically in the footer of each skin - is there anyway to use this code but organize the scripts? As some scripts need to be higher in the order than others to stop JS breaking. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 21, 2014 Share Posted September 21, 2014 In gui.class.php, near line 146, there is code that will get the filenames of any javascript file in the skin folder. This array is returned in the order the operating system gave them (GLOB_NOSORT) -- an ordering which may or may not be under your control. A hook lets you do anything you want to the array. Then, the (stock) skin template code will include the file /js/common.html, which when delivered to the browser, the browser will ask for /js/plugins.php and /js/common.js. PHP will sort the filename array of plugin files found in the plugins directory alphabetically. So, depending where your javascript files are located, you can modify the gui class code or the plugins.php code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.