From kupu-checkins at codespeak.net Sat May 3 13:03:34 2008 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Sat, 3 May 2008 13:03:34 +0200 (CEST) Subject: [kupu-checkins] You have the right too look good and feel great. GUCCI DEALS everyone can afford. Message-ID: <20080503040221.4477.qmail@shampooness.viewpoint.volia.net> Ladies and Gentlemen, Get Ready for.. Thought I would let you know about the Fashion Footwear SPRING Sale! Men and Women Designer Shoes, Heels, Sandals and Boots, All Half-OFF, Buy Direct, Forget Department Store Prices, Get Exclusive 2008 D&G, Gucci, Versace, Prada, Chanel, Christian Dior, Dsquared, Uggs and More! FREE International Shipping on all Orders! http://jcs-etds.com/offer/ From hannosch at codespeak.net Sun May 4 14:42:57 2008 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Sun, 4 May 2008 14:42:57 +0200 (CEST) Subject: [kupu-checkins] r54400 - kupu/trunk/kupu Message-ID: <20080504124257.9EFEB2A8083@codespeak.net> Author: hannosch Date: Sun May 4 14:42:54 2008 New Revision: 54400 Modified: kupu/trunk/kupu/__init__.py Log: Removed comment, I think I've seen kupu being used with Plone already ;) Modified: kupu/trunk/kupu/__init__.py ============================================================================== --- kupu/trunk/kupu/__init__.py (original) +++ kupu/trunk/kupu/__init__.py Sun May 4 14:42:54 2008 @@ -39,7 +39,7 @@ except ImportError: have_cmf = 0 -# test for Plone, removed because Plone isn't supported yet +# test for Plone try: import Products.CMFPlone have_plone = 1 From duncan at codespeak.net Fri May 16 13:38:26 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 16 May 2008 13:38:26 +0200 (CEST) Subject: [kupu-checkins] r54789 - in kupu/trunk/kupu: common plone Message-ID: <20080516113826.780FE1684F6@codespeak.net> Author: duncan Date: Fri May 16 13:38:24 2008 New Revision: 54789 Modified: kupu/trunk/kupu/common/kupu_kjax.js kupu/trunk/kupu/plone/html2captioned.py Log: Make the link checker handle the resolveuid fallback (so it doesn't flag things as bad links if they have special handling). Fix kjax handling multiple requests. Modified: kupu/trunk/kupu/common/kupu_kjax.js ============================================================================== --- kupu/trunk/kupu/common/kupu_kjax.js (original) +++ kupu/trunk/kupu/common/kupu_kjax.js Fri May 16 13:38:24 2008 @@ -9,7 +9,7 @@ *****************************************************************************/ /* Javascript to aid migration page. */ -function KJax() {}; +function KJax() { this.request_queue = [];}; (function(p){ p._loadXML = function(uri, callback, body, reload, extra) { function _sarissaCallback() { @@ -34,15 +34,26 @@ dom = Sarissa.getDomDocument(); dom.loadXML(xmlhttp.responseText); } + if (this.request_queue) { + /* Kick off the next chained request before trying + * to handle the result of the last one. + */ + this._loadXML.apply(this, this.request_queue.splice(0,1)); + } callback.apply(self, [dom, uri, extra]); }; }; var self = this; + /* Make sure our requests are single-threaded. */ + if (this.xmlhttp) { + this.request_queue.push([uri, callback, body, reload, extra]); + } /* load the XML from a uri calls callback with one arg (the XML DOM) when done the (optional) body arg should contain the body for the request */ var xmlhttp = new XMLHttpRequest(); + this.xmlhttp = xmlhttp; var method = body?'POST':'GET'; // be sure that body is null and not an empty string or // something @@ -58,9 +69,9 @@ xmlhttp.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); }; xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); - this.xmlhttp = xmlhttp; xmlhttp.send(body); } catch(e) { + this.xmlhttp = null; if (e && e.name && e.message) { // Microsoft e = e.name + ': ' + e.message; } @@ -118,7 +129,6 @@ }; }; p.newRequest = function(uri) { - if (this.xmlhttp) this.xmlhttp.abort(); this._loadXML(uri, this._xmlcallback); }; p.clearLog = function() { Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Fri May 16 13:38:24 2008 @@ -551,6 +551,13 @@ if obj is not None: newurl = obj.absolute_url() return uid, newurl, tail + # If the uid doesn't exist then we can try the fallback + # script. Even if the fallback works though we'll assume + # an external link for simplicity. + hook = getattr(self.tool, 'kupu_resolveuid_hook', None) + if hook: + target = hook(uid) + return None, target, '' return None, None, None def classifyLink(self, url, base, first=True): @@ -577,6 +584,8 @@ if 'resolveuid/' in absurl: UID, newurl, ntail = self.resolveToPath(absurl) if UID is None: + if newurl: + return 'external', None, newurl, ntail return 'bad', None, url, '' absurl = newurl tail = ntail + tail From duncan at codespeak.net Fri May 16 16:55:53 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 16 May 2008 16:55:53 +0200 (CEST) Subject: [kupu-checkins] r54791 - in kupu/trunk/kupu: doc plone Message-ID: <20080516145553.D27BE398003@codespeak.net> Author: duncan Date: Fri May 16 16:55:50 2008 New Revision: 54791 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/plonedrawers.py Log: Fix plone ticket 8129, error on plonedrawers.py when installing Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri May 16 16:55:50 2008 @@ -9,6 +9,7 @@ * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) * 7990 Internal link drawer broken for editors * 8003 Fixed Kupu translation msgids containing html. + * 8129 "TypeError: string indices must be integers" error on plonedrawers.py when installing - 1.4.9 Modified: kupu/trunk/kupu/plone/plonedrawers.py ============================================================================== --- kupu/trunk/kupu/plone/plonedrawers.py (original) +++ kupu/trunk/kupu/plone/plonedrawers.py Fri May 16 16:55:50 2008 @@ -491,9 +491,12 @@ preview = None previewsize = (0,0) for k in sizes: - if previewsize < sizes[k] <= (128,128): - preview = k - previewsize = sizes[k] + try: + if previewsize < sizes[k] <= (128,128): + preview = k + previewsize = sizes[k] + except TypeError: # Fails on Plone 2.1 + return field.getName() if not preview: smallest = min(sizes.values()) for k in sizes: From kupu-checkins at codespeak.net Sun May 18 21:21:02 2008 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Sun, 18 May 2008 21:21:02 +0200 (CEST) Subject: [kupu-checkins] Dear kupu-checkins@codespeak.net May 87% 0FF Message-ID: <20020518101651.6606.qmail@ajw100.neoplus.adsl.tpnet.pl> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080518/b4cf1958/attachment.htm From duncan at codespeak.net Mon May 19 10:33:30 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 19 May 2008 10:33:30 +0200 (CEST) Subject: [kupu-checkins] r54915 - in kupu/trunk/kupu: common doc Message-ID: <20080519083330.24AE32A0157@codespeak.net> Author: duncan Date: Mon May 19 10:33:27 2008 New Revision: 54915 Modified: kupu/trunk/kupu/common/kupudrawers.js kupu/trunk/kupu/doc/CHANGES.txt Log: Fix for Plone ticket #8080 After uploading image, the "Insert Image" dialog remains open Modified: kupu/trunk/kupu/common/kupudrawers.js ============================================================================== --- kupu/trunk/kupu/common/kupudrawers.js (original) +++ kupu/trunk/kupu/common/kupudrawers.js Mon May 19 10:33:27 2008 @@ -1463,7 +1463,10 @@ var sizeselector = document.getElementsByName('image-size-selector'); if (sizeselector && sizeselector.length > 0) { sizeselector = sizeselector[0]; - uri += sizeselector.options[sizeselector.selectedIndex].value; + var index = sizeselector.selectedIndex; + if (sizeselector.length > 0 && index >= 0) { + uri += sizeselector.options[index].value; + } } var radios = document.getElementsByName('image-align'); var imgclass = ""; Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Mon May 19 10:33:27 2008 @@ -9,6 +9,7 @@ * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) * 7990 Internal link drawer broken for editors * 8003 Fixed Kupu translation msgids containing html. + * 8080 After uploading image, the "Insert Image" dialog remains open * 8129 "TypeError: string indices must be integers" error on plonedrawers.py when installing - 1.4.9 From duncan at codespeak.net Mon May 19 11:01:14 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 19 May 2008 11:01:14 +0200 (CEST) Subject: [kupu-checkins] r54916 - in kupu/trunk/kupu: doc plone Message-ID: <20080519090114.8AAE92A00E0@codespeak.net> Author: duncan Date: Mon May 19 11:01:01 2008 New Revision: 54916 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_config.pt Log: Applied patch for plone ticket #8014 kupu zmi_docs#images link broken Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Mon May 19 11:01:01 2008 @@ -9,6 +9,7 @@ * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) * 7990 Internal link drawer broken for editors * 8003 Fixed Kupu translation msgids containing html. + * 8014 kupu zmi_docs#images link broken * 8080 After uploading image, the "Insert Image" dialog remains open * 8129 "TypeError: string indices must be integers" error on plonedrawers.py when installing Modified: kupu/trunk/kupu/plone/kupu_config.pt ============================================================================== --- kupu/trunk/kupu/plone/kupu_config.pt (original) +++ kupu/trunk/kupu/plone/kupu_config.pt Mon May 19 11:01:01 2008 @@ -103,14 +103,15 @@ - If you enable this option a transform to hide UIDs and support image - captioning from client browsers will also be enabled + If you enable this option a transform to hide UIDs and support image + captioning from client browsers will also be enabled (see image captioning documentation). + tal:attributes="href string:${context/absolute_url}/zmi_docs#images" + href="zmi_docs#images">see image captioning documentation). - If the transform does not enable itself automatically you may - need to update your PortalTransforms product. + If the transform does not enable itself automatically you may + need to update your PortalTransforms product. @@ -138,7 +139,8 @@ captioning from client browsers will also be enabled (see image captioning documentation). + tal:attributes="href string:${context/absolute_url}/zmi_docs#images" + href="zmi_docs#images">see image captioning documentation). If the transform does not enable itself automatically you may need to update your PortalTransforms product. From duncan at codespeak.net Mon May 19 11:05:44 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 19 May 2008 11:05:44 +0200 (CEST) Subject: [kupu-checkins] r54918 - kupu/trunk/kupu/plone Message-ID: <20080519090544.5CBCC2A0191@codespeak.net> Author: duncan Date: Mon May 19 11:05:42 2008 New Revision: 54918 Modified: kupu/trunk/kupu/plone/libraries.pt Log: Applied additional patch for plone ticket #8003 kupu14-plone-libraries.diff Modified: kupu/trunk/kupu/plone/libraries.pt ============================================================================== --- kupu/trunk/kupu/plone/libraries.pt (original) +++ kupu/trunk/kupu/plone/libraries.pt Mon May 19 11:05:42 2008 @@ -133,35 +133,35 @@

The following variables are available in the TALES expressions:

