[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 = { Strolch = {
appVersion: null,
props: { props: {
strolch_js: '0.2.5', strolch_js: '0.2.6',
version: null, version: null,
revision: null, revision: null,
userConfig: null, userConfig: null,
@ -22,6 +24,12 @@ Strolch = {
/* /*
* configuration * configuration
*/ */
setAppVersion: function (appVersion) {
this.appVersion = appVersion;
},
getAppVersion: function () {
return this.appVersion;
},
getAuthToken: function () { getAuthToken: function () {
return localStorage.authToken; return localStorage.authToken;
}, },
@ -151,6 +159,16 @@ Strolch = {
return false; 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 * Utils
*/ */

View File

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