usoCheckup - Otto Install Theme

By Marti Last update Dec 1, 2011 — Installed 902 times.

There are 7 previous versions of this script.

(function() {

// ==UserScript==
// @name          usoCheckup - Otto Install Theme
// @namespace     http://userscripts.org/users/37004
// @description   Theme for usoCheckup that has no confirmation prompts other then GM's install dialog
// @copyright     2009+, Marti Martz (http://userscripts.org/users/37004)
// @license       GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @license       (CC); http://creativecommons.org/licenses/by-nc-sa/3.0/
// @version       0.0.7
// @exclude *
// ==/UserScript==

  if (typeof usoCheckup != "undefined")
    usoCheckup.widgets("alert", function(details) {
      var remoteVersion = parseInt((typeof details.remoteMeta["uso"]["version"] == "string") ? details.remoteMeta["uso"]["version"] : details.remoteMeta["uso"]["version"][details.remoteMeta["uso"]["version"].length - 1]);
      var localVersion = parseInt((typeof usoCheckup.localMeta["uso"]["version"] == "string") ? usoCheckup.localMeta["uso"]["version"] : usoCheckup.localMeta["uso"]["version"][usoCheckup.localMeta["uso"]["version"].length - 1]);

      if (remoteVersion > localVersion)
        if (!details.mismatched && !details.unlisted)
          switch (usoCheckup.updateUrl["default"]) {
            case "update":
              usoCheckup.openUrl(usoCheckup.updateUrl["install"].replace(/\/source\/(\d+)\.user\.js$/, "/version/$1/" + remoteVersion + ".user.js"));
              break;
            default:
              usoCheckup.openUrl(usoCheckup.updateUrl["install"]);
              break;
          }
    });

})();