Hello.
I've just created new simple plugin, which allows user to add some kind of system internal variables from dropdown into their templates (which are edited using FCKeditor). List of variables depends on user, so i need to pass javascript hash to CreateItems() method).
I tried something like this:
//mycode.html
var editor = new FCKeditor('myFieldName', 550, 150);
editor.Config.variablesList = {0:'a',1:'b',2:'c'};
editor.ReplaceTextarea();
and made correspodning changes in plugin:
//fckplugin.js
var FCKVarsList = function(tooltip, style) {
this.CommandName = 'VarsList' ;
this.Label = 'Variables';
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT;
}
FCKVarsList.prototype = new FCKToolbarSpecialCombo;
FCKVarsList.prototype.GetLabel = function() {
return this.Label;
}
//CREATE ITEMS HERE!!!
FCKVarsList.prototype.CreateItems = function(targetSpecialCombo) {
var vl = FCKConfig.variablesList;
for (var i in vl)
this._Combo.AddItem((i + " " +vl[i]), (i +" " +vl[i]), vl[i]);
}
And what i found is that FCK wraps config variables with String methods defined in fckjscoreextensions.js and there is no way to get my hash back!
How i can pass hash?
Thanks a lot to anyone who can help me.
I've just created new simple plugin, which allows user to add some kind of system internal variables from dropdown into their templates (which are edited using FCKeditor). List of variables depends on user, so i need to pass javascript hash to CreateItems() method).
I tried something like this:
//mycode.html
var editor = new FCKeditor('myFieldName', 550, 150);
editor.Config.variablesList = {0:'a',1:'b',2:'c'};
editor.ReplaceTextarea();
and made correspodning changes in plugin:
//fckplugin.js
var FCKVarsList = function(tooltip, style) {
this.CommandName = 'VarsList' ;
this.Label = 'Variables';
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT;
}
FCKVarsList.prototype = new FCKToolbarSpecialCombo;
FCKVarsList.prototype.GetLabel = function() {
return this.Label;
}
//CREATE ITEMS HERE!!!
FCKVarsList.prototype.CreateItems = function(targetSpecialCombo) {
var vl = FCKConfig.variablesList;
for (var i in vl)
this._Combo.AddItem((i + " " +vl[i]), (i +" " +vl[i]), vl[i]);
}
And what i found is that FCK wraps config variables with String methods defined in fckjscoreextensions.js and there is no way to get my hash back!
How i can pass hash?
Thanks a lot to anyone who can help me.