Symbian.org/Main.js
changeset 3 9cbe91927e89
parent 2 99bc8e56b756
child 4 cb6368112727
--- a/Symbian.org/Main.js	Mon Jun 08 13:27:04 2009 +0100
+++ b/Symbian.org/Main.js	Tue Jun 09 13:59:04 2009 +0100
@@ -46,7 +46,7 @@
 var wikiBaseUrl = symbianOrgBaseUrl+"/wiki/index.php";
 
 // Update variables
-var myversion = "1.0rc5";
+var myversion = "1.0rc6";
 var versionWikiPageUrl = wikiBaseUrl + "/Symbian.org_WRT_Widget";
 var versionWikiPageString = "Current widget version is [";
 var downloadUrl = symbianOrgBaseUrl + "/wiki/images/c/c5/Symbian.org.wgz";
@@ -319,7 +319,7 @@
 	uiManager.showNotification(-1, "wait", "Checking for updates...", -1);
 	updatePageAjax = new Ajax();
 	updatePageAjax.onreadystatechange = checkForUpdatesStage2;
-	updatePageAjax.open('GET', versionWikiPageUrl, true);
+	updatePageAjax.open('GET', nocache(versionWikiPageUrl), true);
 	updatePageAjax.send(null);	
 }
 
@@ -345,7 +345,7 @@
 			if (answer) {
 				// ok, we have the update
 				uiManager.hideNotification();
-				openURL(downloadUrl);
+				openURL(nocache(downloadUrl));
 				setTimeout(function () {window.close();}, 1000);
 			} else {
 			uiManager.showNotification(3000, "info", "Update cancelled.");
@@ -409,3 +409,13 @@
 		widget.setPreferenceForKey(sizestring, "fontsize");
 	}
 }
+
+function nocache(url) {
+    if (url.indexOf("?") == -1) {
+        url += "?";
+    } else {
+        url += "&";
+    }
+    url += "nocache=" + (new Date().getTime());
+	return url;
+}