From kupu-checkins at codespeak.net Tue Mar 4 13:47:47 2008 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Tue, 4 Mar 2008 13:47:47 +0100 (CET) Subject: [kupu-checkins] March 84% Off Message-ID: <20080304024708.2647.qmail@fcj18.internetdsl.tpnet.pl> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080304/98482d6c/attachment.htm From kupu-checkins at codespeak.net Tue Mar 4 15:12:26 2008 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Tue, 4 Mar 2008 15:12:26 +0100 (CET) Subject: [kupu-checkins] March 86% Off Message-ID: <20080304161204.19242.qmail@caching1-pnc2.asianet.co.th> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080304/b582c2df/attachment.htm From duncan at codespeak.net Wed Mar 5 12:05:41 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Wed, 5 Mar 2008 12:05:41 +0100 (CET) Subject: [kupu-checkins] r52187 - kupu/trunk/kupu/plone Message-ID: <20080305110541.DA4D2169F7F@codespeak.net> Author: duncan Date: Wed Mar 5 12:05:40 2008 New Revision: 52187 Modified: kupu/trunk/kupu/plone/html2captioned.py Log: Make html2char more robust Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Wed Mar 5 12:05:40 2008 @@ -670,6 +670,9 @@ if code: return unichr(int(code, 16)) else: - return unichr(name2codepoint[match.group(3)]) + code = match.group(3) + if code in name2codepoint: + return unichr(name2codepoint[code]) + return match.group(0) - return EntityPattern.sub(unescape, s) + return EntityPattern.sub(unescape, s.decode(encoding)) From mihxil at codespeak.net Thu Mar 6 16:41:35 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Thu, 6 Mar 2008 16:41:35 +0100 (CET) Subject: [kupu-checkins] r52217 - kupu/trunk/kupu/mmbase Message-ID: <20080306154135.C67ED1684C6@codespeak.net> Author: mihxil Date: Thu Mar 6 16:41:34 2008 New Revision: 52217 Modified: kupu/trunk/kupu/mmbase/kupustyle.css Log: mainly spacinng Modified: kupu/trunk/kupu/mmbase/kupustyle.css ============================================================================== --- kupu/trunk/kupu/mmbase/kupustyle.css (original) +++ kupu/trunk/kupu/mmbase/kupustyle.css Thu Mar 6 16:41:34 2008 @@ -1,24 +1,24 @@ @import url("../../style/css/mmxf.css"); -body { +body { background-color: white; font-size: 12pt; } -h1,h2,h3,h4,h5,h6,h7,h8,th { +h1,h2,h3,h4,h5,h6,h7,h8,th { font-weight: bold; color: #006; } -h1 { +h1 { font-size: 15pt; } -h2 { +h2 { padding-left: 1em; font-size: 14pt; } -h3 { +h3 { padding-left: 2em; font-size: 13pt; } -h4 { +h4 { padding-left: 3em; font-size: 12pt; margin-top: 0px; @@ -27,7 +27,7 @@ padding-bottom: 0px; } -h5, h6, h7, h8 { +h5, h6, h7, h8 { font-style: italic; font-size: 12pt; margin-top: 0px; @@ -35,27 +35,27 @@ padding-top: 0px; padding-bottom: 0px; } -h5 { +h5 { padding-left: 4em; } -h6 { +h6 { padding-left: 5em; } -h7 { +h7 { padding-left: 6em; } -h8 { +h8 { padding-left: 7em; } -h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child, h7:first-child, h8:first-child { +h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child, h7:first-child, h8:first-child { margin-top: 0px; } p { } -table { +table { border: 1px black solid; border-spacing: 0px; empty-cells: show; @@ -63,58 +63,58 @@ background-color: #fafafa; } -.mmxf table.plain td, .mmxf table.data td { +.mmxf table.plain td, .mmxf table.data td { border: 1px gray solid; } -th { +th { border: 1px black solid; } -img.image-right { +img.image-right { width: 100px; float: right; margin-right: 0px; margin-left: 1ex; } -img.image-left { +img.image-left { width: 100px; float: left; margin-left: 0px; margin-right: 1ex; } -img.section-inline { +img.section-inline { } -img.node { +img.node { float: left; border: solid 5px green; } -img.paragraph { +img.paragraph { border: solid 1px green; } -img.section { +img.section { float: left; border: solid 1px green; } -img.big { +img.big { width: 200px; height: auto; } -strong, b { +strong, b { color: green; font-weight: bold; } -em, i { +em, i { font-style: italic; } -div.float { +div.float { display: block; float: left; width: 200px; @@ -123,28 +123,28 @@ border: solid black 1px; } -div.note { +div.note { background-color: #ffc; font-style: italic; } -div.note i { +div.note i { font-style: normal; } -div.note em { +div.note em { font-style: normal; } -div.right { +div.right { margin-right: 0px; float: right; } -div.left { +div.left { margin-left: 0px; float: left; -} +} -div.intermezzo { +div.intermezzo { float: left; margin-left: 0px; margin-right: 2ex; @@ -152,18 +152,15 @@ background-color: #cfc; font-style: normal; } -div.quote { +div.quote { background-color: #fcc !important; font-style: italic; } -div.caption { +div.caption { background-color: #ddd; } -ul, ol { +ul, ol { list-style-position: outside; + margin-left: 1ex; } - -li { - margin-left: 20px; -} \ No newline at end of file From mihxil at codespeak.net Thu Mar 6 16:41:57 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Thu, 6 Mar 2008 16:41:57 +0100 (CET) Subject: [kupu-checkins] r52218 - kupu/trunk/kupu/mmbase Message-ID: <20080306154157.3FD151684C6@codespeak.net> Author: mihxil Date: Thu Mar 6 16:41:51 2008 New Revision: 52218 Modified: kupu/trunk/kupu/mmbase/toolboxes.kupu Log: some i18n message were broken Modified: kupu/trunk/kupu/mmbase/toolboxes.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/toolboxes.kupu (original) +++ kupu/trunk/kupu/mmbase/toolboxes.kupu Thu Mar 6 16:41:51 2008 @@ -14,16 +14,16 @@
-

Images

+

Images

Image class:
From mihxil at codespeak.net Thu Mar 6 17:15:37 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Thu, 6 Mar 2008 17:15:37 +0100 (CET) Subject: [kupu-checkins] r52221 - kupu/trunk/kupu/mmbase Message-ID: <20080306161537.D87AF169E75@codespeak.net> Author: mihxil Date: Thu Mar 6 17:15:37 2008 New Revision: 52221 Modified: kupu/trunk/kupu/mmbase/html.kupu kupu/trunk/kupu/mmbase/mmbase.kupu Log: details Modified: kupu/trunk/kupu/mmbase/html.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/html.kupu (original) +++ kupu/trunk/kupu/mmbase/html.kupu Thu Mar 6 17:15:37 2008 @@ -7,7 +7,7 @@ $Id: html.kupu,v 1.14 2005/09/27 18:26:52 michiel Exp $ @@ -24,7 +24,7 @@ --> - + client Modified: kupu/trunk/kupu/mmbase/mmbase.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/mmbase.kupu (original) +++ kupu/trunk/kupu/mmbase/mmbase.kupu Thu Mar 6 17:15:37 2008 @@ -60,14 +60,8 @@ en,zh,ja,de,fr,pt,nl,da,cs,fi,el,sr,eo,hi - - - - - - - - + locale.getDisplayName(locale) + ${gui} From kupu-checkins at codespeak.net Tue Mar 11 23:42:56 2008 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Tue, 11 Mar 2008 23:42:56 +0100 (CET) Subject: [kupu-checkins] MensHealth id 1005294 Message-ID: <20080312144229.12766.qmail@screening.abacus.volia.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080311/22bc9fc9/attachment.htm From duncan at codespeak.net Fri Mar 14 11:43:19 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 14 Mar 2008 11:43:19 +0100 (CET) Subject: [kupu-checkins] r52480 - in kupu/trunk/kupu: doc plone/kupu_plone_layer Message-ID: <20080314104319.D0BAC169F5F@codespeak.net> Author: duncan Date: Fri Mar 14 11:43:19 2008 New Revision: 52480 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_plone_layer/kupuploneinit.js Log: Workaround for bad KSS form submissions (Plone ticket 7893) Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Mar 14 11:43:19 2008 @@ -2,6 +2,10 @@ Kupu changes ============ +- 1.4.9 + + - Workaround for bad KSS form submissions (Plone ticket 7893) + - 1.4.8 - Tabbing key now takes you to next/previous field. However, plone Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupuploneinit.js ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupuploneinit.js (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupuploneinit.js Fri Mar 14 11:43:19 2008 @@ -201,6 +201,7 @@ opt.selected = opt.defaultSelected = (opt.value=='text/html'); } pulldown.disabled = true; + pulldown.removeAttribute('name'); var hidden = document.createElement('input'); hidden.type = 'hidden'; hidden.name = fmtname; From duncan at codespeak.net Fri Mar 14 13:14:30 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 14 Mar 2008 13:14:30 +0100 (CET) Subject: [kupu-checkins] r52490 - in kupu/trunk/kupu: common doc Message-ID: <20080314121430.154D2169F7A@codespeak.net> Author: duncan Date: Fri Mar 14 13:14:29 2008 New Revision: 52490 Modified: kupu/trunk/kupu/common/kupubasetools.js kupu/trunk/kupu/doc/CHANGES.txt Log: Manage anchors got confused by links Modified: kupu/trunk/kupu/common/kupubasetools.js ============================================================================== --- kupu/trunk/kupu/common/kupubasetools.js (original) +++ kupu/trunk/kupu/common/kupubasetools.js Fri Mar 14 13:14:29 2008 @@ -2870,7 +2870,10 @@ /* Returns the anchor for a node, creating one if reqd. unless * ifexists is set*/ var anchors = node.getElementsByTagName('a'); - if (anchors.length > 0) return anchors[0].name; + for (var i = 0; i < anchors.length; i++) { + if (anchors[i].name) { return anchors[i].name; } + } + if (ifexists) return; var anchor = Sarissa.getText(node, true).strip().truncate(40). Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Mar 14 13:14:29 2008 @@ -4,7 +4,12 @@ - 1.4.9 - - Workaround for bad KSS form submissions (Plone ticket 7893) + - Manage anchors didn't add an anchor correctly if there was an + anchor used for a link inside the element. + + - Plone tickets + + * 7893 Workaround for bad KSS form submissions - 1.4.8 From duncan at codespeak.net Fri Mar 14 16:13:59 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 14 Mar 2008 16:13:59 +0100 (CET) Subject: [kupu-checkins] r52504 - in kupu/trunk/kupu: common doc Message-ID: <20080314151359.71F59169EC2@codespeak.net> Author: duncan Date: Fri Mar 14 16:13:58 2008 New Revision: 52504 Modified: kupu/trunk/kupu/common/kupuhelpers.js kupu/trunk/kupu/doc/CHANGES.txt Log: Fix for Plone ticket 7939: Kupu breaks on Firefox 3.0b4 in OSX Modified: kupu/trunk/kupu/common/kupuhelpers.js ============================================================================== --- kupu/trunk/kupu/common/kupuhelpers.js (original) +++ kupu/trunk/kupu/common/kupuhelpers.js Fri Mar 14 16:13:58 2008 @@ -458,8 +458,9 @@ }; function MozillaSelection(document) { + var win = document.getWindow(); this.document = document; - this.selection = document.getWindow().getSelection(); + this.selection = win.getSelection(); this._createRange = function() { return this.document.getDocument().createRange(); @@ -573,7 +574,7 @@ // JavaScript isn't as nice as Python in that respect (kwargs) // if selectAfterPlace is a DOM node, select all of that node's // contents, else select the newly added node's - this.selection = this.document.getWindow().getSelection(); + this.selection = win.getSelection(); this.selection.addRange(range); if (selectAfterPlace.nodeType == 1) { this.selection.selectAllChildren(selectAfterPlace); @@ -587,7 +588,7 @@ this.selection.addRange(range); }; }; - this.document.getWindow().focus(); + win.focus(); }; return node; }; @@ -965,7 +966,7 @@ }; this.reset = function() { - this.selection = this.document.getWindow().getSelection(); + this.selection = win.getSelection(); }; this.cloneContents = function() { @@ -1007,8 +1008,8 @@ }; //sample kindly snipped from Mozilla's wiki - if( !Range.prototype.intersectsNode ){ - Range.prototype.intersectsNode = function(node) { + if( !win.Range.prototype.intersectsNode ){ + win.Range.prototype.intersectsNode = function(node) { var nodeRange = node.ownerDocument.createRange(); try { nodeRange.selectNode(node); @@ -1030,8 +1031,8 @@ }; return false; }; - if( !Range.prototype.containsNode ){ - Range.prototype.containsNode = function(node) { + if( !win.Range.prototype.containsNode ){ + win.Range.prototype.containsNode = function(node) { var nodeRange = node.ownerDocument.createRange(); try { nodeRange.selectNode(node); Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Mar 14 16:13:58 2008 @@ -10,6 +10,7 @@ - Plone tickets * 7893 Workaround for bad KSS form submissions + * 7939 Kupu breaks on Firefox 3.0b4 in OSX - 1.4.8 From duncan at codespeak.net Fri Mar 14 17:01:46 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 14 Mar 2008 17:01:46 +0100 (CET) Subject: [kupu-checkins] r52508 - in kupu/trunk/kupu: common doc Message-ID: <20080314160146.44839169EFC@codespeak.net> Author: duncan Date: Fri Mar 14 17:01:44 2008 New Revision: 52508 Modified: kupu/trunk/kupu/common/kupubasetools.js kupu/trunk/kupu/doc/CHANGES.txt Log: Plone ticket 6915 Kupu cant find anchors inside table cells Modified: kupu/trunk/kupu/common/kupubasetools.js ============================================================================== --- kupu/trunk/kupu/common/kupubasetools.js (original) +++ kupu/trunk/kupu/common/kupubasetools.js Fri Mar 14 17:01:44 2008 @@ -2833,13 +2833,21 @@ var doc = this.editor.getInnerDocument(); var body = doc.body; var paras = []; - for (var node = body.firstChild; node; node = node.nextSibling) { - var name = node.nodeName.toLowerCase(); - var style = name + "|" + node.className; - if (style==style1) { - paras.push([node,0]); - } else if (style==style2) { - paras.push([node,1]); + var pat = /(.*?)(\|.*|$)/; + var tag1 = style1.replace(pat, '$1'); + var tag2 = style2.replace(pat, '$1'); + if (tag2 && tag2 != tag1) { tag1 = "*"; } + if (tag1) { + var nodes = body.getElementsByTagName(tag1); + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var style = node.nodeName.toLowerCase() + "|" + node.className; + if (style==style1) { + paras.push([node,0]); + } + if (style==style2) { + paras.push([node,1]); + } } } return paras; Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Mar 14 17:01:44 2008 @@ -9,6 +9,7 @@ - Plone tickets + * 6915 Kupu can't find anchors inside table cells * 7893 Workaround for bad KSS form submissions * 7939 Kupu breaks on Firefox 3.0b4 in OSX From duncan at codespeak.net Fri Mar 14 17:16:32 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 14 Mar 2008 17:16:32 +0100 (CET) Subject: [kupu-checkins] r52511 - in kupu/trunk/kupu: common doc Message-ID: <20080314161632.A0284169F39@codespeak.net> Author: duncan Date: Fri Mar 14 17:16:32 2008 New Revision: 52511 Modified: kupu/trunk/kupu/common/kupueditor.js kupu/trunk/kupu/doc/CHANGES.txt Log: Plone ticket 7916 kupu breaks strong/em tags with class names, on firefox Modified: kupu/trunk/kupu/common/kupueditor.js ============================================================================== --- kupu/trunk/kupu/common/kupueditor.js (original) +++ kupu/trunk/kupu/common/kupueditor.js Fri Mar 14 17:16:32 2008 @@ -705,9 +705,9 @@ if (!_SARISSA_IS_IE) { /* Mozilla doesn't understand strong/em */ var fixups = { 'strong':'b', 'em':'i' }; - text = text.replace(/<(\/?)(strong|em)>/gi, function(all,close,tag) { + text = text.replace(/<(\/?)(strong|em)\b([^>]*)>/gi, function(all,close,tag,attrs) { tag = fixups[tag.toLowerCase()]; - return '<'+close+tag+'>'; + return '<'+close+tag+attrs+'>'; }); }; text = text.replace(/

()<\/p>/g,'$1'); Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Mar 14 17:16:32 2008 @@ -11,6 +11,7 @@ * 6915 Kupu can't find anchors inside table cells * 7893 Workaround for bad KSS form submissions + * 7916 Kupu breaks strong/em tags with class names, on firefox * 7939 Kupu breaks on Firefox 3.0b4 in OSX - 1.4.8 From kupu-checkins at codespeak.net Sun Mar 16 12:47:28 2008 From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net) Date: Sun, 16 Mar 2008 12:47:28 +0100 (CET) Subject: [kupu-checkins] Daily Newsletter - Sunday, ID:180504312 Message-ID: <20080316174641.6219.qmail@softbank126112202054.bbtec.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080316/2c9cc367/attachment-0001.htm From timte at codespeak.net Wed Mar 19 15:39:28 2008 From: timte at codespeak.net (timte at codespeak.net) Date: Wed, 19 Mar 2008 15:39:28 +0100 (CET) Subject: [kupu-checkins] r52723 - kupu/trunk/kupu/plone/kupu_plone_layer Message-ID: <20080319143928.32267169EF9@codespeak.net> Author: timte Date: Wed Mar 19 15:39:27 2008 New Revision: 52723 Modified: kupu/trunk/kupu/plone/kupu_plone_layer/convertContentForKupu.py Log: If a formlib form is used in plone 2.5 kupu causes UnicodeDecodeError by trying str(content) when content is non-ascii unicode. A check for unicode is added. Modified: kupu/trunk/kupu/plone/kupu_plone_layer/convertContentForKupu.py ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/convertContentForKupu.py (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/convertContentForKupu.py Wed Mar 19 15:39:27 2008 @@ -13,6 +13,13 @@ text_format = context.REQUEST.get('%s_text_format' % fieldname, context.getContentType(fieldname)) if len(content)==0 or 'html' in text_format.lower(): + if isinstance(content, unicode): + try: + encoding = context.getCharset() + except AttributeError: + encoding = 'utf8' + content = content.encode(encoding) + return str(content) transforms = getToolByName(context, 'portal_transforms') From duncan at codespeak.net Thu Mar 20 12:35:56 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 20 Mar 2008 12:35:56 +0100 (CET) Subject: [kupu-checkins] r52768 - in kupu/trunk/kupu: doc plone Message-ID: <20080320113556.58C8C16852C@codespeak.net> Author: duncan Date: Thu Mar 20 12:35:55 2008 New Revision: 52768 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/librarytool.py Log: Plone ticket 7804 KupuLibraryTool spellcheck method is missing a docstring Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu Mar 20 12:35:55 2008 @@ -10,6 +10,7 @@ - Plone tickets * 6915 Kupu can't find anchors inside table cells + * 7804 KupuLibraryTool spellcheck method is missing a docstring * 7893 Workaround for bad KSS form submissions * 7916 Kupu breaks strong/em tags with class names, on firefox * 7939 Kupu breaks on Firefox 3.0b4 in OSX Modified: kupu/trunk/kupu/plone/librarytool.py ============================================================================== --- kupu/trunk/kupu/plone/librarytool.py (original) +++ kupu/trunk/kupu/plone/librarytool.py Thu Mar 20 12:35:55 2008 @@ -364,6 +364,9 @@ return getattr(self, '_toolbar_filters', {}) def spellcheck(self, REQUEST): + """Call spellchecker: WARNING this functionality may not work, + it is not part of the standard Plone+kupu implementation. + Some user assembly required.""" from Products.kupu.python.spellcheck import SpellChecker, format_result data = REQUEST["text"] c = SpellChecker() From duncan at codespeak.net Thu Mar 20 12:37:48 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 20 Mar 2008 12:37:48 +0100 (CET) Subject: [kupu-checkins] r52769 - kupu/trunk/kupu/doc Message-ID: <20080320113748.5B6A816852C@codespeak.net> Author: duncan Date: Thu Mar 20 12:37:47 2008 New Revision: 52769 Modified: kupu/trunk/kupu/doc/PLONE2.txt Log: Clarify policy in documentation: hidden toolbar buttons may not be supported. Modified: kupu/trunk/kupu/doc/PLONE2.txt ============================================================================== --- kupu/trunk/kupu/doc/PLONE2.txt (original) +++ kupu/trunk/kupu/doc/PLONE2.txt Thu Mar 20 12:37:47 2008 @@ -501,6 +501,11 @@ ), ), +N.B. Toolbar buttons which are disabled in Plone's default +configuration may represent tools which are not fully integrated into +Plone. If you wish to use these tools and find problems with them you +should submit a patch. + Custom styles ------------- Kupu allows you to specify styles for paragraphs (P or DIV tags), From duncan at codespeak.net Thu Mar 20 14:52:14 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 20 Mar 2008 14:52:14 +0100 (CET) Subject: [kupu-checkins] r52772 - in kupu/trunk/kupu: doc plone plone/kupu_plone_layer Message-ID: <20080320135214.5EBBA168539@codespeak.net> Author: duncan Date: Thu Mar 20 14:52:12 2008 New Revision: 52772 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/body.kupu kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/trunk/kupu/plone/kupu_plone_layer/kupuplone.css.dtml Log: Fix plone ticket #7409 "edit without kupu" does not appear on edit form Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu Mar 20 14:52:12 2008 @@ -7,9 +7,12 @@ - Manage anchors didn't add an anchor correctly if there was an anchor used for a link inside the element. + - timte fixed a possible unicode decode error + - Plone tickets * 6915 Kupu can't find anchors inside table cells + * 7409 "edit without kupu" does not appear on edit form (the fix for this make the link appear but only in source mode). * 7804 KupuLibraryTool spellcheck method is missing a docstring * 7893 Workaround for bad KSS form submissions * 7916 Kupu breaks strong/em tags with class names, on firefox Modified: kupu/trunk/kupu/plone/body.kupu ============================================================================== --- kupu/trunk/kupu/plone/body.kupu (original) +++ kupu/trunk/kupu/plone/body.kupu Thu Mar 20 14:52:12 2008 @@ -65,15 +65,17 @@

