Hi,
I have created a very simple combolist plugin (the code is posted at the end of the message) and i have an unvolved problem. Can you help me ?
This is very stange, when i load a frist time my page, everything is working, but when i refresh my page (or go to an other and then come back again) when i click on the combo list and then click 'far away' without select anything, i have an IE crash (everything is working on firefox).
1) First time
- every thing ok
2) Refresh or come back
- the page seems to load normaly
- i click once on the combo item
- the i cick outside the item
=> IE crash
3) New session
- i load a fisrt time the page
- close the window
- open the page again
=> NO CRASH
4) New Page !!
- i load the page once
- i do a 'ctrl+N' on my page
- in the the windows, everything is ok
=> NO CRASH
Where the problem can came ?
I did not know where to search ?
I have tried to change my header, Prama no cache ... => same problem
Here is the code i uses in fckplugin.js :
// Erwan ALLIAUME
var FCKMyCombo_command = function(name) {
this.Name = name ;
}
// Un item est selectionne
FCKMyCombo_command.prototype.Execute = function(itemText, itemLabel) {
if (itemText != "") {
FCK.InsertHtml(itemText);
}
}
// appele lors de la maj du textarea pour mettre a jour le composant
this.FCKMyCombo_command.prototype.GetState = function() { return ; }
FCKCommands.RegisterCommand( 'FormuleOperations' , new FCKMyCombo_command('FormuleOperations') ) ;
// creation de la combo
var FCKToolbarMyCombo = function(tooltip,style) {
this.Command = FCKCommands.GetCommand('FormuleOperations');
this.CommandName = 'FormuleOperations';
this.Label = this.GetLabel();
this.Tooltip = tooltip ? tooltip:this.Label; //Doesn't seem to work
this.Style = style;
};
FCKToolbarMyCombo.RefreshState = function() {
alert('refresh');
return ;
};
FCKToolbarMyCombo.prototype = new FCKToolbarSpecialCombo;
// Nom du libelle de la combo
FCKToolbarMyCombo.prototype.GetLabel = function() {
return FCKLang.Operations;
};
// Ajout des elements a la liste
FCKToolbarMyCombo.prototype.CreateItems = function(A) {
this._Combo.AddItem(' + ', 'Addition');
this._Combo.AddItem(' - ', 'Soustraction');
this._Combo.AddItem(' * ', 'Multiplication');
this._Combo.AddItem(' / ', 'Division');
}
FCKToolbarItems.RegisterItem( 'FormuleOperations' , new FCKToolbarMyCombo( 'FormuleOperations', FCK_TOOLBARITEM_ONLYTEXT) ) ;
Thanks a lot.
I have created a very simple combolist plugin (the code is posted at the end of the message) and i have an unvolved problem. Can you help me ?
This is very stange, when i load a frist time my page, everything is working, but when i refresh my page (or go to an other and then come back again) when i click on the combo list and then click 'far away' without select anything, i have an IE crash (everything is working on firefox).
1) First time
- every thing ok
2) Refresh or come back
- the page seems to load normaly
- i click once on the combo item
- the i cick outside the item
=> IE crash
3) New session
- i load a fisrt time the page
- close the window
- open the page again
=> NO CRASH
4) New Page !!
- i load the page once
- i do a 'ctrl+N' on my page
- in the the windows, everything is ok
=> NO CRASH
Where the problem can came ?
I did not know where to search ?
I have tried to change my header, Prama no cache ... => same problem
Here is the code i uses in fckplugin.js :
// Erwan ALLIAUME
var FCKMyCombo_command = function(name) {
this.Name = name ;
}
// Un item est selectionne
FCKMyCombo_command.prototype.Execute = function(itemText, itemLabel) {
if (itemText != "") {
FCK.InsertHtml(itemText);
}
}
// appele lors de la maj du textarea pour mettre a jour le composant
this.FCKMyCombo_command.prototype.GetState = function() { return ; }
FCKCommands.RegisterCommand( 'FormuleOperations' , new FCKMyCombo_command('FormuleOperations') ) ;
// creation de la combo
var FCKToolbarMyCombo = function(tooltip,style) {
this.Command = FCKCommands.GetCommand('FormuleOperations');
this.CommandName = 'FormuleOperations';
this.Label = this.GetLabel();
this.Tooltip = tooltip ? tooltip:this.Label; //Doesn't seem to work
this.Style = style;
};
FCKToolbarMyCombo.RefreshState = function() {
alert('refresh');
return ;
};
FCKToolbarMyCombo.prototype = new FCKToolbarSpecialCombo;
// Nom du libelle de la combo
FCKToolbarMyCombo.prototype.GetLabel = function() {
return FCKLang.Operations;
};
// Ajout des elements a la liste
FCKToolbarMyCombo.prototype.CreateItems = function(A) {
this._Combo.AddItem(' + ', 'Addition');
this._Combo.AddItem(' - ', 'Soustraction');
this._Combo.AddItem(' * ', 'Multiplication');
this._Combo.AddItem(' / ', 'Division');
}
FCKToolbarItems.RegisterItem( 'FormuleOperations' , new FCKToolbarMyCombo( 'FormuleOperations', FCK_TOOLBARITEM_ONLYTEXT) ) ;
Thanks a lot.