Added unknown resource type error
This commit is contained in:
parent
0f7e2c9866
commit
421d1881e5
|
@ -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 json accept header on assets resources list.
|
||||||
* Added cb errors on assets resources json parse + result obj.
|
* Added cb errors on assets resources json parse + result obj.
|
||||||
* Renamed cssData type to dss for enum easiness.
|
* Renamed cssData type to dss for enum easiness.
|
||||||
|
* Added unknown resource type error.
|
||||||
|
|
||||||
### 0.1.1
|
### 0.1.1
|
||||||
* Moved websql delete timeout to cleanServerlUrl for faster boot.
|
* Moved websql delete timeout to cleanServerlUrl for faster boot.
|
||||||
|
|
|
@ -534,6 +534,9 @@
|
||||||
tag = document.createElement('script');
|
tag = document.createElement('script');
|
||||||
tag.type = 'text/javascript';
|
tag.type = 'text/javascript';
|
||||||
}
|
}
|
||||||
|
if (tag === null) {
|
||||||
|
return cb('Unknown resource type: '+resource.type);
|
||||||
|
}
|
||||||
tag.appendChild(document.createTextNode(data));
|
tag.appendChild(document.createTextNode(data));
|
||||||
|
|
||||||
document.getElementsByTagName('head')[0].appendChild(tag);
|
document.getElementsByTagName('head')[0].appendChild(tag);
|
||||||
|
@ -789,16 +792,18 @@
|
||||||
cacheSetValue('meta','server_resources',resources, function (err) {
|
cacheSetValue('meta','server_resources',resources, function (err) {
|
||||||
if (err !== null) { return cb(err); }
|
if (err !== null) { return cb(err); }
|
||||||
utilRunStack('loadResources', resources, loadResourceStep , function (err) {
|
utilRunStack('loadResources', resources, loadResourceStep , function (err) {
|
||||||
if (err !== null) { return cb(err); }
|
|
||||||
cleanupCache(resources,false,cb); // only clean when fetched + cached
|
|
||||||
progressBar.done();
|
progressBar.done();
|
||||||
|
if (err === null) {
|
||||||
|
cleanupCache(resources,false,cb); // only clean when fetched + cached
|
||||||
|
} else {
|
||||||
|
cb(err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
utilRunStack('loadResources', resources, loadResourceStep , function (err) {
|
utilRunStack('loadResources', resources, loadResourceStep , function (err) {
|
||||||
if (err !== null) { return cb(err); }
|
|
||||||
cb();
|
|
||||||
progressBar.done();
|
progressBar.done();
|
||||||
|
cb(err); // done or error
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
|
@ -14,7 +14,7 @@ var clientResourcesWeb = [];
|
||||||
var clientResources = {
|
var clientResources = {
|
||||||
js: [],
|
js: [],
|
||||||
css: [],
|
css: [],
|
||||||
cssData: []
|
dss: []
|
||||||
};
|
};
|
||||||
|
|
||||||
var addClientResource = function(clientResource, resourceType) {
|
var addClientResource = function(clientResource, resourceType) {
|
||||||
|
@ -59,9 +59,9 @@ var createClientResourceFetchList = function() {
|
||||||
var urlCss = clientResources.css[clientResourceIdxCss];
|
var urlCss = clientResources.css[clientResourceIdxCss];
|
||||||
fetchList.push({url:urlCss,type:'css'});
|
fetchList.push({url:urlCss,type:'css'});
|
||||||
}
|
}
|
||||||
for (var clientResourceIdxCssData in clientResources.cssData) {
|
for (var clientResourceIdxCssData in clientResources.dss) {
|
||||||
var urlCssData = clientResources.cssData[clientResourceIdxCssData];
|
var urlCssData = clientResources.cssData[clientResourceIdxCssData];
|
||||||
fetchList.push({url:urlCssData,type:'cssData'});
|
fetchList.push({url:urlCssData,type:'dss'});
|
||||||
}
|
}
|
||||||
return fetchList;
|
return fetchList;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,14 @@ document.title = 'FFSpaLoader Example';
|
||||||
var serverUrl = window.FFServerUrl;
|
var serverUrl = window.FFServerUrl;
|
||||||
console.log('FFExample provided serverUrl \"'+serverUrl+'\"');
|
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('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('ng-controller', 'ApplicationController').attr('ng-include', '\''+serverUrl+'/example-ui/thtml/header\'').appendTo($('#wrapper'));
|
||||||
$(document.createElement('div')).attr('id', 'page-wrapper').appendTo($('#wrapper'));
|
$(document.createElement('div')).attr('id', 'page-wrapper').appendTo($('#wrapper'));
|
||||||
|
|
Loading…
Reference in a new issue