From duncan at codespeak.net Wed Nov 1 11:51:55 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Wed, 1 Nov 2006 11:51:55 +0100 (CET) Subject: [kupu-checkins] r33999 - in kupu/trunk/kupu: common tests Message-ID: <20061101105155.B46B110063@code0.codespeak.net> Author: duncan Date: Wed Nov 1 11:51:49 2006 New Revision: 33999 Modified: kupu/trunk/kupu/common/kupueditor.js kupu/trunk/kupu/common/sarissa.js kupu/trunk/kupu/common/sarissa_ieemu_xpath.js kupu/trunk/kupu/tests/run_tests.html kupu/trunk/kupu/tests/test_kupubasetools.js kupu/trunk/kupu/tests/test_kupueditor.js kupu/trunk/kupu/tests/test_kupuhelpers.js kupu/trunk/kupu/tests/test_xhtml.js Log: Update to latest sarissa.js/sarissa_ieemu_xpath.js: 0.9.7.4+fixes (will switch to 0.9.7.5 when it becomes available). kupueditor.js no longer uses Sarissa.serialize (since that has vapourised). Tests no long use Sarissa.serialize. Tests reference Node.TEXT_NODE and Node.ELEMENT_NODE since Opera couldn't handle node.TEXT_NODE &c. Tests are now more forgiving when comparing output since Opera does weird things like adding attributes to tag and closing in innerHTML. Fixed a real bug in the tests: calling createRange on wrong document. Opera still failing 15 unit tests and messing up the style pulldown. Modified: kupu/trunk/kupu/common/kupueditor.js ============================================================================== --- kupu/trunk/kupu/common/kupueditor.js (original) +++ kupu/trunk/kupu/common/kupueditor.js Wed Nov 1 11:51:49 2006 @@ -92,6 +92,7 @@ this.log = logger; // simple logger object this.tools = {}; // mapping id->tool this.filters = new Array(); // contentfilters + this.serializer = new XMLSerializer(); this._designModeSetAttempts = 0; this._initialized = false; @@ -624,7 +625,7 @@ var bodies = transform.getElementsByTagName('body'); var data = ''; for (var i = 0; i < bodies.length; i++) { - data += Sarissa.serialize(bodies[i]); + data += this.serializer.serializeToString(bodies[i]); } return this.escapeEntities(data); }; @@ -746,13 +747,13 @@ var contents = '\n' + '' + - Sarissa.serialize(transform.getElementsByTagName("head")[0]) + - Sarissa.serialize(transform.getElementsByTagName("body")[0]) + + this.serializer.serializeToString(transform.getElementsByTagName("head")[0]) + + this.serializer.serializeToString(transform.getElementsByTagName("body")[0]) + ''; } else { var contents = '' + - Sarissa.serialize(transform.getElementsByTagName("head")[0]) + - Sarissa.serialize(transform.getElementsByTagName("body")[0]) + + this.serializer.serializeToString(transform.getElementsByTagName("head")[0]) + + this.serializer.serializeToString(transform.getElementsByTagName("body")[0]) + ''; }; Modified: kupu/trunk/kupu/common/sarissa.js ============================================================================== --- kupu/trunk/kupu/common/sarissa.js (original) +++ kupu/trunk/kupu/common/sarissa.js Wed Nov 1 11:51:49 2006 @@ -1,66 +1,54 @@ -/***************************************************************************** - * - * Sarissa XML library version 0.9.6 - * Copyright (c) 2003 Manos Batsis, - * mailto: mbatsis at users full stop sourceforge full stop net - * This software is distributed under the Kupu License. See - * LICENSE.txt for license text. See the Sarissa homepage at - * http://sarissa.sourceforge.net for more information. - * - ***************************************************************************** - +/** * ==================================================================== * About * ==================================================================== - * Sarissa cross browser XML library - * @version 0.9.6 - * @author: Manos Batsis, mailto: mbatsis at users full stop sourceforge full stop net - * * Sarissa is an ECMAScript library acting as a cross-browser wrapper for native XML APIs. * The library supports Gecko based browsers like Mozilla and Firefox, - * Internet Explorer (5.5+ with MSXML3.0+) and, last but not least, KHTML based browsers like - * Konqueror and Safari. - * + * Internet Explorer (5.5+ with MSXML3.0+), Konqueror, Safari and a little of Opera + * @version @sarissa.version@ + * @author: Manos Batsis, mailto: mbatsis at users full stop sourceforge full stop net + * ==================================================================== + * Licence + * ==================================================================== + * Sarissa is free software distributed under the GNU GPL version 2 (see gpl.txt) or higher, + * GNU LGPL version 2.1 (see lgpl.txt) or higher and Apache Software License 2.0 or higher + * (see asl.txt). This means you can choose one of the three and use that if you like. If + * you make modifications under the ASL, i would appreciate it if you submitted those. + * In case your copy of Sarissa does not include the license texts, you may find + * them online in various formats at http://www.gnu.org and + * http://www.apache.org. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** - *

Sarissa is a utility class. Provides static methods for DOMDocument and - * XMLHTTP objects, DOM Node serializatrion to XML strings and other goodies.

+ *

Sarissa is a utility class. Provides "static" methods for DOMDocument, + * DOM Node serialization to XML strings and other utility goodies.

* @constructor */ function Sarissa(){}; -/** @private */ Sarissa.PARSED_OK = "Document contains no parsing errors"; -/** - * Tells you whether transformNode and transformNodeToObject are available. This functionality - * is contained in sarissa_ieemu_xslt.js and is deprecated. If you want to control XSLT transformations - * use the XSLTProcessor - * @deprecated - * @type boolean - */ -Sarissa.IS_ENABLED_TRANSFORM_NODE = false; -/** - * tells you whether XMLHttpRequest (or equivalent) is available - * @type boolean - */ -Sarissa.IS_ENABLED_XMLHTTP = false; -/** - * tells you whether selectNodes/selectSingleNode is available - * @type boolean - */ -Sarissa.IS_ENABLED_SELECT_NODES = false; +Sarissa.PARSED_EMPTY = "Document is empty"; +Sarissa.PARSED_UNKNOWN_ERROR = "Not well-formed or other error"; var _sarissa_iNsCounter = 0; var _SARISSA_IEPREFIX4XSLPARAM = ""; var _SARISSA_HAS_DOM_IMPLEMENTATION = document.implementation && true; var _SARISSA_HAS_DOM_CREATE_DOCUMENT = _SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.createDocument; var _SARISSA_HAS_DOM_FEATURE = _SARISSA_HAS_DOM_IMPLEMENTATION && document.implementation.hasFeature; var _SARISSA_IS_MOZ = _SARISSA_HAS_DOM_CREATE_DOCUMENT && _SARISSA_HAS_DOM_FEATURE; -var _SARISSA_IS_SAFARI = navigator.userAgent.toLowerCase().indexOf("applewebkit") != -1; +var _SARISSA_IS_SAFARI = (navigator.userAgent && navigator.vendor && (navigator.userAgent.toLowerCase().indexOf("applewebkit") != -1 || navigator.vendor.indexOf("Apple") != -1)); var _SARISSA_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1; - -if(!window.Node || !window.Node.ELEMENT_NODE){ - var Node = {ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12}; +if(!window.Node || !Node.ELEMENT_NODE){ + Node = {ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12}; }; +if( typeof XMLDocument == "undefined" && typeof Document != "undefined"){ XMLDocument = Document; } + // IE initialization if(_SARISSA_IS_IE){ // for XSLT parameter names, prefix needed by IE @@ -68,13 +56,15 @@ // used to store the most recent ProgID available out of the above var _SARISSA_DOM_PROGID = ""; var _SARISSA_XMLHTTP_PROGID = ""; + var _SARISSA_DOM_XMLWRITER = ""; /** * Called when the Sarissa_xx.js file is parsed, to pick most recent * ProgIDs for IE, then gets destroyed. + * @private * @param idList an array of MSXML PROGIDs from which the most recent will be picked for a given object * @param enabledList an array of arrays where each array has two items; the index of the PROGID for which a certain feature is enabled */ - pickRecentProgID = function (idList, enabledList){ + Sarissa.pickRecentProgID = function (idList){ // found progID flag var bFound = false; for(var i=0; i < idList.length && !bFound; i++){ @@ -82,50 +72,69 @@ var oDoc = new ActiveXObject(idList[i]); o2Store = idList[i]; bFound = true; - for(var j=0;j"); - // don't use the same prefix again - ++_sarissa_iNsCounter; - } - else - oDoc.loadXML("<" + sName + "/>"); + // create an artifical namespace prefix + // or reuse existing prefix if applicable + var prefix = ""; + if(sUri){ + if(sName.indexOf(":") > 1){ + prefix = sName.substring(0, sName.indexOf(":")); + sName = sName.substring(sName.indexOf(":")+1); + }else{ + prefix = "a" + (_sarissa_iNsCounter++); + }; + }; + // use namespaces if a namespace URI exists + if(sUri){ + oDoc.loadXML('<' + prefix+':'+sName + " xmlns:" + prefix + "=\"" + sUri + "\"" + " />"); + } else { + oDoc.loadXML('<' + sName + " />"); + }; }; return oDoc; }; // see non-IE version Sarissa.getParseErrorText = function (oDoc) { var parseErrorText = Sarissa.PARSED_OK; - if(oDoc.parseError != 0){ + if(oDoc.parseError.errorCode != 0){ parseErrorText = "XML Parsing Error: " + oDoc.parseError.reason + "\nLocation: " + oDoc.parseError.url + "\nLine Number " + oDoc.parseError.line + ", Column " + @@ -136,6 +145,9 @@ parseErrorText += "-"; }; parseErrorText += "^\n"; + } + else if(oDoc.documentElement == null){ + parseErrorText = Sarissa.PARSED_EMPTY; }; return parseErrorText; }; @@ -150,43 +162,113 @@ * @constructor */ XSLTProcessor = function(){ + if(!_SARISSA_XSLTEMPLATE_PROGID){ + _SARISSA_XSLTEMPLATE_PROGID = Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.4.0", "MSXML2.XSLTemplate.3.0"]); + }; this.template = new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID); this.processor = null; }; /** - * Impoprts the given XSLT DOM and compiles it to a reusable transform + * Imports the given XSLT DOM and compiles it to a reusable transform + * Note: If the stylesheet was loaded from a URL and contains xsl:import or xsl:include elements,it will be reloaded to resolve those * @argument xslDoc The XSLT DOMDocument to import */ XSLTProcessor.prototype.importStylesheet = function(xslDoc){ + if(!_SARISSA_THREADEDDOM_PROGID){ + _SARISSA_THREADEDDOM_PROGID = Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.4.0", "MSXML2.FreeThreadedDOMDocument.3.0"]); + _SARISSA_DOM_XMLWRITER = Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.4.0", "Msxml2.MXXMLWriter.3.0", "MSXML2.MXXMLWriter", "MSXML.MXXMLWriter", "Microsoft.XMLDOM"]); + }; + xslDoc.setProperty("SelectionLanguage", "XPath"); + xslDoc.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); // convert stylesheet to free threaded - var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); - converted.loadXML(xslDoc.xml); + var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); + // make included/imported stylesheets work if exist and xsl was originally loaded from url + if(xslDoc.url && xslDoc.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']") != null){ + converted.async = false; + converted.load(xslDoc.url); + } else { + converted.loadXML(xslDoc.xml); + }; + converted.setProperty("SelectionNamespaces", "xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); + var output = converted.selectSingleNode("//xsl:output"); + this.outputMethod = output ? output.getAttribute("method") : "html"; this.template.stylesheet = converted; this.processor = this.template.createProcessor(); // (re)set default param values this.paramsSet = new Array(); }; + /** - * Transform the given XML DOM + * Transform the given XML DOM and return the transformation result as a new DOM document * @argument sourceDoc The XML DOMDocument to transform * @return The transformation result as a DOM Document */ XSLTProcessor.prototype.transformToDocument = function(sourceDoc){ - this.processor.input = sourceDoc; - var outDoc = new ActiveXObject(_SARISSA_DOM_PROGID); - this.processor.output = outDoc; - this.processor.transform(); - return outDoc; + // fix for bug 1549749 + if(_SARISSA_THREADEDDOM_PROGID == "MSXML2.FreeThreadedDOMDocument.3.0"){ + this.processor.input=sourceDoc; + + var outDoc=new ActiveXObject(_SARISSA_DOM_PROGID); + + this.processor.output=outDoc; + + this.processor.transform(); + + return outDoc; + } + else{ + this.processor.input = sourceDoc; + + var outDoc = new ActiveXObject(_SARISSA_DOM_XMLWRITER); + + this.processor.output = outDoc; + + this.processor.transform(); + + var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID); + + oDoc.loadXML(outDoc.output+""); + + return oDoc; + }; }; + /** - * Not sure if this works in IE. Maybe this will allow non-well-formed - * transformation results (i.e. with no single root element) + * Transform the given XML DOM and return the transformation result as a new DOM fragment. + * Note: The xsl:output method must match the nature of the owner document (XML/HTML). * @argument sourceDoc The XML DOMDocument to transform - * @return The transformation result as a DOM Fragment + * @argument ownerDoc The owner of the result fragment + * @return The transformation result as a DOM Document */ - XSLTProcessor.prototype.transformToFragment = function(sourceDoc, ownerDocument){ - return this.transformToDocument(sourceDoc); + XSLTProcessor.prototype.transformToFragment = function (sourceDoc, ownerDoc) { + this.processor.input = sourceDoc; + this.processor.transform(); + var s = this.processor.output; + var f = ownerDoc.createDocumentFragment(); + if (this.outputMethod == 'text') { + f.appendChild(ownerDoc.createTextNode(s)); + } else if (ownerDoc.body && ownerDoc.body.innerHTML) { + var container = ownerDoc.createElement('div'); + container.innerHTML = s; + while (container.hasChildNodes()) { + f.appendChild(container.firstChild); + } + } + else { + var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID); + if (s.substring(0, 5) == '') + 2); + } + var xml = ''.concat('', s, ''); + oDoc.loadXML(xml); + var container = oDoc.documentElement; + while (container.hasChildNodes()) { + f.appendChild(container.firstChild); + } + } + return f; }; + /** * Set global XSLT parameter of the imported stylesheet * @argument nsURI The parameter namespace URI @@ -214,102 +296,23 @@ * @return The parameter value if reviously set by setParameter, null otherwise */ XSLTProcessor.prototype.getParameter = function(nsURI, name){ - if(this.paramsSet[""+nsURI] && this.paramsSet[""+nsURI][name]) - return this.paramsSet[""+nsURI][name]; - else + nsURI = nsURI || ""; + if(this.paramsSet[nsURI] && this.paramsSet[nsURI][name]){ + return this.paramsSet[nsURI][name]; + }else{ return null; + }; }; -} -else{ /* end IE initialization, try to deal with real browsers now ;-) */ - if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){ - if(window.XMLDocument){ - /** - *

Emulate IE's onreadystatechange attribute

- */ - XMLDocument.prototype.onreadystatechange = null; - /** - *

Emulates IE's readyState property, which always gives an integer from 0 to 4:

- * - */ - XMLDocument.prototype.readyState = 0; - /** - *

Emulate IE's parseError attribute

- */ - XMLDocument.prototype.parseError = 0; - - // NOTE: setting async to false will only work with documents - // called over HTTP (meaning a server), not the local file system, - // unless you are using Moz 1.4+. - // BTW the try>catch block is for 1.4; I haven't found a way to check if - // the property is implemented without - // causing an error and I dont want to use user agent stuff for that... - var _SARISSA_SYNC_NON_IMPLEMENTED = false; - try{ - /** - *

Emulates IE's async property for Moz versions prior to 1.4. - * It controls whether loading of remote XML files works - * synchronously or asynchronously.

- */ - XMLDocument.prototype.async = true; - _SARISSA_SYNC_NON_IMPLEMENTED = true; - }catch(e){/* trap */}; - /** - *

Keeps a handle to the original load() method. Internal use and only - * if Mozilla version is lower than 1.4

- * @private - */ - XMLDocument.prototype._sarissa_load = XMLDocument.prototype.load; - - /** - *

Overrides the original load method to provide synchronous loading for - * Mozilla versions prior to 1.4, using an XMLHttpRequest object (if - * async is set to false)

- * @returns the DOM Object as it was before the load() call (may be empty) - */ - XMLDocument.prototype.load = function(sURI) { - var oDoc = document.implementation.createDocument("", "", null); - Sarissa.copyChildNodes(this, oDoc); - this.parseError = 0; - Sarissa.__setReadyState__(this, 1); - try { - if(this.async == false && _SARISSA_SYNC_NON_IMPLEMENTED) { - var tmp = new XMLHttpRequest(); - tmp.open("GET", sURI, false); - tmp.send(null); - Sarissa.__setReadyState__(this, 2); - Sarissa.copyChildNodes(tmp.responseXML, this); - Sarissa.__setReadyState__(this, 3); - } - else { - this._sarissa_load(sURI); - }; - } - catch (objException) { - this.parseError = -1; - } - finally { - if(this.async == false){ - Sarissa.__handleLoad__(this); - }; - }; - return oDoc; - }; - };//if(window.XMLDocument) - +}else{ /* end IE initialization, try to deal with real browsers now ;-) */ + if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){ /** *

