Re: Re: TinyMCE
Stefan Seifert <[email protected]>
| Newsgroups | gmane.comp.cms.zms.devel |
|---|---|
| Organization | Atikon EDV & Marketing GmbH |
| Message-ID | <[email protected]> |
On Friday, 05. September 2008, axooh wrote: > It would be great, if you can post your patch. We are very interested. Took me much longer than expected to find some time to clean up the patch but finally, here it is. The patch is against a modified zms-2.10.5-15, so I don't know if it will apply cleanly to a stock ZMS. But it shouldn't be too much of a problem. It's just a bunch of new files and small modifications in two others. Also attached is the Epoz product itself, that we use. It is modified to make sure that full absolute URLs are created and to filter out some crap coming from Microsoft Office when copy&pasting. Hope this helps. If you have any problems, just ask. -- Stefan Seifert a t i k o n e d v & m a r k e t i n g gmbh webdesign grafikdesign softwareentwicklung __________________________________________________ a-4020 linz salzburger straße 205 tel: +43(0)732/611 266-37 fax: +43(0)732/611 266-20 mailto: [email protected] web: www.atikon.com firmenbuchnummer: 199780w firmenbuchgericht: landesgericht linz
zms-2.10-epoz.diff
(text/x-diff, 37.9 KB)
diff -Nur zms-noepoz/_objinputs.py zms-epoz/_objinputs.py
--- zms-noepoz/_objinputs.py 2008-10-17 17:54:24.000000000 +0200
+++ zms-epoz/_objinputs.py 2008-03-17 13:21:19.000000000 +0100
@@ -38,6 +38,10 @@
################################################################################
class ObjInputs:
+ epoz_widget_js = HTMLFile('plugins/rte/epoz/epoz_widget.js', globals())
+ epoz_link = HTMLFile('plugins/rte/epoz/epoz_link', globals())
+ epoz_image = HTMLFile('plugins/rte/epoz/epoz_image', globals())
+
# ----------------------------------------------------------------------------
# ObjInputs.getUrlInput:
#
diff -Nur zms-noepoz/plugins/rte/epoz/epoz_image.dtml zms-epoz/plugins/rte/epoz/epoz_image.dtml
--- zms-noepoz/plugins/rte/epoz/epoz_image.dtml 1970-01-01 01:00:00.000000000 +0100
+++ zms-epoz/plugins/rte/epoz/epoz_image.dtml 2008-03-31 16:22:03.000000000 +0200
@@ -0,0 +1,118 @@
+<dtml-var manage_page_header>
+<title><dtml-var "getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSLINKELEMENT',manage_lang)"></title>
+
+<dtml-call "REQUEST.set('l_thisObj',getLinkObj(REQUEST.get('elUrlValue','')))">
+<dtml-if "l_thisObj is _.None">
+ <dtml-call "REQUEST.set('l_thisObj',getSelf([PAGES,PAGEELEMENTS]))">
+</dtml-if>
+<dtml-call "REQUEST.set('l_thisPage',l_thisObj.getSelf(PAGES))">
+
+<script language="JavaScript">
+ function selectImage(id) {
+ var url = id;
+ parent.CreateImage(url);
+ }
+
+ function followHref(href, elUrlValue) {
+ href += '?lang=<dtml-var lang>&manage_lang=<dtml-var manage_lang>';
+ href += '&elUrlValue='+elUrlValue;
+ href += '&this_path=<dtml-var "REQUEST.form.get('this_path',getSelf(PAGES).absolute_url())">';
+ self.location.href = href;
+ }
+</script>
+</head>
+<body class="zmiNeutralColorMedium0" alink="#990000" vlink="#cc0000" link="#336699" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
+
+<dtml-with l_thisPage>
+
+<dtml-var "f_headline(_,_,headline=getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSGRAPHIC',manage_lang))"><br/>
+
+<form name="form1">
+
+<table cellspacing="0" cellpadding="8" border="0" width="100%" class="zmiNeutralColorLight0">
+<tr valign="top">
+ <td align="left">
+
+ <table cellspacing="0" cellpadding="1" border="0" width="100%">
+ <tr valign="middle" class="zmiNeutralColorMedium0">
+ <td align="left" class="form-small">
+ <dtml-in "breadcrumbs_obj_path()">
+ <dtml-let ob=sequence-item>
+ »
+ <a href="javascript:followHref('epoz_image','<dtml-var "getRefObjPath(ob)">')" class="zmi"
+ ><dtml-var "getTitlealt(REQUEST)"
+ ></a>
+ </dtml-let>
+ </dtml-in>
+ </td>
+ </tr>
+ </table>
+
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <a href="javascript:selectImage('<dtml-var "getHome().id">_<dtml-var id>');">
+ <img src="<dtml-var "display_icon(REQUEST)">" title="" alt="" style="border: none;">
+ <dtml-var l_title>
+ </a>
+
+ <dtml-call "REQUEST.set('res',[])">
+ <dtml-in "getChildNodes(REQUEST)">
+ <dtml-if "isPage() or meta_type == 'ZMSGraphic'">
+ <dtml-call "res.append(_['sequence-item'])">
+ </dtml-if>
+ </dtml-in>
+
+ <dtml-in res>
+ <dtml-let ob=sequence-item>
+
+ <dtml-if "isPage() or meta_type in ['ZMSFile','ZMSCustom']">
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <dtml-elif "meta_type in ['ZMSTextarea','ZMSGraphic']">
+ <dtml-call "REQUEST.set('l_title',search_quote(getObjAttrValue(getObjAttr('text'),REQUEST),80,''))">
+ <dtml-else>
+ <dtml-call "REQUEST.set('l_title',display_type(REQUEST))">
+ </dtml-if>
+
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_url" value="<dtml-var "getSelf(PAGES).absolute_url()">">
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_anchor" value="<dtml-if "isPageElement()">#<dtml-var id></dtml-if>">
+
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <dtml-if "isPage() and getChildNodes(REQUEST)">
+ <dtml-if sequence-end>
+ <td><a href="javascript:followHref('epoz_image','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_pl.gif" title="+" border="0"></a></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><a href="javascript:followHref('epoz_image','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_pl.gif" title="+" border="0"></a></td>
+ </dtml-if>
+ <dtml-else>
+ <dtml-if sequence-end>
+ <td><img src="<dtml-var MISC_ZMS>tv_last.gif" title="" border="0"></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><img src="<dtml-var MISC_ZMS>tv_item.gif" title="" border="0"></td>
+ </dtml-if>
+ </dtml-if>
+ <td colspan="3" title="<dtml-var "getLangStr('ACTION_SELECT',manage_lang)%display_type(REQUEST)">">
+ <dtml-if "meta_type == 'ZMSGraphic'"><a href="javascript:selectImage('<dtml-var "getImage(REQUEST).getHref(REQUEST)">');">
+ <img src="<dtml-var "display_icon(REQUEST)">" title="" alt="" style="border: none;" />
+ <img src="<dtml-var "getImage(REQUEST).getHref(REQUEST)">" alt="&dtml-l_title;" height="40" width="40" />
+ <dtml-var l_title>
+ </a>
+ <dtml-else>
+ <img src="<dtml-var "display_icon(REQUEST)">" title="" alt="" style="border: none;" />
+ <dtml-var l_title>
+ </dtml-if>
+ </td>
+ </tr>
+ </table>
+
+ </dtml-let>
+ </dtml-in>
+
+ </td>
+</tr>
+</table>
+</form>
+
+</dtml-with>
+
+</body>
+</html>
diff -Nur zms-noepoz/plugins/rte/epoz/epoz_link.dtml zms-epoz/plugins/rte/epoz/epoz_link.dtml
--- zms-noepoz/plugins/rte/epoz/epoz_link.dtml 1970-01-01 01:00:00.000000000 +0100
+++ zms-epoz/plugins/rte/epoz/epoz_link.dtml 2008-03-19 12:12:21.000000000 +0100
@@ -0,0 +1,132 @@
+<dtml-var manage_page_header>
+<dtml-call "REQUEST.set('preview', None)">
+<title><dtml-var "getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSLINKELEMENT',manage_lang)"></title>
+
+<dtml-call "REQUEST.set('l_thisObj',getLinkObj(REQUEST.get('elUrlValue','')))">
+<dtml-if "l_thisObj is _.None">
+ <dtml-call "REQUEST.set('l_thisObj',getSelf([PAGES,PAGEELEMENTS]))">
+</dtml-if>
+<dtml-call "REQUEST.set('l_thisPage',l_thisObj.getSelf(PAGES))">
+
+<script language="JavaScript">
+ function selectObject(id, fm) {
+ url = fm.elements[id+'_url'].value;
+ anchor = fm.elements[id+'_anchor'].value;
+ return url + anchor;
+ doc_offs = <dtml-var "_.len(getDocumentElement().getHref2IndexHtml(REQUEST))">;
+ this_path = '<dtml-var "REQUEST.form.get('this_path',getSelf(PAGES).getHref2IndexHtml(REQUEST))">';
+ this_path = this_path.substring(doc_offs, this_path.length);
+ url = url.substring(doc_offs,url.length);
+ i = 0;
+ while (i < this_path.length && i < url.length && this_path.substring(0, i) == url.substring(0, i)) {
+ i++;
+ }
+ i = this_path.substring(0,i).lastIndexOf('/');
+ this_path = this_path.substring(i,this_path.length);
+ url = url.substring(i,url.length);
+ c = '';
+ j = -1;
+ while (true) {
+ j = this_path.indexOf('/',j+1);
+ if (j < 0) break;
+ c += '../';
+ }
+ c = './' + c;
+ url = c + url.substring(1,url.length) + anchor;
+ return url;
+ }
+
+ function selectLink(id) {
+ var url = selectObject(id, document.forms[0]);
+ parent.CreateLink(url);
+ }
+
+ function followHref(href, elUrlValue) {
+ href += '?lang=<dtml-var lang>&manage_lang=<dtml-var manage_lang>';
+ href += '&elUrlValue='+elUrlValue;
+ href += '&this_path=<dtml-var "REQUEST.form.get('this_path',getSelf(PAGES).getHref2IndexHtml(REQUEST))">';
+ self.location.href = href;
+ }
+</script>
+</head>
+<body class="zmiNeutralColorMedium0" alink="#990000" vlink="#cc0000" link="#336699" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
+
+<dtml-with l_thisPage>
+
+<dtml-var "f_headline(_,_,headline=getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSLINKELEMENT',manage_lang))"><br/>
+<form name="form0">
+
+<table cellspacing="0" cellpadding="8" border="0" width="100%" class="zmiNeutralColorLight0">
+<tr valign="top">
+ <td align="left">
+
+ <table cellspacing="0" cellpadding="1" border="0" width="100%">
+ <tr valign="middle" class="zmiNeutralColorMedium0">
+ <td align="left" class="form-small">
+ <dtml-in "breadcrumbs_obj_path()">
+ <dtml-let ob=sequence-item>
+ »
+ <a href="javascript:followHref('epoz_link','<dtml-var "getRefObjPath(ob)">')" class="zmi"
+ ><dtml-var "getTitlealt(REQUEST)"
+ ></a>
+ </dtml-let>
+ </dtml-in>
+ </td>
+ </tr>
+ </table>
+
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <a href="javascript:selectLink('<dtml-var "getHome().id">_<dtml-var id>');"><img style="border: none;" src="<dtml-var "display_icon(REQUEST)">" title="" alt=""> <dtml-var l_title></a>
+
+ <dtml-call "REQUEST.set('res',[])">
+ <dtml-in "getChildNodes(REQUEST)">
+ <dtml-if "isPage() or isPageElement()">
+ <dtml-call "res.append(_['sequence-item'])">
+ </dtml-if>
+ </dtml-in>
+
+ <dtml-in res>
+ <dtml-let ob=sequence-item>
+
+ <dtml-if "isPage() or meta_type in ['ZMSFile','ZMSCustom']">
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <dtml-elif "meta_type in ['ZMSTextarea','ZMSGraphic']">
+ <dtml-call "REQUEST.set('l_title',search_quote(getObjAttrValue(getObjAttr('text'),REQUEST),80,''))">
+ <dtml-else>
+ <dtml-call "REQUEST.set('l_title',display_type(REQUEST))">
+ </dtml-if>
+
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_url" value="<dtml-var "getSelf(PAGES).getHref2IndexHtml(REQUEST)">">
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_anchor" value="<dtml-if "isPageElement()">#<dtml-var id></dtml-if>">
+
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <dtml-if "isPage() and getChildNodes(REQUEST)">
+ <dtml-if sequence-end>
+ <td><a href="javascript:followHref('epoz_link','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_pl.gif" title="+" border="0"></a></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><a href="javascript:followHref('epoz_link','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_pl.gif" title="+" border="0"></a></td>
+ </dtml-if>
+ <dtml-else>
+ <dtml-if sequence-end>
+ <td><img src="<dtml-var MISC_ZMS>tv_last.gif" title="" border="0"></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><img src="<dtml-var MISC_ZMS>tv_item.gif" title="" border="0"></td>
+ </dtml-if>
+ </dtml-if>
+ <td colspan="3" title="<dtml-var "getLangStr('ACTION_SELECT',manage_lang)%display_type(REQUEST)">"><a href="javascript:selectLink('<dtml-var "getHome().id">_<dtml-var id>');"><img src="<dtml-var "display_icon(REQUEST)">" title="" alt="" style="border: none;" /> <dtml-var l_title></td>
+ </tr>
+ </table>
+
+ </dtml-let>
+ </dtml-in>
+
+ </td>
+</tr>
+</table>
+</form>
+
+</dtml-with>
+
+</body>
+</html>
diff -Nur zms-noepoz/plugins/rte/epoz/epoz_toolbox.dtml zms-epoz/plugins/rte/epoz/epoz_toolbox.dtml
--- zms-noepoz/plugins/rte/epoz/epoz_toolbox.dtml 1970-01-01 01:00:00.000000000 +0100
+++ zms-epoz/plugins/rte/epoz/epoz_toolbox.dtml 2008-03-17 13:20:42.000000000 +0100
@@ -0,0 +1,237 @@
+<dtml-var manage_page_header>
+<title><dtml-var "getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSLINKELEMENT',manage_lang)"></title>
+
+<dtml-call "REQUEST.set('l_thisObj',getLinkObj(REQUEST.get('elUrlValue','')))">
+<dtml-if "l_thisObj is _.None">
+ <dtml-call "REQUEST.set('l_thisObj',getSelf([PAGES,PAGEELEMENTS]))">
+</dtml-if>
+<dtml-call "REQUEST.set('l_thisPage',l_thisObj.getSelf(PAGES))">
+
+<script language="JavaScript">
+ function selectObject(id, fm) {
+ url = fm.elements[id+'_url'].value;
+ anchor = fm.elements[id+'_anchor'].value;
+ doc_offs = <dtml-var "_.len(getDocumentElement().absolute_url())">;
+ this_path = '<dtml-var "REQUEST.form.get('this_path',getSelf(PAGES).absolute_url())">';
+ this_path = this_path.substring(doc_offs, this_path.length);
+ url = url.substring(doc_offs,url.length);
+ i = 0;
+ while (i < this_path.length && i < url.length && this_path.substring(0, i) == url.substring(0, i)) {
+ i++;
+ }
+ i = this_path.substring(0,i).lastIndexOf('/');
+ this_path = this_path.substring(i,this_path.length);
+ url = url.substring(i,url.length);
+ c = '';
+ j = -1;
+ while (true) {
+ j = this_path.indexOf('/',j+1);
+ if (j < 0) break;
+ c += '../';
+ }
+ c = './' + c;
+ url = c + url.substring(1,url.length) + anchor;
+ }
+
+ function selectLink(id) {
+ var url = selectObject(id, document.forms[0]);
+ window.opener.CreateLink(url);
+ window.close();
+ }
+
+ function selectImage(id) {
+// var url = selectObject(id, document.forms[1]);
+ var url = id;
+ window.opener.CreateImage(url);
+ window.close();
+ }
+
+ function followHref(href, elUrlValue) {
+ href += '?lang=<dtml-var lang>&manage_lang=<dtml-var manage_lang>';
+ href += '&elUrlValue='+elUrlValue;
+ href += '&this_path=<dtml-var "REQUEST.form.get('this_path',getSelf(PAGES).absolute_url())">';
+ self.location.href = href;
+ }
+</script>
+</head>
+<body class="zmiNeutralColorMedium0" alink="#990000" vlink="#cc0000" link="#336699" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
+
+<dtml-with l_thisPage>
+
+<dtml-var "f_headline(_,_,headline=getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSLINKELEMENT',manage_lang))"><br/>
+<form name="form0">
+
+<table cellspacing="0" cellpadding="8" border="0" width="100%" class="zmiNeutralColorLight0">
+<tr valign="top">
+ <td align="left">
+
+ <table cellspacing="0" cellpadding="1" border="0" width="100%">
+ <tr valign="middle" class="zmiNeutralColorMedium0">
+ <td align="left" class="form-small">
+ <dtml-in "breadcrumbs_obj_path()">
+ <dtml-let ob=sequence-item>
+ »
+ <a href="javascript:followHref('epoz_toolbox','<dtml-var "getRefObjPath(ob)">')" class="zmi"
+ ><dtml-var "getTitlealt(REQUEST)"
+ ></a>
+ </dtml-let>
+ </dtml-in>
+ </td>
+ </tr>
+ </table>
+
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td title="<dtml-var "getLangStr('ACTION_SELECT',manage_lang)%display_type(REQUEST)">"><input class="form-element" type="radio" onclick="selectLink('<dtml-var "getHome().id">_<dtml-var id>');"></td>
+ <td><img src="<dtml-var "display_icon(REQUEST)">" title="" border="0"></td>
+ <td class="form-small"><dtml-var l_title></td>
+ </tr>
+ </table>
+
+ <dtml-call "REQUEST.set('res',[])">
+ <dtml-in "getChildNodes(REQUEST)">
+ <dtml-if "isPage() or isPageElement()">
+ <dtml-call "res.append(_['sequence-item'])">
+ </dtml-if>
+ </dtml-in>
+
+ <dtml-in res>
+ <dtml-let ob=sequence-item>
+
+ <dtml-if "isPage() or meta_type in ['ZMSFile','ZMSCustom']">
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <dtml-elif "meta_type in ['ZMSTextarea','ZMSGraphic']">
+ <dtml-call "REQUEST.set('l_title',search_quote(getObjAttrValue(getObjAttr('text'),REQUEST),80,''))">
+ <dtml-else>
+ <dtml-call "REQUEST.set('l_title',display_type(REQUEST))">
+ </dtml-if>
+
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_url" value="<dtml-var "getSelf(PAGES).absolute_url()">">
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_anchor" value="<dtml-if "isPageElement()">#<dtml-var id></dtml-if>">
+
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <dtml-if "isPage() and getChildNodes(REQUEST)">
+ <dtml-if sequence-end>
+ <td><a href="javascript:followHref('epoz_toolbox','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_last_pl.gif" title="+" border="0"></a></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><a href="javascript:followHref('epoz_toolbox','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_item_pl.gif" title="+" border="0"></a></td>
+ </dtml-if>
+ <dtml-else>
+ <dtml-if sequence-end>
+ <td><img src="<dtml-var MISC_ZMS>tv_last.gif" title="" border="0"></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><img src="<dtml-var MISC_ZMS>tv_item.gif" title="" border="0"></td>
+ </dtml-if>
+ </dtml-if>
+ <td title="<dtml-var "getLangStr('ACTION_SELECT',manage_lang)%display_type(REQUEST)">"><input class="form-element" type="radio" onclick="selectLink('<dtml-var "getHome().id">_<dtml-var id>');"></td>
+ <td><img src="<dtml-var "display_icon(REQUEST)">" title="" border="0" /></td>
+ <td class="form-small"><dtml-var l_title></td>
+ </tr>
+ </table>
+
+ </dtml-let>
+ </dtml-in>
+
+ </td>
+</tr>
+
+<tr>
+ <td><input class="form-submit" type="submit" name="btn" value="<dtml-var "getLangStr('BTN_CANCEL',manage_lang)" html_quote>" onclick="self.parent.close();"></td>
+</tr>
+
+</table>
+</form>
+
+<dtml-var "f_headline(_,_,headline=getLangStr('ACTION_SELECT',manage_lang)%getLangStr('TYPE_ZMSGRAPHIC',manage_lang))"><br/>
+
+<form name="form1">
+
+<table cellspacing="0" cellpadding="8" border="0" width="100%" class="zmiNeutralColorLight0">
+<tr valign="top">
+ <td align="left">
+
+ <table cellspacing="0" cellpadding="1" border="0" width="100%">
+ <tr valign="middle" class="zmiNeutralColorMedium0">
+ <td align="left" class="form-small">
+ <dtml-in "breadcrumbs_obj_path()">
+ <dtml-let ob=sequence-item>
+ »
+ <a href="javascript:followHref('epoz_toolbox','<dtml-var "getRefObjPath(ob)">')" class="zmi"
+ ><dtml-var "getTitlealt(REQUEST)"
+ ></a>
+ </dtml-let>
+ </dtml-in>
+ </td>
+ </tr>
+ </table>
+
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td title="<dtml-var "getLangStr('ACTION_SELECT',manage_lang)%display_type(REQUEST)">"><input class="form-element" type="radio" onclick="selectImage('<dtml-var "getHome().id">_<dtml-var id>');"></td>
+ <td><img src="<dtml-var "display_icon(REQUEST)">" title="" border="0"></td>
+ <td class="form-small"><dtml-var l_title></td>
+ </tr>
+ </table>
+
+ <dtml-call "REQUEST.set('res',[])">
+ <dtml-in "getChildNodes(REQUEST)">
+ <dtml-if "isPage() or meta_type == 'ZMSGraphic'">
+ <dtml-call "res.append(_['sequence-item'])">
+ </dtml-if>
+ </dtml-in>
+
+ <dtml-in res>
+ <dtml-let ob=sequence-item>
+
+ <dtml-if "isPage() or meta_type in ['ZMSFile','ZMSCustom']">
+ <dtml-call "REQUEST.set('l_title',getTitlealt(REQUEST))">
+ <dtml-elif "meta_type in ['ZMSTextarea','ZMSGraphic']">
+ <dtml-call "REQUEST.set('l_title',search_quote(getObjAttrValue(getObjAttr('text'),REQUEST),80,''))">
+ <dtml-else>
+ <dtml-call "REQUEST.set('l_title',display_type(REQUEST))">
+ </dtml-if>
+
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_url" value="<dtml-var "getSelf(PAGES).absolute_url()">">
+ <input type="hidden" name="<dtml-var "getHome().id">_<dtml-var id>_anchor" value="<dtml-if "isPageElement()">#<dtml-var id></dtml-if>">
+
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <dtml-if "isPage() and getChildNodes(REQUEST)">
+ <dtml-if sequence-end>
+ <td><a href="javascript:followHref('epoz_toolbox','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_last_pl.gif" title="+" border="0"></a></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><a href="javascript:followHref('epoz_toolbox','<dtml-var "getRefObjPath(ob)">')"><img src="<dtml-var MISC_ZMS>tv_item_pl.gif" title="+" border="0"></a></td>
+ </dtml-if>
+ <dtml-else>
+ <dtml-if sequence-end>
+ <td><img src="<dtml-var MISC_ZMS>tv_last.gif" title="" border="0"></td>
+ <dtml-else>
+ <td style="background-image:url(<dtml-var MISC_ZMS>tv_line.gif);"><img src="<dtml-var MISC_ZMS>tv_item.gif" title="" border="0"></td>
+ </dtml-if>
+ </dtml-if>
+ <td title="<dtml-var "getLangStr('ACTION_SELECT',manage_lang)%display_type(REQUEST)">"><dtml-if "meta_type == 'ZMSGraphic'"><input class="form-element" type="radio" onclick="selectImage('<dtml-var "getImage(REQUEST).getHref(REQUEST)">');"></dtml-if></td>
+ <td><img src="<dtml-var "display_icon(REQUEST)">" title="" border="0" /></td>
+ <td class="form-small"><dtml-var l_title></td>
+ </tr>
+ </table>
+
+ </dtml-let>
+ </dtml-in>
+
+ </td>
+</tr>
+
+<tr>
+ <td><input class="form-submit" type="submit" name="btn" value="<dtml-var "getLangStr('BTN_CANCEL',manage_lang)" html_quote>" onclick="self.parent.close();"></td>
+</tr>
+
+</table>
+</form>
+
+</dtml-with>
+
+</body>
+</html>
diff -Nur zms-noepoz/plugins/rte/epoz/epoz_widget.js.dtml zms-epoz/plugins/rte/epoz/epoz_widget.js.dtml
--- zms-noepoz/plugins/rte/epoz/epoz_widget.js.dtml 1970-01-01 01:00:00.000000000 +0100
+++ zms-epoz/plugins/rte/epoz/epoz_widget.js.dtml 2008-03-17 23:06:45.000000000 +0100
@@ -0,0 +1,301 @@
+/*
+// 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.
+*/
+
+var curselection;
+function GetSelection() {
+ if (browser.isIE5up) {
+ curselection = EpozElement.contentWindow.document.selection;
+ } else {
+ curselection = EpozElement.contentWindow.window.getSelection();
+ }
+ return curselection;
+}
+
+function GetSelectedRange(selection) {
+ var range;
+ if (!selection)
+ selection = GetSelection();
+ if (browser.isIE5up) {
+ range = selection.createRange();
+ } else {
+ EpozElement.contentWindow.focus();
+ if (selection && selection.rangeCount) {
+ // alert(selection.anchorNode.childNodes[selection.anchorOffset]);
+ range = selection.getRangeAt(0);
+ } else {
+ range = EpozElement.contentWindow.document.createRange();
+ }
+ }
+ return range;
+}
+
+function GetSelectedTag(range) {
+ if(!range)
+ range = GetSelectedRange();
+ if (range.parentElement)
+ return range.parentElement();
+ if (
+ range.startContainer
+ && range.endContainer
+ && range.startContainer == range.endContainer
+ && range.startContainer.nodeType == Node.ELEMENT_NODE
+ && range.startContainer.childNodes[range.startOffset]
+ && range.startContainer.childNodes[range.startOffset].nodeType == Node.ELEMENT_NODE
+ && range.startContainer.childNodes[range.startOffset].tagName.toLowerCase() == 'img'
+ ) {
+ var image = range.startContainer.childNodes[range.startOffset];
+ //range.selectNode(image);
+ var tag = image;
+ } else {
+ var tag = range.startContainer == range.endContainer ? range.startContainer : range.commonAncestorContainer;
+ if (tag && tag.nodeType != Node.ELEMENT_NODE)
+ tag = tag.parentNode;
+ }
+ return tag;
+}
+
+function ListTags(e, range) {
+ var tag = GetSelectedTag(range);
+ var node = tag;
+ var taglist = '';
+ var level = 0;
+ while (node && node.nodeName != "BODY" && ! (node.nodeName == "DIV" && node.className == "ZMSTextarea") ) {
+ taglist = '<a href="javascript:SelectTag(' + level + ')">' + node.nodeName + '</a> ' + taglist;
+ node = node.parentNode;
+ level += 1;
+ }
+ document.getElementById('taglist').innerHTML = taglist;
+ document.getElementById('removetag').style.display = (taglist != '' ? 'inline' : 'none');
+ var properties = document.getElementById('properties');
+ if (taglist) {
+ var tagname = tag.tagName.toLowerCase();
+ switch ( tagname ) {
+ case 'img':
+ properties.innerHTML = 'Bild: <label>Alternativtext: <input onkeyup="Save(this, \'alt\')" value="' + tag.alt + '"></label> <label>Titel: <input onkeyup="Save(this, \'title\')" value="' + tag.title + '"></label>';
+ break;
+ case 'a':
+ properties.innerHTML = 'Link: <label>Ziel: <input size="70" onkeyup="Save(this, \'href\')" value="' + tag.href + '"></label><br/> <label>Titel: <input onkeyup="Save(this, \'title\')" value="' + tag.title + '"></label>';
+ break;
+ default:
+ properties.innerHTML = '';
+ }
+ properties.innerHTML += GetClassSelector(tagname, tag.className);
+ } else {
+ properties.innerHTML = ' ';
+ }
+}
+
+function GetClassSelector(tagname, classname) {
+ var ss = document.styleSheets;
+ var retval = ' <label>Stil: <select size="1" onchange="Save(this, \'className\')"><option value="">keine Klasse</option>';
+ var classes = Object();
+ for (i = 0; i < ss.length; i++) {
+ //if (ss[i].media.item(0) != 'screen')
+ // continue;
+ var rules = ss[i].cssRules || ss[i].rules;
+ for (j = 0; j < rules.length; j++) {
+ selector = rules[j].selectorText;
+ if (selector.match(/^#content\s+(\w*)\.(\w+)$/) && ! classes[RegExp.$2]) {
+ classes[RegExp.$2] = 1;
+ if (! RegExp.$1 || RegExp.$1.toLowerCase() == tagname)
+ retval += '<option value="' + RegExp.$2 + '"' + (RegExp.$2 == classname ? ' selected="selected"' : '') + '>' + RegExp.$2 + ' (' + selector + ')</option>';
+ }
+ }
+ }
+ return retval + '</select></label>';
+}
+
+function Save(element, attribute) {
+ var tag = GetSelectedTag();
+ tag[attribute] = element.value;
+ element.focus();
+}
+
+function SelectTag(level) {
+ var range = GetSelectedRange();
+ var tag = GetSelectedTag(range);
+ var taglist = '';
+ while (level > 0 && tag && tag.tagName != "BODY" && ! (tag.tagName == "DIV" && tag.className == "ZMSTextarea") ) {
+ tag = tag.parentNode;
+ level -= 1;
+ }
+ var selection = curselection;
+ selection.selectAllChildren(tag);
+ ListTags(undefined, GetSelectedRange(selection));
+}
+
+function RemoveTag() {
+ var tag = GetSelectedTag();
+ if(tag.firstChild) {
+ var content = EpozElement.contentWindow.document.createRange();
+ content.setStartBefore(tag.firstChild);
+ content.setEndAfter(tag.lastChild);
+ var fragment = content.extractContents();
+ tag.parentNode.replaceChild(fragment, tag);
+ } else {
+ curselection.removeAllRanges();
+ tag.parentNode.removeChild(tag);
+ }
+ ListTags();
+}
+
+function SpanText() {
+ var sel = curselection;
+ var range = GetSelectedRange(sel);
+ if (sel.removeAllRanges)
+ sel.removeAllRanges();
+ else if (sel.empty)
+ sel.empty();
+ if (range.surroundContents) {
+ var span = document.createElement('span');
+ range.surroundContents(span);
+ sel.selectAllChildren(span);
+ } else {
+ range.pasteHTML('<span>' + range.htmlText + '</span>');
+ range.select();
+ }
+ ListTags(undefined, GetSelectedRange(sel));
+}
+
+function CreateEpoz() {
+
+ var widget = '';
+ var spacer = '<img src="'+form_path+'epoz_button_space.gif" width="2" height="1">';
+
+ widget += '<div id="EpozToolbar">';
+
+/*
+ The select-box for formats
+*/
+
+ widget += '<select id="formatblock" onchange="SelectFormat(this);" style="margin-bottom: 2px;">';
+ widget += '<option value="">'+EpozLang["Normal"]+'</option>';
+ widget += '<option value="<p>">'+EpozLang["Paragraph"]+'</option>';
+ widget += '<option value="<h1>">'+EpozLang["Heading1"]+'</option>';
+ widget += '<option value="<h2>">'+EpozLang["Heading2"]+'</option>';
+ widget += '<option value="<h3>">'+EpozLang["Heading3"]+'</option>';
+ widget += '<option value="<h4>">'+EpozLang["Heading4"]+'</option>';
+ widget += '<option value="<h5>">'+EpozLang["Heading5"]+'</option>';
+ widget += '<option value="<h6>">'+EpozLang["Heading6"]+'</option>';
+ widget += '<option value="<pre>">'+EpozLang["Formatted"]+'</option>';
+ widget += '</select>';
+ widget += '<br />';
+
+/*
+ The font-face-buttons (bold, italic, underline, strikethrough)
+*/
+
+ widget += '<img class="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 class="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 class="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 class="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;
+
+/*
+ The sub-/superscript-buttons
+*/
+
+ widget += '<img class="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 class="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;
+
+/*
+ The remove-format-button
+*/
+
+ widget += '<img class="epoz_button_format" style="'+form_button_style+'" src="'+form_path+'epoz_button_format.gif" width=23" height="22" alt="'+EpozLang["Format"]+'" title="'+EpozLang["Format"]+'" onClick="SpanText();" />';
+ widget += '<img class="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;
+
+/*
+ The color-selections (foreground, background)
+*/
+ widget += '<img class="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 += spacer;
+
+/*
+ Alignment-controls
+*/
+ widget += '<img class="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 class="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 class="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;
+
+/*
+ Lists and In/Outdent
+*/
+ widget += '<img class="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 class="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 class="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 class="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;
+
+/*
+ Insert Link, Image, Rule, Table
+*/
+ widget += '<img class="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 class="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 class="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\');" />';
+
+/*
+ The optional toolbox
+*/
+ if ((form_toolbox != null) && (form_toolbox != "")) {
+ widget += spacer;
+ widget += '<img class="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\');" />';
+ }
+
+ widget += spacer;
+
+/*
+ Undo & Redo
+*/
+
+ widget += '<img class="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 class="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\', \'\');" />';
+
+/*
+ Don't remove!!! And better not touch...;)
+*/
+
+ widget += '\n<br />\n';
+ widget += '<iframe src="'+form_pageurl+'/epoz_blank_iframe.html?charset='+form_charset+'&css='+encodeURIComponent(form_css)+'&customcss='+encodeURIComponent(form_customcss)+'&pageurl='+encodeURIComponent(form_pageurl)+'" frameborder="0" id="' + Epoz + '" style="' + form_area_style + '" onload="InitDocument(this);"></iframe>';
+ widget += '</div>';
+
+ widget += '<textarea style="display: none; ' + form_area_style + '" id="' + form_name + '" name="' + form_name + '" value=""></textarea>';
+ var path = window.location.pathname.split('/');
+ widget += '<div style="margin: 0px;"><label><input id="EpozViewMode" style="margin: 0px; width: 10px; height: 10px;" type="checkbox" onclick="redirectAndSwitchViewMode(this);" /> ' + EpozLang["HTML"] + '</label> #' + path[path.length - 2] + ' <span id="taglist"></span> <a id="removetag" href="javascript:RemoveTag()" style="display: none;">Tag entfernen</a></div><div id="properties"> </div>';
+
+ document.writeln(widget);
+ var epozelement = document.getElementById(Epoz);
+ setTimeout(function () {
+ HookupListeners(epozelement)
+ }, 1000);
+}
+
+function HookupListeners(epozelement) {
+ try {
+ addListener(epozelement.contentWindow.document, "keypress", ListTags);
+ addListener(epozelement.contentWindow.document, "mouseup", ListTags);
+ addListener(epozelement.contentWindow.document, "click", ListTags);
+ } catch (e) {
+ setTimeout(function () { HookupListeners(epozelement) }, 1000);
+ }
+
+}
+
+
+// Create a default-textbox for browsers without Rich-Text-Features
+
+function CreateTextarea() {
+ document.writeln('<textarea name="' + form_name + '" id="' + Epoz + '" style="' + form_area_style + '">'+form_data+'</textarea>');
+}
diff -Nur zms-noepoz/plugins/rte/epoz/manage_form.dtml zms-epoz/plugins/rte/epoz/manage_form.dtml
--- zms-noepoz/plugins/rte/epoz/manage_form.dtml 1970-01-01 01:00:00.000000000 +0100
+++ zms-epoz/plugins/rte/epoz/manage_form.dtml 2008-05-08 11:36:50.000000000 +0200
@@ -0,0 +1,35 @@
+<dtml-comment>
+################################################################################
+### EPOZ XHTML WYSIWYG Editor
+################################################################################
+</dtml-comment>
+<dtml-call "REQUEST.set('editor_prefix', '')">
+<dtml-if "REQUEST.get('ZMS_INSERT',meta_type) in ['ZMSTextarea','ZMSGraphic']">
+ <script type="text/javascript">
+ <!--//
+ <dtml-call "REQUEST.set('editor_prefix', 'editor_')">
+ function zmiStandardOnSubmitEventHandler() {
+ var el = document.getElementById('zmiStandardEditor');
+ if ( el.style.display != 'none' && el.style.visibility != 'hidden') {
+ document.getElementById('&dtml-editor_prefix;&dtml-elName;').value = document.getElementById('&dtml-elName;').value;
+ }
+ }
+
+ <dtml-call "REQUEST.set('beforeSubmitBtnClick','zmiRichtextOnSubmitEventHandler(); ')">
+ function zmiRichtextOnSubmitEventHandler() {
+ var el = document.getElementById('zmiRichtextEditor');
+ if ( el.style.display != 'none' && el.style.visibility != 'hidden') {
+ SyncEpoz();
+ document.getElementById('&dtml-elName;').value = document.getElementById('&dtml-editor_prefix;&dtml-elName;').value;
+ }
+ }
+
+ //-->
+ </script>
+</dtml-if>
+
+<div style="position: relative; width: 100%;">
+ <dtml-var "Epoz(name='%s%s'%(editor_prefix,elName), data=data, toolbox=url_append_params('epoz_toolbox', {'lang':lang, 'manage_lang':manage_lang}), lang='en', style='width:100%; height:300px;', path='', widget='%s/epoz_widget_js'%(getDocumentElement().absolute_url()), css='%s/css/style.css'%(ZMS_COMMON), customcss='', charset='utf-8', pageurl='%s/'%getParentNode().absolute_url())">
+ <iframe style="position: absolute; left: 101%; top: 0; width: 270px; height: 250px;" src="epoz_link?lang=<dtml-var lang>&manage_lang=<dtml-var manage_lang>"></iframe>
+ <iframe style="position: absolute; left: 101%; top: 250px; width: 270px; height: 250px;" src="epoz_image?lang=<dtml-var lang>&manage_lang=<dtml-var manage_lang>"></iframe>
+</div>
\ No newline at end of file
diff -Nur zms-noepoz/zmstextarea.py zms-epoz/zmstextarea.py
--- zms-noepoz/zmstextarea.py 2008-10-17 17:54:35.000000000 +0200
+++ zms-epoz/zmstextarea.py 2008-03-17 13:20:09.000000000 +0100
@@ -142,6 +142,7 @@
# Management Interface.
# ---------------------
manage_main = HTMLFile('dtml/zmstextarea/manage_main', globals())
+ epoz_toolbox = HTMLFile('plugins/rte/epoz/epoz_toolbox', globals())
"""
Epoz.tar.bz2
(application/x-tbz, 46.8 KB) - not displayed