Fixed askUrl.urlTransport and updated readme a but
This commit is contained in:
parent
838714aac1
commit
ec4e9a0dae
48
README.md
48
README.md
|
@ -1,31 +1,55 @@
|
||||||
es5-ff-spa-loader
|
es5-ff-spa-loader
|
||||||
=========
|
=========
|
||||||
|
|
||||||
A javascript library providing server defined loading of resouces for a single page application.
|
A javascript library providing server defined loading of resources for a single page application.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Use the es5-ff-spa-loader.js in header as script resource or inline in body.
|
npm --save install es5-ff-spa-loader (TODO)
|
||||||
|
|
||||||
## Usage
|
Then use the es5-ff-spa-loader.js in header as script resource or inline in body.
|
||||||
|
|
||||||
On index.html
|
## Usage Mobile
|
||||||
|
|
||||||
FFSpaLoader.start(...);
|
Single index.html
|
||||||
|
|
||||||
|
FFSpaLoader.options.debug = true;
|
||||||
|
FFSpaLoader.options.server.url = 'http://myserver';
|
||||||
|
FFSpaLoader.options.server.urlPath = '/api/path/to/spa/client/resources';
|
||||||
|
FFSpaLoader.bootDevice(function() {
|
||||||
|
FFSpaLoader.options.cache.factory = FFSpaLoader.autoSelectCache();// need deviceready via bootDevice for sqllite.
|
||||||
|
FFSpaLoader.start(function() {
|
||||||
|
console.log('FFExample.bootstrap angular');
|
||||||
|
angular.bootstrap( $('body'), ['exampleUI']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
## Usage Web
|
||||||
|
|
||||||
|
Single index.html
|
||||||
|
|
||||||
|
FFSpaLoader.options.debug = true;
|
||||||
|
FFSpaLoader.options.server.url = '';
|
||||||
|
FFSpaLoader.options.server.urlPath = '/api/path/to/spa/client/resources';
|
||||||
|
FFSpaLoader.options.cache.factory = FFSpaLoader.autoSelectCache();
|
||||||
|
FFSpaLoader.start(function() {
|
||||||
|
console.log('FFExample.bootstrap angular');
|
||||||
|
angular.bootstrap( $('body'), ['exampleUI']);
|
||||||
|
});
|
||||||
|
|
||||||
|
## Usage Multi Server
|
||||||
|
|
||||||
|
Leave out the 'FFSpaLoader.options.server.url' option then the user will be promted to input
|
||||||
|
the server on first boot.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
* url = The url to fetch resources list from.
|
* options.debug = Enable console debug output.
|
||||||
* debug = Enable console debug output.
|
|
||||||
* cachePrefix = The cache key prefix. (default: 'sync-')
|
|
||||||
* cacheGetFn = example; 'function(key) {return localStorage.getItem(key);}'
|
|
||||||
* cacheSetFn = example; 'function(key,value) {localStorage.setItem(key,value);}'
|
|
||||||
* cacheDelFn = example; 'function(key) {return localStorage.removeItem(key);}'
|
|
||||||
|
|
||||||
## Example Application
|
## Example Application
|
||||||
|
|
||||||
There is a fully working express example application in the example folder.
|
There is a fully working express example application in the example folder.
|
||||||
todo
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -595,10 +595,10 @@ var FFSpaLoader = (/** @lends module:FFSpaLoader */function () {
|
||||||
var formTag = document.createElement('div');
|
var formTag = document.createElement('div');
|
||||||
rootTag.appendChild(formTag);
|
rootTag.appendChild(formTag);
|
||||||
|
|
||||||
if (options.urlTransport !== undefined) {
|
if (options.askUrl.urlTransport !== undefined) {
|
||||||
var transportTag = document.createElement('label');
|
var transportTag = document.createElement('label');
|
||||||
rootTag.setAttribute('for','serverInput');
|
rootTag.setAttribute('for','serverInput');
|
||||||
transportTag.appendChild(document.createTextNode(options.urlTransport));
|
transportTag.appendChild(document.createTextNode(options.askUrl.urlTransport));
|
||||||
formTag.appendChild(transportTag);
|
formTag.appendChild(transportTag);
|
||||||
}
|
}
|
||||||
var inputTag = document.createElement('input');
|
var inputTag = document.createElement('input');
|
||||||
|
|
|
@ -9,7 +9,7 @@ var cors = require('cors');
|
||||||
var morgan = require('morgan')
|
var morgan = require('morgan')
|
||||||
|
|
||||||
// example options;
|
// example options;
|
||||||
var serverUrl = 'http://10.11.12.216:8080';
|
var serverUrl = 'http://localhost:8080';
|
||||||
var useInline = true; // or false
|
var useInline = true; // or false
|
||||||
|
|
||||||
var clientResourcesWeb = [];
|
var clientResourcesWeb = [];
|
||||||
|
|
Loading…
Reference in a new issue