From e910123eb4f019f7c49a9575f691de2d065a47e0 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Mon, 27 May 2019 18:49:46 +0200 Subject: [PATCH] [New] Added appVersion property and hasComponent() function (cherry picked from commit c081cd1be9595c0ffa5b00123a065dd5dec07cd4) --- Strolch.js | 20 +++++++++++++++++++- bower.json | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Strolch.js b/Strolch.js index f19c53a..42ee283 100644 --- a/Strolch.js +++ b/Strolch.js @@ -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 */ diff --git a/bower.json b/bower.json index 943fe82..fb1491f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "strolchjs", - "version": "0.2.5", + "version": "0.2.6", "main": "strolch.js", "ignore": [ "**/.*",