mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 11:26:16 -04:00
support for correct paths and for plugins without client hooks
This commit is contained in:
parent
c866f7ac77
commit
4840e7ed58
1 changed files with 10 additions and 6 deletions
|
@ -103,9 +103,11 @@ function sendPadHeaderFiles(res, callback){
|
||||||
if(key === "ep_etherpad-lite") return;
|
if(key === "ep_etherpad-lite") return;
|
||||||
var plugin = plugins[key];
|
var plugin = plugins[key];
|
||||||
var client_hooks = plugin.parts[0].client_hooks;
|
var client_hooks = plugin.parts[0].client_hooks;
|
||||||
|
if(client_hooks){
|
||||||
Object.keys(client_hooks).forEach(function(k){
|
Object.keys(client_hooks).forEach(function(k){
|
||||||
pluginPaths.push(client_hooks[k]);
|
pluginPaths.push(client_hooks[k]);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Now we need to uniquify the array so we only have unique paths
|
// Now we need to uniquify the array so we only have unique paths
|
||||||
|
@ -114,12 +116,14 @@ function sendPadHeaderFiles(res, callback){
|
||||||
})
|
})
|
||||||
|
|
||||||
// Next to join the array into a string so we can add it to the link value
|
// Next to join the array into a string so we can add it to the link value
|
||||||
var uniquePluginString = "'";
|
var uniquePluginString = "";
|
||||||
|
|
||||||
for (var i = 0; i < uniquePaths.length; i++) {
|
for (var i = 0; i < uniquePaths.length; i++) {
|
||||||
uniquePluginString += "<"+uniquePaths[i]+".js>; rel=prefetch\,";
|
uniquePluginString += "<static/plugins/"+uniquePaths[i]+".js>; rel=prefetch\, ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.log("unique plugin string...", uniquePluginString)
|
||||||
|
|
||||||
res.set('Link', uniquePluginString + " <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\, \
|
||||||
|
@ -133,6 +137,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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue