From duncan at codespeak.net Mon Oct 1 11:48:24 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 1 Oct 2007 11:48:24 +0200 (CEST) Subject: [kupu-checkins] r47067 - kupu/trunk/kupu/plone Message-ID: <20071001094824.C32C78131@code0.codespeak.net> Author: duncan Date: Mon Oct 1 11:48:24 2007 New Revision: 47067 Modified: kupu/trunk/kupu/plone/util.py Log: Plone ticket #6970 (can't upgrade to Kupu 1.4.1) Added a workaround for a problem with PortalTransforms. When reinstalling kupu the old transforms are removed and then added again. The identity transform captioned-to-html has parameters which need to be set after adding the transform, and it appears that if all three operations (remove, add and update) happen in the same transaction this error occurs. I've added a savepoint to the transaction for the case where it creates the identity transform and that seems to fix the problem. Modified: kupu/trunk/kupu/plone/util.py ============================================================================== --- kupu/trunk/kupu/plone/util.py (original) +++ kupu/trunk/kupu/plone/util.py Mon Oct 1 11:48:24 2007 @@ -92,7 +92,15 @@ if not hasattr(transform_tool, INVERSE_TRANSFORM): transform_tool.manage_addTransform(INVERSE_TRANSFORM, 'Products.PortalTransforms.transforms.identity') - + # Need to commit a subtransaction here, otherwise setting the + # parameters will cause an exception when the transaction is + # finally comitted. + try: + import transaction + transaction.savepoint(optimistic=True) + except ImportError: + get_transaction().commit(1) + inverse = transform_tool[INVERSE_TRANSFORM] if inverse.get_parameter_value('inputs') != [MT_CAPTIONED] or inverse.get_parameter_value('output') != 'text/html': inverse.set_parameters(inputs=[MT_CAPTIONED], output='text/html') From duncan at codespeak.net Mon Oct 1 12:49:10 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 1 Oct 2007 12:49:10 +0200 (CEST) Subject: [kupu-checkins] r47069 - in kupu/trunk/kupu/plone: . kupu_plone_layer Message-ID: <20071001104910.71C9880FE@code0.codespeak.net> Author: duncan Date: Mon Oct 1 12:49:09 2007 New Revision: 47069 Modified: kupu/trunk/kupu/plone/body.kupu kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html Log: Plone ticket #7119: 'Edit without visual editor' link doesn't show up in Plone 2.5.3 Plone 2.5.x doesn't have the getAllowedContentTypes method on fields, so we have to fall back to accessing the attribute directly. Modified: kupu/trunk/kupu/plone/body.kupu ============================================================================== --- kupu/trunk/kupu/plone/body.kupu (original) +++ kupu/trunk/kupu/plone/body.kupu Mon Oct 1 12:49:09 2007 @@ -65,8 +65,10 @@
- + @@ -477,7 +477,7 @@
-
+ From duncan at codespeak.net Mon Oct 1 14:47:44 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 1 Oct 2007 14:47:44 +0200 (CEST) Subject: [kupu-checkins] r47073 - kupu/trunk/kupu/doc Message-ID: <20071001124744.BA8A380AB@code0.codespeak.net> Author: duncan Date: Mon Oct 1 14:47:43 2007 New Revision: 47073 Modified: kupu/trunk/kupu/doc/CHANGES.txt Log: Record recent changes Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Mon Oct 1 14:47:43 2007 @@ -4,9 +4,17 @@ - SVN + - Kupu now uses sarissa 0.9.8.1 (still a differences in + sarissa_ieemu_xpath.js, but these are purely cosmetic so that jslint + runs cleanly). + - Plone tickets + * 6970: can't upgrade to Kupu 1.4.1 * 6975: Cannot save HTML field as NULL + * 7119: 'Edit without visual editor' link doesn't show up in Plone 2.5.3 + * 7140: kupu fails with danish letters in title. + * 7139: Kupu Manage Anchors not working in inline edit - 1.4.2 From duncan at codespeak.net Thu Oct 4 10:48:07 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 4 Oct 2007 10:48:07 +0200 (CEST) Subject: [kupu-checkins] r47143 - in kupu/trunk/kupu: doc plone plone/kupu_plone_layer Message-ID: <20071004084807.506108175@code0.codespeak.net> Author: duncan Date: Thu Oct 4 10:48:07 2007 New Revision: 47143 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/html2captioned.py kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt Log: Fix for Plone issue #7143: UnicodeError inserting image Also the fix broke captioning, so I cleaned up the captioning code and associated template moving all of the logic out of the template into the Python code. Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu Oct 4 10:48:07 2007 @@ -13,8 +13,9 @@ * 6970: can't upgrade to Kupu 1.4.1 * 6975: Cannot save HTML field as NULL * 7119: 'Edit without visual editor' link doesn't show up in Plone 2.5.3 - * 7140: kupu fails with danish letters in title. * 7139: Kupu Manage Anchors not working in inline edit + * 7140: kupu fails with danish letters in title. + * 7143: UnicodeError inserting image - 1.4.2 Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Thu Oct 4 10:48:07 2007 @@ -137,18 +137,39 @@ d['class'] = attrs.group('class') d['originalwidth'] = attrs.group('width') d['originalalt'] = attrs.group('alt') + d['url_path'] = target.absolute_url_path() d['caption'] = newline_to_br(html_quote(target.Description())) d['image'] = d['fullimage'] = target + d['tag'] = None + d['isfullsize'] = False + d['width'] = target.width if srctail: + if isinstance(srctail, unicode): + srctail =srctail.encode('utf8') # restrictedTraverse doesn't accept unicode try: subtarget = target.restrictedTraverse(srctail) except: subtarget = getattr(target, srctail, None) if subtarget: d['image'] = subtarget + + if srctail.startswith('image_'): + d['tag'] = target.getField('image').tag(target, scale=srctail[6:]) + elif subtarget: + d['tag'] = subtarget.tag() + + if d['tag'] is None: + d['tag'] = target.tag() + + if subtarget: + d['isfullsize'] = subtarget.width == target.width and subtarget.height == target.height + d['width'] = subtarget.width + return template(**d) return match.group(0) # No change + if isinstance(data, str): + data = data.decode('utf8') html = IMAGE_PATTERN.sub(replaceImage, data) # Replace urls that use UIDs with human friendly urls. Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt Thu Oct 4 10:48:07 2007 @@ -1,15 +1,9 @@ -
-
+
+
[image goes here]
From duncan at codespeak.net Thu Oct 4 11:08:47 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 4 Oct 2007 11:08:47 +0200 (CEST) Subject: [kupu-checkins] r47144 - kupu/trunk/kupu/plone Message-ID: <20071004090847.E3977816B@code0.codespeak.net> Author: duncan Date: Thu Oct 4 11:08:45 2007 New Revision: 47144 Modified: kupu/trunk/kupu/plone/util.py Log: Fix compatibility with earlier Plone versions broken by revision 46952 Modified: kupu/trunk/kupu/plone/util.py ============================================================================== --- kupu/trunk/kupu/plone/util.py (original) +++ kupu/trunk/kupu/plone/util.py Thu Oct 4 11:08:45 2007 @@ -132,11 +132,11 @@ transform_tool.manage_addPolicy(MT_SAFE, required) try: - import zope.i18nmessageid - import zope.i18n + from zope.i18nmessageid import Message + from zope.i18n import translate as i18n_translate def translate(label, context): - if isinstance(label, zope.i18nmessageid.Message): - return zope.i18n.translate(label, context=context) + if isinstance(label, Message): + return i18n_translate(label, context=context) return label except ImportError: def translate(label, context): From duncan at codespeak.net Thu Oct 4 11:49:16 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 4 Oct 2007 11:49:16 +0200 (CEST) Subject: [kupu-checkins] r47145 - in kupu/trunk/kupu: doc plone Message-ID: <20071004094916.441BC8181@code0.codespeak.net> Author: duncan Date: Thu Oct 4 11:49:15 2007 New Revision: 47145 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/plonedrawers.py Log: Applied suggested patch for plone ticket #7158: Kupu Edit already inserted image: Preview and sizes get wrong urls (I couldn't reproduce the issue, but the patch looks sensible anyway) Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu Oct 4 11:49:15 2007 @@ -16,6 +16,7 @@ * 7139: Kupu Manage Anchors not working in inline edit * 7140: kupu fails with danish letters in title. * 7143: UnicodeError inserting image + * 7158: Kupu Edit already inserted image: Preview and sizes get wrong urls - 1.4.2 Modified: kupu/trunk/kupu/plone/plonedrawers.py ============================================================================== --- kupu/trunk/kupu/plone/plonedrawers.py (original) +++ kupu/trunk/kupu/plone/plonedrawers.py Thu Oct 4 11:49:15 2007 @@ -20,6 +20,7 @@ from Globals import InitializeClass from Products.Archetypes.public import * from Products.Archetypes.interfaces.referenceable import IReferenceable +from Products.Archetypes.utils import shasattr from Products.PythonScripts.standard import html_quote, newline_to_br from Products.kupu.plone import util from Products.kupu.plone.librarytool import KupuError @@ -648,6 +649,8 @@ except AttributeError: return [] if portal_types: + while not shasattr(obj.aq_base, 'portal_type'): + obj = obj.aq_parent while obj.portal_type not in portal_types: obj = obj.aq_parent if obj is portal: From duncan at codespeak.net Fri Oct 5 15:39:53 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 5 Oct 2007 15:39:53 +0200 (CEST) Subject: [kupu-checkins] r47191 - in kupu/trunk/kupu: . doc Message-ID: <20071005133953.B4B48818F@code0.codespeak.net> Author: duncan Date: Fri Oct 5 15:39:53 2007 New Revision: 47191 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/version.txt Log: Update version numbers for 1.4.3 release Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Oct 5 15:39:53 2007 @@ -2,7 +2,7 @@ Kupu changes ============ -- SVN +- 1.4.3 - Kupu now uses sarissa 0.9.8.1 (still a differences in sarissa_ieemu_xpath.js, but these are purely cosmetic so that jslint Modified: kupu/trunk/kupu/version.txt ============================================================================== --- kupu/trunk/kupu/version.txt (original) +++ kupu/trunk/kupu/version.txt Fri Oct 5 15:39:53 2007 @@ -1 +1 @@ -kupu 1.4.2 +kupu 1.4.3 From duncan at codespeak.net Fri Oct 5 16:49:24 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 5 Oct 2007 16:49:24 +0200 (CEST) Subject: [kupu-checkins] r47192 - kupu/tag/kupu-1.4.3 Message-ID: <20071005144924.77660815D@code0.codespeak.net> Author: duncan Date: Fri Oct 5 16:49:23 2007 New Revision: 47192 Added: kupu/tag/kupu-1.4.3/ - copied from r47191, kupu/trunk/kupu/ Log: Created tag for 1.4.3 From kupu-checkins at codespeak.net Tue Oct 9 00:37:14 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Tue, 9 Oct 2007 00:37:14 +0200 (CEST) Subject: [kupu-checkins] October 75% OFF Message-ID: <20071009053839.22895.qmail@ppp85-140-102-93.pppoe.mtu-net.ru> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071009/e55047e2/attachment.htm From duncan at codespeak.net Wed Oct 10 13:29:25 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Wed, 10 Oct 2007 13:29:25 +0200 (CEST) Subject: [kupu-checkins] r47378 - in kupu/trunk/kupu: common plone Message-ID: <20071010112925.C1C9181F5@code0.codespeak.net> Author: duncan Date: Wed Oct 10 13:29:24 2007 New Revision: 47378 Modified: kupu/trunk/kupu/common/kupudrawers.js kupu/trunk/kupu/common/kupuhelpers.js kupu/trunk/kupu/plone/plonelibrarytool.py Log: Work round missing Selection methods for Safari compatability Modified: kupu/trunk/kupu/common/kupudrawers.js ============================================================================== --- kupu/trunk/kupu/common/kupudrawers.js (original) +++ kupu/trunk/kupu/common/kupudrawers.js Wed Oct 10 13:29:24 2007 @@ -440,7 +440,7 @@ var there = preview.contentWindow.location.href; } catch(e) { return; } - if (here != there && !(/^about:/.test(there))) { + if (there && here != there && !(/^about:/.test(there))) { input.value = there; } this.showAnchors(currentAnchor()); @@ -926,8 +926,10 @@ if (this.editor.getBrowserName() == 'IE') { newitemsnode = newitemsnode.cloneNode(true); + if (newbc) newbc = newbc.cloneNode(true); } else { newitemsnode = this.xmldata.importNode(newitemsnode, true); + if (newbc) newbc = this.xmldata.importNode(newbc, true); } if (newbc) { if (bcnode) { @@ -1297,7 +1299,7 @@ if (this.editor.getBrowserName() == 'IE') { resultlib = resultlib.cloneNode(true); } else { - this.xmldata.importNode(resultlib, true); + resultlib = this.xmldata.importNode(resultlib, true); } var libraries = this.xmldata.selectSingleNode("/libraries"); libraries.appendChild(resultlib); @@ -1398,10 +1400,20 @@ } this.createContent = function() { + function getSel(sel, p, t) { + var nodes = p.getElementsByTagName(t); + for (var i = 0; i < nodes.length; i++) { + if (sel.containsNode(nodes[i])) { + return nodes[i]; + }; + }; + } var ed = this.editor; + var sel = ed.getSelection(); var currnode = ed.getSelectedNode(); - var currimg = ed.getNearestParentOfType(currnode, 'OBJECT') || ed.getNearestParentOfType(currnode, 'IMG'); - this.selectedSrc = currimg.data||currimg.src||null; + var currimg = ed.getNearestParentOfType(currnode, 'OBJECT') || ed.getNearestParentOfType(currnode, 'IMG') || + getSel(sel, currnode, 'object') || getSel(sel, currnode, 'img'); + this.selectedSrc = currimg?(currimg.data||currimg.src||null):null; this.options = {}; if (currimg) { ed.getSelection().selectNodeContents(currimg); Modified: kupu/trunk/kupu/common/kupuhelpers.js ============================================================================== --- kupu/trunk/kupu/common/kupuhelpers.js (original) +++ kupu/trunk/kupu/common/kupuhelpers.js Wed Oct 10 13:29:24 2007 @@ -460,13 +460,27 @@ function MozillaSelection(document) { this.document = document; this.selection = document.getWindow().getSelection(); - + + this._createRange = function() { + return this.document.getDocument().createRange(); + } this.selectNodeContents = function(node) { if (node && node.parentNode) { /* select the contents of a node */ - this.selection.removeAllRanges(); - this.selection.selectAllChildren(node); - } + var sel = this.selection; + sel.removeAllRanges(); + if (sel.selectAllChildren) { + sel.selectAllChildren(node); + } else { + var range = this._createRange(); + try { + range.selectNode(node); + } catch (e) { + range.selectNodeContents(node); + }; + sel.addRange(range); + }; + }; }; this.collapse = function(collapseToEnd) { @@ -504,7 +518,7 @@ var pos = range.startOffset; // make a new range for the new selection - var range = this.document.getDocument().createRange(); + var range = this._createRange(); if (container.nodeType == 3 && node.nodeType == 3) { // if we insert text in a textnode, do optimized insertion @@ -616,9 +630,9 @@ var aoffset = this.selection.anchorOffset; var onode = this.selection.focusNode; var ooffset = this.selection.focusOffset; - var arange = this.document.getDocument().createRange(); + var arange = this._createRange(); arange.setStart(anode, aoffset); - var orange = this.document.getDocument().createRange(); + var orange = this._createRange(); orange.setStart(onode, ooffset); return arange.compareBoundaryPoints('START_TO_START', orange) <= 0 ? anode : onode; }; @@ -672,9 +686,9 @@ var aoffset = this.selection.anchorOffset; var onode = this.selection.focusNode; var ooffset = this.selection.focusOffset; - var arange = this.document.getDocument().createRange(); + var arange = this._createRange(); arange.setStart(anode, aoffset); - var orange = this.document.getDocument().createRange(); + var orange = this._createRange(); orange.setStart(onode, ooffset); return arange.compareBoundaryPoints('START_TO_START', orange) > 0 ? anode : onode; }; @@ -774,8 +788,8 @@ { var parent1 = parent; var parent2 = null; - var range1 = this.document.getDocument().createRange(); - var range2 = this.document.getDocument().createRange(); + var range1 = this._createRange(); + var range2 = this._createRange(); var parent2 = this.parentElementOfRange(this.selection.getRangeAt(i)); @@ -796,7 +810,7 @@ //just one node, which we don't want; but since parent1 //and parent2 are different, their range is not just //one node - var coverRange = this.document.getDocument().createRange(); + var coverRange = this._createRange(); coverRange.setStartBefore(parent1); coverRange.setEndAfter(parent2); parent = coverRange.commonAncestorContainer; @@ -806,7 +820,7 @@ //just one node, which we don't want; but since parent1 //and parent2 are different, their range is not just //one node - var coverRange = this.document.getDocument().createRange(); + var coverRange = this._createRange(); coverRange.setStartBefore(parent2); coverRange.setEndAfter(parent1); parent = coverRange.commonAncestorContainer; @@ -961,7 +975,18 @@ }; this.containsNode = function(node) { - return this.selection.containsNode(node, true); + var sel = this.selection; + if (sel.containsNode) { + return sel.containsNode(node, true); + } else { + // kludge it for safari + for(var i = 0; i < sel.rangeCount; i++ ) { + if( sel.getRangeAt(i).containsNode(node) ) { + return true; + } + }; + return false; + } }; this.toString = function() { @@ -991,6 +1016,8 @@ nodeRange.selectNodeContents(node); }; + // selection end after node start and selection start + // before node end return this.compareBoundaryPoints(Range.END_TO_START, nodeRange) == -1 && this.compareBoundaryPoints(Range.START_TO_END, nodeRange) == 1; }; @@ -1003,6 +1030,21 @@ }; return false; }; + if( !Range.prototype.containsNode ){ + Range.prototype.containsNode = function(node) { + var nodeRange = node.ownerDocument.createRange(); + try { + nodeRange.selectNode(node); + } catch (e) { + nodeRange.selectNodeContents(node); + }; + + // selection start not after node start and selection end + // not before node end. + return this.compareBoundaryPoints(Range.START_TO_START, nodeRange) != -1 && + this.compareBoundaryPoints(Range.END_TO_END, nodeRange) != 1; + }; + }; }; MozillaSelection.prototype = new BaseSelection; Modified: kupu/trunk/kupu/plone/plonelibrarytool.py ============================================================================== --- kupu/trunk/kupu/plone/plonelibrarytool.py (original) +++ kupu/trunk/kupu/plone/plonelibrarytool.py Wed Oct 10 13:29:24 2007 @@ -360,9 +360,12 @@ verno = getver(' rv:') if verno: return verno >= (1,3,1) -# verno = getver(' AppleWebKit/') -# if verno: -# return verno >= (420,) + verno = getver(' AppleWebKit/') + if verno: + return verno >= (523,6) + verno = getver(' Safari/') + if verno: + return verno >= (522,12) verno = getver('MSIE') if verno: From kupu-checkins at codespeak.net Mon Oct 15 22:51:39 2007 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Mon, 15 Oct 2007 22:51:39 +0200 (CEST) Subject: [kupu-checkins] LdbmTulbxZtlCp Offer Message-ID: <20071016155316.9336.qmail@ppp85-140-63-29.pppoe.mtu-net.ru> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071015/7587df89/attachment.htm From duncan at codespeak.net Thu Oct 25 16:38:29 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 25 Oct 2007 16:38:29 +0200 (CEST) Subject: [kupu-checkins] r47941 - kupu/trunk/kupu/plone Message-ID: <20071025143829.930C580E0@code0.codespeak.net> Author: duncan Date: Thu Oct 25 16:38:29 2007 New Revision: 47941 Modified: kupu/trunk/kupu/plone/plonelibrarytool.py Log: Need higher webkit version to avoid hitting regex problems Modified: kupu/trunk/kupu/plone/plonelibrarytool.py ============================================================================== --- kupu/trunk/kupu/plone/plonelibrarytool.py (original) +++ kupu/trunk/kupu/plone/plonelibrarytool.py Thu Oct 25 16:38:29 2007 @@ -362,7 +362,7 @@ return verno >= (1,3,1) verno = getver(' AppleWebKit/') if verno: - return verno >= (523,6) + return verno >= (523,11) verno = getver(' Safari/') if verno: return verno >= (522,12) From duncan at codespeak.net Thu Oct 25 17:37:31 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 25 Oct 2007 17:37:31 +0200 (CEST) Subject: [kupu-checkins] r47950 - kupu/trunk/kupu/plone/kupu_plone_layer Message-ID: <20071025153731.29E7480E5@code0.codespeak.net> Author: duncan Date: Thu Oct 25 17:37:30 2007 New Revision: 47950 Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupuplone.css.dtml Log: Plone issue #7229: kupu 1.4.3 css correction to display redo button icon in editing interface Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupuplone.css.dtml ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupuplone.css.dtml (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupuplone.css.dtml Thu Oct 25 17:37:30 2007 @@ -197,8 +197,6 @@ button.kupu-justifyright-pressed { background-position: 0 -300px; } -button.kupu-logo {} -button.kupu-redo {} button.kupu-removelink, button.kupu-removeimage { background-position: 0 -320px; } @@ -228,7 +226,8 @@ button.kupu-underline-pressed {background-image: url("&dtml-portal_url;/plonekupuimages/underline.gif");} button.kupu-undo {background-image: url("&dtml-portal_url;/plonekupuimages/undo.gif");} - +button.kupu-redo {background-image: url("&dtml-portal_url;/plonekupuimages/redo.gif");} +button.kupu-logo {background-image: url("kupuimages/kupu_icon.gif");} div.kupu-drawer { From duncan at codespeak.net Thu Oct 25 17:40:31 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 25 Oct 2007 17:40:31 +0200 (CEST) Subject: [kupu-checkins] r47952 - in kupu/trunk/kupu: . common/kupudrawers default plone plone/kupu_plone_layer Message-ID: <20071025154031.E66D580E5@code0.codespeak.net> Author: duncan Date: Thu Oct 25 17:40:31 2007 New Revision: 47952 Modified: kupu/trunk/kupu/common/kupudrawers/drawer.xsl kupu/trunk/kupu/default/drawers.kupu kupu/trunk/kupu/default/toolbar.kupu kupu/trunk/kupu/i18n.bat kupu/trunk/kupu/plone/body.kupu kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/trunk/kupu/plone/plonedrawers.py Log: Plone ticket #7258 Missing translation msgids for kupu Fix i18n batch file so it picks up drawer.xsl, fix some other i18n warnings. Rebuilt kupu.pot Modified: kupu/trunk/kupu/common/kupudrawers/drawer.xsl ============================================================================== --- kupu/trunk/kupu/common/kupudrawers/drawer.xsl (original) +++ kupu/trunk/kupu/common/kupudrawers/drawer.xsl Thu Oct 25 17:40:31 2007 @@ -390,9 +390,10 @@ -
Modified: kupu/trunk/kupu/default/toolbar.kupu ============================================================================== --- kupu/trunk/kupu/default/toolbar.kupu (original) +++ kupu/trunk/kupu/default/toolbar.kupu Thu Oct 25 17:40:31 2007 @@ -61,7 +61,7 @@ - + @@ -416,7 +416,7 @@ Table style
@@ -466,7 +466,7 @@
- Modified: kupu/trunk/kupu/plone/plonedrawers.py ============================================================================== --- kupu/trunk/kupu/plone/plonedrawers.py (original) +++ kupu/trunk/kupu/plone/plonedrawers.py Thu Oct 25 17:40:31 2007 @@ -646,7 +646,7 @@ src = src[len(base):].lstrip('/') try: obj = portal.restrictedTraverse(src) - except AttributeError: + except (KeyError, AttributeError): return [] if portal_types: while not shasattr(obj.aq_base, 'portal_type'): From duncan at codespeak.net Fri Oct 26 10:57:49 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 26 Oct 2007 10:57:49 +0200 (CEST) Subject: [kupu-checkins] r48020 - kupu/trunk/kupu/common Message-ID: <20071026085749.1DF398130@code0.codespeak.net> Author: duncan Date: Fri Oct 26 10:57:45 2007 New Revision: 48020 Modified: kupu/trunk/kupu/common/kupueditor.js Log: Fix for Plone issue #7099: Kupu error on multi-schemata archetypes content Replaced Firefox designmode timer with an onresize event handler for the iframe. Modified: kupu/trunk/kupu/common/kupueditor.js ============================================================================== --- kupu/trunk/kupu/common/kupueditor.js (original) +++ kupu/trunk/kupu/common/kupueditor.js Fri Oct 26 10:57:45 2007 @@ -95,6 +95,7 @@ this._designModeSetAttempts = 0; this._initialized = false; + this._wantDesignMode = false; // some properties to save the selection, required for IE to remember // where in the iframe the selection was @@ -506,43 +507,48 @@ this._initializeEventHandlers = function() { /* attache the event handlers to the iframe */ + var win = this.getDocument().getWindow(); + var idoc = this.getInnerDocument(); + // Set design mode on resize event: + this._addEventHandler(win, 'resize', this._resizeHandler, this); // Initialize DOM2Event compatibility // XXX should come back and change to passing in an element - this._addEventHandler(this.getInnerDocument(), "click", this.updateStateHandler, this); - this._addEventHandler(this.getInnerDocument(), "dblclick", this.updateStateHandler, this); - this._addEventHandler(this.getInnerDocument(), "keyup", this.updateStateHandler, this); - this._addEventHandler(this.getInnerDocument(), "keyup", function() {this.content_changed = true;}, this); - this._addEventHandler(this.getInnerDocument(), "mouseup", this.updateStateHandler, this); + this._addEventHandler(idoc, "click", this.updateStateHandler, this); + this._addEventHandler(idoc, "dblclick", this.updateStateHandler, this); + this._addEventHandler(idoc, "keyup", this.updateStateHandler, this); + this._addEventHandler(idoc, "keyup", function() {this.content_changed = true;}, this); + this._addEventHandler(idoc, "mouseup", this.updateStateHandler, this); if (this.getBrowserName() == "IE") { - this._addEventHandler(this.getInnerDocument(), "selectionchange", this.onSelectionChange, this); + this._addEventHandler(idoc, "selectionchange", this.onSelectionChange, this); } }; + this._resizeHandler = function() { + // Use the resize event to trigger setting design mode + if (this._wantDesignMode) { + this._setDesignModeWhenReady(); + } + } this._setDesignModeWhenReady = function() { - /* Rather dirty polling loop to see if Mozilla is done doing it's - initialization thing so design mode can be set. - */ - this._designModeSetAttempts++; - if (this._designModeSetAttempts > 25) { - alert(_('Couldn\'t set design mode. Kupu will not work on this browser.')); - return; - }; + /* Try to set design mode, but if we fail then just wait for a + * resize event. + */ var success = false; try { this._setDesignMode(); success = true; } catch (e) { - // register a function to the timer_instance because - // window.setTimeout can't refer to 'this'... - timer_instance.registerFunction(this, this._setDesignModeWhenReady, 100); }; if (success) { + this._wantDesignMode = false; // provide an 'afterInit' method on KupuEditor.prototype // for additional bootstrapping (after editor init) if (this.afterInit) { this.afterInit(); }; - }; + } else { + this._wantDesignMode = true; // Enable the resize trigger + } }; this._setDesignMode = function() { From kupu-checkins at codespeak.net Sun Oct 28 23:09:37 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Sun, 28 Oct 2007 23:09:37 +0100 (CET) Subject: [kupu-checkins] October 76% OFF Message-ID: <20071028100934.2557.qmail@client-190.40.65.45.speedy.net.pe> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071028/97f1650a/attachment-0001.htm From kupu-checkins at codespeak.net Mon Oct 29 10:04:56 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Mon, 29 Oct 2007 10:04:56 +0100 (CET) Subject: [kupu-checkins] October 76% OFF Message-ID: <20071029130506.16479.qmail@ssk.la.net.ua> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071029/8b7820d5/attachment.htm