Epoz/epoz/epoz_core epoz_script_widget.js.dtml,1.2,1.3 epoz_iframe_trigger.js.dtml,1.1,1.2 epoz_script_main.js.dtml,1.3,1.4 epoz_redirect.js.dtml,1.1,1.2
Maik Jablonski <[email protected]>
| Newsgroups | gmane.comp.web.zope.epoz |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/epoz/Epoz/epoz/epoz_core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26172/epoz/epoz_core
Modified Files:
epoz_script_widget.js.dtml epoz_iframe_trigger.js.dtml
epoz_script_main.js.dtml epoz_redirect.js.dtml
Log Message:
added CSS-IDs to all buttons so disabling single buttons gets much more easier
Index: epoz_script_main.js.dtml
===================================================================
RCS file: /cvsroot/epoz/Epoz/epoz/epoz_core/epoz_script_main.js.dtml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** epoz_script_main.js.dtml 23 May 2005 20:47:34 -0000 1.3
--- epoz_script_main.js.dtml 24 May 2005 19:06:38 -0000 1.4
***************
*** 30,39 ****
function GetHTML(source_mode) {
! if (source_mode == null)
source_mode = document.getElementById('EpozViewMode').checked;
if (source_mode) {
return EpozTextArea.value;
! }
! else {
try {
return EpozElement.contentWindow.document.body.innerHTML;
--- 30,40 ----
function GetHTML(source_mode) {
! if (source_mode == null) {
source_mode = document.getElementById('EpozViewMode').checked;
+ }
+
if (source_mode) {
return EpozTextArea.value;
! } else {
try {
return EpozElement.contentWindow.document.body.innerHTML;
Index: epoz_iframe_trigger.js.dtml
===================================================================
RCS file: /cvsroot/epoz/Epoz/epoz/epoz_core/epoz_iframe_trigger.js.dtml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** epoz_iframe_trigger.js.dtml 23 May 2005 20:47:34 -0000 1.1
--- epoz_iframe_trigger.js.dtml 24 May 2005 19:06:38 -0000 1.2
***************
*** 6,27 ****
function raiseEpozRedirect() {
! docid = document.id;
! if (!docid) return; // single mode
! docid = document.id.slice(DocPrefixLength);
! frameId = IFramePrefix + docid;
! iframe = window.parent.document.getElementById(frameId);
! if (iframe)
! raiseEvent(iframe, "click");
}
function raiseEvent(ob, eventName) {
if (browser.isIE55 || browser.isIE6up) {
! eventName = "on" + eventName;
! ob.fireEvent(eventName);
}
else if (browser.isGecko) {
! event = document.createEvent("MouseEvents");
! event.initEvent(eventName, true, true);
! ob.dispatchEvent(event);
}
--- 6,30 ----
function raiseEpozRedirect() {
! docid = document.id;
! if (!docid) {
! return; // single mode
! }
! docid = document.id.slice(DocPrefixLength);
! frameId = IFramePrefix + docid;
! iframe = window.parent.document.getElementById(frameId);
! if (iframe) {
! raiseEvent(iframe, "click");
! }
}
function raiseEvent(ob, eventName) {
if (browser.isIE55 || browser.isIE6up) {
! eventName = "on" + eventName;
! ob.fireEvent(eventName);
}
else if (browser.isGecko) {
! event = document.createEvent("MouseEvents");
! event.initEvent(eventName, true, true);
! ob.dispatchEvent(event);
}
***************
*** 30,37 ****
function addMouseDownListener() {
if (browser.isIE55 || browser.isIE6up) {
! document.attachEvent("onmousedown", raiseEpozRedirect);
}
else if (browser.isGecko) {
! document.addEventListener("mousedown", raiseEpozRedirect, false);
}
}
--- 33,40 ----
function addMouseDownListener() {
if (browser.isIE55 || browser.isIE6up) {
! document.attachEvent("onmousedown", raiseEpozRedirect);
}
else if (browser.isGecko) {
! document.addEventListener("mousedown", raiseEpozRedirect, false);
}
}
Index: epoz_redirect.js.dtml
===================================================================
RCS file: /cvsroot/epoz/Epoz/epoz/epoz_core/epoz_redirect.js.dtml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** epoz_redirect.js.dtml 23 May 2005 20:47:34 -0000 1.1
--- epoz_redirect.js.dtml 24 May 2005 19:06:38 -0000 1.2
***************
*** 1,4 ****
// This script allow to use several Epoz WYSIWYG fields.
! // Copyright (C) 2005 Benoît PIN <mailto:[email protected]>
var IFramePrefix = "Iframe_";
--- 1,4 ----
// This script allow to use several Epoz WYSIWYG fields.
! // Copyright (C) 2005 Benoit PIN <mailto:[email protected]>
var IFramePrefix = "Iframe_";
***************
*** 14,19 ****
function redirectEpoz(iframe) {
if(EpozElement) {
! if (EpozElement == iframe)
return;
changeBorderStyle(EpozElement, "dashed");
unwrapEpozVariables();
--- 14,20 ----
function redirectEpoz(iframe) {
if(EpozElement) {
! if (EpozElement == iframe) {
return;
+ }
changeBorderStyle(EpozElement, "dashed");
unwrapEpozVariables();
***************
*** 43,48 ****
function unwrapEpozVariables() {
! if (!EpozElement) // no redirection happens yet.
return;
fieldId = EpozElement.contentWindow.document.id.slice(DocPrefixLength);
--- 44,52 ----
function unwrapEpozVariables() {
! if (!EpozElement) {
! // no redirection happens yet.
return;
+ }
+
fieldId = EpozElement.contentWindow.document.id.slice(DocPrefixLength);
***************
*** 232,238 ****
while (pn != document) {
! if (pn.nodeName == 'FORM')
break;
! else {
pn = pn.parentNode;
}
--- 236,242 ----
while (pn != document) {
! if (pn.nodeName == 'FORM') {
break;
! } else {
pn = pn.parentNode;
}
Index: epoz_script_widget.js.dtml
===================================================================
RCS file: /cvsroot/epoz/Epoz/epoz/epoz_core/epoz_script_widget.js.dtml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** epoz_script_widget.js.dtml 23 May 2005 20:47:34 -0000 1.2
--- epoz_script_widget.js.dtml 24 May 2005 19:06:38 -0000 1.3
***************
*** 2,6 ****
// Create HTML for Epoz-Editor
//
! // Comment out the parts you don't want to be shown.
//
--- 2,12 ----
// Create HTML for Epoz-Editor
//
! // Use CSS #button_id {display:none;} to disable buttons
! // you don't want to be shown!
! //
! // OR
! //
! // Comment out the parts you don't want to be shown in a customized
! // template.
//
***************
*** 30,40 ****
/*
! The font-face-buttons (bold, italic, underline)
*/
! 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\', \'\');" />';
! 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\', \'\');" />';
! 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\', \'\');" />';
! 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\', \'\');" />';
widget += spacer;
--- 36,46 ----
/*
! The font-face-buttons (bold, italic, underline, strikethrough)
*/
! widget += '<img id="epoz_button_bold" style="'+form_button_style+'" src="'+form_path+'epoz_button_bold.gif" width="23" height="22" alt="'+EpozLang["Bold"]+'" title="'+EpozLang["Bold"]+'" onClick="FormatText(\'bold\', \'\');" />';
! widget += '<img id="epoz_button_italic" style="'+form_button_style+'" src="'+form_path+'epoz_button_italic.gif" width="23" height="22" alt="'+EpozLang["Italic"]+'" title="'+EpozLang["Italic"]+'" onClick="FormatText(\'italic\', \'\');" />';
! widget += '<img id="epoz_button_underline" style="'+form_button_style+'" src="'+form_path+'epoz_button_underline.gif" width="23" height="22" alt="'+EpozLang["Underline"]+'" title="'+EpozLang["Underline"]+'" onClick="FormatText(\'underline\', \'\');" />';
! widget += '<img id="epoz_button_strikethrough" style="'+form_button_style+'" src="'+form_path+'epoz_button_strikethrough.gif" width="23" height="22" alt="'+EpozLang["Strikethrough"]+'" title="'+EpozLang["Strikethrough"]+'" onClick="FormatText(\'strikethrough\', \'\');" />';
widget += spacer;
***************
*** 43,48 ****
*/
! 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\', \'\');" />';
! 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\', \'\');" />';
widget += spacer;
--- 49,54 ----
*/
! widget += '<img id="epoz_button_subscript" style="'+form_button_style+'" src="'+form_path+'epoz_button_subscript.gif" width="23" height="22" alt="'+EpozLang["Subscript"]+'" title="'+EpozLang["Subscript"]+'" onClick="FormatText(\'subscript\', \'\');" />';
! widget += '<img id="epoz_button_superscript" style="'+form_button_style+'" src="'+form_path+'epoz_button_superscript.gif" width="23" height="22" alt="'+EpozLang["Superscript"]+'" title="'+EpozLang["Superscript"]+'" onClick="FormatText(\'superscript\', \'\');" />';
widget += spacer;
***************
*** 51,55 ****
*/
! 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\', \'\');" />';
widget += spacer;
--- 57,61 ----
*/
! widget += '<img id="epoz_button_unformat" style="'+form_button_style+'" src="'+form_path+'epoz_button_unformat.gif" width="23" height="22" alt="'+EpozLang["RemoveFormat"]+'" title="'+EpozLang["RemoveFormat"]+'" onClick="FormatText(\'removeformat\', \'\');" />';
widget += spacer;
***************
*** 57,62 ****
The color-selections (foreground, background)
*/
! 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();" />';
! 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();" />';
widget += spacer;
--- 63,68 ----
The color-selections (foreground, background)
*/
! widget += '<img id="epoz_button_textcolor" style="'+form_button_style+'" src="'+form_path+'epoz_button_textcolor.gif" width="23" height="22" alt="'+EpozLang["TextColor"]+'" title="'+EpozLang["TextColor"]+'" onClick="SetTextColor();" />';
! widget += '<img id="epoz_button_bgcolor" style="'+form_button_style+'" src="'+form_path+'epoz_button_bgcolor.gif" width="23" height="22" alt="'+EpozLang["BackColor"]+'" title="'+EpozLang["BackColor"]+'" onClick="SetBackColor();" />';
widget += spacer;
***************
*** 64,70 ****
Alignment-controls
*/
! 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\', \'\');" />';
! 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\', \'\');" />';
! 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\', \'\');" />';
widget += spacer;
--- 70,76 ----
Alignment-controls
*/
! widget += '<img id="epoz_button_left_just" 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\', \'\');" />';
! widget += '<img id="epoz_button_centre" style="'+form_button_style+'" src="'+form_path+'epoz_button_centre.gif" width="23" height="22" alt="'+EpozLang["Center"]+'" title="'+EpozLang["Center"]+'" onClick="FormatText(\'justifycenter\', \'\');" />';
! widget += '<img id="epoz_button_right_just" 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\', \'\');" />';
widget += spacer;
***************
*** 72,79 ****
Lists and In/Outdent
*/
! 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\', \'\');" />';
! 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\', \'\');" />';
! 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\', \'\');" />';
! 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\', \'\');" />';
widget += spacer;
--- 78,85 ----
Lists and In/Outdent
*/
! widget += '<img id="epoz_button_numbered_list" 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\', \'\');" />';
! widget += '<img id="epoz_button_list" style="'+form_button_style+'" src="'+form_path+'epoz_button_list.gif" width="23" height="22" alt="'+EpozLang["UnorderedList"]+'" title="'+EpozLang["UnorderedList"]+'" onClick="FormatText(\'insertunorderedlist\', \'\');" />';
! widget += '<img id="epoz_button_outdent" style="'+form_button_style+'" src="'+form_path+'epoz_button_outdent.gif" width="23" height="22" alt="'+EpozLang["Outdent"]+'" title="'+EpozLang["Outdent"]+'" onClick="FormatText(\'outdent\', \'\');" />';
! widget += '<img id="epoz_button_indent" style="'+form_button_style+'" src="'+form_path+'epoz_button_indent.gif" width="23" height="22" alt="'+EpozLang["Indent"]+'" title="'+EpozLang["Indent"]+'" onClick="FormatText(\'indent\', \'\');" />';
widget += spacer;
***************
*** 81,89 ****
Insert Link, Image, Rule, Table
*/
! 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();" />';
! 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();" />';
! 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();" />';
! 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\', \'\');" />';
! 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\');" />';
/*
--- 87,95 ----
Insert Link, Image, Rule, Table
*/
! widget += '<img id="epoz_button_hyperlink" style="'+form_button_style+'" src="'+form_path+'epoz_button_hyperlink.gif" width="23" height="22" alt="'+EpozLang["InsertLink"]+'" title="'+EpozLang["InsertLink"]+'" onClick="CreateLink();" />';
! widget += '<img id="epoz_button_anchor" style="'+form_button_style+'" src="'+form_path+'epoz_button_anchor.gif" width="23" height="22" alt="'+EpozLang["InsertAnchor"]+'" title="'+EpozLang["InsertAnchor"]+'" onClick="CreateAnchor();" />';
! widget += '<img id="epoz_button_image" style="'+form_button_style+'" src="'+form_path+'epoz_button_image.gif" width="23" height="22" alt="'+EpozLang["InsertImage"]+'" title="'+EpozLang["InsertImage"]+'" onClick="CreateImage();" />';
! widget += '<img id="epoz_button_hr" style="'+form_button_style+'" src="'+form_path+'epoz_button_hr.gif" width="23" height="22" alt="'+EpozLang["InsertRule"]+'" title="'+EpozLang["InsertRule"]+'" onClick="FormatText(\'inserthorizontalrule\', \'\');" />';
! widget += '<img id="epoz_button_table" 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\');" />';
/*
***************
*** 92,96 ****
if ((form_toolbox != null) && (form_toolbox != "")) {
widget += spacer;
! 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\');" />';
}
--- 98,102 ----
if ((form_toolbox != null) && (form_toolbox != "")) {
widget += spacer;
! widget += '<img id="epoz_button_tools" 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\');" />';
}
***************
*** 101,106 ****
*/
! 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\', \'\');" />';
! 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\', \'\');" />';
/*
--- 107,112 ----
*/
! widget += '<img id="epoz_button_undo" style="'+form_button_style+'" src="'+form_path+'epoz_button_undo.gif" width="23" height="22" alt="'+EpozLang["Undo"]+'" title="'+EpozLang["Undo"]+'" onClick="FormatText(\'undo\', \'\');" />';
! widget += '<img id="epoz_button_redo" style="'+form_button_style+'" src="'+form_path+'epoz_button_redo.gif" width="23" height="22" alt="'+EpozLang["Redo"]+'" title="'+EpozLang["Redo"]+'" onClick="FormatText(\'redo\', \'\');" />';
/*
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005