Permalink
Browse files

move install folder to install.html and projecte.zip to package.zip

  • Loading branch information...
1 parent 6901589 commit 65621a8f8c3cc93cb1b6b1e2a4e67946a74f122f @swznd swznd committed Jan 21, 2013
Showing with 23 additions and 160 deletions.
  1. +16 −0 install.html
  2. +0 −157 install/index.html
  3. +1 −3 manifest.webapp
  4. +6 −0 package.manifest
  5. BIN package.zip
  6. BIN projecte.zip
View
@@ -0,0 +1,16 @@
+<html>
+ <body>
+ <p>Packaged app installation page</p>
+ <script>
+ var manifestUrl = window.location.href.replace('install.html','')+'package.manifest';
+ alert(manifestUrl);
+ var req = navigator.mozApps.installPackage(manifestUrl);
+ req.onsuccess = function() {
+ alert(this.result.origin);
+ };
+ req.onerror = function() {
+ alert(this.error.name);
+ };
+ </script>
+ </body>
+</html>
View
@@ -1,157 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8">
- <script>
- 'use strict';
-
- /**
- * Detects if the current app has been installed.
- *
- * See https://github.com/wavysandbox/install/blob/master/README.md
- * for details on how to use.
- *
- */
- function install() {
- var fn = install[install.type + 'Install'];
- if (fn) {
- fn();
- } else {
- install.trigger('error', 'unsupported install: ' + install.type);
- }
- }
-
- function triggerChange(state) {
- install.state = state;
- install.trigger('change', install.state);
- }
-
- /**
- * The install state. Values are:
- * 'unknown': the code has not tried to detect any state.
- *
- * @type {String}
- */
- install.state = 'unknown';
-
- install.check = function () {
- var apps = navigator.mozApps,
- request;
-
- if (navigator.mozApps) {
- //Mozilla web apps
- install.type = 'mozilla';
- request = navigator.mozApps.getSelf();
- request.onsuccess = function () {
- if (this.result) {
- triggerChange('installed');
- } else {
- triggerChange('uninstalled');
- }
- };
-
- request.onerror = function (err) {
- // Just console log it, no need to bother the user.
- install.error = err;
- triggerChange('error');
- };
-
- } else if (typeof chrome !== 'undefined' &&
- chrome.webstore &&
- chrome.app) {
- //Chrome web apps
- install.type = 'chromeStore';
- if (chrome.app.isInstalled) {
- triggerChange('installed');
- } else {
- triggerChange('uninstalled');
- }
- } else if (typeof window.navigator.standalone !== 'undefined') {
- install.type = 'ios';
- if (window.navigator.standalone) {
- triggerChange('installed');
- } else {
- triggerChange('uninstalled');
- }
- } else {
- install.type = 'unsupported';
- triggerChange('unsupported');
- }
- };
-
- /* Mozilla/Firefox installation */
- install.mozillaInstallUrl = location.href + '../manifest.webapp';
- install.mozillaInstall = function () {
- var installRequest = navigator.mozApps.install(install.mozillaInstallUrl);
-
- installRequest.onsuccess = function (data) {
- triggerChange('installed');
- };
-
- installRequest.onerror = function (err) {
- install.error = err;
- triggerChange('error');
- };
- };
-
- /* Chrome installation */
- install.chromeInstallUrl = null;
- install.chromeInstall = function () {
- chrome.webstore.install(install.chromeInstallUrl,
- function () {
- triggerChange('installed');
- }, function (err) {
- install.error = err;
- triggerChange('error');
- });
- };
-
- /* iOS installation */
- //Right now, just asks that something show a UI
- //element mentioning how to install using the Safari
- //"Add to Home Screen" button.
- install.iosInstall = function () {
- install.trigger('showiOSInstall', navigator.platform.toLowerCase());
- };
-
- //Allow install to do events.
- var events = {};
-
- install.on = function(name, func) {
- events[name] = (events[name] || []).concat([func]);
- };
-
- install.off = function(name, func) {
- if(events[name]) {
- var res = [];
-
- for(var i=0, l=events[name].length; i<l; i++) {
- var f = events[name][i];
- if(f != func) {
- res.push();
- }
- }
-
- events[name] = res;
- }
- };
-
- install.trigger = function(name) {
- var args = Array.prototype.slice.call(arguments, 1);
-
- if(events[name]) {
- for(var i=0, l=events[name].length; i<l; i++) {
- events[name][i].apply(this, args);
- }
- }
- };
-
-
- //Start up the checks
- install.check();
- </script>
- </head>
- <body>
- <button onclick="install()">Install</button>
- </body>
-</html>
View
@@ -1,10 +1,8 @@
{
"version": "0.1",
"name": "Project E",
- "package_path": "http://beetlebox.github.com/firefoxos-001/projecte.zip",
- "size" : 3067102,
- "relase_notes": "Test Release",
"launch_path" : "/index.html",
+ "description": "Test Description",
"icons": {
"16": "/img/icons/mortar-16.png",
"48": "/img/icons/mortar-48.png",
View
@@ -0,0 +1,6 @@
+{
+ "name": "Project E",
+ "package_path": "http://beetlebox.github.com/firefoxos-001/package.zip",
+ "size": 2963648,
+ "version": "1.0"
+}
View
Binary file not shown.
View
Binary file not shown.

0 comments on commit 65621a8

Please sign in to comment.