+function qwebirc_ui_onbeforeunload(e) { /* IE sucks */
+ var message = "This action will close all active IRC connections.";
+ var e = e || window.event;
+ if(e)
+ e.returnValue = message;
+ return message;
+}
+
qwebirc.ui.Interface = new Class({
Implements: [Options],
options: {
searchURL: true,
theme: undefined,
baseURL: null,
- hue: null
+ hue: null,
+ uiOptionsArg: null,
+ dynamicBaseURL: "/",
+ staticBaseURL: "/"
},
initialize: function(element, ui, options) {
+ qwebirc.global = {dynamicBaseURL: options.dynamicBaseURL, staticBaseURL: options.staticBaseURL}; /* HACK */
+
this.setOptions(options);
window.addEvent("domready", function() {
var callback = function(options) {
var IRC = new qwebirc.irc.IRCClient(options, ui_);
IRC.connect();
- window.addEvent("beforeunload", function() {
+ window.onbeforeunload = qwebirc_ui_onbeforeunload;
+ window.addEvent("unload", function() {
IRC.quit("Page closed");
});
};
if(this.options.searchURL) {
var args = qwebirc.util.parseURI(String(document.location));
this.options.hue = this.getHueArg(args);
+
+ if($defined(args["uio"]))
+ this.options.uiOptionsArg = args["uio"];
+
var url = args["url"];
var chans, nick = args["nick"];