this.firstClient = false;
this.commandhistory = new qwebirc.irc.CommandHistory();
this.clientId = 0;
+
+ this.windowFocused = true;
+ window.addEvent("blur", function() { if(this.windowFocused) { this.windowFocused = false; this.focusChange(false); } }.bind(this));
+ window.addEvent("focus", function() { if(!this.windowFocused) { this.windowFocused = true; this.focusChange(true); } }.bind(this));
},
newClient: function(client) {
client.id = this.clientId++;
*/
loginBox: function(callback, initialNickname, initialChannels, autoConnect, autoNick) {
qwebirc.ui.GenericLoginBox(this.parentElement, callback, initialNickname, initialChannels, autoConnect, autoNick, this.options.networkName);
+ },
+ focusChange: function(newValue) {
+ var window_ = this.getActiveWindow();
+ if($defined(window_))
+ window_.focusChange(newValue);
}
});
updateTitle: function(text) {
if(this.__flasher.updateTitle(text))
this.parent(text);
+ },
+ focusChange: function(value) {
+ this.parent(value);
+ this.__flasher.focusChange(value);
}
});
historyExec: function(line) {
this.commandhistory.addLine(line);
this.client.exec(line);
- }
+ },
+ focusChange: function(newValue) {
+ console.log("focus change: " + newValue);
+ if(newValue == true || !(this.type & qwebirc.ui.WINDOW_LASTLINE))
+ return;
+
+ if(this.lastPositionLineInserted)
+ this.lines.removeChild(this.lastPositionLine);
+
+ if(this.parentObject.uiOptions.LASTPOS_LINE)
+ this.lines.appendChild(this.lastPositionLine);
+ }
});
\r
this.flashing = false;\r
\r
- window.addEvent("focus", function() { this.windowFocused = true; this.cancelFlash(); }.bind(this));\r
- window.addEvent("blur", function() { this.windowFocused = false; }.bind(this));\r
- \r
this.canFlash = true;\r
} else {\r
this.canFlash = false;\r
updateTitle: function(text) {\r
this.titleText = text;\r
return this.canUpdateTitle;\r
+ },\r
+ focusChange: function(value) {\r
+ if(value)\r
+ this.cancelFlash();\r
}\r
});\r
[3, "NICK_OV_STATUS", "Show status (@/+) before nicknames in nicklist", true],
[5, "ACCEPT_SERVICE_INVITES", "Automatically join channels when invited by Q", true],
[6, "USE_HIDDENHOST", "Hide your hostmask when authed to Q (+x)", true],
- [8, "LASTPOS_LINE", "Show a last position indicator for each window.", true]
+ [8, "LASTPOS_LINE", "Show a last position indicator for each window", true]
];
qwebirc.config.DefaultOptions = null;