From duncan at codespeak.net Mon Dec 3 12:29:56 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 3 Dec 2007 12:29:56 +0100 (CET) Subject: [kupu-checkins] r49311 - in kupu/trunk/kupu: doc plone/kupu_plone_layer Message-ID: <20071203112956.39F2081A2@code0.codespeak.net> Author: duncan Date: Mon Dec 3 12:29:55 2007 New Revision: 49311 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_plone_layer/kupusearch.xml.pt Log: Fix plone ticket 7428 Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Mon Dec 3 12:29:55 2007 @@ -13,6 +13,7 @@ * 7293 kupu import step has the wrong dependencies in a portal setup export * 7377 Making an Image a Link within Kupu renders the link tag at the top of the content page * 7387 Kupu-Commit Selected Changes button missing when converting UID=>Relative Link + * 7428 Searching for non-ascii character in kupu Insert Link dialog causes Error 500 - 1.4.4 Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupusearch.xml.pt ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupusearch.xml.pt (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupusearch.xml.pt Mon Dec 3 12:29:55 2007 @@ -12,7 +12,8 @@ - Search Results Search results. From duncan at codespeak.net Mon Dec 3 12:47:59 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 3 Dec 2007 12:47:59 +0100 (CET) Subject: [kupu-checkins] r49312 - in kupu/trunk/kupu: doc plone plone/tests Message-ID: <20071203114759.AD80D8169@code0.codespeak.net> Author: duncan Date: Mon Dec 3 12:47:59 2007 New Revision: 49312 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/plonelibrarytool.py kupu/trunk/kupu/plone/tests/test_browserSupportsKupu.py Log: Fix for Plone ticket 7426 Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Mon Dec 3 12:47:59 2007 @@ -13,6 +13,7 @@ * 7293 kupu import step has the wrong dependencies in a portal setup export * 7377 Making an Image a Link within Kupu renders the link tag at the top of the content page * 7387 Kupu-Commit Selected Changes button missing when converting UID=>Relative Link + * 7426 Kupu 1.4.4 installed with Plone 3.0.3 for PowerPC presents itself in Safari 3.0.4, but content in Kupu window can't be edited * 7428 Searching for non-ascii character in kupu Insert Link dialog causes Error 500 - 1.4.4 Modified: kupu/trunk/kupu/plone/plonelibrarytool.py ============================================================================== --- kupu/trunk/kupu/plone/plonelibrarytool.py (original) +++ kupu/trunk/kupu/plone/plonelibrarytool.py Mon Dec 3 12:47:59 2007 @@ -362,7 +362,7 @@ return verno >= (1,3,1) verno = getver(' AppleWebKit/') if verno: - return verno >= (523,11) + return verno >= (525,1) verno = getver(' Safari/') if verno: return verno >= (522,12) Modified: kupu/trunk/kupu/plone/tests/test_browserSupportsKupu.py ============================================================================== --- kupu/trunk/kupu/plone/tests/test_browserSupportsKupu.py (original) +++ kupu/trunk/kupu/plone/tests/test_browserSupportsKupu.py Mon Dec 3 12:47:59 2007 @@ -52,7 +52,7 @@ MOZILLA: (1,3,1), INTERNET_EXPLORER: (5,5), OPERA: (9,0), - SAFARI: (999,9), #(420,0), # Safari not yet supported + SAFARI: (525,1), #(420,0), # Safari not yet supported } # BROWSERS records contain: @@ -389,6 +389,8 @@ ('Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 9.00', 'Linux', '9.00', OPERA), ('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Safari/419.3', 'Mac', '420.0', SAFARI), ('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3', 'Mac', '418.9.1', SAFARI), + ("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/523.12.9 (KHTML, like Gecko) Version/3.0 Safari/523.12.9", 'Windows', '523.12.9', SAFARI), + ("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.1+ (KHTML, like Gecko) Version/3.0 Safari/523.12.9", 'Mac', '525.1', SAFARI), ) def createTest(sig, isSupported, index, os, browser, version): From kupu-checkins at codespeak.net Tue Dec 4 00:35:28 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Tue, 4 Dec 2007 00:35:28 +0100 (CET) Subject: [kupu-checkins] December 77% OFF Message-ID: <20071203013532.3090.qmail@adsl190-024108065.dyn.etb.net.co> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071204/cb00c372/attachment.htm From duncan at codespeak.net Tue Dec 4 14:17:29 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 4 Dec 2007 14:17:29 +0100 (CET) Subject: [kupu-checkins] r49334 - kupu/trunk/kupu/common Message-ID: <20071204131729.383A0816B@code0.codespeak.net> Author: duncan Date: Tue Dec 4 14:17:28 2007 New Revision: 49334 Modified: kupu/trunk/kupu/common/kupubasetools.js kupu/trunk/kupu/common/kupueditor.js Log: Fix assorted issues with images including the long-standing 'firefox corrupts the url' issue. Plone tickets 6430, 6835, 7419 Modified: kupu/trunk/kupu/common/kupubasetools.js ============================================================================== --- kupu/trunk/kupu/common/kupubasetools.js (original) +++ kupu/trunk/kupu/common/kupubasetools.js Tue Dec 4 14:17:28 2007 @@ -1251,6 +1251,7 @@ /* create an image */ var img = this.editor.getInnerDocument().createElement('img'); img.src = url; + img.setAttribute('kupu-src') = url; img.removeAttribute('height'); img.removeAttribute('width'); if (alttext) { Modified: kupu/trunk/kupu/common/kupueditor.js ============================================================================== --- kupu/trunk/kupu/common/kupueditor.js (original) +++ kupu/trunk/kupu/common/kupueditor.js Tue Dec 4 14:17:28 2007 @@ -505,21 +505,64 @@ */ }; + // Fixup Mozilla breaking image src url when dragging images + this.imageInserted = function(event) { + var node = event.target; + if (node && node.nodeType==1) { + var nodes = (/^img$/i.test(node.nodeName))?[node]:node.getElementsByTagName('img'); + for (var i = 0; i < nodes.length; i++) { + node = nodes[i]; + var src = node.getAttribute('kupu-src'); + if (src) { node.src = src; }; + }; + }; + }; + // Prevent Mozilla resizing of images + this.imageModified = function(event) { + var node = event.target; + if (node && /^img$/i.test(node.nodeName)) { + if (event.attrName=="style" && event.attrChange==1 && /height|width/.test(event.newValue)) { + timer_instance.registerFunction(this, this._clearStyle, 1, node); + } + }; + }; + // Make sure image size is set on width/height attributes not style. + this._clearStyle = function(node) { + var w = node.width; + var h = node.height; + node.style.width = ""; + node.style.height = ""; + if (this.okresize) { + if (w) {node.width = w;}; + if (h) {node.height = h;}; + }; + }; + this._cancelResize = function(evt) { + return false; + }; + this._initializeEventHandlers = function() { /* attache the event handlers to the iframe */ var win = this.getDocument().getWindow(); var idoc = this.getInnerDocument(); + var e = this._addEventHandler; + var validattrs = this.xhtmlvalid.tagAttributes['img']; + this.okresize = validattrs.contains('width') && validattrs.contains('height'); // Set design mode on resize event: - this._addEventHandler(win, 'resize', this._resizeHandler, this); + e(win, 'resize', this._resizeHandler, this); // Initialize DOM2Event compatibility // XXX should come back and change to passing in an element - 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); + e(idoc, "click", this.updateStateHandler, this); + e(idoc, "dblclick", this.updateStateHandler, this); + e(idoc, "keyup", this.updateStateHandler, this); + e(idoc, "keyup", function() {this.content_changed = true;}, this); + e(idoc, "mouseup", this.updateStateHandler, this); if (this.getBrowserName() == "IE") { - this._addEventHandler(idoc, "selectionchange", this.onSelectionChange, this); + e(idoc, "selectionchange", this.onSelectionChange, this); + if (!this.okresize) { e(idoc.documentElement, "resizestart", this._cancelResize, this);}; + } else { + e(idoc, "DOMNodeInserted", this.imageInserted, this); + e(idoc, "DOMAttrModified", this.imageModified, this); } }; @@ -652,7 +695,8 @@ // If we have multiple bodies this needs to remove the extras. this.setHTMLBody = function(text) { - var bodies = this.getInnerDocument().documentElement.getElementsByTagName('body'); + var doc = this.getInnerDocument().documentElement; + var bodies = doc.getElementsByTagName('body'); for (var i = 0; i < bodies.length-1; i++) { bodies[i].parentNode.removeChild(bodies[i]); } @@ -666,6 +710,12 @@ }; text = text.replace(/

()<\/p>/g,'$1'); bodies[bodies.length-1].innerHTML = text; + /* Mozilla corrupts dragged images, so save the src attribute */ + var nodes = doc.getElementsByTagName('img'); + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + node.setAttribute('kupu-src', node.src); + }; }; this._fixXML = function(doc, document) { From duncan at codespeak.net Tue Dec 4 15:13:27 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 4 Dec 2007 15:13:27 +0100 (CET) Subject: [kupu-checkins] r49337 - in kupu/trunk/kupu: doc plone Message-ID: <20071204141327.DE21C815C@code0.codespeak.net> Author: duncan Date: Tue Dec 4 15:13:26 2007 New Revision: 49337 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/ReftextField.py Log: Fix for RefTextField contributed by Reinout van Rees Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Tue Dec 4 15:13:26 2007 @@ -8,13 +8,28 @@ - Fixed the transform to preserve links around images. + - Images may only be resized if 'height' and 'width' are permitted + image attributes. Resizing images in Firefox sets those + attributes rather than the style attribute. + - Plone tickets - * 7293 kupu import step has the wrong dependencies in a portal setup export - * 7377 Making an Image a Link within Kupu renders the link tag at the top of the content page - * 7387 Kupu-Commit Selected Changes button missing when converting UID=>Relative Link - * 7426 Kupu 1.4.4 installed with Plone 3.0.3 for PowerPC presents itself in Safari 3.0.4, but content in Kupu window can't be edited - * 7428 Searching for non-ascii character in kupu Insert Link dialog causes Error 500 + * 5765 Kupu in IE unable to make a link from selected image + * 6430 Kupu: changes to images resized by handle-dragging are + lost (not saved) + * 6835 Drag image breaks in Kupu + * 7293 kupu import step has the wrong dependencies in a portal + setup export + * 7377 Making an Image a Link within Kupu renders the link tag at + the top of the content page + * 7387 Kupu-Commit Selected Changes button missing when + converting UID=>Relative Link + * 7426 Kupu 1.4.4 installed with Plone 3.0.3 for PowerPC presents + itself in Safari 3.0.4, but content in Kupu window can't be edited + * 7428 Searching for non-ascii character in kupu Insert Link + dialog causes Error 500 + * 7419 Plone and/or Kupu should at least WARN an editor of an + image that changes may be lost at Save time - 1.4.4 Modified: kupu/trunk/kupu/plone/ReftextField.py ============================================================================== --- kupu/trunk/kupu/plone/ReftextField.py (original) +++ kupu/trunk/kupu/plone/ReftextField.py Tue Dec 4 15:13:26 2007 @@ -1,5 +1,6 @@ from AccessControl import ClassSecurityInfo from Products.Archetypes.public import * +from Products.Archetypes.BaseUnit import BaseUnit from Products.Archetypes.config import REFERENCE_CATALOG from Products.Archetypes.Field import TextField from Products.Archetypes.ReferenceEngine import Reference @@ -38,6 +39,9 @@ TextField.set(self, instance, value, **kwargs) + if isinstance(value, BaseUnit): + # Baseunit: can occur when overriding atct text fields. + value = value() if not isinstance(value, basestring): value.seek(0); value = value.read() From duncan at codespeak.net Tue Dec 4 16:38:12 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 4 Dec 2007 16:38:12 +0100 (CET) Subject: [kupu-checkins] r49342 - kupu/trunk/kupu/plone Message-ID: <20071204153812.76F618143@code0.codespeak.net> Author: duncan Date: Tue Dec 4 16:38:11 2007 New Revision: 49342 Added: kupu/trunk/kupu/plone/config.py Modified: kupu/trunk/kupu/plone/ReftextField.py kupu/trunk/kupu/plone/html2captioned.py Log: Moved UID_PATTERN to a separate config module. Made both the output transform and the reftext field use the same regex. Modified: kupu/trunk/kupu/plone/ReftextField.py ============================================================================== --- kupu/trunk/kupu/plone/ReftextField.py (original) +++ kupu/trunk/kupu/plone/ReftextField.py Tue Dec 4 16:38:11 2007 @@ -7,11 +7,9 @@ from Products.Archetypes.exceptions import ReferenceException from ZPublisher.HTTPRequest import FileUpload from Products.CMFCore.utils import getToolByName +from Products.kupu.plone.config import UID_PATTERN import re -# UID_PATTERN matches a UID in an anchor or image tag. -UID_PATTERN = re.compile(r'''<(?:a\b[^>]+href|img\b[^>]+src)="resolveuid/(?P[^?#">/]+)''', re.I) - class ReftextField(TextField): __implements__ = TextField.__implements__ @@ -46,7 +44,8 @@ value.seek(0); value = value.read() - uids = UID_PATTERN.findall(value) # XXX: build list of uids from the value here + # build list of uids from the value here + uids = [ m.group('uid') for m in UID_PATTERN.finditer(page) ] uids = dict.fromkeys(uids).keys() # Remove duplicate uids. tool = getToolByName(instance, REFERENCE_CATALOG) Added: kupu/trunk/kupu/plone/config.py ============================================================================== --- (empty file) +++ kupu/trunk/kupu/plone/config.py Tue Dec 4 16:38:11 2007 @@ -0,0 +1,22 @@ +############################################################################## +# +# Copyright (c) 2003-2008 Kupu Contributors. All rights reserved. +# +# This software is distributed under the terms of the Kupu +# License. See LICENSE.txt for license text. For a list of Kupu +# Contributors see CREDITS.txt. +# +############################################################################## +"""Kupu configuration file +""" +import re + +# Pattern to match resolveuid links in HTML. +# Match groups: +# tag: the html tag from the start up to the point where the uid +# occurs. +# url: the url containing the uid (stops after the uid: any +# trailing part such as '/image_thumb' is not included. +# uid: the uid itself. +UID_PATTERN = re.compile('(?P<(?:a|img|object|param)\\s[^>]*(?:src|href|data|value)\s*=\s*")(?P[^"]*resolveuid/(?P[^/"#? ]*))', re.DOTALL | re.IGNORECASE) + Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Tue Dec 4 16:38:11 2007 @@ -17,6 +17,8 @@ from urllib import unquote_plus, quote_plus from Acquisition import aq_base from htmlentitydefs import name2codepoint +from Products.kupu.plone.config import UID_PATTERN + name2codepoint = name2codepoint.copy() name2codepoint['apos']=ord("'") @@ -66,8 +68,6 @@ ''' -UID_PATTERN = re.compile('(?P<(?:a|img|object|param)\\s[^>]*(?:src|href|data|value)\s*=\s*")(?P[^"]*resolveuid/(?P[^/"#? ]*))', re.DOTALL | re.IGNORECASE) - class HTMLToCaptioned: """Transform which adds captions to images embedded in HTML""" __implements__ = itransform From duncan at codespeak.net Tue Dec 4 17:24:17 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 4 Dec 2007 17:24:17 +0100 (CET) Subject: [kupu-checkins] r49344 - in kupu/trunk/kupu: common tests Message-ID: <20071204162417.D8770814D@code0.codespeak.net> Author: duncan Date: Tue Dec 4 17:24:14 2007 New Revision: 49344 Modified: kupu/trunk/kupu/common/kupubasetools.js kupu/trunk/kupu/tests/test_kupuhelpers.js Log: Fix typo and update test Modified: kupu/trunk/kupu/common/kupubasetools.js ============================================================================== --- kupu/trunk/kupu/common/kupubasetools.js (original) +++ kupu/trunk/kupu/common/kupubasetools.js Tue Dec 4 17:24:14 2007 @@ -1251,7 +1251,7 @@ /* create an image */ var img = this.editor.getInnerDocument().createElement('img'); img.src = url; - img.setAttribute('kupu-src') = url; + img.setAttribute('kupu-src', url); img.removeAttribute('height'); img.removeAttribute('width'); if (alttext) { Modified: kupu/trunk/kupu/tests/test_kupuhelpers.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupuhelpers.js (original) +++ kupu/trunk/kupu/tests/test_kupuhelpers.js Tue Dec 4 17:24:14 2007 @@ -103,6 +103,7 @@ s = s.replace(/\/>/g, ">"); s = s.replace(' style=""', ""); s = s.replace(" style=''", ""); + s = s.replace(/ kupu-src="[^"]*"/, ""); return s; }; From kupu-checkins at codespeak.net Wed Dec 5 08:56:10 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Wed, 5 Dec 2007 08:56:10 +0100 (CET) Subject: [kupu-checkins] December 72% OFF Message-ID: <20071205095623.7000.qmail@acmb123.neoplus.adsl.tpnet.pl> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071205/d0ecd45f/attachment.htm From duncan at codespeak.net Wed Dec 5 17:14:03 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Wed, 5 Dec 2007 17:14:03 +0100 (CET) Subject: [kupu-checkins] r49390 - in kupu/trunk/kupu/plone: . kupu_plone_layer Message-ID: <20071205161403.42DC516848E@codespeak.net> Author: duncan Date: Wed Dec 5 17:14:02 2007 New Revision: 49390 Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/trunk/kupu/plone/wysiwyg_support.kupu Log: Added a default format field for when kupu is suppressed. Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html Wed Dec 5 17:14:02 2007 @@ -16,7 +16,7 @@ - + @@ -504,6 +504,7 @@ +

Modified: kupu/trunk/kupu/plone/wysiwyg_support.kupu ============================================================================== --- kupu/trunk/kupu/plone/wysiwyg_support.kupu (original) +++ kupu/trunk/kupu/plone/wysiwyg_support.kupu Wed Dec 5 17:14:02 2007 @@ -48,6 +48,12 @@ rows rows|default; cols cols|default;"> + From kupu-checkins at codespeak.net Thu Dec 6 08:18:33 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Thu, 6 Dec 2007 08:18:33 +0100 (CET) Subject: [kupu-checkins] December 74% OFF Message-ID: <20071206091833.6623.qmail@adsl-pool-222.123.102-218.tttmaxnet.com> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071206/28e6eebf/attachment.htm From duncan at codespeak.net Thu Dec 6 10:16:12 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 6 Dec 2007 10:16:12 +0100 (CET) Subject: [kupu-checkins] r49437 - in kupu/trunk/kupu: . doc plone/kupu_plone_layer Message-ID: <20071206091612.4F6CB168503@codespeak.net> Author: duncan Date: Thu Dec 6 10:16:10 2007 New Revision: 49437 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/trunk/kupu/version.txt Log: Prepare for 1.4.5 release Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu Dec 6 10:16:10 2007 @@ -2,7 +2,7 @@ Kupu changes ============ -- SVN unreleased +- 1.4.5 - Fixed unit tests for the transform (they now use a real image instead of a mockup) Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html Thu Dec 6 10:16:10 2007 @@ -27,7 +27,7 @@ - +
Modified: kupu/trunk/kupu/version.txt ============================================================================== --- kupu/trunk/kupu/version.txt (original) +++ kupu/trunk/kupu/version.txt Thu Dec 6 10:16:10 2007 @@ -1 +1 @@ -kupu 1.4.4 +kupu 1.4.5 From duncan at codespeak.net Thu Dec 6 10:34:14 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 6 Dec 2007 10:34:14 +0100 (CET) Subject: [kupu-checkins] r49440 - kupu/tag/kupu-1.4.5 Message-ID: <20071206093414.ECC7A168522@codespeak.net> Author: duncan Date: Thu Dec 6 10:34:14 2007 New Revision: 49440 Added: kupu/tag/kupu-1.4.5/ - copied from r49439, kupu/trunk/kupu/ Log: Created tag for kupu 1.4.5 From kupu-checkins at codespeak.net Thu Dec 6 13:05:12 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Thu, 6 Dec 2007 13:05:12 +0100 (CET) Subject: [kupu-checkins] December 74% OFF Message-ID: <20071206020657.6672.qmail@AMarseille-157-1-29-39.w90-15.abo.wanadoo.fr> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071206/1cf169fe/attachment-0001.htm From kupu-checkins at codespeak.net Thu Dec 6 14:11:39 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Thu, 6 Dec 2007 14:11:39 +0100 (CET) Subject: [kupu-checkins] December 76% OFF Message-ID: <20071206031136.18459.qmail@p57B09E9C.dip0.t-ipconnect.de> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071206/2388dc71/attachment.htm From duncan at codespeak.net Fri Dec 7 12:12:58 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 7 Dec 2007 12:12:58 +0100 (CET) Subject: [kupu-checkins] r49502 - kupu/trunk/kupu/plone Message-ID: <20071207111258.04702168572@codespeak.net> Author: duncan Date: Fri Dec 7 12:12:58 2007 New Revision: 49502 Modified: kupu/trunk/kupu/plone/ReftextField.py Log: Fix typo in change to ReftextField Modified: kupu/trunk/kupu/plone/ReftextField.py ============================================================================== --- kupu/trunk/kupu/plone/ReftextField.py (original) +++ kupu/trunk/kupu/plone/ReftextField.py Fri Dec 7 12:12:58 2007 @@ -45,7 +45,7 @@ value = value.read() # build list of uids from the value here - uids = [ m.group('uid') for m in UID_PATTERN.finditer(page) ] + uids = [ m.group('uid') for m in UID_PATTERN.finditer(value) ] uids = dict.fromkeys(uids).keys() # Remove duplicate uids. tool = getToolByName(instance, REFERENCE_CATALOG) From duncan at codespeak.net Fri Dec 7 12:26:17 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 7 Dec 2007 12:26:17 +0100 (CET) Subject: [kupu-checkins] r49503 - in kupu/trunk/kupu: . doc Message-ID: <20071207112617.7BCC7168578@codespeak.net> Author: duncan Date: Fri Dec 7 12:26:15 2007 New Revision: 49503 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/version.txt Log: Generating another release because of a silly bug introduced in kupu 1.4.5 Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Dec 7 12:26:15 2007 @@ -2,6 +2,10 @@ Kupu changes ============ +- 1.4.6 + + - Fixed ReftextField error introduced in 1.4.5 + - 1.4.5 - Fixed unit tests for the transform (they now use a real image instead of a mockup) Modified: kupu/trunk/kupu/version.txt ============================================================================== --- kupu/trunk/kupu/version.txt (original) +++ kupu/trunk/kupu/version.txt Fri Dec 7 12:26:15 2007 @@ -1 +1 @@ -kupu 1.4.5 +kupu 1.4.6 From duncan at codespeak.net Fri Dec 7 12:34:37 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 7 Dec 2007 12:34:37 +0100 (CET) Subject: [kupu-checkins] r49505 - kupu/tag/kupu-1.4.6 Message-ID: <20071207113437.C5E69168578@codespeak.net> Author: duncan Date: Fri Dec 7 12:34:37 2007 New Revision: 49505 Added: kupu/tag/kupu-1.4.6/ - copied from r49504, kupu/trunk/kupu/ Log: Tag new build From hannosch at codespeak.net Tue Dec 11 21:16:15 2007 From: hannosch at codespeak.net (hannosch at codespeak.net) Date: Tue, 11 Dec 2007 21:16:15 +0100 (CET) Subject: [kupu-checkins] r49654 - in kupu/trunk/kupu: doc plone/profiles/default Message-ID: <20071211201615.A7CDB1684E4@codespeak.net> Author: hannosch Date: Tue Dec 11 21:16:15 2007 New Revision: 49654 Added: kupu/trunk/kupu/plone/profiles/default/metadata.xml (contents, props changed) Modified: kupu/trunk/kupu/doc/CHANGES.txt Log: Added metadata.xml file to the Plone GenericSetup profile. Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Tue Dec 11 21:16:15 2007 @@ -2,6 +2,10 @@ Kupu changes ============ +- 1.4.7 + + - Added metadata.xml file to the Plone GenericSetup profile. + - 1.4.6 - Fixed ReftextField error introduced in 1.4.5 Added: kupu/trunk/kupu/plone/profiles/default/metadata.xml ============================================================================== --- (empty file) +++ kupu/trunk/kupu/plone/profiles/default/metadata.xml Tue Dec 11 21:16:15 2007 @@ -0,0 +1,4 @@ + + + 1.4.6 + From kupu-checkins at codespeak.net Wed Dec 12 03:39:17 2007 From: kupu-checkins at codespeak.net (VIAGRA ® Official Site) Date: Wed, 12 Dec 2007 03:39:17 +0100 (CET) Subject: [kupu-checkins] December 73% OFF Message-ID: <20071212163920.6688.qmail@mx-ll-58.147.38-21.tttmaxnet.com> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071212/58be81c1/attachment.htm From duncan at codespeak.net Tue Dec 18 16:43:30 2007 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 18 Dec 2007 16:43:30 +0100 (CET) Subject: [kupu-checkins] r49893 - in kupu/trunk/kupu: common doc Message-ID: <20071218154330.365B516854D@codespeak.net> Author: duncan Date: Tue Dec 18 16:43:29 2007 New Revision: 49893 Modified: kupu/trunk/kupu/common/kupucontentfilters.js kupu/trunk/kupu/doc/CHANGES.txt Log: Fix whitelist/blacklist when only one element is specified. Span tags left without attributes after filtering are removed. Modified: kupu/trunk/kupu/common/kupucontentfilters.js ============================================================================== --- kupu/trunk/kupu/common/kupucontentfilters.js (original) +++ kupu/trunk/kupu/common/kupucontentfilters.js Tue Dec 18 16:43:29 2007 @@ -162,6 +162,11 @@ // function XhtmlValidation(editor) { // Support functions + function asList(s) { + if (typeof(s)==typeof('') || !s.length) s = [s]; + return s; + } + this.Set = function(ary) { if (typeof(ary)==typeof('')) ary = [ary]; if (ary instanceof Array) { @@ -175,7 +180,7 @@ } } }; - + this._exclude = function(array, exceptions) { var ex; if (exceptions.split) { @@ -446,7 +451,7 @@ // Permitted elements for style. this.styleWhitelist = new this.Set(['text-align', 'list-style-type', 'float']); this.classBlacklist = new this.Set(['MsoNormal', 'MsoTitle', 'MsoHeader', 'MsoFootnoteText', - 'Bullet1', 'Bullet2']); + 'Bullet1', 'Bullet2', 'Apple-span-style']); this.classFilter = function(value) { var classes = value.split(' '); @@ -462,8 +467,11 @@ this._defaultCopyAttribute = function(name, htmlnode, xhtmlnode) { var val = htmlnode.getAttribute(name); if (val) xhtmlnode.setAttribute(name, val); + return !!val; }; // Set up filters for attributes. + // Filters may return false if nothing was copied, true or + // undefined if an attribute was copied. var filter = this; this.attrFilters = new function(validation, editor) { var attrs = validation.elements.attributes; @@ -474,10 +482,12 @@ var val = htmlnode.getAttribute('class'); if (val) val = validation.classFilter(val); if (val) xhtmlnode.setAttribute('class', val); + return !!val; }; // allow a * wildcard to make all attributes valid in the filter // note that this is pretty slow on IE this['*'] = function(name, htmlnode, xhtmlnode) { + var res = false; var nodeName = filter._getTagName(htmlnode); var bad = filter.badTagAttributes[nodeName]; for (var i=0; i < htmlnode.attributes.length; i++) { @@ -488,8 +498,10 @@ }; if (attr.specified) { xhtmlnode.setAttribute(name, attr.value); + res = true; }; }; + return res; }; if (editor.getBrowserName()=="IE") { this['class'] = function(name, htmlnode, xhtmlnode) { @@ -502,26 +514,33 @@ if (val) val = validation.classFilter(val); if (val) xhtmlnode.setAttribute('class', val); } + return !!val; }; this['http-equiv'] = function(name, htmlnode, xhtmlnode) { var val = htmlnode.httpEquiv; if (val) xhtmlnode.setAttribute('http-equiv', val); + return !!val; }; this['xml:lang'] = this['xml:space'] = function(name, htmlnode, xhtmlnode) { try { var val = htmlnode.getAttribute(name); if (val) xhtmlnode.setAttribute(name, val); + return !!val; } catch(e) { } }; } this.alt = function(name, htmlnode, xhtmlnode) { var val = htmlnode.getAttribute(name); - if (val || xhtmlnode.tagName=='img') xhtmlnode.setAttribute(name, val); + var ok = val || xhtmlnode.tagName=='img'; + if (ok) xhtmlnode.setAttribute(name, val); + return ok; }; this.rowspan = this.colspan = function(name, htmlnode, xhtmlnode) { var val = htmlnode.getAttribute(name); - if (val && val != '1') xhtmlnode.setAttribute(name, val); + var ok = val && val != '1'; + if (ok) xhtmlnode.setAttribute(name, val); + return ok; }; this.style = function(name, htmlnode, xhtmlnode) { var val = htmlnode.style.cssText; @@ -538,8 +557,9 @@ } if (styles[styles.length-1]) styles.push(''); val = styles.join('; ').strip(); - } + }; if (val) xhtmlnode.setAttribute('style', val); + return !!val; }; }(this, editor); @@ -557,20 +577,19 @@ this.excludeTags(exclude.t); } if (exclude.c) { - var c = exclude.c; - if (!c.length) c = [c]; + var c = asList(exclude.c); for (var i = 0; i < c.length; i++) { this.excludeTagAttributes(c[i].t, c[i].a); } } if (exclude.xstyle) { - var s = exclude.xstyle; + var s = asList(exclude.xstyle); for (var i = 0; i < s.length; i++) { this.styleWhitelist[s[i]] = 1; } } if (exclude['class']) { - var c = exclude['class']; + var c = asList(exclude['class']); for (var i = 0; i < c.length; i++) { this.classBlacklist[c[i]] = 1; } @@ -578,18 +597,25 @@ }; // Copy all valid attributes from htmlnode to xhtmlnode. + // Returns true if at least one attribute was copied. this._copyAttributes = function(htmlnode, xhtmlnode, valid) { var name; + var res = false; if (valid.contains('*')) { // allow all attributes on this tag - this.attrFilters['*'](name, htmlnode, xhtmlnode); - return; - }; - for (var i = 0; i < valid.length; i++) { - name = valid[i]; - var filter = this.attrFilters[name]; - if (filter) filter(name, htmlnode, xhtmlnode); + res = this.attrFilters['*'](name, htmlnode, xhtmlnode); + if (res===undefined) res = true; + } else { + for (var i = 0; i < valid.length; i++) { + name = valid[i]; + var filter = this.attrFilters[name]; + if (filter) { + var f = filter(name, htmlnode, xhtmlnode); + res|=(f||f===undefined); + } + }; } + return res; }; this._xmlCopyAttr = function(srcnode, target) { var valid = this.tagAttributes[srcnode.nodeName]; @@ -705,7 +731,10 @@ } catch (e) { }; if (validattrs && xhtmlnode) { - this._copyAttributes(htmlnode, xhtmlnode, validattrs); + if (!this._copyAttributes(htmlnode, xhtmlnode, validattrs) && nodename=='span') { + parentnode = xhtmlparent; + xhtmlnode = null; + } } } Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Tue Dec 18 16:43:29 2007 @@ -6,6 +6,11 @@ - Added metadata.xml file to the Plone GenericSetup profile. + - Style whitelist and class blacklist now work when there is only + one entry in the list. + + - Span tags with no attributes after filtering are removed. + - 1.4.6 - Fixed ReftextField error introduced in 1.4.5 From deo at codespeak.net Tue Dec 25 22:32:27 2007 From: deo at codespeak.net (deo at codespeak.net) Date: Tue, 25 Dec 2007 22:32:27 +0100 (CET) Subject: [kupu-checkins] r50119 - kupu/branch/kupu-1.3/i18n Message-ID: <20071225213227.94F7D16843A@codespeak.net> Author: deo Date: Tue Dec 25 22:32:25 2007 New Revision: 50119 Modified: kupu/branch/kupu-1.3/i18n/kupu-pt-br.po Log: Typos. Modified: kupu/branch/kupu-1.3/i18n/kupu-pt-br.po ============================================================================== --- kupu/branch/kupu-1.3/i18n/kupu-pt-br.po (original) +++ kupu/branch/kupu-1.3/i18n/kupu-pt-br.po Tue Dec 25 22:32:25 2007 @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: Kupu 1.3\n" "POT-Creation-Date: Wed Aug 3 16:07:37 2005\n" -"PO-Revision-Date: 2005-08-07 19:29-0300\n" +"PO-Revision-Date: 2007-03-13 16:35-0300\n" "Last-Translator: Dorneles Trem?a \n" "Language-Team: Silva i18n team \n" "MIME-Version: 1.0\n" @@ -102,7 +102,7 @@ #: /common/kupu.pox:None msgid "Image tool initialized" -msgstr "Ferramente de imagem inicializada" +msgstr "Ferramenta de imagem inicializada" #: /common/kupu.pox:None msgid "End offset out of range!" @@ -174,7 +174,7 @@ #: /common/kupu.pox:None msgid "Colorchooser tool initialized" -msgstr "Ferramente de sele??o de cores inicializada" +msgstr "Ferramenta de sele??o de cores inicializada" #: /common/kupu.pox:None msgid "No parentcolumn found!" From kupu-checkins at codespeak.net Sat Dec 29 16:29:55 2007 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Sat, 29 Dec 2007 16:29:55 +0100 (CET) Subject: [kupu-checkins] 40% Off -- 4 Days Only Message-ID: <20071229072956.14334.qmail@dsl88.242-21782.ttnet.net.tr> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20071229/59b53afb/attachment-0001.htm