diff --git a/README.md b/README.md index 90634e2..ed60d94 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ A javascript library providing server defined loading of assets for a single pag ## Options + The available FFSpaLoader.options.* values; + * debug.enable = Enable debug output. (default: false) * debug.handler = Prints/log debug message. (default: console.log) * debug.prefix = Debug message prefix. (default: 'FFSpaLoader.') @@ -78,7 +80,7 @@ A javascript library providing server defined loading of assets for a single pag * error.title = The error title. (default: 'Loader Error'); * error.style = The error ui css style. (default: red border box) * boot.cordova.enable = Use deviceready event to boot when cordova is detected. (default: true) - * boot.cordova.timeout = Boot after timeout when deviceready event is not received. (default: 4096) + * boot.cordova.timeout = Boot after (if<0=no-)timeout when deviceready event is not received. (default: -1) * boot.cordova.flag = The window flag which is set when cordova is booted. (default: 'FFCordovaDevice') * boot.angular.enable = Auto bootstrap angular modules. (default: true) * boot.angular.modules = The angular modules to boot. (default: empty) @@ -95,6 +97,19 @@ A javascript library providing server defined loading of assets for a single pag * cache.css = The cache backend for for css, null is auto select. (default: null) * cache.cssData = The cache backend for for cssData, null is auto select. (default: null) + +## Factory + + The available FFSpaLoader.factory.* functions; + + * detect.localStorage() = Checks is localStorage is working. + * detect.openDatabase() = Checks if openDatabase is defined. + * detect.sqlitePlugin() = Checks if sqlitePlugin is defined. + * detect.cordova() = Checks if cordova is defined. + * detect.cordovaDevice() = Checks if cordovaDevive window flag is defined which will be set by the buildin cordova boot code. + * cache.localStorage() = Creates an localStorage service. + * cache.websql(opt) = Creates an websql service. + ## Cache Config Per default all cache type as in auto select mode which detect and used the following; @@ -136,6 +151,7 @@ A javascript library providing server defined loading of assets for a single pag * test in production * Server header set+check support * Redo css(?divs) of server question + * Add table+instance websql options so it can also be used in application code. * Add more tests * css: set tag.media = 'only you'; * css: add media in resouces @@ -148,11 +164,16 @@ Add unit tests for any new or changed functionality. Lint and test your code. ## Release History +### 0.0.4 +* Disable cordova timeout per default. +* Remove unused mobileAgent detect. + + ### 0.0.3 -* Fix script path in example +* Fixed example script path. ### 0.0.2 -* Limited example size +* Fixed example size. ### 0.0.1 -* Initial release +* Initial release. diff --git a/es5-ff-spa-loader.js b/es5-ff-spa-loader.js index 780885f..813f407 100644 --- a/es5-ff-spa-loader.js +++ b/es5-ff-spa-loader.js @@ -55,7 +55,7 @@ boot: { cordova: { enable: true, - timeout: 4096, // FIXME: Test really slow devices -> increase ? or add support -1 for disable or ? + timeout: -1, flag: 'FFCordovaDevice' }, angular: { @@ -115,9 +115,6 @@ }, cordovaDevice: function() { return options.boot.cordova.flag in rootWindow; - }, - mobileAgent: function() { - return rootWindow.navigator !== undefined && rootWindow.navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/); } }, cache: { @@ -265,8 +262,8 @@ var rootTag = document.createElement('div'); rootTag.setAttribute('class','ffError'); - var cssTag = document.createElement("style"); - cssTag.type = "text/css"; + var cssTag = document.createElement('style'); + cssTag.type = 'text/css'; cssTag.innerHTML = options.error.style; rootTag.appendChild(cssTag); @@ -596,8 +593,8 @@ var rootTag = document.createElement('div'); rootTag.setAttribute('class','ffAskUrl'); - var cssTag = document.createElement("style"); - cssTag.type = "text/css"; + var cssTag = document.createElement('style'); + cssTag.type = 'text/css'; cssTag.innerHTML = options.server.question.style; rootTag.appendChild(cssTag); @@ -791,7 +788,7 @@ bootOnce(); }, options.boot.cordova.timeout); } - document.addEventListener("deviceready", function () { + document.addEventListener('deviceready', function () { rootWindow[options.boot.cordova.flag] = true; utilDebug('bootCordova '+options.boot.cordova.flag); bootOnce(); diff --git a/test/test-factory.js b/test/test-factory.js index 2242817..606056e 100644 --- a/test/test-factory.js +++ b/test/test-factory.js @@ -19,8 +19,5 @@ describe('Check factory detect', function() { it('FFSpaLoader.factory.detect.cordovaDevice', function() { assert.equal(false, FFSpaLoader.factory.detect.cordovaDevice()); }); - it('FFSpaLoader.factory.detect.mobileAgent', function() { - assert.equal(false, FFSpaLoader.factory.detect.mobileAgent()); - }); });