- go : function(id, mode) {
- id = id || 'content';
- mode = mode || this.mode || '';
-
- var ed, qt = this.I('quicktags'), H = this.I('edButtonHTML'), P = this.I('edButtonPreview'), ta = this.I(id);
-
- try { ed = tinyMCE.get(id); }
- catch(e) { ed = false; }
-
- if ( 'tinymce' == mode ) {
- if ( ed && ! ed.isHidden() )
- return false;
-
- setUserSetting( 'editor', 'tinymce' );
- this.mode = 'html';
-
- P.className = 'active';
- H.className = '';
- edCloseAllTags(); // :-(
- qt.style.display = 'none';
-
- ta.style.color = '#FFF';
- ta.value = this.wpautop(ta.value);
-
- try {
- if ( ed )
- ed.show();
- else
- tinyMCE.execCommand("mceAddControl", false, id);
- } catch(e) {}
-
- ta.style.color = '#000';
- } else {
- setUserSetting( 'editor', 'html' );
- ta.style.color = '#000';
- this.mode = 'tinymce';
- H.className = 'active';
- P.className = '';
-
- if ( ed && !ed.isHidden() ) {
- ta.style.height = ed.getContentAreaContainer().offsetHeight + 24 + 'px';
- ed.hide();
- }
-
- qt.style.display = 'block';
- }
- return false;
- },
-