Tables
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 Mon Jul 2 17:16:18 2007
@@ -66,9 +66,19 @@
+
+
+
+ Original
+
+
Modified: kupu/trunk/kupu/plone/plonedrawers.py
==============================================================================
--- kupu/trunk/kupu/plone/plonedrawers.py (original)
+++ kupu/trunk/kupu/plone/plonedrawers.py Mon Jul 2 17:16:18 2007
@@ -286,6 +286,7 @@
image_sizes = image_field.getAvailableSizes(obj)
sizes = [(v[0], v[1], k, '%s_%s' % (imagefield,k)) for k,v in image_sizes.items()]
sizes.sort()
+ sizes.reverse()
IMAGE_SIZES_CACHE[cache_key] = sizes
else:
sizes = IMAGE_SIZES_CACHE[cache_key]
Modified: kupu/trunk/kupu/plone/plonelibrarytool.py
==============================================================================
--- kupu/trunk/kupu/plone/plonelibrarytool.py (original)
+++ kupu/trunk/kupu/plone/plonelibrarytool.py Mon Jul 2 17:16:18 2007
@@ -292,6 +292,10 @@
def getFiltersourceedit(self):
return getattr(self, 'filtersourceedit', True)
+ security.declareProtected('View', "getAllowOriginalImageSize")
+ def getAllowOriginalImageSize(self):
+ return getattr(self, 'allowOriginalImageSize', False)
+
security.declareProtected('View', 'isKupuEnabled')
def isKupuEnabled(self, useragent='', allowAnonymous=False, REQUEST=None, context=None, fieldName=None):
if not REQUEST:
@@ -787,6 +791,7 @@
installBeforeUnload=None, parastyles=None, refbrowser=None,
captioning=None,
filterSourceEdit=None,
+ allowOriginalImageSize=None,
REQUEST=None):
"""Delete resource types through the ZMI"""
if linkbyuid is not None:
@@ -797,6 +802,8 @@
self.install_beforeunload = bool(installBeforeUnload)
if filterSourceEdit is not None:
self.filtersourceedit = bool(filterSourceEdit)
+ if allowOriginalImageSize is not None:
+ self.allowOriginalImageSize = bool(allowOriginalImageSize)
if parastyles is not None:
self.paragraph_styles = [ line.strip() for line in parastyles if line.strip() ]
From duncan at codespeak.net Mon Jul 2 17:26:32 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Mon, 2 Jul 2007 17:26:32 +0200 (CEST)
Subject: [kupu-checkins] r44673 - kupu/trunk/kupu/plone
Message-ID: <20070702152632.6C73F80B3@code0.codespeak.net>
Author: duncan
Date: Mon Jul 2 17:26:30 2007
New Revision: 44673
Modified:
kupu/trunk/kupu/plone/librarytool.py
Log:
Added spellcheck function to library tool for ?ukasz ?akomy
Modified: kupu/trunk/kupu/plone/librarytool.py
==============================================================================
--- kupu/trunk/kupu/plone/librarytool.py (original)
+++ kupu/trunk/kupu/plone/librarytool.py Mon Jul 2 17:26:30 2007
@@ -360,3 +360,16 @@
def _getToolbarFilterOptions(self):
return getattr(self, '_toolbar_filters', {})
+
+ def spellcheck(self, REQUEST):
+ from Products.kupu.python.spellcheck import SpellChecker, format_result
+ data = REQUEST["text"]
+ c = SpellChecker()
+ result = c.check(data)
+ if result == None:
+ result = ""
+ else:
+ result = format_result(result)
+ REQUEST.RESPONSE.setHeader("Content-Type","text/xml, charset=utf-8")
+ REQUEST.RESPONSE.setHeader("Content-Length",str(len(result)))
+ return result
From duncan at codespeak.net Tue Jul 3 10:17:56 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Tue, 3 Jul 2007 10:17:56 +0200 (CEST)
Subject: [kupu-checkins] r44687 - kupu/trunk/kupu/common
Message-ID: <20070703081756.8540680B6@code0.codespeak.net>
Author: duncan
Date: Tue Jul 3 10:17:55 2007
New Revision: 44687
Modified:
kupu/trunk/kupu/common/kupubasetools.js
kupu/trunk/kupu/common/kupudrawers.js
Log:
Plone ticket #5622
Add a class (even if empty) to internal LinkDrawer
Now adds class="internal-link" to links created/edited by the internal link drawer,
and class="external-link" to links created/edited by the external link drawer.
Modified: kupu/trunk/kupu/common/kupubasetools.js
==============================================================================
--- kupu/trunk/kupu/common/kupubasetools.js (original)
+++ kupu/trunk/kupu/common/kupubasetools.js Tue Jul 3 10:17:55 2007
@@ -1039,7 +1039,7 @@
linkWindow.focus();
};
- this.updateLink = function (linkel, url, type, name, target, title) {
+ this.updateLink = function (linkel, url, type, name, target, title, className) {
if (type && type == 'anchor') {
linkel.removeAttribute('href');
linkel.setAttribute('name', name);
@@ -1060,17 +1060,22 @@
else {
linkel.removeAttribute('target');
};
+ if (className===undefined) {
+ linkel.removeAttribute('className');
+ } else {
+ linkel.className = className;
+ }
linkel.style.color = this.linkcolor;
};
};
- this.formatSelectedLink = function(url, type, name, target, title) {
+ this.formatSelectedLink = function(url, type, name, target, title, className) {
var currnode = this.editor.getSelectedNode();
// selection inside link
var linkel = this.editor.getNearestParentOfType(currnode, 'A');
if (linkel) {
- this.updateLink(linkel, url, type, name, target, title);
+ this.updateLink(linkel, url, type, name, target, title, className);
return true;
}
@@ -1083,7 +1088,7 @@
for (var i = 0; i < linkelements.length; i++) {
linkel = linkelements[i];
if (selection.containsNode(linkel)) {
- this.updateLink(linkel, url, type, name, target, title);
+ this.updateLink(linkel, url, type, name, target, title, className);
containsLink = true;
}
};
@@ -1102,24 +1107,24 @@
//
// the order of the arguments is a bit odd here because of backward
// compatibility
- this.createLink = function(url, type, name, target, title) {
+ this.createLink = function(url, type, name, target, title, className) {
url = url.strip();
if (!url) {
this.deleteLink();
return;
};
- if (!this.formatSelectedLink(url, type, name, target, title)) {
+ if (!this.formatSelectedLink(url, type, name, target, title, className)) {
// No links inside or outside.
this.editor.execCommand("CreateLink", url);
- if (!this.formatSelectedLink(url, type, name, target, title)) {
+ if (!this.formatSelectedLink(url, type, name, target, title, className)) {
// Insert link with no text selected, insert the title
// or URI instead.
var doc = this.editor.getInnerDocument();
var linkel = doc.createElement("a");
linkel.setAttribute('href', url);
- linkel.setAttribute('class', 'generated');
+ linkel.setAttribute('class', className || 'generated');
this.editor.getSelection().replaceWithNode(linkel, true);
- this.updateLink(linkel, url, type, name, target, title);
+ this.updateLink(linkel, url, type, name, target, title, className);
};
}
};
Modified: kupu/trunk/kupu/common/kupudrawers.js
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers.js (original)
+++ kupu/trunk/kupu/common/kupudrawers.js Tue Jul 3 10:17:55 2007
@@ -365,7 +365,7 @@
this.editor.resumeEditing();
if (this.getMode()) {
var url = input.value;
- this.tool.createLink(url, null, null, this.target);
+ this.tool.createLink(url, null, null, this.target, 'external-link');
input.value = '';
} else {
// Import the html
@@ -1549,7 +1549,7 @@
var node = getFromSelector('link_target');
var target = node && node.value;
- this.tool.createLink(uri, null, name, target, title);
+ this.tool.createLink(uri, null, name, target, title, 'internal-link');
this.drawertool.closeDrawer();
};
};
From duncan at codespeak.net Tue Jul 3 11:01:21 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Tue, 3 Jul 2007 11:01:21 +0200 (CEST)
Subject: [kupu-checkins] r44688 - kupu/trunk/kupu/doc
Message-ID: <20070703090121.4BBF980BB@code0.codespeak.net>
Author: duncan
Date: Tue Jul 3 11:01:20 2007
New Revision: 44688
Modified:
kupu/trunk/kupu/doc/CHANGES.txt
Log:
Update change log
Modified: kupu/trunk/kupu/doc/CHANGES.txt
==============================================================================
--- kupu/trunk/kupu/doc/CHANGES.txt (original)
+++ kupu/trunk/kupu/doc/CHANGES.txt Tue Jul 3 11:01:20 2007
@@ -4,6 +4,10 @@
- Recent
+ - Added a 'manage anchors' tab to the anchor drawer
+
+ - Big cleanup of i18n attributes
+
- Updated the Japanese translation files, thx to Tyam.
- Added in some support for inserting Flash content.
@@ -28,6 +32,20 @@
- Plone tickets:
+ * 5622 Add a class (even if empty) to internal LinkDrawer
+
+ * 6283 Do not allow bigger images than Preview by default from Kupu
+
+ * 6440 Browser error: exception element has no properties while
+ registering an event handler for element null, event click, method
+ function ()
+
+ * 6720 i18n error in kupu collection
+
+ * 5985 Kupu should not strip the dir attribute by default.
+
+ * 5985 Range.intersectsNode declared obsolete
+
* 5189 patch to support embed tag
* 5420 "Edit with kupu" broken for fields on custom fieldset
From duncan at codespeak.net Tue Jul 3 12:17:58 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Tue, 3 Jul 2007 12:17:58 +0200 (CEST)
Subject: [kupu-checkins] r44691 - in kupu/trunk/kupu: doc plone
plone/kupu_plone_layer
Message-ID: <20070703101758.91D7B80B6@code0.codespeak.net>
Author: duncan
Date: Tue Jul 3 12:17:58 2007
New Revision: 44691
Modified:
kupu/trunk/kupu/doc/CHANGES.txt
kupu/trunk/kupu/plone/head.kupu
kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html
Log:
Plone ticket 4887, editing defaults to kupu, even when javascript turned off
Now degrades cleanly: when javascript is turned off you get the source edit textarea and no toolbar.
Modified: kupu/trunk/kupu/doc/CHANGES.txt
==============================================================================
--- kupu/trunk/kupu/doc/CHANGES.txt (original)
+++ kupu/trunk/kupu/doc/CHANGES.txt Tue Jul 3 12:17:58 2007
@@ -32,6 +32,8 @@
- Plone tickets:
+ * 4887 editing defaults to kupu, even when javascript turned off
+
* 5622 Add a class (even if empty) to internal LinkDrawer
* 6283 Do not allow bigger images than Preview by default from Kupu
Modified: kupu/trunk/kupu/plone/head.kupu
==============================================================================
--- kupu/trunk/kupu/plone/head.kupu (original)
+++ kupu/trunk/kupu/plone/head.kupu Tue Jul 3 12:17:58 2007
@@ -21,38 +21,48 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 Tue Jul 3 12:17:58 2007
@@ -6,28 +6,28 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
+
-
-
+
+
@@ -89,26 +89,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From fschulze at codespeak.net Tue Jul 3 13:56:16 2007
From: fschulze at codespeak.net (fschulze at codespeak.net)
Date: Tue, 3 Jul 2007 13:56:16 +0200 (CEST)
Subject: [kupu-checkins] r44693 - kupu/trunk/kupu/plone
Message-ID: <20070703115616.44C8080B3@code0.codespeak.net>
Author: fschulze
Date: Tue Jul 3 13:56:14 2007
New Revision: 44693
Modified:
kupu/trunk/kupu/plone/librarytool.py
Log:
Fix usage of filters in _setToolbarFilters, it's a dict, not an object.
Modified: kupu/trunk/kupu/plone/librarytool.py
==============================================================================
--- kupu/trunk/kupu/plone/librarytool.py (original)
+++ kupu/trunk/kupu/plone/librarytool.py Tue Jul 3 13:56:14 2007
@@ -319,9 +319,9 @@
filter is a list of records with: id, visible, override"""
clean = {}
for f in filters:
- id = f.id
- visible = bool(getattr(f, 'visible', False))
- expr = getattr(f, 'override', None)
+ id = f['id']
+ visible = bool(f.get('visible', False))
+ expr = f.get('override', None)
if not id:
continue
From duncan at codespeak.net Fri Jul 6 17:32:48 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Fri, 6 Jul 2007 17:32:48 +0200 (CEST)
Subject: [kupu-checkins] r44794 - kupu/trunk/kupu/common
Message-ID: <20070706153248.B39B38149@code0.codespeak.net>
Author: duncan
Date: Fri Jul 6 17:32:47 2007
New Revision: 44794
Modified:
kupu/trunk/kupu/common/sarissa.js
Log:
Fix to importNode to allow kukit to import nodes not in the HTML namespace
Modified: kupu/trunk/kupu/common/sarissa.js
==============================================================================
--- kupu/trunk/kupu/common/sarissa.js (original)
+++ kupu/trunk/kupu/common/sarissa.js Fri Jul 6 17:32:47 2007
@@ -441,7 +441,7 @@
}else{
tmp.innerHTML = pNode.xml ? pNode.cloneNode(false).xml : pNode.cloneNode(false).outerHTML;
};
- return tmp.getElementsByTagName(oNode.nodeName)[0];
+ return tmp.getElementsByTagName(oNode.nodeName.replace(/^[^:]*:/,''))[0];
};
}catch(e){ };
};
From duncan at codespeak.net Sat Jul 7 21:01:27 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Sat, 7 Jul 2007 21:01:27 +0200 (CEST)
Subject: [kupu-checkins] r44831 - in kupu/trunk/kupu/plone: .
kupu_plone_layer
Message-ID: <20070707190127.D8B1E81CD@code0.codespeak.net>
Author: duncan
Date: Sat Jul 7 21:01:27 2007
New Revision: 44831
Modified:
kupu/trunk/kupu/plone/head.kupu
kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html
Log:
Revert changes from revision 44691: Fix for Plone ticket 4887 appears to upset Plone's inline editing.
Modified: kupu/trunk/kupu/plone/head.kupu
==============================================================================
--- kupu/trunk/kupu/plone/head.kupu (original)
+++ kupu/trunk/kupu/plone/head.kupu Sat Jul 7 21:01:27 2007
@@ -21,48 +21,38 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 Sat Jul 7 21:01:27 2007
@@ -6,28 +6,28 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
+
-
-
+
+
@@ -89,36 +89,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From duncan at codespeak.net Sat Jul 7 21:02:09 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Sat, 7 Jul 2007 21:02:09 +0200 (CEST)
Subject: [kupu-checkins] r44832 - kupu/trunk/kupu/common
Message-ID: <20070707190209.E673F81B2@code0.codespeak.net>
Author: duncan
Date: Sat Jul 7 21:02:09 2007
New Revision: 44832
Modified:
kupu/trunk/kupu/common/kupudrawers.js
Log:
Put guards around calls to editor.busy/notbusy otherwise compositepack breaks.
Modified: kupu/trunk/kupu/common/kupudrawers.js
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers.js (original)
+++ kupu/trunk/kupu/common/kupudrawers.js Sat Jul 7 21:02:09 2007
@@ -9,6 +9,12 @@
*****************************************************************************/
// $Id$
+function kupu_busy(ed) {
+ if (ed.busy) ed.busy();
+}
+function kupu_notbusy(ed, force) {
+ if (ed.notbusy) ed.notbusy(force);
+}
function DrawerTool() {
/* a tool to open and fill drawers
this tool has to (and should!) only be instantiated once
@@ -57,7 +63,7 @@
this.current_drawer.hide();
this.current_drawer.editor.resumeEditing();
this.current_drawer = null;
- this.editor.notbusy(true);
+ kupu_notbusy(this.editor, true)
};
};
@@ -190,14 +196,14 @@
if (limit-- && anchorframe.src==src) {
timer_instance.registerFunction(this, onloadEvent, 500);
} else {
- ed.notbusy(true);
+ kupu_notbusy(ed, true);
}
return;
};
if(window.drawertool && window.drawertool.current_drawer) {
window.drawertool.current_drawer.anchorframe_loaded();
};
- ed.notbusy();
+ kupu_notbusy(ed);
};
var id = 'kupu-linkdrawer-anchors';
@@ -210,7 +216,7 @@
var src = inp[0].value;
inp[0].value = "";
if (!src) { return; }
- ed.busy();
+ kupu_busy(ed);
if (this.anchorframe.readyState) { // IE
anchorframe.src = src;
onloadEvent();
@@ -1330,7 +1336,7 @@
if (xmlhttp.readyState == 4) {
if (xmlhttp.status && xmlhttp.status != 200) {
var errmessage = 'Error '+xmlhttp.status+' loading '+(uri||'XML');
- self.editor.notbusy(true);
+ kupu_notbusy(ed, true);
alert(errmessage);
throw "Error loading XML";
};
@@ -1340,10 +1346,11 @@
dom.loadXML(xmlhttp.responseText);
}
callback.apply(self, [dom, uri, extra]);
- self.editor.notbusy();
+ kupu_notbusy(ed);
};
};
var self = this;
+ var ed = this.editor;
/* load the XML from a uri
calls callback with one arg (the XML DOM) when done
the (optional) body arg should contain the body for the request
@@ -1354,7 +1361,7 @@
// something
body=body?body:null;
- this.editor.busy();
+ kupu_busy(ed);
try {
xmlhttp.open(method, uri, true);
xmlhttp.onreadystatechange = _sarissaCallback;
@@ -1372,7 +1379,7 @@
if (e && e.name && e.message) { // Microsoft
e = e.name + ': ' + e.message;
}
- this.editor.notbusy(true);
+ kupu_notbusy(ed, true);
alert(e);
}
};
From duncan at codespeak.net Mon Jul 9 09:23:17 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Mon, 9 Jul 2007 09:23:17 +0200 (CEST)
Subject: [kupu-checkins] r44861 - in kupu/trunk/kupu: doc
plone/kupu_plone_layer
Message-ID: <20070709072317.0261F8211@code0.codespeak.net>
Author: duncan
Date: Mon Jul 9 09:23:17 2007
New Revision: 44861
Modified:
kupu/trunk/kupu/doc/CHANGES.txt
kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html
Log:
Update CHANGES.txt
Modified: kupu/trunk/kupu/doc/CHANGES.txt
==============================================================================
--- kupu/trunk/kupu/doc/CHANGES.txt (original)
+++ kupu/trunk/kupu/doc/CHANGES.txt Mon Jul 9 09:23:17 2007
@@ -32,8 +32,6 @@
- Plone tickets:
- * 4887 editing defaults to kupu, even when javascript turned off
-
* 5622 Add a class (even if empty) to internal LinkDrawer
* 6283 Do not allow bigger images than Preview by default from Kupu
@@ -64,6 +62,8 @@
* 6598 Default linkables in Kupu: folder is not, plone site is not, ATRelativePathCriterion is
+ * 4887 Fix for "editing defaults to kupu, even when javascript turned off" reverted as it breaks inline editing.
+
- 1.4 Beta 6
- Removed the getToolByName deprecation workround since
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 Mon Jul 9 09:23:17 2007
@@ -6,28 +6,28 @@
-
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
+
+
-
+
-
-
+
+
From duncan at codespeak.net Mon Jul 9 09:25:41 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Mon, 9 Jul 2007 09:25:41 +0200 (CEST)
Subject: [kupu-checkins] r44862 - kupu/tag/kupu-1.4rc1
Message-ID: <20070709072541.91C618143@code0.codespeak.net>
Author: duncan
Date: Mon Jul 9 09:25:40 2007
New Revision: 44862
Added:
kupu/tag/kupu-1.4rc1/
- copied from r44861, kupu/trunk/kupu/
Log:
Tagged for 1.4rc1
From duncan at codespeak.net Mon Jul 9 16:08:08 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Mon, 9 Jul 2007 16:08:08 +0200 (CEST)
Subject: [kupu-checkins] r44879 - kupu/trunk/kupu/plone
Message-ID: <20070709140808.665258215@code0.codespeak.net>
Author: duncan
Date: Mon Jul 9 16:08:07 2007
New Revision: 44879
Modified:
kupu/trunk/kupu/plone/html2captioned.py
Log:
Fix width code for image scales
Modified: kupu/trunk/kupu/plone/html2captioned.py
==============================================================================
--- kupu/trunk/kupu/plone/html2captioned.py (original)
+++ kupu/trunk/kupu/plone/html2captioned.py Mon Jul 9 16:08:07 2007
@@ -137,7 +137,11 @@
tag = END_TAG_PATTERN.sub('\\1 alt="%s"\\2' % escape(target.Title(),1), tag)
d['tag'] = tag
if not width and srctail:
- subtarget = getattr(target, srctail, None)
+ try:
+ subtarget = target.restrictedTraverse(srctail)
+ except:
+ subtarget = getattr(target, srctail, None)
+
if hasattr(aq_base(subtarget), 'getWidth'):
width = subtarget.getWidth()
elif hasattr(aq_base(subtarget), 'width'):
From duncan at codespeak.net Mon Jul 9 17:28:32 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Mon, 9 Jul 2007 17:28:32 +0200 (CEST)
Subject: [kupu-checkins] r44881 - in kupu/trunk/kupu: doc plone
plone/kupu_plone_layer
Message-ID: <20070709152832.E1FD48223@code0.codespeak.net>
Author: duncan
Date: Mon Jul 9 17:28:32 2007
New Revision: 44881
Added:
kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt
Modified:
kupu/trunk/kupu/doc/CHANGES.txt
kupu/trunk/kupu/plone/html2captioned.py
kupu/trunk/kupu/plone/kupu_plone_layer/kupuplone.css.dtml
Log:
Removed hardwired html for captioning transform so the html can be customised in the skin.
Modified: kupu/trunk/kupu/doc/CHANGES.txt
==============================================================================
--- kupu/trunk/kupu/doc/CHANGES.txt (original)
+++ kupu/trunk/kupu/doc/CHANGES.txt Mon Jul 9 17:28:32 2007
@@ -2,7 +2,13 @@
Kupu changes
============
-- Recent
+- Recent changes
+
+ - Fixed broken code for determining the width of captioned images.
+ Also removed the hardwired html for the transform and use a
+ template instead (so it can be customised).
+
+- 1.4rc1
- Added a 'manage anchors' tab to the anchor drawer
Modified: kupu/trunk/kupu/plone/html2captioned.py
==============================================================================
--- kupu/trunk/kupu/plone/html2captioned.py (original)
+++ kupu/trunk/kupu/plone/html2captioned.py Mon Jul 9 17:28:32 2007
@@ -37,15 +37,17 @@
ATTR_VALUE = '=(?:"?)(?P<%s>(?<=")[^"]*|[^ \/>]*)'
ATTR_CLASS = ATTR_VALUE % 'class'
ATTR_WIDTH = ATTR_VALUE % 'width'
+ATTR_ALT = ATTR_VALUE % 'alt'
ATTR_PATTERN = re.compile('''
(?P
\<
( class%s
| src\s*=\s*"resolveuid/(?P([^/"#? ]*))
| width%s
+ | alt%s
| .
)*\>
- )''' % (ATTR_CLASS, ATTR_WIDTH), re.VERBOSE | re.IGNORECASE | re.DOTALL)
+ )''' % (ATTR_CLASS, ATTR_WIDTH, ATTR_ALT), re.VERBOSE | re.IGNORECASE | re.DOTALL)
SRC_TAIL = re.compile(r'/([^" \/>]+)')
CLASS_PATTERN = re.compile('\s*class\s*=\s*("[^"]*captioned[^"]*"|[^" \/>]+)')
@@ -111,6 +113,7 @@
(default: None)
"""
context = kwargs.get('context', None)
+ template = context.kupu_captioned_image
if context:
at_tool = context.archetype_tool
rc = at_tool.reference_catalog
@@ -125,39 +128,23 @@
srctail = m.group(1)
else:
srctail = None
- klass = attrs.group('class')
- width = attrs.group('width')
if src:
d = attrs.groupdict()
target = self.resolveuid(context, rc, src)
if target:
+ d['class'] = attrs.group('class')
+ d['originalwidth'] = attrs.group('width')
+ d['originalalt'] = attrs.group('alt')
d['caption'] = newline_to_br(html_quote(target.Description()))
- tag = CLASS_PATTERN.sub('', d['tag'])
- tag = ALT_PATTERN.sub('', tag)
- tag = END_TAG_PATTERN.sub('\\1 alt="%s"\\2' % escape(target.Title(),1), tag)
- d['tag'] = tag
- if not width and srctail:
+ d['image'] = d['fullimage'] = target
+ if srctail:
try:
subtarget = target.restrictedTraverse(srctail)
except:
subtarget = getattr(target, srctail, None)
-
- if hasattr(aq_base(subtarget), 'getWidth'):
- width = subtarget.getWidth()
- elif hasattr(aq_base(subtarget), 'width'):
- width = subtarget.width
- if not width:
- try:
- width = target.getWidth()
- except AttributeError:
- pass
- if not width:
- try:
- width = target.getImage().getWidth()
- except:
- width = 150
- d['width'] = width
- return IMAGE_TEMPLATE % d
+ if subtarget:
+ d['image'] = subtarget
+ return template(**d)
return match.group(0) # No change
html = IMAGE_PATTERN.sub(replaceImage, data)
Added: kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt
==============================================================================
--- (empty file)
+++ kupu/trunk/kupu/plone/kupu_plone_layer/kupu_captioned_image.pt Mon Jul 9 17:28:32 2007
@@ -0,0 +1,15 @@
+
+
+
+
+
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 Mon Jul 9 17:28:32 2007
@@ -306,5 +306,12 @@
.kupu-html embed embed, .kupu-html embed object {
display:none;
}
+dd.image-caption {
+ text-align:left;
+ padding: 0;
+}
+dl.captioned {
+ padding: 10px;
+}
/* */
From kupu-checkins at codespeak.net Wed Jul 11 14:51:46 2007
From: kupu-checkins at codespeak.net (kupu-checkins at codespeak.net)
Date: Wed, 11 Jul 2007 14:51:46 +0200 (CEST)
Subject: [kupu-checkins] Doctor Jillian : 45% off your order
Message-ID: <20070711035228.10215.qmail@MODEA.net.t-com.hr>
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/kupu-checkins/attachments/20070711/92d0b5b7/attachment.htm
From duncan at codespeak.net Fri Jul 13 13:23:06 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Fri, 13 Jul 2007 13:23:06 +0200 (CEST)
Subject: [kupu-checkins] r45010 - in kupu/trunk/kupu/plone: .
kupu_plone_layer
Message-ID: <20070713112306.C7CC08275@code0.codespeak.net>
Author: duncan
Date: Fri Jul 13 13:23:06 2007
New Revision: 45010
Modified:
kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html
kupu/trunk/kupu/plone/wysiwyg_support.kupu
Log:
Try a fix for text_format not defined problem.
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 Fri Jul 13 13:23:06 2007
@@ -523,7 +523,7 @@
Convert to HTML and edit with the visual editor
-
+
Format