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/plonelibrarytool.py Tue Mar 25 14:07:28 2008 @@ -52,9 +52,9 @@ _default_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}", @@ -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) @@ -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 Modified: kupu/branch/kupu-1.4/plone/profiles/default/import_steps.xml ============================================================================== --- kupu/branch/kupu-1.4/plone/profiles/default/import_steps.xml (original) +++ kupu/branch/kupu-1.4/plone/profiles/default/import_steps.xml Tue Mar 25 14:07:28 2008 @@ -3,8 +3,7 @@ - - + Import Kupu settings Modified: kupu/branch/kupu-1.4/plone/profiles/default/kupu.xml ============================================================================== --- kupu/branch/kupu-1.4/plone/profiles/default/kupu.xml (original) +++ kupu/branch/kupu-1.4/plone/profiles/default/kupu.xml Tue Mar 25 14:07:28 2008 @@ -28,9 +28,9 @@ list-style-type float - Simple text containing an embedded image
-

picture alt text

+

picture alt text

Modified: kupu/branch/kupu-1.4/plone/tests/input/simple.in ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/input/simple.in (original) +++ kupu/branch/kupu-1.4/plone/tests/input/simple.in Tue Mar 25 14:07:28 2008 @@ -1,5 +1,4 @@
Simple text containing an embedded image
+

picture alt text

+

picture alt text

picture alt text

-

picture alt text

-

picture alt text

Modified: kupu/branch/kupu-1.4/plone/tests/output/linked.out ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/output/linked.out (original) +++ kupu/branch/kupu-1.4/plone/tests/output/linked.out Tue Mar 25 14:07:28 2008 @@ -1,9 +1,12 @@
Simple text containing an embedded image
- image 104ede98d4c7c8eaeaa3b984f7395979 + + Kupu Test Image +
-
+
Test image caption
-
+ Modified: kupu/branch/kupu-1.4/plone/tests/output/notcaptioned.out ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/output/notcaptioned.out (original) +++ kupu/branch/kupu-1.4/plone/tests/output/notcaptioned.out Tue Mar 25 14:07:28 2008 @@ -1,2 +1,2 @@
Simple text containing an embedded image
-

picture alt text

+

picture alt text

