add in settings for staging, update extension version number, start a bit of refactoring on first run detection.

This commit is contained in:
jrburke 2010-11-19 12:30:32 -08:00
Родитель d02fdb4317
Коммит e5d3008e65
5 изменённых файлов: 51 добавлений и 32 удалений

Просмотреть файл

@ -11,7 +11,7 @@ static_dir=$(TOPSRCDIR)/web-static
webbuild_dir=$(TOPSRCDIR)/tools/webbuild webbuild_dir=$(TOPSRCDIR)/tools/webbuild
requirejs_dir=$(webbuild_dir)/requirejs requirejs_dir=$(webbuild_dir)/requirejs
version := 0.7.1 version := 0.7.2
ifeq ($(release_build),) ifeq ($(release_build),)
xpi_type := dev xpi_type := dev

Просмотреть файл

@ -37,6 +37,12 @@ var FFSHARE_EXT_ID = "ffshare@mozilla.org";
Components.utils.import("resource://ffshare/modules/injector.js"); Components.utils.import("resource://ffshare/modules/injector.js");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
// This add-on manager is only available in Firefox 4+
try {
Components.utils.import("resource://gre/modules/AddonManager.jsm");
} catch (e) {
}
var slice = Array.prototype.slice, var slice = Array.prototype.slice,
ostring = Object.prototype.toString, ostring = Object.prototype.toString,
empty = {}, fn, empty = {}, fn,
@ -583,39 +589,51 @@ var FFSHARE_EXT_ID = "ffshare@mozilla.org";
errorPage: 'chrome://ffshare/content/down.html', errorPage: 'chrome://ffshare/content/down.html',
addButton: function () {
// Place the button in the toolbar. This should only be called
// on first install or upgrade.
try {
//Not needed since we add to the end.
//var afterId = "urlbar-container"; // ID of element to insert after
var navBar = document.getElementById("nav-bar"),
curSet = navBar.currentSet.split(","), set;
if (curSet.indexOf(buttonId) === -1) {
//The next two lines place it between url and search bars.
//pos = curSet.indexOf(afterId) + 1 || curSet.length;
//var set = curSet.slice(0, pos).concat(buttonId).concat(curSet.slice(pos));
//Add it to the end of the toolbar.
set = curSet.concat(buttonId).join(",");
navBar.setAttribute("currentset", set);
navBar.currentSet = set;
document.persist(navBar.id, "currentset");
try {
BrowserToolboxCustomizeDone(true);
}
catch (e) {}
}
}
catch (e) {}
},
onLoad: function () { onLoad: function () {
// initialization code // initialization code
if (this.firstRun) { if (this.firstRun) {
// Place the button in the toolbar on first load. this.addButton();
try {
//Not needed since we add to the end.
//var afterId = "urlbar-container"; // ID of element to insert after
var navBar = document.getElementById("nav-bar"),
curSet = navBar.currentSet.split(","), set;
if (curSet.indexOf(buttonId) === -1) {
//The next two lines place it between url and search bars.
//pos = curSet.indexOf(afterId) + 1 || curSet.length;
//var set = curSet.slice(0, pos).concat(buttonId).concat(curSet.slice(pos));
//Add it to the end of the toolbar.
set = curSet.concat(buttonId).join(",");
navBar.setAttribute("currentset", set);
navBar.currentSet = set;
document.persist(navBar.id, "currentset");
try {
BrowserToolboxCustomizeDone(true);
}
catch (e) {}
}
}
catch (e) {}
//Register first run listener. //Register first run listener.
gBrowser.getBrowserForTab(gBrowser.selectedTab).addProgressListener(firstRunProgressListener, Components.interfaces.nsIWebProgress.STATE_DOCUMENT); gBrowser.getBrowserForTab(gBrowser.selectedTab).addProgressListener(firstRunProgressListener, Components.interfaces.nsIWebProgress.STATE_DOCUMENT);
this.addedFirstRunProgressListener = true; this.addedFirstRunProgressListener = true;
} }
//Figure out if this is a first install/upgrade case.
if (typeof AddonManager !== 'undefined') {
AddonManager.getAddonByID(FFSHARE_EXT_ID, function (addon) {
log("My extension's version is [" + addon.version + "]");
});
}
try { try {
gBrowser.addProgressListener(canShareProgressListener); gBrowser.addProgressListener(canShareProgressListener);
} catch (e) { } catch (e) {
@ -805,6 +823,8 @@ var FFSHARE_EXT_ID = "ffshare@mozilla.org";
if (!ffshare.shareUrl) { if (!ffshare.shareUrl) {
if (ffshare.system === 'dev') { if (ffshare.system === 'dev') {
ffshare.shareUrl = 'http://linkdrop.caraveo.com:5000/share/'; ffshare.shareUrl = 'http://linkdrop.caraveo.com:5000/share/';
} else if (ffshare.system === 'staging') {
ffshare.shareUrl = 'https://f1-staging.mozillamessaging.com/share/';
} else { } else {
ffshare.shareUrl = 'https://f1.mozillamessaging.com/share/'; ffshare.shareUrl = 'https://f1.mozillamessaging.com/share/';
} }
@ -813,6 +833,8 @@ var FFSHARE_EXT_ID = "ffshare@mozilla.org";
if (!ffshare.frontpageUrl) { if (!ffshare.frontpageUrl) {
if (ffshare.system === 'dev') { if (ffshare.system === 'dev') {
ffshare.frontpageUrl = 'http://linkdrop.caraveo.com:5000/'; ffshare.frontpageUrl = 'http://linkdrop.caraveo.com:5000/';
} else if (ffshare.system === 'staging') {
ffshare.frontpageUrl = 'http://f1-staging.mozillamessaging.com/';
} else { } else {
ffshare.frontpageUrl = 'http://f1.mozillamessaging.com/'; ffshare.frontpageUrl = 'http://f1.mozillamessaging.com/';
} }

Просмотреть файл

@ -4,7 +4,7 @@
<em:id>ffshare@mozilla.org</em:id> <em:id>ffshare@mozilla.org</em:id>
<em:type>2</em:type> <em:type>2</em:type>
<em:name>F1 by Mozilla Labs</em:name> <em:name>F1 by Mozilla Labs</em:name>
<em:version>0.7.1</em:version> <em:version>0.7.2</em:version>
<em:creator>Mozilla</em:creator> <em:creator>Mozilla</em:creator>
<em:contributor></em:contributor> <em:contributor></em:contributor>
<em:homepageURL>http://f1.mozillamessaging.com/</em:homepageURL> <em:homepageURL>http://f1.mozillamessaging.com/</em:homepageURL>

Просмотреть файл

@ -7,6 +7,8 @@
* HTML5/FF friendly option for the video - Bryan * HTML5/FF friendly option for the video - Bryan
* Support long URLs better: - Shane * Support long URLs better: - Shane
* Make sure db can deal with long urls better (used to minimize bitly shortenings) * Make sure db can deal with long urls better (used to minimize bitly shortenings)
* Build xpi on staging box - Gozer
* For staging box, reference staging xpi for the install button.
* Email template design - Andy * Email template design - Andy
* optional bugs * optional bugs
* HTML5 autocomplete - James * HTML5 autocomplete - James

Просмотреть файл

@ -61,15 +61,10 @@ body.status {
} }
/* Turn off some things if not in dev */ /* Turn off some things if not in dev */
html.staging body li.debugTab,
html.prod body li.debugTab { html.prod body li.debugTab {
display: none; display: none;
} }
/*
html.prod body li.gmailTab,
html.prod body #settings li.gmailSettings {
display: none;
}
*/
a { a {
text-decoration: none; text-decoration: none;