Ensures the document was loaded correctly, otherwise sets the * parseError to -1 to indicate something went wrong. Internal use

* @private */ Sarissa.__handleLoad__ = function(oDoc){ - if (!oDoc.documentElement || oDoc.documentElement.tagName == "parsererror") - oDoc.parseError = -1; Sarissa.__setReadyState__(oDoc, 4); }; - /** *

Attached by an event handler to the load event. Internal use.

* @private @@ -317,7 +320,6 @@ _sarissa_XMLDocument_onload = function(){ Sarissa.__handleLoad__(this); }; - /** *

Sets the readyState property of the given DOM Document object. * Internal use.

@@ -328,80 +330,111 @@ */ Sarissa.__setReadyState__ = function(oDoc, iReadyState){ oDoc.readyState = iReadyState; + oDoc.readystate = iReadyState; if (oDoc.onreadystatechange != null && typeof oDoc.onreadystatechange == "function") oDoc.onreadystatechange(); }; - /** - *

Factory method to obtain a new DOM Document object

- * @argument sUri the namespace of the root node (if any) - * @argument sUri the local name of the root node (if any) - * @returns a new DOM Document - */ Sarissa.getDomDocument = function(sUri, sName){ - var oDoc = document.implementation.createDocument(sUri?sUri:"", sName?sName:"", null); + var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null); + if(!oDoc.onreadystatechange){ + + /** + *

Emulate IE's onreadystatechange attribute

+ */ + oDoc.onreadystatechange = null; + }; + if(!oDoc.readyState){ + /** + *

Emulates IE's readyState property, which always gives an integer from 0 to 4:

+ * + */ + oDoc.readyState = 0; + }; oDoc.addEventListener("load", _sarissa_XMLDocument_onload, false); return oDoc; - }; + }; + if(window.XMLDocument){ + + //if(window.XMLDocument) , now mainly for opera + }// TODO: check if the new document has content before trying to copynodes, check for error handling in DOM 3 LS + else if(_SARISSA_HAS_DOM_FEATURE && !Document.prototype.load && document.implementation.hasFeature('LS', '3.0')){ + //Opera 9 may get the XPath branch which gives creates XMLDocument, therefore it doesn't reach here which is good + /** + *

Factory method to obtain a new DOM Document object

+ * @argument sUri the namespace of the root node (if any) + * @argument sUri the local name of the root node (if any) + * @returns a new DOM Document + */ + Sarissa.getDomDocument = function(sUri, sName){ + var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null); + return oDoc; + }; + } + else { + Sarissa.getDomDocument = function(sUri, sName){ + var oDoc = document.implementation.createDocument(sUri?sUri:null, sName?sName:null, null); + // looks like safari does not create the root element for some unknown reason + if(oDoc && (sUri || sName) && !oDoc.documentElement){ + oDoc.appendChild(oDoc.createElementNS(sUri, sName)); + }; + return oDoc; + }; + }; };//if(_SARISSA_HAS_DOM_CREATE_DOCUMENT) }; //========================================== // Common stuff //========================================== if(!window.DOMParser){ - /** - * DOMParser is a utility class, used to construct DOMDocuments from XML strings - * @constructor - */ - DOMParser = function() { - }; - /** - * Construct a new DOM Document from the given XMLstring - * @param sXml the given XML string - * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml). - * @return a new DOM Document from the given XML string - */ - DOMParser.prototype.parseFromString = function(sXml, contentType){ - var doc = Sarissa.getDomDocument(); - doc.loadXML(sXml); - return doc; - }; - -}; - -if(window.XMLHttpRequest){ - Sarissa.IS_ENABLED_XMLHTTP = true; -} -else if(_SARISSA_IS_IE){ - /** - * Emulate XMLHttpRequest - * @constructor - */ - XMLHttpRequest = function() { - return new ActiveXObject(_SARISSA_XMLHTTP_PROGID); + if(_SARISSA_IS_SAFARI){ + /* + * DOMParser is a utility class, used to construct DOMDocuments from XML strings + * @constructor + */ + DOMParser = function() { }; + /** + * Construct a new DOM Document from the given XMLstring + * @param sXml the given XML string + * @param contentType the content type of the document the given string represents (one of text/xml, application/xml, application/xhtml+xml). + * @return a new DOM Document from the given XML string + */ + DOMParser.prototype.parseFromString = function(sXml, contentType){ + var xmlhttp = new XMLHttpRequest(); + xmlhttp.open("GET", "data:text/xml;charset=utf-8," + encodeURIComponent(sXml), false); + xmlhttp.send(null); + return xmlhttp.responseXML; + }; + }else if(Sarissa.getDomDocument && Sarissa.getDomDocument() && Sarissa.getDomDocument(null, "bar").xml){ + DOMParser = function() { }; + DOMParser.prototype.parseFromString = function(sXml, contentType){ + var doc = Sarissa.getDomDocument(); + doc.loadXML(sXml); + return doc; + }; }; - Sarissa.IS_ENABLED_XMLHTTP = true; }; -if(!window.document.importNode && _SARISSA_IS_IE){ +if(!document.importNode && _SARISSA_IS_IE){ try{ /** - * Implements importNode for the current window document in IE using innerHTML. - * Testing showed that DOM was multiple times slower than innerHTML for this, - * sorry folks. If you encounter trouble (who knows what IE does behind innerHTML) - * please gimme a call. + * Implementation of importNode for the context window document in IE * @param oNode the Node to import * @param bChildren whether to include the children of oNode * @returns the imported node for further use */ - window.document.importNode = function(oNode, bChildren){ - var importNode = document.createElement("div"); - if(bChildren) - importNode.innerHTML = Sarissa.serialize(oNode); - else - importNode.innerHTML = Sarissa.serialize(oNode.cloneNode(false)); - return importNode.firstChild; + document.importNode = function(oNode, bChildren){ + var tmp = document.createElement("div"); + if(bChildren){ + tmp.innerHTML = oNode.xml ? oNode.xml : oNode.innerHTML; + }else{ + tmp.innerHTML = oNode.xml ? oNode.cloneNode(false).xml : oNode.cloneNode(false).innerHTML; + }; + return tmp.getElementsByTagName("*")[0]; }; - }catch(e){}; + }catch(e){ }; }; if(!Sarissa.getParseErrorText){ /** @@ -415,17 +448,16 @@ */ Sarissa.getParseErrorText = function (oDoc){ var parseErrorText = Sarissa.PARSED_OK; - if(oDoc.parseError != 0){ - /*moz*/ - if(oDoc.documentElement.tagName == "parsererror"){ - parseErrorText = oDoc.documentElement.firstChild.data; - parseErrorText += "\n" + oDoc.documentElement.firstChild.nextSibling.firstChild.data; - }/*konq*/ - else if(oDoc.documentElement.tagName == "html"){ - parseErrorText = Sarissa.getText(oDoc.documentElement.getElementsByTagName("h1")[0], false) + "\n"; - parseErrorText += Sarissa.getText(oDoc.documentElement.getElementsByTagName("body")[0], false) + "\n"; - parseErrorText += Sarissa.getText(oDoc.documentElement.getElementsByTagName("pre")[0], false); - }; + if(!oDoc.documentElement){ + parseErrorText = Sarissa.PARSED_EMPTY; + } else if(oDoc.documentElement.tagName == "parsererror"){ + parseErrorText = oDoc.documentElement.firstChild.data; + parseErrorText += "\n" + oDoc.documentElement.firstChild.nextSibling.firstChild.data; + } else if(oDoc.getElementsByTagName("parsererror").length > 0){ + var parsererror = oDoc.getElementsByTagName("parsererror")[0]; + parseErrorText = Sarissa.getText(parsererror, true)+"\n"; + } else if(oDoc.parseError && oDoc.parseError.errorCode != 0){ + parseErrorText = Sarissa.PARSED_UNKNOWN_ERROR; }; return parseErrorText; }; @@ -438,8 +470,7 @@ var nodeType = node.nodeType; if(nodeType == Node.TEXT_NODE || nodeType == Node.CDATA_SECTION_NODE){ s += node.data; - } - else if(deep == true + } else if(deep == true && (nodeType == Node.ELEMENT_NODE || nodeType == Node.DOCUMENT_NODE || nodeType == Node.DOCUMENT_FRAGMENT_NODE)){ @@ -448,33 +479,20 @@ }; return s; }; -if(window.XMLSerializer){ +if(!window.XMLSerializer + && Sarissa.getDomDocument + && Sarissa.getDomDocument("","foo", null).xml){ /** - *

Factory method to obtain the serialization of a DOM Node

- * @returns the serialized Node as an XML string + * Utility class to serialize DOM Node objects to XML strings + * @constructor */ - Sarissa.serialize = function(oDoc){ - return (new XMLSerializer()).serializeToString(oDoc); - }; -}else{ - if((Sarissa.getDomDocument("","foo", null)).xml){ - // see non-IE version - Sarissa.serialize = function(oDoc) { - // TODO: check for HTML document and return innerHTML instead - return oDoc.xml; - }; - /** - * Utility class to serialize DOM Node objects to XML strings - * @constructor - */ - XMLSerializer = function(){}; - /** - * Serialize the given DOM Node to an XML string - * @param oNode the DOM Node to serialize - */ - XMLSerializer.prototype.serializeToString = function(oNode) { - return oNode.xml; - }; + XMLSerializer = function(){}; + /** + * Serialize the given DOM Node to an XML string + * @param oNode the DOM Node to serialize + */ + XMLSerializer.prototype.serializeToString = function(oNode) { + return oNode.xml; }; }; @@ -489,7 +507,8 @@ * @argument oNode the Node to empty */ Sarissa.clearChildNodes = function(oNode) { - while(oNode.hasChildNodes()){ + // need to check for firstChild due to opera 8 bug with hasChildNodes + while(oNode.firstChild) { oNode.removeChild(oNode.firstChild); }; }; @@ -502,17 +521,19 @@ * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is false */ Sarissa.copyChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { + if((!nodeFrom) || (!nodeTo)){ + throw "Both source and destination nodes must be provided"; + }; if(!bPreserveExisting){ Sarissa.clearChildNodes(nodeTo); }; var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument; var nodes = nodeFrom.childNodes; - if(ownerDoc.importNode && (!_SARISSA_IS_IE)) { + if(typeof(ownerDoc.importNode) != "undefined") { for(var i=0;i < nodes.length;i++) { nodeTo.appendChild(ownerDoc.importNode(nodes[i], true)); }; - } - else{ + } else { for(var i=0;i < nodes.length;i++) { nodeTo.appendChild(nodes[i].cloneNode(true)); }; @@ -525,32 +546,34 @@ * the move operation, unless you supply a true third parameter

* @argument nodeFrom the Node to copy the childNodes from * @argument nodeTo the Node to copy the childNodes to - * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is false - */ + * @argument bPreserveExisting whether to preserve the original content of nodeTo, default is + */ Sarissa.moveChildNodes = function(nodeFrom, nodeTo, bPreserveExisting) { + if((!nodeFrom) || (!nodeTo)){ + throw "Both source and destination nodes must be provided"; + }; if(!bPreserveExisting){ Sarissa.clearChildNodes(nodeTo); }; - var nodes = nodeFrom.childNodes; // if within the same doc, just move, else copy and delete if(nodeFrom.ownerDocument == nodeTo.ownerDocument){ - nodeTo.appendChild(nodes[i]); - }else{ + while(nodeFrom.firstChild){ + nodeTo.appendChild(nodeFrom.firstChild); + }; + } else { var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument; - if(ownerDoc.importNode && (!_SARISSA_IS_IE)) { - for(var i=0;i < nodes.length;i++) { - nodeTo.appendChild(ownerDoc.importNode(nodes[i], true)); - }; - } - else{ - for(var i=0;i < nodes.length;i++) { - nodeTo.appendChild(nodes[i].cloneNode(true)); - }; + if(ownerDoc.importNode) { + for(var i=0;i < nodes.length;i++) { + nodeTo.appendChild(ownerDoc.importNode(nodes[i], true)); + }; + }else{ + for(var i=0;i < nodes.length;i++) { + nodeTo.appendChild(nodes[i].cloneNode(true)); + }; }; Sarissa.clearChildNodes(nodeFrom); }; - }; /** Modified: kupu/trunk/kupu/common/sarissa_ieemu_xpath.js ============================================================================== --- kupu/trunk/kupu/common/sarissa_ieemu_xpath.js (original) +++ kupu/trunk/kupu/common/sarissa_ieemu_xpath.js Wed Nov 1 11:51:49 2006 @@ -1,19 +1,9 @@ -/***************************************************************************** - * - * Sarissa XML library version 0.9.6 - * Copyright (c) 2003 Manos Batsis, - * mailto: mbatsis at users full stop sourceforge full stop net - * This software is distributed under the Kupu License. See - * LICENSE.txt for license text. See the Sarissa homepage at - * http://sarissa.sourceforge.net for more information. - * - ***************************************************************************** - +/** * ==================================================================== * About * ==================================================================== * Sarissa cross browser XML library - IE XPath Emulation - * @version 0.9.6 + * @version @sarissa.version@ * @author: Manos Batsis, mailto: mbatsis at users full stop sourceforge full stop net * * This script emulates Internet Explorer's selectNodes and selectSingleNode @@ -22,9 +12,28 @@ * USers may also map a namespace prefix to a default (unprefixed) namespace in the * source document with Sarissa.setXpathNamespaces * + * + * ==================================================================== + * Licence + * ==================================================================== + * Sarissa is free software distributed under the GNU GPL version 2 (see gpl.txt) or higher, + * GNU LGPL version 2.1 (see lgpl.txt) or higher and Apache Software License 2.0 or higher + * (see asl.txt). This means you can choose one of the three and use that if you like. If + * you make modifications under the ASL, i would appreciate it if you submitted those. + * In case your copy of Sarissa does not include the license texts, you may find + * them online in various formats at http://www.gnu.org and + * http://www.apache.org. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE + * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ if(_SARISSA_HAS_DOM_FEATURE && document.implementation.hasFeature("XPath", "3.0")){ - var xmldoc = window.XMLDocument || window.Document; /** *

SarissaNodeList behaves as a NodeList but is only used as a result to selectNodes, * so it also has some properties IEs proprietery object features.

@@ -58,7 +67,9 @@ */ SarissaNodeList.prototype.expr = ""; /** dummy, used to accept IE's stuff without throwing errors */ - xmldoc.prototype.setProperty = function(x,y){}; + if(window.XMLDocument && (!XMLDocument.prototype.setProperty)){ + XMLDocument.prototype.setProperty = function(x,y){}; + }; /** *

Programmatically control namespace URI/prefix mappings for XPath * queries.

@@ -92,7 +103,7 @@ var ns = namespaces[i]; var colonPos = ns.indexOf(":"); var assignPos = ns.indexOf("="); - if(colonPos == 5 && assignPos > colonPos+2){ + if(colonPos > 0 && assignPos > colonPos+1){ var prefix = ns.substring(colonPos+1, assignPos); var uri = ns.substring(assignPos+2, ns.length-1); oDoc._sarissa_xpathNamespaces[prefix] = uri; @@ -105,9 +116,9 @@ * @private Flag to control whether a custom namespace resolver should * be used, set to true by Sarissa.setXpathNamespaces */ - xmldoc.prototype._sarissa_useCustomResolver = false; + XMLDocument.prototype._sarissa_useCustomResolver = false; /** @private */ - xmldoc.prototype._sarissa_xpathNamespaces = new Array(); + XMLDocument.prototype._sarissa_xpathNamespaces = new Array(); /** *

Extends the XMLDocument to emulate IE's selectNodes.

* @argument sExpr the XPath expression to use @@ -116,24 +127,34 @@ * @returns the result of the XPath search as a SarissaNodeList * @throws An error if no namespace URI is found for the given prefix. */ - xmldoc.prototype.selectNodes = function(sExpr, contextNode){ + XMLDocument.prototype.selectNodes = function(sExpr, contextNode, returnSingle){ var nsDoc = this; var nsresolver = this._sarissa_useCustomResolver - ? function(prefix){ + ? function(prefix){ var s = nsDoc._sarissa_xpathNamespaces[prefix]; if(s)return s; else throw "No namespace URI found for prefix: '" + prefix+"'"; - } + } : this.createNSResolver(this.documentElement); + var result = null; + if(!returnSingle){ var oResult = this.evaluate(sExpr, - (contextNode?contextNode:this), - nsresolver, - XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - var nodeList = new SarissaNodeList(oResult.snapshotLength); - nodeList.expr = sExpr; - for(var i=0;iExtends the Element to emulate IE's selectNodes

@@ -151,23 +172,18 @@ throw "Method selectNodes is only supported by XML Elements"; }; /** - *

Extends the XMLDocument to emulate IE's selectSingleNodes.

+ *

Extends the XMLDocument to emulate IE's selectSingleNode.

* @argument sExpr the XPath expression to use * @argument contextNode this is for internal use only by the same * method when called on Elements * @returns the result of the XPath search as an (Sarissa)NodeList */ - xmldoc.prototype.selectSingleNode = function(sExpr, contextNode){ + XMLDocument.prototype.selectSingleNode = function(sExpr, contextNode){ var ctx = contextNode?contextNode:null; - sExpr = "("+sExpr+")[1]"; - var nodeList = this.selectNodes(sExpr, ctx); - if(nodeList.length > 0) - return nodeList.item(0); - else - return null; + return this.selectNodes(sExpr, ctx, true); }; /** - *

Extends the Element to emulate IE's selectNodes.

+ *

Extends the Element to emulate IE's selectSingleNode.

* @argument sExpr the XPath expression to use * @returns the result of the XPath search as an (Sarissa)NodeList * @throws An error if invoked on an HTML Element as this is only be @@ -181,5 +197,4 @@ throw "Method selectNodes is only supported by XML Elements"; }; Sarissa.IS_ENABLED_SELECT_NODES = true; - xmldoc = undefined; -}; +}; \ No newline at end of file Modified: kupu/trunk/kupu/tests/run_tests.html ============================================================================== --- kupu/trunk/kupu/tests/run_tests.html (original) +++ kupu/trunk/kupu/tests/run_tests.html Wed Nov 1 11:51:49 2006 @@ -74,6 +74,27 @@ iframe.style.display = 'none'; }; + // Mark a specific test as failing under Opera. When Opera is + // fixed (or the test rewritten to cope with it) the flagged test + // will then fail. + function opera_is_broken(self, fname) { + var fn = self[fname]; + if (navigator.userAgent.toLowerCase().indexOf("opera") == -1) { + return; // Browser is not opera. + } + self.debug('Invert test '+fname+'for broken browser'); + function test() { + try { + fn.call(self); + } catch(e) { + // The function threw an exception, which is what we + // expect. + return + }; + self.assert(false, 'expected test '+fname+' to fail, but it passed!'); + }; + self[fname] = test; + } //]]> Modified: kupu/trunk/kupu/tests/test_kupubasetools.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupubasetools.js (original) +++ kupu/trunk/kupu/tests/test_kupubasetools.js Wed Nov 1 11:51:49 2006 @@ -71,11 +71,10 @@ this.selection.selection.removeAllRanges(); for(var i = 0; i < indices.length; i = i + 1) { - var range = document.createRange(); + var range = this.doc.createRange(); range.selectNode(cellNodes[indices[i]]); this.selection.selection.addRange(range); }; - this.assertEquals('"'+this.selection.toString().replace(/\r|\n/g, '')+'"', '"'+verificationString+'"'); }; @@ -268,7 +267,7 @@ data = '
foofoz
barbaz
'; expected = '

foo

foz

bar

baz
' if (!_SARISSA_IS_IE) { - this.body.innerHTML = data; + this.body.innerHTML = data; this._selectTableCells(new Array(0,2),'foo\tbar'); this.ui.setTextStyle('h1|te st'); this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); Modified: kupu/trunk/kupu/tests/test_kupueditor.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupueditor.js (original) +++ kupu/trunk/kupu/tests/test_kupueditor.js Wed Nov 1 11:51:49 2006 @@ -10,6 +10,13 @@ // $Id$ +function serializeDocument(d) { + return serializeNode(d.documentElement); +} +function serializeNode(n) { + var serializer = new XMLSerializer(); + return serializer.serializeToString(n); +} function KupuEditorTestCase() { this.name = 'KupuEditorTestCase'; @@ -21,7 +28,7 @@ var parser = new DOMParser(); var xmlstring = '

some link Even more

' var doc = parser.parseFromString(xmlstring, 'text/xml'); - this.assertEquals(Sarissa.serialize(doc).strip(),xmlstring); + this.assertEquals(serializeDocument(doc).strip(),xmlstring); var span = doc.documentElement.firstChild.firstChild.firstChild.firstChild; @@ -40,20 +47,20 @@ this.testRemoveNearestParentOfType = function() { var xmlstring = '

some link Even more

' var doc = (new DOMParser()).parseFromString(xmlstring, 'text/xml'); - this.assertEquals(Sarissa.serialize(doc).strip(), xmlstring); + this.assertEquals(serializeDocument(doc).strip(), xmlstring); var span = doc.documentElement.firstChild.firstChild.firstChild.firstChild; // first try to remove a parent we don't have; we expect the // xml not to change. this.editor.removeNearestParentOfType(span, 'br'); - this.assertEquals(Sarissa.serialize(doc).strip(), xmlstring); + this.assertEquals(serializeDocument(doc).strip(), xmlstring); // now remove a real parent; we expect it to be gone in the // resulting xml. this.editor.removeNearestParentOfType(span, 'a'); var expected = '

some link Even more

'; - this.assertEquals(Sarissa.serialize(doc).strip(), expected); + this.assertEquals(serializeDocument(doc).strip(), expected); }; this.test_serializeOutputToString = function() { Modified: kupu/trunk/kupu/tests/test_kupuhelpers.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupuhelpers.js (original) +++ kupu/trunk/kupu/tests/test_kupuhelpers.js Wed Nov 1 11:51:49 2006 @@ -27,18 +27,18 @@ // this does not skip invisible whitespace var node = element.firstChild; for (var i=0; i < element.childNodes.length; i++) { - if (node.nodeType == node.TEXT_NODE) { + if (node.nodeType == Node.TEXT_NODE) { var endcounts = !node.nextSibling && blockElements.contains(element.tagName.toUpperCase()); - if ((offset < node.length) || - ((offset == node.length) && (!lastnode || endcounts))) { + if ((offset < node.data.length) || + ((offset == node.data.length) && (!lastnode || endcounts))) { return [node, offset]; }; if (endcounts) { offset -= 1; }; - offset -= node.length; - } else if (node.nodeType == node.ELEMENT_NODE) { + offset -= node.data.length; + } else if (node.nodeType == Node.ELEMENT_NODE) { if (visibleEmptyElements.contains(node.tagName.toUpperCase())) { if (offset > 0 && !node.nextSibling) { offset -= 1; @@ -65,7 +65,7 @@ endNextNode, verificationString, ieskew, endskew) { var element = this.body; var innerSelection = this.selection.selection; - if (_SARISSA_IS_IE) { + if (innerSelection.createRange) { if (ieskew) { startOffset += ieskew; if (endskew) { @@ -83,13 +83,14 @@ range.setEndPoint('EndToStart', endrange); range.select(); } else { - var position = this._MozillaPosition(element, startOffset, - startNextNode); - innerSelection.collapse(position[0], position[1]); + var position = this._MozillaPosition(element, startOffset, startNextNode); + var epos = null; if (startOffset != endOffset) { - var position = this._MozillaPosition(element, endOffset, - endNextNode); - innerSelection.extend(position[0], position[1]); + var epos = this._MozillaPosition(element, endOffset, endNextNode); + } + innerSelection.collapse(position[0], position[1]); + if (epos) { + innerSelection.extend(epos[0], epos[1]); }; }; this.assertEquals('"'+this.selection.toString().replace(/(\r|\n|\t)+/g, '')+'"', @@ -99,6 +100,7 @@ this._cleanHtml = function(s) { s = s.toLowerCase().replace(/[\r\n]/g, ""); s = s.replace(/\>[ ]+\<"); + s = s.replace(/\/>/g, ">"); return s; }; @@ -207,14 +209,18 @@ KupuHelpersTestCase.prototype = new TestCase; function KupuSelectionTestCase() { - + this.cleanbody = function() { + var s = this.body.innerHTML.toLowerCase(); + s = s.replace(/]*)\/>/g, ''); + return s; + } this.testReplaceWithNode = function() { this.body.innerHTML = '

foo bar baz

'; // select |bar| this._setSelection(4, null, 7, null, 'bar'); node = this.doc.createElement('img'); this.selection.replaceWithNode(node, true); - this.assertEquals(this.body.innerHTML.toLowerCase(), '

foo baz

'); + this.assertEquals(this.cleanbody(), '

foo baz

'); }; this.testReplaceWithNodeTwice = function() { @@ -224,7 +230,7 @@ node = this.doc.createElement('img'); this.selection.replaceWithNode(node, true); this.selection.replaceWithNode(node, true); - this.assertEquals(this.body.innerHTML.toLowerCase(), '

foo baz

'); + this.assertEquals(this.cleanbody(), '

foo baz

'); }; this.testParentElementMissing = function() { @@ -237,9 +243,11 @@ }; this.testParentElementBold = function() { - this.body.innerHTML = '

foo bar baz

'; - // select |bar| - this._setSelection(4, true, 7, false, 'bar'); + this.body.innerHTML = '

foo xbar! baz

'; + // select |bar| + // kludged for opera which cannot do a selection involving the + // first character of the tag. + this._setSelection(5, true, 8, true, 'bar'); node = this.doc.getElementsByTagName('b')[0]; this.assertEquals(this.selection.parentElement(), node); }; @@ -272,7 +280,7 @@ this.testParentElement_r9516 = function() { this.body.innerHTML = '

foo bar

baz

'; // select |

baz| - this._setSelection(7, true, 12, false, 'baz'); + this._setSelection(6, true, 12, false, 'rbaz'); node = this.doc.getElementsByTagName('body')[0]; this.assertEquals(this.selection.parentElement(), node); }; @@ -288,7 +296,7 @@ this.body.innerHTML = '

foo bar baz

'; var selection = this.kupudoc.getSelection(); selection.selectNodeContents(this.body); - this.assertEquals(selection.toString(), 'foo bar baz'); + this.assertEquals('['+selection.toString()+']', '[foo bar baz]'); selection.selectNodeContents(this.body.firstChild.childNodes[1]); this.assertEquals(selection.toString(), 'bar'); }; Modified: kupu/trunk/kupu/tests/test_xhtml.js ============================================================================== --- kupu/trunk/kupu/tests/test_xhtml.js (original) +++ kupu/trunk/kupu/tests/test_xhtml.js Wed Nov 1 11:51:49 2006 @@ -18,14 +18,19 @@ this.incontext = function(s) { return 'test'+s+''; } + this.serializeNode = function(n) { + var serializer = new XMLSerializer(); + return serializer.serializeToString(n); + } this.verifyResult = function(newdoc, exp) { var expected = this.incontext(exp); - var actual = Sarissa.serialize(newdoc); + var actual = this.serializeNode(newdoc); actual = actual.replace('\xa0', ' '); + actual = actual.replace(/^]*>/, ''); if (actual == expected) return; - var context = /test<\/title><\/head><body>(.*)<\/body><\/html>/; + var context = /<html[^>]*><head><title>test<\/title><\/head><body>(.*)<\/body><\/html>/i; if (context.test(actual) && context.test(expected)) { var a = context.exec(actual)[1]; var e = context.exec(expected)[1]; From duncan at codespeak.net Thu Nov 2 18:54:42 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Thu, 2 Nov 2006 18:54:42 +0100 (CET) Subject: [kupu-checkins] r34071 - kupu/trunk/kupu/tests Message-ID: <20061102175442.7A04A1006E@code0.codespeak.net> Author: duncan Date: Thu Nov 2 18:54:36 2006 New Revision: 34071 Modified: kupu/trunk/kupu/tests/run_tests.html kupu/trunk/kupu/tests/test_kupubasetools.js kupu/trunk/kupu/tests/test_kupuhelpers.js kupu/trunk/kupu/tests/test_kupuinit.js kupu/trunk/kupu/tests/test_plone.js Log: Tests now give green bar on Firefox, IE and Opera, but in IE and Opera they warn that some tests have been bypassed (and will indicate failure if any of the bypassed tests pass). Modified: kupu/trunk/kupu/tests/run_tests.html ============================================================================== --- kupu/trunk/kupu/tests/run_tests.html (original) +++ kupu/trunk/kupu/tests/run_tests.html Thu Nov 2 18:54:36 2006 @@ -56,7 +56,8 @@ }; var body = getFromSelector('body'); - var testsuite = new TestSuite(new HTMLReporter(body, true)); + var reporter = new HTMLReporter(body, true); + var testsuite = new TestSuite(reporter); testsuite.registerTest(KupuHelpersTestCase); testsuite.registerTest(KupuEditorTestCase); testsuite.registerTest(KupuSelectionTestCase); @@ -72,8 +73,12 @@ iframe.contentWindow.document.designMode = 'off'; iframe.style.display = 'none'; + for (var i = 0; i < skipped_tests.length; i++) { + reporter.debug("Expected failure on "+skipped_tests[i]); + } }; + var skipped_tests = []; // Mark a specific test as failing under Opera. When Opera is // fixed (or the test rewritten to cope with it) the flagged test // will then fail. @@ -82,7 +87,27 @@ if (navigator.userAgent.toLowerCase().indexOf("opera") == -1) { return; // Browser is not opera. } - self.debug('Invert test '+fname+'for broken browser'); + //self.debug('Invert test '+fname+'for broken browser'); + function test() { + try { + fn.call(self); + } catch(e) { + // The function threw an exception, which is what we + // expect. + return + }; + self.assert(false, 'expected test '+fname+' to fail, but it passed!'); + }; + self[fname] = test; + skipped_tests.push(fname); + } + // To demonstrate fairness, mark a specific test as failing under IE. + function ie_is_broken(self, fname) { + var fn = self[fname]; + if (!_SARISSA_IS_IE) { + return; // Browser is not opera. + } + //self.debug('Invert test '+fname+'for broken browser'); function test() { try { fn.call(self); @@ -94,6 +119,7 @@ self.assert(false, 'expected test '+fname+' to fail, but it passed!'); }; self[fname] = test; + skipped_tests.push(fname); } //]]> </script> Modified: kupu/trunk/kupu/tests/test_kupubasetools.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupubasetools.js (original) +++ kupu/trunk/kupu/tests/test_kupubasetools.js Thu Nov 2 18:54:36 2006 @@ -129,6 +129,7 @@ this.updateStateTest('<p>foo</p><div class="other">baz</div>', 1, 7, 'oobaz', 0, "Mixed styles"); } + opera_is_broken(this, 'test_updateState7'); this.test_setTextStyle = function() { this.body.innerHTML = '<p>foo</p><p>bar</p><p>baz</p>'; @@ -213,6 +214,7 @@ this.ui.setTextStyle('td|te st'); this.assertEquals(this._cleanHtml(this.body.innerHTML), withcellstyle); }; + opera_is_broken(this, 'test_setTextStyle_ParaStyleThenCellStyle_SingleTableCell'); this.test_setTextStyle_TableHeaderThenParaStyle_SingleTableCell = function() { //Apply a table header style to a cell, then a paragraph style @@ -247,32 +249,34 @@ this.ui.setTextStyle('h1|te st'); this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); }; + opera_is_broken(this, 'test_setTextStyle_ParaStyle_AdjacentCells'); this.test_setTextStyle_SetCellStyle_Column = function() { //Apply a table cell (td) style, *with class*, on a column of cells -- //only available with Mozilla data = '<table><tbody><tr><td>foo</td><td>foz</td></tr><tr><td>bar</td><td>baz</td></tr></tbody></table>'; expected = '<table><tbody><tr><td class="te st">foo</td><td>foz</td></tr><tr><td class="te st">bar</td><td>baz</td></tr></tbody></table>' - if (!_SARISSA_IS_IE) { - this.body.innerHTML = data; - this._selectTableCells(new Array(0,2),'foo\tbar'); - this.ui.setTextStyle('td|te st'); - this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); - }; + + this.body.innerHTML = data; + this._selectTableCells(new Array(0,2),'foo\tbar'); + this.ui.setTextStyle('td|te st'); + this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); }; - + opera_is_broken(this, 'test_setTextStyle_SetCellStyle_Column'); + ie_is_broken(this, 'test_setTextStyle_SetCellStyle_Column'); + this.test_setTextStyle_ParaStyle_Column = function() { //Apply a paragraph style, *with class*, on a column of cells -- only //available with Mozilla data = '<table><tbody><tr><td>foo</td><td>foz</td></tr><tr><td>bar</td><td>baz</td></tr></tbody></table>'; expected = '<table><tbody><tr><td><h1 class="te st">foo</h1></td><td>foz</td></tr><tr><td><h1 class="te st">bar</h1></td><td>baz</td></tr></tbody></table>' - if (!_SARISSA_IS_IE) { - this.body.innerHTML = data; - this._selectTableCells(new Array(0,2),'foo\tbar'); - this.ui.setTextStyle('h1|te st'); - this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); - }; + this.body.innerHTML = data; + this._selectTableCells(new Array(0,2),'foo\tbar'); + this.ui.setTextStyle('h1|te st'); + this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); }; + opera_is_broken(this, 'test_setTextStyle_ParaStyle_Column'); + ie_is_broken(this, 'test_setTextStyle_ParaStyle_Column'); this.test_setTextStyleReplacingDiv = function() { this.body.innerHTML = '<p>foo</p><div>bar</div><p>baz</p>'; Modified: kupu/trunk/kupu/tests/test_kupuhelpers.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupuhelpers.js (original) +++ kupu/trunk/kupu/tests/test_kupuhelpers.js Thu Nov 2 18:54:36 2006 @@ -259,6 +259,7 @@ node = this.doc.getElementsByTagName('img')[0]; this.assertEquals(this.selection.parentElement(), node); }; + opera_is_broken(this, 'testParentElementImg'); this.testParentElementImgSpecial = function() { this.body.innerHTML = '<p>foo <a><img/></a></p>'; @@ -268,6 +269,7 @@ foo = this.selection.parentElement(); this.assertEquals(this.selection.parentElement(), node); }; + opera_is_broken(this, 'testParentElementImgSpecial'); this.testParentElementMixed = function() { this.body.innerHTML = '<p>foo <b>bar</b><img><img> baz</p>'; @@ -300,6 +302,7 @@ selection.selectNodeContents(this.body.firstChild.childNodes[1]); this.assertEquals(selection.toString(), 'bar'); }; + opera_is_broken(this, 'testToString'); }; KupuSelectionTestCase.prototype = new SelectionTestCase; Modified: kupu/trunk/kupu/tests/test_kupuinit.js ============================================================================== --- kupu/trunk/kupu/tests/test_kupuinit.js (original) +++ kupu/trunk/kupu/tests/test_kupuinit.js Thu Nov 2 18:54:36 2006 @@ -84,6 +84,7 @@ var boldchecker = this._makeBoldchecker(); this.assertEquals(boldchecker(selNode, null, this.editor), false); }; + opera_is_broken(this, 'testBoldcheckerMixed'); this.testBoldcheckerBoldLeftOuter = function() { this.body.innerHTML = '<p>foo <b>bar</b></p>'; @@ -93,6 +94,7 @@ var boldchecker = this._makeBoldchecker(); this.assertEquals(boldchecker(selNode, null, this.editor), true); }; + opera_is_broken(this, 'testBoldcheckerBoldLeftOuter'); this.testBoldcheckerBoldInner = function() { this.body.innerHTML = '<p>foo <b>bar</b></p>'; @@ -102,6 +104,7 @@ var boldchecker = this._makeBoldchecker(); this.assertEquals(boldchecker(selNode, null, this.editor), true); }; + opera_is_broken(this, 'testBoldcheckerBoldInner'); this.testBoldcheckerExecCommand = function() { this.body.innerHTML = '<p>foo bar</p>'; @@ -115,7 +118,6 @@ this.testBoldcheckerExecCommandCollapsed = function() { // XXX: the feature seems to work, but test is broken on IE - if (_SARISSA_IS_IE) return; this.body.innerHTML = '<p>foo bar</p>'; // select || this._setSelection(3, null, 3, null, ''); @@ -124,9 +126,10 @@ var boldchecker = this._makeBoldchecker(); this.assertEquals(boldchecker(selNode, null, this.editor), true); }; - + opera_is_broken(this, 'testBoldcheckerExecCommandCollapsed'); + ie_is_broken(this, 'testBoldcheckerExecCommandCollapsed'); + this.testBoldcheckerExecCommandNoCSS = function() { - if (_SARISSA_IS_IE) return; this.editor.getDocument().execCommand('styleWithCSS', null, false); this.body.innerHTML = '<p>foo bar</p>'; @@ -139,6 +142,7 @@ this.editor.getDocument().execCommand('styleWithCSS', null, true); }; + ie_is_broken(this, 'testBoldcheckerExecCommandNoCSS'); this.testBoldcheckerStrong = function() { this.body.innerHTML = '<p>foo <strong>bar</strong></p>'; @@ -158,6 +162,7 @@ var boldchecker = this._makeBoldchecker(); this.assertEquals(boldchecker(selNode, null, this.editor), true); }; + opera_is_broken(this, 'testBoldcheckerStyle'); this.testItalicscheckerItalics = function() { this.body.innerHTML = '<p>foo <i>bar</i></p>'; Modified: kupu/trunk/kupu/tests/test_plone.js ============================================================================== --- kupu/trunk/kupu/tests/test_plone.js (original) +++ kupu/trunk/kupu/tests/test_plone.js Thu Nov 2 18:54:36 2006 @@ -105,6 +105,7 @@ this.ui.setTextStyle('h2'); this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); } + opera_is_broken(this, 'testSetTextStyle'); this.testSetTextStyleTable = function() { var data = '<table><tbody><tr><td>test</td></tr></tbody></table>'; @@ -123,6 +124,7 @@ this.ui.setTextStyle('td'); this.assertEquals(this._cleanHtml(this.body.innerHTML), expected); } + opera_is_broken(this, 'testSetTextStyleTable'); this.testSetTextSpanStyle = function() { var data = '<p>some text</p><p>some more</p>'; From duncan at codespeak.net Fri Nov 3 11:29:48 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Fri, 3 Nov 2006 11:29:48 +0100 (CET) Subject: [kupu-checkins] r34088 - kupu/trunk/kupu/plone Message-ID: <20061103102948.7BD7B1006F@code0.codespeak.net> Author: duncan Date: Fri Nov 3 11:29:38 2006 New Revision: 34088 Modified: kupu/trunk/kupu/plone/plonedrawers.py Log: allowed_types_method on topic criteria should call the method on the criterion rather than the topic Modified: kupu/trunk/kupu/plone/plonedrawers.py ============================================================================== --- kupu/trunk/kupu/plone/plonedrawers.py (original) +++ kupu/trunk/kupu/plone/plonedrawers.py Fri Nov 3 11:29:38 2006 @@ -46,6 +46,7 @@ self.name = name self._tool = tool parts = name.split('.', 1) + self.subObject = None if len(parts)==1: self._portal_types = tool.queryPortalTypesForResourceType(name, ()) @@ -56,6 +57,7 @@ # Topic criteria have typename and fieldname embedded in # the criteria name. if fieldname.startswith('crit__'): + self.subObject = '_'.join(fieldname.split('_')[:-1]) typename, fieldname = fieldname.split('_')[-2:] __traceback_info__ = (parts, typename, fieldname) @@ -137,6 +139,8 @@ return None reference_tool = getToolByName(tool, 'reference_catalog') self._instance = reference_tool.lookupObject(UID) + if self.subObject: + return self._instance[self.subObject] return self._instance From duncan at codespeak.net Mon Nov 6 10:31:02 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 6 Nov 2006 10:31:02 +0100 (CET) Subject: [kupu-checkins] r34259 - kupu/branch/kupu-1.3/plone/kupu_plone_layer Message-ID: <20061106093102.782CF10080@code0.codespeak.net> Author: duncan Date: Mon Nov 6 10:31:00 2006 New Revision: 34259 Added: kupu/branch/kupu-1.3/plone/kupu_plone_layer/kupu_wysiwyg_support.html - copied unchanged from r34258, kupu/branch/plone-2.1/plone/kupu_plone_layer/kupu_wysiwyg_support.html Log: Copied generated file to the kupu-1.3 branch. '... practicality beats purity' From duncan at codespeak.net Mon Nov 6 11:14:32 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 6 Nov 2006 11:14:32 +0100 (CET) Subject: [kupu-checkins] r34260 - kupu/branch/kupu-1.3/common Message-ID: <20061106101432.06BCC10076@code0.codespeak.net> Author: duncan Date: Mon Nov 6 11:14:31 2006 New Revision: 34260 Modified: kupu/branch/kupu-1.3/common/kupudrawers.js kupu/branch/kupu-1.3/common/sarissa.js Log: Changes to sarissa.js to support IE7. Avoid security warnings on progids, make copyChildNodes work with IE7. Fix kupudrawers.js to not do importNodes when it doesn't have to. Modified: kupu/branch/kupu-1.3/common/kupudrawers.js ============================================================================== --- kupu/branch/kupu-1.3/common/kupudrawers.js (original) +++ kupu/branch/kupu-1.3/common/kupudrawers.js Mon Nov 6 11:14:31 2006 @@ -472,7 +472,6 @@ var doc = this._transformXml(); var sourcenode = doc.selectSingleNode('//*[@id="'+id+'"]'); var targetnode = document.getElementById(id); - sourcenode = document.importNode(sourcenode, true); Sarissa.copyChildNodes(sourcenode, targetnode); if (!this.focussed) { this.focusElement(); @@ -788,7 +787,7 @@ if (this.editor.getBrowserName() == 'IE') { resultlib = resultlib.cloneNode(true); } else { - this.shared.xmldata.importNode(resultlib, true); + resultlib = this.shared.xmldata.importNode(resultlib, true); } var libraries = this.shared.xmldata.selectSingleNode("/libraries"); libraries.appendChild(resultlib); Modified: kupu/branch/kupu-1.3/common/sarissa.js ============================================================================== --- kupu/branch/kupu-1.3/common/sarissa.js (original) +++ kupu/branch/kupu-1.3/common/sarissa.js Mon Nov 6 11:14:31 2006 @@ -74,7 +74,7 @@ * @param idList an array of MSXML PROGIDs from which the most recent will be picked for a given object * @param enabledList an array of arrays where each array has two items; the index of the PROGID for which a certain feature is enabled */ - pickRecentProgID = function (idList, enabledList){ + Sarissa.pickRecentProgID = function (idList, enabledList){ // found progID flag var bFound = false; for(var i=0; i < idList.length && !bFound; i++){ @@ -94,18 +94,14 @@ idList = null; return o2Store; }; - // pick best available MSXML progIDs - _SARISSA_DOM_PROGID = pickRecentProgID(["Msxml2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"], [["SELECT_NODES", 2],["TRANSFORM_NODE", 2]]); - _SARISSA_XMLHTTP_PROGID = pickRecentProgID(["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], [["XMLHTTP", 4]]); - _SARISSA_THREADEDDOM_PROGID = pickRecentProgID(["Msxml2.FreeThreadedDOMDocument.5.0", "MSXML2.FreeThreadedDOMDocument.4.0", "MSXML2.FreeThreadedDOMDocument.3.0"]); - _SARISSA_XSLTEMPLATE_PROGID = pickRecentProgID(["Msxml2.XSLTemplate.5.0", "Msxml2.XSLTemplate.4.0", "MSXML2.XSLTemplate.3.0"], [["XSLTPROC", 2]]); - // we dont need this anymore - pickRecentProgID = null; //============================================ // Factory methods (IE) //============================================ // see non-IE version Sarissa.getDomDocument = function(sUri, sName){ + if (!_SARISSA_DOM_PROGID) { + _SARISSA_DOM_PROGID = Sarissa.pickRecentProgID(["Msxml2.DOMDocument.4.0", "Msxml2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"], [["SELECT_NODES", 2],["TRANSFORM_NODE", 2]]); + }; var oDoc = new ActiveXObject(_SARISSA_DOM_PROGID); // if a root tag name was provided, we need to load it in the DOM // object @@ -150,6 +146,9 @@ * @constructor */ XSLTProcessor = function(){ + if (!_SARISSA_XSLTEMPLATE_PROGID) { + _SARISSA_XSLTEMPLATE_PROGID = Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.4.0", "MSXML2.XSLTemplate.3.0"], [["XSLTPROC", 2]]); + }; this.template = new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID); this.processor = null; }; @@ -159,6 +158,9 @@ */ XSLTProcessor.prototype.importStylesheet = function(xslDoc){ // convert stylesheet to free threaded + if (!_SARISSA_THREADEDDOM_PROGID) { + _SARISSA_THREADEDDOM_PROGID = Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.4.0", "MSXML2.FreeThreadedDOMDocument.3.0"]); + } var converted = new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); converted.loadXML(xslDoc.xml); this.template.stylesheet = converted; @@ -368,17 +370,19 @@ }; -if(window.XMLHttpRequest){ - Sarissa.IS_ENABLED_XMLHTTP = true; -} -else if(_SARISSA_IS_IE){ +if (!window.XMLHttpRequest && window.ActiveXObject) { /** * Emulate XMLHttpRequest * @constructor */ XMLHttpRequest = function() { + if(!_SARISSA_XMLHTTP_PROGID){ + _SARISSA_XMLHTTP_PROGID = Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]); + }; return new ActiveXObject(_SARISSA_XMLHTTP_PROGID); }; +} +if(window.XMLHttpRequest){ Sarissa.IS_ENABLED_XMLHTTP = true; }; @@ -507,7 +511,7 @@ }; var ownerDoc = nodeTo.nodeType == Node.DOCUMENT_NODE ? nodeTo : nodeTo.ownerDocument; var nodes = nodeFrom.childNodes; - if(ownerDoc.importNode && (!_SARISSA_IS_IE)) { + if(ownerDoc.importNode) { for(var i=0;i < nodes.length;i++) { nodeTo.appendChild(ownerDoc.importNode(nodes[i], true)); }; From duncan at codespeak.net Mon Nov 6 11:52:21 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 6 Nov 2006 11:52:21 +0100 (CET) Subject: [kupu-checkins] r34261 - kupu/branch/kupu-1.3/common Message-ID: <20061106105221.000A210075@code0.codespeak.net> Author: duncan Date: Mon Nov 6 11:52:20 2006 New Revision: 34261 Modified: kupu/branch/kupu-1.3/common/sarissa.js Log: Fix IE6 support. Modified: kupu/branch/kupu-1.3/common/sarissa.js ============================================================================== --- kupu/branch/kupu-1.3/common/sarissa.js (original) +++ kupu/branch/kupu-1.3/common/sarissa.js Mon Nov 6 11:52:20 2006 @@ -68,6 +68,8 @@ // used to store the most recent ProgID available out of the above var _SARISSA_DOM_PROGID = ""; var _SARISSA_XMLHTTP_PROGID = ""; + var _SARISSA_THREADEDDOM_PROGID = ""; + var _SARISSA_XSLTEMPLATE_PROGID = ""; /** * Called when the Sarissa_xx.js file is parsed, to pick most recent * ProgIDs for IE, then gets destroyed. From duncan at codespeak.net Mon Nov 6 15:28:33 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Mon, 6 Nov 2006 15:28:33 +0100 (CET) Subject: [kupu-checkins] r34265 - kupu/branch/kupu-1.3/common Message-ID: <20061106142833.312E410075@code0.codespeak.net> Author: duncan Date: Mon Nov 6 15:28:31 2006 New Revision: 34265 Modified: kupu/branch/kupu-1.3/common/kupubasetools.js Log: Fix for zoom sizes being slightly different in IE6/IE7. Modified: kupu/branch/kupu-1.3/common/kupubasetools.js ============================================================================== --- kupu/branch/kupu-1.3/common/kupubasetools.js (original) +++ kupu/branch/kupu-1.3/common/kupubasetools.js Mon Nov 6 15:28:31 2006 @@ -2543,8 +2543,12 @@ var width = window.innerWidth; var height = window.innerHeight; } else if (document.documentElement) { - var width = document.documentElement.offsetWidth-5; - var height = document.documentElement.offsetHeight-5; + if (!window._IE_VERSION) { + _IE_VERSION = /MSIE\s*([0-9.]*)/.exec(navigator.appVersion); + }; + var kludge = (_IE_VERSION[1]<7)?5:0; + var width = document.documentElement.offsetWidth-kludge; + var height = document.documentElement.offsetHeight-kludge; } else { var width = document.body.offsetWidth-5; var height = document.body.offsetHeight-5; From duncan at codespeak.net Tue Nov 7 11:10:50 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 11:10:50 +0100 (CET) Subject: [kupu-checkins] r34308 - in kupu/branch/kupu-1.3: common plone plone/kupu_plone_layer Message-ID: <20061107101050.DB8C310075@code0.codespeak.net> Author: duncan Date: Tue Nov 7 11:10:48 2006 New Revision: 34308 Modified: kupu/branch/kupu-1.3/common/kupubasetools.js kupu/branch/kupu-1.3/common/kupueditor.js kupu/branch/kupu-1.3/common/kupusourceedit.js kupu/branch/kupu-1.3/plone/body.kupu kupu/branch/kupu-1.3/plone/kupu_plone_layer/kupu_wysiwyg_support.html Log: Fixes to source edit for IE7: added a div round the iframe/textarea combination which stops the textarea being displaced horizontally, but which broke zoom mode. Fixed zoom mode to use the containing div position which coincidentally simplifies the code. Tidy up html a bit for source view mode. Modified: kupu/branch/kupu-1.3/common/kupubasetools.js ============================================================================== --- kupu/branch/kupu-1.3/common/kupubasetools.js (original) +++ kupu/branch/kupu-1.3/common/kupubasetools.js Tue Nov 7 11:10:48 2006 @@ -2554,10 +2554,8 @@ var height = document.body.offsetHeight-5; } width = width + 'px'; - var offset = iframe.offsetTop; - if (sourceArea && sourceArea.offsetTop) offset = sourceArea.offsetTop-1; - var nheight = Math.max(height - offset -1/*top border*/, 10); - nheight = nheight + 'px'; + var offset = iframe.parentNode.offsetTop; + var nheight = Math.max(height - offset -1/*top border*/, 10) + 'px'; fulleditor.style.width = width; /*IE needs this*/ iframe.style.width = width; iframe.style.height = nheight; Modified: kupu/branch/kupu-1.3/common/kupueditor.js ============================================================================== --- kupu/branch/kupu-1.3/common/kupueditor.js (original) +++ kupu/branch/kupu-1.3/common/kupueditor.js Tue Nov 7 11:10:48 2006 @@ -618,7 +618,7 @@ for (var i = 0; i < bodies.length; i++) { data += Sarissa.serialize(bodies[i]); } - return this.escapeEntities(data); + return this.layoutsource(this.escapeEntities(data)); }; this.getHTMLBody = function() { @@ -629,7 +629,7 @@ for (var i = 0; i < bodies.length; i++) { data += bodies[i].innerHTML; } - return this.escapeEntities(data); + return this.layoutsource(this.escapeEntities(data)); }; // If we have multiple bodies this needs to remove the extras. @@ -747,6 +747,13 @@ return contents; }; + this.layoutsource = function(data) { + data = data.replace( + /\s*(<(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td))\b/ig, '\n$1'); + data = data.replace( + /\s*(<\/(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td)>)\s*/ig, '$1\n'); + return data.strip(); + } this.escapeEntities = function(xml) { // XXX: temporarily disabled return xml; Modified: kupu/branch/kupu-1.3/common/kupusourceedit.js ============================================================================== --- kupu/branch/kupu-1.3/common/kupusourceedit.js (original) +++ kupu/branch/kupu-1.3/common/kupusourceedit.js Tue Nov 7 11:10:48 2006 @@ -75,7 +75,7 @@ } else { data = kupu.getHTMLBody(); }; - sourcearea.value = data; + sourcearea.value = data.strip(); kupu.setClass(sourceClass); editorframe.style.display = 'none'; sourcearea.style.display = 'block'; Modified: kupu/branch/kupu-1.3/plone/body.kupu ============================================================================== --- kupu/branch/kupu-1.3/plone/body.kupu (original) +++ kupu/branch/kupu-1.3/plone/body.kupu Tue Nov 7 11:10:48 2006 @@ -7,6 +7,7 @@ xmlns:i18n="http://xml.zope.org/namespaces/i18n"> <kupu:id>$Id$</kupu:id> <kupu:part name="editorframe"><script type="text/javascript">var focuscount = 0;</script> + <div> <iframe class="kupu-editor-iframe" frameborder="0" src="emptypage" @@ -63,6 +64,7 @@ rows rows|default; cols cols|default;"> </textarea> + </div> </kupu:part> <kupu:part name="suppress-kupu"> Modified: kupu/branch/kupu-1.3/plone/kupu_plone_layer/kupu_wysiwyg_support.html ============================================================================== --- kupu/branch/kupu-1.3/plone/kupu_plone_layer/kupu_wysiwyg_support.html (original) +++ kupu/branch/kupu-1.3/plone/kupu_plone_layer/kupu_wysiwyg_support.html Tue Nov 7 11:10:48 2006 @@ -11,7 +11,7 @@ <!--$Id: sourceedit.kupu 25716 2006-04-12 10:07:19Z fschulze $--> <!--$Id: sourceedit.kupu 9779 2005-03-15 11:34:47Z duncan $--> <!--$Id: contextmenu.kupu 9520 2005-02-26 16:30:23Z duncan $--> - <!--$Id: toolbar.kupu 27291 2006-05-16 17:15:27Z fschulze $--> + <!--$Id: toolbar.kupu 31005 2006-08-04 14:29:57Z duncan $--> <!--$Id: toolboxes.kupu 16467 2005-08-25 11:08:10Z guido $--> <!--$Id: colorchooser.kupu 9520 2005-02-26 16:30:23Z duncan $--> <!--$Id: save.kupu 9520 2005-02-26 16:30:23Z duncan $--> @@ -19,8 +19,8 @@ <!--$Id: include.kupu 9520 2005-02-26 16:30:23Z duncan $--> <!--$Id: wire.kupu 23401 2006-02-16 13:47:33Z limi $--> <!--$Id: head.kupu 21720 2006-01-05 15:59:25Z paul $--> - <!--$Id: xmlconfig.kupu 30986 2006-08-04 11:38:46Z duncan $--> - <!--$Id: body.kupu 27715 2006-05-26 10:35:22Z duncan $--> + <!--$Id: xmlconfig.kupu 31003 2006-08-04 14:19:13Z duncan $--> + <!--$Id: body.kupu 31003 2006-08-04 14:19:13Z duncan $--> <!--$Id: toolbar.kupu 25716 2006-04-12 10:07:19Z fschulze $--> <!--$Id: drawers.kupu 14546 2005-07-12 14:35:55Z duncan $--> <!--$Id: beforeunload.kupu 14546 2005-07-12 14:35:55Z duncan $--> @@ -349,6 +349,7 @@ </div> <script type="text/javascript">var focuscount = 0;</script> + <div> <iframe class="kupu-editor-iframe" frameborder="0" src="emptypage" onfocus="this.contentWindow.focus();" tal:define=" base here/absolute_url; posfactory python:base.find('/portal_factory/'); base python:posfactory > 0 and base[:posfactory+15] or base; base kupu_base_override|base;" tal:attributes="src string:${base}/emptypage; tabindex tabindex/next|nothing;"> </iframe> <input type="hidden" name="text_format:default" value="text/html" tal:define="fieldName fieldName|inputname|nothing; val python:fieldName and 'text/html' or 'html'; fieldName python:test(fieldName, fieldName+'_', '') + 'text_format:default';" tal:attributes="name fieldName;value val;"/> @@ -358,6 +359,7 @@ </tal:test> <textarea cols="80" rows="25" tabindex="" class="kupu-editor-textarea" name="description" id="kupu-editor-textarea" tal:define="pss modules/Products/PythonScripts/standard; text_format python: getattr(here,'text_format','html'); is_stx python:text_format=='structured-text'; is_ptx python:text_format=='plain';" tal:condition="not:fieldName|nothing" tal:content="python:(is_stx and pss.structured_text(inputvalue)) or (is_ptx and pss.newline_to_br(inputvalue)) or inputvalue" tal:attributes="name inputname; onfocus onfocus|nothing; onblur onblur|nothing; tabindex tabindex|nothing; rows rows|default; cols cols|default;"> </textarea> + </div> <div class="kupuoverride" tal:condition="python:exists('kupu_content') and len(kupu_content)==0" tal:define="floated widget/allow_file_upload | python:1;" tal:attributes="style python:test(floated, 'float:left;;', '');"><span class="discreet"><a class="forcekupu" href="#" i18n:translate="suppress-kupu" tal:attributes="href string:${request/URL0}?kupu.suppress=${fieldName};" title="reload current page without kupu"> Edit without visual editor From duncan at codespeak.net Tue Nov 7 11:19:32 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 11:19:32 +0100 (CET) Subject: [kupu-checkins] r34309 - kupu/branch/kupu-1.3/plone Message-ID: <20061107101932.04EF210075@code0.codespeak.net> Author: duncan Date: Tue Nov 7 11:19:31 2006 New Revision: 34309 Modified: kupu/branch/kupu-1.3/plone/plonelibrarytool.py Log: Fix the duplicated resource bug. Modified: kupu/branch/kupu-1.3/plone/plonelibrarytool.py ============================================================================== --- kupu/branch/kupu-1.3/plone/plonelibrarytool.py (original) +++ kupu/branch/kupu-1.3/plone/plonelibrarytool.py Tue Nov 7 11:19:31 2006 @@ -104,9 +104,10 @@ # We load default values here, so __init__ can still be used # in unit tests. Plus, it only makes sense to load these if # we're being added to a Plone site anyway - for lib in _default_libraries: - self.addLibrary(**lib) - self._res_types.update(_default_resource_types) + if not len(self._libraries): + for lib in _default_libraries: + self.addLibrary(**lib) + self._res_types.update(_default_resource_types) security.declareProtected('View', "getLinkbyuid") def getLinkbyuid(self): From duncan at codespeak.net Tue Nov 7 11:22:00 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 11:22:00 +0100 (CET) Subject: [kupu-checkins] r34310 - in kupu/branch/kupu-1.3: . default doc Message-ID: <20061107102200.1755D10075@code0.codespeak.net> Author: duncan Date: Tue Nov 7 11:21:58 2006 New Revision: 34310 Modified: kupu/branch/kupu-1.3/default/toolbar.kupu kupu/branch/kupu-1.3/doc/CHANGES.txt kupu/branch/kupu-1.3/version.txt Log: Updated CHANGES.txt, bumped version number. Modified: kupu/branch/kupu-1.3/default/toolbar.kupu ============================================================================== --- kupu/branch/kupu-1.3/default/toolbar.kupu (original) +++ kupu/branch/kupu-1.3/default/toolbar.kupu Tue Nov 7 11:21:58 2006 @@ -52,7 +52,7 @@ <kupu:part name="logo"> <span class="kupu-tb-buttongroup kupu-logo" style="float: right" id="kupu-logo"> - <button type="button" class="kupu-logo" title="Kupu 1.3.8 (SVN/Unreleased)" + <button type="button" class="kupu-logo" title="Kupu 1.3.9" i18n:attributes="title" accesskey="k" onclick="window.open('http://kupu.oscom.org');"> </button> </span> Modified: kupu/branch/kupu-1.3/doc/CHANGES.txt ============================================================================== --- kupu/branch/kupu-1.3/doc/CHANGES.txt (original) +++ kupu/branch/kupu-1.3/doc/CHANGES.txt Tue Nov 7 11:21:58 2006 @@ -2,6 +2,13 @@ Kupu changes ============ +- 1.3.9 + + - Fixes for IE7 compatability. + + - Fixed the duplicate resources bug (so resources won't be duplicated + on reinstall any more). + - 1.3.8 - HTML view now does filtering by default in Plone (can be turned Modified: kupu/branch/kupu-1.3/version.txt ============================================================================== --- kupu/branch/kupu-1.3/version.txt (original) +++ kupu/branch/kupu-1.3/version.txt Tue Nov 7 11:21:58 2006 @@ -1 +1 @@ -kupu 1.3.8 (SVN/Unreleased) +kupu 1.3.9 From duncan at codespeak.net Tue Nov 7 12:18:26 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 12:18:26 +0100 (CET) Subject: [kupu-checkins] r34311 - in kupu/trunk/kupu: common plone plone/kupu_plone_layer Message-ID: <20061107111826.45DFD10075@code0.codespeak.net> Author: duncan Date: Tue Nov 7 12:18:23 2006 New Revision: 34311 Modified: kupu/trunk/kupu/common/kupubasetools.js kupu/trunk/kupu/common/kupudrawers.js kupu/trunk/kupu/common/kupueditor.js kupu/trunk/kupu/common/kupusourceedit.js kupu/trunk/kupu/common/sarissa.js kupu/trunk/kupu/plone/body.kupu kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/trunk/kupu/plone/plonedrawers.py Log: Fixes for IE7 compatibility. Modified: kupu/trunk/kupu/common/kupubasetools.js ============================================================================== --- kupu/trunk/kupu/common/kupubasetools.js (original) +++ kupu/trunk/kupu/common/kupubasetools.js Tue Nov 7 12:18:23 2006 @@ -2707,17 +2707,19 @@ var width = window.innerWidth; var height = window.innerHeight; } else if (document.documentElement) { - var width = document.documentElement.offsetWidth-5; - var height = document.documentElement.offsetHeight-5; + if (!window._IE_VERSION) { + _IE_VERSION = /MSIE\s*([0-9.]*)/.exec(navigator.appVersion); + }; + var kludge = (_IE_VERSION[1]<7)?5:0; + var width = document.documentElement.offsetWidth-kludge; + var height = document.documentElement.offsetHeight-kludge; } else { var width = document.body.offsetWidth-5; var height = document.body.offsetHeight-5; } width = width + 'px'; - var offset = iframe.offsetTop; - if (sourceArea && sourceArea.offsetTop) offset = sourceArea.offsetTop-1; - var nheight = Math.max(height - offset -1/*top border*/, 10); - nheight = nheight + 'px'; + var offset = iframe.parentNode.offsetTop; + var nheight = Math.max(height - offset -1/*top border*/, 10) + 'px'; fulleditor.style.width = width; /*IE needs this*/ iframe.style.width = width; iframe.style.height = nheight; Modified: kupu/trunk/kupu/common/kupudrawers.js ============================================================================== --- kupu/trunk/kupu/common/kupudrawers.js (original) +++ kupu/trunk/kupu/common/kupudrawers.js Tue Nov 7 12:18:23 2006 @@ -674,7 +674,6 @@ var targetnode = document.getElementById(id); if (!sourcenode || !targetnode) return; - sourcenode = document.importNode(sourcenode, true); Sarissa.copyChildNodes(sourcenode, targetnode); if (!this.focussed) { this.focusElement(); Modified: kupu/trunk/kupu/common/kupueditor.js ============================================================================== --- kupu/trunk/kupu/common/kupueditor.js (original) +++ kupu/trunk/kupu/common/kupueditor.js Tue Nov 7 12:18:23 2006 @@ -627,7 +627,7 @@ for (var i = 0; i < bodies.length; i++) { data += this.serializer.serializeToString(bodies[i]); } - return this.escapeEntities(data); + return this.layoutsource(this.escapeEntities(data)); }; this.getHTMLBody = function() { @@ -638,7 +638,7 @@ for (var i = 0; i < bodies.length; i++) { data += bodies[i].innerHTML; } - return this.escapeEntities(data); + return this.layoutsource(this.escapeEntities(data)); }; // If we have multiple bodies this needs to remove the extras. @@ -765,6 +765,13 @@ return contents; }; + this.layoutsource = function(data) { + data = data.replace( + /\s*(<(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td))\b/ig, '\n$1'); + data = data.replace( + /\s*(<\/(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td)>)\s*/ig, '$1\n'); + return data.strip(); + } this.escapeEntities = function(xml) { // XXX: temporarily disabled return xml; Modified: kupu/trunk/kupu/common/kupusourceedit.js ============================================================================== --- kupu/trunk/kupu/common/kupusourceedit.js (original) +++ kupu/trunk/kupu/common/kupusourceedit.js Tue Nov 7 12:18:23 2006 @@ -75,9 +75,7 @@ } else { data = kupu.getHTMLBody(); } - data = data.replace( - /\s*(<(p|div|h.|ul|ol|dl|menu|dir|pre|blockquote|address|center|table|thead|tbody|tfoot|tr|th|td))\b/g, '\n$1').strip(); - sourcearea.value = data; + sourcearea.value = data.strip(); kupu.setClass(sourceClass); editorframe.style.display = 'none'; sourcearea.style.display = 'block'; Modified: kupu/trunk/kupu/common/sarissa.js ============================================================================== --- kupu/trunk/kupu/common/sarissa.js (original) +++ kupu/trunk/kupu/common/sarissa.js Tue Nov 7 12:18:23 2006 @@ -428,9 +428,9 @@ document.importNode = function(oNode, bChildren){ var tmp = document.createElement("div"); if(bChildren){ - tmp.innerHTML = oNode.xml ? oNode.xml : oNode.innerHTML; + tmp.innerHTML = oNode.xml ? oNode.xml : oNode.outerHTML; }else{ - tmp.innerHTML = oNode.xml ? oNode.cloneNode(false).xml : oNode.cloneNode(false).innerHTML; + tmp.innerHTML = oNode.xml ? oNode.cloneNode(false).xml : oNode.cloneNode(false).outerHTML; }; return tmp.getElementsByTagName("*")[0]; }; Modified: kupu/trunk/kupu/plone/body.kupu ============================================================================== --- kupu/trunk/kupu/plone/body.kupu (original) +++ kupu/trunk/kupu/plone/body.kupu Tue Nov 7 12:18:23 2006 @@ -7,6 +7,7 @@ xmlns:i18n="http://xml.zope.org/namespaces/i18n"> <kupu:id>$Id$</kupu:id> <kupu:part name="editorframe"><script type="text/javascript">var focuscount = 0;</script> + <div> <iframe class="kupu-editor-iframe" frameborder="0" src="emptypage" @@ -60,6 +61,7 @@ rows rows|default; cols cols|default;"> </textarea> + </div> </kupu:part> <kupu:part name="suppress-kupu"> 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 Nov 7 12:18:23 2006 @@ -416,6 +416,7 @@ </div> <script type="text/javascript">var focuscount = 0;</script> + <div> <iframe class="kupu-editor-iframe" frameborder="0" src="emptypage" onfocus="this.contentWindow.focus();" tal:define="base python:here.kupu_library_tool.getBaseUrl(here, True); base kupu_base_override|base;" tal:attributes="src string:${base}/emptypage; tabindex tabindex/next|nothing;"> </iframe> <input type="hidden" name="text_format:default" value="text/html" tal:define="fieldName fieldName|inputname|nothing; val python:fieldName and 'text/html' or 'html'; fieldName python:test(fieldName, fieldName+'_', '') + 'text_format:default';" tal:attributes="name fieldName;value val;"/> @@ -425,6 +426,7 @@ </tal:test> <textarea cols="80" rows="25" tabindex="" class="kupu-editor-textarea" name="description" id="kupu-editor-textarea" tal:define="pss modules/Products/PythonScripts/standard; text_format python: getattr(here,'text_format','html'); is_stx python:text_format=='structured-text'; is_ptx python:text_format=='plain';" tal:condition="not:fieldName|nothing" tal:content="python:(is_stx and pss.structured_text(inputvalue)) or (is_ptx and pss.newline_to_br(inputvalue)) or inputvalue" tal:attributes="name inputname; onfocus onfocus|nothing; onblur onblur|nothing; tabindex tabindex|nothing; rows rows|default; cols cols|default;"> </textarea> + </div> <div class="kupuoverride" tal:condition="python:exists('kupu_content') and len(kupu_content)==0" tal:define="floated widget/allow_file_upload | python:1;" tal:attributes="style python:test(floated, 'float:left;;', '');"><span class="discreet"><a class="forcekupu" href="#" i18n:translate="suppress-kupu" tal:attributes="href string:${request/URL0}?kupu.suppress=${fieldName};" title="reload current page without kupu"> Edit without visual editor Modified: kupu/trunk/kupu/plone/plonedrawers.py ============================================================================== --- kupu/trunk/kupu/plone/plonedrawers.py (original) +++ kupu/trunk/kupu/plone/plonedrawers.py Tue Nov 7 12:18:23 2006 @@ -232,7 +232,11 @@ if not callable(obj.getId): if getattr(obj, 'getObject', None) is None: return - obj = obj.getObject() + try: + obj = obj.getObject() + except: + return + if getattr(obj, 'getField', None) is None: return image_field = obj.getWrappedField(imagefield) From duncan at codespeak.net Tue Nov 7 12:25:56 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 12:25:56 +0100 (CET) Subject: [kupu-checkins] r34312 - kupu/trunk/ecmaunit Message-ID: <20061107112556.D3DCD10075@code0.codespeak.net> Author: duncan Date: Tue Nov 7 12:25:55 2006 New Revision: 34312 Modified: kupu/trunk/ecmaunit/ecmaunit.js Log: Make debug method accept multiple arguments. Decode DOMException codes so that Opera's errors become somewhat less obscure. Modified: kupu/trunk/ecmaunit/ecmaunit.js ============================================================================== --- kupu/trunk/ecmaunit/ecmaunit.js (original) +++ kupu/trunk/ecmaunit/ecmaunit.js Tue Nov 7 12:25:55 2006 @@ -72,7 +72,11 @@ }; TestCase.prototype.debug = function(msg) { - this._reporter.debug(msg); + var args = []; + for (var i=0; i < arguments.length; i++) { + args.push(arguments[i]); + }; + this._reporter.debug(args.join(', ')); } TestCase.prototype.assert = function(statement, message) { /* assert whether a variable resolves to true */ @@ -171,6 +175,25 @@ if (e && e.name && e.message) { // Microsoft e = e.name + ': ' + e.message; } + if (e.code && /.*DOMException/i.test(e.toString())) { + var msg = ['', 'INDEX_SIZE_ERR', + 'DOMSTRING_SIZE_ERR', + 'HIERARCHY_REQUEST_ERR', + 'WRONG_DOCUMENT_ERR', + 'INVALID_CHARACTER_ERR', + 'NO_DATA_ALLOWED_ERR', + 'NO_MODIFICATION_ALLOWED_ERR', + 'NOT_FOUND_ERR', + 'NOT_SUPPORTED_ERR', + 'INUSE_ATTRIBUTE_ERR', + 'INVALID_STATE_ERR', + 'SYNTAX_ERR', + 'INVALID_MODIFICATION_ERR', + 'NAMESPACE_ERR', + 'INVALID_ACCESS_ERR', + ][e.code]; + e = "DOMException:" + e.code + ", "+msg; + } this._reporter.reportError(this.name, attr, e, raw); this._exceptions.push(new Array(this.name, attr, e, raw)); }; From duncan at codespeak.net Tue Nov 7 14:45:11 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 14:45:11 +0100 (CET) Subject: [kupu-checkins] r34325 - in kupu/trunk/kupu/plone: . tests tests/input tests/output Message-ID: <20061107134511.6887110071@code0.codespeak.net> Author: duncan Date: Tue Nov 7 14:45:09 2006 New Revision: 34325 Modified: kupu/trunk/kupu/plone/html2captioned.py kupu/trunk/kupu/plone/tests/input/simple.in kupu/trunk/kupu/plone/tests/output/simple.out kupu/trunk/kupu/plone/tests/runme.cmd Log: Transform wasn't converting back urls where the uid wasn't in the last element. Modified: kupu/trunk/kupu/plone/html2captioned.py ============================================================================== --- kupu/trunk/kupu/plone/html2captioned.py (original) +++ kupu/trunk/kupu/plone/html2captioned.py Tue Nov 7 14:45:09 2006 @@ -59,7 +59,7 @@ </div> ''' -UID_PATTERN = re.compile('(?P<tag><(?:a|img) [^>]*(?:src|href)=")(?P<url>[^"]*resolveuid/(?P<uid>[^"#? ]*))') +UID_PATTERN = re.compile('(?P<tag><(?:a|img) [^>]*(?:src|href)=")(?P<url>[^"]*resolveuid/(?P<uid>[^/"#? ]*))') class HTMLToCaptioned: """Transform which adds captions to images embedded in HTML""" Modified: kupu/trunk/kupu/plone/tests/input/simple.in ============================================================================== --- kupu/trunk/kupu/plone/tests/input/simple.in (original) +++ kupu/trunk/kupu/plone/tests/input/simple.in Tue Nov 7 14:45:09 2006 @@ -1,2 +1,3 @@ <div>Simple text containing an embedded image</div> <p><img class="image-left captioned" height="144" alt="picture alt text" src="resolveuid/104ede98d4c7c8eaeaa3b984f7395979" width="120"/></p> +<p><img class="image-left captioned" height="144" alt="picture alt text" src="resolveuid/104ede98d4c7c8eaeaa3b984f7395979/image_thumb" width="120"/></p> Modified: kupu/trunk/kupu/plone/tests/output/simple.out ============================================================================== --- kupu/trunk/kupu/plone/tests/output/simple.out (original) +++ kupu/trunk/kupu/plone/tests/output/simple.out Tue Nov 7 14:45:09 2006 @@ -4,3 +4,8 @@ </div> <div class="image-caption">Test image caption</div> </div> +<div class="image-left captioned" style="width:120px;"> + <div style="width:120px;"><img height="144" src="[url for 104ede98d4c7c8eaeaa3b984f7395979]/image_thumb" width="120" alt="image 104ede98d4c7c8eaeaa3b984f7395979"/> + </div> + <div class="image-caption">Test image caption</div> +</div> Modified: kupu/trunk/kupu/plone/tests/runme.cmd ============================================================================== --- kupu/trunk/kupu/plone/tests/runme.cmd (original) +++ kupu/trunk/kupu/plone/tests/runme.cmd Tue Nov 7 14:45:09 2006 @@ -8,10 +8,10 @@ set INSTANCE_HOME=%PLONEHOME%\Data set SOFTWARE_HOME=%PLONEHOME%\Zope\lib\python @set PYTHON=C:\Plone20\Zope\bin\python.exe -"%PYTHON%" %~D0%~P0test_browserSupportsKupu.py %2 +rem "%PYTHON%" %~D0%~P0test_browserSupportsKupu.py %2 rem "%PYTHON%" %~D0%~P0test_librarymanager.py rem "%PYTHON%" %~D0%~P0test_html2captioned.py rem "%PYTHON%" %~D0%~P0test_resourcetypemapper.py rem "%PYTHON%" %~D0%~P0test_urls.py -rem "%PYTHON%" "%~D0%~P0runalltests.py" %2 +"%PYTHON%" "%~D0%~P0runalltests.py" %2 endlocal From duncan at codespeak.net Tue Nov 7 14:46:49 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 14:46:49 +0100 (CET) Subject: [kupu-checkins] r34326 - kupu/branch/kupu-1.3/plone Message-ID: <20061107134649.04B4910071@code0.codespeak.net> Author: duncan Date: Tue Nov 7 14:46:48 2006 New Revision: 34326 Modified: kupu/branch/kupu-1.3/plone/html2captioned.py Log: Transform wasn't converting back urls where the uid wasn't in the last element. Modified: kupu/branch/kupu-1.3/plone/html2captioned.py ============================================================================== --- kupu/branch/kupu-1.3/plone/html2captioned.py (original) +++ kupu/branch/kupu-1.3/plone/html2captioned.py Tue Nov 7 14:46:48 2006 @@ -52,7 +52,7 @@ </div> ''' -UID_PATTERN = re.compile('(?P<tag><(?:a|img) [^>]*(?:src|href)=")(?P<url>[^"]*resolveuid/(?P<uid>[^"#? ]*))') +UID_PATTERN = re.compile('(?P<tag><(?:a|img) [^>]*(?:src|href)=")(?P<url>[^"]*resolveuid/(?P<uid>[^/"#? ]*))') class HTMLToCaptioned: """Transform which adds captions to images embedded in HTML""" From manos_lists at geekologue.com Tue Nov 7 15:24:38 2006 From: manos_lists at geekologue.com (Manos Batsis) Date: Tue, 07 Nov 2006 06:24:38 -0800 Subject: [kupu-checkins] r34311 - in kupu/trunk/kupu: common plone plone/kupu_plone_layer In-Reply-To: <20061107111826.45DFD10075@code0.codespeak.net> References: <20061107111826.45DFD10075@code0.codespeak.net> Message-ID: <1162909478.45509726a8929@www.kattare.com> Quoting duncan at codespeak.net: > - tmp.innerHTML = oNode.xml ? oNode.xml : > oNode.innerHTML; > + tmp.innerHTML = oNode.xml ? oNode.xml : > oNode.outerHTML; Ah, had forgot about this one. But is outerHTML supported by Mozilish UAs out there? This [1] says its not, maybe we need to copy the node to another temporary element and use that elements innerHTML in that case. We can do that by making a recursive call with an additional parameter in the current sarissa head [2] i believe. WDYT? Also looks like i need to convert thhe line ends :-/ [1] http://www.quirksmode.org/dom/w3c_html.html [2] http://sarissa.cvs.sourceforge.net/sarissa/sarissa/sarissa.js?view=markup From duncan at codespeak.net Tue Nov 7 15:50:44 2006 From: duncan at codespeak.net (duncan at codespeak.net) Date: Tue, 7 Nov 2006 15:50:44 +0100 (CET) Subject: [kupu-checkins] r34332 - in kupu/trunk/kupu: Extensions plone plone/kupu_plone_layer Message-ID: <20061107145044.496D21007F@code0.codespeak.net> Author: duncan Date: Tue Nov 7 15:50:40 2006 New Revision: 34332 Modified: kupu/trunk/kupu/Extensions/Install.py kupu/trunk/kupu/plone/head.kupu kupu/trunk/kupu/plone/kupu_plone_layer/kupu_wysiwyg_support.html kupu/trunk/kupu/plone/kupu_plone_layer/kupuploneinit.js Log: Nuked kupu's context menu. Firefox 2 has a sensible context menu built-in and IE6/7 also have halfway decent context menus. Firefox 1.x now gets the pretty useful default context menu, but that is still an improvement on the broken kupu menu we used to show. Modified: kupu/trunk/kupu/Extensions/Install.py ============================================================================== --- kupu/trunk/kupu/Extensions/Install.py (original) +++ kupu/trunk/kupu/Extensions/Install.py Tue Nov 7 15:50:40 2006 @@ -108,6 +108,7 @@ enabled=True, cookable=cookable) + jstool.manage_removeScript('kupucontextmenu.js'); for id in js_files(data): print >>out, "JS file", id jstool.manage_removeScript(id=id) Modified: kupu/trunk/kupu/plone/head.kupu ============================================================================== --- kupu/trunk/kupu/plone/head.kupu (original) +++ kupu/trunk/kupu/plone/head.kupu Tue Nov 7 15:50:40 2006 @@ -40,8 +40,6 @@ tal:attributes="src string:${portal_url}/kupuloggers.js"> </script> <script type="text/javascript" tal:attributes="src string:${portal_url}/kupucontentfilters.js"> </script> - <script type="text/javascript" - tal:attributes="src string:${portal_url}/kupucontextmenu.js"> </script> <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuploneeditor.js"> </script> 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 Nov 7 15:50:40 2006 @@ -21,7 +21,7 @@ <!--$Id: wire.kupu 25247 2006-04-03 11:23:02Z fschulze $--> <!--$Id: head.kupu 20919 2005-12-09 10:14:44Z duncan $--> <!--$Id: xmlconfig.kupu 30512 2006-07-25 10:17:05Z duncan $--> - <!--$Id: body.kupu 31913 2006-09-01 10:07:10Z duncan $--> + <!--$Id: body.kupu 34311 2006-11-07 11:18:23Z duncan $--> <!--$Id: toolbar.kupu 25717 2006-04-12 10:33:01Z fschulze $--> <!--$Id: drawers.kupu 21175 2005-12-15 14:25:08Z duncan $--> <!--$Id: beforeunload.kupu 14546 2005-07-12 14:35:55Z duncan $--> @@ -99,7 +99,6 @@ <script type="text/javascript" tal:attributes="src string:${portal_url}/kupubasetools.js"> </script> <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuloggers.js"> </script> <script type="text/javascript" tal:attributes="src string:${portal_url}/kupucontentfilters.js"> </script> - <script type="text/javascript" tal:attributes="src string:${portal_url}/kupucontextmenu.js"> </script> <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuploneeditor.js"> </script> <script type="text/javascript" tal:attributes="src string:${portal_url}/kupuploneui.js"> </script> 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 Tue Nov 7 15:50:40 2006 @@ -34,10 +34,6 @@ var kupu = new KupuEditor(doc, conf, l); kupu.setHTMLBody(initialtext); - // add the contextmenu - var cm = new ContextMenu(); - kupu.setContextMenu(cm); - // now we can create a UI object which we can use from the UI var ui = new KupuUI(prefix+'select.kupu-tb-styles'); kupu.registerTool('ui', ui); From mihxil at codespeak.net Tue Nov 14 19:07:23 2006 From: mihxil at codespeak.net (mihxil at codespeak.net) Date: Tue, 14 Nov 2006 19:07:23 +0100 (CET) Subject: [kupu-checkins] r34609 - in kupu/trunk/kupu/mmbase: . drawers i18n Message-ID: <20061114180723.94C3810083@code0.codespeak.net> Author: mihxil Date: Tue Nov 14 19:07:19 2006 New Revision: 34609 Modified: kupu/trunk/kupu/mmbase/Makefile kupu/trunk/kupu/mmbase/drawers/drawer.jspx kupu/trunk/kupu/mmbase/drawers/libraries.jspx kupu/trunk/kupu/mmbase/head.kupu kupu/trunk/kupu/mmbase/i18n/de.po kupu/trunk/kupu/mmbase/i18n/en.po kupu/trunk/kupu/mmbase/i18n/eo.po kupu/trunk/kupu/mmbase/i18n/fr.po kupu/trunk/kupu/mmbase/i18n/it.po kupu/trunk/kupu/mmbase/i18n/nl.po kupu/trunk/kupu/mmbase/layout.js kupu/trunk/kupu/mmbase/mmbase.css kupu/trunk/kupu/mmbase/mmbase.js kupu/trunk/kupu/mmbase/mmbasetools.js kupu/trunk/kupu/mmbase/node.body.jspx kupu/trunk/kupu/mmbase/preview.jspx kupu/trunk/kupu/mmbase/toolboxes.kupu kupu/trunk/kupu/mmbase/wire.kupu Log: several bugfixes, and small improvements Modified: kupu/trunk/kupu/mmbase/Makefile ============================================================================== --- kupu/trunk/kupu/mmbase/Makefile (original) +++ kupu/trunk/kupu/mmbase/Makefile Tue Nov 14 19:07:19 2006 @@ -14,12 +14,18 @@ #type in i18n: msginit -l <locale> -i messages.po -all: index.jspx +all: index.jspx body.jspx head.jspx -index.jspx: mmbase-kupu-i18n.jar *.kupu +index.jspx: mmbase-kupu-i18n.jar *.kupu Makefile $(XSLTPROC) $(XSLTPROC_PARAMS) -o $@ $(XSLJSPX_FILE) dist-mmbase.kupu +body.jspx: mmbase-kupu-i18n.jar *.kupu Makefile + $(XSLTPROC) $(XSLTPROC_PARAMS) -o $@ $(XSLJSPX_FILE) body-mmbase.kupu + +head.jspx: mmbase-kupu-i18n.jar *.kupu Makefile + $(XSLTPROC) $(XSLTPROC_PARAMS) -o $@ $(XSLJSPX_FILE) head-mmbase.kupu + $(I18N): @$(MAKE) -C $(KUPU_HOME) kupu-i18n.jar Modified: kupu/trunk/kupu/mmbase/drawers/drawer.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/drawer.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/drawer.jspx Tue Nov 14 19:07:19 2006 @@ -6,8 +6,11 @@ <jsp:output omit-xml-declaration="true" /> <mm:cloud method="asis"> <mm:import id="nodetypes">images</mm:import> - <mm:formatter xslt="drawer.xsl" escape="none"> + <mm:formatter escape="none"> <mm:include referids="nodetypes" page="libraries.jspx" escape="none" /> + <mm:xslt> + <mm:include page="drawer.xsl.jspx" /> + </mm:xslt> </mm:formatter> </mm:cloud> </mm:content> Modified: kupu/trunk/kupu/mmbase/drawers/libraries.jspx ============================================================================== --- kupu/trunk/kupu/mmbase/drawers/libraries.jspx (original) +++ kupu/trunk/kupu/mmbase/drawers/libraries.jspx Tue Nov 14 19:07:19 2006 @@ -13,7 +13,7 @@ <libraries> <param name="showupload">yes</param> <param name="drawertype">image</param> - <mm:url absolute="server" id="kupubasedir" page="../.." write="false" /> + <mm:import id="kupubasedir"><mm:url absolute="server" page="../.." /></mm:import> <mm:stringlist referid="nodetypes" id="nodetype"> <mm:hasnodemanager name="$_"> <mm:hasrelationmanager sourcemanager="$s" destinationmanager="$_" role="idrel"> Modified: kupu/trunk/kupu/mmbase/head.kupu ============================================================================== --- kupu/trunk/kupu/mmbase/head.kupu (original) +++ kupu/trunk/kupu/mmbase/head.kupu Tue Nov 14 19:07:19 2006 @@ -16,6 +16,7 @@ <jsp:text>: ${param.objectnumber}</jsp:text> + saved from url=(0013)about:internet Modified: kupu/trunk/kupu/mmbase/i18n/de.po ============================================================================== --- kupu/trunk/kupu/mmbase/i18n/de.po (original) +++ kupu/trunk/kupu/mmbase/i18n/de.po Tue Nov 14 19:07:19 2006 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mmbase 18\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-28 18:04+0100\n" +"POT-Creation-Date: 2006-09-19 17:56+0200\n" "PO-Revision-Date: 2005-06-09 00:42+0200\n" "Last-Translator: Michiel Meeuwissen \n" "Language-Team: German \n" @@ -16,51 +16,51 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: mmbase.js:141 +#: mmbase.js:141 mmbase.js:158 msgid "Saving body (kupu)" msgstr "" -#: mmbase.js:144 +#: mmbase.js:144 mmbase.js:161 msgid "Saving fields (form)" msgstr "" -#: mmbase.js:173 +#: mmbase.js:173 mmbase.js:191 msgid "saved" msgstr "" -#: mmbase.js:202 +#: mmbase.js:202 mmbase.js:242 msgid "RELOAD" msgstr "" -#: mmbase.js:223 +#: mmbase.js:223 mmbase.js:264 msgid "Getting node fields for " msgstr "" -#: mmbase.js:231 +#: mmbase.js:231 mmbase.js:275 msgid "Loading node fields for " msgstr "" -#: mmbase.js:243 +#: mmbase.js:243 mmbase.js:289 msgid "Getting node body " msgstr "" -#: mmbase.js:250 +#: mmbase.js:250 mmbase.js:300 msgid "Loading node body " msgstr "" -#: mmbasetools.js:13 +#: mmbasetools.js:13 mmbasetools.js:14 msgid "Div tool initialized" msgstr "" -#: mmbasetools.js:39 +#: mmbasetools.js:39 mmbasetools.js:40 msgid "Found paragraph" msgstr "" -#: mmbasetools.js:43 +#: mmbasetools.js:43 mmbasetools.js:44 msgid "Didn't find paragraph" msgstr "" -#: mmbasetools.js:48 +#: mmbasetools.js:48 mmbasetools.js:50 msgid "Div inserted" msgstr "" @@ -72,7 +72,7 @@ msgid "Normal" msgstr "" -#: phony.js:3 phony.js:5 +#: phony.js:3 phony.js:5 phony.js:2 msgid "Richtext editor" msgstr "" @@ -80,27 +80,27 @@ msgid "Heading 1" msgstr "" -#: phony.js:6 +#: phony.js:6 phony.js:3 msgid "default" msgstr "" -#: phony.js:7 +#: phony.js:7 phony.js:4 phony.js:6 msgid "Block" msgstr "" -#: phony.js:8 +#: phony.js:8 phony.js:5 phony.js:7 msgid "Block class" msgstr "" -#: phony.js:9 +#: phony.js:9 phony.js:6 phony.js:8 msgid "Note left" msgstr "" -#: phony.js:10 +#: phony.js:10 phony.js:7 phony.js:9 msgid "Note right" msgstr "" -#: phony.js:11 +#: phony.js:11 phony.js:8 phony.js:10 msgid "Insert block" msgstr "" @@ -111,3 +111,19 @@ #: override.js:3 msgid "emphasis: alt-i" msgstr "" + +#: mmbase.js:197 +msgid "Not saved" +msgstr "" + +#: mmbase.js:215 +msgid "Reinited " +msgstr "" + +#: phony.js:4 +msgid "Left (Big)" +msgstr "" + +#: phony.js:5 +msgid "Right (Big)" +msgstr "" Modified: kupu/trunk/kupu/mmbase/i18n/en.po ============================================================================== --- kupu/trunk/kupu/mmbase/i18n/en.po (original) +++ kupu/trunk/kupu/mmbase/i18n/en.po Tue Nov 14 19:07:19 2006 @@ -8,59 +8,59 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-28 18:04+0100\n" -"PO-Revision-Date: 2005-11-28 18:05+0100\n" +"POT-Creation-Date: 2006-09-19 17:56+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: mmbase.js:141 +#: mmbase.js:141 mmbase.js:158 msgid "Saving body (kupu)" msgstr "Saving body (kupu)" -#: mmbase.js:144 +#: mmbase.js:144 mmbase.js:161 msgid "Saving fields (form)" msgstr "Saving fields (form)" -#: mmbase.js:173 +#: mmbase.js:173 mmbase.js:191 msgid "saved" msgstr "saved" -#: mmbase.js:202 +#: mmbase.js:202 mmbase.js:242 msgid "RELOAD" msgstr "RELOAD" -#: mmbase.js:223 +#: mmbase.js:223 mmbase.js:264 msgid "Getting node fields for " msgstr "Getting node fields for " -#: mmbase.js:231 +#: mmbase.js:231 mmbase.js:275 msgid "Loading node fields for " msgstr "Loading node fields for " -#: mmbase.js:243 +#: mmbase.js:243 mmbase.js:289 msgid "Getting node body " msgstr "Getting node body " -#: mmbase.js:250 +#: mmbase.js:250 mmbase.js:300 msgid "Loading node body " msgstr "Loading node body " -#: mmbasetools.js:13 +#: mmbasetools.js:13 mmbasetools.js:14 msgid "Div tool initialized" msgstr "Div tool initialized" -#: mmbasetools.js:39 +#: mmbasetools.js:39 mmbasetools.js:40 msgid "Found paragraph" msgstr "Found paragraph" -#: mmbasetools.js:43 +#: mmbasetools.js:43 mmbasetools.js:44 msgid "Didn't find paragraph" msgstr "Didn't find paragraph" -#: mmbasetools.js:48 +#: mmbasetools.js:48 mmbasetools.js:50 msgid "Div inserted" msgstr "Div inserted" @@ -72,7 +72,7 @@ msgid "Normal" msgstr "Normal" -#: phony.js:3 phony.js:5 +#: phony.js:3 phony.js:5 phony.js:2 msgid "Richtext editor" msgstr "Richtext editor" @@ -80,27 +80,27 @@ msgid "Heading 1" msgstr "Heading 1" -#: phony.js:6 +#: phony.js:6 phony.js:3 msgid "default" msgstr "default" -#: phony.js:7 +#: phony.js:7 phony.js:4 phony.js:6 msgid "Block" msgstr "Block" -#: phony.js:8 +#: phony.js:8 phony.js:5 phony.js:7 msgid "Block class" msgstr "Block class" -#: phony.js:9 +#: phony.js:9 phony.js:6 phony.js:8 msgid "Note left" msgstr "Note left" -#: phony.js:10 +#: phony.js:10 phony.js:7 phony.js:9 msgid "Note right" msgstr "Note right" -#: phony.js:11 +#: phony.js:11 phony.js:8 phony.js:10 msgid "Insert block" msgstr "Insert block" @@ -111,3 +111,19 @@ #: override.js:3 msgid "emphasis: alt-i" msgstr "emphasis: alt-i" + +#: mmbase.js:197 +msgid "Not saved" +msgstr "" + +#: mmbase.js:215 +msgid "Reinited " +msgstr "" + +#: phony.js:4 +msgid "Left (Big)" +msgstr "" + +#: phony.js:5 +msgid "Right (Big)" +msgstr "" Modified: kupu/trunk/kupu/mmbase/i18n/eo.po ============================================================================== --- kupu/trunk/kupu/mmbase/i18n/eo.po (original) +++ kupu/trunk/kupu/mmbase/i18n/eo.po Tue Nov 14 19:07:19 2006 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mmbase 18\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-28 18:04+0100\n" +"POT-Creation-Date: 2006-09-19 17:56+0200\n" "PO-Revision-Date: 2005-11-28 18:06+0100\n" "Last-Translator: Michiel Meeuwissen \n" "Language-Team: Esperanto \n" @@ -16,51 +16,51 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: mmbase.js:141 +#: mmbase.js:141 mmbase.js:158 msgid "Saving body (kupu)" msgstr "Savante tekston (kupan)" -#: mmbase.js:144 +#: mmbase.js:144 mmbase.js:161 msgid "Saving fields (form)" msgstr "Savante kampojn (formularajn)" -#: mmbase.js:173 +#: mmbase.js:173 mmbase.js:191 msgid "saved" msgstr "Savita" -#: mmbase.js:202 +#: mmbase.js:202 mmbase.js:242 msgid "RELOAD" msgstr "RETIRAS" -#: mmbase.js:223 +#: mmbase.js:223 mmbase.js:264 msgid "Getting node fields for " msgstr "Tirante kampojn" -#: mmbase.js:231 +#: mmbase.js:231 mmbase.js:275 msgid "Loading node fields for " msgstr "En?utante kampojn por " -#: mmbase.js:243 +#: mmbase.js:243 mmbase.js:289 msgid "Getting node body " msgstr "Tirante nodan korpon " -#: mmbase.js:250 +#: mmbase.js:250 mmbase.js:300 msgid "Loading node body " msgstr "En?utante objekton" -#: mmbasetools.js:13 +#: mmbasetools.js:13 mmbasetools.js:14 msgid "Div tool initialized" msgstr "" -#: mmbasetools.js:39 +#: mmbasetools.js:39 mmbasetools.js:40 msgid "Found paragraph" msgstr "" -#: mmbasetools.js:43 +#: mmbasetools.js:43 mmbasetools.js:44 msgid "Didn't find paragraph" msgstr "" -#: mmbasetools.js:48 +#: mmbasetools.js:48 mmbasetools.js:50 msgid "Div inserted" msgstr "" @@ -72,7 +72,7 @@ msgid "Normal" msgstr "" -#: phony.js:3 phony.js:5 +#: phony.js:3 phony.js:5 phony.js:2 msgid "Richtext editor" msgstr "Ri?a redaktilo" @@ -80,27 +80,27 @@ msgid "Heading 1" msgstr "" -#: phony.js:6 +#: phony.js:6 phony.js:3 msgid "default" msgstr "defa?lto" -#: phony.js:7 +#: phony.js:7 phony.js:4 phony.js:6 msgid "Block" msgstr "" -#: phony.js:8 +#: phony.js:8 phony.js:5 phony.js:7 msgid "Block class" msgstr "" -#: phony.js:9 +#: phony.js:9 phony.js:6 phony.js:8 msgid "Note left" msgstr "" -#: phony.js:10 +#: phony.js:10 phony.js:7 phony.js:9 msgid "Note right" msgstr "" -#: phony.js:11 +#: phony.js:11 phony.js:8 phony.js:10 msgid "Insert block" msgstr "" @@ -111,3 +111,20 @@ #: override.js:3 msgid "emphasis: alt-i" msgstr "emfaze: alt-e" + +#: mmbase.js:197 +#, fuzzy +msgid "Not saved" +msgstr "Savita" + +#: mmbase.js:215 +msgid "Reinited " +msgstr "" + +#: phony.js:4 +msgid "Left (Big)" +msgstr "" + +#: phony.js:5 +msgid "Right (Big)" +msgstr "" Modified: kupu/trunk/kupu/mmbase/i18n/fr.po ============================================================================== --- kupu/trunk/kupu/mmbase/i18n/fr.po (original) +++ kupu/trunk/kupu/mmbase/i18n/fr.po Tue Nov 14 19:07:19 2006 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mmbase 18\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-28 18:04+0100\n" +"POT-Creation-Date: 2006-09-19 17:56+0200\n" "PO-Revision-Date: 2005-06-09 00:42+0200\n" "Last-Translator: Michiel Meeuwissen \n" "Language-Team: French \n" @@ -16,51 +16,51 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: mmbase.js:141 +#: mmbase.js:141 mmbase.js:158 msgid "Saving body (kupu)" msgstr "" -#: mmbase.js:144 +#: mmbase.js:144 mmbase.js:161 msgid "Saving fields (form)" msgstr "" -#: mmbase.js:173 +#: mmbase.js:173 mmbase.js:191 msgid "saved" msgstr "" -#: mmbase.js:202 +#: mmbase.js:202 mmbase.js:242 msgid "RELOAD" msgstr "" -#: mmbase.js:223 +#: mmbase.js:223 mmbase.js:264 msgid "Getting node fields for " msgstr "" -#: mmbase.js:231 +#: mmbase.js:231 mmbase.js:275 msgid "Loading node fields for " msgstr "" -#: mmbase.js:243 +#: mmbase.js:243 mmbase.js:289 msgid "Getting node body " msgstr "" -#: mmbase.js:250 +#: mmbase.js:250 mmbase.js:300 msgid "Loading node body " msgstr "" -#: mmbasetools.js:13 +#: mmbasetools.js:13 mmbasetools.js:14 msgid "Div tool initialized" msgstr "" -#: mmbasetools.js:39 +#: mmbasetools.js:39 mmbasetools.js:40 msgid "Found paragraph" msgstr "" -#: mmbasetools.js:43 +#: mmbasetools.js:43 mmbasetools.js:44 msgid "Didn't find paragraph" msgstr "" -#: mmbasetools.js:48 +#: mmbasetools.js:48 mmbasetools.js:50 msgid "Div inserted" msgstr "" @@ -72,7 +72,7 @@ msgid "Normal" msgstr "" -#: phony.js:3 phony.js:5 +#: phony.js:3 phony.js:5 phony.js:2 msgid "Richtext editor" msgstr "" @@ -80,27 +80,27 @@ msgid "Heading 1" msgstr "" -#: phony.js:6 +#: phony.js:6 phony.js:3 msgid "default" msgstr "" -#: phony.js:7 +#: phony.js:7 phony.js:4 phony.js:6 msgid "Block" msgstr "" -#: phony.js:8 +#: phony.js:8 phony.js:5 phony.js:7 msgid "Block class" msgstr "" -#: phony.js:9 +#: phony.js:9 phony.js:6 phony.js:8 msgid "Note left" msgstr "" -#: phony.js:10 +#: phony.js:10 phony.js:7 phony.js:9 msgid "Note right" msgstr "" -#: phony.js:11 +#: phony.js:11 phony.js:8 phony.js:10 msgid "Insert block" msgstr "" @@ -111,3 +111,19 @@ #: override.js:3 msgid "emphasis: alt-i" msgstr "" + +#: mmbase.js:197 +msgid "Not saved" +msgstr "" + +#: mmbase.js:215 +msgid "Reinited " +msgstr "" + +#: phony.js:4 +msgid "Left (Big)" +msgstr "" + +#: phony.js:5 +msgid "Right (Big)" +msgstr "" Modified: kupu/trunk/kupu/mmbase/i18n/it.po ============================================================================== --- kupu/trunk/kupu/mmbase/i18n/it.po (original) +++ kupu/trunk/kupu/mmbase/i18n/it.po Tue Nov 14 19:07:19 2006 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: mmbase 18\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-11-28 18:04+0100\n" +"POT-Creation-Date: 2006-09-19 17:56+0200\n" "PO-Revision-Date: 2005-06-09 00:45+0200\n" "Last-Translator: Michiel Meeuwissen \n" "Language-Team: Italian \n" @@ -16,51 +16,51 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: mmbase.js:141 +#: mmbase.js:141 mmbase.js:158 msgid "Saving body (kupu)" msgstr "" -#: mmbase.js:144