return [false, false]; /* [disabled, default_value] */
return [true];
},
- get: function(value, ui) {
+ applyChanges: function(value, ui) {
if(ui.setBeepOnMention)
ui.setBeepOnMention(value);
}
[11, "STYLE_HUE", "Adjust user interface hue", function() {
return {class_: qwebirc.config.HueOption, default_: 210};
}, {
- get: function(value, ui) {
- ui.setModifiableStylesheetValues(value, 0, 0);
+ applyChanges: function(value, ui) {
+ ui.setModifiableStylesheetValues({hue: value});
}
}],
- [12, "QUERY_ON_NICK_CLICK", "Query on nickname click in channel", false]
+ [12, "QUERY_ON_NICK_CLICK", "Query on nickname click in channel", false],
+ [13, "SHOW_NICKLIST", "Show nickname list in channels", true],
+ [14, "SHOW_TIMESTAMPS", "Show timestamps", true] /* we rely on the hue update */
];
qwebirc.config.DefaultOptions = null;
render: function() {
this.event("render", this.mainElement);
},
- get: function(value) {
- this.event("get", [value, this.parentObject.optionObject.ui]);
- return value;
+ applyChanges: function() {
+ this.event("applyChanges", [this.get(), this.parentObject.optionObject.ui]);
},
event: function(name, x) {
if(!$defined(this.option.extras))
this.parent();
},
get: function() {
- return this.parent(this.mainElement.value);
+ return this.mainElement.value;
}
});
slider.addEvent("change", function(step) {
this.value = step;
- this.get();
+ this.applyChanges();
}.bind(this));
this.mainElement = i;
this.parent();
},
get: function() {
- return this.parent(this.value);
+ return this.value;
},
cancel: function() {
this.value = this.startValue;
- this.get();
+ this.applyChanges();
}
});
this.parent();
},
get: function() {
- return this.parent(this.mainElement.checked);
+ return this.mainElement.checked;
}
});
var x = this.elements[i];
if(x.checked) {
this.option.position = i;
- return this.parent(this.option.options[i][1]);
+ return this.option.options[i][1];
}
}
}
var box = x[1];
this.optionObject.setValue(option, box.get());
}.bind(this));
+ this.boxList.forEach(function(x) {
+ x[1].applyChanges();
+ }.bind(this));
this.optionObject.flush();
},
cancel: function() {
qwebirc.ui.SuppliedArgOptions = new Class({
Extends: qwebirc.ui.CookieOptions,
initialize: function(ui, arg) {
- var p = {};
+ var p = new QHash();
if($defined(arg) && arg != "" && arg.length > 2) {
var checksum = arg.substr(arg.length - 2, 2);
if(decoded && (new qwebirc.util.crypto.MD5().digest(decoded).slice(0, 2) == checksum)) {
var p2 = qwebirc.util.parseURI("?" + decoded);
- for(var k in p2) {
- p[k] = JSON.decode(p2[k], true);
- }
+ p2.each(function(k, v) {
+ p.put(k, JSON.decode(v, true));
+ });
}
}
if(x.settableByURL !== true)
return this.parent(x);
- var opt = this.parsedOptions[x.optionId];
+ var opt = this.parsedOptions.get(String(x.optionId));
if(!$defined(opt))
return this.parent(x);