working include of plugin javascript files

This commit is contained in:
John McLear 2015-06-21 11:58:12 +01:00
parent 58c011ca1c
commit c866f7ac77

View file

@ -108,15 +108,19 @@ function sendPadHeaderFiles(res, callback){
}); });
}); });
// Now we need to uniquify the array so we only have unique paths
var uniquePaths = pluginPaths.filter(function(item, pos) { var uniquePaths = pluginPaths.filter(function(item, pos) {
return pluginPaths.indexOf(item) == pos; return pluginPaths.indexOf(item) == pos;
}) })
console.warn("paths", uniquePaths); // Next to join the array into a string so we can add it to the link value
var uniquePluginString = "'";
// Now we need to uniquify the array for (var i = 0; i < uniquePaths.length; i++) {
uniquePluginString += "<"+uniquePaths[i]+".js>; rel=prefetch\,";
}
res.set('Link', '<static/js/require-kernel.js>; rel=prefetch \, \ res.set('Link', uniquePluginString + " <static/js/require-kernel.js>; rel=prefetch\, \
<javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define>; rel=prefetch\, \ <javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define>; rel=prefetch\, \
<javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define>; rel=prefetch\, \ <javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define>; rel=prefetch\, \
<javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js?callback=require.define>; rel=prefetch\, \ <javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js?callback=require.define>; rel=prefetch\, \
@ -129,6 +133,6 @@ function sendPadHeaderFiles(res, callback){
<static/css/iframe_editor.css>; rel=prefetch\, \ <static/css/iframe_editor.css>; rel=prefetch\, \
<pluginfw/plugin-definitions.json>; rel=prefetch\, \ <pluginfw/plugin-definitions.json>; rel=prefetch\, \
<locales.json>; rel=prefetch\, \ <locales.json>; rel=prefetch\, \
<static/font/fontawesome-etherpad.woff>; rel=prefetch'); <static/font/fontawesome-etherpad.woff>; rel=prefetch'");
callback(); callback();
} }