- Select a paragraph style then choose a paragraph and Ok to insert a link to that location.
-
-
- Select one or two paragraph styles, then Ok to insert a table of contents.
-
-
- Anchors are created for checked paragraphs and
- removed for unchecked paragraphs when you press Ok.
- Anchors in use on this page may not be deleted.
-
-
+
+
+
+
+ Select a paragraph style then choose a paragraph and Ok to insert a link to that location.
+
+
+ Select one or two paragraph styles, then Ok to insert a table of contents.
+
+
+ Anchors are created for checked paragraphs and
+ removed for unchecked paragraphs when you press Ok.
+ Anchors in use on this page may not be deleted.
+
+
- Select a paragraph style then choose a paragraph and Ok to insert a link to that location.
-
-
- Select one or two paragraph styles, then Ok to insert a table of contents.
-
-
- Anchors are created for checked paragraphs and
- removed for unchecked paragraphs when you press Ok.
- Anchors in use on this page may not be deleted.
-
-
+
+
+
+
+ Select a paragraph style then choose a paragraph and Ok to insert a link to that location.
+
+
+ Select one or two paragraph styles, then Ok to insert a table of contents.
+
+
+ Anchors are created for checked paragraphs and
+ removed for unchecked paragraphs when you press Ok.
+ Anchors in use on this page may not be deleted.
+
+
+
From duncan at codespeak.net Thu Nov 8 16:15:56 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Thu, 8 Nov 2007 16:15:56 +0100 (CET)
Subject: [kupu-checkins] r48420 - in kupu/trunk/kupu: . doc
Message-ID: <20071108151556.7E0808171@code0.codespeak.net>
Author: duncan
Date: Thu Nov 8 16:15:56 2007
New Revision: 48420
Modified:
kupu/trunk/kupu/doc/CHANGES.txt
kupu/trunk/kupu/version.txt
Log:
Update CHANGES.txt
Modified: kupu/trunk/kupu/doc/CHANGES.txt
==============================================================================
--- kupu/trunk/kupu/doc/CHANGES.txt (original)
+++ kupu/trunk/kupu/doc/CHANGES.txt Thu Nov 8 16:15:56 2007
@@ -2,18 +2,19 @@
Kupu changes
============
-- 1.4.4 SVN/unreleased
+- 1.4.4
- Enabled Safari support (needs webkit nightly build and Safari 3)
- Plone tickets
- * 7224 Kupu: error in iframe tabindex attribute
- * 7305 Page creation and kupu upload image returns an error if Kupu link uid's is turned on.
- * 7285 Kupu Accesskey for Save conflict with Firefox History Menu
* 7099 Kupu error on multi-schemata archetypes content
* 7258 Missing translation msgids for kupu
+ * 7224 Kupu: error in iframe tabindex attribute
* 7229 kupu 1.4.3 css correction to display redo button icon in editing interface
+ * 7285 Kupu Accesskey for Save conflict with Firefox History Menu
+ * 7305 Page creation and kupu upload image returns an error if Kupu link uid's is turned on.
+ * 7315 Kupu table of contents generator doesn't allow multiple paragraph styles to be selected in IE7
- 1.4.3
Modified: kupu/trunk/kupu/version.txt
==============================================================================
--- kupu/trunk/kupu/version.txt (original)
+++ kupu/trunk/kupu/version.txt Thu Nov 8 16:15:56 2007
@@ -1 +1 @@
-kupu 1.4.3
+kupu 1.4.4
From duncan at codespeak.net Thu Nov 8 17:07:01 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Thu, 8 Nov 2007 17:07:01 +0100 (CET)
Subject: [kupu-checkins] r48421 - kupu/trunk/kupu/common
Message-ID: <20071108160701.2694C816C@code0.codespeak.net>
Author: duncan
Date: Thu Nov 8 17:07:00 2007
New Revision: 48421
Modified:
kupu/trunk/kupu/common/kupubasetools.js
kupu/trunk/kupu/common/kupudrawers.js
Log:
Fix safari link insertion: safari has a weird implementation of the CreateLink command which inserts new links with the url
as text content. This makes it hard to detect when a new link was inserted (as opposed to an existing link
reformatted), everything else inserts a blank link.
Modified: kupu/trunk/kupu/common/kupubasetools.js
==============================================================================
--- kupu/trunk/kupu/common/kupubasetools.js (original)
+++ kupu/trunk/kupu/common/kupubasetools.js Thu Nov 8 17:07:00 2007
@@ -1039,14 +1039,15 @@
linkWindow.focus();
};
- this.updateLink = function (linkel, url, type, name, target, title, className) {
+ this.updateLink = function (linkel, url, type, name, target, title, className, bForce) {
if (type && type == 'anchor') {
linkel.removeAttribute('href');
linkel.setAttribute('name', name);
} else {
linkel.href = url;
- if (linkel.innerHTML == "") {
+ if (linkel.innerHTML == "" || (bForce && linkel.innerHTML==url)) {
var doc = this.editor.getInnerDocument();
+ while (linkel.firstChild) { linkel.removeChild(linkel.firstChild); };
linkel.appendChild(doc.createTextNode(title || url));
}
if (title) {
@@ -1069,13 +1070,13 @@
};
};
- this.formatSelectedLink = function(url, type, name, target, title, className) {
+ this.formatSelectedLink = function(url, type, name, target, title, className, bForce) {
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, className);
+ this.updateLink(linkel, url, type, name, target, title, className, bForce);
return true;
}
@@ -1088,7 +1089,7 @@
for (var i = 0; i < linkelements.length; i++) {
linkel = linkelements[i];
if (selection.containsNode(linkel)) {
- this.updateLink(linkel, url, type, name, target, title, className);
+ this.updateLink(linkel, url, type, name, target, title, className, bForce);
containsLink = true;
}
};
@@ -1116,7 +1117,7 @@
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, className)) {
+ if (!this.formatSelectedLink(url, type, name, target, title, className, true)) {
// Insert link with no text selected, insert the title
// or URI instead.
var doc = this.editor.getInnerDocument();
Modified: kupu/trunk/kupu/common/kupudrawers.js
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers.js (original)
+++ kupu/trunk/kupu/common/kupudrawers.js Thu Nov 8 17:07:00 2007
@@ -369,7 +369,7 @@
this.editor.resumeEditing();
if (this.getMode()) {
var url = input.value;
- this.tool.createLink(url, null, null, this.target, 'external-link');
+ this.tool.createLink(url, null, null, this.target, null, 'external-link');
input.value = '';
} else {
// Import the html
From duncan at codespeak.net Fri Nov 9 11:15:18 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Fri, 9 Nov 2007 11:15:18 +0100 (CET)
Subject: [kupu-checkins] r48462 - kupu/tag/kupu-1.4.4
Message-ID: <20071109101518.4CC9081C5@code0.codespeak.net>
Author: duncan
Date: Fri Nov 9 11:15:16 2007
New Revision: 48462
Added:
kupu/tag/kupu-1.4.4/
- copied from r48461, kupu/trunk/kupu/
Log:
Tagged Kupu 1.4.4
From duncan at codespeak.net Fri Nov 9 15:08:39 2007
From: duncan at codespeak.net (duncan at codespeak.net)
Date: Fri, 9 Nov 2007 15:08:39 +0100 (CET)
Subject: [kupu-checkins] r48472 - in kupu/branch/kupu-1.4: . common
common/kupudrawers default doc plone plone/kupu_plone_layer
plone/kupu_references plone/profiles/default plone/tests
plone/tests/output
Message-ID: <20071109140839.EC78D81E1@code0.codespeak.net>
Author: duncan
Date: Fri Nov 9 15:08:37 2007
New Revision: 48472
Modified:
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/kupudrawerstyles.css
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/default/drawers.kupu
kupu/branch/kupu-1.4/default/toolbar.kupu
kupu/branch/kupu-1.4/doc/CHANGES.txt
kupu/branch/kupu-1.4/doc/PLONE2.txt
kupu/branch/kupu-1.4/i18n.bat
kupu/branch/kupu-1.4/plone/body.kupu
kupu/branch/kupu-1.4/plone/helpers.py
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/kupu_captioned_image.pt
kupu/branch/kupu-1.4/plone/kupu_plone_layer/kupu_wysiwyg_support.html
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/kupusearch.xml.pt
kupu/branch/kupu-1.4/plone/kupu_plone_layer/sample-kupu-customisation-policy.py
kupu/branch/kupu-1.4/plone/kupu_references/referencebrowser.pt
kupu/branch/kupu-1.4/plone/plonedrawers.py
kupu/branch/kupu-1.4/plone/plonelibrarytool.py
kupu/branch/kupu-1.4/plone/profiles/default/kupu.xml
kupu/branch/kupu-1.4/plone/save.kupu
kupu/branch/kupu-1.4/plone/tests/output/linked.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/test_html2captioned.py
kupu/branch/kupu-1.4/plone/util.py
kupu/branch/kupu-1.4/plone/wire.kupu
kupu/branch/kupu-1.4/plone/z3interfaces.py
kupu/branch/kupu-1.4/plone/zmi_docs.pt
kupu/branch/kupu-1.4/version.txt
Log:
Bring 1.4 branch up to date with 1.4.4 trunk
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 Fri Nov 9 15:08:37 2007
@@ -677,7 +677,7 @@
this._removeStyle = function() {
function needbreak(e) {
if (isblock && e) {
- if (blocktagre.test(e.nodeName) || e.nodeName=='BR') return;
+ if (blocktagre.test(e.nodeName) || /^br$/i.test(e.nodeName)) return;
parent.insertBefore(ed.newElement('br'), n);
}
}
@@ -1039,14 +1039,15 @@
linkWindow.focus();
};
- this.updateLink = function (linkel, url, type, name, target, title, className) {
+ this.updateLink = function (linkel, url, type, name, target, title, className, bForce) {
if (type && type == 'anchor') {
linkel.removeAttribute('href');
linkel.setAttribute('name', name);
} else {
linkel.href = url;
- if (linkel.innerHTML == "") {
+ if (linkel.innerHTML == "" || (bForce && linkel.innerHTML==url)) {
var doc = this.editor.getInnerDocument();
+ while (linkel.firstChild) { linkel.removeChild(linkel.firstChild); };
linkel.appendChild(doc.createTextNode(title || url));
}
if (title) {
@@ -1069,13 +1070,13 @@
};
};
- this.formatSelectedLink = function(url, type, name, target, title, className) {
+ this.formatSelectedLink = function(url, type, name, target, title, className, bForce) {
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, className);
+ this.updateLink(linkel, url, type, name, target, title, className, bForce);
return true;
}
@@ -1088,7 +1089,7 @@
for (var i = 0; i < linkelements.length; i++) {
linkel = linkelements[i];
if (selection.containsNode(linkel)) {
- this.updateLink(linkel, url, type, name, target, title, className);
+ this.updateLink(linkel, url, type, name, target, title, className, bForce);
containsLink = true;
}
};
@@ -1116,7 +1117,7 @@
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, className)) {
+ if (!this.formatSelectedLink(url, type, name, target, title, className, true)) {
// Insert link with no text selected, insert the title
// or URI instead.
var doc = this.editor.getInnerDocument();
@@ -1711,8 +1712,7 @@
for (var i=0; i < currtable.childNodes.length; i++) {
var currtbody = currtable.childNodes[i];
if (currtbody.nodeType != 1 ||
- (currtbody.nodeName.toUpperCase() != "THEAD" &&
- currtbody.nodeName.toUpperCase() != "TBODY")) {
+ (/^thead|tbody$/i.test(currtbody.nodeName))) {
continue;
}
for (var j=0; j < currtbody.childNodes.length; j++) {
@@ -1808,7 +1808,7 @@
this._isBodyRow = function(row) {
for (var node = row.firstChild; node; node=node.nextSibling) {
- if (/TD/.test(node.nodeName)) {
+ if (/^td$/i.test(node.nodeName)) {
return true;
}
}
@@ -1819,7 +1819,7 @@
// Remove formatted div or p from a cell
var nxt, n;
for (var node = el.firstChild; node;) {
- if (/^DIV|P$/i.test(node.nodeName)) {
+ if (/^div|p$/i.test(node.nodeName)) {
for (var n = node.firstChild; n;) {
var nxt = n.nextSibling;
el.insertBefore(n, node); // Move nodes out of div
@@ -1857,7 +1857,7 @@
var row = rows[i];
var currnumcols = 0;
for (var node = row.firstChild; node; node=node.nextSibling) {
- if (/td|th/i.test(node.nodeName)) {
+ if (/^(td|th)$/i.test(node.nodeName)) {
currnumcols += parseInt(node.getAttribute('colSpan') || '1');
};
};
@@ -1879,7 +1879,7 @@
}
for (var node = row.firstChild; node;) {
var nxt = node.nextSibling;
- if (/TD|TH/.test(node.nodeName)) {
+ if (/^(td|th)$/i.test(node.nodeName)) {
this._cleanCell(node);
newrow.appendChild(node);
};
@@ -1936,13 +1936,13 @@
var hrows = [], brows = [], frows = [];
for (var node = table.firstChild; node; node = node.nextSibling) {
- var nodeName = node.nodeName;
- if (/TR/.test(node.nodeName)) {
+ var nodeName = node.nodeName.toLowerCase();
+ if (/tr/i.test(node.nodeName)) {
brows.push(node);
- } else if (/THEAD|TBODY|TFOOT/.test(node.nodeName)) {
- var rows = nodeName=='THEAD' ? hrows : nodeName=='TFOOT' ? frows : brows;
+ } else if (/thead|tbody|tfoot/i.test(node.nodeName)) {
+ var rows = nodeName=='thead' ? hrows : nodeName=='tfoot' ? frows : brows;
for (var inode = node.firstChild; inode; inode = inode.nextSibling) {
- if (/TR/.test(inode.nodeName)) {
+ if (/tr/i.test(inode.nodeName)) {
rows.push(inode);
};
};
@@ -2308,11 +2308,12 @@
var path = '';
var url = null; // for links we want to display the url too
var currnode = selNode;
- while (currnode != null && currnode.nodeName != '#document') {
- if (currnode.nodeName.toLowerCase() == 'a') {
+ var nn;
+ while (currnode != null && (nn=currnode.nodeName.toLowerCase()) != '#document') {
+ if (nn=='a') {
url = currnode.getAttribute('href');
};
- path = '/' + currnode.nodeName.toLowerCase() + path;
+ path = '/' + nn + path;
currnode = currnode.parentNode;
}
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 Fri Nov 9 15:08:37 2007
@@ -724,7 +724,7 @@
var kid = kids[i];
if (kid.parentNode !== htmlnode) {
- if (kid.tagName == 'BODY') {
+ if (kid.tagName.toLowerCase()=='body') {
if (nodename != 'html') continue;
} else if (kid.parentNode.tagName === htmlnode.tagName) {
continue; // IE bug: nodes appear multiple places
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 Fri Nov 9 15:08:37 2007
@@ -155,9 +155,9 @@
event = event || window.event;
var target = event.currentTarget || event.srcElement;
var el = target;
- while (el.nodeName != 'LI') { el = el.parentNode; };
+ while (!/^li$/i.test(el.nodeName)) { el = el.parentNode; };
var thistab = el;
- while (el.nodeName != 'UL') { el = el.parentNode; };
+ while (!/^ul$/i.test(el.nodeName)) { el = el.parentNode; };
var tabs = el.getElementsByTagName('li');
for (var i = 0; i < tabs.length; i++) {
var el = tabs[i];
@@ -243,21 +243,19 @@
proto.anchorText = function(a) {
// Text inside anchor, or immediate sibling block tag, or parent block.
- var blocktag = /^DIV|P|BODY|TD|H.$/;
+ var blocktag = /^div|p|body|td|h.$/i;
var txt = '';
var prefix = '#' + a.name;
-findlabel:
+
for (var node = a; node && !txt; node=node.parentNode) {
var txt = node.textContent || node.innerText || '';
if (txt || blocktag.test(node.nodeName)) {
break;
}
- for (var sibling = node.nextSibling; sibling; sibling = sibling.nextSibling) {
- if (sibling.nodeName=='#text') {
+ for (var sibling = node.nextSibling; sibling && !txt; sibling = sibling.nextSibling) {
+ if (sibling.nodeName.toLowerCase()=='#text') {
txt = sibling.data.strip();
- } else if (blocktag.test(sibling.nodeName)) {
- break findlabel;
} else {
txt += sibling.textContent || sibling.innerText ||'';
};
@@ -371,7 +369,7 @@
this.editor.resumeEditing();
if (this.getMode()) {
var url = input.value;
- this.tool.createLink(url, null, null, this.target, 'external-link');
+ this.tool.createLink(url, null, null, this.target, null, 'external-link');
input.value = '';
} else {
// Import the html
@@ -442,7 +440,7 @@
var there = preview.contentWindow.location.href;
} catch(e) { return; }
- if (here != there && !(/^about:/.test(there))) {
+ if (there && here != there && !(/^about:/.test(there))) {
input.value = there;
}
this.showAnchors(currentAnchor());
@@ -928,8 +926,10 @@
if (this.editor.getBrowserName() == 'IE') {
newitemsnode = newitemsnode.cloneNode(true);
+ if (newbc) newbc = newbc.cloneNode(true);
} else {
newitemsnode = this.xmldata.importNode(newitemsnode, true);
+ if (newbc) newbc = this.xmldata.importNode(newbc, true);
}
if (newbc) {
if (bcnode) {
@@ -1299,7 +1299,7 @@
if (this.editor.getBrowserName() == 'IE') {
resultlib = resultlib.cloneNode(true);
} else {
- this.xmldata.importNode(resultlib, true);
+ resultlib = this.xmldata.importNode(resultlib, true);
}
var libraries = this.xmldata.selectSingleNode("/libraries");
libraries.appendChild(resultlib);
@@ -1400,10 +1400,20 @@
}
this.createContent = function() {
+ function getSel(sel, p, t) {
+ var nodes = p.getElementsByTagName(t);
+ for (var i = 0; i < nodes.length; i++) {
+ if (sel.containsNode(nodes[i])) {
+ return nodes[i];
+ };
+ };
+ }
var ed = this.editor;
+ var sel = ed.getSelection();
var currnode = ed.getSelectedNode();
- var currimg = ed.getNearestParentOfType(currnode, 'OBJECT') || ed.getNearestParentOfType(currnode, 'IMG');
- this.selectedSrc = currimg.data||currimg.src||null;
+ var currimg = ed.getNearestParentOfType(currnode, 'OBJECT') || ed.getNearestParentOfType(currnode, 'IMG') ||
+ getSel(sel, currnode, 'object') || getSel(sel, currnode, 'img');
+ this.selectedSrc = currimg?(currimg.data||currimg.src||null):null;
this.options = {};
if (currimg) {
ed.getSelection().selectNodeContents(currimg);
@@ -1711,7 +1721,7 @@
if (level==0) {
toc.appendChild(li);
} else {
- if (!toc.lastChild || toc.lastChild.nodeName != 'ul') {
+ if (!toc.lastChild || toc.lastChild.nodeName.toLowerCase() != 'ul') {
toc.appendChild(ed.newElement('ul'));
}
toc.lastChild.appendChild(li);
@@ -1735,10 +1745,10 @@
};
}
var node = ed.getSelection().parentElement();
- if (node.nodeName == 'BODY') {
+ if (node.nodeName.toLowerCase() == 'body') {
node.insertBefore(toc, node.firstChild);
} else {
- while (node.parentNode.nodeName != 'BODY') {
+ while (node.parentNode.nodeName.toLowerCase() != 'body') {
node = node.parentNode;
}
node.parentNode.insertBefore(toc, node);
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 Fri Nov 9 15:08:37 2007
@@ -390,9 +390,10 @@
-