Permalink
Browse files

Open home page for every update

  • Loading branch information...
1 parent d2ff87e commit 0dbcb8ad48c65e59eadba5deb2b28c17345b6716 @chao committed Apr 20, 2012
Showing with 24 additions and 4 deletions.
  1. +3 −0 README.md
  2. +0 −1 content/js/restclient.js
  3. +21 −3 content/js/restclient.overlay.js
View
3 README.md
@@ -11,6 +11,9 @@
* Remember open response tab
* Fixed request url input box size bug
* Support Firefox 12
+ * Allow user to load old requests (exported by version 1.3.x)
+ * Updated favorite url, add a drop down list for showing favorite URLs
+ * Updated UI color, to enhance the request form
* Version 2.0.0
* Re-designed the UI by using [twitter bootstrap](twitter.github.com/bootstrap/)
View
1 content/js/restclient.js
@@ -55,7 +55,6 @@ if (typeof (restclient) === "undefined") {
} catch (e) {
console.error(n);
console.error(JSON.stringify(arg));
- console.error(i18nStrings.get(n));
console.error(e.message);
}
}
View
24 content/js/restclient.overlay.js
@@ -29,25 +29,43 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"use strict";
restclient.overlay = {
+
init : function() {
restclient.init();
restclient.overlay.firstRun();
},
+ getBrowser: function(){
+ var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+ .getInterface(Components.interfaces.nsIWebNavigation)
+ .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
+ .rootTreeItem
+ .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+ .getInterface(Components.interfaces.nsIDOMWindow);
+ return mainWindow.gBrowser;
+ },
firstRun : function() {
- var firstRunPref = "firstRunDone";
+ var firstRunPref = "firstRunDone",
+ versionPref = "version",
+ versionNumber = "2.0.1",
+ browser = restclient.overlay.getBrowser();
+
if(!restclient.getPref(firstRunPref, false))
{
var navbar = document.getElementById("nav-bar");
var newset = navbar.currentSet + ',restclient-navbar-button';
navbar.currentSet = newset;
navbar.setAttribute("currentset", newset );
document.persist("nav-bar", "currentset");
- gBrowser.selectedTab = gBrowser.addTab("http://www.restclient.net/");
restclient.setPref(firstRunPref, true);
}
+ if(restclient.getPref(versionPref, '') != versionNumber) {
+ browser.selectedTab = browser.addTab("http://www.restclient.net/?browser=firefox&version=" + versionNumber);
+ restclient.setPref(versionPref, versionNumber);
+ }
},
open: function(){
- gBrowser.selectedTab = gBrowser.addTab("chrome://restclient/content/restclient.html");
+ var browser = restclient.overlay.getBrowser();
+ browser.selectedTab = browser.addTab("chrome://restclient/content/restclient.html");
}
}
window.addEventListener("load", function(){ restclient.overlay.init(); }, false);

0 comments on commit 0dbcb8a

Please sign in to comment.