Modified: kupu/branch/kupu-1.4/plone/tests/output/notquoted.out ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/output/notquoted.out (original) +++ kupu/branch/kupu-1.4/plone/tests/output/notquoted.out Tue Mar 25 14:07:28 2008 @@ -1,13 +1,17 @@
IE doesn't always quote attributes
- image 104ede98d4c7c8eaeaa3b984f7395979 + Kupu Test Image
-
Test image caption
+
Test image caption
- image 104ede98d4c7c8eaeaa3b984f7395979 + Kupu Test Image
-
Test image caption
+
Test image caption
Modified: kupu/branch/kupu-1.4/plone/tests/output/simple.out ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/output/simple.out (original) +++ kupu/branch/kupu-1.4/plone/tests/output/simple.out Tue Mar 25 14:07:28 2008 @@ -1,16 +1,27 @@
Simple text containing an embedded image
-
image 104ede98d4c7c8eaeaa3b984f7395979 +
+ Kupu Test Image
-
Test image caption
+
Test image caption
-
image 104ede98d4c7c8eaeaa3b984f7395979 +
+ + Kupu Test Image +
-
Test image caption
+
Test image caption
-
image 104ede98d4c7c8eaeaa3b984f7395979 +
+ Kupu Test Image
-
Test image caption
+
Test image caption
Modified: kupu/branch/kupu-1.4/plone/tests/runme.cmd ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/runme.cmd (original) +++ kupu/branch/kupu-1.4/plone/tests/runme.cmd Tue Mar 25 14:07:28 2008 @@ -10,6 +10,7 @@ @set PYTHON=C:\Plone20\Zope\bin\python.exe rem "%PYTHON%" %~D0%~P0test_browserSupportsKupu.py %2 rem "%PYTHON%" %~D0%~P0test_librarymanager.py +rem "%PYTHON%" %~D0%~P0test_links.py rem "%PYTHON%" %~D0%~P0test_html2captioned.py rem "%PYTHON%" %~D0%~P0test_resourcetypemapper.py rem "%PYTHON%" %~D0%~P0test_urls.py Modified: kupu/branch/kupu-1.4/plone/tests/test_browserSupportsKupu.py ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/test_browserSupportsKupu.py (original) +++ kupu/branch/kupu-1.4/plone/tests/test_browserSupportsKupu.py Tue Mar 25 14:07:28 2008 @@ -17,16 +17,6 @@ if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) -from Testing import ZopeTestCase -DEPS = ('MimetypesRegistry', 'PortalTransforms', 'Archetypes', 'ATContentTypes') -try: - import Products.TextIndexNG2 - DEPS = DEPS + ('TextIndexNG2',) -except ImportError: - pass - -for product in DEPS: - ZopeTestCase.installProduct(product, 1) from Products.PloneTestCase import PloneTestCase PloneTestCase.setupPloneSite(products=['ATContentTypes', 'kupu']) @@ -62,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: @@ -399,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): Modified: kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py (original) +++ kupu/branch/kupu-1.4/plone/tests/test_html2captioned.py Tue Mar 25 14:07:28 2008 @@ -2,8 +2,9 @@ if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) +from kuputestcase import * + from unittest import TestCase, TestSuite, main, makeSuite -from Products.CMFPlone.tests import PloneTestCase from os.path import join, abspath, dirname from Products.PortalTransforms.tests.test_transforms import * @@ -27,92 +28,7 @@ ('Products.kupu.plone.html2captioned', "linked.in", "linked.out", normalize_html, 0), ) -class MockImage: - def __init__(self, uid, description): - self.uid, self.description = uid, description - if not uid.startswith('SUB:'): - self.image_thumb = MockSubImage(self) - - def Title(self): - return 'image '+self.uid - def Description(self): - return self.description - def absolute_url(self): - return '[url for %s]' % self.uid - def absolute_url_path(self): - return '[url for %s]' % self.uid - def getWidth(self): - return 600 - def tag(self, height="", width="", **kw): - src = self.absolute_url_path() - alt = self.Title() - if not width: - width = self.getWidth() - return '%s' % (height, src, width, alt) - -class MockSubImage(MockImage): - def __init__(self, parent): - self.uid = parent.uid - self.description = parent.description - - def getWidth(self): - return 20 - def absolute_url_path(self): - return '[url for %s]' % self.uid+'/image_thumb' - -class MockCatalogTool: - def lookupObject(self, uid): - dummydata = { - '104ede98d4c7c8eaeaa3b984f7395979': 'Test image caption' - } - if uid not in dummydata: - return None - image = MockImage(uid, dummydata[uid]) - return image - -class MockArchetypeTool: - reference_catalog = MockCatalogTool() - -def mockPageTemplate(self, **kw): - """Acquisition isn't set up correctly for us to use a real PageTemplateFile, - so for the test we just use string formatting. - """ - caption = kw.get('caption', '!caption!') - image = kw.get('image', None) - fullimage = kw.get('fullimage', None) - Class=kw['class'] - width = kw['width'] - owidth = fullimage.getWidth() - if width is None: - kw['width'] = width = image.getWidth() - href = fullimage.absolute_url_path() - tag = image.tag(**kw) - - #if width==owidth: - TEMPLATE = '''
-
%(tag)s
-
%(caption)s
-
''' - #else: - # TEMPLATE = '''
- #
%(tag)s
- #
%(caption)s
- #
''' - - return TEMPLATE % dict( - caption=caption, Class=Class, href=href, width=width, tag=tag) - -class MockPortal: - # Mock portal class: just enough to let me think I can lookup a - # Description for an image from its UID. - archetype_tool = MockArchetypeTool() - - # Also now needs access to the captioning template - kupu_captioned_image = mockPageTemplate - -class TransformTest(TestCase): - portal = MockPortal() - +class TransformTest(KupuTestCase): def do_convert(self, filename=None): if filename is None and exists(self.output + '.nofilename'): output = self.output + '.nofilename' @@ -136,22 +52,25 @@ output.close() self.assert_(0) expected = output.read() + raw_got, raw_expected = got, expected if self.normalize is not None: expected = self.normalize(expected) got = self.normalize(got) output.close() self.assertEquals(got, expected, - '[%s]\n\n!=\n\n[%s]\n\nIN %s(%s)' % ( + 'Got:\n[%s]\n\n!=\n\nExpected:\n[%s]\n\nIN %s(%s)' % ( got, expected, self.transform.name(), self.input)) self.assertEquals(self.subobjects, len(res_data.getSubObjects()), - '%s\n\n!=\n\n%s\n\nIN %s(%s)' % ( + 'Subobjects:\n%s\n\n!=\n\nLength: %s\n\nIN %s(%s)' % ( self.subobjects, len(res_data.getSubObjects()), self.transform.name(), self.input)) def testSame(self): + self.setup_content() self.do_convert(filename=self.input) def testSameNoFilename(self): + self.setup_content() self.do_convert() def __repr__(self): Modified: kupu/branch/kupu-1.4/plone/tests/test_links.py ============================================================================== --- kupu/branch/kupu-1.4/plone/tests/test_links.py (original) +++ kupu/branch/kupu-1.4/plone/tests/test_links.py Tue Mar 25 14:07:28 2008 @@ -13,103 +13,12 @@ if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) -from Products.PloneTestCase import PloneTestCase -from Products.PloneTestCase.ptc import portal_owner - -PloneTestCase.setupPloneSite(products=['kupu']) - -from AccessControl.SecurityManagement import newSecurityManager -try: - from Products.ATContentTypes.lib import constraintypes -except: - constraintypes = None - +from kuputestcase import * from Products.kupu.plone.html2captioned import Migration -RESOURCES = dict( - linkable = ('Document', 'Image', 'File', 'Folder'), - mediaobject = ('Image',), - collection = ('Folder',), - containsanchors = ('Document',), - ) - -# Type names vary according to the version of Plone and/or -# ATContentTypes. Map the new names to the old ones here, and -# turn it into an identity mapping later if we can. -TypeMapping = { - 'Document': 'ATDocument', - 'Image': 'ATImage', - 'Link': 'ATLink', - 'Folder': 'ATFolder', - 'File': 'ATFile', - 'News Item': 'ATNewsItem', - 'Event': 'ATEvent', -} -def MapType(typename): - return TypeMapping[typename] - -class TestLinkCode(PloneTestCase.PloneTestCase): +class TestLinkCode(KupuTestCase): """Test the link checking code""" - def afterSetUp(self): - portal = self.portal - self.setRoles(['Manager',]) - self.kupu = portal.kupu_library_tool - typestool = self.portal.portal_types - if not hasattr(typestool, 'ATDocument'): - # Use the type names without the AT prefix - for k in TypeMapping: - TypeMapping[k] = k - - def loginPortalOwner(self): - '''Use if you need to manipulate the portal itself.''' - uf = self.app.acl_users - user = uf.getUserById(portal_owner).__of__(uf) - newSecurityManager(None, user) - - def create(self, id, metatype='ATDocument', folder=None, **kwds): - '''Create an object in the cms portal''' - if folder is None: - folder = self.portal - - folder.invokeFactory(MapType(metatype), id) - obj = getattr(folder, id) - - if metatype=='Folder' and constraintypes: - obj.setConstrainTypesMode(constraintypes.DISABLED) - - if metatype=='Document': - obj.setTitle('Simple document') - obj.setText('Sample document text') - for k, v in kwds.items(): - field = obj.getField(k) - mutator = field.getMutator(obj)(v) - - obj.reindexObject() - return obj - - def setup_content(self): - self.setRoles(['Manager',]) - self.loginPortalOwner() - f = self.create('folder', 'Folder') - - for id in ('alpha', 'beta'): - self.create(id, 'Document', f, subject=['aspidistra']) - self.create('gamma', 'Image', f) - - sub1 = self.create('sub1', 'Folder', f) - sub1.setSubject(['aspidistra']) - sub1.reindexObject() - sub2 = self.create('sub2', 'Folder', f) - self.create('delta', 'Folder', sub2) - - portal = self.portal - tool = self.portal.kupu_library_tool - types = tool.zmi_get_resourcetypes() - #tool.deleteResource([ t.name for t in types]) - for k,v in RESOURCES.items(): - tool.addResourceType(k, [MapType(t) for t in v]) - def test_relative(self): self.setup_content() migrator = Migration(self.kupu) Modified: kupu/branch/kupu-1.4/plone/wysiwyg_support.kupu ============================================================================== --- kupu/branch/kupu-1.4/plone/wysiwyg_support.kupu (original) +++ kupu/branch/kupu-1.4/plone/wysiwyg_support.kupu Tue Mar 25 14:07:28 2008 @@ -48,6 +48,12 @@ rows rows|default; cols cols|default;"> + Modified: kupu/branch/kupu-1.4/plone/zmi_links.pt ============================================================================== --- kupu/branch/kupu-1.4/plone/zmi_links.pt (original) +++ kupu/branch/kupu-1.4/plone/zmi_links.pt Tue Mar 25 14:07:28 2008 @@ -34,7 +34,7 @@
Modified: kupu/branch/kupu-1.4/tests/test_kupuhelpers.js ============================================================================== --- kupu/branch/kupu-1.4/tests/test_kupuhelpers.js (original) +++ kupu/branch/kupu-1.4/tests/test_kupuhelpers.js Tue Mar 25 14:07:28 2008 @@ -103,6 +103,7 @@ s = s.replace(/\/>/g, ">"); s = s.replace(' style=""', ""); s = s.replace(" style=''", ""); + s = s.replace(/ kupu-src="[^"]*"/, ""); return s; }; Modified: kupu/branch/kupu-1.4/version.txt ============================================================================== --- kupu/branch/kupu-1.4/version.txt (original) +++ kupu/branch/kupu-1.4/version.txt Tue Mar 25 14:07:28 2008 @@ -1 +1 @@ -kupu 1.4.4 +kupu 1.4.9 From mihxil at codespeak.net Fri Mar 28 10:32:05 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Fri, 28 Mar 2008 10:32:05 +0100 (CET) Subject: [kupu-checkins] r53037 - kupu/trunk/kupu/mmbase/drawers Message-ID: <20080328093205.1AD91169FAF@codespeak.net> Author: mihxil Date: Fri Mar 28 10:32:04 2008 New Revision: 53037 Modified: kupu/trunk/kupu/mmbase/drawers/attachments.items.jspx kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx kupu/trunk/kupu/mmbase/drawers/search.library.jspx Log: made it a bit more robust, removed some trailing whitespace Modified: kupu/trunk/kupu/mmbase/drawers/attachments.items.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/attachments.items.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/attachments.items.jspx Fri Mar 28 10:32:04 2008 @@ -3,11 +3,11 @@ Needs: a request context 'drawer', containing a listcontainer 'query'. --> - + @@ -16,7 +16,7 @@ yes - + mmbase://attachments/${attachment.number} [<mm:field name="mimetype" />: <mm:field name="title" />] b Modified: kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx Fri Mar 28 10:32:04 2008 @@ -1,4 +1,4 @@ - - bla @@ -28,4 +27,4 @@ - \ No newline at end of file + Modified: kupu/trunk/kupu/mmbase/drawers/search.library.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/search.library.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/search.library.jspx Fri Mar 28 10:32:04 2008 @@ -17,7 +17,6 @@ images - ${nodetypes} "<mm:write referid="search" />" @@ -36,7 +35,7 @@ - + @@ -54,4 +53,4 @@ - \ No newline at end of file + From mihxil at codespeak.net Fri Mar 28 10:43:19 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Fri, 28 Mar 2008 10:43:19 +0100 (CET) Subject: [kupu-checkins] r53039 - kupu/trunk/kupu/mmbase Message-ID: <20080328094319.BEFB4169FB8@codespeak.net> Author: mihxil Date: Fri Mar 28 10:43:19 2008 New Revision: 53039 Modified: kupu/trunk/kupu/mmbase/Makefile Log: added some artifacts to the clean Modified: kupu/trunk/kupu/mmbase/Makefile ============================================================================== --- kupu/trunk/kupu/mmbase/Makefile (original) +++ kupu/trunk/kupu/mmbase/Makefile Fri Mar 28 10:43:19 2008 @@ -27,7 +27,7 @@ $(XSLTPROC) $(XSLTPROC_PARAMS) -o $@ $(XSLJSPX_FILE) head-mmbase.kupu $(I18N): - @$(MAKE) -C $(KUPU_HOME) kupu-i18n.jar + @$(MAKE) -C $(KUPU_HOME) kupu-i18n.jar .PHONY: messages: *.js clean @@ -48,6 +48,7 @@ clean: rm -f index.jspx + rm -f body.jspx head.jspx rm -f mmbase-kupu-i18n.jar rm -rf resourcebundle @$(MAKE) -C $(KUPU_HOME) clean From mihxil at codespeak.net Fri Mar 28 10:44:16 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Fri, 28 Mar 2008 10:44:16 +0100 (CET) Subject: [kupu-checkins] r53040 - kupu/trunk/kupu/mmbase Message-ID: <20080328094416.8908B169FB4@codespeak.net> Author: mihxil Date: Fri Mar 28 10:44:16 2008 New Revision: 53040 Modified: kupu/trunk/kupu/mmbase/head.kupu kupu/trunk/kupu/mmbase/mmbase.kupu kupu/trunk/kupu/mmbase/wire.kupu Log: made sure that the mmbase.css is included last, which makes it easier to override things Modified: kupu/trunk/kupu/mmbase/head.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/head.kupu (original) +++ kupu/trunk/kupu/mmbase/head.kupu Fri Mar 28 10:44:16 2008 @@ -8,7 +8,7 @@ xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"> $Id: head.kupu,v 1.15 2005/09/14 17:24:31 michiel Exp $ - + @@ -44,9 +44,8 @@ </kupu:part> <kupu:part name="styles"> - <link href="${kupu_common}/kupustyles.css" rel="stylesheet" type="text/css"><jsp:text> </jsp:text></link> + <link href="${kupu_common}/kupustyles.css" rel="stylesheet" type="text/css"><jsp:text> </jsp:text></link> <!-- fills image buttons and so on --> - <link href="mmbase.css" rel="stylesheet" type="text/css" /> </kupu:part> Modified: kupu/trunk/kupu/mmbase/mmbase.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/mmbase.kupu (original) +++ kupu/trunk/kupu/mmbase/mmbase.kupu Fri Mar 28 10:44:16 2008 @@ -32,6 +32,11 @@ <kupu:insert-part feature="body" part="fulleditor" /> </div> </kupu:part> + + <kupu:part name="styles"> + <link href="mmbase.css" rel="stylesheet" type="text/css" /> + </kupu:part> + <kupu:part name="header"> <div id="header"> <fmt:bundle basename="org.mmbase.kupu.Messages"> Modified: kupu/trunk/kupu/mmbase/wire.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/wire.kupu (original) +++ kupu/trunk/kupu/mmbase/wire.kupu Fri Mar 28 10:44:16 2008 @@ -12,6 +12,7 @@ <kupu:insert-part feature="head" part="meta" /> <kupu:insert-part feature="head" part="styles" /> <kupu:insert-part feature="drawers" part="styles" /> + <kupu:insert-part feature="mmbase" part="styles" /> <kupu:insert-part feature="head" part="jsincludes" /> <kupu:insert-part feature="contextmenu" part="jsincludes" /> <kupu:insert-part feature="head" part="bootstrap-editor" /> From mihxil at codespeak.net Fri Mar 28 10:45:14 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Fri, 28 Mar 2008 10:45:14 +0100 (CET) Subject: [kupu-checkins] r53041 - kupu/trunk/kupu/mmbase Message-ID: <20080328094514.97C9D169FB8@codespeak.net> Author: mihxil Date: Fri Mar 28 10:45:14 2008 New Revision: 53041 Modified: kupu/trunk/kupu/mmbase/mmbase.css Log: Since we mention builder guinames in the #kupulibrariesitem 130px is a bit small, increased a bit Modified: kupu/trunk/kupu/mmbase/mmbase.css ============================================================================== --- kupu/trunk/kupu/mmbase/mmbase.css (original) +++ kupu/trunk/kupu/mmbase/mmbase.css Fri Mar 28 10:45:14 2008 @@ -1,46 +1,46 @@ @import url("layout.css"); -body { +body { } -a { +a { color: #ffa; text-decoration: none; } -ul, ol { +ul, ol { padding-left: 18px; margin-left: 0px; } -li { +li { margin-left: 0px; } -#leftColumnContent a:hover { +#leftColumnContent a:hover { background-color: #76a2b6; } -img { +img { border: 0; } -#header, #leftColumn { +#header, #leftColumn { background-color: #527d94; color: #fff; } -#nodefields p { +#nodefields p { font-size: smaller; } -#nodefields span.mm_datetime { +#nodefields span.mm_datetime { } -#nodefields a:hover { +#nodefields a:hover { background-color: #527d94; } -#nodefields { +#nodefields { background-color: #76a2b6; overflow: auto; } @@ -49,33 +49,33 @@ /* user-input: enabled; */ } -#nodefields input.mm_year { +#nodefields input.mm_year { width: 5ex; font-size: smaller; } -#nodefields select { - font-size: smaller; +#nodefields select { + font-size: smaller; } -#mmbase-tools { +#mmbase-tools { overflow: auto; overflow-x: auto; overflow-y: auto; - + } -#mmbase-tools ul { - list-style-type: none; +#mmbase-tools ul { + list-style-type: none; } -iframe { +iframe { background-color: #ffc; } -a.current { +a.current { background-color: #76a2b6; } @@ -84,16 +84,16 @@ text-decoration: none; } -#mmbase-tools .mmbase-tool { +#mmbase-tools .mmbase-tool { min-height: 100px; } - -#preview { + +#preview { background-color: blue; margin: 0px; } -#kupu { +#kupu { z-index: 1; } #kupu-tb-buttons { @@ -103,32 +103,33 @@ display: none; background-color: white; } -#kupu div.kupu-drawer { +#kupu div.kupu-drawer { width: 800px; -} -#kupu div.kupu-resourceitems { +} +#kupu div.kupu-resourceitems { width: 400px; } -#kupu div.kupu-drawer textarea, #kupu div.kupu-drawer input { +#kupu div.kupu-drawer textarea, #kupu div.kupu-drawer input { border: 1px solid; background-color: #eee; } -#kupu div.kupu-drawer textarea { +#kupu div.kupu-drawer textarea { width: 95%; } -div.kupu-panels td.panel { +div.kupu-panels td.panel { height: 300px; -} +} -#kupu div#image_alt_div { +#kupu div#image_alt_div { display: none; } -#kupu div.kupu-drawer input#kupu-upload-file { +#kupu div.kupu-drawer input#kupu-upload-file { width: 60%; } -#kupu div.kupu-drawer div.overflow { +#kupu div.kupu-drawer div.overflow { overflow-x: auto; overflow-y: auto; + } #kupu div.kupu-editorframe { @@ -151,50 +152,55 @@ display: none; } -#kupu-editor { +#kupu-editor { background-color: white; } -#kupu-editor h1,h2,h3,h4,h5,h6,h7 { +#kupu-editor h1,h2,h3,h4,h5,h6,h7 { color: red; } -div.kupu-toolbox, div.kupu-toolbox-active { +div.kupu-toolbox, div.kupu-toolbox-active { position: absolute; width: 200px; right: 2px; display: block; background-color: #527d94; } -div.kupu-toolbox-active { +div.kupu-toolbox-active { background-color: #76a2b6; } -div.kupu-toolbox-active #kupu-div-addbutton { +div.kupu-toolbox-active #kupu-div-addbutton { display: none; - + } -div#kupu-toolbox-links { +div#kupu-toolbox-links { } -div#kupu-toolbox-images { +div#kupu-toolbox-images { top: 250px; } -div#kupu-toolbox-tables { +div#kupu-toolbox-tables { top: 500px; } -div#kupu-toolbox-debug { +div#kupu-toolbox-debug { top: 750px; } -div#kupu-toolbox-addtable{ +div#kupu-toolbox-addtable{ + +} + +div#kupu-librariesitems { + width: 200px; +} -} -img.icon { +img.icon { margin-right: 0.5ex; border: 0px; } button.mmbase-logo {background-image: url("mmbase.png");} -.kupu-removediv {background-image: url("../common/kupuimages/remove.png");} \ No newline at end of file +.kupu-removediv {background-image: url("../common/kupuimages/remove.png");} From duncan at codespeak.net Fri Mar 28 12:49:50 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 28 Mar 2008 12:49:50 +0100 (CET) Subject: [kupu-checkins] r53051 - in kupu/trunk/kupu: doc plone/kupu_plone_layer Message-ID: <20080328114950.67597169FBA@codespeak.net> Author: duncan Date: Fri Mar 28 12:49:48 2008 New Revision: 53051 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/kupu_plone_layer/kupucollection.xml.pt Log: Fix Plone ticket 7985 Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Fri Mar 28 12:49:48 2008 @@ -2,6 +2,12 @@ Kupu changes ============ +- SVN (unreleased) + + - Plone tickets + + * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) + - 1.4.9 - Manage anchors didn't add an anchor correctly if there was an 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 Fri Mar 28 12:49:48 2008 @@ -108,7 +108,7 @@ <size tal:condition="origok"> <selected tal:condition="python:defscale in ('original', '')" /> <label i18n:translate="option_original">Original</label> - <uri tal:content="info/url" /> + <uri/> </size> </sizes> </uploadbutton> From mihxil at codespeak.net Fri Mar 28 20:28:11 2008 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Fri, 28 Mar 2008 20:28:11 +0100 (CET) Subject: [kupu-checkins] r53067 - in kupu/trunk/kupu/mmbase: . drawers Message-ID: <20080328192811.98C25169F94@codespeak.net> Author: mihxil Date: Fri Mar 28 20:28:09 2008 New Revision: 53067 Modified: kupu/trunk/kupu/mmbase/body-mmbase.kupu (props changed) kupu/trunk/kupu/mmbase/body.kupu (contents, props changed) kupu/trunk/kupu/mmbase/contextmenu.kupu (contents, props changed) kupu/trunk/kupu/mmbase/dist-mmbase.kupu (props changed) kupu/trunk/kupu/mmbase/drawers.kupu (contents, props changed) kupu/trunk/kupu/mmbase/drawers/attachments.items.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/collection.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/drawer.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/drawer.xsl.jspx (contents, props changed) kupu/trunk/kupu/mmbase/drawers/images.items.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/libraries.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/library.jspx (contents, props changed) kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx (contents, props changed) kupu/trunk/kupu/mmbase/drawers/search.library.jspx (contents, props changed) kupu/trunk/kupu/mmbase/drawers/segments.items.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/test.post.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/texts.items.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/upload.jspx (props changed) kupu/trunk/kupu/mmbase/drawers/urls.items.jspx (props changed) kupu/trunk/kupu/mmbase/head-mmbase.kupu (props changed) kupu/trunk/kupu/mmbase/head.kupu (contents, props changed) kupu/trunk/kupu/mmbase/html.kupu (contents, props changed) kupu/trunk/kupu/mmbase/include.kupu (props changed) kupu/trunk/kupu/mmbase/index.kupu (props changed) kupu/trunk/kupu/mmbase/kupuinit.js kupu/trunk/kupu/mmbase/mmbase.css kupu/trunk/kupu/mmbase/mmbase.kupu (props changed) kupu/trunk/kupu/mmbase/saveonpart.kupu (contents, props changed) kupu/trunk/kupu/mmbase/test.kupu (props changed) kupu/trunk/kupu/mmbase/toolbar.kupu (contents, props changed) kupu/trunk/kupu/mmbase/toolboxes.kupu (contents, props changed) kupu/trunk/kupu/mmbase/wire.kupu (contents, props changed) kupu/trunk/kupu/mmbase/xmlconfig.kupu (props changed) Log: details, svn:keywords Modified: kupu/trunk/kupu/mmbase/body.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/body.kupu (original) +++ kupu/trunk/kupu/mmbase/body.kupu Fri Mar 28 20:28:09 2008 @@ -10,7 +10,7 @@ xmlns:fn="http://java.sun.com/jsp/jstl/functions" i18n:domain="kupu" > - <kupu:id>$Id: body.kupu,v 1.10 2005/09/27 18:26:52 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="body"> Modified: kupu/trunk/kupu/mmbase/contextmenu.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/contextmenu.kupu (original) +++ kupu/trunk/kupu/mmbase/contextmenu.kupu Fri Mar 28 20:28:09 2008 @@ -8,7 +8,7 @@ xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="kupu" > - <kupu:id>$Id: contextmenu.kupu,v 1.2 2005/04/19 21:23:58 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="jsincludes"> <script type="text/javascript" src="${kupu_common}/kupucontextmenu.js"><jsp:text> </jsp:text></script> Modified: kupu/trunk/kupu/mmbase/drawers.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/drawers.kupu (original) +++ kupu/trunk/kupu/mmbase/drawers.kupu Fri Mar 28 20:28:09 2008 @@ -9,7 +9,7 @@ xmlns:jsp="http://java.sun.com/JSP/Page" i18n:domain="kupu" > - <kupu:id>$Id: drawers.kupu,v 1.15 2005/10/19 14:18:50 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="styles"> Modified: kupu/trunk/kupu/mmbase/drawers/drawer.xsl.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/drawer.xsl.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/drawer.xsl.jspx Fri Mar 28 20:28:09 2008 @@ -13,7 +13,7 @@ XSL transformation from Kupu Library XML to HTML for the image library drawer. -$Id: drawer.xsl,v 1.12 2005/09/16 19:47:56 michiel Exp $ +$Id$ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" @@ -24,11 +24,11 @@ <mm:link absolute="true" page="../../common/kupudrawers/drawer.xsl"> <!-- Must be absolute, or otherwise IE chokes --> <xsl:import href="${_}" /> - </mm:link> - + </mm:link> - <!-- - Overridden to use the 'showupload' parameter always, if an 'uploadbutton' tab is present + + <!-- + Overridden to use the 'showupload' parameter always, if an 'uploadbutton' tab is present --> <xsl:template match="*" mode="panel"> <xsl:choose> @@ -58,10 +58,11 @@ </xsl:template> <!-- - Just overridden to rename it, because we use upload also for attachments, not only for images + Just overridden to rename it, because we use upload also for attachments, not only for images (Called in 'panel' mode) --> <xsl:template match="uploadbutton" mode="upload"> + bla bla bla <xsl:apply-templates select="." mode="image-upload" /> </xsl:template> @@ -73,8 +74,8 @@ <xsl:apply-templates select="." mode="base-properties"/> </xsl:template> - <!-- - We know height and width beforehand, so we don't use the 'kupuFixImage' function. + <!-- + We know height and width beforehand, so we don't use the 'kupuFixImage' function. That works faster and more reliable. They are added as attributes on all tags (icon, preview and uri). --> @@ -88,7 +89,7 @@ </xsl:if> </img> </xsl:template> - + <xsl:template match="resource|collection" mode="image-view"> <xsl:choose> <xsl:when test="preview"> @@ -99,7 +100,7 @@ </xsl:otherwise> </xsl:choose> </xsl:template> - + <xsl:template name="mystyle"> <link type="text/css" rel="stylesheet" media="all"> <xsl:attribute name="href">mydrawerstyle.css</xsl:attribute> Modified: kupu/trunk/kupu/mmbase/drawers/library.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/library.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/library.jspx Fri Mar 28 20:28:09 2008 @@ -4,7 +4,7 @@ type="text/xml" expires="-1"> <!-- - $Id: library.jspx,v 1.13 2005/10/19 14:18:50 michiel Exp $ + $Id$ --> <jsp:output omit-xml-declaration="yes" /> Modified: kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/search.constraints.jspx Fri Mar 28 20:28:09 2008 @@ -3,7 +3,7 @@ It need two variables to exist: search: string to search on nodetype: fields of which node-type must be considered - $Id: search.constraints.jspx,v 1.2 2005/06/28 12:33:20 michiel Exp $ + $Id$ --> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" Modified: kupu/trunk/kupu/mmbase/drawers/search.library.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/search.library.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/search.library.jspx Fri Mar 28 20:28:09 2008 @@ -5,7 +5,7 @@ expires="-1"> <jsp:directive.page errorPage="../error.jspx" /> <!-- - $Id: search.library.jspx,v 1.3 2005/10/19 14:18:50 michiel Exp $ + $Id$ --> <jsp:output omit-xml-declaration="yes" /> Modified: kupu/trunk/kupu/mmbase/head.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/head.kupu (original) +++ kupu/trunk/kupu/mmbase/head.kupu Fri Mar 28 20:28:09 2008 @@ -7,7 +7,7 @@ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"> - <kupu:id>$Id: head.kupu,v 1.15 2005/09/14 17:24:31 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="meta"> <fmt:bundle basename="org.mmbase.kupu.Messages"> Modified: kupu/trunk/kupu/mmbase/html.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/html.kupu (original) +++ kupu/trunk/kupu/mmbase/html.kupu Fri Mar 28 20:28:09 2008 @@ -4,7 +4,7 @@ implementation="mmbase" xmlns:kupu="http://kupu.oscom.org/namespaces/dist" > - <kupu:id>$Id: html.kupu,v 1.14 2005/09/27 18:26:52 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="html"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" Modified: kupu/trunk/kupu/mmbase/kupuinit.js ============================================================================== --- kupu/trunk/kupu/mmbase/kupuinit.js (original) +++ kupu/trunk/kupu/mmbase/kupuinit.js Fri Mar 28 20:28:09 2008 @@ -36,6 +36,7 @@ // now we can create a UI object which we can use from the UI var ui = new KupuUI('kupu-tb-styles'); + //console.log(ui.tsselect.childNodes.item(7)); // the ui must be registered to the editor like a tool so it can be notified // of state changes Modified: kupu/trunk/kupu/mmbase/mmbase.css ============================================================================== --- kupu/trunk/kupu/mmbase/mmbase.css (original) +++ kupu/trunk/kupu/mmbase/mmbase.css Fri Mar 28 20:28:09 2008 @@ -195,6 +195,9 @@ div#kupu-librariesitems { width: 200px; } +div#kupu-resourceitems { + width: 250px; +} img.icon { margin-right: 0.5ex; Modified: kupu/trunk/kupu/mmbase/saveonpart.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/saveonpart.kupu (original) +++ kupu/trunk/kupu/mmbase/saveonpart.kupu Fri Mar 28 20:28:09 2008 @@ -6,7 +6,7 @@ xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:kupu="http://kupu.oscom.org/namespaces/dist" > - <kupu:id>$Id: saveonpart.kupu,v 1.3 2005/09/14 17:24:31 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="jsincludes"> <!-- saveonpart function is in mmbase.js --> Modified: kupu/trunk/kupu/mmbase/toolbar.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/toolbar.kupu (original) +++ kupu/trunk/kupu/mmbase/toolbar.kupu Fri Mar 28 20:28:09 2008 @@ -8,7 +8,7 @@ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" i18n:domain="kupu" > - <kupu:id>$Id: toolbar.kupu,v 1.12 2005/06/30 17:11:44 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <!-- lets limit ourselves to 2 ways of emphasis (in stead of 3) --> <kupu:part name="buttongroup-basicmarkup"> Modified: kupu/trunk/kupu/mmbase/toolboxes.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/toolboxes.kupu (original) +++ kupu/trunk/kupu/mmbase/toolboxes.kupu Fri Mar 28 20:28:09 2008 @@ -9,7 +9,7 @@ xmlns="http://www.w3.org/1999/xhtml" i18n:domain="kupu" > - <kupu:id>$Id: toolboxes.kupu,v 1.9 2005/09/08 08:30:31 michiel Exp $</kupu:id> + <kupu:id>$Id$</kupu:id> <kupu:part name="images"> Modified: kupu/trunk/kupu/mmbase/wire.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/wire.kupu (original) +++ kupu/trunk/kupu/mmbase/wire.kupu Fri Mar 28 20:28:09 2008 @@ -1,6 +1,6 @@ <!-- - @version $Id: wire.kupu,v 1.12 2005/07/11 16:33:48 michiel Exp $ + @version $Id$ @author Michiel Meeuwissen <michiel.meeuwissen at gmail.com> --> <kupu:wire From duncan at codespeak.net Sat Mar 29 16:33:34 2008 From: duncan at codespeak.net (duncan at codespeak.net) Date: Sat, 29 Mar 2008 16:33:34 +0100 (CET) Subject: [kupu-checkins] r53093 - in kupu/trunk/kupu: doc plone Message-ID: <20080329153334.DA9D3169F4C@codespeak.net> Author: duncan Date: Sat Mar 29 16:33:33 2008 New Revision: 53093 Modified: kupu/trunk/kupu/doc/CHANGES.txt kupu/trunk/kupu/plone/plonelibrarytool.py Log: Reduced permission required for accessors. Modified: kupu/trunk/kupu/doc/CHANGES.txt ============================================================================== --- kupu/trunk/kupu/doc/CHANGES.txt (original) +++ kupu/trunk/kupu/doc/CHANGES.txt Sat Mar 29 16:33:33 2008 @@ -7,6 +7,7 @@ - Plone tickets * 7958 Kupu: Insert image: KeyError: 'info' (Error 503 loading kupucollection.xml?resource_type=mediaobject) + * 7990 Internal link drawer broken for editors - 1.4.9 Modified: kupu/trunk/kupu/plone/plonelibrarytool.py ============================================================================== --- kupu/trunk/kupu/plone/plonelibrarytool.py (original) +++ kupu/trunk/kupu/plone/plonelibrarytool.py Sat Mar 29 16:33:33 2008 @@ -241,7 +241,7 @@ if REQUEST: REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_toolbar') - security.declareProtected(permissions.ManageLibraries, "getGlobalButtonFilter") + security.declareProtected("View", "getGlobalButtonFilter") def getGlobalButtonFilter(self): gfilter = getattr(self, '_global_toolbar_filter', None) if gfilter is not None: @@ -644,7 +644,7 @@ t.mode = 'whitelist' return types - security.declareProtected(permissions.ManageLibraries, "get_resourcetypes") + security.declareProtected("View", "get_resourcetypes") def get_resourcetypes(self): """Return the type mapping, but without the ZMI dummy entry""" keys = self._res_types.keys() @@ -656,7 +656,7 @@ real.append(wrapped) return real - security.declareProtected(permissions.ManageLibraries, "zmi_get_resourcetypes") + security.declareProtected("View", "zmi_get_resourcetypes") def zmi_get_resourcetypes(self): """Return the type mapping for the ZMI view""" real = self.get_resourcetypes() @@ -691,29 +691,29 @@ if (REQUEST): REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_resource_types') - security.declareProtected(permissions.ManageLibraries, "getPreviewForType") + security.declareProtected("View", "getPreviewForType") def getPreviewForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) expr = action_map.get(portal_type, {}).get('expression', '') return getattr(expr, 'text', expr) - security.declareProtected(permissions.ManageLibraries, "getNormalViewForType") + security.declareProtected("View", "getNormalViewForType") def getNormalViewForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) expr = action_map.get(portal_type, {}).get('normal', '') return getattr(expr, 'text', expr) - security.declareProtected(permissions.ManageLibraries, "getScaleFieldForType") + security.declareProtected("View", "getScaleFieldForType") def getScaleFieldForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) value = action_map.get(portal_type, {}).get('scalefield', 'image') return value - security.declareProtected(permissions.ManageLibraries, "getDefaultImageType") + security.declareProtected("View", "getDefaultImageType") def getDefaultImageType(self): return 'Image' - security.declareProtected(permissions.ManageLibraries, "getDefaultScaleForType") + security.declareProtected("View", "getDefaultScaleForType") def getDefaultScaleForType(self, portal_type = None): if not portal_type: portal_type = self.getDefaultImageType() @@ -721,12 +721,12 @@ value = action_map.get(portal_type, {}).get('defscale', 'image_preview') return value - security.declareProtected(permissions.ManageLibraries, "getClassesForType") + security.declareProtected("View", "getClassesForType") def getClassesForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) return action_map.get(portal_type, {}).get('classes', ()) - security.declareProtected(permissions.ManageLibraries, "getMediaForType") + security.declareProtected("View", "getMediaForType") def getMediaForType(self, portal_type): action_map = getattr(self, '_preview_actions', {}) value = action_map.get(portal_type, {}).get('mediatype', 'image')