* Removed the Kevin Roth rich text editor and replaced it with TinyMCE.
[citadel.git] / webcit / tiny_mce / themes / simple / editor_template_src.js
1 function TinyMCE_simple_getEditorTemplate() {
2         var template = new Array();
3
4         template['html'] = '\
5 <table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">\
6 <tr><td align="center">\
7 <span id="{$editor_id}">IFRAME</span>\
8 </td></tr>\
9 <tr><td class="mceToolbar" align="center" height="1">\
10 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Bold\');" onmousedown="return false;"><img id="{$editor_id}_bold" src="{$themeurl}/images/{$lang_bold_img}" title="{$lang_bold_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');"></a>\
11 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Italic\');" onmousedown="return false;"><img id="{$editor_id}_italic" src="{$themeurl}/images/{$lang_italic_img}" title="{$lang_italic_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
12 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Underline\');" onmousedown="return false;"><img id="{$editor_id}_underline" src="{$themeurl}/images/{$lang_underline_img}" title="{$lang_underline_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
13 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Strikethrough\');" onmousedown="return false;"><img id="{$editor_id}_strikethrough" src="{$themeurl}/images/strikethrough.gif" title="{$lang_striketrough_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
14 <img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">\
15 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\');" onmousedown="return false;"><img src="{$themeurl}/images/undo.gif" title="{$lang_undo_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
16 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Redo\');" onmousedown="return false;"><img src="{$themeurl}/images/redo.gif" title="{$lang_redo_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
17 <img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">\
18 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceCleanup\');" onmousedown="return false;"><img src="{$themeurl}/images/cleanup.gif" title="{$lang_cleanup_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
19 <img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">\
20 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertUnorderedList\');" onmousedown="return false;"><img id="{$editor_id}_bullist" src="{$themeurl}/images/bullist.gif" title="{$lang_bullist_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
21 <a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertOrderedList\');" onmousedown="return false;"><img id="{$editor_id}_numlist" src="{$themeurl}/images/numlist.gif" title="{$lang_numlist_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');">\
22 </td></tr>\
23 </table>';
24
25         template['delta_width'] = 0;
26         template['delta_height'] = -20;
27
28         return template;
29 }
30
31 function TinyMCE_simple_handleNodeChange(editor_id, node) {
32         // Reset old states
33         tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal');
34         tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal');
35         tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal');
36         tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal');
37         tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal');
38         tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal');
39
40         // Handle elements
41         do {
42                 switch (node.nodeName.toLowerCase()) {
43                         case "b":
44                         case "strong":
45                                 tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected');
46                         break;
47
48                         case "i":
49                         case "em":
50                                 tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected');
51                         break;
52
53                         case "u":
54                                 tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected');
55                         break;
56
57                         case "strike":
58                                 tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected');
59                         break;
60                         
61                         case "ul":
62                                 tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonSelected');
63                         break;
64
65                         case "ol":
66                                 tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonSelected');
67                         break;
68                 }
69         } while ((node = node.parentNode));
70 }