Modificare il file:
\FckEditor\plugins\zoom\fckplugin.js
//********START******** /* 1st, define the 'command' to execute when an item from the list is selected - ie, insert the text. */ var zoomValue = "100" ; var FCKZoom_command = function(name) { /* The 'name' parameter doesn't do anything. You could define above using: a) var FCKMyCombo_command = function() { or b) var FCKMyCombo_command = function(name, var1, var2, var3) { or c) what ever you like Just remember to reflect this at the 'FCKCommands.RegisterCommand( 'mycombocommand' , new FCKMyCombo_command('any_name') ) ;' line below. EG: a) FCKCommands.RegisterCommand( 'mycombocommand' , new FCKMyCombo_command() ) ; b) FCKCommands.RegisterCommand( 'mycombocommand' , new FCKMyCombo_command('any_name', 'var1', 'var2', 'var3') ) ; c) what ever you like */ this.Name = name ; } //This get's executed when an item from the combo list gets selected FCKZoom_command.prototype.Execute = function(itemText, itemLabel) { //if (itemText != "") // FCK.InsertHtml(itemText); zoomValue = itemText ; Zoom = itemText if (Zoom == null || Zoom == ""){ zoomValue = "100" ; } FCK.EditorDocument.body.runtimeStyle.zoom = Zoom + "%" ; } //was getting GetState is not a function (or similar) errors, so added this. FCKZoom_command.prototype.GetState = function() { return zoomValue ; } FCKCommands.RegisterCommand( 'Zoom' , new FCKZoom_command('ZoomCmd') ) ; /* 2nd, create the Combo object */ var FCKToolbarZoom=function(tooltip,style){ this.Command=FCKCommands.GetCommand('Zoom');//the command to execute when an item is selected this.CommandName = 'Zoom'; this.Label=this.GetLabel(); this.Tooltip=tooltip?tooltip:this.Label; //Doesn't seem to work this.Style=style; //FCK_TOOLBARITEM_ICONTEXT OR FCK_TOOLBARITEM_ONLYTEXT this.PanelWidth = 80 ; this.FieldWidth = 50 ; }; FCKToolbarZoom.prototype=new FCKToolbarSpecialCombo; //Label to appear in the FCK toolbar FCKToolbarZoom.prototype.GetLabel=function(){ return "Zoom"; }; FCKToolbarZoom.prototype.RefreshActiveItems=function(targetSpecialCombo){ targetSpecialCombo.DeselectAll(); targetSpecialCombo.SelectItem(zoomValue); targetSpecialCombo.SetLabelById(zoomValue); } //Add the items to the combo list FCKToolbarZoom.prototype.CreateItems=function(targetSpecialCombo){ if (!FCKBrowserInfo.IsGecko) targetSpecialCombo.OnBeforeClick = this.RefreshActiveItems ; //this._Combo.AddItem(itemText, itemLabel); //see FCKMyCombo_command.prototype.Execute = function(itemText, itemLabel) above tmp = FCKConfig.ZoomValue.split(",") for(i=0;i<tmp.length;i++){ this._Combo.AddItem(tmp[i], tmp[i] + '%', tmp[i] + '%'); } } //Register the combo with the FCKEditor FCKToolbarItems.RegisterItem( 'Zoom' , new FCKToolbarZoom( 'Zoom', FCK_TOOLBARITEM_ICONTEXT ) ) ; //or FCK_TOOLBARITEM_ONLYTEXT //********END********
[
Íàçàä
]