From d9642fafddbaa28789339e1989c4583af003a193 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 6 Nov 2018 14:15:05 -0500 Subject: Fix license issues Fix license definition in package.json files Remove obsolete dgbuilder from SDNC (dgbuilder now in CCSDK) Change-Id: Iee0bf9468f081c5957eae2e873efbea6fb6be354 Issue-ID: SDNC-489 Signed-off-by: Timoney, Dan (dt5972) Former-commit-id: 4e104ac4183dd46124753c4571939e765a124508 --- dgbuilder/core_nodes/logic/10-switch.html | 198 ------------------------------ dgbuilder/core_nodes/logic/10-switch.js | 78 ------------ dgbuilder/core_nodes/logic/15-change.html | 139 --------------------- dgbuilder/core_nodes/logic/15-change.js | 74 ----------- dgbuilder/core_nodes/logic/16-range.html | 81 ------------ dgbuilder/core_nodes/logic/16-range.js | 48 -------- 6 files changed, 618 deletions(-) delete mode 100644 dgbuilder/core_nodes/logic/10-switch.html delete mode 100644 dgbuilder/core_nodes/logic/10-switch.js delete mode 100644 dgbuilder/core_nodes/logic/15-change.html delete mode 100644 dgbuilder/core_nodes/logic/15-change.js delete mode 100644 dgbuilder/core_nodes/logic/16-range.html delete mode 100644 dgbuilder/core_nodes/logic/16-range.js (limited to 'dgbuilder/core_nodes/logic') diff --git a/dgbuilder/core_nodes/logic/10-switch.html b/dgbuilder/core_nodes/logic/10-switch.html deleted file mode 100644 index 4e02f446..00000000 --- a/dgbuilder/core_nodes/logic/10-switch.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - diff --git a/dgbuilder/core_nodes/logic/10-switch.js b/dgbuilder/core_nodes/logic/10-switch.js deleted file mode 100644 index 8bcb8571..00000000 --- a/dgbuilder/core_nodes/logic/10-switch.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright 2013 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -module.exports = function(RED) { - "use strict"; - var operators = { - 'eq': function(a, b) { return a == b; }, - 'neq': function(a, b) { return a != b; }, - 'lt': function(a, b) { return a < b; }, - 'lte': function(a, b) { return a <= b; }, - 'gt': function(a, b) { return a > b; }, - 'gte': function(a, b) { return a >= b; }, - 'btwn': function(a, b, c) { return a >= b && a <= c; }, - 'cont': function(a, b) { return (a + "").indexOf(b) != -1; }, - 'regex': function(a, b) { return (a + "").match(new RegExp(b)); }, - 'true': function(a) { return a === true; }, - 'false': function(a) { return a === false; }, - 'null': function(a) { return typeof a == "undefined"; }, - 'nnull': function(a) { return typeof a != "undefined"; }, - 'else': function(a) { return a === true; } - }; - - function SwitchNode(n) { - RED.nodes.createNode(this, n); - this.rules = n.rules; - this.property = n.property; - this.checkall = n.checkall || "true"; - var propertyParts = n.property.split("."); - var node = this; - - for (var i=0; i - - - - - - diff --git a/dgbuilder/core_nodes/logic/15-change.js b/dgbuilder/core_nodes/logic/15-change.js deleted file mode 100644 index b7ef62e1..00000000 --- a/dgbuilder/core_nodes/logic/15-change.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright 2013 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -module.exports = function(RED) { - "use strict"; - function ChangeNode(n) { - RED.nodes.createNode(this, n); - this.action = n.action; - this.property = n.property || ""; - this.from = n.from || " "; - this.to = n.to || " "; - this.reg = (n.reg === null || n.reg); - var node = this; - if (node.reg === false) { - this.from = this.from.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } - var makeNew = function( stem, path, value ) { - var lastPart = (arguments.length === 3) ? path.pop() : false; - for (var i = 0; i < path.length; i++) { - stem = stem[path[i]] = stem[path[i]] || {}; - } - if (lastPart) { stem = stem[lastPart] = value; } - return stem; - }; - - this.on('input', function (msg) { - if (node.action == "change") { - try { - node.re = new RegExp(this.from, "g"); - } catch (e) { - node.error(e.message); - } - if (typeof msg[node.property] === "string") { - msg[node.property] = (msg[node.property]).replace(node.re, node.to); - } - } - //else if (node.action == "replace") { - //if (node.to.indexOf("msg.") == 0) { - //msg[node.property] = eval(node.to); - //} - //else { - //msg[node.property] = node.to; - //} - //} - else if (node.action == "replace") { - if (node.to.indexOf("msg.") === 0) { - makeNew( msg, node.property.split("."), eval(node.to) ); - } - else { - makeNew( msg, node.property.split("."), node.to ); - } - //makeNew( msg, node.property.split("."), node.to ); - } - else if (node.action == "delete") { - delete(msg[node.property]); - } - node.send(msg); - }); - } - RED.nodes.registerType("change", ChangeNode); -} diff --git a/dgbuilder/core_nodes/logic/16-range.html b/dgbuilder/core_nodes/logic/16-range.html deleted file mode 100644 index 5f87128f..00000000 --- a/dgbuilder/core_nodes/logic/16-range.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - diff --git a/dgbuilder/core_nodes/logic/16-range.js b/dgbuilder/core_nodes/logic/16-range.js deleted file mode 100644 index ec39342a..00000000 --- a/dgbuilder/core_nodes/logic/16-range.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright 2013 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -module.exports = function(RED) { - "use strict"; - function RangeNode(n) { - RED.nodes.createNode(this, n); - this.action = n.action; - this.round = n.round || false; - this.minin = Number(n.minin); - this.maxin = Number(n.maxin); - this.minout = Number(n.minout); - this.maxout = Number(n.maxout); - var node = this; - - this.on('input', function (msg) { - var n = Number(msg.payload); - if (!isNaN(n)) { - if (node.action == "clamp") { - if (n < node.minin) { n = node.minin; } - if (n > node.maxin) { n = node.maxin; } - } - if (node.action == "roll") { - if (n >= node.maxin) { n = (n - node.minin) % (node.maxin - node.minin) + node.minin; } - if (n < node.minin) { n = (n - node.minin) % (node.maxin - node.minin) + node.maxin; } - } - msg.payload = ((n - node.minin) / (node.maxin - node.minin) * (node.maxout - node.minout)) + node.minout; - if (node.round) { msg.payload = Math.round(msg.payload); } - node.send(msg); - } - else { node.log("Not a number: "+msg.payload); } - }); - } - RED.nodes.registerType("range", RangeNode); -} -- cgit 1.2.3-korg