mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9516da01e3 | ||
|
|
7657bd2375 | ||
|
|
0adcea9e7c | ||
|
|
aa8ad60083 | ||
|
|
5d98a86a6b | ||
|
|
4418fdaed6 | ||
|
|
c58c45c917 | ||
|
|
45eba5cabd | ||
|
|
3ab0d0d865 | ||
|
|
a6803081ab | ||
|
|
8debed805b | ||
|
|
fc9835512d | ||
|
|
5f0cab8cc2 | ||
|
|
bd391963bc | ||
|
|
97fa28fb10 | ||
|
|
67d5b39c96 |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,3 +1,22 @@
|
||||
#### 0.15.2: Maintenance Release
|
||||
|
||||
- Revert bidi changes to nodes and hide menu option until fixed Fixes #1024
|
||||
- Let xml node set options both ways
|
||||
- Bump serialport to use version 4
|
||||
- gpio node handle multiple bits of data returned in one go
|
||||
- HTTP In should pass application/octet-stream as buffer not string Fixes #1023
|
||||
- Handle missing httpNodeRoot setting properly
|
||||
- Config sidebar not handling node definition error properly
|
||||
- Add minimum show time to deploy spinner to avoid flicker
|
||||
- Add work-in-progress update button to palette-editor
|
||||
- Add log.removeHandler function
|
||||
- Add Crtl/Shift/p shortcut for manage palette
|
||||
- Add spinner to deploy button
|
||||
- Status messages from nodes in subflows not delegated properly Fixes #1016
|
||||
- fix spelling in join node info
|
||||
- Speed up tab scrolling
|
||||
- Update delay burst test to be more tolerant of timing Fixes #1013
|
||||
|
||||
#### 0.15.1: Maintenance Release
|
||||
|
||||
- Update default palette catalogue to use https
|
||||
|
||||
@@ -104,10 +104,8 @@ module.exports = function(grunt) {
|
||||
"editor/js/settings.js",
|
||||
"editor/js/user.js",
|
||||
"editor/js/comms.js",
|
||||
"editor/js/bidi/bidi.js",
|
||||
"editor/js/bidi/base-text-dir.js",
|
||||
"editor/js/bidi/format.js",
|
||||
"editor/js/bidi/numeric-shaping.js",
|
||||
"editor/js/text/bidi.js",
|
||||
"editor/js/text/format.js",
|
||||
"editor/js/ui/state.js",
|
||||
"editor/js/nodes.js",
|
||||
"editor/js/history.js",
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
**/
|
||||
RED.bidi.baseTextDir = (function() {
|
||||
var LRE = "\u202A",
|
||||
RLE = "\u202B",
|
||||
PDF = "\u202C";
|
||||
|
||||
function _isRTLValue(stringValue) {
|
||||
var length = stringValue.length;
|
||||
for (var i = 0 ; i < length; i++) {
|
||||
if (_isBidiChar(stringValue.charCodeAt(i))) {
|
||||
return true;
|
||||
} else if (_isLatinChar(stringValue.charCodeAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return RED.bidi.isMirroringEnabled();
|
||||
}
|
||||
|
||||
function _isBidiChar(c) {
|
||||
return (c >= 0x05d0 && c <= 0x05ff)||
|
||||
(c >= 0x0600 && c <= 0x065f)||
|
||||
(c >= 0x066a && c <= 0x06ef)||
|
||||
(c >= 0x06fa && c <= 0x07ff)||
|
||||
(c >= 0xfb1d && c <= 0xfdff)||
|
||||
(c >= 0xfe70 && c <= 0xfefc);
|
||||
}
|
||||
|
||||
function _isLatinChar(c) {
|
||||
return (c > 64 && c < 91) || (c > 96 && c < 123);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforces the text direction of a given string by adding
|
||||
* UCC (Unicode Control Characters)
|
||||
* @param value - the string
|
||||
*/
|
||||
function _enforceTextDirectionWithUCC(value) {
|
||||
if (value) {
|
||||
var dir = RED.bidi.resolveBaseTextDir(value);
|
||||
if (dir == "ltr") {
|
||||
return LRE + value + PDF;
|
||||
} else if (dir == "rtl") {
|
||||
return RLE + value + PDF;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
enforceTextDirectionWithUCC: _enforceTextDirectionWithUCC,
|
||||
isRTLValue : _isRTLValue
|
||||
}
|
||||
})();
|
||||
@@ -1,189 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
**/
|
||||
RED.bidi = (function() {
|
||||
var textDir = "";
|
||||
var shaperType = "";
|
||||
var calendarType = "";
|
||||
|
||||
/**
|
||||
* Indicates the type of bidi-support
|
||||
* BTD : Base text direction
|
||||
* NS : Numeric Shaping
|
||||
* CALENDAR : National Calendar
|
||||
* STT_ATTACH : Structure Text Support, it is using to call attach function located at format.js
|
||||
* STT_GETHTML : STT_ATTACH : Structure Text Support, it is using to call getHtml function located at format.js
|
||||
*/
|
||||
var _flags = {
|
||||
BTD: 1,
|
||||
NS: 2,
|
||||
CALENDAR: 4,
|
||||
STT_ATTACH: 8,
|
||||
STT_GETHTML: 16
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverse component position when mirroring is enabled
|
||||
*/
|
||||
var _componentPos = {};
|
||||
|
||||
/**
|
||||
* Check if browser language is RTL language
|
||||
*/
|
||||
function _isMirroringEnabled() {
|
||||
var isRTLLang = new RegExp("^(ar|he)").test(navigator.language);
|
||||
if (isRTLLang) {
|
||||
_componentPos.left = "right";
|
||||
_componentPos.right = "left";
|
||||
return true;
|
||||
} else {
|
||||
_componentPos.left = "left";
|
||||
_componentPos.right = "right";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param val - the numeric shaping type: None , National or contextual
|
||||
*/
|
||||
function _setNumericShapingType(val) {
|
||||
shaperType = val;
|
||||
_refreshView();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the national calendar preference
|
||||
* @param val - the calendar type hijri, hebrew or gregorian
|
||||
*/
|
||||
function _setCalendarType(val) {
|
||||
calendarType = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the date according to the current selected calendar
|
||||
* @param date - the date object to be formatted
|
||||
*/
|
||||
function _getGlobalizedDate(date) {
|
||||
var options = {};
|
||||
var lang = navigator.language;
|
||||
if (calendarType === "hijri") {
|
||||
options = lang + "-u-ca-islamic";
|
||||
} else if (calendarType === "hebrew") {
|
||||
options = lang + "-u-ca-hebrew";
|
||||
}
|
||||
return date.toLocaleString(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text direction preference
|
||||
* @param dir - the text direction preference
|
||||
*/
|
||||
function _setTextDirection(dir) {
|
||||
textDir = dir;
|
||||
_refreshView();
|
||||
_enforceTextDirectionOnPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforces the text direction for all the spans with style bidiAware under
|
||||
* workspace or sidebar div
|
||||
*/
|
||||
function _enforceTextDirectionOnPage() {
|
||||
$("#workspace").find('span.bidiAware').each(function() {
|
||||
$(this).attr("dir", _resolveBaseTextDir($(this).html()));
|
||||
});
|
||||
$("#sidebar").find('span.bidiAware').each(function() {
|
||||
$(this).attr("dir", _resolveBaseTextDir($(this).text()));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the text direction of a given string.
|
||||
* @param value - the string
|
||||
*/
|
||||
function _resolveBaseTextDir(value) {
|
||||
if (textDir == "auto") {
|
||||
if (RED.bidi.baseTextDir.isRTLValue(value)) {
|
||||
return "rtl";
|
||||
} else {
|
||||
return "ltr";
|
||||
}
|
||||
} else {
|
||||
return textDir;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event listeners to the Input to ensure its text-direction attribute
|
||||
* is properly set based on its content.
|
||||
* @param input - the input field
|
||||
*/
|
||||
function _prepareInput(input) {
|
||||
input.on("keyup",_onInputChange).on("paste",_onInputChange).on("cut",_onInputChange);
|
||||
// Set the initial text direction
|
||||
_onInputChange.call(input);
|
||||
}
|
||||
|
||||
function _onInputChange() {
|
||||
$(this).attr("dir", _resolveBaseTextDir($(this).val()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Refreshes the view whenever changing the user preferences
|
||||
*/
|
||||
function _refreshView() {
|
||||
RED.nodes.eachNode(function(n) { n.dirty = true;});
|
||||
RED.view.redraw();
|
||||
RED.palette.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Applying bidi support for these features: base-text-dir ,Numeric-shaping or both, STT ,Calendar which is controlled by the flag value.
|
||||
* @param value- the string to apply the bidi-support on it.
|
||||
* @param flag - indicates the type of bidi-support (Base-text-dir ,Numeric-shaping or both, STT , Calendar)
|
||||
* @param type - could be one of filepath, url, email
|
||||
* @param args - pass additional arguments to the handler. generally null.
|
||||
*/
|
||||
function _applyBidiSupport(value, flag, type, args) {
|
||||
switch (flag) {
|
||||
case 0:
|
||||
value = RED.bidi.baseTextDir.enforceTextDirectionWithUCC(value);
|
||||
return RED.bidi.numericShaping.shape(value, shaperType, textDir);
|
||||
case 1:
|
||||
return RED.bidi.baseTextDir.enforceTextDirectionWithUCC(value);
|
||||
case 2:
|
||||
return RED.bidi.numericShaping.shape(value, shaperType, textDir);
|
||||
case 4:
|
||||
return _getGlobalizedDate(value);
|
||||
case 8:
|
||||
return RED.bidi.format.attach(value, type, args, _isMirroringEnabled(), navigator.language);
|
||||
case 16:
|
||||
return RED.bidi.format.getHtml(value, type, args, _isMirroringEnabled(), navigator.language);
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return {
|
||||
isMirroringEnabled: _isMirroringEnabled,
|
||||
setNumericShapingType : _setNumericShapingType,
|
||||
setCalendarType: _setCalendarType,
|
||||
setTextDirection : _setTextDirection,
|
||||
applyBidiSupport : _applyBidiSupport,
|
||||
resolveBaseTextDir : _resolveBaseTextDir,
|
||||
prepareInput: _prepareInput,
|
||||
flags: _flags,
|
||||
componentPos: _componentPos
|
||||
}
|
||||
})();
|
||||
@@ -1,86 +0,0 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
**/
|
||||
RED.bidi.numericShaping = (function(){
|
||||
var regex = /([0-9])|([\u0660-\u0669])|([\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FF\u0750-\u077F\u08A0-\u08E3\u200F\u202B\u202E\u2067\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFC\uFDFE-\uFDFF\uFE70-\uFEFE]+)|([^0-9\u0660-\u0669\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FF\u0750-\u077F\u08A0-\u08E3\u200F\u202B\u202E\u2067\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFC\uFDFE-\uFDFF\uFE70-\uFEFE\u0600-\u0607\u0609-\u060A\u060C\u060E-\u061A\u064B-\u066C\u0670\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u08E4-\u08FF\uFD3E-\uFD3F\uFDD0-\uFDEF\uFDFD\uFEFF\u0000-\u0040\u005B-\u0060\u007B-\u007F\u0080-\u00A9\u00AB-\u00B4\u00B6-\u00B9\u00BB-\u00BF\u00D7\u00F7\u02B9-\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u02FF\u2070\u2074-\u207E\u2080-\u208E\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A-\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189\uA720-\uA721\uA788\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE]+)/g;
|
||||
|
||||
/**
|
||||
* Converts the digits in the text to European or Arabic digits According to
|
||||
* the shaperType & the textDir.
|
||||
*/
|
||||
function _shape(text, shaperType, textDir) {
|
||||
text = text.toString();
|
||||
if(textDir === "auto"){
|
||||
textDir = RED.bidi.resolveBaseTextDir(text);
|
||||
}
|
||||
if (!text) {
|
||||
return text;
|
||||
}
|
||||
switch (shaperType) {
|
||||
case "defaultNumeral":
|
||||
return _shapeEuropean(text);
|
||||
case "national":
|
||||
return _shapeArabic(text);
|
||||
case "contextual":
|
||||
return _shapeContextual(text, textDir === "rtl" ? 2 : 1);
|
||||
default:
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the digits in the text to European digits.
|
||||
*/
|
||||
function _shapeEuropean(text) {
|
||||
return text.replace(/[\u0660-\u0669]/g, function(c) {
|
||||
return c.charCodeAt(0) - 1632;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the digits in the text to Arabic digits.
|
||||
*/
|
||||
function _shapeArabic(text) {
|
||||
return text.replace(/[0-9]/g, function(c) {
|
||||
return String.fromCharCode(parseInt(c) + 1632);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the digits in the text to European or Arabic digits
|
||||
* According to the type of the preceding strong character.
|
||||
* @param context:The current effective context.
|
||||
* Allowed values:
|
||||
* '1': European context
|
||||
* '2': Arabic context
|
||||
*/
|
||||
function _shapeContextual(text, context) {
|
||||
return text.replace(regex, function(match, latinDigit, arabicDigit, strongArabic, strongLatin){
|
||||
if (latinDigit) {
|
||||
return (context === 2) ? String.fromCharCode(parseInt(latinDigit) + 1632) : latinDigit;
|
||||
} else if (arabicDigit) {
|
||||
return (context === 1) ? arabicDigit.charCodeAt(0) - 1632 : arabicDigit;
|
||||
} else if (strongArabic) {
|
||||
context = 2;
|
||||
} else if (strongLatin) {
|
||||
context = 1;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
}
|
||||
return {
|
||||
shape: _shape
|
||||
}
|
||||
})();
|
||||
@@ -179,23 +179,13 @@ var RED = (function() {
|
||||
{id:"menu-item-view-snap-grid",label:RED._("menu.label.view.snapGrid"),toggle:true,onselect:RED.view.toggleSnapGrid},
|
||||
{id:"menu-item-status",label:RED._("menu.label.displayStatus"),toggle:true,onselect:toggleStatus, selected: true},
|
||||
null,
|
||||
{id:"menu-item-bidi",label:RED._("menu.label.view.textDir"),options:[
|
||||
{id:"menu-item-bidi-default",toggle:"text-direction",label:RED._("menu.label.view.defaultDir"),selected: true, onselect:function(s) { if (s) {RED.bidi.setTextDirection("")}}},
|
||||
{id:"menu-item-bidi-ltr",toggle:"text-direction",label:RED._("menu.label.view.ltr"), onselect:function(s) { if (s) {RED.bidi.setTextDirection("ltr")}}},
|
||||
{id:"menu-item-bidi-rtl",toggle:"text-direction",label:RED._("menu.label.view.rtl"), onselect:function(s) { if (s) {RED.bidi.setTextDirection("rtl")}}},
|
||||
{id:"menu-item-bidi-auto",toggle:"text-direction",label:RED._("menu.label.view.auto"), onselect:function(s) { if (s) {RED.bidi.setTextDirection("auto")}}}
|
||||
]},
|
||||
{id:"menu-item-numerals",label:RED._("menu.label.view.numericShaping"),options:[
|
||||
{id:"menu-item-numerals-default",toggle:"numeral-type",label:RED._("menu.label.view.defaultNumeral"),selected: true, onselect:function(s) { if(s){RED.bidi.setNumericShapingType("defaultNumeral")}}},
|
||||
{id:"menu-item-numerals-national",toggle:"numeral-type",label:RED._("menu.label.view.national"), onselect:function(s) { if (s) {RED.bidi.setNumericShapingType("national")}}},
|
||||
{id:"menu-item-numerals-contextual",toggle:"numeral-type",label:RED._("menu.label.view.contextual"), onselect:function(s) { if (s){RED.bidi.setNumericShapingType("contextual")}}}
|
||||
]},
|
||||
{id:"menu-item-calendars",label:RED._("menu.label.view.calendar"),options:[
|
||||
{id:"menu-item-calendars-default",toggle:"calendar-type",label:RED._("menu.label.view.defaultCalendar"),selected: true, onselect:function(s) { if(s) {RED.bidi.setCalendarType("gregorian")}}},
|
||||
{id:"menu-item-calendars-hijri",toggle:"calendar-type",label:RED._("menu.label.view.hijri"), onselect:function(s) { if (s) {RED.bidi.setCalendarType("hijri")}}},
|
||||
{id:"menu-item-calendars-hebrew",toggle:"calendar-type",label:RED._("menu.label.view.hebrew"), onselect:function(s) { if (s) {RED.bidi.setCalendarType("hebrew")}}}
|
||||
]},
|
||||
null,
|
||||
// {id:"menu-item-bidi",label:RED._("menu.label.view.textDir"),options:[
|
||||
// {id:"menu-item-bidi-default",toggle:"text-direction",label:RED._("menu.label.view.defaultDir"),selected: true, onselect:function(s) { if(s){RED.text.bidi.setTextDirection("")}}},
|
||||
// {id:"menu-item-bidi-ltr",toggle:"text-direction",label:RED._("menu.label.view.ltr"), onselect:function(s) { if(s){RED.text.bidi.setTextDirection("ltr")}}},
|
||||
// {id:"menu-item-bidi-rtl",toggle:"text-direction",label:RED._("menu.label.view.rtl"), onselect:function(s) { if(s){RED.text.bidi.setTextDirection("rtl")}}},
|
||||
// {id:"menu-item-bidi-auto",toggle:"text-direction",label:RED._("menu.label.view.auto"), onselect:function(s) { if(s){RED.text.bidi.setTextDirection("auto")}}}
|
||||
// ]},
|
||||
// null,
|
||||
{id:"menu-item-sidebar",label:RED._("menu.label.sidebar.show"),toggle:true,onselect:RED.sidebar.toggleSidebar, selected: true}
|
||||
]});
|
||||
menuOptions.push(null);
|
||||
@@ -236,11 +226,6 @@ var RED = (function() {
|
||||
|
||||
RED.menu.init({id:"btn-sidemenu",options: menuOptions});
|
||||
|
||||
//apply rtl direction on body tag in case of GUI mirroring is enabled
|
||||
if (RED.bidi.isMirroringEnabled()) {
|
||||
$("body").attr("dir","rtl");
|
||||
}
|
||||
|
||||
RED.user.init();
|
||||
|
||||
RED.library.init();
|
||||
|
||||
130
editor/js/text/bidi.js
Normal file
130
editor/js/text/bidi.js
Normal file
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
**/
|
||||
RED.text = {};
|
||||
RED.text.bidi = (function() {
|
||||
var textDir = "";
|
||||
var LRE = "\u202A",
|
||||
RLE = "\u202B",
|
||||
PDF = "\u202C";
|
||||
|
||||
function isRTLValue(stringValue) {
|
||||
var length = stringValue.length;
|
||||
for (var i=0;i<length;i++) {
|
||||
if (isBidiChar(stringValue.charCodeAt(i))) {
|
||||
return true;
|
||||
}
|
||||
else if(isLatinChar(stringValue.charCodeAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isBidiChar(c) {
|
||||
return (c >= 0x05d0 && c <= 0x05ff)||
|
||||
(c >= 0x0600 && c <= 0x065f)||
|
||||
(c >= 0x066a && c <= 0x06ef)||
|
||||
(c >= 0x06fa && c <= 0x07ff)||
|
||||
(c >= 0xfb1d && c <= 0xfdff)||
|
||||
(c >= 0xfe70 && c <= 0xfefc);
|
||||
}
|
||||
|
||||
function isLatinChar(c){
|
||||
return (c > 64 && c < 91)||(c > 96 && c < 123)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the text direction of a given string.
|
||||
* @param value - the string
|
||||
*/
|
||||
function resolveBaseTextDir(value) {
|
||||
if (textDir == "auto") {
|
||||
if (isRTLValue(value)) {
|
||||
return "rtl";
|
||||
} else {
|
||||
return "ltr";
|
||||
}
|
||||
}
|
||||
else {
|
||||
return textDir;
|
||||
}
|
||||
}
|
||||
|
||||
function onInputChange() {
|
||||
$(this).attr("dir", resolveBaseTextDir($(this).val()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds event listeners to the Input to ensure its text-direction attribute
|
||||
* is properly set based on its content.
|
||||
* @param input - the input field
|
||||
*/
|
||||
function prepareInput(input) {
|
||||
input.on("keyup",onInputChange).on("paste",onInputChange).on("cut",onInputChange);
|
||||
// Set the initial text direction
|
||||
onInputChange.call(input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforces the text direction of a given string by adding
|
||||
* UCC (Unicode Control Characters)
|
||||
* @param value - the string
|
||||
*/
|
||||
function enforceTextDirectionWithUCC(value) {
|
||||
if (value) {
|
||||
var dir = resolveBaseTextDir(value);
|
||||
if (dir == "ltr") {
|
||||
return LRE + value + PDF;
|
||||
}
|
||||
else if (dir == "rtl") {
|
||||
return RLE + value + PDF;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enforces the text direction for all the spans with style bidiAware under
|
||||
* workspace or sidebar div
|
||||
*/
|
||||
function enforceTextDirectionOnPage() {
|
||||
$("#workspace").find('span.bidiAware').each(function() {
|
||||
$(this).attr("dir", resolveBaseTextDir($(this).html()));
|
||||
});
|
||||
$("#sidebar").find('span.bidiAware').each(function() {
|
||||
$(this).attr("dir", resolveBaseTextDir($(this).text()));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text direction preference
|
||||
* @param dir - the text direction preference
|
||||
*/
|
||||
function setTextDirection(dir) {
|
||||
textDir = dir;
|
||||
RED.nodes.eachNode(function(n) { n.dirty = true;});
|
||||
RED.view.redraw();
|
||||
RED.palette.refresh();
|
||||
enforceTextDirectionOnPage();
|
||||
}
|
||||
|
||||
return {
|
||||
setTextDirection: setTextDirection,
|
||||
enforceTextDirectionWithUCC: enforceTextDirectionWithUCC,
|
||||
resolveBaseTextDir: resolveBaseTextDir,
|
||||
prepareInput: prepareInput
|
||||
}
|
||||
})();
|
||||
@@ -13,8 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
RED.bidi.format = (function() {
|
||||
RED.text.format = (function() {
|
||||
|
||||
var TextSegment = (function() {
|
||||
var TextSegment = function (obj) {
|
||||
@@ -759,7 +758,7 @@ RED.bidi.format = (function() {
|
||||
{
|
||||
guiDir: isRtl ? "rtl" : "ltr",
|
||||
dir: "ltr",
|
||||
points: "/\\:.&<>"
|
||||
points: "/\\:."
|
||||
};
|
||||
if (!parseOnly) {
|
||||
return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
|
||||
@@ -877,7 +876,7 @@ RED.bidi.format = (function() {
|
||||
{
|
||||
guiDir: isRtl ? "rtl" : "ltr",
|
||||
dir: "ltr",
|
||||
points: ":?#/@.[]=&<>"
|
||||
points: ":?#/@.[]="
|
||||
};
|
||||
if (!parseOnly) {
|
||||
return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
|
||||
@@ -1305,18 +1304,6 @@ RED.bidi.format = (function() {
|
||||
}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Returns the string representation of a given structured text
|
||||
* @param text - the structured text
|
||||
* @param type - could be one of filepath, url, email
|
||||
* @param args - pass additional arguments to the handler. generally null.
|
||||
* @param isRtl - indicates if the GUI is mirrored
|
||||
* @param locale - the browser locale
|
||||
*/
|
||||
getString: function (text, type, args, isRtl, locale) {
|
||||
return getHandler(type).format(text, args, isRtl, false, locale);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the HTML representation of a given structured text
|
||||
* @param text - the structured text
|
||||
@@ -75,7 +75,7 @@ RED.menu = (function() {
|
||||
linkContent += '<span class="menu-label-container"><span class="menu-label">'+opt.label+'</span>'+
|
||||
'<span class="menu-sublabel">'+opt.sublabel+'</span></span>'
|
||||
} else {
|
||||
linkContent += '<span class="menu-label">'+RED.bidi.applyBidiSupport(opt.label, RED.bidi.flags.NS)+'</span>'
|
||||
linkContent += '<span class="menu-label">'+opt.label+'</span>'
|
||||
}
|
||||
|
||||
linkContent += '</a>';
|
||||
|
||||
@@ -34,8 +34,8 @@ RED.popover = (function() {
|
||||
var targetHeight = target.height();
|
||||
|
||||
var divHeight = div.height();
|
||||
var popoverPos = ((RED.bidi.isMirroringEnabled()) ? targetPos.left-targetWidth-210 : targetPos.left+targetWidth+17);
|
||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-10,left:popoverPos});
|
||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-10,left:targetPos.left+targetWidth+17});
|
||||
|
||||
div.fadeIn("fast");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@
|
||||
if (val === undefined || val === null || val === "") {
|
||||
this.resultCount.text("").hide();
|
||||
} else {
|
||||
val = RED.bidi.applyBidiSupport(val,RED.bidi.flags.NS);
|
||||
this.resultCount.text(val).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,8 +202,9 @@ RED.tabs = (function() {
|
||||
if (tab.icon) {
|
||||
$('<img src="'+tab.icon+'" class="red-ui-tab-icon"/>').appendTo(link);
|
||||
}
|
||||
var span = $('<span/>',{class:"bidiAware"});
|
||||
span.attr('dir', RED.bidi.resolveBaseTextDir(tab.label)).text(RED.bidi.applyBidiSupport(tab.label,RED.bidi.flags.NS)).appendTo(link);
|
||||
var span = $('<span/>',{class:"bidiAware"}).text(tab.label).appendTo(link);
|
||||
span.attr('dir', RED.text.bidi.resolveBaseTextDir(tab.label));
|
||||
|
||||
link.on("click",onTabClick);
|
||||
link.on("dblclick",onTabDblClick);
|
||||
if (tab.closeable) {
|
||||
@@ -313,7 +314,7 @@ RED.tabs = (function() {
|
||||
tabs[id].label = label;
|
||||
var tab = ul.find("a[href='#"+id+"']");
|
||||
tab.attr("title",label);
|
||||
tab.find("span").attr('dir', RED.bidi.resolveBaseTextDir(label)).text(RED.bidi.applyBidiSupport(label,RED.bidi.flags.NS));
|
||||
tab.find("span").text(label).attr('dir', RED.text.bidi.resolveBaseTextDir(label));
|
||||
updateTabWidths();
|
||||
},
|
||||
order: function(order) {
|
||||
|
||||
@@ -198,12 +198,12 @@
|
||||
if (opt.label) {
|
||||
op.text(opt.label);
|
||||
}
|
||||
// reverse property direction in case of right directionality
|
||||
if (opt.icon) {
|
||||
$('<img>',{src:opt.icon,style:"margin-"+RED.bidi.componentPos.right+": 4px; height: 18px;"}).prependTo(op);
|
||||
$('<img>',{src:opt.icon,style:"margin-right: 4px; height: 18px;"}).prependTo(op);
|
||||
} else {
|
||||
op.css("padding-"+RED.bidi.componentPos.left, "18px");
|
||||
op.css({paddingLeft: "18px"});
|
||||
}
|
||||
|
||||
op.click(function(event) {
|
||||
event.preventDefault();
|
||||
callback(opt.value);
|
||||
@@ -225,19 +225,15 @@
|
||||
var that = this;
|
||||
var pos = relativeTo.offset();
|
||||
var height = relativeTo.height();
|
||||
var width = relativeTo.outerWidth();
|
||||
var menuHeight = menu.height();
|
||||
var top = (height+pos.top-3);
|
||||
if (top+menuHeight > $(window).height()) {
|
||||
top -= (top+menuHeight)-$(window).height()+5;
|
||||
}
|
||||
|
||||
var menuPos = ((RED.bidi.isMirroringEnabled()) ? ((pos.left + width) - (menu.offset().left + menu.outerWidth())) : (2+pos.left));
|
||||
menu.css({
|
||||
top: top+"px",
|
||||
left: menuPos+"px",
|
||||
left: (2+pos.left)+"px",
|
||||
});
|
||||
|
||||
menu.slideDown(100);
|
||||
this._delay(function() {
|
||||
that.uiSelect.addClass('red-ui-typedInput-focus');
|
||||
@@ -275,10 +271,9 @@
|
||||
} else {
|
||||
this.selectTrigger.width('auto');
|
||||
var labelWidth = this._getLabelWidth(this.selectTrigger);
|
||||
// reverse property direction in case of right directionality
|
||||
this.elementDiv.css(RED.bidi.componentPos.left,labelWidth+"px");
|
||||
this.elementDiv.css('left',labelWidth+"px");
|
||||
if (this.optionSelectTrigger) {
|
||||
this.optionSelectTrigger.css(RED.bidi.componentPos.left,(labelWidth+5)+"px");
|
||||
this.optionSelectTrigger.css('left',(labelWidth+5)+"px");
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -341,7 +336,7 @@
|
||||
image = new Image();
|
||||
image.name = opt.icon;
|
||||
image.src = opt.icon;
|
||||
$('<img>',{src:opt.icon,style:"margin-"+RED.bidi.componentPos.right+": 4px;height: 18px;"}).prependTo(this.selectLabel);
|
||||
$('<img>',{src:opt.icon,style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel);
|
||||
} else {
|
||||
this.selectLabel.text(opt.label);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ RED.deploy = (function() {
|
||||
|
||||
function changeDeploymentType(type) {
|
||||
deploymentType = type;
|
||||
$("#btn-deploy img").attr("src",deploymentTypes[type].img);
|
||||
$("#btn-deploy-icon").attr("src",deploymentTypes[type].img);
|
||||
}
|
||||
|
||||
var currentDiff = null;
|
||||
@@ -50,7 +50,15 @@ RED.deploy = (function() {
|
||||
|
||||
if (type == "default") {
|
||||
$('<li><span class="deploy-button-group button-group">'+
|
||||
'<a id="btn-deploy" class="deploy-button disabled" href="#"><img id="btn-deploy-icon" src="red/images/deploy-full-o.png"> <span>'+RED._("deploy.deploy")+'</span></a>'+
|
||||
'<a id="btn-deploy" class="deploy-button disabled" href="#">'+
|
||||
'<span class="deploy-button-content">'+
|
||||
'<img id="btn-deploy-icon" src="red/images/deploy-full-o.png"> '+
|
||||
'<span>'+RED._("deploy.deploy")+'</span>'+
|
||||
'</span>'+
|
||||
'<span class="deploy-button-spinner hide">'+
|
||||
'<img src="red/images/spin.svg"/>'+
|
||||
'</span>'+
|
||||
'</a>'+
|
||||
'<a id="btn-deploy-options" data-toggle="dropdown" class="deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
|
||||
'</span></li>').prependTo(".header-toolbar");
|
||||
RED.menu.init({id:"btn-deploy-options",
|
||||
@@ -69,8 +77,14 @@ RED.deploy = (function() {
|
||||
|
||||
$('<li><span class="deploy-button-group button-group">'+
|
||||
'<a id="btn-deploy" class="deploy-button disabled" href="#">'+
|
||||
(icon?'<img id="btn-deploy-icon" src="'+icon+'"> ':'')+
|
||||
'<span>'+label+'</span></a>'+
|
||||
'<span class="deploy-button-content">'+
|
||||
(icon?'<img id="btn-deploy-icon" src="'+icon+'"> ':'')+
|
||||
'<span>'+label+'</span>'+
|
||||
'</span>'+
|
||||
'<span class="deploy-button-spinner hide">'+
|
||||
'<img src="red/images/spin.svg"/>'+
|
||||
'</span>'+
|
||||
'</a>'+
|
||||
'</span></li>').prependTo(".header-toolbar");
|
||||
}
|
||||
|
||||
@@ -114,7 +128,7 @@ RED.deploy = (function() {
|
||||
],
|
||||
create: function() {
|
||||
$("#node-dialog-confirm-deploy").parent().find("div.ui-dialog-buttonpane")
|
||||
.prepend('<div style="height:0; vertical-align: middle; display:inline-block; margin-top: 13px; float:'+RED.bidi.componentPos.left+';">'+
|
||||
.prepend('<div style="height:0; vertical-align: middle; display:inline-block; margin-top: 13px; float:left;">'+
|
||||
'<input style="vertical-align:top;" type="checkbox" id="node-dialog-confirm-deploy-hide">'+
|
||||
'<label style="display:inline;" for="node-dialog-confirm-deploy-hide"> do not warn about this again</label>'+
|
||||
'<input type="hidden" id="node-dialog-confirm-deploy-type">'+
|
||||
@@ -519,9 +533,7 @@ RED.deploy = (function() {
|
||||
|
||||
|
||||
function save(skipValidation,force) {
|
||||
if (RED.nodes.dirty()) {
|
||||
//$("#debug-tab-clear").click(); // uncomment this to auto clear debug on deploy
|
||||
|
||||
if (!$("#btn-deploy").hasClass("disabled")) {
|
||||
if (!skipValidation) {
|
||||
var hasUnknown = false;
|
||||
var hasInvalid = false;
|
||||
@@ -570,7 +582,7 @@ RED.deploy = (function() {
|
||||
$( "#node-dialog-confirm-deploy-config" ).show();
|
||||
invalidNodes.sort(sortNodeInfo);
|
||||
$( "#node-dialog-confirm-deploy-invalid-list" )
|
||||
.html("<li>"+invalidNodes.map(function(A) { return (A.tab?"["+RED.bidi.applyBidiSupport(A.tab, RED.bidi.flags.NS)+"] ":"")+RED.bidi.applyBidiSupport(A.label, RED.bidi.flags.NS)+" ("+A.type+")"}).join("</li><li>")+"</li>");
|
||||
.html("<li>"+invalidNodes.map(function(A) { return (A.tab?"["+A.tab+"] ":"")+A.label+" ("+A.type+")"}).join("</li><li>")+"</li>");
|
||||
|
||||
} else if (hasUnusedConfig && !ignoreDeployWarnings.unusedConfig) {
|
||||
// showWarning = true;
|
||||
@@ -590,8 +602,10 @@ RED.deploy = (function() {
|
||||
|
||||
var nns = RED.nodes.createCompleteNodeSet();
|
||||
|
||||
$("#btn-deploy-icon").removeClass('fa-download');
|
||||
$("#btn-deploy-icon").addClass('spinner');
|
||||
var startTime = Date.now();
|
||||
$(".deploy-button-content").css('opacity',0);
|
||||
$(".deploy-button-spinner").show();
|
||||
$("#btn-deploy").addClass("disabled");
|
||||
|
||||
var data = {flows:nns};
|
||||
|
||||
@@ -641,6 +655,7 @@ RED.deploy = (function() {
|
||||
RED.events.emit("deploy");
|
||||
}).fail(function(xhr,textStatus,err) {
|
||||
RED.nodes.dirty(true);
|
||||
$("#btn-deploy").removeClass("disabled");
|
||||
if (xhr.status === 401) {
|
||||
RED.notify(RED._("deploy.deployFailed",{message:RED._("user.notAuthorized")}),"error");
|
||||
} else if (xhr.status === 409) {
|
||||
@@ -651,8 +666,11 @@ RED.deploy = (function() {
|
||||
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
|
||||
}
|
||||
}).always(function() {
|
||||
$("#btn-deploy-icon").removeClass('spinner');
|
||||
$("#btn-deploy-icon").addClass('fa-download');
|
||||
var delta = Math.max(0,300-(Date.now()-startTime));
|
||||
setTimeout(function() {
|
||||
$(".deploy-button-content").css('opacity',1);
|
||||
$(".deploy-button-spinner").hide();
|
||||
},delta);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,12 +315,12 @@ RED.editor = (function() {
|
||||
val = "";
|
||||
}
|
||||
if (definition !== undefined && definition[property].hasOwnProperty("format") && definition[property].format !== "" && input[0].nodeName === "DIV") {
|
||||
input.html(RED.bidi.applyBidiSupport(val, RED.bidi.flags.STT_GETHTML, definition[property].format, {}));
|
||||
RED.bidi.applyBidiSupport(input[0],RED.bidi.flags.STT_ATTACH, definition[property].format, {});
|
||||
input.html(RED.text.format.getHtml(val, definition[property].format, {}, false, "en"));
|
||||
RED.text.format.attach(input[0], definition[property].format, {}, false, "en");
|
||||
} else {
|
||||
input.val(val);
|
||||
if (input[0].nodeName === 'INPUT' || input[0].nodeName === 'TEXTAREA') {
|
||||
RED.bidi.prepareInput(input);
|
||||
RED.text.bidi.prepareInput(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1186,7 +1186,7 @@ RED.editor = (function() {
|
||||
}
|
||||
|
||||
configNodes.forEach(function(cn) {
|
||||
select.append('<option value="'+cn.id+'"'+(value==cn.id?" selected":"")+'>'+RED.bidi.applyBidiSupport(cn.__label__,RED.bidi.flags.BTD & RED.bidi.flags.NS)+'</option>');
|
||||
select.append('<option value="'+cn.id+'"'+(value==cn.id?" selected":"")+'>'+RED.text.bidi.enforceTextDirectionWithUCC(cn.__label__)+'</option>');
|
||||
delete cn.__label__;
|
||||
});
|
||||
|
||||
@@ -1320,7 +1320,7 @@ RED.editor = (function() {
|
||||
});
|
||||
|
||||
$("#subflow-input-name").val(subflow.name);
|
||||
RED.bidi.prepareInput($("#subflow-input-name"));
|
||||
RED.text.bidi.prepareInput($("#subflow-input-name"));
|
||||
subflowEditor.getSession().setValue(subflow.info||"",-1);
|
||||
var userCount = 0;
|
||||
var subflowType = "subflow:"+editing_node.id;
|
||||
|
||||
@@ -105,7 +105,7 @@ RED.keyboard = (function() {
|
||||
}
|
||||
if (!dialog) {
|
||||
dialog = $('<div id="keyboard-help-dialog" class="hide">'+
|
||||
'<div id="keyboard-help-dialog-div1">'+
|
||||
'<div style="vertical-align: top;display:inline-block; box-sizing: border-box; width:50%; padding: 10px;">'+
|
||||
'<table class="keyboard-shortcuts">'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">a</span></td><td>'+RED._("keyboard.selectAll")+'</td></tr>'+
|
||||
'<tr><td><span class="help-key">Shift</span> + <span class="help-key">Click</span></td><td>'+RED._("keyboard.selectAllConnected")+'</td></tr>'+
|
||||
@@ -121,10 +121,11 @@ RED.keyboard = (function() {
|
||||
'<tr><td><span class="help-key">Shift</span> + <span class="help-key"> ↓ </span></td></tr>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div id="keyboard-help-dialog-div2">'+
|
||||
'<div style="vertical-align: top;display:inline-block; box-sizing: border-box; width:50%; padding: 10px;">'+
|
||||
'<table class="keyboard-shortcuts">'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">Space</span></td><td>'+RED._("keyboard.toggleSidebar")+'</td></tr>'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">.</span></td><td>'+RED._("keyboard.searchBox")+'</td></tr>'+
|
||||
'<tr><td><span class="help-key">Ctrl/⌘</span> + <span class="help-key">Shift</span> + <span class="help-key">p</span></td><td>'+RED._("keyboard.managePalette")+'</td></tr>'+
|
||||
'<tr><td></td><td></td></tr>'+
|
||||
'<tr><td><span class="help-key">Delete</span></td><td rowspan="2">'+RED._("keyboard.deleteSelected")+'</td></tr>'+
|
||||
'<tr><td><span class="help-key">Backspace</span></td></tr>'+
|
||||
|
||||
@@ -17,7 +17,6 @@ RED.notify = (function() {
|
||||
var currentNotifications = [];
|
||||
var c = 0;
|
||||
return function(msg,type,fixed,timeout) {
|
||||
msg = RED.bidi.applyBidiSupport(msg ,RED.bidi.flags.NS);
|
||||
if (currentNotifications.length > 4) {
|
||||
var ll = currentNotifications.length;
|
||||
for (var i = 0;ll > 4 && i<currentNotifications.length;i+=1) {
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
**/
|
||||
RED.palette.editor = (function() {
|
||||
|
||||
var disabled = false;
|
||||
|
||||
var editorTabs;
|
||||
var filterInput;
|
||||
var searchInput;
|
||||
@@ -22,6 +24,7 @@ RED.palette.editor = (function() {
|
||||
var packageList;
|
||||
var loadedList = [];
|
||||
var filteredList = [];
|
||||
var loadedIndex = {};
|
||||
|
||||
var typesInUse = {};
|
||||
var nodeEntries = {};
|
||||
@@ -88,6 +91,15 @@ RED.palette.editor = (function() {
|
||||
callback(xhr);
|
||||
})
|
||||
}
|
||||
|
||||
function refreshNodeModuleList() {
|
||||
for (var id in nodeEntries) {
|
||||
if (nodeEntries.hasOwnProperty(id)) {
|
||||
_refreshNodeModule(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function refreshNodeModule(module) {
|
||||
if (!eventTimers.hasOwnProperty(module)) {
|
||||
eventTimers[module] = setTimeout(function() {
|
||||
@@ -235,7 +247,6 @@ RED.palette.editor = (function() {
|
||||
}
|
||||
}
|
||||
var nodeCount = (activeTypeCount === typeCount)?typeCount:activeTypeCount+" / "+typeCount;
|
||||
nodeCount = RED.bidi.applyBidiSupport(nodeCount,RED.bidi.flags.NS);
|
||||
nodeEntry.setCount.html(RED._('palette.editor.nodeCount',{count:typeCount,label:nodeCount}));
|
||||
|
||||
if (nodeEntries[module].totalUseCount > 0) {
|
||||
@@ -253,6 +264,19 @@ RED.palette.editor = (function() {
|
||||
nodeEntry.container.toggleClass("disabled",(activeTypeCount === 0));
|
||||
}
|
||||
}
|
||||
|
||||
nodeEntry.updateButton.hide();
|
||||
// if (loadedIndex.hasOwnProperty(module)) {
|
||||
// if (moduleInfo.version !== loadedIndex[module].version) {
|
||||
// nodeEntry.updateButton.show();
|
||||
// nodeEntry.updateButton.html(RED._('palette.editor.update',{version:loadedIndex[module].version}));
|
||||
// } else {
|
||||
// nodeEntry.updateButton.hide();
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
// nodeEntry.updateButton.hide();
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -260,17 +284,28 @@ RED.palette.editor = (function() {
|
||||
if (RED.settings.theme('palette.editable') === false) {
|
||||
return;
|
||||
}
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
initInstallTab();
|
||||
$("#header-shade").show();
|
||||
$("#editor-shade").show();
|
||||
$("#sidebar-shade").show();
|
||||
$("#sidebar-separator").hide();
|
||||
|
||||
editorTabs.activateTab('nodes');
|
||||
|
||||
$("#main-container").addClass("palette-expanded");
|
||||
setTimeout(function() {
|
||||
editorTabs.resize();
|
||||
filterInput.focus();
|
||||
},250);
|
||||
RED.events.emit("palette-editor:open");
|
||||
RED.keyboard.add("*",/* ESCAPE */ 27,function(){hidePaletteEditor();d3.event.preventDefault();});
|
||||
}
|
||||
function hidePaletteEditor() {
|
||||
RED.keyboard.remove("*");
|
||||
$("#main-container").removeClass("palette-expanded");
|
||||
$("#header-shade").hide();
|
||||
$("#editor-shade").hide();
|
||||
@@ -308,6 +343,7 @@ RED.palette.editor = (function() {
|
||||
catalogueLoadStatus.push(v);
|
||||
if (v.modules) {
|
||||
v.modules.forEach(function(m) {
|
||||
loadedIndex[m.id] = m;
|
||||
m.index = [m.id];
|
||||
if (m.keywords) {
|
||||
m.index = m.index.concat(m.keywords);
|
||||
@@ -336,6 +372,7 @@ RED.palette.editor = (function() {
|
||||
function initInstallTab() {
|
||||
if (loadedList.length === 0) {
|
||||
loadedList = [];
|
||||
loadedIndex = {};
|
||||
packageList.editableList('empty');
|
||||
$(".palette-module-shade-status").html(RED._('palette.editor.loading'));
|
||||
var catalogues = RED.settings.theme('palette.catalogues')||['https://catalogue.nodered.org/catalogue.json'];
|
||||
@@ -349,6 +386,7 @@ RED.palette.editor = (function() {
|
||||
catalogues.forEach(function(catalog,index) {
|
||||
$.getJSON(catalog, {_: new Date().getTime()},function(v) {
|
||||
handleCatalogResponse(catalog,index,v);
|
||||
refreshNodeModuleList();
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -380,6 +418,13 @@ RED.palette.editor = (function() {
|
||||
return;
|
||||
}
|
||||
|
||||
RED.events.on("editor:open",function() { disabled = true; });
|
||||
RED.events.on("editor:close",function() { disabled = false; });
|
||||
RED.events.on("search:open",function() { disabled = true; });
|
||||
RED.events.on("search:close",function() { disabled = false; });
|
||||
|
||||
RED.keyboard.add("*", /* p */ 80,{shift:true,ctrl:true},function() {RED.palette.editor.show();d3.event.preventDefault();});
|
||||
|
||||
editorTabs = RED.tabs.create({
|
||||
id:"palette-editor-tabs",
|
||||
onchange:function(tab) {
|
||||
@@ -392,7 +437,6 @@ RED.palette.editor = (function() {
|
||||
searchInput.searchBox('value',"");
|
||||
}
|
||||
if (tab.id === 'install') {
|
||||
initInstallTab();
|
||||
if (searchInput) {
|
||||
searchInput.focus();
|
||||
}
|
||||
@@ -455,11 +499,18 @@ RED.palette.editor = (function() {
|
||||
var titleRow = $('<div class="palette-module-meta palette-module-name"><i class="fa fa-cube"></i></div>').appendTo(headerRow);
|
||||
$('<span>').html(entry.name).appendTo(titleRow);
|
||||
var metaRow = $('<div class="palette-module-meta palette-module-version"><i class="fa fa-tag"></i></div>').appendTo(headerRow);
|
||||
$('<span>').html(RED.bidi.applyBidiSupport(entry.version,RED.bidi.flags.NS)).appendTo(metaRow);
|
||||
$('<span>').html(entry.version).appendTo(metaRow);
|
||||
var buttonRow = $('<div>',{class:"palette-module-meta"}).appendTo(headerRow);
|
||||
var setButton = $('<a href="#" class="editor-button editor-button-small palette-module-set-button"><i class="fa fa-angle-right palette-module-node-chevron"></i> </a>').appendTo(buttonRow);
|
||||
var setCount = $('<span>').appendTo(setButton);
|
||||
var buttonGroup = $('<div>',{class:"palette-module-button-group"}).appendTo(buttonRow);
|
||||
|
||||
var updateButton = $('<a href="#" class="editor-button editor-button-small"></a>').html(RED._('palette.editor.update')).appendTo(buttonGroup);
|
||||
updateButton.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
})
|
||||
|
||||
|
||||
var removeButton = $('<a href="#" class="editor-button editor-button-small"></a>').html(RED._('palette.editor.remove')).appendTo(buttonGroup);
|
||||
removeButton.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
@@ -477,6 +528,7 @@ RED.palette.editor = (function() {
|
||||
var shade = $('<div class="palette-module-shade hide"><img src="red/images/spin.svg" class="palette-spinner"/></div>').appendTo(container);
|
||||
|
||||
object.elements = {
|
||||
updateButton: updateButton,
|
||||
removeButton: removeButton,
|
||||
enableButton: enableButton,
|
||||
setCount: setCount,
|
||||
@@ -609,6 +661,7 @@ RED.palette.editor = (function() {
|
||||
refreshButton.click(function(e) {
|
||||
e.preventDefault();
|
||||
loadedList = [];
|
||||
loadedIndex = {};
|
||||
initInstallTab();
|
||||
})
|
||||
|
||||
|
||||
@@ -86,22 +86,20 @@ RED.palette = (function() {
|
||||
}
|
||||
displayLines.push(currentLine);
|
||||
|
||||
var tempLines = displayLines.join("^&%");
|
||||
tempLines =RED.bidi.applyBidiSupport(tempLines, RED.bidi.flags.NS);
|
||||
var lines = tempLines.replace("^&%", "<br/>");
|
||||
var lines = displayLines.join("<br/>");
|
||||
var multiLineNodeHeight = 8+(lineHeight*displayLines.length);
|
||||
el.css({height:multiLineNodeHeight+"px"});
|
||||
|
||||
var labelElement = el.find(".palette_label");
|
||||
labelElement.html(lines).attr('dir', RED.bidi.resolveBaseTextDir(lines));
|
||||
labelElement.html(lines).attr('dir', RED.text.bidi.resolveBaseTextDir(lines));
|
||||
|
||||
el.find(".palette_port").css({top:(multiLineNodeHeight/2-5)+"px"});
|
||||
|
||||
var popOverContent;
|
||||
try {
|
||||
var l = "<p><b>"+RED.bidi.applyBidiSupport(label,RED.bidi.flags.BTD & RED.bidi.flags.NS)+"</b></p>";
|
||||
var l = "<p><b>"+RED.text.bidi.enforceTextDirectionWithUCC(label)+"</b></p>";
|
||||
if (label != type) {
|
||||
l = "<p><b>"+RED.bidi.applyBidiSupport(label,RED.bidi.flags.BTD & RED.bidi.flags.NS)+"</b><br/><i>"+type+"</i></p>";
|
||||
l = "<p><b>"+RED.text.bidi.enforceTextDirectionWithUCC(label)+"</b><br/><i>"+type+"</i></p>";
|
||||
}
|
||||
popOverContent = $(l+(info?info:$("script[data-help-name$='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim())
|
||||
.filter(function(n) {
|
||||
|
||||
@@ -250,6 +250,7 @@ RED.search = (function() {
|
||||
createDialog();
|
||||
}
|
||||
dialog.slideDown();
|
||||
RED.events.emit("search:open");
|
||||
visible = true;
|
||||
}
|
||||
searchInput.focus();
|
||||
@@ -268,6 +269,7 @@ RED.search = (function() {
|
||||
searchInput.searchBox('value','');
|
||||
});
|
||||
}
|
||||
RED.events.emit("search:close");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ RED.sidebar = (function() {
|
||||
sidebarSeparator.opening = true;
|
||||
var newChartRight = 7;
|
||||
$("#sidebar").addClass("closing");
|
||||
$("#workspace").css(RED.bidi.componentPos.right,newChartRight);
|
||||
$("#workspace").css("right",newChartRight);
|
||||
$("#editor-stack").css("right",newChartRight+1);
|
||||
$("#sidebar").width(0);
|
||||
RED.menu.setSelected("menu-item-sidebar",true);
|
||||
@@ -123,21 +123,16 @@ RED.sidebar = (function() {
|
||||
},
|
||||
drag: function(event,ui) {
|
||||
var d = ui.position.left-sidebarSeparator.start;
|
||||
// using to handle sidebar width at both RTL and LTR UIs
|
||||
var newSidebarWidth = (RED.bidi.isMirroringEnabled() ? sidebarSeparator.width + d : sidebarSeparator.width - d);
|
||||
var newSidebarWidth = sidebarSeparator.width-d;
|
||||
if (sidebarSeparator.opening) {
|
||||
newSidebarWidth -= 3;
|
||||
}
|
||||
|
||||
if (newSidebarWidth > 150) {
|
||||
// to handle sidebar width at both RTL and LTR UIs
|
||||
var tempValue = (RED.bidi.isMirroringEnabled() ? sidebarSeparator.chartWidth - d : sidebarSeparator.chartWidth + d);
|
||||
if (tempValue < 200) {
|
||||
|
||||
if (sidebarSeparator.chartWidth+d < 200) {
|
||||
ui.position.left = 200+sidebarSeparator.start-sidebarSeparator.chartWidth;
|
||||
d = ui.position.left-sidebarSeparator.start;
|
||||
// to handle sidebar width at both RTL and LTR UIs
|
||||
newSidebarWidth = (RED.bidi.isMirroringEnabled() ? sidebarSeparator.width + d : sidebarSeparator.width - d);
|
||||
newSidebarWidth = sidebarSeparator.width-d;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,9 +151,8 @@ RED.sidebar = (function() {
|
||||
$("#sidebar").removeClass("closing");
|
||||
}
|
||||
|
||||
//to handle workspace css right property at both RTL and LTR UIs
|
||||
var newChartRight = (RED.bidi.isMirroringEnabled() ? $("#editor-stack").css("right") : sidebarSeparator.chartRight-d);
|
||||
$("#workspace").css(RED.bidi.componentPos.right,(RED.bidi.isMirroringEnabled() ? newSidebarWidth+2 : newChartRight));
|
||||
var newChartRight = sidebarSeparator.chartRight-d;
|
||||
$("#workspace").css("right",newChartRight);
|
||||
$("#editor-stack").css("right",newChartRight+1);
|
||||
$("#sidebar").width(newSidebarWidth);
|
||||
|
||||
@@ -171,12 +165,12 @@ RED.sidebar = (function() {
|
||||
RED.menu.setSelected("menu-item-sidebar",false);
|
||||
if ($("#sidebar").width() < 180) {
|
||||
$("#sidebar").width(180);
|
||||
$("#workspace").css(RED.bidi.componentPos.right,187);
|
||||
$("#workspace").css("right",187);
|
||||
$("#editor-stack").css("right",188);
|
||||
}
|
||||
}
|
||||
$("#sidebar-separator").css(RED.bidi.componentPos.left,"auto");
|
||||
$("#sidebar-separator").css(RED.bidi.componentPos.right,($("#sidebar").width()+2)+"px");
|
||||
$("#sidebar-separator").css("left","auto");
|
||||
$("#sidebar-separator").css("right",($("#sidebar").width()+2)+"px");
|
||||
RED.events.emit("sidebar:resize");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ RED.subflow = (function() {
|
||||
RED.view.select();
|
||||
RED.nodes.dirty(true);
|
||||
RED.view.redraw();
|
||||
$("#workspace-subflow-output .spinner-value").html(RED.bidi.applyBidiSupport(subflow.out.length,RED.bidi.flags.NS));
|
||||
$("#workspace-subflow-output .spinner-value").html(subflow.out.length);
|
||||
}
|
||||
|
||||
function removeSubflowOutput(removedSubflowOutputs) {
|
||||
@@ -216,7 +216,7 @@ RED.subflow = (function() {
|
||||
$("#workspace-subflow-input-add").toggleClass("active", activeSubflow.in.length !== 0);
|
||||
$("#workspace-subflow-input-remove").toggleClass("active",activeSubflow.in.length === 0);
|
||||
|
||||
$("#workspace-subflow-output .spinner-value").html(RED.bidi.applyBidiSupport(activeSubflow.out.length,RED.bidi.flags.NS));
|
||||
$("#workspace-subflow-output .spinner-value").html(activeSubflow.out.length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,15 +224,15 @@ RED.subflow = (function() {
|
||||
var toolbar = $("#workspace-toolbar");
|
||||
toolbar.empty();
|
||||
|
||||
$('<a class="button subflow-toolbar" id="workspace-subflow-edit" href="#" data-i18n="[append]subflow.editSubflowProperties"><i class="fa fa-pencil"></i> </a>').appendTo(toolbar);
|
||||
$('<span class="workspace-subflow-label" data-i18n="subflow.input"></span> '+
|
||||
'<div style="display: inline-block;" class="button-group subflow-toolbar">'+
|
||||
'<a id="workspace-subflow-input-remove" class="button active subflow-toolbar" href="#">0</a>'+
|
||||
$('<a class="button" id="workspace-subflow-edit" href="#" data-i18n="[append]subflow.editSubflowProperties"><i class="fa fa-pencil"></i> </a>').appendTo(toolbar);
|
||||
$('<span style="margin-left: 5px;" data-i18n="subflow.input"></span> '+
|
||||
'<div style="display: inline-block;" class="button-group">'+
|
||||
'<a id="workspace-subflow-input-remove" class="button active" href="#">0</a>'+
|
||||
'<a id="workspace-subflow-input-add" class="button" href="#">1</a>'+
|
||||
'</div>').appendTo(toolbar);
|
||||
|
||||
$('<span class="workspace-subflow-label" data-i18n="subflow.output"></span> <div id="workspace-subflow-output" style="display: inline-block;" class="button-group spinner-group">'+
|
||||
'<a id="workspace-subflow-output-remove" class="button subflow-toolbar" href="#"><i class="fa fa-minus"></i></a>'+
|
||||
$('<span style="margin-left: 5px;" data-i18n="subflow.output"></span> <div id="workspace-subflow-output" style="display: inline-block;" class="button-group spinner-group">'+
|
||||
'<a id="workspace-subflow-output-remove" class="button" href="#"><i class="fa fa-minus"></i></a>'+
|
||||
'<div class="spinner-value">3</div>'+
|
||||
'<a id="workspace-subflow-output-add" class="button" href="#"><i class="fa fa-plus"></i></a>'+
|
||||
'</div>').appendTo(toolbar);
|
||||
@@ -243,11 +243,6 @@ RED.subflow = (function() {
|
||||
toolbar.i18n();
|
||||
|
||||
|
||||
var subflow_add = RED.bidi.applyBidiSupport($("#workspace-subflow-input-add").text(),RED.bidi.flags.NS);
|
||||
var subflow_remove = RED.bidi.applyBidiSupport($("#workspace-subflow-input-remove").text(),RED.bidi.flags.NS);
|
||||
$("#workspace-subflow-input-add").html(subflow_add);
|
||||
$("#workspace-subflow-input-remove").html(subflow_remove);
|
||||
|
||||
$("#workspace-subflow-output-remove").click(function(event) {
|
||||
event.preventDefault();
|
||||
var wasDirty = RED.nodes.dirty();
|
||||
|
||||
@@ -136,8 +136,8 @@ RED.sidebar.config = (function() {
|
||||
try {
|
||||
label = node._def.label.call(node);
|
||||
} catch(err) {
|
||||
console.log("Definition error: "+node_def.type+".label",err);
|
||||
label = node_def.type;
|
||||
console.log("Definition error: "+node._def.type+".label",err);
|
||||
label = node._def.type;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -70,10 +70,10 @@ RED.sidebar.info = (function() {
|
||||
var table = '<table class="node-info"><tbody>';
|
||||
table += '<tr class="blank"><td colspan="2">'+RED._("sidebar.info.node")+'</td></tr>';
|
||||
if (node.type != "subflow" && node.name) {
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td> <span class="bidiAware" dir="'+RED.bidi.resolveBaseTextDir(node.name)+'">'+RED.bidi.applyBidiSupport(node.name,RED.bidi.flags.NS)+'</span></td></tr>';
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td> <span class="bidiAware" dir="'+RED.text.bidi.resolveBaseTextDir(node.name)+'">'+node.name+'</span></td></tr>';
|
||||
}
|
||||
table += "<tr><td>"+RED._("sidebar.info.type")+"</td><td> "+node.type+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("sidebar.info.id")+"</td><td> "+RED.bidi.applyBidiSupport(node.id,RED.bidi.flags.NS)+"</td></tr>";
|
||||
table += "<tr><td>"+RED._("sidebar.info.id")+"</td><td> "+node.id+"</td></tr>";
|
||||
|
||||
var m = /^subflow(:(.+))?$/.exec(node.type);
|
||||
var subflowNode;
|
||||
@@ -93,8 +93,8 @@ RED.sidebar.info = (function() {
|
||||
userCount++;
|
||||
}
|
||||
});
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(subflowNode.name)+'">'+RED.bidi.applyBidiSupport(subflowNode.name,RED.bidi.flags.NS)+'</span></td></tr>';
|
||||
table += "<tr><td>"+RED._("sidebar.info.instances")+"</td><td>"+RED.bidi.applyBidiSupport(userCount,RED.bidi.flags.NS)+"</td></tr>";
|
||||
table += '<tr><td>'+RED._("common.label.name")+'</td><td><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(subflowNode.name)+'">'+subflowNode.name+'</span></td></tr>';
|
||||
table += "<tr><td>"+RED._("sidebar.info.instances")+"</td><td>"+userCount+"</td></tr>";
|
||||
}
|
||||
|
||||
if (!m && node.type != "subflow" && node.type != "comment") {
|
||||
@@ -132,7 +132,7 @@ RED.sidebar.info = (function() {
|
||||
val = val.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
}
|
||||
|
||||
table += '<tr class="node-info-property-row'+(propertiesExpanded?"":" hide")+'"><td>'+n+"</td><td>"+RED.bidi.applyBidiSupport(val,RED.bidi.flags.NS)+"</td></tr>";
|
||||
table += '<tr class="node-info-property-row'+(propertiesExpanded?"":" hide")+'"><td>'+n+"</td><td>"+val+"</td></tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,14 +140,14 @@ RED.sidebar.info = (function() {
|
||||
table += "</tbody></table><hr/>";
|
||||
if (!subflowNode && node.type != "comment") {
|
||||
var helpText = $("script[data-help-name$='"+node.type+"']").html()||"";
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(helpText)+'">'+RED.bidi.applyBidiSupport(helpText,RED.bidi.flags.NS)+'</span></div>';
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(helpText)+'">'+helpText+'</span></div>';
|
||||
}
|
||||
if (subflowNode) {
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(subflowNode.info||"")+'">'+marked(subflowNode.info||"")+'</span></div>';
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(subflowNode.info||"")+'">'+marked(subflowNode.info||"")+'</span></div>';
|
||||
} else if (node._def && node._def.info) {
|
||||
var info = node._def.info;
|
||||
var textInfo = (typeof info === "function" ? info.call(node) : info);
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.bidi.resolveBaseTextDir(textInfo)+'">'+marked(textInfo)+'</span></div>';
|
||||
table += '<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(textInfo)+'">'+marked(textInfo)+'</span></div>';
|
||||
//table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -1454,7 +1454,7 @@ RED.view = (function() {
|
||||
.on("mouseout",function(d,i) { var port = d3.select(this); port.classed("port_hovered",false);});
|
||||
|
||||
outGroup.append("svg:text").attr("class","port_label").attr("x",20).attr("y",8).style("font-size","10px").text("output");
|
||||
outGroup.append("svg:text").attr("class","port_label port_index").attr("x",20).attr("y",24).text(function(d,i){ return RED.bidi.applyBidiSupport(i+1,RED.bidi.flags.NS)});
|
||||
outGroup.append("svg:text").attr("class","port_label port_index").attr("x",20).attr("y",24).text(function(d,i){ return i+1});
|
||||
|
||||
var subflowInputs = vis.selectAll(".subflowinput").data(activeSubflow.in,function(d,i){ return d.id;});
|
||||
subflowInputs.exit().remove();
|
||||
@@ -1503,7 +1503,7 @@ RED.view = (function() {
|
||||
if (d.dirty) {
|
||||
var output = d3.select(this);
|
||||
output.selectAll(".subflowport").classed("node_selected",function(d) { return d.selected; })
|
||||
output.selectAll(".port_index").text(function(d){ return RED.bidi.applyBidiSupport(d.i+1, RED.bidi.flags.NS)});
|
||||
output.selectAll(".port_index").text(function(d){ return d.i+1});
|
||||
output.attr("transform", function(d) { return "translate(" + (d.x-d.w/2) + "," + (d.y-d.h/2) + ")"; });
|
||||
dirtyNodes[d.id] = d;
|
||||
d.dirty = false;
|
||||
@@ -1809,7 +1809,7 @@ RED.view = (function() {
|
||||
l = d._def.label;
|
||||
try {
|
||||
l = (typeof l === "function" ? l.call(d) : l)||"";
|
||||
l = RED.bidi.applyBidiSupport(l,RED.bidi.flags.BTD & RED.bidi.flags.NS);
|
||||
l = RED.text.bidi.enforceTextDirectionWithUCC(l);
|
||||
} catch(err) {
|
||||
console.log("Definition error: "+d.type+".label",err);
|
||||
l = d.type;
|
||||
|
||||
@@ -113,7 +113,7 @@ RED.workspaces = (function() {
|
||||
$('<input type="text" style="display: none;" />').prependTo(dialogForm);
|
||||
dialogForm.submit(function(e) { e.preventDefault();});
|
||||
$("#node-input-name").val(workspace.label);
|
||||
RED.bidi.prepareInput($("#node-input-name"))
|
||||
RED.text.bidi.prepareInput($("#node-input-name"))
|
||||
dialogForm.i18n();
|
||||
},
|
||||
close: function() {
|
||||
|
||||
@@ -25,41 +25,19 @@
|
||||
margin-left: -25px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-menu * .fa-check-square {
|
||||
float: right;
|
||||
margin-left: initial;
|
||||
margin-right: -8px;
|
||||
}
|
||||
|
||||
.dropdown-menu * a.active > .fa-check-square {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-menu * a.active > .fa-check-square {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-menu * .fa-square {
|
||||
display: inline-block;
|
||||
color: #e0e0e0;
|
||||
margin-left: -25px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-menu * .fa-square {
|
||||
float: right;
|
||||
margin-left: initial;
|
||||
margin-right: -8px;
|
||||
}
|
||||
|
||||
.dropdown-menu * a.active > .fa-square {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-menu * a.active > .fa-square {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dropdown-menu>li.disabled>a:hover>[class^="icon-"] {
|
||||
background-image: url("vendor/bootstrap/img/glyphicons-halflings.png") !important;
|
||||
@@ -70,12 +48,6 @@
|
||||
width: 200px !important;
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-menu{
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.dropdown-menu > li > a > i {
|
||||
width: 10px;
|
||||
text-align: center;
|
||||
@@ -104,18 +76,9 @@
|
||||
content: " ";
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-submenu>a:before {
|
||||
float : right;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.dropdown-submenu.disabled > a:before {
|
||||
border-right-color: #444;
|
||||
}
|
||||
.dropdown-submenu.pull-left>.dropdown-menu {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
[dir="rtl"] .dropdown-submenu.pull-left>.dropdown-menu {
|
||||
right: -250px;
|
||||
}
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
width: 0;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
[dir="rtl"] #editor-stack {
|
||||
right: 180px;
|
||||
}
|
||||
|
||||
.editor-tray {
|
||||
position:absolute;
|
||||
margin: 0;
|
||||
@@ -53,7 +48,6 @@
|
||||
.editor-tray-body {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.editor-tray-header {
|
||||
@include disable-selection;
|
||||
position: relative;
|
||||
@@ -124,16 +118,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .editor-tray-toolbar {
|
||||
text-align: left;
|
||||
|
||||
button {
|
||||
&.leftButton {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.editor-tray-titlebar {
|
||||
border-bottom: 1px solid $secondary-border-color;
|
||||
padding: 8px;
|
||||
@@ -282,9 +266,6 @@
|
||||
font-size: 12px !important;
|
||||
line-height: 35px;
|
||||
}
|
||||
[dir="rtl"] #node-config-dialog-scope-container {
|
||||
float: left;
|
||||
}
|
||||
#node-config-dialog-scope-warning {
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
@@ -306,28 +287,3 @@
|
||||
font-size: 12px;
|
||||
line-height: 35px;
|
||||
}
|
||||
[dir="rtl"] #node-config-dialog-user-count {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/*
|
||||
* some icons have to be rotated in case of rtl dir
|
||||
*/
|
||||
[dir="rtl"] .fa-tag,
|
||||
[dir="rtl"] .fa-tags,
|
||||
[dir="rtl"] .fa-repeat {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
/*
|
||||
* some icons have to be rotated in case of rtl dir
|
||||
*/
|
||||
[dir="rtl"] .fa-random,
|
||||
[dir="rtl"] .fa-tasks,
|
||||
[dir="rtl"] .fa-list,
|
||||
[dir="rtl"] .fa-sign-out,
|
||||
[dir="rtl"] .fa-sign-in {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
@@ -68,10 +68,6 @@
|
||||
@include disable-selection;
|
||||
}
|
||||
|
||||
[dir="rtl"] .node_label {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.port_label {
|
||||
stroke-width: 0;
|
||||
fill: #888;
|
||||
@@ -183,10 +179,6 @@
|
||||
text-anchor:start;
|
||||
}
|
||||
|
||||
[dir="rtl"] .node_status_label {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.port_hovered {
|
||||
stroke: $port-selected-color;
|
||||
fill: $port-selected-color;
|
||||
|
||||
@@ -65,12 +65,6 @@ span.logo {
|
||||
|
||||
}
|
||||
|
||||
[dir="rtl"] span.logo {
|
||||
float: right;
|
||||
direction: ltr;
|
||||
padding-right: 18px;
|
||||
}
|
||||
|
||||
.header-toolbar {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
@@ -86,10 +80,6 @@ span.logo {
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .header-toolbar {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.button {
|
||||
@include disable-selection;
|
||||
}
|
||||
@@ -121,6 +111,7 @@ span.logo {
|
||||
}
|
||||
#header .button-group > a {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
float: left;
|
||||
line-height: 22px;
|
||||
font-size: 14px;
|
||||
@@ -129,10 +120,6 @@ span.logo {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[dir="rtl"] #header .button-group > a {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.deploy-button {
|
||||
background: $deployButton;
|
||||
color: #eee !important;
|
||||
@@ -147,6 +134,20 @@ span.logo {
|
||||
}
|
||||
}
|
||||
|
||||
.deploy-button-spinner {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
opacity: 0.8;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#btn-deploy {
|
||||
|
||||
padding: 4px 12px;
|
||||
@@ -156,7 +157,7 @@ span.logo {
|
||||
background: $deployDisabledButton;
|
||||
color: #999 !important;
|
||||
|
||||
img {
|
||||
.deploy-button-content>img {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
@@ -172,7 +173,7 @@ span.logo {
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
.deploy-button-content>img {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
@@ -231,11 +232,6 @@ span.logo {
|
||||
display: inline-block;
|
||||
text-indent: 0px;
|
||||
}
|
||||
|
||||
[dir="rtl"] #header ul.dropdown-menu li a span.menu-label {
|
||||
text-indent: 20px;
|
||||
}
|
||||
|
||||
#header ul.dropdown-menu li a span.menu-sublabel {
|
||||
color: #aeaeae;
|
||||
font-size: 13px;
|
||||
@@ -243,10 +239,6 @@ span.logo {
|
||||
text-indent: 0px;
|
||||
}
|
||||
|
||||
[dir="rtl"] #header ul.dropdown-menu li a span.menu-sublabel {
|
||||
text-indent: 15px;
|
||||
}
|
||||
|
||||
#header ul.dropdown-menu > li:hover > a,
|
||||
#header ul.dropdown-menu > li:focus > a {
|
||||
background: $headerMenuItemHover !important;
|
||||
@@ -274,11 +266,6 @@ span.logo {
|
||||
display: inline-block;
|
||||
text-indent: 0px;
|
||||
}
|
||||
|
||||
[dir="rtl"] #header ul#btn-deploy-options-submenu li a span.menu-label {
|
||||
text-indent: 20px;
|
||||
}
|
||||
|
||||
#header ul#btn-deploy-options-submenu li a {
|
||||
padding: 10px 30px;
|
||||
color: #fff;
|
||||
|
||||
@@ -49,12 +49,6 @@
|
||||
.ui-dialog .ui-dialog-title {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
[dir="rtl"] .ui-dialog .ui-dialog-title {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-titlebar {
|
||||
padding: 10px;
|
||||
background: #f3f3f3;
|
||||
@@ -72,19 +66,10 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
[dir="rtl"] .ui-dialog-titlebar-close{
|
||||
left: 15px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.ui-dialog-buttonset {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
[dir="rtl"] .ui-dialog-buttonset {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
||||
float: none;
|
||||
}
|
||||
@@ -134,12 +119,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .ui-dialog-buttonset button {
|
||||
&.leftButton {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-buttonpane {
|
||||
padding: .3em 1em .5em 1em;
|
||||
}
|
||||
|
||||
@@ -38,15 +38,3 @@
|
||||
box-shadow: #999 1px 1px 1px;
|
||||
}
|
||||
|
||||
#keyboard-help-dialog-div1,
|
||||
#keyboard-help-dialog-div2 {
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width:50%;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
[dir="rtl"] #keyboard-help-dialog-div2 {
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
@@ -230,80 +230,3 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[dir="rtl"] #palette-editor {
|
||||
right: 0px;
|
||||
text-align: right;
|
||||
|
||||
.palette-editor-toolbar {
|
||||
text-align: left;
|
||||
|
||||
.button-group {
|
||||
margin-right: 0px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.palette-module-button-group {
|
||||
right: initial;
|
||||
left:0;
|
||||
|
||||
a {
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
float : left;
|
||||
}
|
||||
}
|
||||
|
||||
.palette-module-shade {
|
||||
left:0;
|
||||
right:0;
|
||||
}
|
||||
|
||||
.palette-module-meta {
|
||||
|
||||
.fa {
|
||||
margin-left: 5px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.palette-module-updated {
|
||||
margin-right: 10px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.palette-module-link {
|
||||
margin-right: 5px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.palette-module-description {
|
||||
margin-right: 20px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.palette-module-type {
|
||||
padding-right: 5px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.palette-module-type-swatch {
|
||||
margin-left: 5px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.palette-module-set-button-group {
|
||||
left: 4px;
|
||||
right: initial;
|
||||
}
|
||||
|
||||
i.fa.palette-module-node-chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.expanded {
|
||||
i.fa.palette-module-node-chevron {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,6 @@
|
||||
transition: width 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
[dir="rtl"] #palette {
|
||||
left: initial;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.palette-expanded {
|
||||
& #palette {
|
||||
width: 380px;
|
||||
@@ -47,18 +42,6 @@
|
||||
& #palette-editor { display: block !important }
|
||||
}
|
||||
|
||||
[dir="rtl"] .palette-expanded {
|
||||
|
||||
& #palette {
|
||||
width: 380px;
|
||||
box-shadow: 0 1px 6px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
& #workspace {
|
||||
left: 315px !important;
|
||||
right: 380px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.palette-scroll {
|
||||
position: absolute;
|
||||
@@ -91,9 +74,7 @@
|
||||
@include component-footer-button;
|
||||
}
|
||||
|
||||
[dir="rtl"] .palette-button {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.palette-category {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
@@ -114,11 +95,6 @@
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
|
||||
[dir="rtl"] .palette-header {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.palette-header i {
|
||||
margin: 3px 10px 3px 3px;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
@@ -128,12 +104,6 @@
|
||||
-moz-transform: rotate(-90deg);
|
||||
-o-transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
[dir="rtl"] .palette-header i {
|
||||
margin: 3px 3px 3px 10px;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.palette-header i.expanded {
|
||||
-webkit-transform: rotate(0deg);
|
||||
-moz-transform: rotate(0deg);
|
||||
@@ -153,10 +123,6 @@
|
||||
margin: 4px 28px 4px 0;
|
||||
}
|
||||
|
||||
[dir="rtl"] .palette_label_right {
|
||||
margin: 4px 0 4px 28px;
|
||||
}
|
||||
|
||||
.palette_node {
|
||||
cursor:move;
|
||||
background: #ddd;
|
||||
@@ -211,12 +177,6 @@
|
||||
border-right: none;
|
||||
border-left: 1px solid rgba(0,0,0,0.1);
|
||||
}
|
||||
[dir="rtl"] .palette_icon_container_right {
|
||||
left: 0;
|
||||
right: auto;
|
||||
border-left: none;
|
||||
border-right: 1px solid rgba(0,0,0,0.1);
|
||||
}
|
||||
.palette_icon {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
|
||||
@@ -28,12 +28,6 @@
|
||||
line-height: 1.4em;
|
||||
@include component-shadow;
|
||||
}
|
||||
[dir="rtl"] .red-ui-popover {
|
||||
transform: rotateY(180deg);
|
||||
p {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
}
|
||||
.red-ui-popover:after, .red-ui-popover:before {
|
||||
right: 100%;
|
||||
top: 50%;
|
||||
|
||||
@@ -26,11 +26,6 @@
|
||||
@include component-border;
|
||||
}
|
||||
|
||||
[dir="rtl"] #sidebar {
|
||||
right: auto;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#sidebar.closing {
|
||||
background: #eee;
|
||||
border-color: #900;
|
||||
@@ -57,26 +52,9 @@
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
[dir="rtl"] #sidebar-separator {
|
||||
left: 315px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.sidebar-closed > #sidebar { display: none; }
|
||||
.sidebar-closed > #sidebar-separator { right: 0px !important; }
|
||||
|
||||
[dir="rtl"] .sidebar-closed > #sidebar-separator {
|
||||
left: 0px !important;
|
||||
right: auto !important;
|
||||
}
|
||||
|
||||
.sidebar-closed > #workspace { right: 7px !important; }
|
||||
|
||||
[dir="rtl"] .sidebar-closed > #workspace {
|
||||
left: 7px !important;
|
||||
right: 179px !important;
|
||||
}
|
||||
|
||||
.sidebar-closed > #editor-stack { right: 8px !important; }
|
||||
|
||||
#sidebar .button {
|
||||
@@ -95,10 +73,6 @@
|
||||
border-bottom: 1px solid $secondary-border-color;
|
||||
}
|
||||
|
||||
[dir="rtl"] .sidebar-header {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#sidebar-footer {
|
||||
@include component-footer;
|
||||
}
|
||||
@@ -122,11 +96,6 @@
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
[dir="rtl"] .button-group .sidebar-header-button:not(:first-child) {
|
||||
border-left: solid 1px;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.sidebar-shade {
|
||||
position: absolute;
|
||||
top:0;
|
||||
|
||||
@@ -49,14 +49,6 @@
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
}
|
||||
[dir="rtl"] .config_node {
|
||||
.palette_label {
|
||||
margin-left: 0px;
|
||||
margin-right: 8px;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
}
|
||||
.config_node_type {
|
||||
color: #999;
|
||||
text-align: right;
|
||||
@@ -65,21 +57,11 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
[dir="rtl"] .config_node_type {
|
||||
text-align: left;
|
||||
padding-right: 0px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
.config_node_none {
|
||||
color: #ddd;
|
||||
text-align:right;
|
||||
padding-right: 3px;
|
||||
}
|
||||
[dir="rtl"] .config_node_none {
|
||||
text-align: left;
|
||||
padding-right: 0px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
.config_node_unused {
|
||||
border-color: #aaa;
|
||||
background: #f9f9f9;
|
||||
|
||||
@@ -51,13 +51,6 @@ div.node-info {
|
||||
.node-info-property-header {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
[dir="rtl"] .node-info-property-header {
|
||||
i{
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
|
||||
.node-info-property-header:hover,
|
||||
.node-info-property-header:focus {
|
||||
color: #666;
|
||||
|
||||
@@ -114,22 +114,6 @@
|
||||
padding-right: 59px;
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-tabs {
|
||||
& ul {
|
||||
li {
|
||||
a.red-ui-tab-label {
|
||||
padding-left: 0px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.red-ui-tabs-add.red-ui-tabs-scrollable {
|
||||
padding-left: 59px;
|
||||
padding-right: 21px;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-tab-button {
|
||||
position: absolute;
|
||||
box-sizing: border-box;
|
||||
@@ -153,11 +137,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-tab-button {
|
||||
right: initial;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.red-ui-tab-scroll {
|
||||
width: 21px;
|
||||
top: 0;
|
||||
@@ -181,15 +160,6 @@
|
||||
// box-shadow: 8px 0px 5px -2px rgba(0,0,0,0.1);
|
||||
}
|
||||
}
|
||||
ul.red-ui-tabs li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-tab-scroll-left {
|
||||
right: 0;
|
||||
left: initial;
|
||||
}
|
||||
|
||||
.red-ui-tab-scroll-right {
|
||||
right: 0px;
|
||||
a {
|
||||
@@ -202,11 +172,6 @@ ul.red-ui-tabs li {
|
||||
right: 38px;
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-tabs.red-ui-tabs-add .red-ui-tab-scroll-right {
|
||||
right: initial;
|
||||
left: 38px;
|
||||
}
|
||||
|
||||
.red-ui-tab-icon {
|
||||
margin-left: -8px;
|
||||
margin-right: 3px;
|
||||
@@ -217,11 +182,6 @@ ul.red-ui-tabs li {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-tab-icon{
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.red-ui-tabs-badges {
|
||||
position: absolute;
|
||||
top:2px;
|
||||
@@ -263,9 +223,3 @@ ul.red-ui-tabs li {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-tab-close {
|
||||
right: initial;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,16 +69,3 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-editableList-container {
|
||||
li {
|
||||
.red-ui-editableList-item-handle {
|
||||
left: auto;
|
||||
right: 2px;
|
||||
}
|
||||
.red-ui-editableList-item-remove {
|
||||
right: auto;
|
||||
left: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,18 +68,3 @@
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-searchBox-container {
|
||||
input {
|
||||
text-indent: 6px;
|
||||
}
|
||||
i.fa-search {
|
||||
left: initial;
|
||||
right: 8px
|
||||
}
|
||||
.red-ui-searchBox-resultCount {
|
||||
left: 18px;
|
||||
right: initial;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,27 +122,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[dir="rtl"] .red-ui-typedInput-container {
|
||||
a {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
|
||||
span {
|
||||
padding: 0 5px 0 1px;
|
||||
}
|
||||
}
|
||||
a.red-ui-typedInput-option-trigger {
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
padding: 0 0 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-typedInput-options {
|
||||
@include component-shadow;
|
||||
position: absolute;
|
||||
|
||||
@@ -27,11 +27,6 @@
|
||||
transition: right 0.2s ease;
|
||||
}
|
||||
|
||||
[dir="rtl"] #chart {
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#chart:focus {
|
||||
outline: none;
|
||||
}
|
||||
@@ -49,11 +44,6 @@
|
||||
|
||||
}
|
||||
|
||||
[dir="rtl"] #workspace {
|
||||
left: 322px;
|
||||
right: 179px;
|
||||
}
|
||||
|
||||
.workspace-footer-button {
|
||||
@include component-footer-button;
|
||||
}
|
||||
@@ -61,7 +51,3 @@
|
||||
#workspace-footer {
|
||||
@include component-footer;
|
||||
}
|
||||
|
||||
[dir="rtl"] #workspace-footer {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -74,35 +74,3 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[dir="rtl"] #workspace-toolbar {
|
||||
.button {
|
||||
margin-right: 0px;
|
||||
}
|
||||
.button-group {
|
||||
&:not(.spinner-group) {
|
||||
.button:not(:first-child) {
|
||||
border-right: none;
|
||||
border-left: solid 0.25px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.workspace-subflow-label {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
[dir="rtl"] .workspace-subflow-label {
|
||||
margin-right: 15px;
|
||||
margin-top: 3px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
[dir="rtl"] .subflow-toolbar {
|
||||
float: right;
|
||||
}
|
||||
|
||||
[dir="rtl"] #workspace-subflow-delete {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
|
||||
@@ -87,13 +87,13 @@
|
||||
|
||||
<div id="node-dialog-confirm-deploy" class="hide">
|
||||
<form class="form-horizontal">
|
||||
<div id="node-dialog-confirm-deploy-config" data-i18n="[prepend]deploy.confirm.improperlyConfigured;[append]deploy.confirm.confirm">
|
||||
<ul id="node-dialog-confirm-deploy-invalid-list"></ul>
|
||||
<div id="node-dialog-confirm-deploy-config" style="text-align: left; padding-top: 30px;" data-i18n="[prepend]deploy.confirm.improperlyConfigured;[append]deploy.confirm.confirm">
|
||||
<ul style="font-size: 0.9em; width: 400px; margin: 10px auto; text-align: left;" id="node-dialog-confirm-deploy-invalid-list"></ul>
|
||||
</div>
|
||||
<div id="node-dialog-confirm-deploy-unknown" style="text-align: left; padding-top: 10px;" data-i18n="[prepend]deploy.confirm.unknown;[append]deploy.confirm.confirm">
|
||||
<ul class="node-dialog-confirm-deploy" id="node-dialog-confirm-deploy-unknown-list"></ul>
|
||||
<ul style="font-size: 0.9em; width: 400px; margin: 10px auto; text-align: left;" id="node-dialog-confirm-deploy-unknown-list"></ul>
|
||||
</div>
|
||||
<div id="node-dialog-confirm-deploy-conflict" data-i18n="[prepend]deploy.confirm.conflict;[append]deploy.confirm.confirm">
|
||||
<div id="node-dialog-confirm-deploy-conflict" style="text-align: left; padding-top: 10px;" data-i18n="[prepend]deploy.confirm.conflict;[append]deploy.confirm.confirm">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -164,30 +164,5 @@
|
||||
<script src="vendor/ace/ext-language_tools.js"></script>
|
||||
<script src="{{ asset.red }}"></script>
|
||||
|
||||
<style>
|
||||
#node-dialog-confirm-deploy-invalid-list {
|
||||
font-size: 0.9em;
|
||||
width: 400px;
|
||||
margin: 10px auto;
|
||||
text-align: left;
|
||||
}
|
||||
[dir="rtl"] #node-dialog-confirm-deploy-invalid-list {
|
||||
text-align: right;
|
||||
}
|
||||
#node-dialog-confirm-deploy-conflict {
|
||||
text-align: left;
|
||||
padding-top: 10px;
|
||||
}
|
||||
[dir="rtl"] #node-dialog-confirm-deploy-conflict {
|
||||
text-align: right;
|
||||
}
|
||||
#node-dialog-confirm-deploy-config {
|
||||
text-align: left;
|
||||
padding-top: 30px;
|
||||
}
|
||||
[dir="rtl"] #node-dialog-confirm-deploy-config {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div style="box-sizing: border-box; line-height: 20px; font-size: 0.8em; border-bottom: 1px solid #ddd; height: 20px;">
|
||||
<input type="checkbox" data-i18n="[title]catch.label.selectAll" id="node-input-target-node-checkbox-all" style="width: 30px; margin: 0 2px 1px 2px;">
|
||||
<div style="display: inline-block;"><a id="node-input-target-sort-label" href="#" data-i18n="[title]catch.label.sortByLabel"><span data-i18n="catch.label.node"></span> <i class="node-input-catch-sort-label-a fa fa-caret-down"></i><i class="node-input-catch-sort-label-d fa fa-caret-up"></i></a></div>
|
||||
<div id="node-input-catch-target-sort-type"><a id="node-input-target-sort-type" href="#" data-i18n="[title]catch.label.sortByType"><i class="node-input-catch-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-catch-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="catch.label.type"></span></a></div>
|
||||
<div style="position: absolute; right: 10px; width: 50px; display: inline-block; text-align: right;"><a id="node-input-target-sort-type" href="#" data-i18n="[title]catch.label.sortByType"><i class="node-input-catch-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-catch-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="catch.label.type"></span></a></div>
|
||||
</div>
|
||||
<div style="background: #fbfbfb; box-sizing: border-box; position:absolute; top:20px;bottom:0;left:0px;right:0px; overflow-y: scroll; overflow-x: hidden;">
|
||||
<ul id="node-input-catch-target-container" style=" list-style-type:none; margin: 0;"></ul>
|
||||
@@ -85,17 +85,6 @@
|
||||
#node-input-catch-target-container li:hover .node-input-target-node-sublabel {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
#node-input-catch-target-sort-type {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
width: 50px;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
}
|
||||
[dir="rtl"] #node-input-catch-target-sort-type {
|
||||
right: auto;
|
||||
left: 0px;
|
||||
}
|
||||
.node-input-target-node-sublabel {
|
||||
position:absolute;
|
||||
right: 0px;
|
||||
@@ -104,10 +93,6 @@
|
||||
font-size: 0.8em;
|
||||
background: #fbfbfb;
|
||||
}
|
||||
[dir="rtl"] .node-input-target-node-sublabel {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('catch',{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div style="box-sizing: border-box; line-height: 20px; font-size: 0.8em; border-bottom: 1px solid #ddd; height: 20px;">
|
||||
<input type="checkbox" data-i18n="[title]status.label.selectAll" id="node-input-target-node-checkbox-all" style="width: 30px; margin: 0 2px 1px 2px;">
|
||||
<div style="display: inline-block;"><a id="node-input-target-sort-label" href="#" data-i18n="[title]status.label.sortByLabel"><span data-i18n="status.label.node"></span> <i class="node-input-status-sort-label-a fa fa-caret-down"></i><i class="node-input-status-sort-label-d fa fa-caret-up"></i></a></div>
|
||||
<div id="node-input-status-target-sort-type"><a id="node-input-target-sort-type" href="#" data-i18n="[title]status.label.sortByType"><i class="node-input-status-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-status-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="status.label.type"></span></a></div>
|
||||
<div style="position: absolute; right: 10px; width: 50px; display: inline-block; text-align: right;"><a id="node-input-target-sort-type" href="#" data-i18n="[title]status.label.sortByType"><i class="node-input-status-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-status-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="status.label.type"></span></a></div>
|
||||
</div>
|
||||
<div style="background: #fbfbfb; box-sizing: border-box; position:absolute; top:20px;bottom:0;left:0px;right:0px; overflow-y: scroll; overflow-x: hidden;">
|
||||
<ul id="node-input-status-target-container" style=" list-style-type:none; margin: 0;"></ul>
|
||||
@@ -76,17 +76,6 @@
|
||||
#node-input-status-target-container li:hover .node-input-target-node-sublabel {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
#node-input-status-target-sort-type {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
width: 50px;
|
||||
display: inline-block;
|
||||
text-align: right;"
|
||||
}
|
||||
[dir="rtl"] #node-input-status-target-sort-type {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
.node-input-target-node-sublabel {
|
||||
position:absolute;
|
||||
right: 0px;
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
function getTimestamp() {
|
||||
var d = new Date();
|
||||
return RED.bidi.applyBidiSupport(d,RED.bidi.flags.CALENDAR);
|
||||
return d.toLocaleString();
|
||||
}
|
||||
|
||||
var sbc = document.getElementById("debug-content");
|
||||
@@ -198,11 +198,10 @@
|
||||
} else {
|
||||
msg.innerHTML += '<span class="debug-message-topic">'+
|
||||
(o.topic?topic+' : ':'')+
|
||||
(o.property?'msg.'+property:'msg')+" : "+RED.bidi.applyBidiSupport(format,RED.bidi.flags.NS)+
|
||||
(o.property?'msg.'+property:'msg')+" : "+format+
|
||||
|
||||
'</span>';
|
||||
}
|
||||
payload = RED.bidi.applyBidiSupport(payload,RED.bidi.flags.NS);
|
||||
msg.innerHTML += '<span class="debug-message-payload">'+ payload+ '</span>';
|
||||
var atBottom = (sbc.scrollHeight-messages.height()-sbc.scrollTop) < 5;
|
||||
messageCount++;
|
||||
|
||||
@@ -70,25 +70,6 @@
|
||||
#node-input-link-container li:hover .node-input-target-node-sublabel {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
#node-input-link-sort-type-div {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
width: 50px;
|
||||
display: inline-block;
|
||||
text-align: right;"
|
||||
}
|
||||
[dir="rtl"] #node-input-link-sort-type-div {
|
||||
right: auto;
|
||||
left: 0;
|
||||
}
|
||||
#node-input-link-sort-label-div {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
}
|
||||
[dir="rtl"] #node-input-link-sort-label-div {
|
||||
margin-left: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.node-input-link-node-sublabel {
|
||||
position:absolute;
|
||||
right: 0px;
|
||||
@@ -150,8 +131,8 @@
|
||||
|
||||
$('<div id="node-input-link-container-div" style="min-height: 100px;position: relative; box-sizing: border-box; border-radius: 2px; height: 180px; border: 1px solid #ccc;overflow:hidden; ">'+
|
||||
' <div style="box-sizing: border-box; line-height: 20px; font-size: 0.8em; border-bottom: 1px solid #ddd; height: 20px;">'+
|
||||
' <div id="node-input-link-sort-label-div"><a id="node-input-link-sort-label" href="#" data-i18n="[title]link.label.sortByLabel"><span data-i18n="link.label.node">name</span> <i class="node-input-link-sort-label-a fa fa-caret-down"></i><i class="node-input-link-sort-label-d fa fa-caret-up"></i></a></div>'+
|
||||
' <div id="node-input-link-sort-type-div"><a id="node-input-link-sort-type" href="#" data-i18n="[title]link.label.sortByFlow"><i class="node-input-link-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-link-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="link.label.type">flow</span></a></div>'+
|
||||
' <div style="display: inline-block;margin-left: 5px;"><a id="node-input-link-sort-label" href="#" data-i18n="[title]link.label.sortByLabel"><span data-i18n="link.label.node">name</span> <i class="node-input-link-sort-label-a fa fa-caret-down"></i><i class="node-input-link-sort-label-d fa fa-caret-up"></i></a></div>'+
|
||||
' <div style="position: absolute; right: 10px; width: 50px; display: inline-block; text-align: right;"><a id="node-input-link-sort-type" href="#" data-i18n="[title]link.label.sortByFlow"><i class="node-input-link-sort-sublabel-a fa fa-caret-down"></i><i class="node-input-link-sort-sublabel-d fa fa-caret-up"></i> <span data-i18n="link.label.type">flow</span></a></div>'+
|
||||
' </div>'+
|
||||
' <div style="background: #fbfbfb; box-sizing: border-box; position:absolute; top:20px;bottom:0;left:0px;right:0px; overflow-y: scroll; overflow-x: hidden;">'+
|
||||
' <ul id="node-input-link-container" style=" list-style-type:none; margin: 0;"></ul>'+
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="form-row" style="position: relative; margin-bottom: 0px;">
|
||||
<label for="node-input-template"><i class="fa fa-file-code-o"></i> <span data-i18n="template.label.template"></span></label>
|
||||
<input type="hidden" id="node-input-template" autofocus="autofocus">
|
||||
<div class="template-div-format">
|
||||
<div style="position: absolute; right:0;display:inline-block; text-align: right; font-size: 0.8em;">
|
||||
<span data-i18n="template.label.format"></span>:
|
||||
<select id="node-input-format" style="width:110px; font-size: 10px !important; height: 24px; padding:0;">
|
||||
<option value="handlebars">mustache</option>
|
||||
@@ -141,18 +141,3 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.template-div-format {
|
||||
position: absolute;
|
||||
right:0;
|
||||
display:inline-block;
|
||||
text-align: right;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
[dir="rtl"] .template-div-format {
|
||||
right: auto;
|
||||
left: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<option value="day" data-i18n="delay.label.units.day.singular"></option>
|
||||
</select>
|
||||
<br/>
|
||||
<div id="node-input-dr"><input type="checkbox" id="node-input-drop"><label style="width: 250px;" for="node-input-drop"><span data-i18n="delay.dropmsg"></span></label></div>
|
||||
<div id="node-input-dr"><input style="margin: 20px 0 20px 100px; width: 30px;" type="checkbox" id="node-input-drop"><label style="width: 250px;" for="node-input-drop"><span data-i18n="delay.dropmsg"></span></label></div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -241,12 +241,3 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
#node-input-drop {
|
||||
margin: 20px 0 20px 100px;
|
||||
width: 30px;"
|
||||
}
|
||||
[dir="rtl"] #node-input-drop {
|
||||
margin: 20px 100px 20px 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label data-i18n="trigger.label.reset" style="width:auto"></label>
|
||||
<div class="trigger-reset-options-div" >
|
||||
<div style="display:inline-block; width:70%;vertical-align:top">
|
||||
<ul>
|
||||
<li data-i18n="trigger.label.resetMessage"></li>
|
||||
<li><span data-i18n="trigger.label.resetPayload"></span> <input type="text" id="node-input-reset" style="width:150px" data-i18n="[placeholder]trigger.label.resetprompt"></li>
|
||||
@@ -171,13 +171,3 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.trigger-reset-options-div {
|
||||
display:inline-block;
|
||||
width:70%;
|
||||
vertical-align:top;
|
||||
}
|
||||
[dir="rtl"] .trigger-reset-options-div {
|
||||
padding-right: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -77,14 +77,14 @@ module.exports = function(RED) {
|
||||
node.status({fill:"green",shape:"dot",text:"common.status.ok"});
|
||||
|
||||
node.child.stdout.on('data', function (data) {
|
||||
data = data.toString().trim();
|
||||
if (data.length > 0) {
|
||||
if (node.running && node.buttonState !== -1) {
|
||||
node.send({ topic:"pi/"+node.pin, payload:Number(data) });
|
||||
var d = data.toString().trim().split("\n");
|
||||
for (var i = 0; i < d.length; i++) {
|
||||
if (node.running && node.buttonState !== -1 && !isNaN(Number(d[i]))) {
|
||||
node.send({ topic:"pi/"+node.pin, payload:Number(d[i]) });
|
||||
}
|
||||
node.buttonState = data;
|
||||
node.status({fill:"green",shape:"dot",text:data});
|
||||
if (RED.settings.verbose) { node.log("out: "+data+" :"); }
|
||||
node.buttonState = d[i];
|
||||
node.status({fill:"green",shape:"dot",text:d[i]});
|
||||
if (RED.settings.verbose) { node.log("out: "+d[i]+" :"); }
|
||||
}
|
||||
});
|
||||
|
||||
@@ -229,8 +229,8 @@ module.exports = function(RED) {
|
||||
|
||||
node.child.stdout.on('data', function (data) {
|
||||
data = Number(data);
|
||||
if (data === 0) { node.send({ topic:"pi/mouse", button:data, payload:0 }); }
|
||||
else { node.send({ topic:"pi/mouse", button:data, payload:1 }); }
|
||||
if (data === 1) { node.send({ topic:"pi/mouse", button:data, payload:1 }); }
|
||||
else { node.send({ topic:"pi/mouse", button:data, payload:0 }); }
|
||||
});
|
||||
|
||||
node.child.stderr.on('data', function (data) {
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
<div class="form-row node-input-broker">
|
||||
<label for="node-config-input-broker"><i class="fa fa-globe"></i> <span data-i18n="mqtt.label.broker"></span></label>
|
||||
<input class="input-append-left" type="text" id="node-config-input-broker" placeholder="e.g. localhost" style="width: 40%;" >
|
||||
<label for="node-config-input-port" id="node-config-label-port"> <span data-i18n="mqtt.label.port"></span></label>
|
||||
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> <span data-i18n="mqtt.label.port"></span></label>
|
||||
<input type="text" id="node-config-input-port" data-i18n="[placeholder]mqtt.label.port" style="width:45px">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@@ -165,7 +165,7 @@
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-keepalive" style="width: auto"><i class="fa fa-clock-o"></i> <span data-i18n="mqtt.label.keepalive"></span></label>
|
||||
<input type="text" id="node-config-input-keepalive" style="width: 50px">
|
||||
<input type="checkbox" id="node-config-input-cleansession">
|
||||
<input type="checkbox" id="node-config-input-cleansession" style="margin-left: 30px; height: 1em;display: inline-block; width: auto; vertical-align: middle;">
|
||||
<label for="node-config-input-cleansession" style="width: auto;" data-i18n="mqtt.label.cleansession"></label>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@@ -357,25 +357,3 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#node-config-label-port {
|
||||
margin-left: 10px;
|
||||
width: 35px;
|
||||
}
|
||||
[dir="rtl"] #node-config-label-port{
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
#node-config-input-cleansession {
|
||||
margin-left: 30px;
|
||||
height: 1em;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
vertical-align: middle;
|
||||
}
|
||||
[dir="rtl"] #node-config-input-cleansession {
|
||||
margin-left: 0px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="httpin.label.url"></span></label>
|
||||
<div id="node-input-url" contenteditable="true" placeholder="/url"></div>
|
||||
<input id="node-input-url" type="text" placeholder="/url">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
@@ -117,7 +117,7 @@ msg.cookies = {
|
||||
color:"rgb(231, 231, 174)",
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
url: {value:"",required:true,format:"url"},
|
||||
url: {value:"",required:true},
|
||||
method: {value:"get",required:true},
|
||||
swaggerDoc: {type:"swagger-doc", required:false}
|
||||
},
|
||||
@@ -137,7 +137,7 @@ msg.cookies = {
|
||||
} else {
|
||||
root += this.url;
|
||||
}
|
||||
return RED.text.format.getString("["+this.method+"] "+root, "url", {}, false, "en");
|
||||
return "["+this.method+"] "+root;
|
||||
} else {
|
||||
return "http";
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ module.exports = function(RED) {
|
||||
isText = false;
|
||||
} else if (parsedType.subtype !== "octet-stream") {
|
||||
checkUTF = true;
|
||||
} else {
|
||||
// applicatino/octet-stream
|
||||
isText = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="httpin.label.url"></span></label>
|
||||
<div id="node-input-url" contenteditable="true" placeholder="http://"></div>
|
||||
<input id="node-input-url" type="text" placeholder="http://">
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
@@ -102,7 +102,7 @@
|
||||
name: {value:""},
|
||||
method:{value:"GET"},
|
||||
ret: {value:"txt"},
|
||||
url:{value:"",format:"url"},
|
||||
url:{value:""},
|
||||
tls: {type:"tls-config",required: false}
|
||||
},
|
||||
credentials: {
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
RED.nodes.registerType('websocket-listener',{
|
||||
category: 'config',
|
||||
defaults: {
|
||||
path: {value:"",required:true,validate:RED.validators.regex(/^((?!\/debug\/ws).)*$/),format:"filepath" },
|
||||
path: {value:"",required:true,validate:RED.validators.regex(/^((?!\/debug\/ws).)*$/)},
|
||||
wholemsg: {value:"false"}
|
||||
},
|
||||
inputs:0,
|
||||
@@ -160,7 +160,7 @@
|
||||
} else {
|
||||
root += this.path;
|
||||
}
|
||||
return RED.text.format.getString(root, "filepath", {}, false, "en");
|
||||
return root;
|
||||
},
|
||||
oneditprepare: function() {
|
||||
var root = RED.settings.httpNodeRoot;
|
||||
@@ -179,13 +179,13 @@
|
||||
RED.nodes.registerType('websocket-client',{
|
||||
category: 'config',
|
||||
defaults: {
|
||||
path: {value:"",required:true,validate:RED.validators.regex(/^((?!\/debug\/ws).)*$/),format:"filepath" },
|
||||
path: {value:"",required:true,validate:RED.validators.regex(/^((?!\/debug\/ws).)*$/)},
|
||||
wholemsg: {value:"false"}
|
||||
},
|
||||
inputs:0,
|
||||
outputs:0,
|
||||
label: function() {
|
||||
return RED.text.format.getString(this.path, "filepath", {}, false, "en");
|
||||
return this.path;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
<script type="text/x-red" data-template-name="websocket-listener">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-path"><i class="fa fa-bookmark"></i> <span data-i18n="websocket.label.path"></span></label>
|
||||
<div id="node-config-input-path" contenteditable="true" placeholder="/ws/example"></div>
|
||||
<input id="node-config-input-path" type="text" placeholder="/ws/example">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-wholemsg"> </label>
|
||||
@@ -255,7 +255,7 @@
|
||||
<script type="text/x-red" data-template-name="websocket-client">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-path"><i class="fa fa-bookmark"></i> <span data-i18n="websocket.label.url"></span></label>
|
||||
<div id="node-config-input-path" contenteditable="true" placeholder="ws://example.com/ws"></div>
|
||||
<input id="node-config-input-path" type="text" placeholder="ws://example.com/ws">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-wholemsg"> </label>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<script type="text/x-red" data-template-name="watch">
|
||||
<div class="form-row node-input-filename">
|
||||
<label for="node-input-files"><i class="fa fa-file"></i> <span data-i18n="watch.label.files"></span></label>
|
||||
<div id="node-input-files" contenteditable="true" tabindex="1" data-i18n="[placeholder]watch.placeholder.files"></div>
|
||||
<input id="node-input-files" type="text" tabindex="1" data-i18n="[placeholder]watch.placeholder.files">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
||||
@@ -46,14 +46,14 @@
|
||||
category: 'advanced-input',
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
files: {value:"",required:true, format:"filepath"}
|
||||
files: {value:"",required:true}
|
||||
},
|
||||
color:"BurlyWood",
|
||||
inputs:0,
|
||||
outputs:1,
|
||||
icon: "watch.png",
|
||||
label: function() {
|
||||
return this.name||RED.text.format.getString(this.files, "filepath", {}, false, "en");
|
||||
return this.name||this.files;
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
||||
@@ -43,9 +43,7 @@ module.exports = function(RED) {
|
||||
server = udpInputPortsInUse[this.port]; // re-use existing
|
||||
}
|
||||
|
||||
var opts = {type:node.ipv, reuseAddr:true};
|
||||
if (process.version.indexOf("v0.10") === 0) { opts = node.ipv; }
|
||||
var server = dgram.createSocket(opts); // default to udp4
|
||||
|
||||
server.on("error", function (err) {
|
||||
if ((err.code == "EACCES") && (node.port < 1024)) {
|
||||
|
||||
@@ -130,8 +130,7 @@
|
||||
var btwnValueField = $('<input/>',{class:"node-input-rule-btwn-value",type:"text",style:"margin-left: 5px;"}).appendTo(row).typedInput({default:'num',types:['msg','flow','global','str','num',previousValueType]});
|
||||
var btwnAndLabel = $('<span/>',{class:"node-input-rule-btwn-label"}).text(" "+andLabel+" ").appendTo(row3);
|
||||
var btwnValue2Field = $('<input/>',{class:"node-input-rule-btwn-value2",type:"text",style:"margin-left:2px;"}).appendTo(row3).typedInput({default:'num',types:['msg','flow','global','str','num',previousValueType]});
|
||||
// reverse float property in case of right directionality
|
||||
var finalspan = $('<span/>',{style:"float: "+RED.bidi.componentPos.right+";margin-top: 6px;"}).appendTo(row);
|
||||
var finalspan = $('<span/>',{style:"float: right;margin-top: 6px;"}).appendTo(row);
|
||||
finalspan.append(' → <span class="node-input-rule-index">'+(i+1)+'</span> ');
|
||||
var caseSensitive = $('<input/>',{id:"node-input-rule-case-"+i,class:"node-input-rule-case",type:"checkbox",style:"width:auto;vertical-align:top"}).appendTo(row2);
|
||||
$('<label/>',{for:"node-input-rule-case-"+i,style:"margin-left: 3px;"}).text(caseLabel).appendTo(row2);
|
||||
|
||||
@@ -18,7 +18,6 @@ module.exports = function(RED) {
|
||||
"use strict";
|
||||
var xml2js = require('xml2js');
|
||||
var parseString = xml2js.parseString;
|
||||
var builder = new xml2js.Builder({renderOpts:{pretty:false}});
|
||||
|
||||
function XMLNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
@@ -27,15 +26,17 @@ module.exports = function(RED) {
|
||||
var node = this;
|
||||
this.on("input", function(msg) {
|
||||
if (msg.hasOwnProperty("payload")) {
|
||||
var options;
|
||||
if (typeof msg.payload === "object") {
|
||||
var options = {};
|
||||
options = {renderOpts:{pretty:false}};
|
||||
if (msg.hasOwnProperty("options") && typeof msg.options === "object") { options = msg.options; }
|
||||
options.async = false;
|
||||
var builder = new xml2js.Builder(options);
|
||||
msg.payload = builder.buildObject(msg.payload, options);
|
||||
node.send(msg);
|
||||
}
|
||||
else if (typeof msg.payload == "string") {
|
||||
var options = {};
|
||||
options = {};
|
||||
if (msg.hasOwnProperty("options") && typeof msg.options === "object") { options = msg.options; }
|
||||
options.async = true;
|
||||
options.attrkey = node.attrkey || options.attrkey || '$';
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<script type="text/x-red" data-template-name="tail">
|
||||
<div class="form-row">
|
||||
<label for="node-input-filename"><i class="fa fa-file"></i> <span data-i18n="tail.label.filename"></span></label>
|
||||
<div id="node-input-filename" contenteditable="true"></div>
|
||||
<input id="node-input-filename" type="text">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-filetype"><i class="fa fa-file-text-o"></i> <span data-i18n="tail.label.type"></span></label>
|
||||
@@ -50,14 +50,14 @@
|
||||
name: {value:""},
|
||||
filetype: {value:"text"},
|
||||
split: {value:false},
|
||||
filename: {value:"",required:true,format:"filepath"}
|
||||
filename: {value:"",required:true}
|
||||
},
|
||||
color:"BurlyWood",
|
||||
inputs:0,
|
||||
outputs:1,
|
||||
icon: "file.png",
|
||||
label: function() {
|
||||
return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en");
|
||||
return this.name||this.filename;
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<script type="text/x-red" data-template-name="file">
|
||||
<div class="form-row node-input-filename">
|
||||
<label for="node-input-filename"><i class="fa fa-file"></i> <span data-i18n="file.label.filename"></span></label>
|
||||
<div id="node-input-filename" contenteditable="true"></div>
|
||||
<input id="node-input-filename" type="text">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-overwriteFile"><i class="fa fa-random"></i> <span data-i18n="file.label.action"></span></label>
|
||||
@@ -56,7 +56,7 @@
|
||||
<script type="text/x-red" data-template-name="file in">
|
||||
<div class="form-row">
|
||||
<label for="node-input-filename"><i class="fa fa-file"></i> <span data-i18n="file.label.filename"></span></label>
|
||||
<div id="node-input-filename" contenteditable="true" data-i18n="[placeholder]file.label.filename"></div>
|
||||
<input id="node-input-filename" type="text" data-i18n="[placeholder]file.label.filename">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-format"><i class="fa fa-sign-out"></i> <span data-i18n="file.label.outputas"></span></label>
|
||||
@@ -83,7 +83,7 @@
|
||||
category: 'storage-output',
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
filename: {value:"",format:"filepath"},
|
||||
filename: {value:""},
|
||||
appendNewline: {value:true},
|
||||
createDir: {value:false},
|
||||
overwriteFile: {value:"false"}
|
||||
@@ -95,9 +95,9 @@
|
||||
align: "right",
|
||||
label: function() {
|
||||
if (this.overwriteFile === "delete") {
|
||||
return this.name||this._("file.label.deletelabel",{file:RED.text.format.getString(this.filename, "filepath", {}, false, "en")})
|
||||
return this.name||this._("file.label.deletelabel",{file:this.filename})
|
||||
} else {
|
||||
return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en")||this._("file.label.filelabel");
|
||||
return this.name||this.filename||this._("file.label.filelabel");
|
||||
}
|
||||
},
|
||||
labelStyle: function() {
|
||||
@@ -115,7 +115,7 @@
|
||||
category: 'storage-input',
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
filename: {value:"",format:"filepath"},
|
||||
filename: {value:""},
|
||||
format: {value:"utf8"},
|
||||
},
|
||||
color:"BurlyWood",
|
||||
@@ -123,7 +123,7 @@
|
||||
outputs:1,
|
||||
icon: "file.png",
|
||||
label: function() {
|
||||
return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en")||this._("file.label.filelabel");
|
||||
return this.name||this.filename||this._("file.label.filelabel");
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red",
|
||||
"version" : "0.15.1",
|
||||
"version" : "0.15.2",
|
||||
"description" : "A visual tool for wiring the Internet of Things",
|
||||
"homepage" : "http://nodered.org",
|
||||
"license" : "Apache-2.0",
|
||||
@@ -62,7 +62,7 @@
|
||||
"node-red-node-rbe":"0.1.*"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"node-red-node-serialport":"0.3.*",
|
||||
"node-red-node-serialport":"0.4.*",
|
||||
"bcrypt":"0.8.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -25,7 +25,7 @@ module.exports = {
|
||||
},
|
||||
settings: function(req,res) {
|
||||
var safeSettings = {
|
||||
httpNodeRoot: settings.httpNodeRoot,
|
||||
httpNodeRoot: settings.httpNodeRoot||"/",
|
||||
version: settings.version,
|
||||
user: req.user
|
||||
}
|
||||
|
||||
@@ -30,15 +30,7 @@
|
||||
"defaultDir": "Default",
|
||||
"ltr": "Left-to-right",
|
||||
"rtl": "Right-to-left",
|
||||
"auto": "Contextual",
|
||||
"numericShaping": "Numeric Shaping",
|
||||
"defaultNumeral":"None",
|
||||
"national":"National",
|
||||
"contextual":"Contextual",
|
||||
"calendar": "National Calendar",
|
||||
"defaultCalendar": "Gregorian",
|
||||
"hijri": "Hijri",
|
||||
"hebrew": "Hebrew"
|
||||
"auto": "Contextual"
|
||||
},
|
||||
"sidebar": {
|
||||
"show": "Show sidebar"
|
||||
@@ -186,7 +178,8 @@
|
||||
"cutNode": "Cut selected nodes",
|
||||
"pasteNode": "Paste nodes",
|
||||
"undoChange": "Undo the last change performed",
|
||||
"searchBox": "Open search box"
|
||||
"searchBox": "Open search box",
|
||||
"managePalette": "Manage palette"
|
||||
},
|
||||
"library": {
|
||||
"openLibrary": "Open Library...",
|
||||
@@ -263,6 +256,7 @@
|
||||
"enable": "enable",
|
||||
"disable": "disable",
|
||||
"remove": "remove",
|
||||
"update": "update to __version__",
|
||||
"install": "install",
|
||||
"installed": "installed",
|
||||
"loading": "Loading catalogues...",
|
||||
|
||||
@@ -114,6 +114,12 @@ var log = module.exports = {
|
||||
addHandler: function(func) {
|
||||
logHandlers.push(func);
|
||||
},
|
||||
removeHandler: function(func) {
|
||||
var index = logHandlers.indexOf(func);
|
||||
if (index > -1) {
|
||||
logHandlers.splice(index,1);
|
||||
}
|
||||
},
|
||||
log: function(msg) {
|
||||
msg.timestamp = Date.now();
|
||||
logHandlers.forEach(function(handler) {
|
||||
|
||||
@@ -192,6 +192,8 @@ function handleError(node,logMessage,msg) {
|
||||
function delegateStatus(node,statusMessage) {
|
||||
if (activeFlows[node.z]) {
|
||||
activeFlows[node.z].handleStatus(node,statusMessage);
|
||||
} else if (activeNodesToFlow[node.z]) {
|
||||
activeFlows[activeNodesToFlow[node.z]].handleStatus(node,statusMessage);
|
||||
}
|
||||
}
|
||||
function handleStatus(node,statusMessage) {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
var should = require("should");
|
||||
var sinon = require("sinon");
|
||||
var util = require("util");
|
||||
|
||||
var log = require("../../../red/runtime/log");
|
||||
|
||||
describe("runtime/log", function() {
|
||||
@@ -156,4 +155,70 @@ describe("runtime/log", function() {
|
||||
sinon.assert.neverCalledWithMatch(util.log,"[trace] This is a trace");
|
||||
sinon.assert.neverCalledWithMatch(util.log,"[metric] ");
|
||||
});
|
||||
|
||||
it('add a custom log handler directly', function() {
|
||||
var settings = {};
|
||||
log.init(settings);
|
||||
|
||||
var logEvents = [];
|
||||
var loggerOne = {
|
||||
emit: function(event,msg) {
|
||||
logEvents.push({logger:1,msg:msg});
|
||||
}
|
||||
};
|
||||
var loggerTwo = {
|
||||
emit: function(event,msg) {
|
||||
logEvents.push({logger:2,msg:msg});
|
||||
}
|
||||
};
|
||||
log.addHandler(loggerOne);
|
||||
log.addHandler(loggerTwo);
|
||||
|
||||
log.error("This is an error");
|
||||
log.warn("This is a warn");
|
||||
log.info("This is an info");
|
||||
log.debug("This is a debug");
|
||||
log.trace("This is a trace");
|
||||
log.log({level:log.METRIC,msg:"testMetric"});
|
||||
|
||||
logEvents.filter(function(evt) { return evt.logger === 1}).should.have.lengthOf(6);
|
||||
logEvents.filter(function(evt) { return evt.logger === 2}).should.have.lengthOf(6);
|
||||
});
|
||||
|
||||
it('remove a custom log handler directly', function() {
|
||||
var settings = {};
|
||||
log.init(settings);
|
||||
|
||||
var logEvents = [];
|
||||
var loggerOne = {
|
||||
emit: function(event,msg) {
|
||||
logEvents.push({logger:1,msg:msg});
|
||||
}
|
||||
};
|
||||
var loggerTwo = {
|
||||
emit: function(event,msg) {
|
||||
logEvents.push({logger:2,msg:msg});
|
||||
}
|
||||
};
|
||||
log.addHandler(loggerOne);
|
||||
log.addHandler(loggerTwo);
|
||||
|
||||
log.info("This is an info");
|
||||
logEvents.filter(function(evt) { return evt.logger === 1}).should.have.lengthOf(1);
|
||||
logEvents.filter(function(evt) { return evt.logger === 2}).should.have.lengthOf(1);
|
||||
|
||||
|
||||
log.removeHandler(loggerTwo);
|
||||
log.info("This is an info");
|
||||
logEvents.filter(function(evt) { return evt.logger === 1}).should.have.lengthOf(2);
|
||||
logEvents.filter(function(evt) { return evt.logger === 2}).should.have.lengthOf(1);
|
||||
|
||||
log.removeHandler(loggerOne);
|
||||
log.info("This is an info");
|
||||
logEvents.filter(function(evt) { return evt.logger === 1}).should.have.lengthOf(2);
|
||||
logEvents.filter(function(evt) { return evt.logger === 2}).should.have.lengthOf(1);
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user