[New] Added appVersion property and hasComponent() function

(cherry picked from commit c081cd1be9)
This commit is contained in:
Robert von Burg 2019-05-27 18:49:46 +02:00
parent ea0d526c7e
commit e910123eb4
2 changed files with 20 additions and 2 deletions

View File

@ -3,8 +3,10 @@
*/
Strolch = {
appVersion: null,
props: {
strolch_js: '0.2.5',
strolch_js: '0.2.6',
version: null,
revision: null,
userConfig: null,
@ -22,6 +24,12 @@ Strolch = {
/*
* configuration
*/
setAppVersion: function (appVersion) {
this.appVersion = appVersion;
},
getAppVersion: function () {
return this.appVersion;
},
getAuthToken: function () {
return localStorage.authToken;
},
@ -151,6 +159,16 @@ Strolch = {
return false;
},
hasComponent: function (componentName) {
for (var i = 0; i < this.appVersion.componentVersions.length; i++) {
var componentV = this.appVersion.componentVersions[i];
if (componentV.componentName == componentName)
return true;
}
return false;
},
/*
* Utils
*/

View File

@ -1,6 +1,6 @@
{
"name": "strolchjs",
"version": "0.2.5",
"version": "0.2.6",
"main": "strolch.js",
"ignore": [
"**/.*",