2
0
Fork 0

Added unknown resource type error

This commit is contained in:
Willem 2016-03-14 01:50:47 +01:00
parent 0f7e2c9866
commit 421d1881e5
4 changed files with 21 additions and 7 deletions

View file

@ -223,6 +223,7 @@ Add unit tests for any new or changed functionality. Lint and test your code.
* Added json accept header on assets resources list.
* Added cb errors on assets resources json parse + result obj.
* Renamed cssData type to dss for enum easiness.
* Added unknown resource type error.
### 0.1.1
* Moved websql delete timeout to cleanServerlUrl for faster boot.

View file

@ -534,6 +534,9 @@
tag = document.createElement('script');
tag.type = 'text/javascript';
}
if (tag === null) {
return cb('Unknown resource type: '+resource.type);
}
tag.appendChild(document.createTextNode(data));
document.getElementsByTagName('head')[0].appendChild(tag);
@ -789,16 +792,18 @@
cacheSetValue('meta','server_resources',resources, function (err) {
if (err !== null) { return cb(err); }
utilRunStack('loadResources', resources, loadResourceStep , function (err) {
if (err !== null) { return cb(err); }
cleanupCache(resources,false,cb); // only clean when fetched + cached
progressBar.done();
if (err === null) {
cleanupCache(resources,false,cb); // only clean when fetched + cached
} else {
cb(err);
}
});
});
} else {
utilRunStack('loadResources', resources, loadResourceStep , function (err) {
if (err !== null) { return cb(err); }
cb();
progressBar.done();
cb(err); // done or error
});
}
}, true);

View file

@ -14,7 +14,7 @@ var clientResourcesWeb = [];
var clientResources = {
js: [],
css: [],
cssData: []
dss: []
};
var addClientResource = function(clientResource, resourceType) {
@ -59,9 +59,9 @@ var createClientResourceFetchList = function() {
var urlCss = clientResources.css[clientResourceIdxCss];
fetchList.push({url:urlCss,type:'css'});
}
for (var clientResourceIdxCssData in clientResources.cssData) {
for (var clientResourceIdxCssData in clientResources.dss) {
var urlCssData = clientResources.cssData[clientResourceIdxCssData];
fetchList.push({url:urlCssData,type:'cssData'});
fetchList.push({url:urlCssData,type:'dss'});
}
return fetchList;
};

View file

@ -4,6 +4,14 @@ document.title = 'FFSpaLoader Example';
var serverUrl = window.FFServerUrl;
console.log('FFExample provided serverUrl \"'+serverUrl+'\"');
// TODO for 0.2.1
//var tplCache = FFSpaLoader.factory.cache.websql({table: 'angular_tpl'});
//tplCache.cacheOpen(function(err) {
// tplCache.cacheSetValue('key123','value456',function(err) {
// console.log('FFExample local value cached');
// });
//});
$(document.createElement('div')).attr('id', 'wrapper').appendTo($('body'));
$(document.createElement('div')).attr('ng-controller', 'ApplicationController').attr('ng-include', '\''+serverUrl+'/example-ui/thtml/header\'').appendTo($('#wrapper'));
$(document.createElement('div')).attr('id', 'page-wrapper').appendTo($('#wrapper'));