2
0
Fork 0

More css and fixed cordova boot

This commit is contained in:
Willem 2016-01-22 13:52:28 +01:00
parent dd1cb4c2f0
commit a9e667d39e
3 changed files with 25 additions and 18 deletions

View file

@ -14,7 +14,7 @@ A javascript library providing server defined loading of assets for a single pag
* Assets caching for offline use. * Assets caching for offline use.
* Assets hashing for fast syncing. * Assets hashing for fast syncing.
* Assets types: js,css,cssData * Assets types: js,css,cssData
* Caching backends: null,localStorage,webSqlDB,sqllite * Caching backends: localStorage,webSqlDB,sqllite,none
* Server url question ui. * Server url question ui.
* Loader error ui. * Loader error ui.
* Build-in Cordova booting. * Build-in Cordova booting.
@ -49,17 +49,17 @@ A javascript library providing server defined loading of assets for a single pag
"data": { "data": {
"resources": [ "resources": [
{ {
"url": "/static/js/assets.js", "url": "/static/js/some-asset.js",
"type": "js", "type": "js",
"hash": -164319899 "hash": -164319899
}, },
{ {
"url": "/static/css/assets.css", "url": "/static/css/some-asset.css",
"type": "css", "type": "css",
"hash": 1391550981 "hash": 1391550981
}, },
{ {
"url": "/static/css/assets-data.css", "url": "/static/css/more-asset-data.css",
"type": "cssData", "type": "cssData",
"hash": 1371811412 "hash": 1371811412
}, },
@ -159,6 +159,7 @@ A javascript library providing server defined loading of assets for a single pag
* test in production * test in production
* Server header check support * Server header check support
* Add table+instance websql options so it can also be used in application code. * Add table+instance websql options so it can also be used in application code.
* Move css to file ?
* Add more tests * Add more tests
* css: set tag.media = 'only you'; * css: set tag.media = 'only you';
* css: add media in resouces * 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. * Allow user upgrade to https in question input from default of transport option.
* Added server request headers option. * Added server request headers option.
* Updated css of question and error ui. * Updated css of question and error ui.
* Fixed cordova booting.
### 0.0.4 ### 0.0.4
* Added auto cache clean code * Added auto cache clean code

View file

@ -50,7 +50,7 @@
error: { error: {
handler: null, // auto filled handler: null, // auto filled
title: 'Loader ', 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: { boot: {
cordova: { cordova: {
@ -78,10 +78,10 @@
}, },
question: { question: {
transport: 'http://', transport: 'http://',
title: 'Server', title: 'Question',
submit: 'Start', submit: 'Start',
text: 'Please provide the server name;', 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;}', 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: { validate: {
min: { min: {
value: 3, value: 3,
@ -607,7 +607,7 @@
var inputValueRaw = inputTag.value; var inputValueRaw = inputTag.value;
while (inputErrorTag.firstChild) { while (inputErrorTag.firstChild) {
inputErrorTag.removeChild(inputErrorTag.firstChild); // clear error inputErrorTag.removeChild(inputErrorTag.firstChild);
} }
var inputValueHost = null; var inputValueHost = null;
@ -653,14 +653,19 @@
return; return;
} }
deleteTag.setAttribute('class','ffQuestion ffQuestionLoad');
var clearUi = function(err) {
if (err !== null) { return cb(err); }
document.getElementsByTagName('body')[0].removeChild(deleteTag); document.getElementsByTagName('body')[0].removeChild(deleteTag);
cb(null);
};
if (cacheHasService('meta')) { if (cacheHasService('meta')) {
cacheSetValue('meta','server_url',options.server.url, function(err) { cacheSetValue('meta','server_url',options.server.url, function(err) {
if (err !== null) { return cb(err); } if (err !== null) { return cb(err); }
startLoader(cb); startLoader(clearUi);
}); });
} else { } else {
startLoader(cb); startLoader(clearUi);
} }
}); });
}; };
@ -693,10 +698,10 @@
var formTag = document.createElement('div'); var formTag = document.createElement('div');
rootTag.appendChild(formTag); rootTag.appendChild(formTag);
var transportTag = document.createElement('label'); // var transportTag = document.createElement('label');
transportTag.setAttribute('for','serverInput'); // transportTag.setAttribute('for','serverInput');
transportTag.appendChild(document.createTextNode(options.question.transport)); // transportTag.appendChild(document.createTextNode(options.question.transport));
formTag.appendChild(transportTag); // formTag.appendChild(transportTag);
var inputTag = document.createElement('input'); var inputTag = document.createElement('input');
inputTag.type = 'text'; inputTag.type = 'text';
@ -860,7 +865,7 @@
var callback = cb; var callback = cb;
cb = null; cb = null;
utilDebug('bootCordova done in '+(new Date().getTime()-startTime)+' ms.'); utilDebug('bootCordova done in '+(new Date().getTime()-startTime)+' ms.');
callback(); callback(null);
}; };
if (options.boot.cordova.timeout > 0) { if (options.boot.cordova.timeout > 0) {
utilDebug('bootCordova timeout '+options.boot.cordova.timeout); utilDebug('bootCordova timeout '+options.boot.cordova.timeout);

View file

@ -9,7 +9,7 @@ var morgan = require('morgan');
// example options; // example options;
var serverUrl = 'http://localhost:8080'; var serverUrl = 'http://localhost:8080';
var useInline = false; // or false var useInline = true; // or false
var clientResourcesWeb = []; var clientResourcesWeb = [];
var clientResources = { var clientResources = {