[extensions-web] Properly comment the source of versionCheck/ExtensionState.



commit 03ef087e15ea5a3a18009566a5a1836f5b60345d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Sep 23 00:07:21 2011 -0400

    Properly comment the source of versionCheck/ExtensionState.

 sweettooth/static/js/extensions.js |   42 ++++++++++++++++++-----------------
 1 files changed, 22 insertions(+), 20 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 52a057a..f622179 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -3,9 +3,13 @@
 define(['jquery', 'messages', 'dbus!_',
         'switch', 'jquery.tipsy'],
 function($, messages, dbusProxy) {
+
+    // ExtensionState and versionCheck are stolen and should
+    // be kept in sync those from the Shell.
+    // Licensed under GPL2+
+    // See: http://git.gnome.org/browse/gnome-shell/tree/js/ui/extensionSystem.js
+
     var ExtensionState = {
-        // These constants should be kept in sync
-        // with those in gnome-shell: see js/ui/extensionSystem.js
         ENABLED: 1,
         DISABLED: 2,
         ERROR: 3,
@@ -17,6 +21,22 @@ function($, messages, dbusProxy) {
         UNINSTALLED: 99
     };
 
+    function versionCheck(required, current) {
+        var currentArray = current.split('.');
+        var major = currentArray[0];
+        var minor = currentArray[1];
+        var point = currentArray[2];
+        for (var i = 0; i < required.length; i++) {
+            var requiredArray = required[i].split('.');
+            if (requiredArray[0] == major &&
+                requiredArray[1] == minor &&
+                (requiredArray[2] == point ||
+                 (requiredArray[2] == undefined && parseInt(minor) % 2 == 0)))
+                return true;
+        }
+        return false;
+    }
+
     // While technically we shouldn't have mismatched API versions,
     // the plugin doesn't check whether the Shell matches, so if someone
     // is running with an old Shell version but a newer plugin, error out.
@@ -40,24 +60,6 @@ function($, messages, dbusProxy) {
         };
     }
 
-    // This is stolen from the Shell:
-    // http://git.gnome.org/browse/gnome-shell/tree/js/ui/extensionSystem.js
-    function versionCheck(required, current) {
-        var currentArray = current.split('.');
-        var major = currentArray[0];
-        var minor = currentArray[1];
-        var point = currentArray[2];
-        for (var i = 0; i < required.length; i++) {
-            var requiredArray = required[i].split('.');
-            if (requiredArray[0] == major &&
-                requiredArray[1] == minor &&
-                (requiredArray[2] == point ||
-                 (requiredArray[2] == undefined && parseInt(minor) % 2 == 0)))
-                return true;
-        }
-        return false;
-    }
-
     // uuid => elem
     var elems = {};
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]