[Pkg-mozext-commits] [tabmixplus] 02/61: Show the new version page for all official versions and for development versions if auto update is on for Tabmix and the new version is from a different date then the installed version

David Prévot taffit at moszumanska.debian.org
Fri Aug 28 19:09:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit e84e025f9e8b8b29fa816fb335690e8601638fc6
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Jul 3 23:36:35 2015 +0300

    Show the new version page for all official versions and for development versions if auto update is on for Tabmix and the new version is from a different date then the installed version
---
 chrome/content/tab/tab.js | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index f54ec2e..4b3567f 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -2375,7 +2375,7 @@ try {
     // 2011-01-22 - verify sessionstore enabled
     Services.prefs.clearUserPref("browser.sessionstore.enabled");
 
-    let getVersion = function _getVersion(currentVersion) {
+    let getVersion = function _getVersion(currentVersion, shouldAutoUpdate) {
       let oldVersion = Tabmix.prefs.prefHasUserValue("version") ? Tabmix.prefs.getCharPref("version") : "";
 
       let vCompare = function(a, b) Services.vc.compare(a, b) <= 0;
@@ -2398,11 +2398,17 @@ try {
       if (currentVersion != oldVersion) {
         Tabmix.prefs.setCharPref("version", currentVersion);
         Services.prefs.savePrefFile(null);
-        // show the new version page if versions are different after excluding
-        // all characters from last alphabet character to the end
-        let re = /([A-Za-z]*)\d*$/;
-        let subs = function(obj) obj[1] ? obj.input.substring(0, obj.index) : obj.input;
-        showNewVersionTab = subs(re.exec(currentVersion)) != subs(re.exec(oldVersion));
+        // show the new version page for all official versions and for development
+        // versions if auto update is on for Tabmix and the new version is from a
+        // different date then the installed version
+        let isDevBuild = /[A-Za-z]/.test(currentVersion);
+        if (!isDevBuild)
+          showNewVersionTab = true;
+        else if (shouldAutoUpdate || oldVersion === "") {
+          let re = /([A-Za-z]*)\d*$/;
+          let subs = function(obj) obj[1] ? obj.input.substring(0, obj.index) : obj.input;
+          showNewVersionTab = subs(re.exec(currentVersion)) != subs(re.exec(oldVersion));
+        }
       }
       if (showNewVersionTab) {
         // open Tabmix page in a new tab
@@ -2421,7 +2427,8 @@ try {
     };
     AddonManager.getAddonByID("{dc572301-7619-498c-a57d-39143191b318}", function(aAddon) {
       try {
-        getVersion(aAddon.version);
+        let shouldAutoUpdate = AddonManager.shouldAutoUpdate(aAddon);
+        getVersion(aAddon.version, shouldAutoUpdate);
       } catch (ex) {Tabmix.assert(ex);}
     });
 

-- 
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