+++ /dev/null
-/*\r
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben\r
- *\r
- * == BEGIN LICENSE ==\r
- *\r
- * Licensed under the terms of any of the following licenses at your\r
- * choice:\r
- *\r
- * - GNU General Public License Version 2 or later (the "GPL")\r
- * http://www.gnu.org/licenses/gpl.html\r
- *\r
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
- * http://www.gnu.org/licenses/lgpl.html\r
- *\r
- * - Mozilla Public License Version 1.1 or later (the "MPL")\r
- * http://www.mozilla.org/MPL/MPL-1.1.html\r
- *\r
- * == END LICENSE ==\r
- *\r
- * FCKToolbarButton Class: represents a button in the toolbar.\r
- */\r
-\r
-var FCKToolbarButton = function( commandName, label, tooltip, style, sourceView, contextSensitive, icon )\r
-{\r
- this.CommandName = commandName ;\r
- this.Label = label ;\r
- this.Tooltip = tooltip ;\r
- this.Style = style ;\r
- this.SourceView = sourceView ? true : false ;\r
- this.ContextSensitive = contextSensitive ? true : false ;\r
-\r
- if ( icon == null )\r
- this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;\r
- else if ( typeof( icon ) == 'number' )\r
- this.IconPath = [ FCKConfig.SkinPath + 'fck_strip.gif', 16, icon ] ;\r
- else\r
- this.IconPath = icon ;\r
-}\r
-\r
-FCKToolbarButton.prototype.Create = function( targetElement )\r
-{\r
- this._UIButton = new FCKToolbarButtonUI( this.CommandName, this.Label, this.Tooltip, this.IconPath, this.Style ) ;\r
- this._UIButton.OnClick = this.Click ;\r
- this._UIButton._ToolbarButton = this ;\r
- this._UIButton.Create( targetElement ) ;\r
-}\r
-\r
-FCKToolbarButton.prototype.RefreshState = function()\r
-{\r
- var uiButton = this._UIButton ;\r
-\r
- if ( !uiButton )\r
- return ;\r
-\r
- // Gets the actual state.\r
- var eState = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;\r
-\r
- // If there are no state changes than do nothing and return.\r
- if ( eState == uiButton.State ) return ;\r
-\r
- // Sets the actual state.\r
- uiButton.ChangeState( eState ) ;\r
-}\r
-\r
-FCKToolbarButton.prototype.Click = function()\r
-{\r
- var oToolbarButton = this._ToolbarButton || this ;\r
- FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oToolbarButton.CommandName ).Execute() ;\r
-}\r
-\r
-FCKToolbarButton.prototype.Enable = function()\r
-{\r
- this.RefreshState() ;\r
-}\r
-\r
-FCKToolbarButton.prototype.Disable = function()\r
-{\r
- // Sets the actual state.\r
- this._UIButton.ChangeState( FCK_TRISTATE_DISABLED ) ;\r
-}\r