2
0
Fork 0

Cleanup ui css and added submit button text option

This commit is contained in:
Willem 2016-01-22 00:02:39 +01:00
parent aab8cb7171
commit dd1cb4c2f0
2 changed files with 13 additions and 19 deletions

View file

@ -91,8 +91,9 @@ A javascript library providing server defined loading of assets for a single pag
* server.header.request = An key value object with the request headers. (default: {'X-FFSpaLoader': 'sync'}) * server.header.request = An key value object with the request headers. (default: {'X-FFSpaLoader': 'sync'})
* question.transport = The transport to prefix the server.url with. (default: 'http://') * question.transport = The transport to prefix the server.url with. (default: 'http://')
* question.title = The question ui title. (default: 'Server') * question.title = The question ui title. (default: 'Server')
* question.submit = The start button text. (default: 'Start')
* question.text = The question ui text. (default: 'Please provide the server name;') * question.text = The question ui text. (default: 'Please provide the server name;')
* question.style = The question ui css style.(note: pending change) (default: green border box) * question.style = The question ui css style. (default: green border box)
* question.validate.min.value = The minimal hostname length, false is disabled (default: 3) * question.validate.min.value = The minimal hostname length, false is disabled (default: 3)
* question.validate.min.message = The error message (default: 'Server name is to short.') * question.validate.min.message = The error message (default: 'Server name is to short.')
* question.validate.max.value = The maximal hostname length, false is disabled (default: 255) * question.validate.max.value = The maximal hostname length, false is disabled (default: 255)
@ -157,7 +158,6 @@ 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
* Redo css(?divs) of server question
* 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.
* Add more tests * Add more tests
* css: set tag.media = 'only you'; * css: set tag.media = 'only you';
@ -176,7 +176,8 @@ Add unit tests for any new or changed functionality. Lint and test your code.
* Added question.validate.[min|max|regex].value|message options. * Added question.validate.[min|max|regex].value|message options.
* Strip question value to hostname+port before use and validating. * Strip question value to hostname+port before use and validating.
* 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 request headers setting. * Added server request headers option.
* Updated css of question and error ui.
### 0.0.4 ### 0.0.4
* Added auto cache clean code * Added auto cache clean code
@ -184,12 +185,7 @@ Add unit tests for any new or changed functionality. Lint and test your code.
* Remove unused mobileAgent detect. * Remove unused mobileAgent detect.
* Fixed cached resources injection order. * Fixed cached resources injection order.
### 0.0.3 ### 0.0.3
* Fixed example script path. * Fixed example script path.
### 0.0.2
* Fixed example size. * Fixed example size.
### 0.0.1
* Initial release. * Initial release.

View file

@ -50,7 +50,7 @@
error: { error: {
handler: null, // auto filled handler: null, // auto filled
title: 'Loader ', title: 'Loader ',
style: '.ffError { margin: auto;width: 90%;border: 3px solid red;padding-left: 1em;padding-bottom: 1em;}' style: '.ffError { margin: 1em auto;width: 90%;border: 0.4em solid red;border-radius: 2em;padding: 0em 1em 1em 1em;max-width: 80%;}'
}, },
boot: { boot: {
cordova: { cordova: {
@ -79,8 +79,9 @@
question: { question: {
transport: 'http://', transport: 'http://',
title: 'Server', title: 'Server',
text: 'Please provide the server name;', // TODO: rename .ffAskUrl submit: 'Start',
style: '.ffAskUrl { font-size: 1em;margin: auto;width: 90%;border: 3px solid #73AD21;padding-left: 1em;padding-bottom: 1em;} .ffAskUrl > div {font-size: 0.8em;color: #ccc;} .ffAskUrl > div > * {} .ffAskUrl > div > input {} .ffAskUrlError{ color: red}', 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;}',
validate: { validate: {
min: { min: {
value: 3, value: 3,
@ -641,7 +642,7 @@
var resourcesUrl = options.server.url + options.server.assets; var resourcesUrl = options.server.url + options.server.assets;
utilDebug('askUrlStart check assets '+resourcesUrl); utilDebug('askUrlStart check assets '+resourcesUrl);
// TODO: add+check headers // TODO: check headers
utilHttpFetch(resourcesUrl,function(err, httpRequest) { utilHttpFetch(resourcesUrl,function(err, httpRequest) {
if (err !== null) { if (err !== null) {
inputErrorTag.appendChild(document.createTextNode('Error could not get data.')); inputErrorTag.appendChild(document.createTextNode('Error could not get data.'));
@ -674,7 +675,7 @@
utilDebug('askUrl create ui'); utilDebug('askUrl create ui');
var rootTag = document.createElement('div'); var rootTag = document.createElement('div');
rootTag.setAttribute('class','ffAskUrl'); rootTag.setAttribute('class','ffQuestion');
var cssTag = document.createElement('style'); var cssTag = document.createElement('style');
cssTag.type = 'text/css'; cssTag.type = 'text/css';
@ -693,7 +694,7 @@
rootTag.appendChild(formTag); rootTag.appendChild(formTag);
var transportTag = document.createElement('label'); var transportTag = document.createElement('label');
rootTag.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);
@ -704,19 +705,16 @@
inputTag.setAttribute('onkeydown','if (event.keyCode == 13) {document.getElementById(\'serverSubmit\').click()}'); inputTag.setAttribute('onkeydown','if (event.keyCode == 13) {document.getElementById(\'serverSubmit\').click()}');
formTag.appendChild(inputTag); formTag.appendChild(inputTag);
var submitLineTag = document.createElement('br');
formTag.appendChild(submitLineTag);
var submitTag = document.createElement('input'); var submitTag = document.createElement('input');
submitTag.id = 'serverSubmit'; submitTag.id = 'serverSubmit';
submitTag.type = 'submit'; submitTag.type = 'submit';
submitTag.value = 'Start'; submitTag.value = options.question.submit;
submitTag.onclick = function() {askUrlValidate(cb,rootTag);}; submitTag.onclick = function() {askUrlValidate(cb,rootTag);};
formTag.appendChild(submitTag); formTag.appendChild(submitTag);
var serverErrorTag = document.createElement('div'); var serverErrorTag = document.createElement('div');
serverErrorTag.id = 'serverInputError'; serverErrorTag.id = 'serverInputError';
serverErrorTag.setAttribute('class','ffAskUrlError'); serverErrorTag.setAttribute('class','ffQuestionError');
formTag.appendChild(serverErrorTag); formTag.appendChild(serverErrorTag);
document.getElementsByTagName('body')[0].appendChild(rootTag); document.getElementsByTagName('body')[0].appendChild(rootTag);