webcit_before_automake is now the trunk
[citadel.git] / webcit / tiny_mce / themes / simple / editor_template_src.js
1 function TinyMCE_simple_getEditorTemplate() {\r
2         var template = new Array();\r
3 \r
4         template['html'] = '\\r
5 <table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}">\\r
6 <tr><td align="center">\\r
7 <span id="{$editor_id}">IFRAME</span>\\r
8 </td></tr>\\r
9 <tr><td class="mceToolbar" align="center" height="1">\\r
10 <a href="javascript:void(0);" onclick="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>\\r
11 <a href="javascript:void(0);" onclick="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\');">\\r
12 <a href="javascript:void(0);" onclick="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\');">\\r
13 <a href="javascript:void(0);" onclick="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\');">\\r
14 <img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">\\r
15 <a href="javascript:void(0);" onclick="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\');">\\r
16 <a href="javascript:void(0);" onclick="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\');">\\r
17 <img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">\\r
18 <a href="javascript:void(0);" onclick="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\');">\\r
19 <img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">\\r
20 <a href="javascript:void(0);" onclick="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\');">\\r
21 <a href="javascript:void(0);" onclick="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\');">\\r
22 </td></tr>\\r
23 </table>';\r
24 \r
25         template['delta_width'] = 0;\r
26         template['delta_height'] = -20;\r
27 \r
28         return template;\r
29 }\r
30 \r
31 function TinyMCE_simple_handleNodeChange(editor_id, node) {\r
32         // Reset old states\r
33         tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal');\r
34         tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal');\r
35         tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal');\r
36         tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal');\r
37         tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal');\r
38         tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal');\r
39 \r
40         // Handle elements\r
41         do {\r
42                 switch (node.nodeName.toLowerCase()) {\r
43                         case "b":\r
44                         case "strong":\r
45                                 tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected');\r
46                         break;\r
47 \r
48                         case "i":\r
49                         case "em":\r
50                                 tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected');\r
51                         break;\r
52 \r
53                         case "u":\r
54                                 tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected');\r
55                         break;\r
56 \r
57                         case "strike":\r
58                                 tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected');\r
59                         break;\r
60                         \r
61                         case "ul":\r
62                                 tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonSelected');\r
63                         break;\r
64 \r
65                         case "ol":\r
66                                 tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonSelected');\r
67                         break;\r
68                 }\r
69         } while ((node = node.parentNode) != null);\r
70 }\r