X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Feuphorik.js;h=e56acde9f6afc2d01a0e4158f4b2c71c77dd4ec0;hp=9dd3357430bc42ef212ad0f18cc23ea77bd945d5;hb=cb001bf4e6e3ec3064b954b7c5583db8440f3492;hpb=83bc327682deb0f857cdbbc71b619350cee6deee diff --git a/js/euphorik.js b/js/euphorik.js index 9dd3357..e56acde 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -128,7 +128,11 @@ Util.prototype.creerDocumentXMLAction = function() { if (document.implementation && document.implementation.createDocument) { - return document.implementation.createDocument("", "action", null) + // var doc = document.implementation.createDocument("", "action", null) + var parser = new DOMParser(); + var doc = parser.parseFromString("\n", "text/xml") + //alert(this.serializeXML(doc)) + return doc } else if (window.ActiveXObject) { @@ -143,32 +147,9 @@ Util.prototype.creerDocumentXMLAction = function() Util.prototype.xmlVersAction = function(xml) { - return {action: this.to_utf8(this.serializeXML(xml /*, "UTF-8"*/))} + //return {action: this.to_utf8(this.serializeXML(xml /*, "UTF-8"*/))} + return {action: this.serializeXML(xml)} } - -// voir : http://homepage3.nifty.com/aokura/jscript/utf8.html -// et : http://www1.tip.nl/~t876506/utf8tbl.html -Util.prototype.to_utf8 = function(s) -{ - if (!s) return "" - - var c, d = "" - for (var i = 0; i < s.length; i++) - { - c = s.charCodeAt(i); - if (c <= 0x7f) { - d += s.charAt(i); - } else if (c >= 0x80 && c <= 0x7ff) { - d += String.fromCharCode(((c >> 6) & 0x1f) | 0xc0); - d += String.fromCharCode((c & 0x3f) | 0x80); - } else { - d += String.fromCharCode((c >> 12) | 0xe0); - d += String.fromCharCode(((c >> 6) & 0x3f) | 0x80); - d += String.fromCharCode((c & 0x3f) | 0x80); - } - } - return d; -} Util.prototype.md5 = function(chaine) { @@ -775,6 +756,12 @@ jQuery.noConflict() jQuery(document).ready( function() { + /* FIXME : ce code pose problème sur konqueror, voir : http://www.kde-forum.org/thread.php?threadid=17993 + var p = new DOMParser(); + var doc = p.parseFromString("\n", "text/xml") + var s = new XMLSerializer() + alert(s.serializeToString(doc)) */ + var util = new Util() var client = new Client(util) var pages = new Pages()