Browse files

add app manifest/etc, and helper page

  • Loading branch information...
1 parent 5419f81 commit 055ca055cdb61a27bf786d5dbbc1c0c89a309520 @ianb committed Apr 16, 2012
Showing with 96 additions and 1 deletion.
  1. BIN 128.png
  2. BIN 16.png
  3. BIN 32.png
  4. BIN 48.png
  5. BIN 64.png
  6. +72 −1 index.html
  7. +24 −0 manifest.webapp
View
BIN 128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN 16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN 32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN 48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN 64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
73 index.html
@@ -1 +1,72 @@
-Hi, this is app1.ianbicking.org
+<html>
+ <head>
+ <title>app1</title>
+ <script src="https://myapps.mozillalabs.com/jsapi/include.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+ <style>
+ .status {
+ border: 2px solid #000;
+ background-color: #999;
+ }
+ </style>
+ <script>
+$(function () {
+ function setInstalled() {
+ var pending = navigator.mozApps.getSelf();
+ pending.onsuccess = function () {
+ if (this.result) {
+ $('#unknown').hide();
+ $('#uninstalled').hide();
+ $('#installed').show();
+ } else {
+ $('#unknown').hide();
+ $('#installed').hide();
+ $('#uninstalled').show();
+ }
+ };
+ pending.onerror = function () {
+ alert('Error in getSelf: ' + this.error);
+ };
+ }
+
+ setInstalled();
+
+ $('#install').click(function () {
+ var pending = navigator.mozApps.install('/manifest.webapp');
+ pending.onsuccess = function () {
+ setInstalled();
+ };
+ pending.onerror = function () {
+ if (this.error == 'DENIED' || this.error.name == 'DENIED') {
+ return;
+ }
+ alert('Error in install: ' + this.error);
+ };
+ });
+});
+
+ </script>
+
+ </head>
+ <body>
+ <div>
+ Welcome to <code>app1</code>
+ </div>
+
+ <div>The manifest is located at <a
+ href="http://app1.ianbicking.org/manifest.webapp">http://app1.ianbicking.org/manifest.webapp</a>
+ </div>
+
+ <div>Installation status is:
+
+ <div id="unknown" class="status">Unknown</div>
+ <div id="installed" class="status" style="display: none">Installed</div>
+ <div id="uninstalled" class="status" style="display: none">Uninstalled</div>
+
+ </div>
+
+ <div>To install or reinstall:
+ <button type="button" id="install">Install</button>
+ </div>
+
+</body>
View
24 manifest.webapp
@@ -0,0 +1,24 @@
+{
+ "name": "Fancy app1",
+ "description": "This is just a test app, to be used for testing and whatnot.\n\nPay no attention!",
+ "icons": {
+ "16": "/16.png",
+ "32": "/32.png",
+ "48": "/48.png",
+ "64": "/64.png",
+ "128": "/128.png"
+ },
+ "developer": {
+ "name": "Mozilla Labs / Ian Bicking",
+ "url": "http://ianbicking.org"
+ },
+ "installs_allowed_from": ["*"],
+ "default_locale": "en",
+ "locales": {
+ "es": {
+ "name": "app de lujo"
+ }
+ }
+}
+
+

0 comments on commit 055ca05

Please sign in to comment.