429831f082c5c1c81c1311cc9603a7c948cf1911
[Epoz.git] / epoz / epoz_core / epoz_script_widget.js.dtml
1 //
2 // Create HTML for Epoz-Editor
3 //
4 // Comment out the parts you don't want to be shown.
5 //
6
7 function CreateEpoz() {
8
9 var widget = '';
10 var spacer = '<img src="'+form_path+'epoz_button_space.gif" width="2" height="1">';
11
12 widget += '<div id="EpozToolbar">';
13
14 /*
15 The select-box for formats
16 */
17
18 widget += '<select id="formatblock" onchange="SelectFormat(this);" style="margin-bottom: 2px;">';
19 widget += '<option value="">'+EpozLang["Normal"]+'</option>';
20 widget += '<option value="<p>">'+EpozLang["Paragraph"]+'</option>';
21 widget += '<option value="<h1>">'+EpozLang["Heading1"]+'</option>';
22 widget += '<option value="<h2>">'+EpozLang["Heading2"]+'</option>';
23 widget += '<option value="<h3>">'+EpozLang["Heading3"]+'</option>';
24 widget += '<option value="<h4>">'+EpozLang["Heading4"]+'</option>';
25 widget += '<option value="<h5>">'+EpozLang["Heading5"]+'</option>';
26 widget += '<option value="<h6>">'+EpozLang["Heading6"]+'</option>';
27 widget += '<option value="<pre>">'+EpozLang["Formatted"]+'</option>';
28 widget += '</select>';
29 widget += '<br />';
30
31 /*
32 The font-face-buttons (bold, italic, underline)
33 */
34
35 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_bold.gif" width="23" height="22" alt="'+EpozLang["Bold"]+'" title="'+EpozLang["Bold"]+'" onClick="FormatText(\'bold\', \'\');" />';
36 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_italic.gif" width="23" height="22" alt="'+EpozLang["Italic"]+'" title="'+EpozLang["Italic"]+'" onClick="FormatText(\'italic\', \'\');" />';
37 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_underline.gif" width="23" height="22" alt="'+EpozLang["Underline"]+'" title="'+EpozLang["Underline"]+'" onClick="FormatText(\'underline\', \'\');" />';
38 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_strikethrough.gif" width="23" height="22" alt="'+EpozLang["Strikethrough"]+'" title="'+EpozLang["Strikethrough"]+'" onClick="FormatText(\'strikethrough\', \'\');" />';
39 widget += spacer;
40
41 /*
42 The sub-/superscript-buttons
43 */
44
45 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_subscript.gif" width="23" height="22" alt="'+EpozLang["Subscript"]+'" title="'+EpozLang["Subscript"]+'" onClick="FormatText(\'subscript\', \'\');" />';
46 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_superscript.gif" width="23" height="22" alt="'+EpozLang["Superscript"]+'" title="'+EpozLang["Superscript"]+'" onClick="FormatText(\'superscript\', \'\');" />';
47 widget += spacer;
48
49 /*
50 The remove-format-button
51 */
52
53 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_unformat.gif" width="23" height="22" alt="'+EpozLang["RemoveFormat"]+'" title="'+EpozLang["RemoveFormat"]+'" onClick="FormatText(\'removeformat\', \'\');" />';
54 widget += spacer;
55
56 /*
57 The color-selections (foreground, background)
58 */
59 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_textcolor.gif" width="23" height="22" alt="'+EpozLang["TextColor"]+'" title="'+EpozLang["TextColor"]+'" onClick="SetTextColor();" />';
60 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_bgcolor.gif" width="23" height="22" alt="'+EpozLang["BackColor"]+'" title="'+EpozLang["BackColor"]+'" onClick="SetBackColor();" />';
61 widget += spacer;
62
63 /*
64 Alignment-controls
65 */
66 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_left_just.gif" width="23" height="22" alt="'+EpozLang["AlignLeft"]+'" title="'+EpozLang["AlignLeft"]+'" onClick="FormatText(\'justifyleft\', \'\');" />';
67 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_centre.gif" width="23" height="22" alt="'+EpozLang["Center"]+'" title="'+EpozLang["Center"]+'" onClick="FormatText(\'justifycenter\', \'\');" />';
68 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_right_just.gif" width="23" height="22" alt="'+EpozLang["AlignRight"]+'" title="'+EpozLang["AlignRight"]+'" onClick="FormatText(\'justifyright\', \'\');" />';
69 widget += spacer;
70
71 /*
72 Lists and In/Outdent
73 */
74 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_numbered_list.gif" width="23" height="22" alt="'+EpozLang["OrderedList"]+'" title="'+EpozLang["OrderedList"]+'" onClick="FormatText(\'insertorderedlist\', \'\');" />';
75 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_list.gif" width="23" height="22" alt="'+EpozLang["UnorderedList"]+'" title="'+EpozLang["UnorderedList"]+'" onClick="FormatText(\'insertunorderedlist\', \'\');" />';
76 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_outdent.gif" width="23" height="22" alt="'+EpozLang["Outdent"]+'" title="'+EpozLang["Outdent"]+'" onClick="FormatText(\'outdent\', \'\');" />';
77 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_indent.gif" width="23" height="22" alt="'+EpozLang["Indent"]+'" title="'+EpozLang["Indent"]+'" onClick="FormatText(\'indent\', \'\');" />';
78 widget += spacer;
79
80 /*
81 Insert Link, Image, Rule, Table
82 */
83 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_hyperlink.gif" width="23" height="22" alt="'+EpozLang["InsertLink"]+'" title="'+EpozLang["InsertLink"]+'" onClick="CreateLink();" />';
84 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_anchor.gif" width="23" height="22" alt="'+EpozLang["InsertAnchor"]+'" title="'+EpozLang["InsertAnchor"]+'" onClick="CreateAnchor();" />';
85 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_image.gif" width="23" height="22" alt="'+EpozLang["InsertImage"]+'" title="'+EpozLang["InsertImage"]+'" onClick="CreateImage();" />';
86 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_hr.gif" width="23" height="22" alt="'+EpozLang["InsertRule"]+'" title="'+EpozLang["InsertRule"]+'" onClick="FormatText(\'inserthorizontalrule\', \'\');" />';
87 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_table.gif" width="23" height="22" alt="'+EpozLang["InsertTable"]+'" title="'+EpozLang["InsertTable"]+'" onClick="window.open(\''+form_path+'epoz_script_table.html\',\'EpozTable\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=220,height=220\');" />';
88
89 /*
90 The optional toolbox
91 */
92 if ((form_toolbox != null) && (form_toolbox != "")) {
93 widget += spacer;
94 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_tools.gif" width="23" height="22" alt="'+EpozLang["Toolbox"]+'" title="'+EpozLang["Toolbox"]+'"" onClick="window.open(\''+form_toolbox+'\',\'EpozToolbox\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=400\');" />';
95 }
96
97 widget += spacer;
98
99 /*
100 Undo & Redo
101 */
102
103 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_undo.gif" width="23" height="22" alt="'+EpozLang["Undo"]+'" title="'+EpozLang["Undo"]+'" onClick="FormatText(\'undo\', \'\');" />';
104 widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_redo.gif" width="23" height="22" alt="'+EpozLang["Redo"]+'" title="'+EpozLang["Redo"]+'" onClick="FormatText(\'redo\', \'\');" />';
105
106 /*
107 Don't remove!!! And better not touch...;)
108 */
109
110 widget += '\n<br />\n';
111 widget += '<iframe src="'+form_pageurl+'/epoz_blank_iframe.html?charset='+form_charset+'&css='+form_css+'&customcss='+form_customcss+'&pageurl='+form_pageurl+'" frameborder="0" id="' + Epoz + '" style="' + form_area_style + '" onload="InitDocument(this);"></iframe>';
112 widget += '</div>';
113
114 widget += '<textarea style="display: none; ' + form_area_style + '" id="' + form_name + '" name="' + form_name + '" value=""></textarea>';
115 widget += '<div style="margin: 0px;"><input id="EpozViewMode" style="margin: 0px; width: 10px; height: 10px;" type="checkbox" onclick="redirectAndSwitchViewMode(this);" />&nbsp;<span style="font-size: 10px;">' + EpozLang["HTML"] + '</span></div>';
116
117 document.writeln(widget);
118 }
119
120
121 // Create a default-textbox for browsers without Rich-Text-Features
122
123 function CreateTextarea() {
124 document.writeln('<textarea name="' + form_name + '" id="' + Epoz + '" style="' + form_area_style + '">'+form_data+'</textarea>');
125 }