From abd2dadb45597e14ca8bba81c928acfebb532e0d Mon Sep 17 00:00:00 2001 From: nojhan Date: Mon, 3 Dec 2012 00:16:14 +0100 Subject: [PATCH] main app code and some default modules --- www/css/app.css | 9 +++ www/css/install-button.css | 20 +++++ www/js/app.js | 145 +++++++++++++++++++++++++++++++++++ www/js/init.js | 5 ++ www/js/install-button.js | 41 ++++++++++ www/js/lib/install.js | 153 +++++++++++++++++++++++++++++++++++++ www/js/lib/require.js | 34 +++++++++ 7 files changed, 407 insertions(+) create mode 100644 www/css/app.css create mode 100644 www/css/install-button.css create mode 100644 www/js/app.js create mode 100644 www/js/init.js create mode 100644 www/js/install-button.js create mode 100644 www/js/lib/install.js create mode 100644 www/js/lib/require.js diff --git a/www/css/app.css b/www/css/app.css new file mode 100644 index 0000000..c81f71b --- /dev/null +++ b/www/css/app.css @@ -0,0 +1,9 @@ + +/* Tip: Use "@import" to add styles instead of adding 's in your + HTML, and volo will inline it when building for production */ + +/* Styles for the installation button */ +@import "install-button.css"; + +/* Your styles here */ + diff --git a/www/css/install-button.css b/www/css/install-button.css new file mode 100644 index 0000000..ed0d408 --- /dev/null +++ b/www/css/install-button.css @@ -0,0 +1,20 @@ +#install-btn { + background: #0088cc; /* Old browsers */ + background: -moz-linear-gradient(top, #0088cc 0%, #0055cc 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0088cc), color-stop(100%,#0055cc)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #0088cc 0%,#0055cc 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #0088cc 0%,#0055cc 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #0088cc 0%,#0055cc 100%); /* IE10+ */ + background: linear-gradient(to bottom, #0088cc 0%,#0055cc 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0088cc', endColorstr='#0055cc',GradientType=0 ); /* IE6-9 */ + + text-align: center; + font-size: 200%; + margin: 1em auto; + display: block; + padding: .5em; + color: white; + width: 10em; + max-width: 80%; + line-height: 1.2em; +} \ No newline at end of file diff --git a/www/js/app.js b/www/js/app.js new file mode 100644 index 0000000..6889dcc --- /dev/null +++ b/www/js/app.js @@ -0,0 +1,145 @@ + +require.config({ + baseUrl: 'js/lib', + paths: {'jquery': + ['//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min', + 'jquery']}, + +}); + + +// This uses require.js to structure javascript: +// http://requirejs.org/docs/api.html#define + +define(function(require) { + + // jQuery + var $ = require("jquery"); + //var $ = require("http://code.jquery.com/jquery-1.7.1.min.js"); + + // Need to verify receipts? This library is included by default. + // https://github.com/mozilla/receiptverifier + require('receiptverifier'); + + // Want to install the app locally? This library hooks up the + // installation button. See