You are not logged in.
edit 1 :
Working example
edit 2 :
Successfully did this by merging 10 plugins into same file now with same principle as below.
The language files were melted, it works fine.
No I only need a way of benchmarking the changes...
- - - - - - - - - - - -
This idea was inspired by this thread : http://xinha.gogo.co.nz/punbb/viewtopic.php?id=315
One way to make xinha load faster could be to merge plugins into one huge pluginfile. For me it seems better to load 1 JS file than 15 JS files.
But Im not sure this will work very good since the plugins have their own language file, and the language file hasnt got any "string name", so how do I merge different languagfe files I wonder?
Anyone has tried merging the plugins?
Ill give it a try :
One problem which occures when mergin two plugins is that only one plugin is initiated (The one with the pluginname).
Example, I create a a new "EwsMultiLoader" plugin which should load many plugins at once. The first thing I do is to set up the folder and create the following .js file :
ews-multi-loader.js
function EwsMultiLoader(editor) {
}
EwsMultiLoader._pluginInfo = {
name : "EwsMultiLoader",
version : "1.0",
developer : "",
developer_url : "http://",
c_owner : "",
sponsor : "",
sponsor_url : "",
license : "htmlArea"
};
I now want to merge the CharacterMap plugin, so i copy the subfolders into my MultiLoader folder. I copy the javascript code from character-map.js into my multi-loader.js and do a few alterations in code, I currently have this file :
function CharacterMap(editor) {
this.editor = editor;
var cfg = editor.config;
var self = this;
cfg.registerButton({
id : "insertcharacter",
tooltip : this._lc("Insert special character"),
image : editor.imgURL("ed_charmap.gif", "EwsMultiLoader"),
textMode : false,
action : function(editor) {
self.buttonPress(editor);
}
})
cfg.addToolbarElement("insertcharacter", "inserthorizontalrule", 1);
};
CharacterMap._pluginInfo = {
name : "CharacterMap",
version : "1.0",
developer : "Holger Hees & Bernhard Pfeifer",
developer_url : "http://www.systemconcept.de/",
c_owner : "Holger Hees & Bernhard Pfeifer",
sponsor : "System Concept GmbH & Bernhard Pfeifer",
sponsor_url : "http://www.systemconcept.de/",
license : "htmlArea"
};
CharacterMap.prototype._lc = function(string) {
return HTMLArea._lc(string, 'EwsMultiLoader');
}
CharacterMap.prototype.buttonPress = function(editor) {
editor._popupDialog( "plugin://EwsMultiLoader/select_character", function( entity )
{
if ( !entity )
{
//user must have pressed Cancel
return false;
}
editor.insertHTML( entity );
}, null);
}
function EwsMultiLoader(editor) {
editor.registerPlugin('CharacterMap');
}
EwsMultiLoader._pluginInfo = {
name : "EwsMultiLoader",
version : "1.0",
developer : "",
developer_url : "http://",
c_owner : "",
sponsor : "",
sponsor_url : "",
license : "htmlArea"
};
And finally in the javascript code to initiate Xinha I replace CharacterMap with EwsMultiLoader, so that my new plugin should load.
This seems to work as far as I can see.
I also assume that when two language files are needed I just "melt" them together since I assume Xinha reads the language code as a big chunk of data (Which would assume two plugins cant have same name on variables and that doesnt sound right)
Could this work or is it something I should be aware of here?
Last edited by kimss (2005-07-16 08:14:46)
Offline