[Pkg-mozext-commits] [tabmixplus] 04/14: The value of 30sec is not stored in the list of the last values in the autoreload list
David Prévot
taffit at moszumanska.debian.org
Sun Oct 5 15:44:56 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch debian-0.4.1.5
in repository tabmixplus.
commit a4f6760c0e583f3b83761f83ba003b083c9be6d5
Author: onemen <tabmix.onemen at gmail.com>
Date: Sat Sep 27 13:23:48 2014 +0300
The value of 30sec is not stored in the list of the last values in the autoreload list
---
chrome/content/minit/autoReload.js | 15 ++++++++++++++-
chrome/content/minit/autoReload.xul | 11 ++---------
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/chrome/content/minit/autoReload.js b/chrome/content/minit/autoReload.js
index 9d78ca8..fd5667f 100644
--- a/chrome/content/minit/autoReload.js
+++ b/chrome/content/minit/autoReload.js
@@ -14,7 +14,7 @@ function accept() {
gPref.setIntPref("extensions.tabmix.reload_time", customReloadTime);
var list = gPref.getCharPref("extensions.tabmix.custom_reload_list");
list = list ? list.split(",") : [];
- let defaultList = [30,60,120,300,900,1800];
+ let defaultList = [60,120,300,900,1800];
if (list.concat(defaultList).indexOf(customReloadTime) == -1) {
list.push(customReloadTime);
if (list.length > 6 )
@@ -43,3 +43,16 @@ function getCustomReloadTime() {
function disable_OK() {
document.documentElement.getButton("accept").disabled = getCustomReloadTime() == 0;
}
+
+function onInput(item) {
+ item.value = parseInt(item.value);
+ if (item.value == 'NaN')
+ item.value = '';
+ let val = Number(item.value);
+ if (val < 0)
+ item.value = -item.value;
+ if (item.id == "autoreload_seconds" && val > 59)
+ item.value = 59;
+
+ disable_OK();
+}
diff --git a/chrome/content/minit/autoReload.xul b/chrome/content/minit/autoReload.xul
index a0f6fd1..1c00f70 100644
--- a/chrome/content/minit/autoReload.xul
+++ b/chrome/content/minit/autoReload.xul
@@ -22,10 +22,7 @@
<caption label="&reloadtime.label1;" />
<menulist id="autoreload_minutes" editable="true"
oncommand="disable_OK();"
- oninput="this.value=parseInt(this.value);
- if (this.value=='NaN') this.value='';
- if (Number(this.value) < 0) this.value = -this.value;
- disable_OK();">
+ oninput="onInput(this);">
<menupopup>
<menuitem value="0" label="0" />
<menuitem value="1" label="1" />
@@ -40,11 +37,7 @@
<menulist id="autoreload_seconds" editable="true"
oncommand="disable_OK();"
- oninput="this.value=parseInt(this.value);
- if (this.value=='NaN') this.value='';
- if (Number(this.value) < 0) this.value = -this.value;
- if (Number(this.value) > 59) this.value = 59;
- disable_OK();">
+ oninput="onInput(this);">
<menupopup>
<menuitem value="0" label="0" />
<menuitem value="10" label="10" />
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list