Permalink
Browse files

Tweaks to get things working with Mozilla app preview

  • Loading branch information...
lmorchard committed Dec 13, 2011
1 parent f146946 commit 7ca6396f4edfda3ff88f3895a4d2189adf6e0880
Showing with 15 additions and 24 deletions.
  1. +0 −2 app.html
  2. +2 −2 app.webapp
  3. +3 −4 js/sideband/main.js
  4. +10 −16 js/sideband/views.js
View
@@ -93,9 +93,7 @@ <h1><img src="img/icon.jpg" width="32" height="32" />Sideband</h1>
<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
@@ -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
@@ -16,21 +16,20 @@ var Sideband_main = {
$this.setupFeeds();
$this.setupEvents();
- if ('mozApps' in navigator) {
- $this.setupApp();
- }
+ $this.setupApp();
});
return this;
},
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
@@ -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);
}
});

0 comments on commit 7ca6396

Please sign in to comment.