X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/e516cc7667c1b2ce0a1eb20c0bbcb6a2d1fe9564..129b197fb5b6c23f2b12f1aa78a149df9357eb1f:/js/jslib.js diff --git a/js/jslib.js b/js/jslib.js index 8b3c2cf..589baa9 100644 --- a/js/jslib.js +++ b/js/jslib.js @@ -17,6 +17,7 @@ qwebirc.util.dictCopy = function(d) { /* how horribly inefficient */ String.prototype.replaceAll = function(f, t) { + //return new RegExp("/" + RegExp.escape(f) + "/g").replace(f, RegExp.escape(t)); var i = this.indexOf(f); var c = this; @@ -50,7 +51,7 @@ qwebirc.util.parseURI = function(uri) { var args = querystring.split("&"); - for(i=0;i")); - } else { - r = new Element("input"); - r.type = type; - if(name) - r.name = name; - - if(selected) - r.checked = true; + if(id) { + id = " id=\"" + escape(id) + "\""; + } else { + id = ""; + } + try { + return $(document.createElement("")); + } catch(e) { + /* fallthough, trying it the proper way... */ + } } + + r = new Element("input"); + r.type = type; + if(name) + r.name = name; + if(id) + r.id = id; + + if(selected) + r.checked = true; parent.appendChild(r); return r; @@ -266,7 +270,7 @@ qwebirc.util.b64Table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012 qwebirc.util.b64Encode = function(data) { var output = []; var table = qwebirc.util.b64Table; - for(i=0;i -1; + } + + for(var i=0;i