From 161e16d25cebcff79012554493d382996f04dc19 Mon Sep 17 00:00:00 2001 From: hadihakim Date: Fri, 28 Apr 2023 17:57:21 +0300 Subject: [PATCH 1/4] update plugin instance title to navigate to --- control/content/index.html | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/control/content/index.html b/control/content/index.html index d9fd31f..4d5e244 100755 --- a/control/content/index.html +++ b/control/content/index.html @@ -350,8 +350,14 @@ if (result && Object.keys(config.pluginData).length > 0) { - pluginInstanceName.innerHTML = config.pluginData.pluginTypeName + ': ' + config.pluginData.title; - queryStringContainer.style.display = "grid" + getPluginInstance(config.pluginData.instanceId).then(pluginInstance => { + if(pluginInstance && pluginInstance.title !== config.pluginData.title) { + config.pluginData.title = pluginInstance.title; + config.save(); + } + pluginInstanceName.innerHTML = config.pluginData.pluginTypeName + ': ' + config.pluginData.title; + queryStringContainer.style.display = "grid" + }); } else { pluginInstanceName.innerHTML = 'Social Wall' queryStringContainer.style.display = "none" @@ -412,6 +418,19 @@ }) } + function getPluginInstance (instanceId) { + return new Promise((resolve, reject) => { + if(!instanceId) resolve(null); + buildfire.pluginInstance.get(instanceId, function(error, instance) { + if (instance) { + resolve(instance); + } else { + resolve(null); + } + }); + }); + } + function setBothPrivacyElements() { let elements = document.getElementsByClassName("tagInputContainer"); if (config.writePrivacy === Config.WRITE_PRIVACY.PRIVATE) { From b817011d7ae5b8cfd70c06e730b544c9e0a2814b Mon Sep 17 00:00:00 2001 From: hadihakim Date: Sat, 29 Apr 2023 02:26:55 +0300 Subject: [PATCH 2/4] add settings to change feature title on navigation --- control/content/index.html | 50 ++++++++++++++++++++++++++++ control/content/js/classes/config.js | 8 +++++ widget/app.js | 6 ++++ 3 files changed, 64 insertions(+) diff --git a/control/content/index.html b/control/content/index.html index 4d5e244..f6d95f9 100755 --- a/control/content/index.html +++ b/control/content/index.html @@ -59,6 +59,41 @@ + +
+ Feature Title +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
Topic Privacy
@@ -362,6 +397,11 @@ pluginInstanceName.innerHTML = 'Social Wall' queryStringContainer.style.display = "none" } + if (config.featureTitle === Config.TITLE.DEFAULT) { + defaultTitle.checked = true; + } else { + topicTitle.checked = true; + } if (config.privacy === Config.PRIVACY.PUBLIC) { publicPrivacy.checked = true; writeAccessContainer.style.display = "grid"; @@ -496,6 +536,16 @@ config.save(); } + function onSelectTitle(title) { + if (title === 'default') { + config.featureTitle = Config.TITLE.DEFAULT; + } + else if (title === 'topic') { + config.featureTitle = Config.TITLE.TOPIC; + } + config.save(); + } + function onSelectWritePrivacy() { setBothPrivacyElements(); config.save(); diff --git a/control/content/js/classes/config.js b/control/content/js/classes/config.js index e02fb69..533f192 100644 --- a/control/content/js/classes/config.js +++ b/control/content/js/classes/config.js @@ -11,6 +11,7 @@ class Config { this.emptyStateMessage = dataObj.emptyStateMessage ||'Create your first group now!'; this.navigateToCwByDefault = dataObj.navigateToCwByDefault || false; this.sortBy = dataObj.sortBy || 'default'; + this.featureTitle = dataObj.featureTitle || 'default'; } static get PRIVACY() { @@ -21,6 +22,13 @@ class Config { } } + static get TITLE() { + return { + DEFAULT: 'default', + TOPIC: 'topic', + } + } + static get WRITE_PRIVACY() { return { PUBLIC: 'public', diff --git a/widget/app.js b/widget/app.js index c7f3853..cb02d8b 100644 --- a/widget/app.js +++ b/widget/app.js @@ -28,6 +28,9 @@ function init() { .then(result => { buildfire.spinner.hide(); config = result.data; + if(!config.featureTitle) { + config.featureTitle = 'default'; + } getStrings(); if (config.privacy === Helper.PRIVACY.PRIVATE && !loggedUser) { enforceUserLogin(); @@ -802,6 +805,9 @@ function navigateTo(topic) { } else { if (topic.originalShareId) pluginData.queryString = 'wid=' + topic.originalShareId + '&privacy=' + topic.privacy; else pluginData.queryString = queryString + '&privacy=' + topic.privacy; + if(config.featureTitle === 'topic') { + pluginData.title = topic.title; + } buildfire.navigation.navigateTo(pluginData); } } From ef5b590bfca76eb5e267efddf7354ad8f4eca34f Mon Sep 17 00:00:00 2001 From: hadihakim Date: Mon, 1 May 2023 20:05:22 +0300 Subject: [PATCH 3/4] Change naming and position of selected feature title settings --- control/content/index.html | 49 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/control/content/index.html b/control/content/index.html index f6d95f9..6e5f851 100755 --- a/control/content/index.html +++ b/control/content/index.html @@ -37,31 +37,8 @@
-
- Query String -
- - -
-
    -
  • topic_id: The topic id
  • -
  • topic_title: The topic title
  • -
  • user_id: The user id
  • -
-
-
-
-
- Feature Title + Selected Feature Title
@@ -74,7 +51,7 @@
- +
@@ -93,6 +70,28 @@
+
+ Query String +
+ + +
+
    +
  • topic_id: The topic id
  • +
  • topic_title: The topic title
  • +
  • user_id: The user id
  • +
+
+
+
Topic Privacy From fb0147d81dceab46996a78154cc5bf1932d8d30c Mon Sep 17 00:00:00 2001 From: hadihakim Date: Wed, 3 May 2023 20:34:23 +0300 Subject: [PATCH 4/4] selected feature title setting style --- control/content/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/control/content/index.html b/control/content/index.html index 6e5f851..5f118c3 100755 --- a/control/content/index.html +++ b/control/content/index.html @@ -38,8 +38,8 @@
- Selected Feature Title -
+ Selected Feature Title +
@@ -51,10 +51,10 @@
- +
-
+
- +