[ Index ] |
|
Code source de FCKeditor 2.4 |
1 /* 2 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 3 * Copyright (C) 2003-2007 Frederico Caldeira Knabben 4 * 5 * == BEGIN LICENSE == 6 * 7 * Licensed under the terms of any of the following licenses at your 8 * choice: 9 * 10 * - GNU General Public License Version 2 or later (the "GPL") 11 * http://www.gnu.org/licenses/gpl.html 12 * 13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 14 * http://www.gnu.org/licenses/lgpl.html 15 * 16 * - Mozilla Public License Version 1.1 or later (the "MPL") 17 * http://www.mozilla.org/MPL/MPL-1.1.html 18 * 19 * == END LICENSE == 20 * 21 * File Name: fckstyledef.js 22 * FCKStyleDef Class: represents a single style definition. 23 * 24 * File Authors: 25 * Frederico Caldeira Knabben (www.fckeditor.net) 26 */ 27 28 var FCKStyleDef = function( name, element ) 29 { 30 this.Name = name ; 31 this.Element = element.toUpperCase() ; 32 this.IsObjectElement = FCKRegexLib.ObjectElements.test( this.Element ) ; 33 this.Attributes = new Object() ; 34 } 35 36 FCKStyleDef.prototype.AddAttribute = function( name, value ) 37 { 38 this.Attributes[ name ] = value ; 39 } 40 41 FCKStyleDef.prototype.GetOpenerTag = function() 42 { 43 var s = '<' + this.Element ; 44 45 for ( var a in this.Attributes ) 46 s += ' ' + a + '="' + this.Attributes[a] + '"' ; 47 48 return s + '>' ; 49 } 50 51 FCKStyleDef.prototype.GetCloserTag = function() 52 { 53 return '</' + this.Element + '>' ; 54 } 55 56 57 FCKStyleDef.prototype.RemoveFromSelection = function() 58 { 59 if ( FCKSelection.GetType() == 'Control' ) 60 this._RemoveMe( FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement() ) ; 61 else 62 this._RemoveMe( FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement() ) ; 63 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 15:28:05 2007 | par Balluche grâce à PHPXref 0.7 |