Remember active window

This commit is contained in:
Mattias Erming 2014-06-19 01:21:20 +02:00
parent 164bf55e98
commit 06bd770c9b
2 changed files with 13 additions and 7 deletions

View File

@ -120,11 +120,17 @@ $(function() {
e.stopPropagation();
});
var networks = $("#networks")
.html(render("networks", {networks: data.networks}))
.find("a")
.last()
var networks = render("networks", {networks: data.networks});
var current = $("#networks")
.html(networks)
.find("a[href='" + $.cookie("current") + "']")
.trigger("click");
if (!current.length) {
$("#networks")
.find("a")
.last()
.trigger("click");
}
break;
case "part":
@ -197,6 +203,8 @@ $(function() {
.removeClass("highlight")
.empty();
$.cookie("current", target);
if (sidebar.find(".highlight").length == 0) {
favicon.badge("");
}

View File

@ -29,9 +29,6 @@ Chan.prototype.addMsg = function(msg) {
fs.mkdir(dir);
}
var date = moment().format("YYYY-MM-DD");
var file = dir + this.name + ".log";
var line = "[" + msg.time + "] ";
if (msg.type == "normal") {
// Format:
@ -46,6 +43,7 @@ Chan.prototype.addMsg = function(msg) {
}
}
var file = dir + this.name + ".log";
fs.appendFile(
file,
line + "\n"