Changeset 644 for trunk/EmoticonButton

Show
Ignore:
Timestamp:
05/20/08 11:03:28 (19 months ago)
Author:
fumiakiy
Message:

Fixed the bug that disabled other buttons when the plugin was installed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/EmoticonButton/mt-static/plugins/EmoticonButton/js/emoticon.js

    r640 r644  
    22MT.App = new Class( MT.App, { 
    33    initEditor: function() { 
    4         arguments.callee.applySuper( this, arguments ); 
    5         this.editor.emoticon = this.addComponent( new MT.App.Emoticon( "emoticon", "emoticon" ) ); 
     4        if ( this.constructor.Editor && DOM.getElement( "editor-content" ) ) { 
     5             
     6            var mode = DOM.getElement( "convert_breaks" ); 
     7            DOM.addEventListener( mode, "change", this.getIndirectEventListener( "setTextareaMode" ) ); 
     8         
     9            /* special case */ 
     10            window.cur_text_format = mode.value; 
     11         
     12            this.editorMode = ( mode.value == "richtext" ) ? "iframe" : "textarea"; 
     13             
     14            this.editor = this.addComponent( new MT.App.Editor.Emoticon( "editor-content", this.editorMode ) ); 
     15            this.editor.textarea.setTextMode( mode.value ); 
     16            this.editor.emoticon = this.addComponent( new MT.App.Emoticon( "emoticon", "emoticon" ) ); 
     17         
     18            this.editorInput = { 
     19                content: DOM.getElement( "editor-input-content" ), 
     20                extended: DOM.getElement( "editor-input-extended" ) 
     21            }; 
     22         
     23            if ( this.editorInput.content.value ) 
     24                this.editor.setHTML( this.editorInput.content.value ); 
     25        } 
    626    } 
    727}); 
     
    89109} ); 
    90110 
    91 MT.App.Editor.Toolbar = new Class( Editor.Toolbar, { 
     111MT.App.Editor.Emoticon = new Class( MT.App.Editor, { 
     112 
     113} ); 
     114 
     115MT.App.Editor.Emoticon.Textarea = new Class( MT.App.Editor.Textarea, { 
     116 
     117} ); 
     118 
     119MT.App.Editor.Emoticon.Iframe = new Class( MT.App.Editor.Iframe, { 
     120 
     121} ); 
     122 
     123MT.App.Editor.Emoticon.Toolbar = new Class( MT.App.Editor.Toolbar, { 
    92124         
    93125    insertEmoticon: function( data ) { 
     126        if (!data) return; 
    94127        var name = data['name']; 
    95128        if (!name) return;