qwebirc.config.DEFAULT_OPTIONS = [
[1, "BEEP_ON_MENTION", "Beep when nick mentioned or on query activity (requires Flash)", true, {
- render: function(input) {
- if(!$defined(Browser.Plugins.Flash) || Browser.Plugins.Flash.version < 8) {
- input.disabled = true;
- input.checked = false;
- }
+ enabled: function() {
+ if(!$defined(Browser.Plugins.Flash) || Browser.Plugins.Flash.version < 8)
+ return [false, false]; /* [disabled, default_value] */
+ return [true];
},
get: function(value, ui) {
if(ui.setBeepOnMention)
ui.setBeepOnMention(value);
}
}],
- [7, "FLASH_ON_MENTION", "Flash titlebar when nick mentioned or on query activity", true],
+ [7, "FLASH_ON_MENTION", "Flash titlebar when nick mentioned or on query activity", true, {
+ enabled: function() {
+ var ua = navigator.userAgent;
+ if(!$defined(ua))
+ return [true];
+
+ if(Browser.Engine.ipod || ua.indexOf("KHTML") != -1)
+ return [false, false];
+
+ return [true];
+ }
+ }],
[2, "DEDICATED_MSG_WINDOW", "Send privmsgs to dedicated messages window", false],
[4, "DEDICATED_NOTICE_WINDOW", "Send notices to dedicated message window", false],
[3, "NICK_OV_STATUS", "Show status (@/+) before nicknames in nicklist", true],
initialize: function(parent, option, position, parentObject) {
this.option = option;
this.value = option.value;
+ this.enabled = this.option.enabled;
this.position = position;
this.parentElement = parent;
this.parentObject = parentObject;
this.mainElement = i;
i.value = this.value;
-
+ i.disabled = !this.enabled;
+
this.parent();
},
get: function() {
this.mainElement = i;
i.checked = this.value;
-
+ i.disabled = !this.enabled;
+
this.parent();
},
get: function() {
var value = this.option.options;
this.elements = [];
-
+
for(var i=0;i<value.length;i++) {
var d = this.FE("div", this.parentObject);
var e = this.createInput("radio", d, "options_radio" + this.position, i == this.option.position);
this.elements.push(e);
-
+ e.disabled = !this.enabled;
+
if(i == 0)
this.mainElement = e;
this.default_ = default_;
this.optionId = optionId;
this.extras = extras;
+
+ if($defined(extras) && $defined(extras.enabled)) {
+ var enabledResult = extras.enabled();
+ this.enabled = enabledResult[0];
+
+ if(!enabledResult[0] && enabledResult.length > 1)
+ this.default_ = enabledResult[1];
+ } else {
+ this.enabled = true;
+ }
},
setSavedValue: function(x) {
this.value = x;