Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaks to get things working with Mozilla app preview

  • Loading branch information...
commit 7ca6396f4edfda3ff88f3895a4d2189adf6e0880 1 parent f146946
@lmorchard authored
View
2  app.html
@@ -93,9 +93,7 @@
<form class="global-actions needs-login">
<fieldset>
- <!--
<button class="installApp"><span>Install App</span></button>
- -->
<button class="editPrefs"><span>Prefs</span></button>
<button class="logout"><span>Logout</span></button>
</fieldset>
View
4 app.webapp
@@ -7,8 +7,8 @@
"url": "http://lmorchard.com/"
},
"installs_allowed_from": [ "*" ],
- "launch_path": "http://s3.amazonaws.com/sideband/app.html",
+ "launch_path": "/sideband/app.html",
"icons": {
- "32": "http://s3.amazonaws.com/sideband/img/icon.jpg"
+ "32": "/sideband/img/icon.jpg"
}
}
View
7 js/sideband/main.js
@@ -16,9 +16,7 @@ var Sideband_main = {
$this.setupFeeds();
$this.setupEvents();
- if ('mozApps' in navigator) {
- $this.setupApp();
- }
+ $this.setupApp();
});
@@ -26,11 +24,12 @@ var Sideband_main = {
},
setupApp: function () {
+ if (!('mozApps' in navigator)) { return; }
var $this = this;
- return;
navigator.mozApps.amInstalled(function (data) {
$this.app_data = data;
console.log("APP IS INSTALLED");
+ $('button.installApp').hide();
});
},
View
26 js/sideband/views.js
@@ -140,27 +140,21 @@ var Sideband_Views_App = Backbone.View.extend({
installApp: function (ev) {
var $this = this;
- console.log("INSTALL THE APP");
- try {
- navigator.mozApps.install(
- "http://s3.amazonaws.com/sideband/app.webapp", null,
- function (result) {
- console.log("INSTALL", result);
- },
- function (result) {
- console.log("INSTALL FAIL", result);
- }
- );
- console.log("CALLED INSTALL");
- } catch (e) {
- console.error(e);
- }
+ navigator.mozApps.install(
+ "/sideband/app.webapp",
+ null,
+ function (result) {
+ window.alert("Thanks for installing Sideband. Check your App Dashboard!");
+ },
+ function (result) {
+ }
+ );
return false;
},
alert: function(msg) {
window.alert(msg);
- console.log("ACHTUNG! " + msg);
+ console.log("ALERT! " + msg);
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.