diff chrome/content/dialogs/update.js @ 0:c14d52a3b2fe

initial import
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 11 Aug 2008 20:34:21 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chrome/content/dialogs/update.js	Mon Aug 11 20:34:21 2008 +0900
@@ -0,0 +1,33 @@
+
+function tinyurl_update_notifyToggle(){
+
+	try{
+		var oPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("");
+			oPrefs.setBoolPref("tinyurl.update.notify", !document.getElementById("tinyurl.update.notify").checked);
+	}catch(err){}
+	
+	return true;
+}
+
+function tinyurl_update_install(){
+	try{
+		//Window Argument is update XPI
+		if(window.arguments.length > 0 && typeof(window.arguments[0]) != 'undefined'){
+						
+			var aInstall = new Array();
+				aInstall["TinUrl"] = window.arguments[0];
+				
+			InstallTrigger.install(aInstall, null);
+		}
+		//If no update XPI, redirect to download site
+		else{
+			window.open(gTinyUrl_DownloadSite).focus();
+			
+			if(opener != null)
+				opener.close();
+			self.close();
+		}
+	}catch(err){alert("An unknown error ocurred.\nCould not upgrade.")}
+	
+	return true;
+}
\ No newline at end of file