X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/blobdiff_plain/86100f08e0277865f58c3c9aec613d398aeb69f1..77e5d85fa0f84ddcc89b36771eec58999e497e55:/js/qwebircinterface.js diff --git a/js/qwebircinterface.js b/js/qwebircinterface.js index f4d608c..c1eb3c2 100644 --- a/js/qwebircinterface.js +++ b/js/qwebircinterface.js @@ -30,12 +30,21 @@ qwebirc.ui.Interface = new Class({ nickValidation: null, helpURL: null, dynamicBaseURL: "/", - staticBaseURL: "/" + staticBaseURL: "/", + cloak: false }, initialize: function(element, ui, options) { this.setOptions(options); var extractHost = function() { - var uri = document.location.origin + document.location.pathname; + var uri = document.location.href; + + /* IE6 doesn't have document.origin ... */ + var start = uri.indexOf('?'); + if(start != -1) + uri = uri.substring(0, start); + var start = uri.indexOf('#'); + if(start != -1) + uri = uri.substring(0, start); if(QWEBIRC_DEBUG && uri.endsWith(".html")) { var last = uri.lastIndexOf("/"); @@ -60,6 +69,7 @@ qwebirc.ui.Interface = new Class({ window.addEvent("domready", function() { var callback = function(options) { + options.cloak = ui_.options.cloak; var IRC = new qwebirc.irc.IRCClient(options, ui_); IRC.connect(); window.onbeforeunload = qwebirc_ui_onbeforeunload; @@ -121,7 +131,10 @@ qwebirc.ui.Interface = new Class({ if(args.contains("randomnick") && args.get("randomnick") == 1) inick = this.options.initialNickname; - + + if(args.contains("cloak") && args.get("cloak") == 1) + this.options.cloak = true; + /* we only consider autoconnecting if the nick hasn't been supplied, or it has and it's not "" */ if(canAutoConnect && (!$defined(inick) || ($defined(inick) && (inick != "")))) { var p = args.get("prompt");