Edit without visual editor 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 Mar 20 14:52:12 2008 @@ -483,7 +483,7 @@
-
+ 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 Mar 20 14:52:12 2008 @@ -244,6 +244,9 @@ font-size: 100%; } +.kupusourceoverride { display: none; } +.kupu-sourcemode .kupusourceoverride { display: block; margin: 0 0.5em; } + div.kupuoverride { margin-left: 0.75em; } From duncan at codespeak.net Thu Mar 20 16:05:58 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 20 Mar 2008 16:05:58 +0100 (CET) Subject: [kupu-checkins] r52777 - in kupu/trunk/kupu: common common/kupudrawers doc plone plone/kupu_plone_layer Message-ID: <20080320150558.49B9816852C@codespeak.net> Author: duncan Date: Thu Mar 20 16:05:56 2008 New Revision: 52777 Modified: kupu/trunk/kupu/common/kupudrawers.js kupu/trunk/kupu/common/kupudrawers/drawer.xsl kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_plone_layer/kupucollection.xml.pt kupu/trunk/kupu/plone/plonedrawers.py kupu/trunk/kupu/plone/plonelibrarytool.py Log: Image upload now has same options as image insertion (list of sizes & styles is taken from content type 'Image' so may not be appropriate for uploading other types). Modified: kupu/trunk/kupu/common/kupudrawers.js ============================================================================== --- kupu/trunk/kupu/common/kupudrawers.js (original) +++ kupu/trunk/kupu/common/kupudrawers.js Thu Mar 20 16:05:56 2008 @@ -1442,6 +1442,7 @@ alert("Please enter a title for the image you are uploading"); return; }; + this.upload_title = form.node_prop_title.value; form.node_prop_desc.value = form.node_prop_desc.value.replace(/^\xa0|\xa0$/g,''); form.submit(); }; @@ -1457,13 +1458,33 @@ }; // called by onLoad within document sent by server - this.finishUpload = function(url) { + this.finishUpload = function(uri) { this.editor.resumeEditing(); - var imgclass = 'image-inline'; - if (this.editor.config && !!this.editor.config.captions) { + var sizeselector = document.getElementsByName('image-size-selector'); + if (sizeselector && sizeselector.length > 0) { + sizeselector = sizeselector[0]; + uri += sizeselector.options[sizeselector.selectedIndex].value; + } + var radios = document.getElementsByName('image-align'); + var imgclass = ""; + for (var i = 0; i < radios.length; i++) { + if (radios[i].checked) { + imgclass = radios[i].value; + }; + }; + var caption = document.getElementsByName('image-caption'); + if (caption && caption.length>0 && caption[0].checked) { imgclass += " captioned"; }; - this.tool.createImage(url, null, imgclass); + var classnames = document.getElementById('kupu-image-class'); + if (classnames && classnames.selectedIndex >= 0) { + imgclass += " "+classnames.options[classnames.selectedIndex].value; + } else { + imgclass += ' image-inline'; + } + imgclass = imgclass.strip(); + + this.tool.createImage(uri, this.upload_title, imgclass); this.shared.newimages = 1; this.drawertool.closeDrawer(); }; Modified: kupu/trunk/kupu/common/kupudrawers/drawer.xsl ============================================================================== --- kupu/trunk/kupu/common/kupudrawers/drawer.xsl (original) +++ kupu/trunk/kupu/common/kupudrawers/drawer.xsl Thu Mar 20 16:05:56 2008 @@ -341,8 +341,7 @@ - - +
@@ -429,6 +428,10 @@
+ + + + Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Thu Mar 20 16:05:56 2008 @@ -9,6 +9,8 @@ - timte fixed a possible unicode decode error + - Image upload now has same style options as image insertion. + - Plone tickets * 6915 Kupu can't find anchors inside table cells Modified: kupu/trunk/kupu/plone/kupu_plone_layer/kupucollection.xml.pt ============================================================================== --- kupu/trunk/kupu/plone/kupu_plone_layer/kupucollection.xml.pt (original) +++ kupu/trunk/kupu/plone/kupu_plone_layer/kupucollection.xml.pt Thu Mar 20 16:05:56 2008 @@ -91,8 +91,26 @@ - + + + + + + + + + + + + Modified: kupu/trunk/kupu/plone/plonedrawers.py ============================================================================== --- kupu/trunk/kupu/plone/plonedrawers.py (original) +++ kupu/trunk/kupu/plone/plonedrawers.py Thu Mar 20 16:05:56 2008 @@ -877,6 +877,40 @@ base = base[:posfactory] return base + security.declareProtected("View", "getUploadImageSizes") + def getUploadImageSizes(self, portal_type=None): + resource_type = self.getResourceType() + portal = getToolByName(self, 'portal_url').getPortalObject() + mediatypes = resource_type.get_portal_types() + catalog = getToolByName(self, 'portal_catalog') + adaptor = InfoAdaptor(self, resource_type, portal) + if portal_type is None: + portal_type = self.getDefaultImageType() + + brains = catalog.searchResults(portal_type=portal_type, limit=1)[:1] + if brains: + info = adaptor.get_image_sizes(brains[0], portal_type, '') + return info + return [] + + security.declareProtected("View", "getUploadImageClasses") + def getUploadImageClasses(self, portal_type=None): + if portal_type is None: + portal_type = self.getDefaultImageType() + stored = self.getClassesForType(portal_type) + classes = [] + for c in stored: + c = c.strip() + if not c: + continue + if '|' in c: + title, classname = c.split('|', 1) + classes.append({'title': title, 'classname': classname}) + else: + classes.append({'title': c, 'classname': c}) + return classes + + def _getImageSizes(self): resource_type = self.getResourceType() portal = getToolByName(self, 'portal_url').getPortalObject() Modified: kupu/trunk/kupu/plone/plonelibrarytool.py ============================================================================== --- kupu/trunk/kupu/plone/plonelibrarytool.py (original) +++ kupu/trunk/kupu/plone/plonelibrarytool.py Thu Mar 20 16:05:56 2008 @@ -709,8 +709,14 @@ value = action_map.get(portal_type, {}).get('scalefield', 'image') return value + security.declareProtected(permissions.ManageLibraries, "getDefaultImageType") + def getDefaultImageType(self): + return 'Image' + security.declareProtected(permissions.ManageLibraries, "getDefaultScaleForType") - def getDefaultScaleForType(self, portal_type): + def getDefaultScaleForType(self, portal_type = None): + if not portal_type: + portal_type = self.getDefaultImageType() action_map = getattr(self, '_preview_actions', {}) value = action_map.get(portal_type, {}).get('defscale', 'image_preview') return value From duncan at codespeak.net Fri Mar 21 17:37:01 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 21 Mar 2008 17:37:01 +0100 (CET) Subject: [kupu-checkins] r52814 - in kupu/trunk/kupu/plone: . kupu_plone_layer Message-ID: <20080321163701.7295B16846C@codespeak.net> Author: duncan Date: Fri Mar 21 17:37:00 2008 New Revision: 52814 Modified: kupu/trunk/kupu/plone/body.kupu kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html Log: Need two checks for exists('kupu_content') :( Modified: kupu/trunk/kupu/plone/body.kupu ============================================================================== --- kupu/trunk/kupu/plone/body.kupu (original) +++ kupu/trunk/kupu/plone/body.kupu Fri Mar 21 17:37:00 2008 @@ -67,7 +67,7 @@
- + @@ -483,7 +483,7 @@
-
+ From kupu-checkins at codespeak.net Fri Mar 21 17:50:42 2008 From: kupu-checkins at codespeak.net (Your Deal Admin 713897521 ® Official Site) Date: Fri, 21 Mar 2008 17:50:42 +0100 (CET) Subject: [kupu-checkins] March %72 OFF Message-ID: <20080321064946.4362.qmail@abhh33.neoplus.adsl.tpnet.pl> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20080321/1af34f55/attachment-0001.htm From duncan at codespeak.net Tue Mar 25 13:52:53 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 25 Mar 2008 13:52:53 +0100 (CET) Subject: [kupu-checkins] r52906 - in kupu/trunk/kupu: . plone/profiles/default Message-ID: <20080325125253.5ABD9168438@codespeak.net> Author: duncan Date: Tue Mar 25 13:52:52 2008 New Revision: 52906 Modified: kupu/trunk/kupu/plone/profiles/default/metadata.xml kupu/trunk/kupu/version.txt Log: Update version numbers. 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 Tue Mar 25 13:52:52 2008 @@ -1,4 +1,4 @@ - 1.4.6 + 1.4.9 Modified: kupu/trunk/kupu/version.txt ============================================================================== --- kupu/trunk/kupu/version.txt (original) +++ kupu/trunk/kupu/version.txt Tue Mar 25 13:52:52 2008 @@ -1 +1 @@ -kupu 1.4.8 +kupu 1.4.9 From duncan at codespeak.net Tue Mar 25 13:55:31 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 25 Mar 2008 13:55:31 +0100 (CET) Subject: [kupu-checkins] r52907 - kupu/tag/kupu-1.4.9 Message-ID: <20080325125531.17A0F168435@codespeak.net> Author: duncan Date: Tue Mar 25 13:55:30 2008 New Revision: 52907 Added: kupu/tag/kupu-1.4.9/ - copied from r52906, kupu/trunk/kupu/ Log: Create tag for 1.4.9 release From duncan at codespeak.net Tue Mar 25 14:07:30 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 25 Mar 2008 14:07:30 +0100 (CET) Subject: [kupu-checkins] r52910 - in kupu/branch/kupu-1.4: . common common/kupudrawers doc mmbase plone plone/kupu_plone_layer plone/profiles/default plone/tests plone/tests/input plone/tests/output tests Message-ID: <20080325130730.42DBF1683D9@codespeak.net> Author: duncan Date: Tue Mar 25 14:07:28 2008 New Revision: 52910 Added: kupu/branch/kupu-1.4/plone/config.py - copied unchanged from r52909, kupu/trunk/kupu/plone/config.py kupu/branch/kupu-1.4/plone/profiles/default/metadata.xml - copied unchanged from r52909, kupu/trunk/kupu/plone/profiles/default/metadata.xml kupu/branch/kupu-1.4/plone/tests/image.jpg - copied unchanged from r52909, kupu/trunk/kupu/plone/tests/image.jpg kupu/branch/kupu-1.4/plone/tests/kuputestcase.py - copied unchanged from r52909, kupu/trunk/kupu/plone/tests/kuputestcase.py Modified: kupu/branch/kupu-1.4/common/kupu_kjax.js kupu/branch/kupu-1.4/common/kupubasetools.js kupu/branch/kupu-1.4/common/kupucontentfilters.js kupu/branch/kupu-1.4/common/kupudrawers.js kupu/branch/kupu-1.4/common/kupudrawers/drawer.xsl kupu/branch/kupu-1.4/common/kupueditor.js kupu/branch/kupu-1.4/common/kupuhelpers.js kupu/branch/kupu-1.4/common/sarissa.js kupu/branch/kupu-1.4/doc/CHANGES.txt kupu/branch/kupu-1.4/doc/PLONE2.txt kupu/branch/kupu-1.4/make-jspx.xsl kupu/branch/kupu-1.4/mmbase/body.kupu kupu/branch/kupu-1.4/mmbase/html.kupu kupu/branch/kupu-1.4/mmbase/kupustyle.css kupu/branch/kupu-1.4/mmbase/mmbase.kupu kupu/branch/kupu-1.4/mmbase/node.jspx kupu/branch/kupu-1.4/mmbase/toolboxes.kupu kupu/branch/kupu-1.4/plone/ReftextField.py kupu/branch/kupu-1.4/plone/body.kupu kupu/branch/kupu-1.4/plone/html2captioned.py kupu/branch/kupu-1.4/plone/kupu_config.pt kupu/branch/kupu-1.4/plone/kupu_plone_layer/convertContentForKupu.py kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupucollection.xml.pt kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuplone.css.dtml kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneeditor.js kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneinit.js kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupusearch.xml.pt kupu/branch/kupu-1.4/plone/kupu_plone_layer/sample-kupu-customisation-policy.py 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/import_steps.xml kupu/branch/kupu-1.4/plone/profiles/default/kupu.xml kupu/branch/kupu-1.4/plone/tests/framework.py kupu/branch/kupu-1.4/plone/tests/input/linked.in kupu/branch/kupu-1.4/plone/tests/input/simple.in kupu/branch/kupu-1.4/plone/tests/output/linked.out kupu/branch/kupu-1.4/plone/tests/output/notcaptioned.out kupu/branch/kupu-1.4/plone/tests/output/notquoted.out kupu/branch/kupu-1.4/plone/tests/output/simple.out kupu/branch/kupu-1.4/plone/tests/runme.cmd kupu/branch/kupu-1.4/plone/tests/test_browserSupportsKupu.py kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py kupu/branch/kupu-1.4/plone/tests/test_links.py kupu/branch/kupu-1.4/plone/wysiwyg_support.kupu kupu/branch/kupu-1.4/plone/zmi_links.pt kupu/branch/kupu-1.4/tests/test_kupuhelpers.js kupu/branch/kupu-1.4/version.txt Log: Bring branch/kupu-1.4 back in line with trunk. 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 Tue Mar 25 14:07:28 2008 @@ -57,9 +57,7 @@ // a web server expects from a POST. xmlhttp.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); }; - if (reload) { - xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); - } + xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"); this.xmlhttp = xmlhttp; xmlhttp.send(body); } catch(e) { Modified: kupu/branch/kupu-1.4/common/kupubasetools.js ============================================================================== --- kupu/branch/kupu-1.4/common/kupubasetools.js (original) +++ kupu/branch/kupu-1.4/common/kupubasetools.js Tue Mar 25 14:07:28 2008 @@ -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) { @@ -2751,9 +2752,9 @@ var width = document.body.offsetWidth-5; var height = document.body.offsetHeight-5; } - width = width + 'px'; - var offset = iframe.parentNode.offsetTop; + var offset = fulleditor.offsetTop; var nheight = Math.max(height - offset -1/*top border*/, 10) + 'px'; + width = width + 'px'; fulleditor.style.width = width; /*IE needs this*/ iframe.style.width = width; iframe.style.height = nheight; @@ -2832,13 +2833,21 @@ var doc = this.editor.getInnerDocument(); var body = doc.body; var paras = []; - for (var node = body.firstChild; node; node = node.nextSibling) { - var name = node.nodeName.toLowerCase(); - var style = name + "|" + node.className; - if (style==style1) { - paras.push([node,0]); - } else if (style==style2) { - paras.push([node,1]); + var pat = /(.*?)(\|.*|$)/; + var tag1 = style1.replace(pat, '$1'); + var tag2 = style2.replace(pat, '$1'); + if (tag2 && tag2 != tag1) { tag1 = "*"; } + if (tag1) { + var nodes = body.getElementsByTagName(tag1); + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var style = node.nodeName.toLowerCase() + "|" + node.className; + if (style==style1) { + paras.push([node,0]); + } + if (style==style2) { + paras.push([node,1]); + } } } return paras; @@ -2869,7 +2878,10 @@ /* Returns the anchor for a node, creating one if reqd. unless * ifexists is set*/ var anchors = node.getElementsByTagName('a'); - if (anchors.length > 0) return anchors[0].name; + for (var i = 0; i < anchors.length; i++) { + if (anchors[i].name) { return anchors[i].name; } + } + if (ifexists) return; var anchor = Sarissa.getText(node, true).strip().truncate(40). 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 Tue Mar 25 14:07:28 2008 @@ -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) { @@ -312,7 +317,7 @@ this.misc = ['noscript'].concat(this.misc_inline); this.inline = ['a'].concat(this.special, this.fontstyle, this.phrase, this.inline_forms); - this.Inline = ['#text'].concat(this.inline, this.misc_inline); + this.Inline = ['#text', '#comment'].concat(this.inline, this.misc_inline); this.heading = ['h1','h2','h3','h4','h5','h6']; this.lists = ['ul','ol','dl','menu','dir']; @@ -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; + } } } @@ -744,6 +773,8 @@ if (nostructure || permittedChildren['#text']) { parentnode.appendChild(ownerdoc.createCDATASection(kid.nodeValue)); } + } else if (kid.nodeType == 8) { + parentnode.appendChild(ownerdoc.createComment(kid.nodeValue)); } } } 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 Tue Mar 25 14:07:28 2008 @@ -5,7 +5,7 @@ * 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. - * + * *****************************************************************************/ // $Id$ @@ -21,7 +21,7 @@ */ this.drawers = {}; this.current_drawer = null; - + this.initialize = function(editor) { this.editor = editor; this.isIE = this.editor.getBrowserName() == 'IE'; @@ -84,7 +84,7 @@ proto.createContent = function() { /* fill the drawer with some content */ - // here's where any intelligence and XSLT transformation and such + // here's where any intelligence and XSLT transformation and such // is done this.element.style.display = 'block'; this.focusElement(); @@ -242,7 +242,7 @@ }; proto.anchorText = function(a) { - // Text inside anchor, or immediate sibling block tag, or parent block. + // Text inside anchor, or immediate sibling block tag, or parent block. var blocktag = /^div|p|body|td|h.$/i; var txt = ''; var prefix = '#' + a.name; @@ -315,7 +315,7 @@ function LinkDrawer(elementid, tool) { /* Link drawer */ DrawerWithAnchors.call(this, elementid, tool); - + var input = getBaseTagClass(this.element, 'input', 'kupu-linkdrawer-input'); var embed = getBaseTagClass(this.element, 'textarea', 'kupu-embed-input'); var preview = getBaseTagClass(this.element, 'iframe', 'kupu-linkdrawer-preview'); @@ -324,11 +324,16 @@ this.anchorui = getBaseTagClass(this.element, 'tr', 'kupu-linkdrawer-anchors'); this.target = ''; this.panel = getBaseTagClass(this.element, 'div', 'kupu-panels'); - var tabs = getBaseTagClass(this.element, 'ul', 'kupu-tabs').getElementsByTagName('a'); - for (var i = 0; i < tabs.length; i++) { - addEventHandler(tabs[i], 'click', this.switchMode, this); + var kuputabs = getBaseTagClass(this.element, 'ul', 'kupu-tabs'); + if (kuputabs) { + var tabs = kuputabs.getElementsByTagName('a'); + for (var i = 0; i < tabs.length; i++) { + addEventHandler(tabs[i], 'click', this.switchMode, this); + } + } + if (embed) { + addEventHandler(embed, 'click', function() { if(embed.defaultValue==embed.value) {embed.select();} }); } - addEventHandler(embed, 'click', function() { if(embed.defaultValue==embed.value) {embed.select();} }); this.selChange = function() { var anchor = this.getFragment(); @@ -403,7 +408,7 @@ var current = bits.length > 1 ? bits[bits.length-1] : ''; return current; } - + this.getMode = function() { return !!(/addlink/.test(this.panel.className)); }; @@ -489,7 +494,7 @@ }; fixClasses(addclassselect); fixClasses(editclassselect); - + var table = editor.getNearestParentOfType(selNode, 'table'); var show, hide; if (!table) { @@ -578,11 +583,11 @@ TableDrawer.prototype = new Drawer; function LibraryDrawer(tool, xsluri, libsuri, searchuri, baseelement, selecturi) { - /* a drawer that loads XSLT and XML from the server + /* a drawer that loads XSLT and XML from the server and converts the XML to XHTML for the drawer using the XSLT there are 2 types of XML file loaded from the server: the first - contains a list of 'libraries', partitions for the data items, + contains a list of 'libraries', partitions for the data items, and the second a list of data items for a certain library all XML loading is done async, since sync loading can freeze Mozilla @@ -626,17 +631,17 @@ this.libsuri = libsuri; this.searchuri = searchuri; this.selecturi = selecturi; - + // marker that gets set when a new image has been uploaded this.shared.newimages = null; // the following vars will be available after this.initialize() // has been called - + // this will be filled by this._libXslCallback() this.shared.xsl = null; - // this will be filled by this.loadLibraries(), which is called - // somewhere further down the chain starting with + // this will be filled by this.loadLibraries(), which is called + // somewhere further down the chain starting with // this._libsXslCallback() this.xmldata = null; @@ -663,7 +668,7 @@ this._libsXslCallback = function(dom) { /* callback for when the xsl for the libs is loaded - + this is called on init and since the initial libs need to be loaded as well (and everything is async with callbacks so there's no way to wait until the XSL is loaded) this @@ -672,7 +677,7 @@ this.shared.xsl = dom; Sarissa.getDomDocument(); /* Work round Sarissa initialisation glitch */ - // Change by Paul to have cached xslt transformers for reuse of + // Change by Paul to have cached xslt transformers for reuse of // multiple transforms and also xslt params try { var xsltproc = new XSLTProcessor(); @@ -715,8 +720,8 @@ } // load the initial XML if(!this.xmldata) { - // Do a meaningful test to see if this is IE5.5 or some other - // editor-enabled version whose XML support isn't good enough + // Do a meaningful test to see if this is IE5.5 or some other + // editor-enabled version whose XML support isn't good enough // for the drawers if (!window.XSLTProcessor) { alert("This function requires better XML support in your browser."); @@ -862,7 +867,7 @@ this.selectLibrary = function(id) { /* unselect the currently selected lib and select a new one - the selected lib (libraries pane) will have a specific CSS class + the selected lib (libraries pane) will have a specific CSS class (selected) */ // remove selection in the DOM @@ -882,7 +887,7 @@ var items_xpath = "items"; var items_node = libnode.selectSingleNode(items_xpath); - + if (items_node && !this.shared.newimages) { // The library has already been loaded before or was // already provided with an items list. No need to do @@ -901,7 +906,7 @@ }; }; this.flagSelectedLib = function(id) { - // instead of running the full transformations again we get a + // instead of running the full transformations again we get a // reference to the element and set the classname... var newseldiv = document.getElementById(id); if (newseldiv) { @@ -1011,7 +1016,7 @@ // First turn off current selection, if any this.removeSelection(); - + var leafnode_path = "//"+tag+"[@id='" + id + "']"; var leafnode = this.xmldata.selectSingleNode(leafnode_path); @@ -1108,7 +1113,7 @@ this.removeSelection = function() { // Mark the drawer as having no selection if (!this.xmldata) return; - + if (!this.multiple) { var items = this.xmldata.selectNodes('//resource[@checked]'); for (var i = 0; i < items.length; i++) { @@ -1294,7 +1299,7 @@ // library as selected this.deselectActiveCollection(); resultlib.setAttribute("selected", "1"); - + // now hook the result library into our DOM if (this.editor.getBrowserName() == 'IE') { resultlib = resultlib.cloneNode(true); @@ -1330,7 +1335,7 @@ with the DOM as the first argument and the uri loaded as the second - note that this method should be called in the context of an + note that this method should be called in the context of an xmlhttp object */ if (xmlhttp.readyState == 4) { @@ -1427,7 +1432,7 @@ } ImageLibraryDrawer.prototype.createContent.call(this); }; - + // upload, on submit/insert press this.uploadImage = function() { var form = document.getElementById('kupu_upload_form'); @@ -1435,34 +1440,55 @@ if (form.node_prop_title.value == "") { alert("Please enter a title for the image you are uploading"); - return; + return; }; + this.upload_title = form.node_prop_title.value; form.node_prop_desc.value = form.node_prop_desc.value.replace(/^\xa0|\xa0$/g,''); form.submit(); }; - + // called for example when no permission to upload for some reason this.cancelUpload = function(msg) { - var s = this.xmldata.selectSingleNode('/libraries/*[@selected]'); + var s = this.xmldata.selectSingleNode('/libraries/*[@selected]'); s.removeAttribute("selected"); this.updateDisplay(); if (msg != '') { alert(msg); }; }; - + // called by onLoad within document sent by server - this.finishUpload = function(url) { + this.finishUpload = function(uri) { this.editor.resumeEditing(); - var imgclass = 'image-inline'; - if (this.editor.config && !!this.editor.config.captions) { + var sizeselector = document.getElementsByName('image-size-selector'); + if (sizeselector && sizeselector.length > 0) { + sizeselector = sizeselector[0]; + uri += sizeselector.options[sizeselector.selectedIndex].value; + } + var radios = document.getElementsByName('image-align'); + var imgclass = ""; + for (var i = 0; i < radios.length; i++) { + if (radios[i].checked) { + imgclass = radios[i].value; + }; + }; + var caption = document.getElementsByName('image-caption'); + if (caption && caption.length>0 && caption[0].checked) { imgclass += " captioned"; }; - this.tool.createImage(url, null, imgclass); + var classnames = document.getElementById('kupu-image-class'); + if (classnames && classnames.selectedIndex >= 0) { + imgclass += " "+classnames.options[classnames.selectedIndex].value; + } else { + imgclass += ' image-inline'; + } + imgclass = imgclass.strip(); + + this.tool.createImage(uri, this.upload_title, imgclass); this.shared.newimages = 1; this.drawertool.closeDrawer(); }; - + this.save = function() { this.editor.resumeEditing(); @@ -1470,7 +1496,7 @@ from the drawer */ var selxpath = '//resource[@selected]'; var selnode = this.xmldata.selectSingleNode(selxpath); - + // If no image resource is selected, check for upload if (!selnode) { var uploadbutton = this.xmldata.selectSingleNode("/libraries/*[@selected]//uploadbutton"); @@ -1565,7 +1591,7 @@ var name = getFromSelector('link_name').value; var node = getFromSelector('link_target'); var target = node && node.value; - + this.tool.createLink(uri, null, name, target, title, 'internal-link'); this.drawertool.closeDrawer(); }; @@ -1672,12 +1698,12 @@ }; var div = el('div', {className: "kupu-bm-level" + paras[i][1] }, [el('label', inner)]); - + this.paralist.appendChild(div); }; }; this.createContent = function() { - this.fillList(); + this.fillList(); this.element.style.display = 'block'; this.focusElement(); }; @@ -1685,7 +1711,7 @@ var mode = this.getMode(); var selected = this.paralist.getElementsByTagName('input'); var ed = this.editor; - + ed.resumeEditing(); if (mode==2) { Modified: kupu/branch/kupu-1.4/common/kupudrawers/drawer.xsl ============================================================================== --- kupu/branch/kupu-1.4/common/kupudrawers/drawer.xsl (original) +++ kupu/branch/kupu-1.4/common/kupudrawers/drawer.xsl Tue Mar 25 14:07:28 2008 @@ -341,8 +341,7 @@ - - +
@@ -429,6 +428,10 @@
+ + + + Modified: kupu/branch/kupu-1.4/common/kupueditor.js ============================================================================== --- kupu/branch/kupu-1.4/common/kupueditor.js (original) +++ kupu/branch/kupu-1.4/common/kupueditor.js Tue Mar 25 14:07:28 2008 @@ -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); } }; @@ -595,6 +638,8 @@ }; this._isDocumentSelected = function() { + if (this.suspended) return false; + var editable_body = this.getInnerDocument().getElementsByTagName('body')[0]; try { var selrange = this.getInnerDocument().selection.createRange(); @@ -652,20 +697,27 @@ // 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]); } if (!_SARISSA_IS_IE) { /* Mozilla doesn't understand strong/em */ var fixups = { 'strong':'b', 'em':'i' }; - text = text.replace(/<(\/?)(strong|em)>/gi, function(all,close,tag) { + text = text.replace(/<(\/?)(strong|em)\b([^>]*)>/gi, function(all,close,tag,attrs) { tag = fixups[tag.toLowerCase()]; - return '<'+close+tag+'>'; + return '<'+close+tag+attrs+'>'; }); }; 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) { @@ -845,15 +897,14 @@ if (!this.suspended) { return; } - this.suspended = false; this.clearClass('kupu-modal'); for (var id in this.tools) { this.tools[id].enable(); } if (this.getBrowserName() == "IE") { var body = this.getInnerDocument().getElementsByTagName('body')[0]; - this._restoreSelection(); body.setAttribute('contentEditable', 'true'); + this._restoreSelection(); } else { var doc = this.getInnerDocument(); this.getDocument().execCommand('contentReadOnly', 'false'); @@ -861,6 +912,7 @@ this.focusDocument(); this.getSelection().restoreRange(this._previous_range); } + this.suspended = false; }; this.newElement = function(tagName) { return newDocumentElement(this.getInnerDocument(), tagName, arguments); Modified: kupu/branch/kupu-1.4/common/kupuhelpers.js ============================================================================== --- kupu/branch/kupu-1.4/common/kupuhelpers.js (original) +++ kupu/branch/kupu-1.4/common/kupuhelpers.js Tue Mar 25 14:07:28 2008 @@ -458,8 +458,9 @@ }; function MozillaSelection(document) { + var win = document.getWindow(); this.document = document; - this.selection = document.getWindow().getSelection(); + this.selection = win.getSelection(); this._createRange = function() { return this.document.getDocument().createRange(); @@ -573,7 +574,7 @@ // JavaScript isn't as nice as Python in that respect (kwargs) // if selectAfterPlace is a DOM node, select all of that node's // contents, else select the newly added node's - this.selection = this.document.getWindow().getSelection(); + this.selection = win.getSelection(); this.selection.addRange(range); if (selectAfterPlace.nodeType == 1) { this.selection.selectAllChildren(selectAfterPlace); @@ -587,7 +588,7 @@ this.selection.addRange(range); }; }; - this.document.getWindow().focus(); + win.focus(); }; return node; }; @@ -965,7 +966,7 @@ }; this.reset = function() { - this.selection = this.document.getWindow().getSelection(); + this.selection = win.getSelection(); }; this.cloneContents = function() { @@ -1007,8 +1008,8 @@ }; //sample kindly snipped from Mozilla's wiki - if( !Range.prototype.intersectsNode ){ - Range.prototype.intersectsNode = function(node) { + if( !win.Range.prototype.intersectsNode ){ + win.Range.prototype.intersectsNode = function(node) { var nodeRange = node.ownerDocument.createRange(); try { nodeRange.selectNode(node); @@ -1030,8 +1031,8 @@ }; return false; }; - if( !Range.prototype.containsNode ){ - Range.prototype.containsNode = function(node) { + if( !win.Range.prototype.containsNode ){ + win.Range.prototype.containsNode = function(node) { var nodeRange = node.ownerDocument.createRange(); try { nodeRange.selectNode(node); Modified: kupu/branch/kupu-1.4/common/sarissa.js ============================================================================== --- kupu/branch/kupu-1.4/common/sarissa.js (original) +++ kupu/branch/kupu-1.4/common/sarissa.js Tue Mar 25 14:07:28 2008 @@ -464,7 +464,7 @@ document.importNode = function(oNode, bChildren){ var tmp; if (oNode.nodeName=='#text') { - return document.createTextElement(oNode.data); + return document.createTextNode(oNode.data); } else { if(oNode.nodeName == "tbody" || oNode.nodeName == "tr"){ 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 Tue Mar 25 14:07:28 2008 @@ -2,6 +2,81 @@ Kupu changes ============ +- 1.4.9 + + - Manage anchors didn't add an anchor correctly if there was an + anchor used for a link inside the element. + + - timte fixed a possible unicode decode error + + - Image upload now has same style options as image insertion. + + - Plone tickets + + * 6915 Kupu can't find anchors inside table cells + * 7409 "edit without kupu" does not appear on edit form (the fix for this make the link appear but only in source mode). + * 7804 KupuLibraryTool spellcheck method is missing a docstring + * 7893 Workaround for bad KSS form submissions + * 7916 Kupu breaks strong/em tags with class names, on firefox + * 7939 Kupu breaks on Firefox 3.0b4 in OSX + +- 1.4.8 + + - Tabbing key now takes you to next/previous field. However, plone + ticket #7727 might result in tab behaviour changing again. + + - Plone tickets + + * 7473 Kupu full screen mode looks broken + * 7494 Insert internal link using IE links in the wrong place + * 7680 Kupu stripping out anchor to top of current page + * 7713 Kupu browser "Home" link goes to Plone root and not content + root. + * 7728 turning on "Link using UIDs" breaks indexing of rich text + fields that contain unicode characters out of the 128 range + +- 1.4.7 + + - 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 + +- 1.4.5 + + - Fixed unit tests for the transform (they now use a real image instead of a mockup) + + - 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 + + * 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 - Enabled Safari support (needs webkit nightly build and Safari 3) Modified: kupu/branch/kupu-1.4/doc/PLONE2.txt ============================================================================== --- kupu/branch/kupu-1.4/doc/PLONE2.txt (original) +++ kupu/branch/kupu-1.4/doc/PLONE2.txt Tue Mar 25 14:07:28 2008 @@ -501,6 +501,11 @@ ), ), +N.B. Toolbar buttons which are disabled in Plone's default +configuration may represent tools which are not fully integrated into +Plone. If you wish to use these tools and find problems with them you +should submit a patch. + Custom styles ------------- Kupu allows you to specify styles for paragraphs (P or DIV tags), Modified: kupu/branch/kupu-1.4/make-jspx.xsl ============================================================================== --- kupu/branch/kupu-1.4/make-jspx.xsl (original) +++ kupu/branch/kupu-1.4/make-jspx.xsl Tue Mar 25 14:07:28 2008 @@ -17,7 +17,7 @@ This means that also the fmt-tags must be available, so your html.kupu must specificy something like: - + - + - ${_} + ${translation} @@ -105,7 +105,7 @@ - + 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 Tue Mar 25 14:07:28 2008 @@ -20,7 +20,11 @@ ${header.referer} ${header.referer} + ${mm:directory(header.referer)} ${mm:directory(referrer)}/${param.wizard}.xml + + ${templates}/${param.wizard}.xml + @@ -59,7 +63,7 @@ - + @@ -78,7 +82,7 @@

-
+
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 Tue Mar 25 14:07:28 2008 @@ -7,7 +7,7 @@ $Id: html.kupu,v 1.14 2005/09/27 18:26:52 michiel Exp $ @@ -24,7 +24,7 @@ --> - + client Modified: kupu/branch/kupu-1.4/mmbase/kupustyle.css ============================================================================== --- kupu/branch/kupu-1.4/mmbase/kupustyle.css (original) +++ kupu/branch/kupu-1.4/mmbase/kupustyle.css Tue Mar 25 14:07:28 2008 @@ -1,24 +1,24 @@ @import url("../../style/css/mmxf.css"); -body { +body { background-color: white; font-size: 12pt; } -h1,h2,h3,h4,h5,h6,h7,h8,th { +h1,h2,h3,h4,h5,h6,h7,h8,th { font-weight: bold; color: #006; } -h1 { +h1 { font-size: 15pt; } -h2 { +h2 { padding-left: 1em; font-size: 14pt; } -h3 { +h3 { padding-left: 2em; font-size: 13pt; } -h4 { +h4 { padding-left: 3em; font-size: 12pt; margin-top: 0px; @@ -27,7 +27,7 @@ padding-bottom: 0px; } -h5, h6, h7, h8 { +h5, h6, h7, h8 { font-style: italic; font-size: 12pt; margin-top: 0px; @@ -35,27 +35,27 @@ padding-top: 0px; padding-bottom: 0px; } -h5 { +h5 { padding-left: 4em; } -h6 { +h6 { padding-left: 5em; } -h7 { +h7 { padding-left: 6em; } -h8 { +h8 { padding-left: 7em; } -h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child, h7:first-child, h8:first-child { +h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child, h7:first-child, h8:first-child { margin-top: 0px; } p { } -table { +table { border: 1px black solid; border-spacing: 0px; empty-cells: show; @@ -63,58 +63,58 @@ background-color: #fafafa; } -.mmxf table.plain td, .mmxf table.data td { +.mmxf table.plain td, .mmxf table.data td { border: 1px gray solid; } -th { +th { border: 1px black solid; } -img.image-right { +img.image-right { width: 100px; float: right; margin-right: 0px; margin-left: 1ex; } -img.image-left { +img.image-left { width: 100px; float: left; margin-left: 0px; margin-right: 1ex; } -img.section-inline { +img.section-inline { } -img.node { +img.node { float: left; border: solid 5px green; } -img.paragraph { +img.paragraph { border: solid 1px green; } -img.section { +img.section { float: left; border: solid 1px green; } -img.big { +img.big { width: 200px; height: auto; } -strong, b { +strong, b { color: green; font-weight: bold; } -em, i { +em, i { font-style: italic; } -div.float { +div.float { display: block; float: left; width: 200px; @@ -123,28 +123,28 @@ border: solid black 1px; } -div.note { +div.note { background-color: #ffc; font-style: italic; } -div.note i { +div.note i { font-style: normal; } -div.note em { +div.note em { font-style: normal; } -div.right { +div.right { margin-right: 0px; float: right; } -div.left { +div.left { margin-left: 0px; float: left; -} +} -div.intermezzo { +div.intermezzo { float: left; margin-left: 0px; margin-right: 2ex; @@ -152,18 +152,19 @@ background-color: #cfc; font-style: normal; } -div.quote { +div.quote { background-color: #fcc !important; font-style: italic; } -div.caption { +div.caption { background-color: #ddd; } -ul, ol { +ul, ol { list-style-position: outside; + margin-left: 0ex; + padding-left: 0ex; +} +ul li, ol li { + margin-left: 3ex; } - -li { - margin-left: 20px; -} \ No newline at end of file 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 Tue Mar 25 14:07:28 2008 @@ -58,16 +58,10 @@ - en,zh,ja,de,fr,pt,nl,da,cs,fi,el,sr,eo + en,zh,ja,de,fr,pt,nl,da,cs,fi,el,sr,eo,hi - - - - - - - - + locale.getDisplayName(locale) + ${gui} Modified: kupu/branch/kupu-1.4/mmbase/node.jspx ============================================================================== --- kupu/branch/kupu-1.4/mmbase/node.jspx (original) +++ kupu/branch/kupu-1.4/mmbase/node.jspx Tue Mar 25 14:07:28 2008 @@ -22,7 +22,8 @@ -
+ +
@@ -60,4 +61,4 @@ - \ No newline at end of file + 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 Tue Mar 25 14:07:28 2008 @@ -14,16 +14,16 @@
-

Images

+

Images

- Image class: + Image class:
+
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 Tue Mar 25 14:07:28 2008 @@ -91,8 +91,26 @@ - + + + + + + + + + + + + Modified: kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuplone.css.dtml ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuplone.css.dtml (original) +++ kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuplone.css.dtml Tue Mar 25 14:07:28 2008 @@ -244,6 +244,9 @@ font-size: 100%; } +.kupusourceoverride { display: none; } +.kupu-sourcemode .kupusourceoverride { display: block; margin: 0 0.5em; } + div.kupuoverride { margin-left: 0.75em; } Modified: kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneeditor.js ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneeditor.js (original) +++ kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneeditor.js Tue Mar 25 14:07:28 2008 @@ -66,7 +66,7 @@ path[i++] = '#'; } str = path.join('/'); - if (anchor) { + if (anchor || str=="") { str = [str,anchor].join('#'); } str = tag + str+'"'; Modified: kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneinit.js ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneinit.js (original) +++ kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupuploneinit.js Tue Mar 25 14:07:28 2008 @@ -201,6 +201,7 @@ opt.selected = opt.defaultSelected = (opt.value=='text/html'); } pulldown.disabled = true; + pulldown.removeAttribute('name'); var hidden = document.createElement('input'); hidden.type = 'hidden'; hidden.name = fmtname; @@ -292,21 +293,31 @@ if (!(/kupu-fulleditor-zoomed/.test(document.body.className))) { var form = textarea.form; var els = form.elements; - var target, targindex; - var mytabindex = iframe.tabIndex; - for (var i = 0; i < els.length; i++) { - var el = els[i]; - if (el.tabIndex && el.tabIndex > mytabindex && !el.disabled && el.offsetWidth && el.offsetHeight) { - if (!targindex || el.tabIndex < targindex) { + var target; + if (event.shiftKey) { // shift-tab goes backwards. + for (var i = 0; i < els.length; i++) { + var el = els[i]; + if (!el.disabled && el.offsetWidth && el.offsetHeight) { target = el; - targindex = el.tabIndex; + } + if (els[i]===textarea) break; + } + } else { // tab forwards + for (var i = 0; i < els.length; i++) { + if (els[i]===textarea) break; + } + for (;i < els.length; i++) { + var el = els[i]; + if (!el.disabled && el.offsetWidth && el.offsetHeight) { + target = el; + break; } } } if (target) { window.focus(); target.focus(); - } + } else { return; }; } if (event.preventDefault) { event.preventDefault(); event.stopPropagation();} event.returnValue = false; Modified: kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupusearch.xml.pt ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupusearch.xml.pt (original) +++ kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupusearch.xml.pt Tue Mar 25 14:07:28 2008 @@ -12,7 +12,8 @@ - Search Results Search results. Modified: kupu/branch/kupu-1.4/plone/kupu_plone_layer/sample-kupu-customisation-policy.py ============================================================================== --- kupu/branch/kupu-1.4/plone/kupu_plone_layer/sample-kupu-customisation-policy.py (original) +++ kupu/branch/kupu-1.4/plone/kupu_plone_layer/sample-kupu-customisation-policy.py Tue Mar 25 14:07:28 2008 @@ -88,9 +88,9 @@ LIBRARIES = ( dict(id="root", title="string:Home", - uri="string:${portal_url}", - src="string:${portal_url}/kupucollection.xml", - icon="string:${portal_url}/misc_/CMFPlone/plone_icon"), + uri="string:${globals_view/navigationRootUrl|portal_url}", + src="string:${globals_view/navigationRootUrl|portal_url}/kupucollection.xml", + icon="string:${globals_view/navigationRootUrl|portal_url}/misc_/CMFPlone/plone_icon"), dict(id="current", title="string:Current folder", uri="string:${folder_url}", 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 Tue Mar 25 14:07:28 2008 @@ -364,6 +364,9 @@ return getattr(self, '_toolbar_filters', {}) def spellcheck(self, REQUEST): + """Call spellchecker: WARNING this functionality may not work, + it is not part of the standard Plone+kupu implementation. + Some user assembly required.""" from Products.kupu.python.spellcheck import SpellChecker, format_result data = REQUEST["text"] c = SpellChecker() 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 Tue Mar 25 14:07:28 2008 @@ -646,15 +646,15 @@ src = src[len(base):].lstrip('/') try: obj = portal.restrictedTraverse(src) + 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: + return [] except (KeyError, 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: - return [] else: # src= ... src = src.split(' ') # src is a list of uids. @@ -877,6 +877,40 @@ base = base[:posfactory] return base + security.declareProtected("View", "getUploadImageSizes") + def getUploadImageSizes(self, portal_type=None): + resource_type = self.getResourceType() + portal = getToolByName(self, 'portal_url').getPortalObject() + mediatypes = resource_type.get_portal_types() + catalog = getToolByName(self, 'portal_catalog') + adaptor = InfoAdaptor(self, resource_type, portal) + if portal_type is None: + portal_type = self.getDefaultImageType() + + brains = catalog.searchResults(portal_type=portal_type, limit=1)[:1] + if brains: + info = adaptor.get_image_sizes(brains[0], portal_type, '') + return info + return [] + + security.declareProtected("View", "getUploadImageClasses") + def getUploadImageClasses(self, portal_type=None): + if portal_type is None: + portal_type = self.getDefaultImageType() + stored = self.getClassesForType(portal_type) + classes = [] + for c in stored: + c = c.strip() + if not c: + continue + if '|' in c: + title, classname = c.split('|', 1) + classes.append({'title': title, 'classname': classname}) + else: + classes.append({'title': c, 'classname': c}) + return classes + + def _getImageSizes(self): resource_type = self.getResourceType() portal = getToolByName(self, 'portal_url').getPortalObject() Modified: kupu/branch/kupu-1.4/plone/plonelibrarytool.py ============================================================================== --- kupu/branch/kupu-1.4/plone/plonelibrarytool.py (original) +++ kupu/branch/kupu-1.4/plone/p