node-red-contrib-mobius-flow-base 2.5.86-beta.61 → 2.5.86-beta.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,24 +5,27 @@ initMobsearch = {
5
5
  toIns: (mobiusSrvc, opts) => {
6
6
  getMobsearch(mobiusSrvc, false, false, opts);
7
7
  },
8
- toRidListed: (mobiusSrvc, opts) => {
8
+ toRid_listed: (mobiusSrvc, opts) => {
9
9
  getMobsearch(mobiusSrvc, true, true, opts);
10
10
  },
11
- toInsListed: (mobiusSrvc, opts) => {
11
+ toIns_listed: (mobiusSrvc, opts) => {
12
12
  getMobsearch(mobiusSrvc, false, true, opts);
13
13
  },
14
14
  };
15
15
 
16
16
  // RID ONLY
17
+ // opts.htmlElementId
17
18
  // opts.uriFieldName
18
19
  // opts.selectionIndex
19
20
  // opts.containerRowName
20
21
  // opts.containerName
21
22
  // opts.containerSecondFieldName
22
23
 
23
- let selectionIndex = 0;
24
+ if (selectionIndex === undefined) {
25
+ let selectionIndex = 0;
26
+ }
24
27
 
25
- function addSearchButton(field, i) {
28
+ function addMobsearchListButton(field, i) {
26
29
  field.click(function () {
27
30
  selectionIndex = i;
28
31
  $('#node-input-resources-container-row').hide();
@@ -62,7 +65,7 @@ function getMobsearch(mobiusSrvc, useRid, listed, opts) {
62
65
  let alertMsg = useRid === true ? `and/or RID ` : ``;
63
66
 
64
67
  //Add new html
65
- document.getElementById('mobsearch').innerHTML += `
68
+ document.getElementById(opts.htmlElementId).innerHTML += `
66
69
  <div id="instance-search-row">
67
70
  <div class="form-row">
68
71
  <label for="instance-search-sid"><i class="fa fa-tasks"></i> URI</label>
@@ -123,7 +123,7 @@ POSSIBILITY OF SUCH DAMAGE.
123
123
  if (!node.resources[i]) {
124
124
  node.resources[i] = {uri: '', comment: ''}
125
125
  }
126
- addSearchButton(searchField, i)
126
+ addMobsearchListButton(searchField, i)
127
127
  // *** END MOBSEARCH *** //
128
128
  },
129
129
  resizeItem: resizeResource
@@ -137,12 +137,13 @@ POSSIBILITY OF SUCH DAMAGE.
137
137
  // *** MOBSEARCH *** //
138
138
 
139
139
  opts = {
140
+ htmlElementId: 'mobsearch',
140
141
  list: node.resources,
141
142
  containerRowName: 'node-input-resources-container-row',
142
143
  containerName: 'node-input-resources-container',
143
144
  containerSecondFieldName: 'node-input-resources-comment',
144
145
  };
145
- initMobsearch.toRidListed(mobiusSrvc, opts);
146
+ initMobsearch.toRid_listed(mobiusSrvc, opts);
146
147
 
147
148
  // *** END MOBSEARCH *** //
148
149
 
@@ -107,6 +107,7 @@ POSSIBILITY OF SUCH DAMAGE.
107
107
  let mobiusSrvc = $("#node-input-connection").val();
108
108
 
109
109
  opts = {
110
+ htmlElementId: 'mobsearch',
110
111
  uriFieldName: 'node-input-instance '
111
112
  };
112
113
  initMobsearch.toIns(mobiusSrvc, opts);
@@ -99,6 +99,7 @@ POSSIBILITY OF SUCH DAMAGE.
99
99
  var node = this;
100
100
  let mobiusSrvc = $("#node-input-connection").val();
101
101
  opts = {
102
+ htmlElementId: 'mobsearch',
102
103
  uriFieldName: 'node-input-resource'
103
104
  };
104
105
  initMobsearch.toRid(mobiusSrvc, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-mobius-flow-base",
3
- "version": "2.5.86-beta.61",
3
+ "version": "2.5.86-beta.62",
4
4
  "description": "Node-RED base nodes for Mobius Flow",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",