diff --git a/README.md b/README.md index fb7298a..16a28c3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ A javascript library providing server defined loading of assets for a single pag * Assets caching for offline use. * Assets hashing for fast syncing. * Assets types: js,css,cssData - * Caching backends: null,localStorage,webSqlDB,sqllite + * Caching backends: localStorage,webSqlDB,sqllite,none * Server url question ui. * Loader error ui. * Build-in Cordova booting. @@ -49,17 +49,17 @@ A javascript library providing server defined loading of assets for a single pag "data": { "resources": [ { - "url": "/static/js/assets.js", + "url": "/static/js/some-asset.js", "type": "js", "hash": ​-164319899 }, { - "url": "/static/css/assets.css", + "url": "/static/css/some-asset.css", "type": "css", "hash": ​1391550981 }, { - "url": "/static/css/assets-data.css", + "url": "/static/css/more-asset-data.css", "type": "cssData", "hash": ​1371811412 }, @@ -159,6 +159,7 @@ A javascript library providing server defined loading of assets for a single pag * test in production * Server header check support * Add table+instance websql options so it can also be used in application code. + * Move css to file ? * Add more tests * css: set tag.media = 'only you'; * css: add media in resouces @@ -178,6 +179,7 @@ Add unit tests for any new or changed functionality. Lint and test your code. * Allow user upgrade to https in question input from default of transport option. * Added server request headers option. * Updated css of question and error ui. +* Fixed cordova booting. ### 0.0.4 * Added auto cache clean code diff --git a/es5-ff-spa-loader.js b/es5-ff-spa-loader.js index e273fae..60dc6aa 100644 --- a/es5-ff-spa-loader.js +++ b/es5-ff-spa-loader.js @@ -50,7 +50,7 @@ error: { handler: null, // auto filled title: 'Loader ', - style: '.ffError { margin: 1em auto;width: 90%;border: 0.4em solid red;border-radius: 2em;padding: 0em 1em 1em 1em;max-width: 80%;}' + style: 'body {color: #EFF0F1;background: #484948;} .ffError { margin: 3em;border-left: 0.3em solid #B55858;border-radius: 1em;padding: 0em 1em 0.3em 1em;}' }, boot: { cordova: { @@ -78,10 +78,10 @@ }, question: { transport: 'http://', - title: 'Server', + title: 'Question', submit: 'Start', - text: 'Please provide the server name;', - style: '.ffQuestion { margin: 1em auto;width: 90%;border: 0.4em solid green;border-radius: 2em;padding: 0em 1em 1em 1em;max-width: 80%;} .ffQuestion > div {color: #ccc;}.ffQuestion > div > input {margin: 0.2em;} .ffQuestionError{color: red;}', + text: 'Please provide the server name', + style: 'body {color: #EFF0F1;background: #484948;} .ffQuestion { margin: 3em;border-left: 0.3em solid #3F68AD;border-radius: 1em;padding: 0em 1em 0.3em 1em;} .ffQuestion > div > input {margin: 0.4em;padding: 0.4em; line-height: 2em;background-color: #454442;color: #EFF0F1;border: none;border-radius: 0.4em;outline: none;min-width: 5em;} .ffQuestion > div > input:focus {border: none;} .ffQuestionError{color: #B55858;} .ffQuestionLoad {transition: all 0.5s ease;color: #484948;} .ffQuestionLoad > div > input {background-color: #484948;color: #484948;}', validate: { min: { value: 3, @@ -607,7 +607,7 @@ var inputValueRaw = inputTag.value; while (inputErrorTag.firstChild) { - inputErrorTag.removeChild(inputErrorTag.firstChild); // clear error + inputErrorTag.removeChild(inputErrorTag.firstChild); } var inputValueHost = null; @@ -653,14 +653,19 @@ return; } - document.getElementsByTagName('body')[0].removeChild(deleteTag); + deleteTag.setAttribute('class','ffQuestion ffQuestionLoad'); + var clearUi = function(err) { + if (err !== null) { return cb(err); } + document.getElementsByTagName('body')[0].removeChild(deleteTag); + cb(null); + }; if (cacheHasService('meta')) { cacheSetValue('meta','server_url',options.server.url, function(err) { if (err !== null) { return cb(err); } - startLoader(cb); + startLoader(clearUi); }); } else { - startLoader(cb); + startLoader(clearUi); } }); }; @@ -693,10 +698,10 @@ var formTag = document.createElement('div'); rootTag.appendChild(formTag); - var transportTag = document.createElement('label'); - transportTag.setAttribute('for','serverInput'); - transportTag.appendChild(document.createTextNode(options.question.transport)); - formTag.appendChild(transportTag); +// var transportTag = document.createElement('label'); +// transportTag.setAttribute('for','serverInput'); +// transportTag.appendChild(document.createTextNode(options.question.transport)); +// formTag.appendChild(transportTag); var inputTag = document.createElement('input'); inputTag.type = 'text'; @@ -860,7 +865,7 @@ var callback = cb; cb = null; utilDebug('bootCordova done in '+(new Date().getTime()-startTime)+' ms.'); - callback(); + callback(null); }; if (options.boot.cordova.timeout > 0) { utilDebug('bootCordova timeout '+options.boot.cordova.timeout); diff --git a/example/example.js b/example/example.js index f3c910f..fbac69c 100644 --- a/example/example.js +++ b/example/example.js @@ -9,7 +9,7 @@ var morgan = require('morgan'); // example options; var serverUrl = 'http://localhost:8080'; -var useInline = false; // or false +var useInline = true; // or false var clientResourcesWeb = []; var clientResources = {