[svn r22157] Adding plugin glossary in fckeditor for working with terms of glossary tool - partial FS#4337
parent
7efef213e0
commit
0e513d32ef
@ -0,0 +1 @@ |
||||
|
||||
@ -0,0 +1,56 @@ |
||||
// Register the command.
|
||||
|
||||
var FCKGlossary = function( name ) |
||||
{ |
||||
this.Name = name ; |
||||
this.StyleName = '_FCK_Glossary' ; |
||||
this.IsActive = false ;
|
||||
this.EditMode = FCK.EditMode; |
||||
|
||||
FCKStyles.AttachStyleStateChange( this.StyleName, this._OnStyleStateChange, this ) ; |
||||
} |
||||
|
||||
FCKGlossary.prototype = |
||||
{ |
||||
Execute : function() |
||||
{ |
||||
FCKUndo.SaveUndoStep() ; |
||||
|
||||
if ( this.IsActive ) {
|
||||
FCKStyles.RemoveStyle(this.StyleName) ;
|
||||
} |
||||
else {
|
||||
FCKStyles.ApplyStyle( this.StyleName ) ;
|
||||
} |
||||
FCK.Focus() ; |
||||
FCK.Events.FireEvent( 'OnSelectionChange' ) ; |
||||
}, |
||||
|
||||
GetState : function() |
||||
{ |
||||
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) |
||||
return FCK_TRISTATE_DISABLED ;
|
||||
return this.IsActive ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF; |
||||
}, |
||||
|
||||
_OnStyleStateChange : function( styleName, isActive ) |
||||
{ |
||||
this.IsActive = isActive ; |
||||
} |
||||
}; |
||||
|
||||
|
||||
|
||||
|
||||
FCKCommands.RegisterCommand( 'Glossary' , new FCKGlossary( 'Glossary' ) ) ; |
||||
|
||||
/*FCKCommands.RegisterCommand( 'Glossary', |
||||
new FCKCoreStyleCommand( 'Italic' ) |
||||
) ;*/ |
||||
|
||||
// Create and register the Audio toolbar button.
|
||||
var oGlossaryItem = new FCKToolbarButton( 'Glossary', FCKLang['GlossaryTitle'], null, null, null, null, null ); |
||||
|
||||
oGlossaryItem.IconPath = FCKConfig.PluginsPath + 'glossary/glossary.gif' ; |
||||
|
||||
FCKToolbarItems.RegisterItem( 'Glossary', oGlossaryItem ) ; |
||||
|
After Width: | Height: | Size: 1016 B |
@ -0,0 +1,7 @@ |
||||
// Glossary.
|
||||
// English language file.
|
||||
// Please, use UTF-8 encoding.
|
||||
|
||||
FCKLang['GlossaryTitle'] = 'Glossary' ; |
||||
|
||||
|
||||
@ -0,0 +1,5 @@ |
||||
// Glossary.
|
||||
// Spanish language file.
|
||||
// Please, use UTF-8 encoding.
|
||||
|
||||
FCKLang['GlossaryTitle'] = 'Glosario' ; |
||||
Loading…
Reference in new issue