equal
deleted
inserted
replaced
141 if ( readCookie('enano_editor_mode') == 'tinymce' ) |
141 if ( readCookie('enano_editor_mode') == 'tinymce' ) |
142 { |
142 { |
143 // Current selection is TinyMCE - make span_wiki have the link and span_mce be plaintext |
143 // Current selection is TinyMCE - make span_wiki have the link and span_mce be plaintext |
144 var a = document.createElement('a'); |
144 var a = document.createElement('a'); |
145 a.href = '#'; |
145 a.href = '#'; |
146 a.onclick = function() { |
|
147 ajaxSetEditorPlain(); |
|
148 return false; |
|
149 }; |
|
150 a.appendChild(document.createTextNode($lang.get('editor_btn_wikitext'))); |
146 a.appendChild(document.createTextNode($lang.get('editor_btn_wikitext'))); |
151 span_wiki.appendChild(a); |
147 span_wiki.appendChild(a); |
152 toggler.appendChild(span_wiki); |
148 toggler.appendChild(span_wiki); |
153 toggler.appendChild(document.createTextNode(' | ')); |
149 toggler.appendChild(document.createTextNode(' | ')); |
154 span_mce.appendChild(document.createTextNode($lang.get('editor_btn_graphical'))); |
150 span_mce.appendChild(document.createTextNode($lang.get('editor_btn_graphical'))); |
160 span_wiki.appendChild(document.createTextNode($lang.get('editor_btn_wikitext'))); |
156 span_wiki.appendChild(document.createTextNode($lang.get('editor_btn_wikitext'))); |
161 toggler.appendChild(span_wiki); |
157 toggler.appendChild(span_wiki); |
162 toggler.appendChild(document.createTextNode(' | ')); |
158 toggler.appendChild(document.createTextNode(' | ')); |
163 var a = document.createElement('a'); |
159 var a = document.createElement('a'); |
164 a.href = '#'; |
160 a.href = '#'; |
165 a.onclick = function() { |
|
166 ajaxSetEditorMCE(); |
|
167 return false; |
|
168 }; |
|
169 a.appendChild(document.createTextNode($lang.get('editor_btn_graphical'))); |
161 a.appendChild(document.createTextNode($lang.get('editor_btn_graphical'))); |
170 span_mce.appendChild(a); |
162 span_mce.appendChild(a); |
171 toggler.appendChild(span_mce); |
163 toggler.appendChild(span_mce); |
172 } |
164 } |
173 } |
165 } |
488 } |
480 } |
489 $dynano('ajaxEditArea').object.focus(); |
481 $dynano('ajaxEditArea').object.focus(); |
490 $dynano('ajaxEditArea').object._edTimestamp = timestamp; |
482 $dynano('ajaxEditArea').object._edTimestamp = timestamp; |
491 $dynano('ajaxEditArea').setContent(content); |
483 $dynano('ajaxEditArea').setContent(content); |
492 |
484 |
|
485 if ( allow_wysiwyg ) |
|
486 { |
|
487 if ( readCookie('enano_editor_mode') == 'tinymce' ) |
|
488 { |
|
489 var a = document.getElementById('enano_edit_btn_pt').getElementsByTagName('a')[0]; |
|
490 a.onclick = function() { |
|
491 ajaxSetEditorPlain(); |
|
492 return false; |
|
493 }; |
|
494 } |
|
495 else |
|
496 { |
|
497 var a = document.getElementById('enano_edit_btn_mce').getElementsByTagName('a')[0]; |
|
498 a.onclick = function() { |
|
499 ajaxSetEditorMCE(); |
|
500 return false; |
|
501 }; |
|
502 } |
|
503 } |
|
504 |
493 // Autosave every 5 minutes (m * s * ms) |
505 // Autosave every 5 minutes (m * s * ms) |
494 setInterval('ajaxPerformAutosave();', ( 5 * 60 * 1000 )); |
506 setInterval('ajaxPerformAutosave();', ( 5 * 60 * 1000 )); |
495 } |
507 } |
496 |
508 |
497 function ajaxEditorSave(is_draft) |
509 function ajaxEditorSave(is_draft) |