- + - + - + - + - + - + - + - +
objectobject The current context object
object_urlobject_url The URL of the current context object
folderfolder The folder the context object is located in
folder_urlfolder_url The URL of the folder the context object is located in
portalportal The portal object
portal_urlportal_url URL of the portal
membermember Authenticated member
requestrequest Request
From guido at codespeak.net Mon May 19 15:22:29 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Mon, 19 May 2008 15:22:29 +0200 (CEST) Subject: [kupu-checkins] r54930 - kupu/trunk/kupu/widgeteer Message-ID: <20080519132229.F343C16850F@codespeak.net> Author: guido Date: Mon May 19 15:22:26 2008 New Revision: 54930 Modified: kupu/trunk/kupu/widgeteer/kupuinit.js Log: Added a hook to do post-init stuff from the afterInit method of widgeteer. Modified: kupu/trunk/kupu/widgeteer/kupuinit.js ============================================================================== --- kupu/trunk/kupu/widgeteer/kupuinit.js (original) +++ kupu/trunk/kupu/widgeteer/kupuinit.js Mon May 19 15:22:26 2008 @@ -46,6 +46,9 @@ // if we don't first focus the outer window, Mozilla won't show a cursor window.focus(); this.getDocument().getWindow().focus(); + if (this.afterWidgeteerInit) { + this.afterWidgeteerInit(this); + }; }; function WidgeteerDrawerTool() { From guido at codespeak.net Mon May 19 15:31:33 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Mon, 19 May 2008 15:31:33 +0200 (CEST) Subject: [kupu-checkins] r54933 - kupu/trunk/kupu/widgeteer Message-ID: <20080519133133.447FA2A017B@codespeak.net> Author: guido Date: Mon May 19 15:31:32 2008 New Revision: 54933 Modified: kupu/trunk/kupu/widgeteer/kupustyles.css Log: Fixed height issue that made that the scrollbar was rendered partially outside of the frame. Modified: kupu/trunk/kupu/widgeteer/kupustyles.css ============================================================================== --- kupu/trunk/kupu/widgeteer/kupustyles.css (original) +++ kupu/trunk/kupu/widgeteer/kupustyles.css Mon May 19 15:31:32 2008 @@ -182,6 +182,7 @@ iframe.kupu-editor-iframe { width: 100%; height: 100%; + margin-bottom: 3em; } textarea.kupu-editor-textarea { From guido at codespeak.net Mon May 19 16:03:03 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Mon, 19 May 2008 16:03:03 +0200 (CEST) Subject: [kupu-checkins] r54939 - kupu/trunk/kupu/widgeteer Message-ID: <20080519140303.5362316843D@codespeak.net> Author: guido Date: Mon May 19 16:02:57 2008 New Revision: 54939 Modified: kupu/trunk/kupu/widgeteer/kupustyles.css Log: Fixed scrollbar rendering issue properly now (for Moz at least, needs to be tested in IE). Modified: kupu/trunk/kupu/widgeteer/kupustyles.css ============================================================================== --- kupu/trunk/kupu/widgeteer/kupustyles.css (original) +++ kupu/trunk/kupu/widgeteer/kupustyles.css Mon May 19 16:02:57 2008 @@ -182,7 +182,7 @@ iframe.kupu-editor-iframe { width: 100%; height: 100%; - margin-bottom: 3em; + margin-bottom: -3em; } textarea.kupu-editor-textarea { From duncan at codespeak.net Mon May 19 16:24:51 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 19 May 2008 16:24:51 +0200 (CEST) Subject: [kupu-checkins] r54941 - kupu/trunk/kupu/plone Message-ID: <20080519142451.93D5B16850B@codespeak.net> Author: duncan Date: Mon May 19 16:24:49 2008 New Revision: 54941 Modified: kupu/trunk/kupu/plone/html2captioned.py Log: decodeEntites can be called with either unicode or str Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Mon May 19 16:24:49 2008 @@ -684,4 +684,6 @@ return unichr(name2codepoint[code]) return match.group(0) - return EntityPattern.sub(unescape, s.decode(encoding)) + if isinstance(s, str): + s = s.decode(encoding) + return EntityPattern.sub(unescape, s) From ldr at codespeak.net Tue May 20 04:40:11 2008 From: ldr at codespeak.net (ldr at codespeak.net) Date: Tue, 20 May 2008 04:40:11 +0200 (CEST) Subject: [kupu-checkins] r54981 - in kupu/trunk/kupu: doc plone plone/tests Message-ID: <20080520024011.42198168502@codespeak.net> Author: ldr Date: Tue May 20 04:40:08 2008 New Revision: 54981 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/html2captioned.py kupu/trunk/kupu/plone/interfaces.py kupu/trunk/kupu/plone/kupu2html.py kupu/trunk/kupu/plone/librarytool.py kupu/trunk/kupu/plone/tests/test_html2captioned.py Log: Purged old Zope2 Interface interfaces for compatibility with Zope 2.12 and Plone 4, while maintaining compatibility with pre Plone 4 versions of Products.PortalTransforms. [elro] Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Tue May 20 04:40:08 2008 @@ -4,6 +4,10 @@ - SVN (unreleased) + - Purged old Zope2 Interface interfaces for compatibility with Zope 2.12 and Plone 4, while maintaining compatibility + with pre Plone 4 versions of Products.PortalTransforms. + [elro] + - Plone tickets * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Tue May 20 04:40:08 2008 @@ -8,6 +8,7 @@ # an appropriate chunk of HTML to include the caption. # from Products.PortalTransforms.interfaces import itransform +from Products.PortalTransforms.z3.interfaces import ITransform from DocumentTemplate.DT_Util import html_quote from DocumentTemplate.DT_Var import newline_to_br from Products.CMFCore.utils import getToolByName @@ -18,6 +19,7 @@ from Acquisition import aq_base from htmlentitydefs import name2codepoint from Products.kupu.plone.config import UID_PATTERN +from zope.interface import implements name2codepoint = name2codepoint.copy() name2codepoint['apos']=ord("'") @@ -70,6 +72,7 @@ class HTMLToCaptioned: """Transform which adds captions to images embedded in HTML""" + implements(ITransform) __implements__ = itransform __name__ = "html_to_captioned" inputs = ('text/html',) Modified: kupu/trunk/kupu/plone/interfaces.py ============================================================================== --- kupu/trunk/kupu/plone/interfaces.py (original) +++ kupu/trunk/kupu/plone/interfaces.py Tue May 20 04:40:08 2008 @@ -11,7 +11,7 @@ $Id$ """ -from Interface import Interface +from zope.interface import Interface class ILibraryManager(Interface): """Provide an interface for managing and retrieving libraries for Modified: kupu/trunk/kupu/plone/kupu2html.py ============================================================================== --- kupu/trunk/kupu/plone/kupu2html.py (original) +++ kupu/trunk/kupu/plone/kupu2html.py Tue May 20 04:40:08 2008 @@ -8,11 +8,14 @@ # this version expects to work on text/x-html-raw from Products.PortalTransforms.interfaces import itransform +from Products.PortalTransforms.z3.interfaces import ITransform from Products.kupu.plone import html2captioned from Products.CMFCore.utils import getToolByName +from zope.interface import implements class KupuOutputTransform(html2captioned.HTMLToCaptioned): """Transform which adds captions to images embedded in HTML""" + implements(ITransform) __implements__ = itransform __name__ = "kupu_raw_to_html" inputs = ('text/x-html-raw',) Modified: kupu/trunk/kupu/plone/librarytool.py ============================================================================== --- kupu/trunk/kupu/plone/librarytool.py (original) +++ kupu/trunk/kupu/plone/librarytool.py Tue May 20 04:40:08 2008 @@ -19,6 +19,7 @@ from Products.PageTemplates.Expressions import getEngine, SecureModuleImporter from Products.kupu.plone.interfaces import IKupuLibraryTool from Products.CMFCore.utils import getToolByName +from zope.interface import implements class KupuError(Exception): pass NEWTYPE_IGNORE, NEWTYPE_ADD = 0, 1 @@ -29,7 +30,7 @@ class KupuLibraryTool(Acquisition.Implicit): """A tool to aid Kupu libraries""" - __implements__ = IKupuLibraryTool + implements(IKupuLibraryTool) def __init__(self): self._libraries = [] Modified: kupu/trunk/kupu/plone/tests/test_html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/tests/test_html2captioned.py (original) +++ kupu/trunk/kupu/plone/tests/test_html2captioned.py Tue May 20 04:40:08 2008 @@ -8,6 +8,7 @@ from os.path import join, abspath, dirname from Products.PortalTransforms.tests.test_transforms import * +from Products.PortalTransforms.z3.interfaces import IDataStream from Products.PortalTransforms.tests.utils import normalize_html from Products.kupu import kupu_globals @@ -39,7 +40,7 @@ input.close() data = datastream(self.transform.name()) res_data = self.transform.convert(orig, data, filename=filename, context=self.portal) - self.assert_(idatastream.isImplementedBy(res_data)) + self.assert_(IDataStream.providedBy(res_data)) got = res_data.getData() try: output = open(output) From duncan at codespeak.net Tue May 20 10:24:43 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 20 May 2008 10:24:43 +0200 (CEST) Subject: [kupu-checkins] r54982 - in kupu/trunk/kupu/plone: . tests Message-ID: <20080520082443.25A4B2A8002@codespeak.net> Author: duncan Date: Tue May 20 10:24:41 2008 New Revision: 54982 Modified: kupu/trunk/kupu/plone/html2captioned.py kupu/trunk/kupu/plone/kupu2html.py kupu/trunk/kupu/plone/tests/test_html2captioned.py Log: Fix PortalTransforms imports broken by Laurence's checkin Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Tue May 20 10:24:41 2008 @@ -7,8 +7,12 @@ # The transform finds all the embedded images, and replaces them with # an appropriate chunk of HTML to include the caption. # -from Products.PortalTransforms.interfaces import itransform -from Products.PortalTransforms.z3.interfaces import ITransform +try: + from Products.PortalTransforms.z3.interfaces import ITransform +except ImportError: + ITransform = None + from Products.PortalTransforms.interfaces import itransform + from DocumentTemplate.DT_Util import html_quote from DocumentTemplate.DT_Var import newline_to_br from Products.CMFCore.utils import getToolByName @@ -72,7 +76,8 @@ class HTMLToCaptioned: """Transform which adds captions to images embedded in HTML""" - implements(ITransform) + if ITransform is not None: + implements(ITransform) __implements__ = itransform __name__ = "html_to_captioned" inputs = ('text/html',) Modified: kupu/trunk/kupu/plone/kupu2html.py ============================================================================== --- kupu/trunk/kupu/plone/kupu2html.py (original) +++ kupu/trunk/kupu/plone/kupu2html.py Tue May 20 10:24:41 2008 @@ -7,15 +7,20 @@ # The transform is the same as the one done by html2captioned, but # this version expects to work on text/x-html-raw -from Products.PortalTransforms.interfaces import itransform -from Products.PortalTransforms.z3.interfaces import ITransform +try: + from Products.PortalTransforms.z3.interfaces import ITransform +except ImportError: + ITransform = None + from Products.PortalTransforms.interfaces import itransform + from Products.kupu.plone import html2captioned from Products.CMFCore.utils import getToolByName from zope.interface import implements class KupuOutputTransform(html2captioned.HTMLToCaptioned): """Transform which adds captions to images embedded in HTML""" - implements(ITransform) + if ITransform is not None: + implements(ITransform) __implements__ = itransform __name__ = "kupu_raw_to_html" inputs = ('text/x-html-raw',) Modified: kupu/trunk/kupu/plone/tests/test_html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/tests/test_html2captioned.py (original) +++ kupu/trunk/kupu/plone/tests/test_html2captioned.py Tue May 20 10:24:41 2008 @@ -8,7 +8,10 @@ from os.path import join, abspath, dirname from Products.PortalTransforms.tests.test_transforms import * -from Products.PortalTransforms.z3.interfaces import IDataStream +try: + from Products.PortalTransforms.z3.interfaces import IDataStream +except ImportError: + IDataStream = None from Products.PortalTransforms.tests.utils import normalize_html from Products.kupu import kupu_globals @@ -40,7 +43,8 @@ input.close() data = datastream(self.transform.name()) res_data = self.transform.convert(orig, data, filename=filename, context=self.portal) - self.assert_(IDataStream.providedBy(res_data)) + if IDataStream is not None: + self.assert_(IDataStream.providedBy(res_data)) got = res_data.getData() try: output = open(output) From duncan at codespeak.net Tue May 20 10:31:46 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 20 May 2008 10:31:46 +0200 (CEST) Subject: [kupu-checkins] r54983 - in kupu/trunk/kupu: common doc Message-ID: <20080520083146.1D80C2A8002@codespeak.net> Author: duncan Date: Tue May 20 10:31:45 2008 New Revision: 54983 Modified: kupu/trunk/kupu/common/kupucontentfilters.js kupu/trunk/kupu/doc/CHANGES.txt Log: Fix broken paste from OpenOffice. Style and script tags now removed completely (including their content). Improved cleanup code to not generate phantom empty paragraphs from nested paragraphs in DOM. Reject META and TITLE tags. Modified: kupu/trunk/kupu/common/kupucontentfilters.js ============================================================================== --- kupu/trunk/kupu/common/kupucontentfilters.js (original) +++ kupu/trunk/kupu/common/kupucontentfilters.js Tue May 20 10:31:45 2008 @@ -400,6 +400,11 @@ this.badTagAttributes = new this.Set({}); + // Nasty tags should be initialised from Plone's HTML control panel + // but we have a few tags we know for sure aren't going to work + // so we can put them in whatever. + this.nastyTags = new this.Set({'script':1, 'style':1, 'meta':1, 'title':1}); + // State array. For each tag identifies what it can contain. // I'm not attempting to check the order or number of contained // tags (yet). @@ -564,7 +569,7 @@ }(this, editor); // Exclude unwanted tags. - this.excludeTags(['center']); + this.excludeTags(['center', 'meta', 'title']); if (editor.config && editor.config.htmlfilter) { this.filterStructure = editor.config.htmlfilter.filterstructure; @@ -672,9 +677,14 @@ if (n instanceof Array) { var newp = ownerdoc.createElement('p'); this._xmlCopyAttr(para, newp); - var ln = n.length-1; - if (/br/i.test(n[ln].nodeName)) { - n.splice(ln,1); + for (var ln = n.length-1; ln >= 0; ln--) { + var nn = n[ln].nodeName.toLowerCase(); + if (nn=='br' || (nn=='#text' && /^\s*$/.test(n[ln].nodeValue))) { + n.splice(ln,1); + } else { break; } + } + if (n.length==0) { + continue; } for (var j = 0; j < n.length; j++) { newp.appendChild(n[j]); @@ -736,6 +746,10 @@ xhtmlnode = null; } } + } else { + // Stripping this tag, maybe we also want to strip the + // content of the tag. + if (this.nastyTags[nodename]) { return null; } } var kids = htmlnode.childNodes; Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Tue May 20 10:31:45 2008 @@ -2,7 +2,7 @@ Kupu changes ============ -- SVN (unreleased) +- 1.4.10 - Purged old Zope2 Interface interfaces for compatibility with Zope 2.12 and Plone 4, while maintaining compatibility with pre Plone 4 versions of Products.PortalTransforms. @@ -10,10 +10,13 @@ - Plone tickets + * 7779 imageuploader doesn t show the input for file if not in english * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) * 7990 Internal link drawer broken for editors * 8003 Fixed Kupu translation msgids containing html. + * 8009 Pasting from OpenOffice broken / mishandled comments * 8014 kupu zmi_docs#images link broken + * 8039 Kupu locks up on adding images when user does not have manager privileges * 8080 After uploading image, the "Insert Image" dialog remains open * 8129 "TypeError: string indices must be integers" error on plonedrawers.py when installing From duncan at codespeak.net Thu May 22 12:12:35 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 22 May 2008 12:12:35 +0200 (CEST) Subject: [kupu-checkins] r55123 - in kupu/trunk/kupu: doc plone/kupu_plone_layer Message-ID: <20080522101235.5A0FC168561@codespeak.net> Author: duncan Date: Thu May 22 12:12:32 2008 New Revision: 55123 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_plone_layer/emptypage.pt kupu/trunk/kupu/plone/kupu_plone_layer/kupu_kjax_support.xml.pt Log: Merged in wiggy's changes revisions 53252, 53279 from branch/kupu-1.4. Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu May 22 12:12:32 2008 @@ -4,6 +4,9 @@ - 1.4.10 + - Update emptypage.pt to include a hint for deliverance that edited + pages should not be themed. [wiggy] + - Purged old Zope2 Interface interfaces for compatibility with Zope 2.12 and Plone 4, while maintaining compatibility with pre Plone 4 versions of Products.PortalTransforms. [elro] Modified: kupu/trunk/kupu/plone/kupu_plone_layer/emptypage.pt ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/emptypage.pt (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/emptypage.pt Thu May 22 12:12:32 2008 @@ -1,6 +1,7 @@ Kupu contentarea + Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupu_kjax_support.xml.pt ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupu_kjax_support.xml.pt (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupu_kjax_support.xml.pt Thu May 22 12:12:32 2008 @@ -18,7 +18,7 @@ length python:len(context.portal_catalog.searchResults(**query));" id="query_length" kj:mode="replace"> -
+
From duncan at codespeak.net Thu May 22 12:27:14 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 22 May 2008 12:27:14 +0200 (CEST) Subject: [kupu-checkins] r55124 - in kupu/trunk/kupu: . plone plone/profiles/default Message-ID: <20080522102714.47EC7168447@codespeak.net> Author: duncan Date: Thu May 22 12:27:13 2008 New Revision: 55124 Modified: kupu/trunk/kupu/plone/html2captioned.py kupu/trunk/kupu/plone/kupu2html.py kupu/trunk/kupu/plone/profiles/default/metadata.xml kupu/trunk/kupu/version.txt Log: Fix imports broken when trying to sort backward compatibility. Set version numbers for release Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Thu May 22 12:27:13 2008 @@ -11,7 +11,7 @@ from Products.PortalTransforms.z3.interfaces import ITransform except ImportError: ITransform = None - from Products.PortalTransforms.interfaces import itransform +from Products.PortalTransforms.interfaces import itransform from DocumentTemplate.DT_Util import html_quote from DocumentTemplate.DT_Var import newline_to_br Modified: kupu/trunk/kupu/plone/kupu2html.py ============================================================================== --- kupu/trunk/kupu/plone/kupu2html.py (original) +++ kupu/trunk/kupu/plone/kupu2html.py Thu May 22 12:27:13 2008 @@ -11,7 +11,7 @@ from Products.PortalTransforms.z3.interfaces import ITransform except ImportError: ITransform = None - from Products.PortalTransforms.interfaces import itransform +from Products.PortalTransforms.interfaces import itransform from Products.kupu.plone import html2captioned from Products.CMFCore.utils import getToolByName Modified: kupu/trunk/kupu/plone/profiles/default/metadata.xml ============================================================================== --- kupu/trunk/kupu/plone/profiles/default/metadata.xml (original) +++ kupu/trunk/kupu/plone/profiles/default/metadata.xml Thu May 22 12:27:13 2008 @@ -1,4 +1,4 @@ - 1.4.9 + 1.4.10 Modified: kupu/trunk/kupu/version.txt ============================================================================== --- kupu/trunk/kupu/version.txt (original) +++ kupu/trunk/kupu/version.txt Thu May 22 12:27:13 2008 @@ -1 +1 @@ -kupu 1.4.9 +kupu 1.4.10 From duncan at codespeak.net Thu May 22 13:12:18 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 22 May 2008 13:12:18 +0200 (CEST) Subject: [kupu-checkins] r55125 - kupu/trunk/kupu/plone/tests Message-ID: <20080522111218.DF1082A00DC@codespeak.net> Author: duncan Date: Thu May 22 13:12:17 2008 New Revision: 55125 Added: kupu/trunk/kupu/plone/tests/test_i18n.py - copied unchanged from r53391, kupu/branch/kupu-1.4/plone/tests/test_i18n.py Log: Merged revision 53391 from branch/kupu-1.4 From duncan at codespeak.net Thu May 22 13:19:06 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 22 May 2008 13:19:06 +0200 (CEST) Subject: [kupu-checkins] r55126 - kupu/trunk/kupu/plone/tests Message-ID: <20080522111906.399302A00DC@codespeak.net> Author: duncan Date: Thu May 22 13:19:05 2008 New Revision: 55126 Modified: kupu/trunk/kupu/plone/tests/test_i18n.py Log: Make Hanno's I18n tests not fail when i18ndude is not available Modified: kupu/trunk/kupu/plone/tests/test_i18n.py ============================================================================== --- kupu/trunk/kupu/plone/tests/test_i18n.py (original) +++ kupu/trunk/kupu/plone/tests/test_i18n.py Thu May 22 13:19:05 2008 @@ -11,6 +11,7 @@ except ImportError: HAS_I18NDUDE = False +tests=[] if HAS_I18NDUDE: GLOBALS = globals() PACKAGE_HOME = os.path.normpath(os.path.join(package_home(GLOBALS), '..', '..')) @@ -21,7 +22,6 @@ i18ndir = os.path.normpath(PACKAGE_HOME) - tests=[] products=[] pots={} pot_catalogs={} @@ -52,9 +52,9 @@ pot_len = pot_lens[product] tests.append(TestOnePoFile) - import unittest - def test_suite(): - suite = unittest.TestSuite() - for test in tests: - suite.addTest(unittest.makeSuite(test)) - return suite +import unittest +def test_suite(): + suite = unittest.TestSuite() + for test in tests: + suite.addTest(unittest.makeSuite(test)) + return suite From duncan at codespeak.net Thu May 22 13:38:08 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 22 May 2008 13:38:08 +0200 (CEST) Subject: [kupu-checkins] r55128 - kupu/tag/kupu-1.4.10 Message-ID: <20080522113808.5BBE6168421@codespeak.net> Author: duncan Date: Thu May 22 13:38:06 2008 New Revision: 55128 Added: kupu/tag/kupu-1.4.10/ - copied from r55127, kupu/trunk/kupu/ Log: Tag for kupu 1.4.10 From guido at codespeak.net Thu May 22 14:49:49 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Thu, 22 May 2008 14:49:49 +0200 (CEST) Subject: [kupu-checkins] r55131 - kupu/trunk/kupu/widgeteer Message-ID: <20080522124949.2555116840E@codespeak.net> Author: guido Date: Thu May 22 14:49:46 2008 New Revision: 55131 Modified: kupu/trunk/kupu/widgeteer/empty.html Log: Set xmlns for XHTML for empty document (to more easily allow XSL transformations). Modified: kupu/trunk/kupu/widgeteer/empty.html ============================================================================== --- kupu/trunk/kupu/widgeteer/empty.html (original) +++ kupu/trunk/kupu/widgeteer/empty.html Thu May 22 14:49:46 2008 @@ -1,6 +1,6 @@ - +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + Test Content Document From kupu-checkins at codespeak.net Sat May 24 13:06:36 2008 From: kupu-checkins at codespeak.net (Viagra.com Inc ®) Date: Sat, 24 May 2008 13:06:36 +0200 (CEST) Subject: [kupu-checkins] Official Site Message-ID: <1876674318.2774782.188460768-6183@cimail96.msn.com> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080524/1dc3949e/attachment.htm From guido at codespeak.net Mon May 26 13:00:48 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Mon, 26 May 2008 13:00:48 +0200 (CEST) Subject: [kupu-checkins] r55242 - kupu/trunk/kupu/widgeteer Message-ID: <20080526110048.65E872A809F@codespeak.net> Author: guido Date: Mon May 26 13:00:45 2008 New Revision: 55242 Modified: kupu/trunk/kupu/widgeteer/kupuinit.js Log: Enabled HTML tag filter, removed settings (originally copied from Silva, and quite Silva specific). Modified: kupu/trunk/kupu/widgeteer/kupuinit.js ============================================================================== --- kupu/trunk/kupu/widgeteer/kupuinit.js (original) +++ kupu/trunk/kupu/widgeteer/kupuinit.js Mon May 26 13:00:45 2008 @@ -437,20 +437,8 @@ drawertool.registerDrawer('tabledrawer', tabledrawer); */ -// var nonxhtmltagfilter = new NonXHTMLTagFilter(); -// kupu.registerFilter(nonxhtmltagfilter); - - kupu.xhtmlvalid.setAttrFilter(['is_toc', 'toc_depth', 'is_citation', - 'source', 'author', 'source_id', - 'silva_type', 'alignment', - 'link_to_hires', 'link']); - // allow all attributes on div, since ExternalSources require that - kupu.xhtmlvalid.includeTagAttributes(['div'], ['*']); - kupu.xhtmlvalid.includeTagAttributes(['p'], ['silva_type']); - kupu.xhtmlvalid.includeTagAttributes(['h6'], ['silva_type']); - kupu.xhtmlvalid.includeTagAttributes(['img'], ['alignment', - 'link_to_hires', - 'target', 'link']); + var nonxhtmltagfilter = new NonXHTMLTagFilter(); + kupu.registerFilter(nonxhtmltagfilter); return kupu; } From guido at codespeak.net Wed May 28 12:56:37 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Wed, 28 May 2008 12:56:37 +0200 (CEST) Subject: [kupu-checkins] r55333 - kupu/trunk/kupu/widgeteer Message-ID: <20080528105637.6084B698070@codespeak.net> Author: guido Date: Wed May 28 12:56:35 2008 New Revision: 55333 Added: kupu/trunk/kupu/widgeteer/popups.kupu Modified: kupu/trunk/kupu/widgeteer/include.kupu kupu/trunk/kupu/widgeteer/kupuinit.js kupu/trunk/kupu/widgeteer/wire.kupu Log: Made the add link and add image popups available from buttons in Widgeteer, to at least have some way to add links and images without the whole DAV browsers in widgeteer-kupu. Modified: kupu/trunk/kupu/widgeteer/include.kupu ============================================================================== --- kupu/trunk/kupu/widgeteer/include.kupu (original) +++ kupu/trunk/kupu/widgeteer/include.kupu Wed May 28 12:56:35 2008 @@ -10,5 +10,6 @@ + Modified: kupu/trunk/kupu/widgeteer/kupuinit.js ============================================================================== --- kupu/trunk/kupu/widgeteer/kupuinit.js (original) +++ kupu/trunk/kupu/widgeteer/kupuinit.js Wed May 28 12:56:35 2008 @@ -259,7 +259,36 @@ b.parentNode.removeChild(b); }; + if (!tools || !tools.length || tools.contains('link')) { + var linktool = new LinkTool(); + kupu.registerTool('link', linktool); + var handler = function(e) { + linktool.createLinkHandler(e); + }; + addEventHandler(document.getElementById('kupu-popup-intlink-button'), + 'click', handler); + } else { + var b = document.getElementById('kupu-popup-intlink-button'); + b.parentNode.removeChild(b); + }; + + if (!tools || !tools.length || tools.contains('image')) { + var imagetool = new ImageTool(); + kupu.registerTool('image', imagetool); + var handler = function(e) { + imagetool.createImageHandler(e); + }; + addEventHandler(document.getElementById('kupu-popup-image-button'), + 'click', handler); + } else { + var b = document.getElementById('kupu-popup-image-button'); + b.parentNode.removeChild(b); + }; + if (!tools || !tools.length || tools.contains('browser')) { + parent.browser_manager.widgeteerpath = + parentiframe.textarea.getAttribute('widget:widgeteerpath') || + '../../'; var linktool = new LinkTool(); kupu.registerTool('linktool', linktool); var handler = function() { Added: kupu/trunk/kupu/widgeteer/popups.kupu ============================================================================== --- (empty file) +++ kupu/trunk/kupu/widgeteer/popups.kupu Wed May 28 12:56:35 2008 @@ -0,0 +1,23 @@ + + + $Id: body.kupu 9779 2005-03-15 11:34:47Z duncan $ + + + + + + + + + Modified: kupu/trunk/kupu/widgeteer/wire.kupu ============================================================================== --- kupu/trunk/kupu/widgeteer/wire.kupu (original) +++ kupu/trunk/kupu/widgeteer/wire.kupu Wed May 28 12:56:35 2008 @@ -43,6 +43,7 @@ + From duncan at codespeak.net Wed May 28 15:35:34 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Wed, 28 May 2008 15:35:34 +0200 (CEST) Subject: [kupu-checkins] r55347 - in kupu/branch/kupu-1.4: . common doc mmbase mmbase/drawers mmbase/tools plone plone/kupu_plone_layer plone/profiles/default plone/tests widgeteer Message-ID: <20080528133534.59AFE169E85@codespeak.net> Author: duncan Date: Wed May 28 15:35:26 2008 New Revision: 55347 Added: kupu/branch/kupu-1.4/mmbase/tools/searchrelate.jspx - copied unchanged from r55124, kupu/trunk/kupu/mmbase/tools/searchrelate.jspx Modified: kupu/branch/kupu-1.4/__init__.py kupu/branch/kupu-1.4/common/kupu_kjax.js kupu/branch/kupu-1.4/common/kupucontentfilters.js kupu/branch/kupu-1.4/common/kupudrawers.js kupu/branch/kupu-1.4/common/kuputoolcollapser.js kupu/branch/kupu-1.4/doc/CHANGES.txt kupu/branch/kupu-1.4/mmbase/Makefile kupu/branch/kupu-1.4/mmbase/body-mmbase.kupu (props changed) kupu/branch/kupu-1.4/mmbase/body.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/contextmenu.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/dist-mmbase.kupu (props changed) kupu/branch/kupu-1.4/mmbase/drawers.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/drawers/attachments.items.jspx (contents, props changed) kupu/branch/kupu-1.4/mmbase/drawers/collection.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/drawer.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/drawer.xsl.jspx (contents, props changed) kupu/branch/kupu-1.4/mmbase/drawers/images.items.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/libraries.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/library.jspx (contents, props changed) kupu/branch/kupu-1.4/mmbase/drawers/search.constraints.jspx (contents, props changed) kupu/branch/kupu-1.4/mmbase/drawers/search.library.jspx (contents, props changed) kupu/branch/kupu-1.4/mmbase/drawers/segments.items.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/test.post.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/texts.items.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/upload.jspx (props changed) kupu/branch/kupu-1.4/mmbase/drawers/urls.items.jspx (props changed) kupu/branch/kupu-1.4/mmbase/head-mmbase.kupu (props changed) kupu/branch/kupu-1.4/mmbase/head.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/html.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/include.kupu (props changed) kupu/branch/kupu-1.4/mmbase/index.kupu (props changed) kupu/branch/kupu-1.4/mmbase/kupuinit.js kupu/branch/kupu-1.4/mmbase/mmbase.css kupu/branch/kupu-1.4/mmbase/mmbase.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/saveonpart.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/test.kupu (props changed) kupu/branch/kupu-1.4/mmbase/toolbar.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/toolboxes.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/wire.kupu (contents, props changed) kupu/branch/kupu-1.4/mmbase/xmlconfig.kupu (props changed) kupu/branch/kupu-1.4/plone/html2captioned.py kupu/branch/kupu-1.4/plone/interfaces.py kupu/branch/kupu-1.4/plone/kupu2html.py kupu/branch/kupu-1.4/plone/kupu_config.pt kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupucollection.xml.pt kupu/branch/kupu-1.4/plone/libraries.pt kupu/branch/kupu-1.4/plone/librarytool.py kupu/branch/kupu-1.4/plone/plonedrawers.py kupu/branch/kupu-1.4/plone/plonelibrarytool.py kupu/branch/kupu-1.4/plone/profiles/default/metadata.xml kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py kupu/branch/kupu-1.4/plone/tests/test_i18n.py kupu/branch/kupu-1.4/version.txt kupu/branch/kupu-1.4/widgeteer/kupuinit.js kupu/branch/kupu-1.4/widgeteer/kupustyles.css Log: Merged trunk revisions 53036-55124, 55125-55128 into kupu-1.4 branch. I think this should bring the branch back in line with the trunk again. Modified: kupu/branch/kupu-1.4/__init__.py ============================================================================== --- kupu/branch/kupu-1.4/__init__.py (original) +++ kupu/branch/kupu-1.4/__init__.py Wed May 28 15:35:26 2008 @@ -39,7 +39,7 @@ except ImportError: have_cmf = 0 -# test for Plone, removed because Plone isn't supported yet +# test for Plone try: import Products.CMFPlone have_plone = 1 Modified: kupu/branch/kupu-1.4/common/kupu_kjax.js ============================================================================== --- kupu/branch/kupu-1.4/common/kupu_kjax.js (original) +++ kupu/branch/kupu-1.4/common/kupu_kjax.js Wed May 28 15:35:26 2008 @@ -9,7 +9,7 @@ *****************************************************************************/ /* Javascript to aid migration page. */ -function KJax() {}; +function KJax() { this.request_queue = [];}; (function(p){ p._loadXML = function(uri, callback, body, reload, extra) { function _sarissaCallback() { @@ -34,15 +34,26 @@ dom = Sarissa.getDomDocument(); dom.loadXML(xmlhttp.responseText); } + if (this.request_queue) { + /* Kick off the next chained request before trying + * to handle the result of the last one. + */ + this._loadXML.apply(this, this.request_queue.splice(0,1)); + } callback.apply(self, [dom, uri, extra]); }; }; var self = this; + /* Make sure our requests are single-threaded. */ + if (this.xmlhttp) { + this.request_queue.push([uri, callback, body, reload, extra]); + } /* load the XML from a uri calls callback with one arg (the XML DOM) when done the (optional) body arg should contain the body for the request */ var xmlhttp = new XMLHttpRequest(); + this.xmlhttp = xmlhttp; var method = body?'POST':'GET'; // be sure that body is null and not an empty string or // something @@ -58,9 +69,9 @@ xmlhttp.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); }; xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); - this.xmlhttp = xmlhttp; xmlhttp.send(body); } catch(e) { + this.xmlhttp = null; if (e && e.name && e.message) { // Microsoft e = e.name + ': ' + e.message; } @@ -99,6 +110,11 @@ this.nextRequest(); }; p.nextRequest = function() { + var onload = this.xmldata.selectSingleNode('//*[@kj:load]'); + if (onload) { + var js = onload.getAttribute('kj:load'); + if (js) { eval(js); }; + }; var next = this.xmldata.selectSingleNode('//*[@kj:next]'); if (next) { var xmluri = next.getAttribute('kj:next'); @@ -113,7 +129,6 @@ }; }; p.newRequest = function(uri) { - if (this.xmlhttp) this.xmlhttp.abort(); this._loadXML(uri, this._xmlcallback); }; p.clearLog = function() { Modified: kupu/branch/kupu-1.4/common/kupucontentfilters.js ============================================================================== --- kupu/branch/kupu-1.4/common/kupucontentfilters.js (original) +++ kupu/branch/kupu-1.4/common/kupucontentfilters.js Wed May 28 15:35:26 2008 @@ -400,6 +400,11 @@ this.badTagAttributes = new this.Set({}); + // Nasty tags should be initialised from Plone's HTML control panel + // but we have a few tags we know for sure aren't going to work + // so we can put them in whatever. + this.nastyTags = new this.Set({'script':1, 'style':1, 'meta':1, 'title':1}); + // State array. For each tag identifies what it can contain. // I'm not attempting to check the order or number of contained // tags (yet). @@ -564,7 +569,7 @@ }(this, editor); // Exclude unwanted tags. - this.excludeTags(['center']); + this.excludeTags(['center', 'meta', 'title']); if (editor.config && editor.config.htmlfilter) { this.filterStructure = editor.config.htmlfilter.filterstructure; @@ -672,9 +677,14 @@ if (n instanceof Array) { var newp = ownerdoc.createElement('p'); this._xmlCopyAttr(para, newp); - var ln = n.length-1; - if (/br/i.test(n[ln].nodeName)) { - n.splice(ln,1); + for (var ln = n.length-1; ln >= 0; ln--) { + var nn = n[ln].nodeName.toLowerCase(); + if (nn=='br' || (nn=='#text' && /^\s*$/.test(n[ln].nodeValue))) { + n.splice(ln,1); + } else { break; } + } + if (n.length==0) { + continue; } for (var j = 0; j < n.length; j++) { newp.appendChild(n[j]); @@ -736,6 +746,10 @@ xhtmlnode = null; } } + } else { + // Stripping this tag, maybe we also want to strip the + // content of the tag. + if (this.nastyTags[nodename]) { return null; } } var kids = htmlnode.childNodes; Modified: kupu/branch/kupu-1.4/common/kupudrawers.js ============================================================================== --- kupu/branch/kupu-1.4/common/kupudrawers.js (original) +++ kupu/branch/kupu-1.4/common/kupudrawers.js Wed May 28 15:35:26 2008 @@ -1463,7 +1463,10 @@ var sizeselector = document.getElementsByName('image-size-selector'); if (sizeselector && sizeselector.length > 0) { sizeselector = sizeselector[0]; - uri += sizeselector.options[sizeselector.selectedIndex].value; + var index = sizeselector.selectedIndex; + if (sizeselector.length > 0 && index >= 0) { + uri += sizeselector.options[index].value; + } } var radios = document.getElementsByName('image-align'); var imgclass = ""; Modified: kupu/branch/kupu-1.4/common/kuputoolcollapser.js ============================================================================== --- kupu/branch/kupu-1.4/common/kuputoolcollapser.js (original) +++ kupu/branch/kupu-1.4/common/kuputoolcollapser.js Wed May 28 15:35:26 2008 @@ -20,11 +20,11 @@ }; for (var i=0; i < this.parent.childNodes.length; i++) { var child = this.parent.childNodes[i]; - if (child.className == 'kupu-toolbox') { + if (child.className.match(/\bkupu-toolbox\b/)) { var heading = child.getElementsByTagName('h1')[0]; if (!heading) { throw('heading not found by collapser for toolbox ' + - child.id); + child.id);henadle }; heading.setAttribute('title', _('click to unfold')); // find the toolbox's body @@ -54,7 +54,7 @@ }; }; addEventHandler(heading, 'click', handler, body, heading); - if (initial_state[child.id] === undefined || + if (initial_state[child.id] === undefined || initial_state[child.id] == '0') { body.style.display = 'none'; } else { @@ -98,12 +98,12 @@ var body = this.getToolBody(child); current_state[child.id] = body.style.display == 'none' ? '0' : '1'; }; - + var exp = new Date(); // 100 years before state is lost... should be enough ;) exp.setTime(exp.getTime() + (100 * 365 * 24 * 60 * 60 * 1000)); - var cookie = 'initial_state=' + - escape(this.serializeMapping(current_state)) + + var cookie = 'initial_state=' + + escape(this.serializeMapping(current_state)) + ';' + 'expires=' + exp.toGMTString() + ';' + 'path=/'; @@ -112,7 +112,7 @@ ToolCollapser.prototype.serializeMapping = function(mapping) { /* serializes the config dict into a string that can be evalled - + works only for dicts with string values */ if (typeof(mapping) == 'string') { @@ -124,7 +124,7 @@ if (!first) { ret += ', '; }; - ret += "'" + key + "': " + + ret += "'" + key + "': " + this.serializeMapping(mapping[key]); first = false; }; Modified: kupu/branch/kupu-1.4/doc/CHANGES.txt ============================================================================== --- kupu/branch/kupu-1.4/doc/CHANGES.txt (original) +++ kupu/branch/kupu-1.4/doc/CHANGES.txt Wed May 28 15:35:26 2008 @@ -2,14 +2,26 @@ Kupu changes ============ -- x.y.z +- 1.4.10 - Update emptypage.pt to include a hint for deliverance that edited - pages should not be themed. + pages should not be themed. [wiggy] + + - Purged old Zope2 Interface interfaces for compatibility with Zope 2.12 and Plone 4, while maintaining compatibility + with pre Plone 4 versions of Products.PortalTransforms. + [elro] - Plone tickets + * 7779 imageuploader doesn t show the input for file if not in english + * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) + * 7990 Internal link drawer broken for editors * 8003 Fixed Kupu translation msgids containing html. + * 8009 Pasting from OpenOffice broken / mishandled comments + * 8014 kupu zmi_docs#images link broken + * 8039 Kupu locks up on adding images when user does not have manager privileges + * 8080 After uploading image, the "Insert Image" dialog remains open + * 8129 "TypeError: string indices must be integers" error on plonedrawers.py when installing - 1.4.9 Modified: kupu/branch/kupu-1.4/mmbase/Makefile ============================================================================== --- kupu/branch/kupu-1.4/mmbase/Makefile (original) +++ kupu/branch/kupu-1.4/mmbase/Makefile Wed May 28 15:35:26 2008 @@ -27,7 +27,7 @@ $(XSLTPROC) $(XSLTPROC_PARAMS) -o $@ $(XSLJSPX_FILE) head-mmbase.kupu $(I18N): - @$(MAKE) -C $(KUPU_HOME) kupu-i18n.jar + @$(MAKE) -C $(KUPU_HOME) kupu-i18n.jar .PHONY: messages: *.js clean @@ -48,6 +48,7 @@ clean: rm -f index.jspx + rm -f body.jspx head.jspx rm -f mmbase-kupu-i18n.jar rm -rf resourcebundle @$(MAKE) -C $(KUPU_HOME) clean Modified: kupu/branch/kupu-1.4/mmbase/body.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/body.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/body.kupu Wed May 28 15:35:26 2008 @@ -10,7 +10,7 @@ xmlns:fn="http://java.sun.com/jsp/jstl/functions" i18n:domain="kupu" > - $Id: body.kupu,v 1.10 2005/09/27 18:26:52 michiel Exp $ + $Id$ Modified: kupu/branch/kupu-1.4/mmbase/contextmenu.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/contextmenu.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/contextmenu.kupu Wed May 28 15:35:26 2008 @@ -8,7 +8,7 @@ xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="kupu" > - $Id: contextmenu.kupu,v 1.2 2005/04/19 21:23:58 michiel Exp $ + $Id$ Modified: kupu/branch/kupu-1.4/mmbase/drawers.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/drawers.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/drawers.kupu Wed May 28 15:35:26 2008 @@ -9,7 +9,7 @@ xmlns:jsp="http://java.sun.com/JSP/Page" i18n:domain="kupu" > - $Id: drawers.kupu,v 1.15 2005/10/19 14:18:50 michiel Exp $ + $Id$ Modified: kupu/branch/kupu-1.4/mmbase/drawers/attachments.items.jspx ============================================================================== --- kupu/branch/kupu-1.4/mmbase/drawers/attachments.items.jspx (original) +++ kupu/branch/kupu-1.4/mmbase/drawers/attachments.items.jspx Wed May 28 15:35:26 2008 @@ -3,11 +3,11 @@ Needs: a request context 'drawer', containing a listcontainer 'query'. --> - + @@ -16,7 +16,7 @@ yes - + mmbase://attachments/${attachment.number} [<mm:field name="mimetype" />: <mm:field name="title" />] b Modified: kupu/branch/kupu-1.4/mmbase/drawers/drawer.xsl.jspx ============================================================================== --- kupu/branch/kupu-1.4/mmbase/drawers/drawer.xsl.jspx (original) +++ kupu/branch/kupu-1.4/mmbase/drawers/drawer.xsl.jspx Wed May 28 15:35:26 2008 @@ -13,7 +13,7 @@ XSL transformation from Kupu Library XML to HTML for the image library drawer. -$Id: drawer.xsl,v 1.12 2005/09/16 19:47:56 michiel Exp $ +$Id$ --> - - + - @@ -58,10 +58,11 @@ + bla bla bla @@ -73,8 +74,8 @@ - @@ -88,7 +89,7 @@ - + @@ -99,7 +100,7 @@ - + mydrawerstyle.css Modified: kupu/branch/kupu-1.4/mmbase/drawers/library.jspx ============================================================================== --- kupu/branch/kupu-1.4/mmbase/drawers/library.jspx (original) +++ kupu/branch/kupu-1.4/mmbase/drawers/library.jspx Wed May 28 15:35:26 2008 @@ -4,7 +4,7 @@ type="text/xml" expires="-1"> Modified: kupu/branch/kupu-1.4/mmbase/drawers/search.constraints.jspx ============================================================================== --- kupu/branch/kupu-1.4/mmbase/drawers/search.constraints.jspx (original) +++ kupu/branch/kupu-1.4/mmbase/drawers/search.constraints.jspx Wed May 28 15:35:26 2008 @@ -1,17 +1,16 @@ - - bla @@ -28,4 +27,4 @@ - \ No newline at end of file + Modified: kupu/branch/kupu-1.4/mmbase/drawers/search.library.jspx ============================================================================== --- kupu/branch/kupu-1.4/mmbase/drawers/search.library.jspx (original) +++ kupu/branch/kupu-1.4/mmbase/drawers/search.library.jspx Wed May 28 15:35:26 2008 @@ -5,7 +5,7 @@ expires="-1"> @@ -17,7 +17,6 @@ images - ${nodetypes} "<mm:write referid="search" />" @@ -36,7 +35,7 @@ - + @@ -54,4 +53,4 @@ - \ No newline at end of file + Modified: kupu/branch/kupu-1.4/mmbase/head.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/head.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/head.kupu Wed May 28 15:35:26 2008 @@ -7,8 +7,8 @@ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"> - $Id: head.kupu,v 1.15 2005/09/14 17:24:31 michiel Exp $ - + $Id$ + @@ -39,14 +39,17 @@ <script type="text/javascript" src="${kupu_common}/kuputoolcollapser.js"><jsp:text> </jsp:text></script> <script type="text/javascript" src="cross-browser.js"><jsp:text> </jsp:text></script> <script type="text/javascript" src="layout.js"><jsp:text> </jsp:text></script> + <jsp:directive.include file="/mmbase/validation/javascript.jspxf" /> <script type="text/javascript" src="mmbasetools.js"><jsp:text> </jsp:text></script> <script type="text/javascript" src="mmbase.js"><jsp:text> </jsp:text></script> </kupu:part> <kupu:part name="styles"> - <link href="${kupu_common}/kupustyles.css" rel="stylesheet" type="text/css"><jsp:text> </jsp:text></link> + <link href="${kupu_common}/kupustyles.css" rel="stylesheet" type="text/css"><jsp:text> </jsp:text></link> + <mm:haspage page="/mmbase/searchrelate/page.css.jsp"> + <link href="${mm:link('/mmbase/searchrelate/page.css.jsp')}" rel="stylesheet" type="text/css"><jsp:text> </jsp:text></link> + </mm:haspage> <!-- fills image buttons and so on --> - <link href="mmbase.css" rel="stylesheet" type="text/css" /> </kupu:part> Modified: kupu/branch/kupu-1.4/mmbase/html.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/html.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/html.kupu Wed May 28 15:35:26 2008 @@ -4,7 +4,7 @@ implementation="mmbase" xmlns:kupu="http://kupu.oscom.org/namespaces/dist" > - <kupu:id>$Id: html.kupu,v 1.14 2005/09/27 18:26:52 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="html"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" Modified: kupu/branch/kupu-1.4/mmbase/kupuinit.js ============================================================================== --- kupu/branch/kupu-1.4/mmbase/kupuinit.js (original) +++ kupu/branch/kupu-1.4/mmbase/kupuinit.js Wed May 28 15:35:26 2008 @@ -36,6 +36,7 @@ // now we can create a UI object which we can use from the UI var ui = new KupuUI('kupu-tb-styles'); + //console.log(ui.tsselect.childNodes.item(7)); // the ui must be registered to the editor like a tool so it can be notified // of state changes Modified: kupu/branch/kupu-1.4/mmbase/mmbase.css ============================================================================== --- kupu/branch/kupu-1.4/mmbase/mmbase.css (original) +++ kupu/branch/kupu-1.4/mmbase/mmbase.css Wed May 28 15:35:26 2008 @@ -1,46 +1,46 @@ @import url("layout.css"); -body { +body { } -a { +a { color: #ffa; text-decoration: none; } -ul, ol { +ul, ol { padding-left: 18px; margin-left: 0px; } -li { +li { margin-left: 0px; } -#leftColumnContent a:hover { +#leftColumnContent a:hover { background-color: #76a2b6; } -img { +img { border: 0; } -#header, #leftColumn { +#header, #leftColumn { background-color: #527d94; color: #fff; } -#nodefields p { +#nodefields p { font-size: smaller; } -#nodefields span.mm_datetime { +#nodefields span.mm_datetime { } -#nodefields a:hover { +#nodefields a:hover { background-color: #527d94; } -#nodefields { +#nodefields { background-color: #76a2b6; overflow: auto; } @@ -49,33 +49,33 @@ /* user-input: enabled; */ } -#nodefields input.mm_year { +#nodefields input.mm_year { width: 5ex; font-size: smaller; } -#nodefields select { - font-size: smaller; +#nodefields select { + font-size: smaller; } -#mmbase-tools { +#mmbase-tools { overflow: auto; overflow-x: auto; overflow-y: auto; - + } -#mmbase-tools ul { - list-style-type: none; +#mmbase-tools ul { + list-style-type: none; } -iframe { +iframe { background-color: #ffc; } -a.current { +a.current { background-color: #76a2b6; } @@ -84,16 +84,16 @@ text-decoration: none; } -#mmbase-tools .mmbase-tool { +#mmbase-tools .mmbase-tool { min-height: 100px; } - -#preview { + +#preview { background-color: blue; margin: 0px; } -#kupu { +#kupu { z-index: 1; } #kupu-tb-buttons { @@ -103,32 +103,33 @@ display: none; background-color: white; } -#kupu div.kupu-drawer { +#kupu div.kupu-drawer { width: 800px; -} -#kupu div.kupu-resourceitems { +} +#kupu div.kupu-resourceitems { width: 400px; } -#kupu div.kupu-drawer textarea, #kupu div.kupu-drawer input { +#kupu div.kupu-drawer textarea, #kupu div.kupu-drawer input { border: 1px solid; background-color: #eee; } -#kupu div.kupu-drawer textarea { +#kupu div.kupu-drawer textarea { width: 95%; } -div.kupu-panels td.panel { +div.kupu-panels td.panel { height: 300px; -} +} -#kupu div#image_alt_div { +#kupu div#image_alt_div { display: none; } -#kupu div.kupu-drawer input#kupu-upload-file { +#kupu div.kupu-drawer input#kupu-upload-file { width: 60%; } -#kupu div.kupu-drawer div.overflow { +#kupu div.kupu-drawer div.overflow { overflow-x: auto; overflow-y: auto; + } #kupu div.kupu-editorframe { @@ -151,50 +152,105 @@ display: none; } -#kupu-editor { +#kupu-editor { background-color: white; } -#kupu-editor h1,h2,h3,h4,h5,h6,h7 { +#kupu-editor h1,h2,h3,h4,h5,h6,h7 { color: red; } -div.kupu-toolbox, div.kupu-toolbox-active { +div.kupu-toolbox, div.kupu-toolbox-active { position: absolute; width: 200px; right: 2px; display: block; background-color: #527d94; } -div.kupu-toolbox-active { +div.kupu-toolbox-active { background-color: #76a2b6; } -div.kupu-toolbox-active #kupu-div-addbutton { +div.kupu-toolbox-active #kupu-div-addbutton { display: none; - + } -div#kupu-toolbox-links { +div#kupu-toolbox-links { } -div#kupu-toolbox-images { +div#kupu-toolbox-images { top: 250px; } -div#kupu-toolbox-tables { +div#kupu-toolbox-tables { top: 500px; } -div#kupu-toolbox-debug { +div#kupu-toolbox-debug { top: 750px; } -div#kupu-toolbox-addtable{ +div#kupu-toolbox-addtable{ + +} + +div#kupu-librariesitems { + width: 200px; +} +div#kupu-resourceitems { + width: 250px; +} -} -img.icon { +img.icon { margin-right: 0.5ex; border: 0px; } button.mmbase-logo {background-image: url("mmbase.png");} -.kupu-removediv {background-image: url("../common/kupuimages/remove.png");} \ No newline at end of file +.kupu-removediv { + background-image: url("../common/kupuimages/remove.png"); +} + + +div.kupu-toolbox.left-box { + width: 260px; + left: 0px; +} + +div.kupu-toolbox.left-box h1 { + color: black; +} + +.mm_related h2 { + background-color: white; + color: black; + font-size: 1em; + margin: 0; + +} + +.mm_related div.searchresult table { + width: 260px; +} +.mm_related div.searchresult table thead { + display: none; +} +.mm_related td.fields { + display: none; +} + + +.mm_related table.create { + width: 260px; + overflow: auto; +} +.mm_related table.create th { + width: 50px; + text-align: left; + font-size: 0.6em; +} +.mm_related table.create input.mm_validate { + width: 200px; +} +.mm_related table.create input[type='file'].mm_validate { + width: 50px; +} Modified: kupu/branch/kupu-1.4/mmbase/mmbase.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/mmbase.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/mmbase.kupu Wed May 28 15:35:26 2008 @@ -32,6 +32,11 @@ <kupu:insert-part feature="body" part="fulleditor" /> </div> </kupu:part> + + <kupu:part name="styles"> + <link href="mmbase.css" rel="stylesheet" type="text/css" /> + </kupu:part> + <kupu:part name="header"> <div id="header"> <fmt:bundle basename="org.mmbase.kupu.Messages"> Modified: kupu/branch/kupu-1.4/mmbase/saveonpart.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/saveonpart.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/saveonpart.kupu Wed May 28 15:35:26 2008 @@ -6,7 +6,7 @@ xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:kupu="http://kupu.oscom.org/namespaces/dist" > - <kupu:id>$Id: saveonpart.kupu,v 1.3 2005/09/14 17:24:31 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="jsincludes"> <!-- saveonpart function is in mmbase.js --> Modified: kupu/branch/kupu-1.4/mmbase/toolbar.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/toolbar.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/toolbar.kupu Wed May 28 15:35:26 2008 @@ -8,7 +8,7 @@ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" i18n:domain="kupu" > - <kupu:id>$Id: toolbar.kupu,v 1.12 2005/06/30 17:11:44 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <!-- lets limit ourselves to 2 ways of emphasis (in stead of 3) --> <kupu:part name="buttongroup-basicmarkup"> Modified: kupu/branch/kupu-1.4/mmbase/toolboxes.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/toolboxes.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/toolboxes.kupu Wed May 28 15:35:26 2008 @@ -9,7 +9,7 @@ xmlns="http://www.w3.org/1999/xhtml" i18n:domain="kupu" > - <kupu:id>$Id: toolboxes.kupu,v 1.9 2005/09/08 08:30:31 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="images"> Modified: kupu/branch/kupu-1.4/mmbase/wire.kupu ============================================================================== --- kupu/branch/kupu-1.4/mmbase/wire.kupu (original) +++ kupu/branch/kupu-1.4/mmbase/wire.kupu Wed May 28 15:35:26 2008 @@ -1,6 +1,6 @@ <!-- - @version $Id: wire.kupu,v 1.12 2005/07/11 16:33:48 michiel Exp $ + @version $Id$ @author Michiel Meeuwissen <michiel.meeuwissen at gmail.com> --> <kupu:wire @@ -12,6 +12,7 @@ <kupu:insert-part feature="head" part="meta" /> <kupu:insert-part feature="head" part="styles" /> <kupu:insert-part feature="drawers" part="styles" /> + <kupu:insert-part feature="mmbase" part="styles" /> <kupu:insert-part feature="head" part="jsincludes" /> <kupu:insert-part feature="contextmenu" part="jsincludes" /> <kupu:insert-part feature="head" part="bootstrap-editor" /> Modified: kupu/branch/kupu-1.4/plone/html2captioned.py ============================================================================== --- kupu/branch/kupu-1.4/plone/html2captioned.py (original) +++ kupu/branch/kupu-1.4/plone/html2captioned.py Wed May 28 15:35:26 2008 @@ -7,7 +7,12 @@ # The transform finds all the embedded images, and replaces them with # an appropriate chunk of HTML to include the caption. # +try: + from Products.PortalTransforms.z3.interfaces import ITransform +except ImportError: + ITransform = None from Products.PortalTransforms.interfaces import itransform + from DocumentTemplate.DT_Util import html_quote from DocumentTemplate.DT_Var import newline_to_br from Products.CMFCore.utils import getToolByName @@ -18,6 +23,7 @@ from Acquisition import aq_base from htmlentitydefs import name2codepoint from Products.kupu.plone.config import UID_PATTERN +from zope.interface import implements name2codepoint = name2codepoint.copy() name2codepoint['apos']=ord("'") @@ -70,6 +76,8 @@ class HTMLToCaptioned: """Transform which adds captions to images embedded in HTML""" + if ITransform is not None: + implements(ITransform) __implements__ = itransform __name__ = "html_to_captioned" inputs = ('text/html',) @@ -551,6 +559,13 @@ if obj is not None: newurl = obj.absolute_url() return uid, newurl, tail + # If the uid doesn't exist then we can try the fallback + # script. Even if the fallback works though we'll assume + # an external link for simplicity. + hook = getattr(self.tool, 'kupu_resolveuid_hook', None) + if hook: + target = hook(uid) + return None, target, '' return None, None, None def classifyLink(self, url, base, first=True): @@ -577,6 +592,8 @@ if 'resolveuid/' in absurl: UID, newurl, ntail = self.resolveToPath(absurl) if UID is None: + if newurl: + return 'external', None, newurl, ntail return 'bad', None, url, '' absurl = newurl tail = ntail + tail @@ -675,4 +692,6 @@ return unichr(name2codepoint[code]) return match.group(0) - return EntityPattern.sub(unescape, s.decode(encoding)) + if isinstance(s, str): + s = s.decode(encoding) + return EntityPattern.sub(unescape, s) Modified: kupu/branch/kupu-1.4/plone/interfaces.py ============================================================================== --- kupu/branch/kupu-1.4/plone/interfaces.py (original) +++ kupu/branch/kupu-1.4/plone/interfaces.py Wed May 28 15:35:26 2008 @@ -11,7 +11,7 @@ $Id$ """ -from Interface import Interface +from zope.interface import Interface class ILibraryManager(Interface): """Provide an interface for managing and retrieving libraries for Modified: kupu/branch/kupu-1.4/plone/kupu2html.py ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu2html.py (original) +++ kupu/branch/kupu-1.4/plone/kupu2html.py Wed May 28 15:35:26 2008 @@ -7,12 +7,20 @@ # The transform is the same as the one done by html2captioned, but # this version expects to work on text/x-html-raw +try: + from Products.PortalTransforms.z3.interfaces import ITransform +except ImportError: + ITransform = None from Products.PortalTransforms.interfaces import itransform + from Products.kupu.plone import html2captioned from Products.CMFCore.utils import getToolByName +from zope.interface import implements class KupuOutputTransform(html2captioned.HTMLToCaptioned): """Transform which adds captions to images embedded in HTML""" + if ITransform is not None: + implements(ITransform) __implements__ = itransform __name__ = "kupu_raw_to_html" inputs = ('text/x-html-raw',) Modified: kupu/branch/kupu-1.4/plone/kupu_config.pt ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_config.pt (original) +++ kupu/branch/kupu-1.4/plone/kupu_config.pt Wed May 28 15:35:26 2008 @@ -103,14 +103,15 @@ </span> <span tal:condition="not:isTransformEnabled"> <tal:block i18n:translate="help_enable_transform"> - If you enable this option a transform to hide UIDs and support image - captioning from client browsers will also be enabled + If you enable this option a transform to hide UIDs and support image + captioning from client browsers will also be enabled </tal:block> (<a i18n:translate="help_image_captioning_url" - href="zmi_docs#images">see image captioning documentation</a>). + tal:attributes="href string:${context/absolute_url}/zmi_docs#images" + href="zmi_docs#images">see image captioning documentation</a>). <tal:block i18n:translate="help_update_portal_transforms"> - If the transform does not enable itself automatically you may - need to update your PortalTransforms product. + If the transform does not enable itself automatically you may + need to update your PortalTransforms product. </tal:block> </span> </div> @@ -138,7 +139,8 @@ captioning from client browsers will also be enabled </tal:block> (<a i18n:translate="help_image_captioning_url" - href="zmi_docs#images">see image captioning documentation</a>). + tal:attributes="href string:${context/absolute_url}/zmi_docs#images" + href="zmi_docs#images">see image captioning documentation</a>). <tal:block i18n:translate="help_update_portal_transforms"> If the transform does not enable itself automatically you may need to update your PortalTransforms product. Modified: kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupucollection.xml.pt ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupucollection.xml.pt (original) +++ kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupucollection.xml.pt Wed May 28 15:35:26 2008 @@ -108,7 +108,7 @@ <size tal:condition="origok"> <selected tal:condition="python:defscale in ('original', '')" /> <label i18n:translate="option_original">Original</label> - <uri tal:content="info/url" /> + <uri/> </size> </sizes> </uploadbutton> Modified: kupu/branch/kupu-1.4/plone/libraries.pt ============================================================================== --- kupu/branch/kupu-1.4/plone/libraries.pt (original) +++ kupu/branch/kupu-1.4/plone/libraries.pt Wed May 28 15:35:26 2008 @@ -133,35 +133,35 @@ <p i18n:translate="available_tales">The following variables are available in the TALES expressions:</p> <table> <tr> - <td><code i18n:translate="object_variable">object</code></td> + <td><code>object</code></td> <td i18n:translate="current_context">The current context object</td> </tr> <tr> - <td><code i18n:translate="object_url_variable">object_url</code></td> + <td><code>object_url</code></td> <td i18n:translate="current_context_url">The URL of the current context object</td> </tr> <tr> - <td><code i18n:translate="folder_variable">folder</code></td> + <td><code>folder</code></td> <td i18n:translate="context_folder">The folder the context object is located in</td> </tr> <tr> - <td><code i18n:translate="folder_url_variable">folder_url</code></td> + <td><code>folder_url</code></td> <td i18n:translate="context_folder_uri">The URL of the folder the context object is located in</td> </tr> <tr> - <td><code i18n:translate="portal_variable">portal</code></td> + <td><code>portal</code></td> <td i18n:translate="portal_object">The portal object</td> </tr> <tr> - <td><code i18n:translate="portal_url_variable">portal_url</code></td> + <td><code>portal_url</code></td> <td i18n:translate="portal_object_url">URL of the portal</td> </tr> <tr> - <td><code i18n:translate="member_variable">member</code></td> + <td><code>member</code></td> <td i18n:translate="authenticated_member">Authenticated member</td> </tr> <tr> - <td><code i18n:translate="request_variable">request</code></td> + <td><code>request</code></td> <td i18n:translate="request">Request</td> </tr> </table> Modified: kupu/branch/kupu-1.4/plone/librarytool.py ============================================================================== --- kupu/branch/kupu-1.4/plone/librarytool.py (original) +++ kupu/branch/kupu-1.4/plone/librarytool.py Wed May 28 15:35:26 2008 @@ -19,6 +19,7 @@ from Products.PageTemplates.Expressions import getEngine, SecureModuleImporter from Products.kupu.plone.interfaces import IKupuLibraryTool from Products.CMFCore.utils import getToolByName +from zope.interface import implements class KupuError(Exception): pass NEWTYPE_IGNORE, NEWTYPE_ADD = 0, 1 @@ -29,7 +30,7 @@ class KupuLibraryTool(Acquisition.Implicit): """A tool to aid Kupu libraries""" - __implements__ = IKupuLibraryTool + implements(IKupuLibraryTool) def __init__(self): self._libraries = [] Modified: kupu/branch/kupu-1.4/plone/plonedrawers.py ============================================================================== --- kupu/branch/kupu-1.4/plone/plonedrawers.py (original) +++ kupu/branch/kupu-1.4/plone/plonedrawers.py Wed May 28 15:35:26 2008 @@ -491,9 +491,12 @@ preview = None previewsize = (0,0) for k in sizes: - if previewsize < sizes[k] <= (128,128): - preview = k - previewsize = sizes[k] + try: + if previewsize < sizes[k] <= (128,128): + preview = k + previewsize = sizes[k] + except TypeError: # Fails on Plone 2.1 + return field.getName() if not preview: smallest = min(sizes.values()) for k in sizes: Modified: kupu/branch/kupu-1.4/plone/plonelibrarytool.py ============================================================================== --- kupu/branch/kupu-1.4/plone/plonelibrarytool.py (original) +++ kupu/branch/kupu-1.4/plone/plonelibrarytool.py Wed May 28 15:35:26 2008 @@ -241,7 +241,7 @@ if REQUEST: REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_toolbar') - security.declareProtected(permissions.ManageLibraries, "getGlobalButtonFilter") + security.declareProtected("View", "getGlobalButtonFilter") def getGlobalButtonFilter(self): gfilter = getattr(self, '_global_toolbar_filter', None) if gfilter is not None: @@ -644,7 +644,7 @@ t.mode = 'whitelist' return types - security.declareProtected(permissions.ManageLibraries, "get_resourcetypes") + security.declareProtected("View", "get_resourcetypes") def get_resourcetypes(self): """Return the type mapping, but without the ZMI dummy entry""" keys = self._res_types.keys() @@ -656,7 +656,7 @@ real.append(wrapped) return real - security.declareProtected(permissions.ManageLibraries, "zmi_get_resourcetypes") + security.declareProtected("View", "zmi_get_resourcetypes") def zmi_get_resourcetypes(self): """Return the type mapping for the ZMI view""" real = self.get_resourcetypes() @@ -691,29 +691,29 @@ if (REQUEST): REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_resource_types') - security.declareProtected(permissions.ManageLibraries, "getPreviewForType") + security.declareProtected("View", "getPreviewForType") def getPreviewForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) expr = action_map.get(portal_type, {}).get('expression', '') return getattr(expr, 'text', expr) - security.declareProtected(permissions.ManageLibraries, "getNormalViewForType") + security.declareProtected("View", "getNormalViewForType") def getNormalViewForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) expr = action_map.get(portal_type, {}).get('normal', '') return getattr(expr, 'text', expr) - security.declareProtected(permissions.ManageLibraries, "getScaleFieldForType") + security.declareProtected("View", "getScaleFieldForType") def getScaleFieldForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) value = action_map.get(portal_type, {}).get('scalefield', 'image') return value - security.declareProtected(permissions.ManageLibraries, "getDefaultImageType") + security.declareProtected("View", "getDefaultImageType") def getDefaultImageType(self): return 'Image' - security.declareProtected(permissions.ManageLibraries, "getDefaultScaleForType") + security.declareProtected("View", "getDefaultScaleForType") def getDefaultScaleForType(self, portal_type = None): if not portal_type: portal_type = self.getDefaultImageType() @@ -721,12 +721,12 @@ value = action_map.get(portal_type, {}).get('defscale', 'image_preview') return value - security.declareProtected(permissions.ManageLibraries, "getClassesForType") + security.declareProtected("View", "getClassesForType") def getClassesForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) return action_map.get(portal_type, {}).get('classes', ()) - security.declareProtected(permissions.ManageLibraries, "getMediaForType") + security.declareProtected("View", "getMediaForType") def getMediaForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) value = action_map.get(portal_type, {}).get('mediatype', 'image') Modified: kupu/branch/kupu-1.4/plone/profiles/default/metadata.xml ============================================================================== --- kupu/branch/kupu-1.4/plone/profiles/default/metadata.xml (original) +++ kupu/branch/kupu-1.4/plone/profiles/default/metadata.xml Wed May 28 15:35:26 2008 @@ -1,4 +1,4 @@ <?xml version="1.0"?> <metadata> - <version>1.4.9</version> + <version>1.4.10</version> </metadata> Modified: kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py (original) +++ kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py Wed May 28 15:35:26 2008 @@ -8,6 +8,10 @@ from os.path import join, abspath, dirname from Products.PortalTransforms.tests.test_transforms import * +try: + from Products.PortalTransforms.z3.interfaces import IDataStream +except ImportError: + IDataStream = None from Products.PortalTransforms.tests.utils import normalize_html from Products.kupu import kupu_globals @@ -39,7 +43,8 @@ input.close() data = datastream(self.transform.name()) res_data = self.transform.convert(orig, data, filename=filename, context=self.portal) - self.assert_(idatastream.isImplementedBy(res_data)) + if IDataStream is not None: + self.assert_(IDataStream.providedBy(res_data)) got = res_data.getData() try: output = open(output) Modified: kupu/branch/kupu-1.4/plone/tests/test_i18n.py ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/test_i18n.py (original) +++ kupu/branch/kupu-1.4/plone/tests/test_i18n.py Wed May 28 15:35:26 2008 @@ -11,6 +11,7 @@ except ImportError: HAS_I18NDUDE = False +tests=[] if HAS_I18NDUDE: GLOBALS = globals() PACKAGE_HOME = os.path.normpath(os.path.join(package_home(GLOBALS), '..', '..')) @@ -21,7 +22,6 @@ i18ndir = os.path.normpath(PACKAGE_HOME) - tests=[] products=[] pots={} pot_catalogs={} @@ -52,9 +52,9 @@ pot_len = pot_lens[product] tests.append(TestOnePoFile) - import unittest - def test_suite(): - suite = unittest.TestSuite() - for test in tests: - suite.addTest(unittest.makeSuite(test)) - return suite +import unittest +def test_suite(): + suite = unittest.TestSuite() + for test in tests: + suite.addTest(unittest.makeSuite(test)) + return suite Modified: kupu/branch/kupu-1.4/version.txt ============================================================================== --- kupu/branch/kupu-1.4/version.txt (original) +++ kupu/branch/kupu-1.4/version.txt Wed May 28 15:35:26 2008 @@ -1 +1 @@ -kupu 1.4.9 +kupu 1.4.10 Modified: kupu/branch/kupu-1.4/widgeteer/kupuinit.js ============================================================================== --- kupu/branch/kupu-1.4/widgeteer/kupuinit.js (original) +++ kupu/branch/kupu-1.4/widgeteer/kupuinit.js Wed May 28 15:35:26 2008 @@ -46,6 +46,9 @@ // if we don't first focus the outer window, Mozilla won't show a cursor window.focus(); this.getDocument().getWindow().focus(); + if (this.afterWidgeteerInit) { + this.afterWidgeteerInit(this); + }; }; function WidgeteerDrawerTool() { Modified: kupu/branch/kupu-1.4/widgeteer/kupustyles.css ============================================================================== --- kupu/branch/kupu-1.4/widgeteer/kupustyles.css (original) +++ kupu/branch/kupu-1.4/widgeteer/kupustyles.css Wed May 28 15:35:26 2008 @@ -182,6 +182,7 @@ iframe.kupu-editor-iframe { width: 100%; height: 100%; + margin-bottom: -3em; } textarea.kupu-editor-textarea { From eric at codespeak.net Wed May 28 17:02:44 2008 From: eric at codespeak.net (eric at codespeak.net) Date: Wed, 28 May 2008 17:02:44 +0200 (CEST) Subject: [kupu-checkins] r55354 - kupu/branch/kupu-1.4-silva Message-ID: <20080528150244.18DB4698071@codespeak.net> Author: eric Date: Wed May 28 17:02:42 2008 New Revision: 55354 Added: kupu/branch/kupu-1.4-silva/ - copied from r55353, kupu/tag/kupu-1.4b1/ Log: copying to a silva specific branch From eric at codespeak.net Wed May 28 17:03:43 2008 From: eric at codespeak.net (eric at codespeak.net) Date: Wed, 28 May 2008 17:03:43 +0200 (CEST) Subject: [kupu-checkins] r55355 - kupu/branch/kupu-1.4-silva/common Message-ID: <20080528150343.E89A4698071@codespeak.net> Author: eric Date: Wed May 28 17:03:42 2008 New Revision: 55355 Modified: kupu/branch/kupu-1.4-silva/common/kupuhelpers.js Log: fix by jasper for firefox 3 problems Modified: kupu/branch/kupu-1.4-silva/common/kupuhelpers.js ============================================================================== --- kupu/branch/kupu-1.4-silva/common/kupuhelpers.js (original) +++ kupu/branch/kupu-1.4-silva/common/kupuhelpers.js Wed May 28 17:03:42 2008 @@ -774,7 +774,7 @@ while (child) { // XXX the additional conditions catch some invisible // intersections, but still not all of them - if (range.intersectsNode(child) && + if (rangeIntersectsNode(range, child) && !(child == startNode && startOffset == child.length) && !(child == endNode && endOffset == 0)) { if (selectedChild) { @@ -1409,3 +1409,21 @@ image.height = height; image.width = width; }; + +// Following function is to replace the deprecated range.intersectsNode +// see http://developer.mozilla.org/en/docs/DOM:range.intersectsNode +// for more info + +function rangeIntersectsNode(range, node) { + var nodeRange = node.ownerDocument.createRange(); + try { + nodeRange.selectNode(node); + } + catch (e) { + nodeRange.selectNodeContents(node); + } + + return range.compareBoundaryPoints(Range.END_TO_START, nodeRange) == -1 && + range.compareBoundaryPoints(Range.START_TO_END, nodeRange) == 1; +} + From eric at codespeak.net Thu May 29 12:11:53 2008 From: eric at codespeak.net (eric at codespeak.net) Date: Thu, 29 May 2008 12:11:53 +0200 (CEST) Subject: [kupu-checkins] r55383 - kupu/branch/kupu-1.4-silva Message-ID: <20080529101153.A9EB1168409@codespeak.net> Author: eric Date: Thu May 29 12:11:51 2008 New Revision: 55383 Modified: kupu/branch/kupu-1.4-silva/version.txt Log: version Modified: kupu/branch/kupu-1.4-silva/version.txt ============================================================================== --- kupu/branch/kupu-1.4-silva/version.txt (original) +++ kupu/branch/kupu-1.4-silva/version.txt Thu May 29 12:11:51 2008 @@ -1 +1 @@ -kupu 1.4b1 +kupu 1.4b2-silva From eric at codespeak.net Thu May 29 12:12:54 2008 From: eric at codespeak.net (eric at codespeak.net) Date: Thu, 29 May 2008 12:12:54 +0200 (CEST) Subject: [kupu-checkins] r55384 - kupu/tag/kupu-1.4b2-silva Message-ID: <20080529101254.4FF6A168409@codespeak.net> Author: eric Date: Thu May 29 12:12:53 2008 New Revision: 55384 Added: kupu/tag/kupu-1.4b2-silva/ - copied from r55383, kupu/branch/kupu-1.4-silva/ Log: beta tag From guido at codespeak.net Thu May 29 17:55:01 2008 From: guido at codespeak.net (guido at codespeak.net) Date: Thu, 29 May 2008 17:55:01 +0200 (CEST) Subject: [kupu-checkins] r55400 - kupu/trunk/kupu/common Message-ID: <20080529155501.BEB3F1684E9@codespeak.net> Author: guido Date: Thu May 29 17:55:00 2008 New Revision: 55400 Modified: kupu/trunk/kupu/common/kupuhelpers.js kupu/trunk/kupu/common/kuputoolcollapser.js Log: Fixed some problems in NodeIterator, fixed exception in kuputoolcollapser if elements didn't have a class name set. Modified: kupu/trunk/kupu/common/kupuhelpers.js ============================================================================== --- kupu/trunk/kupu/common/kupuhelpers.js (original) +++ kupu/trunk/kupu/common/kupuhelpers.js Thu May 29 17:55:00 2008 @@ -327,10 +327,10 @@ this.current = current.firstChild; } else { // walk up parents until we finish or find one with a nextSibling - while (current != this.terminator && !current.nextSibling) { + while (current !== this.terminator && !current.nextSibling) { current = current.parentNode; }; - if (current == this.terminator) { + if (current === this.terminator) { this.current = false; } else { this.current = current.nextSibling; @@ -620,6 +620,9 @@ if (currnode.nodeType == 3) { offset += currnode.nodeValue.length; }; + while (!currnode.nextSibling) { + currnode = currnode.parentNode; + }; currnode = currnode.nextSibling; }; return offset + startnodeoffset; Modified: kupu/trunk/kupu/common/kuputoolcollapser.js ============================================================================== --- kupu/trunk/kupu/common/kuputoolcollapser.js (original) +++ kupu/trunk/kupu/common/kuputoolcollapser.js Thu May 29 17:55:00 2008 @@ -20,7 +20,7 @@ }; for (var i=0; i < this.parent.childNodes.length; i++) { var child = this.parent.childNodes[i]; - if (child.className.match(/\bkupu-toolbox\b/)) { + if (child.className && child.className.match(/\bkupu-toolbox\b/)) { var heading = child.getElementsByTagName('h1')[0]; if (!heading) { throw('heading not found by collapser for toolbox ' +