Compare commits

..

350 Commits

Author SHA1 Message Date
Nick O'Leary
f878ffc01b Update changelog 2020-11-05 13:53:22 +00:00
Nick O'Leary
15b49f4db8 Disable 'use strict' checking in Function node
Fixes #2743
2020-11-05 13:48:55 +00:00
Dave Conway-Jones
b1cc7b3296 de-duplicate colour keys 2020-11-05 09:38:34 +00:00
Dave Conway-Jones
65d90a6dff Add gray/grey alternate options for status 2020-11-05 09:20:47 +00:00
Dave Conway-Jones
a58f4c2ec2 remove " from npm install prefix option
to fix npm 7
2020-11-05 09:19:47 +00:00
Nick O'Leary
75d7ac2d8a Merge pull request #2747 from node-red-hitachi/update-message-jp
update Japanese message catalogue for 1.2.3 release
2020-11-03 10:42:45 +00:00
Hiroyasu Nishiyama
6720c1aa46 update Japanese message catalogue for 1.2.3 release 2020-11-03 09:16:13 +09:00
Nick O'Leary
280203e64e Move mosca to ui-test-dependencies list 2020-11-02 21:32:20 +00:00
Nick O'Leary
281d8b7cec Bump for 1.2.3 2020-11-02 21:31:27 +00:00
Nick O'Leary
2c6cda1f27 Handle import errors on initial load and report to user 2020-11-02 21:14:24 +00:00
Nick O'Leary
fa532da8c7 Merge pull request #2739 from node-red/settings-file
Modify default settings comment
2020-10-29 15:42:00 +00:00
Nick O'Leary
cbf84647de Modify default settings comment 2020-10-29 11:51:30 +00:00
Nick O'Leary
c38a490a6f Merge pull request #2737 from node-red/fix-async-settings
Add mutex lock to saveSettings storage call
2020-10-28 22:14:25 +00:00
Nick O'Leary
9d7a450821 Add mutex lock to saveSettings storage call
Fixes #2736
2020-10-28 21:59:22 +00:00
Nick O'Leary
0ecd9673b8 Only apply recovery tab on initial load
Fixes #2731
2020-10-21 10:36:47 +01:00
Nick O'Leary
97aa1230ef Reinstate coveralls reporting to travis build 2020-10-19 21:22:15 +01:00
Nick O'Leary
ff0be73b1f Migrate to nyc instead of istanbul for code coverage 2020-10-19 21:10:34 +01:00
Nick O'Leary
8049e44dec Update CHANGELOG for 1.2.2 2020-10-19 13:25:38 +01:00
Nick O'Leary
dc26022fb4 Prevent node z property getting set to 0 or "" 2020-10-19 13:24:04 +01:00
Nick O'Leary
e8e44f9a32 Only apply z-recovery logic to flow nodes 2020-10-19 13:23:43 +01:00
Nick O'Leary
12d56b8b03 Fix api call to reload flows
Fixes #2726
2020-10-19 12:56:40 +01:00
Nick O'Leary
e62fd7ed15 Remove bad z property from import config nodes 2020-10-19 12:53:03 +01:00
Nick O'Leary
978eb95acd Bump for 1.2.1 2020-10-15 16:22:37 +01:00
Nick O'Leary
e34f4acb22 Fix race condition in .config file migration
Fixes #2724
2020-10-15 16:21:28 +01:00
Nick O'Leary
15a600c763 Fix tab selection after sidebar tab reorder 2020-10-14 22:10:03 +01:00
Nick O'Leary
82ad5839fa Update changelog and bump dependencies 2020-10-13 21:49:11 +01:00
Nick O'Leary
9af883231d Merge pull request #2722 from node-red-hitachi/fix-link-selection
fix selection of link node not existing within active workspace
2020-10-13 13:56:53 +01:00
Hiroyasu Nishiyama
9bfe8ac007 fix selection of link node not existing within active workspace 2020-10-12 20:16:21 +09:00
Nick O'Leary
f46367d77b Fix import of merged flow 2020-10-12 11:20:44 +01:00
Nick O'Leary
eb2e1c0c45 Merge pull request #2718 from node-red-hitachi/fix-upload-button-width-on-safari
Fix upload button width on Safari
2020-10-09 17:12:35 +01:00
Jiye Yu
baffc2d6ca update Chinese translation for NodeRed v1.2 (#2719) 2020-10-08 13:17:04 +01:00
Hiroyasu Nishiyama
96ab508c91 move width specification of upload button to scss 2020-10-08 09:07:11 +09:00
Nick O'Leary
57e42659e3 Merge pull request #2716 from node-red-hitachi/fix-sidebar-tab-popup
Fix unexpected line break of sidebar tab name popover
2020-10-07 12:33:02 +01:00
Nick O'Leary
f059e97697 Merge pull request #2717 from node-red-hitachi/i18n-module-list-refresh-tooltip
i18n module refresh tooltip
2020-10-07 11:37:01 +01:00
Hiroyasu Nishiyama
516e6430eb fix upload button width on safari 2020-10-07 13:42:43 +09:00
Hiroyasu Nishiyama
f194a8ecf4 i18n module refresh tooltip 2020-10-07 11:08:23 +09:00
Hiroyasu Nishiyama
13f046f310 fix unexpected line break of sidebar tab name popover 2020-10-07 09:57:34 +09:00
Nick O'Leary
1edf5acb87 Merge pull request #2714 from node-red-hitachi/update-function-node-help-text
Update info text of Function node
2020-10-06 17:46:11 +01:00
Nick O'Leary
af636870d4 Add better error message if context file gets corrupted 2020-10-06 15:42:52 +01:00
Hiroyasu Nishiyama
379b8ada61 update info text of function node 2020-10-06 13:45:00 +09:00
Nick O'Leary
5e63471983 Use markdown editor if editText called with md mode 2020-10-05 20:38:05 +01:00
Nick O'Leary
086f0f8450 Prevent group actions when in non-default mouse mode 2020-10-02 16:07:22 +01:00
Nick O'Leary
97a4b3dc2a Merge branch 'pr_2709' into dev 2020-10-02 11:14:16 +01:00
Kazuhito Yokoi
4eb8d681c1 Update Japanese translations needed for 1.2 (#2710) 2020-10-02 11:07:01 +01:00
Hiroyasu Nishiyama
2066584164 fix to make Japanese import dialogue message single line 2020-10-01 19:25:21 +09:00
Nick O'Leary
a954c198fb Bump version for 1.2.0-beta.1 2020-09-30 10:20:41 +01:00
Nick O'Leary
bb1f8cd5e8 Update CHANGELOG and bump package.json 2020-09-29 20:43:03 +01:00
Nick O'Leary
101e96dcb3 Merge pull request #2665 from node-red/msg-router
Pluggable Message Routing
2020-09-29 20:36:23 +01:00
Nick O'Leary
59adf82895 Merge pull request #2707 from node-red/trigger-delay-override
Allow trigger node delay to be overridden with msg.delay
2020-09-29 20:29:10 +01:00
Nick O'Leary
3b68f56b15 Update top-level copyright statements 2020-09-29 20:28:15 +01:00
Nick O'Leary
2962c4372c Support setting trigger loop interval with msg.delay 2020-09-29 17:47:09 +01:00
Nick O'Leary
517e376582 Restore support for runtimeSyncDelivery flag 2020-09-29 17:39:29 +01:00
Nick O'Leary
7a90fe5aec Fix flow api unit tests 2020-09-29 17:35:43 +01:00
Nick O'Leary
ea45dde63a Remove when.js from runtime/lib/flow/index 2020-09-29 17:20:01 +01:00
Nick O'Leary
22a301b55e Add flows:* events and deprecate nodes-* events 2020-09-29 16:29:10 +01:00
Nick O'Leary
605177dcf0 Validate hook names when they are added 2020-09-29 16:28:52 +01:00
Nick O'Leary
460e1f5563 Fixup merge error 2020-09-29 12:19:27 +01:00
Nick O'Leary
6f25337b99 Add docs for RED.hooks 2020-09-29 12:19:27 +01:00
Nick O'Leary
08148a07b2 Update Node/Flow to trigger msg routing hooks 2020-09-29 12:19:27 +01:00
Nick O'Leary
27c0e45940 Remove unused router component 2020-09-29 12:19:27 +01:00
Nick O'Leary
bdd736315a Add RED.hooks engine 2020-09-29 12:19:27 +01:00
Nick O'Leary
d57ec0cd53 Refactor lib/flows code to include initial router component 2020-09-29 12:19:26 +01:00
Nick O'Leary
952c9d8bdb Upgrade to latest nodemon to fix restart
The grunt-nodemon module we were using is no longer
maintained and is stuck on a 1.x version of nodemon.

At that version, node-red doesn't restart properly
due to our increased signal handling in the core.

This change removes grunt-nodemon and replaces it
with nodemon itself, with a custom task to wrap it
that does the same work as grunt-nodemon was doing.
2020-09-29 12:11:10 +01:00
Nick O'Leary
cf84ec78fa Allow trigger node delay to be overridden with msg.delay 2020-09-28 21:10:23 +01:00
Nick O'Leary
b595e84c30 Update jsdoc of util.getMessageProperty 2020-09-28 14:26:20 +01:00
Nick O'Leary
6e5f115bd5 Improve jsdoc of util.getObjectProperty to clarify thrown error
See #2703
2020-09-28 14:23:23 +01:00
Nick O'Leary
a1ab00c93e sort package dependencies 2020-09-28 14:13:53 +01:00
Nick O'Leary
6e5c4e832e Update dependencies 2020-09-28 11:58:22 +01:00
Nick O'Leary
48ea487974 Update changelog 2020-09-28 11:40:38 +01:00
Nick O'Leary
54dc98a90b Merge pull request #2035 from node-red/simple-git
Add option for simplified git workglow
2020-09-28 11:39:17 +01:00
Nick O'Leary
c5bdd3d056 Allow user to manage project version string 2020-09-28 11:30:46 +01:00
Nick O'Leary
64d6e1f8e1 Changing timing in trigger node test 2020-09-28 10:50:19 +01:00
Nick O'Leary
69d60ffb24 Add simplified git workflow to auto-commit changes 2020-09-28 10:41:33 +01:00
Nick O'Leary
e6ffa3d143 Cache settings when doing initial load 2020-09-28 10:41:05 +01:00
Nick O'Leary
bb4330e486 Clone settings before passing to storage layer
Avoids the storage layer modifying the in-memory object
2020-09-28 10:40:03 +01:00
Nick O'Leary
1a4d720978 Improve timings in trigger node test 2020-09-25 23:32:59 +01:00
Nick O'Leary
91c2f479bb Fix settings file migration test 2020-09-25 18:29:47 +01:00
Nick O'Leary
b61701fa17 Remove UI tests from travis config 2020-09-25 18:00:32 +01:00
Nick O'Leary
cb9f910642 Update changelog 2020-09-25 17:19:02 +01:00
Nick O'Leary
4b8d07f301 Merge branch 'pr_2644' into dev 2020-09-25 17:11:39 +01:00
Nick O'Leary
2db3a4f1ef Add unit tests for function node init code 2020-09-25 17:11:10 +01:00
Nick O'Leary
ead1f65887 Disable selection FA icons when dbl clicking node 2020-09-25 16:03:21 +01:00
Nick O'Leary
aae9866866 Update changelog 2020-09-25 15:58:33 +01:00
Nick O'Leary
085ff84bc9 Merge pull request #2704 from node-red/split-config
Split .config.json into separate files
2020-09-25 15:56:32 +01:00
Nick O'Leary
e12975cf0b Do not remove old config.json file to ease downgrade path 2020-09-25 15:50:26 +01:00
Nick O'Leary
a33cf6b532 Merge branch 'master' into dev 2020-09-25 11:53:37 +01:00
Nick O'Leary
5be25d9538 Merge branch 'pr_2705' 2020-09-25 11:53:15 +01:00
Nick O'Leary
2b29eeb795 Add unit test for module path 2020-09-25 11:52:48 +01:00
t.kawamorita
785561a0cc fix getModuleFiles function 2020-09-25 11:58:03 +09:00
Nick O'Leary
b46dc88346 Update changelog 2020-09-24 18:12:52 +01:00
Nick O'Leary
96d81ef72b Add slight delay to fix config.json file tests 2020-09-24 16:54:24 +01:00
Nick O'Leary
81dc3de26a Ensure errors in ACE NRJavaScript mode are on valid lines
In the case of an "Unmatched {" error, it flags the { on
the line we wrap the user's code in. That doesn't help the
user.

This fix moves such an error to the first valid { in the file.

It handles ignoring { in comments or strings. It fails to ignore
{ inside regex. But that's an edge case on top of an edge case.
2020-09-24 16:29:05 +01:00
Nick O'Leary
4d0c572c2e Fix .config.json unit tests 2020-09-24 15:42:52 +01:00
Nick O'Leary
fb2da0ee9e Split .config.json into separate files 2020-09-23 17:29:09 +01:00
Nick O'Leary
b8b0247717 Default flowFilePretty to true if projects enabled 2020-09-23 10:57:58 +01:00
Nick O'Leary
103e212aee Fix size of context sidebar refresh toggle buttons 2020-09-22 23:44:10 +01:00
Nick O'Leary
2f33575907 Merge branch 'dev' of github.com:node-red/node-red into dev 2020-09-21 20:12:42 +01:00
Nick O'Leary
576c528573 Merge pull request #2698 from node-red/import-dupes
Improved handling of importing duplicate subflow/config nodes
2020-09-21 18:30:15 +01:00
Nick O'Leary
3c444d3fb3 Merge branch 'master' into dev 2020-09-21 14:25:30 +01:00
Nick O'Leary
7cb499cde9 Sanitize unknown node type when displaying 2020-09-21 14:00:01 +01:00
Nick O'Leary
5a174ba014 Add comment highlighting to JSONata and fix regex handling
Closes #2701
2020-09-21 11:52:33 +01:00
Nick O'Leary
041feb4e86 Ensure sf instance nodes update in outliner when import-replace sf 2020-09-18 20:56:16 +01:00
Nick O'Leary
19726cf428 Fix setting of esversion in nrjavascript worker 2020-09-16 23:21:52 +01:00
Nick O'Leary
aaf134b1c5 Update ACE to 1.4.12-src-min-noconflict
Fixes #1988
2020-09-16 19:13:40 +01:00
Nick O'Leary
9d5f5ee94b Update to MQTT 4.2.1
Closes #2694
2020-09-16 16:56:39 +01:00
Nick O'Leary
a48f0827ae Detect importing duplicate nodes and help user resolve 2020-09-16 11:59:13 +01:00
Nick O'Leary
5686158245 Allow toggleButton icons to be optional 2020-09-16 11:59:13 +01:00
Nick O'Leary
3824cdde68 Allow treeList to have a header component 2020-09-16 11:59:13 +01:00
Nick O'Leary
e619b9bf7b Merge pull request #2691 from node-red/recover-nodes
Recover nodes with invalid z property
2020-09-16 11:56:29 +01:00
Nick O'Leary
b7243c2226 Merge branch 'master' into dev 2020-09-16 11:54:34 +01:00
Nick O'Leary
70b6674f44 Replace Math.random with crypto.getBytes for session tokens 2020-09-11 14:09:54 +01:00
Nick O'Leary
ef67b8481e Check file exists before trying to take backup 2020-09-11 13:26:00 +01:00
Nick O'Leary
baffe4861c Handle undefined value in Debug view of Array and Object
Fixes #2696
2020-09-07 21:05:27 +01:00
Nick O'Leary
5cf489a270 Fixup node test 2020-09-04 09:52:30 +01:00
Nick O'Leary
44b1819926 Merge pull request #2693 from mgroenhoff/master
Fix `this` context when calling multiple event listeners (fixes #2692).
2020-09-04 09:33:23 +01:00
Melvin Groenhoff
d84c2b780b Fix this context when calling multiple event listeners (fixes #2692). 2020-09-04 10:20:30 +02:00
Nick O'Leary
dc8991a1da Ensure recoverd nodes tab is added to outliner properly 2020-09-03 20:24:50 +01:00
Nick O'Leary
7bd0ca2212 Handle nodes with invalid z property
Closes #2170
2020-09-03 18:31:33 +01:00
Nick O'Leary
4dd619b8c6 Merge branch 'master' into dev 2020-09-03 16:14:55 +01:00
Nick O'Leary
3a86ab186c Merge branch 'dev' of github.com:node-red/node-red into dev 2020-09-03 15:23:41 +01:00
Nick O'Leary
2f2a6367c2 Merge pull request #2684 from node-red/skip-html
Avoid loading node html if disableEditor set
2020-09-03 15:02:09 +01:00
Nick O'Leary
be880c25f9 Merge pull request #2682 from node-red/upload-npm
Add support for file upload on /nodes api
2020-09-03 15:01:31 +01:00
Nick O'Leary
17812f0d77 Merge pull request #2683 from node-red/write-to-temp
Update util.writeFile to write to tmp file before rename
2020-09-03 15:00:31 +01:00
Nick O'Leary
0c5eae2349 Merge pull request #2679 from rorysavage77/mutex-for-flow-modification
Updated flow modification methods to support mutex serialization
2020-09-03 14:17:56 +01:00
Nick O'Leary
3ad1803057 Merge pull request #2655 from node-red/reorder-sidebar
Reorderable sidebar tabs
2020-09-03 14:07:17 +01:00
Nick O'Leary
02c20e97b7 Only recalculate group label offsets when needed 2020-09-03 13:49:42 +01:00
Nick O'Leary
716dc781e4 Reuse first group name/style when merging elements
Fixes #2680
2020-09-03 13:28:35 +01:00
Nick O'Leary
d9900d8e4c Fix copy/paste of node into active group
Fixes #2686
2020-09-03 13:12:08 +01:00
Nick O'Leary
3b9065b057 Prevent Enter on search box from reloading page
Fixes #2678
2020-09-03 11:22:41 +01:00
Nick O'Leary
e73b748b95 Merge branch 'dev' of github.com:node-red/node-red into dev 2020-09-03 11:17:09 +01:00
Nick O'Leary
b309161f00 Merge pull request #2685 from node-red-hitachi/dev-tracemetric
Add 'done' metric log for message tracing
2020-09-03 11:16:26 +01:00
Nick O'Leary
b21667834e Tweak upload dialog margin 2020-08-26 10:37:21 +01:00
Nick O'Leary
183fa59c83 Add tgz upload button to palette manager 2020-08-26 00:15:36 +01:00
Kunihiko Toumura
0c5586ddfb Add 'done' metric log for message tracing 2020-08-18 09:28:50 +09:00
Nick O'Leary
33855bcb8b Skip loading node html if disableEditor set 2020-08-14 00:20:44 +01:00
Nick O'Leary
dc81b7a699 Add --userDir=/tmp/foo support to grunt dev 2020-08-14 00:08:09 +01:00
Nick O'Leary
b0b2c32654 Update util.writeFile to write to tmp file before rename 2020-08-13 17:17:40 +01:00
Nick O'Leary
6f1ed76b4c Add support for file upload in /nodes api 2020-08-13 15:54:54 +01:00
Rory A. Svage
f81cee0be2 Message 2020-08-07 16:44:52 -04:00
Nick O'Leary
bcd85b11a1 Merge branch 'master' into dev 2020-08-05 15:19:54 +01:00
Nick O'Leary
ec368ae3fd Bump for 1.1.3 2020-08-05 14:59:25 +01:00
Nick O'Leary
d28c264422 Fix jshint error on polyfill 2020-08-05 14:58:43 +01:00
Nick O'Leary
fba505bc90 Fix vertical align of fa node icons
Fixes #2670
2020-08-05 13:53:49 +01:00
Kazuhito Yokoi
c50ed2c328 Add Japanese translation for empty rules in switch node 2020-08-05 11:22:23 +01:00
Nick O'Leary
7e11ff2b20 Update packages/node_modules/@node-red/nodes/locales/en-US/function/10-switch.html 2020-08-05 11:22:14 +01:00
Nathanaël Lécaudé
3fb83c46e2 Update 10-switch.html
Clarify switch help regarding booleans for the is empty / is not empty rules.
2020-08-05 11:22:04 +01:00
Nick O'Leary
763f2bd5c5 Merge pull request #2669 from kazuhitoyokoi/dev-jpn4switch
Update Japanese translation for switch node
2020-08-05 11:20:17 +01:00
Nick O'Leary
85edee288f Allow lasso selection to be restricted to active group 2020-08-05 11:16:53 +01:00
Nick O'Leary
1aa494a97a Make ctrl-click on nexted group more intuitive 2020-08-05 10:38:14 +01:00
Nick O'Leary
a8e7627184 Support select-all inside active group 2020-08-04 21:01:08 +01:00
Nick O'Leary
d590bbdd2c Fix copy/paste of nested groups 2020-08-04 20:59:51 +01:00
Nick O'Leary
80d65b5acb Add Set(iterable) polyfill for IE11 2020-08-04 20:59:32 +01:00
Kazuhito Yokoi
1d250f7491 Add Japanese translation for empty rules in switch node 2020-08-04 21:41:23 +09:00
Nick O'Leary
dd741ec6d8 Merge pull request #2649 from natcl/patch-5
Clarify empty rules in switch node documentation
2020-08-03 16:59:25 +01:00
Nick O'Leary
e741af6d55 Update packages/node_modules/@node-red/nodes/locales/en-US/function/10-switch.html 2020-08-03 16:58:09 +01:00
Nick O'Leary
e691b1b7c3 Add additional check for git auth failure response
Fixes #2656
2020-08-03 16:55:36 +01:00
Sebastian Raff
29142128f2 german translation, wording (#2660) (#2666)
to also close #2660
2020-08-02 18:34:10 +01:00
Nick O'Leary
758f44e25f Improve performance of moving groups 2020-07-31 23:22:33 +01:00
Nick O'Leary
16c26d8098 Move runtime settings back to adminApi from editorApi
Fixes #2662
2020-07-31 15:26:21 +01:00
Nick O'Leary
a004c61afc Merge pull request #2653 from node-red-hitachi/dev-messaging-api-cherrypick
Messaging API support of core nodes (cherrypicked)
2020-07-23 15:19:52 +01:00
Nick O'Leary
a9d1a64c32 Merge pull request #2661 from node-red-hitachi/master-zh
Update Chinese message for debug node
2020-07-23 15:09:36 +01:00
Dave Conway-Jones
889224715b Fix hhp-in to handle application/cbor as binary
as per discussion https://discourse.nodered.org/t/http-request-node-invalid-message-body-was-specified-to-be-cbor-but-could-not-decode-message-failed-to-parse/30503
2020-07-23 10:04:24 +01:00
Nick O'Leary
442b9d23f1 Remove filtering of duplicate fa icons 2020-07-22 14:51:07 +01:00
JIYE YU
e4dd895709 update Chinese message for debug node 2020-07-22 12:54:07 +09:00
Nick O'Leary
82677c304e Show node help when switching node edit dialogs
Fixes #2652
2020-07-16 16:12:16 +01:00
Nick O'Leary
73d8dfe381 Allow sidebar tabs to be reordered
The sidebar tab buttons can now be dragged to reorder them.

Changes to the order are stored in user preferences.
2020-07-15 11:26:08 +01:00
Kunihiko Toumura
1177aa8aca new-style callback function (yaml node) 2020-07-14 19:20:37 +09:00
Kunihiko Toumura
0eda0a4935 new-style callback function (xml node) 2020-07-14 19:18:05 +09:00
Kunihiko Toumura
a19dab0dc9 new-style callback function (json node) 2020-07-14 19:15:31 +09:00
Kunihiko Toumura
d8eb80b72e new-style callback function (html node) 2020-07-14 19:10:56 +09:00
Kunihiko Toumura
4f3a6821d1 new-style callback function (http response node) 2020-07-14 19:08:22 +09:00
Kunihiko Toumura
77bd7541ca new-style callback function (template node) 2020-07-14 19:05:41 +09:00
Kunihiko Toumura
ca46bc5366 new-style callback function (range node) 2020-07-14 19:02:41 +09:00
Kunihiko Toumura
2e19bc07df new-style callback function (link in/out node) 2020-07-14 18:59:09 +09:00
Kunihiko Toumura
3f4de43b67 new-style callback function (status node) 2020-07-14 18:56:16 +09:00
Kunihiko Toumura
0d0bf62fc4 new-style callback function (catch node) 2020-07-14 18:53:21 +09:00
Kunihiko Toumura
3c8654fa25 new-style callback function (complete node) 2020-07-14 18:50:03 +09:00
Kunihiko Toumura
756a6ec5aa new-style callback function (inject node) 2020-07-14 18:46:38 +09:00
Nick O'Leary
98c7364924 Ensure group theme picks up theme defaults properly
Fixes #2651
2020-07-13 20:44:53 +01:00
Nick O'Leary
62c01b59b2 Extend release action to update website 2020-07-10 21:46:00 +01:00
Nick O'Leary
43db1824be Bump for 1.1.2 2020-07-10 20:13:05 +01:00
Nick O'Leary
7f671c9f3f Ensure unknown nodes removed from outliner when node registers
Fixes #2646
2020-07-10 20:00:18 +01:00
Nathanaël Lécaudé
410009dd61 Update 10-switch.html
Clarify switch help regarding booleans for the is empty / is not empty rules.
2020-07-10 13:08:40 -04:00
Nick O'Leary
580cc00967 Fix all the touch screen issues 2020-07-10 16:00:38 +01:00
Nick O'Leary
612c565cfd Add RED.view.redrawStatus to avoid full redraw on update 2020-07-10 16:00:18 +01:00
Nick O'Leary
979c5351a8 Ensure node/group xrefs are consistent on import 2020-07-10 15:59:28 +01:00
Nick O'Leary
97b7479081 Disable keyboard handler when dialogs are open 2020-07-09 20:41:55 +01:00
Nick O'Leary
1df2f5e96a Allow Comms websocket auth to be done via token header
Fixes #2642
2020-07-09 19:07:51 +01:00
cinhcet
0601833387 msgid added in vm to avoid unneccesary if statement 2020-07-08 19:09:07 +02:00
Nick O'Leary
8b36279e52 Bump version 1.2.0-alpha.1 2020-07-08 15:57:32 +01:00
Nick O'Leary
32163d5f21 Update changelog 2020-07-08 13:26:48 +01:00
Nick O'Leary
1c337f6817 Fix connecting wires to subflow status or io ports on touchscreen 2020-07-08 13:22:26 +01:00
Nick O'Leary
6df26f2400 Bump for 1.1.1 2020-07-08 10:30:20 +01:00
Nick O'Leary
a9431a5aee Merge pull request #2645 from kazuhitoyokoi/master-addjpn
Update Japanese message for debug node
2020-07-08 10:08:49 +01:00
Kazuhito Yokoi
5a3c832a98 Update Japanese message for debug node 2020-07-08 16:20:02 +09:00
Nick O'Leary
c4b5bb22db Tidy up commit msg on docker update action 2020-07-08 01:13:14 +01:00
Nick O'Leary
2b5a976f35 Add github action to auto-update docker repo version on release publish 2020-07-08 01:02:18 +01:00
cinhcet
5d7a625883 expose send, status, log, warn, error, debug, trace, name, id in setup code of function node 2020-07-08 01:30:29 +02:00
Nick O'Leary
ae1ca85924 Update Debug status label 2020-07-07 22:10:47 +01:00
Nick O'Leary
c9acfdb1d7 Set apiRootUrl for debug pop-out to load locales properly
Fixes #2629, #2630
2020-07-07 21:14:44 +01:00
Nick O'Leary
11ac8fbf13 Ensure groups are removed when deleting subflows 2020-07-07 18:23:42 +01:00
Nick O'Leary
dc541444ba Merge pull request #2638 from node-red/Clean-up-debug-status-/-remove-loops
fix debug status to not loop, make migration more seamless, detect status type objects
2020-07-07 13:37:05 +01:00
Nick O'Leary
8ea25bcd1c Update build-custom-theme to handle keyframes properly
Fixes #2636

Also adds a header to the generated CSS identifing the version
of NR and date/time it was generated.
2020-07-07 11:38:07 +01:00
Nick O'Leary
f5e46a663a Remove hardcoded css and allow group to default from theme
Fixes #2633
2020-07-07 11:01:05 +01:00
Nick O'Leary
64ec415a54 Add RED.view.DEBUG_SYNC_REDRAW to disable requestAnimationFrame
References #2631
2020-07-06 21:01:14 +01:00
Nick O'Leary
57154b2853 Authenticate websocket comms using user-provided token if present
Fixes #2642
2020-07-06 20:45:07 +01:00
Nick O'Leary
0243a902b2 Fix up subflow port wiring 2020-07-06 18:11:47 +01:00
Nick O'Leary
6c04402a98 Prevent wiring to node with no corresponding port
Fixes #2641
2020-07-06 17:32:44 +01:00
Nick O'Leary
ef7c9b5c2a Get group order right in history events to ensure proper handling 2020-07-06 16:00:15 +01:00
Nick O'Leary
73448a6039 Avoid copying duplicate nodes to internal clipboard 2020-07-06 16:00:15 +01:00
Dave Conway-Jones
176a0ff99b add words avout indepedence of messages being delayed. 2020-07-06 10:33:26 +01:00
Dave Conway-Jones
b96d562700 fix debug status to not loop, make migration more seamless, detect status type objects 2020-07-04 15:26:02 +01:00
Nick O'Leary
7a3ead8f3b Merge branch 'dev' 2020-06-30 17:46:43 +01:00
Nick O'Leary
f72903ccc2 Update changelog 2020-06-29 21:12:12 +01:00
Nick O'Leary
668678b2c4 Bump version to 1.1.0 2020-06-29 21:08:34 +01:00
Nick O'Leary
e2802175a5 Clear outline focus on config node sidebar panel 2020-06-29 21:07:21 +01:00
Nick O'Leary
71c5b1be86 Merge pull request #2628 from Steve-Mcl/dev
Add developer options
2020-06-29 20:51:11 +01:00
Nick O'Leary
44da085e0b Tweak group margin to fit node status and look better 2020-06-29 20:43:25 +01:00
Nick O'Leary
362554ad3b Switch JSONata expr does not require msg.parts.count 2020-06-29 09:32:52 +01:00
Dave Conway-Jones
f01866d76f Fix backwards migration of inject without topic 2020-06-28 15:09:07 +01:00
Steve-Mcl
53490cd368 Add developer options
- permits npm run build-dev.  skips minification & doesnt launch nodemon
- permits npm run dev for those without grunt installed globally
2020-06-27 11:24:06 +01:00
Nick O'Leary
c171088838 Fix reparenting nodes in outliner when they change 2020-06-26 17:21:20 +01:00
Nick O'Leary
0cc944dc5a Update changelog 2020-06-26 16:02:19 +01:00
Nick O'Leary
8bd8834237 Add default shortcut for core:show-help-tab 2020-06-26 15:58:02 +01:00
Nick O'Leary
84fc739c8d Merge pull request #2626 from node-red-hitachi/dev-zhcn
Update both zh-CN and zh-TW translation for release 1.1.0
2020-06-26 15:54:47 +01:00
JIYE YU
a7fa2cf0c9 update zh-TW translation for release-1.1.0 2020-06-26 10:40:17 +09:00
JIYE YU
1137cd5ca5 update zh-CN translation for nodes information 2020-06-26 10:38:41 +09:00
Nick O'Leary
d47906b525 Simplify example https settings 2020-06-25 20:10:26 +01:00
JIYE YU
13a59a882e update zh-CN translation for editor-client 2020-06-25 18:31:36 +09:00
Nick O'Leary
3b7348f862 Update changelog 2020-06-24 14:51:18 +01:00
Nick O'Leary
07585f01e3 Ensure all examples are consistently named 2020-06-24 14:43:27 +01:00
Nick O'Leary
5042137006 Merge branch 'pr_2585' into examples 2020-06-24 13:50:50 +01:00
Nick O'Leary
a2ea79130c Merge branch 'pr_2550' into examples 2020-06-24 13:49:56 +01:00
Nick O'Leary
979401f3ac Merge branch 'pr_2549' into examples 2020-06-24 13:49:33 +01:00
Nick O'Leary
4c98db2269 Outliner - add empty item when last config node moved 2020-06-24 13:18:46 +01:00
Nick O'Leary
209c5f337c Join node - clear timeout when msg.reset received
Fixes #2471
2020-06-24 10:02:42 +01:00
Nick O'Leary
8080ed4787 Merge pull request #2623 from node-red-hitachi/update-subflow-message-jp
Update subflow message jp
2020-06-23 16:18:36 +01:00
Nick O'Leary
f3be5f0e67 Merge pull request #2624 from node-red-hitachi/fix-subflow-input
Fix error on empty subflow input types
2020-06-23 16:18:02 +01:00
Hiroyasu Nishiyama
fb2d185c5f fix typedInput error on empty subflow input types 2020-06-23 09:24:29 +09:00
Hiroyasu Nishiyama
f2d696b48e update JP message catalogue for subflow input type 2020-06-23 08:39:44 +09:00
Dave Conway-Jones
5596d2df8e catch tiny possible escape for "\n " in exec command node label. 2020-06-22 22:41:22 +01:00
Dave Conway-Jones
b72ca439e2 Fix tcp in node finishing packets when in streaming base64 receive mode. 2020-06-22 22:40:15 +01:00
Nick O'Leary
432ed264c2 Remove hardcoded css
Fixes #2603
2020-06-22 20:39:41 +01:00
Nick O'Leary
0a411cbe4f Fix node button mouse pointer css 2020-06-22 14:37:52 +01:00
Nick O'Leary
581f71911a Change node linebreak handling to use "\n " 2020-06-22 13:08:35 +01:00
Nick O'Leary
e548bf8bc2 Handle import of node with non-default number of outputs 2020-06-22 10:43:09 +01:00
Nick O'Leary
1d944bab51 Improve display of focussed form element 2020-06-18 22:25:19 +01:00
Nick O'Leary
6f407750f5 Fix clearing group label 2020-06-18 22:25:00 +01:00
Nick O'Leary
19ffe8f308 Default group label to be shown and improve toggle button 2020-06-18 22:24:44 +01:00
Nick O'Leary
c9069d472f Make color/icon/label-pos pickers keyboard navigable 2020-06-18 22:23:50 +01:00
Nick O'Leary
68d3cc7507 Fix node toggle button initial opacity 2020-06-18 10:18:35 +01:00
Nick O'Leary
0c90376752 Align node labels on FF
FF doesn't seems to use alignment-baseline CSS class in the same
way Chrome does. Switched to domintant-baseline.
2020-06-18 10:11:22 +01:00
Hiroyasu Nishiyama
f5eb832cd2 merge template node example #1 and #4 2020-06-18 14:03:33 +09:00
Hiroyasu Nishiyama
c3a058a479 fixed switch node example#8 imported as flow 2020-06-18 13:56:01 +09:00
Hiroyasu Nishiyama
bc87210ce3 change scale and limit to limit and fixed typo 2020-06-18 13:35:09 +09:00
Hiroyasu Nishiyama
d595eb2614 change exec node example to use echo command and merge two examples 2020-06-18 13:12:58 +09:00
Hiroyasu Nishiyama
cb4d118ccc remove delay node example#6 from cookbook 2020-06-18 11:25:05 +09:00
Hiroyasu Nishiyama
62c723866a fix typos 2020-06-18 10:41:36 +09:00
Nick O'Leary
c9e54f2ba9 Bump for 1.1.0-beta.3 2020-06-17 10:54:15 +01:00
Nick O'Leary
e2c86c4b96 Fix wiring nodes from input back to output 2020-06-17 10:52:41 +01:00
Nick O'Leary
4469a334fd Fix sometimes unable to keyboard-move group to left/up 2020-06-17 09:57:25 +01:00
Nick O'Leary
aca379db6e Fix group position in outliner 2020-06-16 20:48:28 +01:00
Nick O'Leary
9ce5210c33 Handle unknown nodes with no icon 2020-06-16 20:34:45 +01:00
Nick O'Leary
4dd68452b4 Prevent node creep when switching tabs 2020-06-16 20:23:18 +01:00
Nick O'Leary
714b3d3fe0 Bump version to 1.1.0-beta.2 2020-06-16 15:21:03 +01:00
Nick O'Leary
2378e0d961 Fix up linting in search.js 2020-06-16 15:08:30 +01:00
Nick O'Leary
f78bbdc29f Update CHANGELOG for 1.1.0-beta.2 2020-06-16 15:03:56 +01:00
Nick O'Leary
708620f929 Merge pull request #2605 from johanneskropf/patch-1
use bash as shell for exec command if on linux
2020-06-16 14:45:34 +01:00
Nick O'Leary
9f0490fc12 Merge pull request #2619 from kazuhitoyokoi/dev-fixuitest3
Fix page object of inject node
2020-06-16 14:38:15 +01:00
Nick O'Leary
d37eebd8ed Merge pull request #2618 from kazuhitoyokoi/dev-addjpntranslations
Fix i18n bug in outliner
2020-06-16 14:22:55 +01:00
Kazuhito Yokoi
bfeda23ce5 Fix page object of inject node 2020-06-16 21:58:08 +09:00
Kazuhito Yokoi
52eb158231 Add Japanese translations for outliner, jsonata and runtime 2020-06-16 21:32:10 +09:00
Nick O'Leary
afb782410d Merge pull request #2617 from kazuhitoyokoi/dev-fixuitest2
Fix page object of debug node
2020-06-16 10:57:16 +01:00
Nick O'Leary
aebb7da3c7 Fix deleting node in group after changing selection 2020-06-16 10:54:50 +01:00
Kazuhito Yokoi
b90710945a Fix page object of debug node 2020-06-16 11:45:27 +09:00
Nick O'Leary
56efd51c06 Fixup padding of quick-add search box 2020-06-15 22:31:47 +01:00
Nick O'Leary
76728d1783 Move config nodes under type-level hierarchy in outline
Also adds user-count label and button to open search
2020-06-15 22:31:47 +01:00
Nick O'Leary
5b1fe9aa0a Emit nodes:change event for config node users list modified 2020-06-15 22:31:47 +01:00
Nick O'Leary
e3c8466819 Merge pull request #2616 from kazuhitoyokoi/dev-fixuitest
Fix page object of inject node
2020-06-15 22:27:30 +01:00
Kazuhito Yokoi
6a70cd1975 Fix page object of inject node 2020-06-15 20:36:41 +09:00
Nick O'Leary
2c45771024 Merge pull request #2593 from kazuhitoyokoi/master-adduitest4travis
Enable automated UI testing on Travis CI
2020-06-15 11:14:14 +01:00
Nick O'Leary
ebca8c0217 Increase group margin to avoid clash with status text 2020-06-14 23:44:26 +01:00
Nick O'Leary
752a080876 Fix event order when quick-adding node to group 2020-06-14 23:44:01 +01:00
Nick O'Leary
0541d9189d Switch RED.events.DEBUG messages to warn to get stacktraces 2020-06-14 23:43:15 +01:00
Nick O'Leary
0e454b08c8 Fix empty item handling for subflows/config in outliner 2020-06-14 22:46:59 +01:00
Nick O'Leary
2d0ca20a03 Fix search indexing of group nodes 2020-06-14 22:46:46 +01:00
Nick O'Leary
61d9ccf263 Avoid regenerating every node label on redraw 2020-06-13 23:02:10 +01:00
Hiroyasu Nishiyama
1c30584153 fix code indentation 2020-06-13 23:33:45 +09:00
Hiroyasu Nishiyama
5c5bebd689 fix handling of multi-line node label 2020-06-13 23:28:10 +09:00
johanneskropf
d9548a2891 moved check for shell 2020-06-12 17:14:11 +02:00
johanneskropf
d25e027201 moved building of execOpt object to line 36 2020-06-12 17:10:31 +02:00
Nick O'Leary
93211470d1 Merge pull request #2611 from node-red-hitachi/fix-group-merge-activation
Disable group merge for single item or non-group items
2020-06-12 08:50:12 +01:00
Nick O'Leary
b5800205c4 Merge pull request #2610 from node-red-hitachi/fix-charAt-error-on-undefined
Fix char at error on undefined when opening websocket-listner
2020-06-12 08:49:34 +01:00
Nick O'Leary
eeebf04509 Merge pull request #2609 from node-red-hitachi/fix-remove-from-group
fix empty placeholder not shown on remove from group
2020-06-12 08:49:09 +01:00
Nick O'Leary
f4f99f594d Merge pull request #2612 from node-red-hitachi/fix-group-position
Fix group position of empty group with multi-line label
2020-06-12 08:48:33 +01:00
Hiroyasu Nishiyama
5e8e739f78 fix position of empty group with multi-line label 2020-06-12 16:07:46 +09:00
Hiroyasu Nishiyama
a15adc43af merge code for checking menu activation 2020-06-12 09:54:11 +09:00
Hiroyasu Nishiyama
07556592c1 disable merge group menu for single item or non-group item 2020-06-12 08:42:15 +09:00
Hiroyasu Nishiyama
7694349078 prevent charAt call on websocket listener 2020-06-11 23:00:56 +09:00
Hiroyasu Nishiyama
4f3cb3103e make treelist of subflow/config nodes initialy has empty placeholder 2020-06-11 22:18:31 +09:00
Hiroyasu Nishiyama
842cd1ecf0 fix empty placeholder not shown on remove from group 2020-06-11 09:57:43 +09:00
Nick O'Leary
81a4f42673 Merge pull request #2607 from node-red-hitachi/fix-stringify-error
prevent conversion of circular structure
2020-06-10 13:38:32 +01:00
Hiroyasu Nishiyama
152e695f4c prevent conversion of circular structure 2020-06-10 19:56:16 +09:00
Nick O'Leary
5a0c10b80e Handle null status text in the editor
Fixes #2606
2020-06-10 10:58:44 +01:00
johanneskropf
06adf3d346 use bash as shell for exec command if on linux
This relates to:
https://github.com/node-red/node-red/issues/2604
and
https://discourse.nodered.org/t/exec-node-timeout-not-working-in-exec-mode/28040
and is a possible workaround for most issues related to kill described there.
This has only been tested on linux where this change applies so it would most definitely need more testing on windows/mac and maybe linux distributions where there is no bash(?).
2020-06-10 11:24:56 +02:00
Nick O'Leary
7be824640c Fix snapToGrid 2020-06-10 01:02:48 +01:00
Nick O'Leary
c061487a16 Massively reduce our dependency on d3 to render the view
This is a slightly scary set of changes to be making. It overhauls
how the view is rendered.

Rather than use d3 for every single part of generating the view,
we new use native DOM functions as much as possible.

d3 is still used for the basic heavy lifting of working out what
nodes/links etc need to be added/removed from the view. But once
it comes to rendering them, d3 is side-lined as much as possible.

There's room for further improvement. This change focusses on Nodes
and Links. It has not touched groups, subflow-ports and link-nodes.
2020-06-10 00:45:20 +01:00
Nick O'Leary
97fd34150f EditableList/TreeList - defer adding elements to DOM
Whenever a DOM element is modified, it causes the browser to re-examine
the whole hierarchy around the element to see if anything needs to change.

This can cause a lot of extra work if an element is added to the DOM and
then a lot of updates are applied to the element.

It is much better to get the element as close to its final state as
possible *before* adding it to the DOM.
2020-06-10 00:42:11 +01:00
Nick O'Leary
6d294a0c74 Prevent RED.stop being called multiple times if >1 signal received 2020-06-09 08:23:12 +01:00
Nick O'Leary
fe4ef354ac Flag a node as removed when it is disabled 2020-06-08 20:59:00 +01:00
Nick O'Leary
d28b8b5e8d Some performance improvements for TreeList 2020-06-08 17:13:05 +01:00
Nick O'Leary
f2b30d9a3f Resize info/help sidebars whenever sidebar is opened 2020-06-08 13:17:06 +01:00
Nick O'Leary
0a614f2741 Add search defaults to outliner searchBox 2020-06-08 12:02:21 +01:00
Nick O'Leary
a9fb50787b Add search presets option to searchBox widget 2020-06-08 12:01:29 +01:00
Nick O'Leary
ce7d7a8e01 Add RED.popover.menu as a new type of menu widget 2020-06-08 12:01:05 +01:00
Nick O'Leary
7006c00233 Add support for is:XYZ search flags
- is:unused
 - is:config
 - is:subflow
 - is:invalid
2020-06-08 11:55:24 +01:00
Nick O'Leary
21866634b3 Track subflow instances on the subflow node itself 2020-06-08 11:49:43 +01:00
Nick O'Leary
34dfd50702 Bump node-red-admin 0.2.6 2020-06-06 10:35:07 +01:00
Nick O'Leary
d9502a6c00 Refresh outline filter whenever something changes
Fixes #2601
2020-06-05 22:19:46 +01:00
Nick O'Leary
95f7b9205a Fix Help tab search box appearance 2020-06-05 17:14:25 +01:00
Nick O'Leary
d14d4944a0 Rename Node Information to Information in sidebar 2020-06-05 17:14:08 +01:00
Nick O'Leary
b4b2729e96 Do a sync-redraw after clearing to ensure clean state 2020-06-05 16:56:12 +01:00
Nick O'Leary
299b81f51b Fix Link node filter
Fixes #2600
2020-06-05 16:20:40 +01:00
Nick O'Leary
ad6b18e66f Make catch/status/complete/link filter case-insensitive 2020-06-05 16:00:02 +01:00
Nick O'Leary
091a462a42 Add 'add' option to touch radialMenu for quick-add dialog 2020-06-05 15:48:45 +01:00
Dave Conway-Jones
cb218a57f1 Merge branch 'dev' of https://github.com/node-red/node-red into dev 2020-06-05 11:22:42 +01:00
Dave Conway-Jones
ba8649117d ensure trigger node detects changes to number of outputs 2020-06-05 11:22:38 +01:00
Nick O'Leary
20daebd965 Ignore whitespace when checking function setup/close code 2020-06-05 10:36:49 +01:00
Nick O'Leary
7c2786969a Preserve event handlers when moving outliner items 2020-06-05 09:55:36 +01:00
Nick O'Leary
565aae5967 Add tooltips to outliner buttons 2020-06-05 09:55:36 +01:00
Dave Conway-Jones
16a634063a Fix debug node status to migrate old nodes to correct default mode. 2020-06-05 09:48:12 +01:00
Nick O'Leary
4c28b5b227 Only validate nodes once they have all been imported
This ensures any checks for dependent config nodes will pass
2020-06-04 17:06:29 +01:00
Nick O'Leary
a7a949377b Ensure configNode.users is updated properly on import 2020-06-04 17:06:11 +01:00
Kazuhito Yokoi
e44d89c2af Enable automated UI testing on Travis CI 2020-06-03 17:22:25 +09:00
Hiroyasu Nishiyama
b4c033ca50 add missing inject node examples 2020-06-01 15:20:53 +09:00
Hiroyasu Nishiyama
b67f2d874b add examples for function category nodes 2020-06-01 14:44:18 +09:00
Hiroyasu Nishiyama
2dd004f6cd rename example name of complete node 2020-05-12 15:56:35 +09:00
Hiroyasu Nishiyama
964b7e0e23 rename example name of status node 2020-05-12 15:53:59 +09:00
Hiroyasu Nishiyama
bc039bde81 rename example name of catch node 2020-05-12 15:52:01 +09:00
Hiroyasu Nishiyama
9505f82d9b split debug node examples 2020-05-12 15:43:28 +09:00
Hiroyasu Nishiyama
c885f2edaa add example of link node across tabs 2020-05-06 12:36:28 +09:00
Hiroyasu Nishiyama
ae5a7176ba change comment of debug node example 2020-05-06 12:36:05 +09:00
Hiroyasu Nishiyama
62ec7f4d37 add examples of common category nodes 2020-05-02 00:18:24 +09:00
Hiroyasu Nishiyama
319c7e9e9f add join node example 2020-05-01 16:49:17 +09:00
Hiroyasu Nishiyama
580492b0c8 create sequence category 2020-05-01 10:39:52 +09:00
Hiroyasu Nishiyama
655ce7b87a add split node example 2020-05-01 10:37:47 +09:00
Hiroyasu Nishiyama
4e09b404a2 fix comment description of sort sequence example 2020-05-01 09:55:38 +09:00
Hiroyasu Nishiyama
748f831495 rename examples & correct sequence size 2020-05-01 09:48:31 +09:00
Hiroyasu Nishiyama
bb3b87814c add sort node examples 2020-05-01 09:24:29 +09:00
Hiroyasu Nishiyama
0bfe20182f rename batch examples 2020-04-30 23:55:22 +09:00
300 changed files with 8191 additions and 3265 deletions

View File

@@ -0,0 +1,29 @@
const fs = require("fs");
const newVersion = require("../../package.json").version;
if (process.env.GITHUB_REF !== "refs/tags/"+newVersion) {
console.log(`GITHUB_REF doesn't match the package.json version: ${process.env.GITHUB_REF} !== ${newVersion}`);
process.exit(0);
}
if (!/^\d+\.\d+\.\d+$/.test(newVersion)) {
console.log(`Not updating for a non-stable release - ${newVersion}`);
process.exit(0);
}
const currentVersion = require("../../../node-red-docker/package.json").version;
console.log(`Update from ${currentVersion} to ${newVersion}`)
updateFile(__dirname+"/../../../node-red-docker/package.json", currentVersion, newVersion);
updateFile(__dirname+"/../../../node-red-docker/docker-custom/package.json", currentVersion, newVersion);
updateFile(__dirname+"/../../../node-red-docker/README.md", currentVersion, newVersion);
console.log(`::set-env name=newVersion::${newVersion}`);
function updateFile(path,from,to) {
let contents = fs.readFileSync(path,"utf8");
contents = contents.replace(new RegExp(from.replace(/\./g,"\\."),"g"), to);
fs.writeFileSync(path, contents);
}

View File

@@ -0,0 +1,18 @@
const fs = require("fs");
const newVersion = require("../../package.json").version;
if (process.env.GITHUB_REF !== "refs/tags/"+newVersion) {
console.log(`GITHUB_REF doesn't match the package.json version: ${process.env.GITHUB_REF} !== ${newVersion}`);
process.exit(0);
}
if (!/^\d+\.\d+\.\d+$/.test(newVersion)) {
console.log(`Not updating for a non-stable release - ${newVersion}`);
process.exit(0);
}
const path = __dirname+"/../../../node-red.github.io/index.html";
let contents = fs.readFileSync(path, "utf8");
contents = contents.replace(/<span class="node-red-latest-version">v\d+\.\d+\.\d+<\/span>/, `<span class="node-red-latest-version">v${newVersion}<\/span>` );
fs.writeFileSync(path, contents);

58
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: PublishDockerImage
on:
release:
types: [published]
jobs:
generate:
name: 'Update node-red-docker image'
runs-on: ubuntu-latest
steps:
- name: Check out node-red repository
uses: actions/checkout@v2
with:
path: 'node-red'
- name: Check out node-red-docker repository
uses: actions/checkout@v2
with:
repository: 'node-red/node-red-docker'
path: 'node-red-docker'
- name: Check out node-red.github.io repository
uses: actions/checkout@v2
with:
repository: 'node-red/node-red.github.io'
path: 'node-red.github.io'
- uses: actions/setup-node@v1
with:
node-version: '12'
- run: node ./node-red/.github/scripts/update-node-red-docker.js
- name: Create Docker Pull Request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.NR_REPO_TOKEN }}
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
path: 'node-red-docker'
commit-message: 'Bump to ${{ env.newVersion }}'
title: '🚀 Update to Node-RED ${{ env.newVersion }} release'
body: |
Updates the Node-RED Docker repo for the ${{ env.newVersion }} release.
Once this is merged, you will need to create a new release with the tag `v${{ env.newVersion }}`.
This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary
- run: node ./node-red/.github/scripts/update-node-red-website.js
- name: Create Website Pull Request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.NR_REPO_TOKEN }}
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
path: 'node-red.github.io'
commit-message: 'Bump to ${{ env.newVersion }}'
title: '🚀 Update to Node-RED ${{ env.newVersion }} release'
body: |
Updates the Node-RED Website repo for the ${{ env.newVersion }} release.
This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary

3
.gitignore vendored
View File

@@ -22,4 +22,5 @@ packages/node_modules/@node-red/editor-client/public
!test/**/node_modules
docs
!packages/node_modules/**/docs
.vscode
.vscode
.nyc_output

View File

@@ -1,12 +1,15 @@
sudo: false
addons:
chrome: stable
language: node_js
matrix:
include:
- node_js: "14"
script:
- ./node_modules/.bin/grunt && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
# - scripts/install-ui-test-dependencies.sh && grunt test-ui
before_script:
- npm install -g coveralls
- node_js: "12"
- node_js: "10"
script:
- ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage
before_script:
- npm install -g istanbul coveralls
- node_js: "8"

View File

@@ -1,3 +1,273 @@
### 1.2.3: Maintenance Release
Editor
- Disable 'use strict' checking in Function node Fixes #2743
- Add gray/grey alternate options for status
- Handle import errors on initial load and report to user
- Only apply recovery tab on initial load Fixes #2731
- Reinstate coveralls reporting to travis build
- Update Japanese message catalogue for 1.2.3 release #2747 (@HiroyasuNishiyama)
Runtime
- Modify default settings comment (#2739)
- Add mutex lock to saveSettings storage call Fixes #2736 (#2737)
- Migrate to nyc instead of istanbul for code coverage
- Move mosca to ui-test-dependencies
- Remove " from npm install prefix option
### 1.2.2: Maintenance Release
Editor
- Prevent node z property getting set to 0 or ""
- Only apply z-recovery logic to flow nodes
- Fix api call to reload flows Fixes #2726
- Remove bad z property from import config nodes
### 1.2.1: Maintenance Release
Runtime
- Fix race condition in .config file migration Fixes #2724
### 1.2.0: Milestone Release
Editor
- Fix selection of link node not existing within active workspace #2722 (@HiroyasuNishiyama)
- Fix import of merged flow
- Fix width of upload button in Safari #2718 (@HiroyasuNishiyama)
- Update Chinese translations #2719 (@JiyeYu)
- Update Japanese translations needed for 1.2 #2710 (@kazuhitoyokoi)
- Fix unexpected line break of sidebar tab name popover #2716 (@HiroyasuNishiyama)
- i18n module refresh tooltip #2717 (@HiroyasuNishiyama)
- Add better error message if context file gets corrupted
- Update info text of function node #2714 (@HiroyasuNishiyama)
- Use markdown editor if editText called with md mode
- Prevent group actions when in non-default mouse mode
### 1.2.0-beta.1: Beta Release
Editor
- Detect importing duplicate nodes and help user resolve #2698
- Allow sidebar tabs to be reordered #2655
- Add tgz upload button to palette manager #2682
- Add 'automatic' git workflow for projects #2035
- Allow project version string to be edited
- Sanitize unknown node type when displaying
- Handle nodes with invalid z property Closes #2170
- Outline: Ensure sf instance nodes update in outliner when import-replace sf
- Outline: Ensure recovered nodes tab is added to outliner properly
- Groups: Only recalculate group label offsets when needed
- Groups: Reuse first group name/style when merging elements Fixes #2680
- Groups: Fix copy/paste of node into active group Fixes #2686
- ACE: Update ACE to 1.4.12-src-min-noconflict Fixes #1988
- ACE: Add comment highlighting to JSONata and fix regex handling Closes #2701
- ACE: Ensure errors in ACE NRJavaScript mode are on valid lines
- Prevent Enter on search box from reloading page Fixes #2678
- Allow toggleButton icons to be optional
- Allow treeList to have a header component
- Disable selection of FA icons when dbl clicking node
Runtime
- Add RED.hooks API for pluggable routing #2665
- Add flows:* events and deprecate nodes-* events
- Split .config.json into separate files #2794
- Add support for file upload in /nodes api #2682
- Add 'done' metric log for message tracing #2685 (@k-toumura)
- Add mutex locking around /flow apis #2679
- Default flowFilePretty to true if projects enabled
- Replace Math.random with crypto.getBytes for session tokens
- Fix `this` context when calling multiple event listeners Fixes #2692. #2693 (@mgroenhoff)
- Add --userDir=/tmp/foo support to grunt dev
- Skip loading node html if disableEditor set #2684
- Update util.writeFile to write to tmp file before rename #2683
- Fix getModuleFiles function to include path property #2705 (@t-kawamorita)
- Update nodemon to latest so grunt dev task behaves
- Improve jsdoc of util.getObjectProperty to clarify thrown error See #2703
Nodes
- Trigger: allow msg.delay to be used to set delay/loop interval #2707
- Function: allow to send & log in its initialize code #2644 (@cinhcet)
- MQTT: Update to MQTT 4.2.1 Closes #2694
- Debug: Handle undefined value in Debug view of Array and Object Fixes #2696
- Switch: Clarify empty rules in switch node documentation #2649 (@natcl) #2669 (@kazuhitoyokoi)
- Updated core nodes to use Done callback #2653 (@k-toumura)
- yaml, xml, json, html, http, template, range, link, status, catch, complete, inject
### 1.1.3: Maintenance Release
Editor
- Fix vertical align of fa node icons Fixes #2670
- Allow lasso selection to be restricted to active group
- Make ctrl-click on nested group more intuitive
- Fix copy/paste of nested groups
- Add Set(iterable) polyfill for IE11
- Support select-all inside active group
- Improve performance of moving groups
- Add additional check for git auth failure response Fixes #2656
- german translation, wording (#2660) (#2666)
- Remove filtering of duplicate fa icons
- Show node help when switching node edit dialogs Fixes #2652
- Ensure group theme picks up theme defaults properly Fixes #2651
Nodes
- Clarify Switch node isEmpty help
- HTTP In: handle application/cbor as binary
Runtime
- Move runtime settings back to adminApi from editorApi Fixes #2662
- Update Chinese message for debug node
### 1.1.2: Maintenance Release
Editor
- Fix all the touch screen issues Fixes #2647
- Add RED.view.redrawStatus to avoid full redraw on update
- Ensure node/group xrefs are consistent on import
- Disable keyboard handler when dialogs are open
- Ensure unknown nodes removed from outliner when node registers Fixes #2646
Runtime
- Allow Comms websocket auth to be done via token header Fixes #2642
### 1.1.1: Maintenance Release
Editor
- Set apiRootUrl for debug pop-out to load locales properly Fixes #2629, #2630
- Update build-custom-theme to handle keyframes properly Fixes #2636
- Remove hardcoded css and allow group to default from theme Fixes #2633
- Add RED.view.DEBUG_SYNC_REDRAW to disable requestAnimationFrame References #2631
- Fix up subflow port wiring
- Ensure groups are removed when deleting subflows
- Get group order right in history events to ensure proper handling
- Prevent wiring to node with no corresponding port Fixes #2641
- Avoid copying duplicate nodes to internal clipboard
- Fix connecting wires to subflow status or io ports on touchscreen Fixes #2637
Runtime
- Authenticate websocket comms using user-provided token if present Fixes #2642
Nodes
- Delay: add words about independence of messages being delayed.
- Debug: fix debug status to not loop, make migration more seamless, detect status type objects #2638
- Debug: Update Japanese message for debug node #2645 (@kazuhitoyokoi)
### 1.1.0: Milestone Release
Editor
- Align node labels on FF
- Fix node toggle button initial opacity
- Make color/icon/label-pos pickers keyboard navigable
- Default group label to be shown and improve toggle button
- Fix clearing group label
- Remove hardcoded css Fixes #2603
- Fix node button mouse pointer css
- Change node linebreak handling to use "\n "
- Handle import of node with non-default number of outputs
- Improve display of focussed form element
- Fix typedInput error on empty subflow input types #2624 (@HiroyasuNishiyama)
- Update JP message catalogue for subflow input type #2471 (@HiroyasuNishiyama)
- Outliner - add empty item when last config node moved
- Update zh-CN/zh-TW translations #2626 (@JiyeYu)
- Add default shortcut for `core:show-help-tab`
- Clear outline focus on config node sidebar panel
- Tweak group margin to fit node status and look better
- Fix reparenting nodes in outliner when they change
Runtime
- Add developer options - permits npm run build-dev #2628 (@Steve-Mcl)
Nodes
- Add example flows for lots of core nodes #2585 #2550 #2549 (@HiroyasuNishiyama)
- TCP: Fix tcp in node finishing packets when in streaming base64 receive mode.
- Join: Clear timeout when msg.reset received Fixes #2471
- Switch: JSONata expr does not require msg.parts.count
- Inject: fix backwards migration of inject without topic
#### 1.1.0-beta.3: Beta Release
Editor
- Fix wiring nodes from input back to output
- Fix sometimes unable to keyboard-move group to left/up
- Fix group position in outliner
- Handle unknown nodes with no icon
- Prevent node creep when switching tabs
#### 1.1.0-beta.2: Beta Release
Editor
- Add UI tests to travis build #2593 #2616 #2617 #2619 (@kazuhitoyokoi)
- Add Japanese translations for outliner, jsonata and runtime #2618 (@kazuhitoyokoi)
- Fix deleting node in group after changing selection
- Fixup padding of quick-add search box
- Move config nodes under type-level hierarchy in outline
- Emit nodes:change event for config node users list modified
- Increase group margin to avoid clash with status text
- Fix event order when quick-adding node to group
- Switch RED.events.DEBUG messages to warn to get stacktraces
- Fix empty item handling for subflows/config in outliner
- Fix search indexing of group nodes
- Avoid regenerating every node label on redraw
- Fix handling of multi-line node label
- Disable merge group menu for single item or non-group item #2611 (@HiroyasuNishiyama)
- Merge pull request #2609 from node-red-hitachi/fix-remove-from-group
- Fix position of empty group with multi-line label #2612 (@HiroyasuNishiyama)
- Make treelist of subflow/config nodes initially have empty placeholder
- Fix empty placeholder not shown on remove from group #2609 (@HiroyasuNishiyama)
- Prevent conversion of circular structure #2607 (@HiroyasuNishiyama)
- Handle null status text in the editor Fixes #2606
- Massively reduce our dependency on d3 to render the view
- EditableList/TreeList - defer adding elements to DOM
- Prevent RED.stop being called multiple times if >1 signal received
- Flag a node as removed when it is disabled
- Some performance improvements for TreeList
- Resize info/help sidebars whenever sidebar is opened
- Add search defaults to outliner searchBox
- Add search presets option to searchBox widget
- Add RED.popover.menu as a new type of menu widget
- Add support for is:XYZ search flags
- Track subflow instances on the subflow node itself
- Refresh outline filter whenever something changes Fixes #2601
- Fix Help tab search box appearance
- Rename Node Information to Information in sidebar
- Do a sync-redraw after clearing to ensure clean state
- Make catch/status/complete/link filter case-insensitive
- Add 'add' option to touch radialMenu for quick-add dialog
- Merge branch 'dev' of https://github.com/node-red/node-red into dev
- ensure trigger node detects changes to number of outputs
- Ignore whitespace when checking function setup/close code
- Preserve event handlers when moving outliner items
- Add tooltips to outliner buttons
- Only validate nodes once they have all been imported
- Ensure configNode.users is updated properly on import
Runtime
- Bump node-red-admin 0.2.6
Nodes
- WebSocket: Prevent charAt call on websocket listener #2610 ()
- Debug: fix status to migrate old nodes to correct default mode.
- Link: Fix Link node filter Fixes #2600
#### 1.1.0-beta.1: Beta Release
Runtime

View File

@@ -20,11 +20,16 @@ var sass = require("node-sass");
module.exports = function(grunt) {
var nodemonArgs = ["-v"];
var nodemonArgs = ["-V"];
var flowFile = grunt.option('flowFile');
if (flowFile) {
nodemonArgs.push(flowFile);
}
var userDir = grunt.option('userDir');
if (userDir) {
nodemonArgs.push("-u");
nodemonArgs.push(userDir);
}
var browserstack = grunt.option('browserstack');
if (browserstack) {
@@ -47,8 +52,8 @@ module.exports = function(grunt) {
ui: 'bdd',
reporter: 'spec'
},
all: { src: ['test/**/*_spec.js'] },
core: { src: ["test/_spec.js","test/unit/**/*_spec.js"]},
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
nodes: { src: ["test/nodes/**/*_spec.js"]}
},
webdriver: {
@@ -56,19 +61,19 @@ module.exports = function(grunt) {
configFile: 'test/editor/wdio.conf.js'
}
},
mocha_istanbul: {
nyc: {
options: {
globals: ['expect'],
timeout: 3000,
ignoreLeaks: false,
ui: 'bdd',
reportFormats: ['lcov','html'],
print: 'both',
istanbulOptions: ['--no-default-excludes', '-i','**/packages/node_modules/**']
cwd: '.',
include: ['packages/node_modules/**'],
excludeNodeModules: false,
exclude: ['packages/node_modules/@node-red/editor-client/**'],
reporter: ['lcov', 'html','text-summary'],
reportDir: 'coverage',
all: true
},
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
nodes: { src: ["test/nodes/**/*_spec.js"]}
all: { cmd: false, args: ['grunt', 'simplemocha:all'] },
core: { options: { exclude:['packages/node_modules/@node-red/editor-client/**', 'packages/node_modules/@node-red/nodes/**']},cmd: false, args: ['grunt', 'simplemocha:core'] },
nodes: { cmd: false, args: ['grunt', 'simplemocha:nodes'] }
},
jshint: {
options: {
@@ -452,6 +457,7 @@ module.exports = function(grunt) {
'packages/node_modules/@node-red/runtime/lib/index.js',
'packages/node_modules/@node-red/runtime/lib/api/*.js',
'packages/node_modules/@node-red/runtime/lib/events.js',
'packages/node_modules/@node-red/runtime/lib/hooks.js',
'packages/node_modules/@node-red/util/**/*.js',
'packages/node_modules/@node-red/editor-api/lib/index.js',
'packages/node_modules/@node-red/editor-api/lib/auth/index.js'
@@ -502,12 +508,10 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-chmod');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.loadNpmTasks('grunt-mocha-istanbul');
if (fs.existsSync(path.join("node_modules", "grunt-webdriver"))) {
grunt.loadNpmTasks('grunt-webdriver');
}
@@ -515,6 +519,26 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
grunt.loadNpmTasks('grunt-npm-command');
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-simple-nyc');
grunt.registerMultiTask('nodemon', 'Runs a nodemon monitor of your node.js server.', function () {
const nodemon = require('nodemon');
this.async();
const options = this.options();
options.script = this.data.script;
let callback;
if (options.callback) {
callback = options.callback;
delete options.callback;
} else {
callback = function(nodemonApp) {
nodemonApp.on('log', function (event) {
console.log(event.colour);
});
};
}
callback(nodemon(options));
});
grunt.registerMultiTask('attachCopyright', function() {
var files = this.data.src;
@@ -596,11 +620,11 @@ module.exports = function(grunt) {
grunt.registerTask('default',
'Builds editor content then runs code style checks and unit tests on all components',
['build','verifyPackageDependencies','jshint:editor','mocha_istanbul:all']);
['build','verifyPackageDependencies','jshint:editor','nyc:all']);
grunt.registerTask('test-core',
'Runs code style check and unit tests on core runtime code',
['build','mocha_istanbul:core']);
['build','nyc:core']);
grunt.registerTask('test-editor',
'Runs code style check on editor code',
@@ -618,12 +642,16 @@ module.exports = function(grunt) {
grunt.registerTask('test-nodes',
'Runs unit tests on core nodes',
['build','mocha_istanbul:nodes']);
['build','nyc:nodes']);
grunt.registerTask('build',
'Builds editor content',
['clean:build','jsonlint','concat:build','concat:vendor','copy:build','uglify:build','sass:build','attachCopyright']);
grunt.registerTask('build-dev',
'Developer mode: build dev version',
['clean:build','concat:build','concat:vendor','copy:build','sass:build','setDevEnv']);
grunt.registerTask('dev',
'Developer mode: run node-red, watch for source changes and build/restart',
['build','setDevEnv','concurrent:dev']);
@@ -639,7 +667,7 @@ module.exports = function(grunt) {
grunt.registerTask('coverage',
'Run Istanbul code test coverage task',
['build','mocha_istanbul:all']);
['build','nyc:all']);
grunt.registerTask('docs',
'Generates API documentation',

View File

@@ -1,4 +1,4 @@
Copyright JS Foundation and other contributors, http://js.foundation
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
Apache License
Version 2.0, January 2004

View File

@@ -67,4 +67,4 @@ It was created by [IBM Emerging Technology](https://www.ibm.com/blogs/emerging-t
## Copyright and license
Copyright JS Foundation and other contributors, https://openjsf.org under [the Apache 2.0 license](LICENSE).
Copyright OpenJS Foundation and other contributors, https://openjsf.org under [the Apache 2.0 license](LICENSE).

View File

@@ -1,13 +1,5 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 1.0.0 | :white_check_mark: |
| 0.20.x | :white_check_mark: |
## Reporting a Vulnerability
Please report any potential security issues to `team@nodered.org`. This will notify the core project team who will respond accordingly.

View File

@@ -1,6 +1,6 @@
{
"name": "node-red",
"version": "1.1.0-beta.1",
"version": "1.2.3",
"description": "Low-code programming for event-driven applications",
"homepage": "http://nodered.org",
"license": "Apache-2.0",
@@ -13,6 +13,8 @@
"start": "node packages/node_modules/node-red/red.js",
"test": "grunt",
"build": "grunt build",
"dev": "grunt dev",
"build-dev": "grunt build-dev",
"docs": "grunt docs"
},
"contributors": [
@@ -24,7 +26,8 @@
}
],
"dependencies": {
"ajv": "6.12.2",
"ajv": "6.12.6",
"async-mutex": "0.2.4",
"basic-auth": "2.0.1",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
@@ -43,24 +46,24 @@
"hash-sum": "2.0.0",
"https-proxy-agent": "5.0.0",
"i18next": "15.1.2",
"iconv-lite": "0.5.1",
"iconv-lite": "0.6.2",
"is-utf8": "0.2.1",
"js-yaml": "3.14.0",
"json-stringify-safe": "5.0.1",
"jsonata": "1.8.3",
"jsonata": "1.8.4",
"lodash.clonedeep": "^4.5.0",
"media-typer": "1.1.0",
"memorystore": "1.6.2",
"memorystore": "1.6.4",
"mime": "2.4.6",
"moment-timezone": "^0.5.31",
"mqtt": "2.18.8",
"mqtt": "4.2.4",
"multer": "1.4.2",
"mustache": "4.0.1",
"node-red-admin": "^0.2.5",
"node-red-admin": "^0.2.6",
"node-red-node-rbe": "^0.2.9",
"node-red-node-sentiment": "^0.1.6",
"node-red-node-tail": "^0.1.0",
"nopt": "4.0.3",
"nopt": "5.0.0",
"oauth2orize": "1.11.0",
"on-headers": "1.0.2",
"passport": "0.4.1",
@@ -69,7 +72,8 @@
"raw-body": "2.4.1",
"request": "2.88.0",
"semver": "6.3.0",
"uglify-js": "3.9.4",
"tar": "6.0.5",
"uglify-js": "3.11.4",
"when": "3.7.8",
"ws": "6.2.1",
"xml2js": "0.4.23"
@@ -78,40 +82,38 @@
"bcrypt": "3.0.8"
},
"devDependencies": {
"marked": "0.8.2",
"dompurify": "2.0.11",
"grunt": "~1.0.4",
"dompurify": "2.2.2",
"grunt": "1.3.0",
"grunt-chmod": "~1.1.1",
"grunt-cli": "~1.3.2",
"grunt-concurrent": "~2.3.1",
"grunt-concurrent": "3.0.0",
"grunt-contrib-clean": "~2.0.0",
"grunt-contrib-compress": "~1.5.0",
"grunt-contrib-compress": "1.6.0",
"grunt-contrib-concat": "~1.0.1",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-jshint": "~2.1.0",
"grunt-contrib-uglify": "~4.0.1",
"grunt-contrib-watch": "~1.1.0",
"grunt-jsdoc": "^2.2.1",
"grunt-jsdoc-to-markdown": "^4.0.0",
"grunt-jsonlint": "~2.0.0",
"grunt-jsdoc": "2.4.1",
"grunt-jsdoc-to-markdown": "5.0.0",
"grunt-jsonlint": "2.1.3",
"grunt-mkdir": "~1.0.0",
"grunt-mocha-istanbul": "5.0.2",
"grunt-nodemon": "~0.4.2",
"grunt-npm-command": "~0.1.2",
"grunt-sass": "~3.1.0",
"grunt-simple-mocha": "~0.4.1",
"grunt-simple-nyc": "^3.0.1",
"http-proxy": "1.18.1",
"istanbul": "0.4.5",
"jsdoc-nr-template": "github:node-red/jsdoc-nr-template",
"marked": "1.2.2",
"minami": "1.2.3",
"mocha": "^5.2.0",
"mosca": "^2.8.3",
"node-red-node-test-helper": "^0.2.5",
"node-sass": "^4.14.1",
"should": "^8.4.0",
"nodemon": "2.0.6",
"should": "13.2.3",
"sinon": "1.17.7",
"stoppable": "^1.1.0",
"supertest": "3.4.2"
"supertest": "5.0.0"
},
"engines": {
"node": ">=8"

View File

@@ -21,15 +21,17 @@ var flows = require("./flows");
var flow = require("./flow");
var context = require("./context");
var auth = require("../auth");
var info = require("./settings");
var apiUtil = require("../util");
module.exports = {
init: function(runtimeAPI) {
init: function(settings,runtimeAPI) {
flows.init(runtimeAPI);
flow.init(runtimeAPI);
nodes.init(runtimeAPI);
context.init(runtimeAPI);
info.init(settings,runtimeAPI);
var needsPermission = auth.needsPermission;
@@ -47,7 +49,14 @@ module.exports = {
// Nodes
adminApp.get("/nodes",needsPermission("nodes.read"),nodes.getAll,apiUtil.errorHandler);
adminApp.post("/nodes",needsPermission("nodes.write"),nodes.post,apiUtil.errorHandler);
if (!settings.editorTheme || !settings.editorTheme.palette || settings.editorTheme.palette.upload !== false) {
const multer = require('multer');
const upload = multer({ storage: multer.memoryStorage() });
adminApp.post("/nodes",needsPermission("nodes.write"),upload.single("tarball"),nodes.post,apiUtil.errorHandler);
} else {
adminApp.post("/nodes",needsPermission("nodes.write"),nodes.post,apiUtil.errorHandler);
}
adminApp.get(/^\/nodes\/messages/,needsPermission("nodes.read"),nodes.getModuleCatalogs,apiUtil.errorHandler);
adminApp.get(/^\/nodes\/((@[^\/]+\/)?[^\/]+\/[^\/]+)\/messages/,needsPermission("nodes.read"),nodes.getModuleCatalog,apiUtil.errorHandler);
adminApp.get(/^\/nodes\/((@[^\/]+\/)?[^\/]+)$/,needsPermission("nodes.read"),nodes.getModule,apiUtil.errorHandler);
@@ -67,6 +76,8 @@ module.exports = {
// adminApp.delete("/context/:scope(node|flow)/:id",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
adminApp.delete("/context/:scope(node|flow)/:id/*",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
adminApp.get("/settings",needsPermission("settings.read"),info.runtimeSettings,apiUtil.errorHandler);
return adminApp;
}
}

View File

@@ -45,8 +45,18 @@ module.exports = {
module: req.body.module,
version: req.body.version,
url: req.body.url,
tarball: undefined,
req: apiUtils.getRequestLogObject(req)
}
if (!runtimeAPI.settings.editorTheme || !runtimeAPI.settings.editorTheme.palette || runtimeAPI.settings.editorTheme.palette.upload !== false) {
if (req.file) {
opts.tarball = {
name: req.file.originalname,
size: req.file.size,
buffer: req.file.buffer
}
}
}
runtimeAPI.nodes.addModule(opts).then(function(info) {
res.json(info);
}).catch(function(err) {

View File

@@ -0,0 +1,72 @@
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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.
**/
var apiUtils = require("../util");
var runtimeAPI;
var settings;
var theme = require("../editor/theme");
var clone = require("clone");
var i18n = require("@node-red/util").i18n
function extend(target, source) {
var keys = Object.keys(source);
var i = keys.length;
while(i--) {
var value = source[keys[i]]
var type = typeof value;
if (type === 'string' || type === 'number' || type === 'boolean' || Array.isArray(value)) {
target[keys[i]] = value;
} else if (value === null) {
if (target.hasOwnProperty(keys[i])) {
delete target[keys[i]];
}
} else {
// Object
if (target.hasOwnProperty(keys[i])) {
target[keys[i]] = extend(target[keys[i]],value);
} else {
target[keys[i]] = value;
}
}
}
return target;
}
module.exports = {
init: function(_settings,_runtimeAPI) {
runtimeAPI = _runtimeAPI;
settings = _settings;
},
runtimeSettings: function(req,res) {
var opts = {
user: req.user
}
runtimeAPI.settings.getRuntimeSettings(opts).then(function(result) {
if (!settings.disableEditor) {
result.editorTheme = result.editorTheme||{};
var themeSettings = theme.settings();
if (themeSettings) {
// result.editorTheme may already exist with the palette
// disabled. Need to merge that into the receive settings
result.editorTheme = extend(clone(themeSettings),result.editorTheme);
}
result.editorTheme.languages = i18n.availableLanguages("editor");
}
res.json(result);
});
},
}

View File

@@ -123,38 +123,57 @@ AnonymousStrategy.prototype.authenticate = function(req) {
});
}
function authenticateUserToken(req) {
return new Promise( (resolve,reject) => {
var token = null;
var tokenHeader = Users.tokenHeader();
if (Users.tokenHeader() === null) {
// No custom user token provided. Fail the request
reject();
return;
} else if (Users.tokenHeader() === 'authorization') {
if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {
token = req.headers.authorization.split(' ')[1];
}
} else {
token = req.headers[Users.tokenHeader()];
}
if (token) {
Users.tokens(token).then(function(user) {
if (user) {
resolve(user);
} else {
reject();
}
});
} else {
reject();
}
});
}
function TokensStrategy() {
passport.Strategy.call(this);
this.name = 'tokens';
}
util.inherits(TokensStrategy, passport.Strategy);
TokensStrategy.prototype.authenticate = function(req) {
var self = this;
var token = null;
if (Users.tokenHeader() === 'authorization') {
if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') {
token = req.headers.authorization.split(' ')[1];
}
} else {
token = req.headers[Users.tokenHeader()];
}
if (token) {
Users.tokens(token).then(function(admin) {
if (admin) {
self.success(admin,{scope:admin.permissions});
} else {
self.fail(401);
}
});
} else {
self.fail(401);
}
authenticateUserToken(req).then(user => {
this.success(user,{scope:user.permissions});
}).catch(err => {
this.fail(401);
});
}
module.exports = {
bearerStrategy: bearerStrategy,
clientPasswordStrategy: clientPasswordStrategy,
passwordTokenExchange: passwordTokenExchange,
anonymousStrategy: new AnonymousStrategy(),
tokensStrategy: new TokensStrategy()
tokensStrategy: new TokensStrategy(),
authenticateUserToken: authenticateUserToken
}

View File

@@ -14,15 +14,7 @@
* limitations under the License.
**/
function generateToken(length) {
var c = "ABCDEFGHIJKLMNOPQRSTUZWXYZabcdefghijklmnopqrstuvwxyz1234567890";
var token = [];
for (var i=0;i<length;i++) {
token.push(c[Math.floor(Math.random()*c.length)]);
}
return token.join("");
}
const crypto = require("crypto");
var storage;
var sessionExpiryTime
@@ -115,7 +107,7 @@ module.exports = {
},
create: function(user,client,scope) {
return loadSessions().then(function() {
var accessToken = generateToken(128);
var accessToken = crypto.randomBytes(128).toString('base64');
var accessTokenExpiresAt = Date.now() + (sessionExpiryTime*1000);

View File

@@ -61,7 +61,7 @@ var api = {
authenticate: authenticate,
default: getDefaultUser,
tokens: getDefaultUser,
tokenHeader: "authorization"
tokenHeader: null
}
function init(config) {
@@ -111,6 +111,8 @@ function init(config) {
api.tokens = config.tokens;
if (config.tokenHeader && typeof config.tokenHeader === "string") {
api.tokenHeader = config.tokenHeader.toLowerCase();
} else {
api.tokenHeader = "authorization";
}
}
}

View File

@@ -16,11 +16,13 @@
var ws = require("ws");
var url = require("url");
const crypto = require("crypto");
var log = require("@node-red/util").log; // TODO: separate module
var Tokens;
var Users;
var Permissions;
var Strategies;
var server;
var settings;
@@ -44,6 +46,7 @@ function init(_server,_settings,_runtimeAPI) {
Tokens.onSessionExpiry(handleSessionExpiry);
Users = require("../auth/users");
Permissions = require("../auth/permissions");
Strategies = require("../auth/strategies");
}
function handleSessionExpiry(session) {
@@ -54,26 +57,19 @@ function handleSessionExpiry(session) {
}
})
}
function generateSession(length) {
var c = "ABCDEFGHIJKLMNOPQRSTUZWXYZabcdefghijklmnopqrstuvwxyz1234567890";
var token = [];
for (var i=0;i<length;i++) {
token.push(c[Math.floor(Math.random()*c.length)]);
}
return token.join("");
}
function CommsConnection(ws) {
this.session = generateSession(32);
function CommsConnection(ws, user) {
this.session = crypto.randomBytes(32).toString('base64');
this.ws = ws;
this.stack = [];
this.user = null;
this.user = user;
this.lastSentTime = 0;
var self = this;
log.audit({event: "comms.open"});
log.trace("comms.open "+self.session);
var pendingAuth = (settings.adminAuth != null);
var preAuthed = !!user;
var pendingAuth = !this.user && (settings.adminAuth != null);
if (!pendingAuth) {
addActiveConnection(self);
@@ -130,8 +126,16 @@ function CommsConnection(ws) {
}
});
} else {
log.audit({event: "comms.auth.fail"});
completeConnection(null,null,false);
Users.tokens(msg.auth).then(function(user) {
if (user) {
self.user = user;
log.audit({event: "comms.auth",user:self.user});
completeConnection(user.permissions,msg.auth,true);
} else {
log.audit({event: "comms.auth.fail"});
completeConnection(null,null,false);
}
});
}
});
} else {
@@ -191,8 +195,8 @@ function start() {
var commsPath = settings.httpAdminRoot || "/";
commsPath = (commsPath.slice(0,1) != "/" ? "/":"") + commsPath + (commsPath.slice(-1) == "/" ? "":"/") + "comms";
wsServer = new ws.Server({ noServer: true });
wsServer.on('connection',function(ws) {
var commsConnection = new CommsConnection(ws);
wsServer.on('connection',function(ws, request, user) {
var commsConnection = new CommsConnection(ws, user);
});
wsServer.on('error', function(err) {
log.warn(log._("comms.error-server",{message:err.toString()}));
@@ -201,8 +205,26 @@ function start() {
server.on('upgrade', function upgrade(request, socket, head) {
const pathname = url.parse(request.url).pathname;
if (pathname === commsPath) {
if (Users.tokenHeader() !== null && request.headers[Users.tokenHeader()]) {
// The user has provided custom token handling. For the websocket,
// the token could be provided in two ways:
// - as an http header (only possible with a reverse proxy setup)
// - passed over the connected websock in an auth packet
// If the header is present, verify the token. If not, use the auth
// packet over the connected socket
//
Strategies.authenticateUserToken(request).then(user => {
wsServer.handleUpgrade(request, socket, head, function done(ws) {
wsServer.emit('connection', ws, request, user);
});
}).catch(err => {
log.audit({event: "comms.auth.fail"});
socket.destroy();
})
return
}
wsServer.handleUpgrade(request, socket, head, function done(ws) {
wsServer.emit('connection', ws, request);
wsServer.emit('connection', ws, request, null);
});
}
// Don't destroy the socket as other listeners may want to handle the

View File

@@ -103,7 +103,7 @@ module.exports = {
editorApp.get('/credentials/:type/:id', needsPermission("credentials.read"),credentials.get,apiUtil.errorHandler);
// Settings
editorApp.get("/settings",needsPermission("settings.read"),info.runtimeSettings,apiUtil.errorHandler);
// Main /settings route is an admin route - see lib/admin/settings.js
// User Settings
editorApp.get("/settings/user",needsPermission("settings.read"),info.userSettings,apiUtil.errorHandler);
// User Settings

View File

@@ -137,6 +137,7 @@ module.exports = {
req.body.hasOwnProperty('description') ||
req.body.hasOwnProperty('dependencies')||
req.body.hasOwnProperty('summary') ||
req.body.hasOwnProperty('version') ||
req.body.hasOwnProperty('files') ||
req.body.hasOwnProperty('git')) {
runtimeAPI.projects.updateProject(opts).then(function() {

View File

@@ -16,56 +16,12 @@
var apiUtils = require("../util");
var runtimeAPI;
var sshkeys = require("./sshkeys");
var theme = require("./theme");
var clone = require("clone");
var i18n = require("@node-red/util").i18n
function extend(target, source) {
var keys = Object.keys(source);
var i = keys.length;
while(i--) {
var value = source[keys[i]]
var type = typeof value;
if (type === 'string' || type === 'number' || type === 'boolean' || Array.isArray(value)) {
target[keys[i]] = value;
} else if (value === null) {
if (target.hasOwnProperty(keys[i])) {
delete target[keys[i]];
}
} else {
// Object
if (target.hasOwnProperty(keys[i])) {
target[keys[i]] = extend(target[keys[i]],value);
} else {
target[keys[i]] = value;
}
}
}
return target;
}
module.exports = {
init: function(_runtimeAPI) {
runtimeAPI = _runtimeAPI;
sshkeys.init(runtimeAPI);
},
runtimeSettings: function(req,res) {
var opts = {
user: req.user
}
runtimeAPI.settings.getRuntimeSettings(opts).then(function(result) {
result.editorTheme = result.editorTheme||{};
var themeSettings = theme.settings();
if (themeSettings) {
// result.editorTheme may already exist with the palette
// disabled. Need to merge that into the receive settings
result.editorTheme = extend(clone(themeSettings),result.editorTheme);
}
result.editorTheme.languages = i18n.availableLanguages("editor");
res.json(result);
});
},
userSettings: function(req, res) {
var opts = {
user: req.user

View File

@@ -99,7 +99,7 @@ function init(settings,_server,storage,runtimeAPI) {
adminApp.use(corsHandler);
}
var adminApiApp = require("./admin").init(runtimeAPI);
var adminApiApp = require("./admin").init(settings, runtimeAPI);
adminApp.use(adminApiApp);
} else {
adminApp = null;

View File

@@ -43,6 +43,10 @@ module.exports = {
rejectHandler: function(req,res,err) {
//TODO: why this when errorHandler also?!
log.audit({event: "api.error",error:err.code||"unexpected_error",message:err.message||err.toString()},req);
if (!err.code) {
// by definition, an unexpected_error to log
log.error(err);
}
var response = {
code: err.code||"unexpected_error",
message: err.message||err.toString()

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-api",
"version": "1.1.0-beta.1",
"version": "1.2.3",
"license": "Apache-2.0",
"main": "./lib/index.js",
"repository": {
@@ -16,16 +16,17 @@
}
],
"dependencies": {
"@node-red/util": "1.1.0-beta.1",
"@node-red/editor-client": "1.1.0-beta.1",
"@node-red/util": "1.2.3",
"@node-red/editor-client": "1.2.3",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"clone": "2.1.2",
"cors": "2.8.5",
"express-session": "1.17.1",
"express": "4.17.1",
"memorystore": "1.6.2",
"memorystore": "1.6.4",
"mime": "2.4.6",
"multer": "1.4.2",
"mustache": "4.0.1",
"oauth2orize": "1.11.0",
"passport-http-bearer": "1.0.1",

View File

@@ -20,7 +20,10 @@
"fill": "Fill",
"label": "Label",
"color": "Color",
"position": "Position"
"position": "Position",
"enable": "Enable",
"disable": "Disable",
"upload": "Upload"
},
"type": {
"string": "string",
@@ -39,7 +42,8 @@
"loadNodeCatalogs": "Loading Node catalogs",
"loadNodes": "Loading Nodes __count__",
"loadFlows": "Loading Flows",
"importFlows": "Adding Flows to workspace"
"importFlows": "Adding Flows to workspace",
"importError": "<p>Error adding flows</p><p>__message__</p>"
},
"workspace": {
"defaultName": "Flow __number__",
@@ -195,6 +199,8 @@
"flow_plural": "__count__ flows",
"subflow": "__count__ subflow",
"subflow_plural": "__count__ subflows",
"replacedNodes": "__count__ node replaced",
"replacedNodes_plural": "__count__ nodes replaced",
"pasteNodes": "Paste flow json or",
"selectFile": "select a file to import",
"importNodes": "Import nodes",
@@ -202,6 +208,8 @@
"download": "Download",
"importUnrecognised": "Imported unrecognised type:",
"importUnrecognised_plural": "Imported unrecognised types:",
"importDuplicate": "Imported duplicate node:",
"importDuplicate_plural": "Imported duplicate nodes:",
"nodesExported": "Nodes exported to clipboard",
"nodesImported": "Imported:",
"nodeCopied": "__count__ node copied",
@@ -210,6 +218,9 @@
"groupCopied_plural": "__count__ groups copied",
"groupStyleCopied": "Group style copied",
"invalidFlow": "Invalid flow: __message__",
"recoveredNodes": "Recovered Nodes",
"recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.",
"recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>",
"export": {
"selected":"selected nodes",
"current":"current flow",
@@ -224,13 +235,19 @@
},
"import": {
"import": "Import to",
"importSelected": "Import selected",
"importCopy": "Import copy",
"viewNodes": "View nodes...",
"newFlow": "new flow",
"replace": "replace",
"errors": {
"notArray": "Input not a JSON Array",
"itemNotObject": "Input not a valid flow - item __index__ not a node object",
"missingId": "Input not a valid flow - item __index__ missing 'id' property",
"missingType": "Input not a valid flow - item __index__ missing 'type' property"
}
},
"conflictNotification1": "Some of the nodes you are importing already exist in your workspace.",
"conflictNotification2": "Select which nodes to import and whether to replace the existing nodes, or to import a copy of them."
},
"copyMessagePath": "Path copied",
"copyMessageValue": "Value copied",
@@ -367,6 +384,7 @@
"locale": "Select UI Language",
"icon": "Icon",
"inputType": "Input type",
"selectType": "select types...",
"inputs" : {
"input": "input",
"select": "select",
@@ -529,6 +547,8 @@
"sortAZ": "a-z",
"sortRecent": "recent",
"more": "+ __count__ more",
"upload": "Upload module tgz file",
"refresh": "Refresh module list",
"errors": {
"catalogLoadFailed": "<p>Failed to load node catalogue.</p><p>Check the browser console for more information</p>",
"installFailed": "<p>Failed to install: __module__</p><p>__message__</p><p>Check the log for more information</p>",
@@ -564,7 +584,7 @@
},
"sidebar": {
"info": {
"name": "Node information",
"name": "Information",
"tabName": "Name",
"label": "info",
"node": "Node",
@@ -595,7 +615,16 @@
"showTips":"You can open the tips from the settings panel",
"outline": "Outline",
"empty": "empty",
"globalConfig": "Global Configuration Nodes"
"globalConfig": "Global Configuration Nodes",
"triggerAction": "Trigger action",
"find": "Find in workspace",
"search": {
"configNodes": "Configuration nodes",
"unusedConfigNodes": "Unused configuration nodes",
"invalidNodes": "Invalid nodes",
"uknownNodes": "Unknown nodes",
"unusedSubflows": "Unused subflows"
}
},
"help": {
"name": "Help",
@@ -696,6 +725,12 @@
"committerTip": "Leave blank to use system default",
"userName": "Username",
"email": "Email",
"workflow": "Workflow",
"workfowTip": "Choose your preferred git workflow",
"workflowManual": "Manual",
"workflowManualTip": "All changes must be manually committed under the 'history' sidebar",
"workflowAuto": "Automatic",
"workflowAutoTip": "Changes are committed automatically with every deploy",
"sshKeys": "SSH Keys",
"sshKeysTip": "Allows you to create secure connections to remote git repositories.",
"add": "add key",

View File

@@ -20,7 +20,10 @@
"fill": "塗りつぶし",
"label": "ラベル",
"color": "色",
"position": "配置"
"position": "配置",
"enable": "有効",
"disable": "無効",
"upload": "アップロード"
},
"type": {
"string": "文字列",
@@ -39,7 +42,8 @@
"loadNodeCatalogs": "ノードカタログを読み込み中",
"loadNodes": "ノードを読み込み中 __count__",
"loadFlows": "フローを読み込み中",
"importFlows": "ワークスペースにフローを追加中"
"importFlows": "ワークスペースにフローを追加中",
"importError": "<p>フロー追加エラー</p><p>__message__</p>"
},
"workspace": {
"defaultName": "フロー __number__",
@@ -195,13 +199,17 @@
"flow_plural": "__count__ 個のフロー",
"subflow": "__count__ 個のサブフロー",
"subflow_plural": "__count__ 個のサブフロー",
"pasteNodes": "JSON形式のフローデータを貼り付けてください",
"selectFile": "読み込むファイルを選択してください",
"importNodes": "フローをクリップボートから読み込み",
"replacedNodes": "置換された __count__ 個のノード",
"replacedNodes_plural": "置換された __count__ 個のノード",
"pasteNodes": "JSON形式のフローデータを貼り付け",
"selectFile": "読み込むファイルを選択",
"importNodes": "フローをクリップボードから読み込み",
"exportNodes": "フローをクリップボードへ書き出し",
"download": "ダウンロード",
"importUnrecognised": "認識できない型が読み込まれました:",
"importUnrecognised_plural": "認識できない型が読み込まれました:",
"importDuplicate": "重複したノードを読み込みました:",
"importDuplicate_plural": "重複したノードを読み込みました:",
"nodesExported": "クリップボードへフローを書き出しました",
"nodesImported": "読み込みました:",
"nodeCopied": "__count__ 個のノードをコピーしました",
@@ -210,6 +218,9 @@
"groupCopied_plural": "__count__ 個のグループをコピーしました",
"groupStyleCopied": "グループの形式をコピーしました",
"invalidFlow": "不正なフロー: __message__",
"recoveredNodes": "復旧したノード",
"recoveredNodesInfo": "このフロー内のードは読み込み時に、有効なフローIDがありませんでした。これらフローIDは、フローに追加されているため、復元または削除できます。",
"recoveredNodesNotification": "<p>有効なフローIDを持たないードが読み込まれました</p><p>これらノードは '__flowName__' という新しいフローへ追加されました。</p>",
"export": {
"selected": "選択したフロー",
"current": "現在のタブ",
@@ -224,13 +235,19 @@
},
"import": {
"import": "読み込み先",
"importSelected": "選択したノードを読み込み",
"importCopy": "コピーを読み込み",
"viewNodes": "ノードを参照...",
"newFlow": "新規のタブ",
"replace": "置換",
"errors": {
"notArray": "JSON形式の配列ではありません",
"itemNotObject": "不正なフロー - __index__ 番目の要素はノードオブジェクトではありません",
"missingId": "不正なフロー - __index__ 番目の要素に'id'プロパティがありません",
"missingType": "不正なフロー - __index__ 番目の要素に'type'プロパティがありません"
}
},
"conflictNotification1": "読み込もうとしているノードのいくつかは、既にワークスペース内に存在しています。",
"conflictNotification2": "読み込むノードを選択し、また既存のノードを置き換えるか、もしくはそれらのコピーを読み込むかも選択してください。"
},
"copyMessagePath": "パスをコピーしました",
"copyMessageValue": "値をコピーしました",
@@ -367,6 +384,7 @@
"locale": "UI言語の選択",
"icon": "記号",
"inputType": "入力形式",
"selectType": "形式選択...",
"inputs": {
"input": "入力",
"select": "メニュー",
@@ -529,6 +547,8 @@
"sortAZ": "辞書順",
"sortRecent": "日付順",
"more": "+ さらに __count__ 個",
"upload": "モジュールのtgzファイルをアップロード",
"refresh": "モジュールリスト更新",
"errors": {
"catalogLoadFailed": "<p>ノードのカタログの読み込みに失敗しました。</p><p>詳細はブラウザのコンソールを確認してください。</p>",
"installFailed": "<p>追加処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>",
@@ -595,7 +615,16 @@
"showTips": "設定からヒントを表示できます",
"outline": "アウトライン",
"empty": "空",
"globalConfig": "グローバル設定ノード"
"globalConfig": "グローバル設定ノード",
"triggerAction": "アクションを実行",
"find": "ワークスペース内を検索",
"search": {
"configNodes": "設定ノード",
"unusedConfigNodes": "未使用の設定ノード",
"invalidNodes": "不正なノード",
"uknownNodes": "未知のノード",
"unusedSubflows": "未使用のサブフロー"
}
},
"help": {
"name": "ヘルプ",
@@ -696,6 +725,12 @@
"committerTip": "システムのデフォルトを使用する場合、空白のままにしてください",
"userName": "ユーザ名",
"email": "メールアドレス",
"workflow": "ワークフロー",
"workfowTip": "望ましいgitワークフローを選択してください",
"workflowManual": "手動",
"workflowManualTip": "全ての変更は「履歴」サイドバー内で手動でコミットする必要があります",
"workflowAuto": "自動",
"workflowAutoTip": "変更はデプロイの度に自動的にコミットされます",
"sshKeys": "SSH キー",
"sshKeysTip": "gitリポジトリへのセキュアな接続を作成できます。",
"add": "キーを追加",

View File

@@ -266,5 +266,9 @@
"$type": {
"args": "value",
"desc": "`value` の型を文字列として返します。もし `value` が未定義の場合、 `undefined` が返されます。"
},
"$moment": {
"args": "[str]",
"desc": "Momentライブラリを使用して日付オブジェクトを取得します。"
}
}

View File

@@ -14,7 +14,16 @@
"back": "后退",
"next": "下一个",
"clone": "克隆项目",
"cont": "继续"
"cont": "继续",
"style": "风格",
"line": "大纲",
"fill": "填充",
"label": "标签",
"color": "颜色",
"position": "位置",
"enable": "启用",
"disable": "禁用",
"upload": "上传"
},
"type": {
"string": "字符串",
@@ -28,11 +37,18 @@
"null": "空"
}
},
"event": {
"loadPalette": "加载控制板",
"loadNodeCatalogs": "加载节点目录",
"loadNodes": "加载 __count__ 个节点",
"loadFlows": "加载流程",
"importFlows": "往工作区中加载流程"
},
"workspace": {
"defaultName": "流程__number__",
"defaultName": "流程 __number__",
"editFlow": "编辑流程: __name__",
"confirmDelete": "确认删除",
"delete": "你确定删除 '__label__'?",
"delete": "你确定删除 __label__ ?",
"dropFlowHere": "把流程放到这里",
"addFlow": "添加流程",
"listFlows": "流程一览",
@@ -91,7 +107,12 @@
"projects-new": "新建",
"projects-open": "打开",
"projects-settings": "项目设定",
"showNodeLabelDefault": "显示新添加的节点的标签"
"showNodeLabelDefault": "显示新添加的节点的标签",
"groups": "组",
"groupSelection": "选择组",
"ungroupSelection": "取消选择组",
"groupMergeSelection": "合并选择",
"groupRemoveSelection": "从组中移除"
}
},
"actions": {
@@ -101,7 +122,7 @@
"zoom-in": "放大"
},
"user": {
"loggedInAs": "作为__name__登陆",
"loggedInAs": "作为 __name__ 登陆",
"username": "账号",
"password": "密码",
"login": "登陆",
@@ -127,13 +148,13 @@
"missing_flow_file": "<p>找不到项目流程文件。</p><p>该项目未配置流程文件。</p>",
"missing_package_file": "<p>找不到项目包文件。</p><p>项目缺少package.json文件。</p>",
"project_empty": "<p>该项目为空。</p><p>是否要创建一组默认的项目文件?<br/>否则,您将必须在编辑器外部手动将文件添加到项目中。</p>",
"project_not_found": "<p>未找到项目'__project__'。</p>",
"project_not_found": "<p>未找到项目 __project__ 。</p>",
"git_merge_conflict": "<p>自动合并更改失败。</p><p>修复未合并的冲突,然后提交结果。</p>"
},
"error": "<strong>错误</strong>: __message__",
"errors": {
"lostConnection": "丢失与服务器的连接,重新连接...",
"lostConnectionReconnect": "丢失与服务器的连接__time__秒后重新连接",
"lostConnectionReconnect": "丢失与服务器的连接, __time__ 秒后重新连接",
"lostConnectionTry": "现在尝试",
"cannotAddSubflowToItself": "无法向其自身添加子流程",
"cannotAddCircularReference": "无法添加子流程 - 循环引用",
@@ -167,14 +188,18 @@
"clipboard": {
"clipboard": "剪贴板",
"nodes": "节点",
"node": "__count__节点",
"node_plural": "__count__节点",
"configNode": "__count__配置节点",
"configNode_plural": "__count__配置节点",
"flow": "__count__流程",
"flow_plural": "__count__流程",
"subflow": "__count__流程",
"subflow_plural": "__count__流程",
"node": "__count__节点",
"node_plural": "__count__节点",
"configNode": "__count__配置节点",
"configNode_plural": "__count__配置节点",
"group": "__count__ 个组",
"group_plural": "__count__ 个组",
"flow": "__count__流程",
"flow_plural": "__count__流程",
"subflow": "__count__ 个子流程",
"subflow_plural": "__count__ 子流程",
"replacedNodes": "__count__ 个节点被置换",
"replacedNodes_plural": "__count__ 个节点被置换",
"pasteNodes": "在这里粘贴节点",
"selectFile": "选择要导入的文件",
"importNodes": "导入节点",
@@ -184,9 +209,15 @@
"importUnrecognised_plural": "导入了无法识别的类型:",
"nodesExported": "节点导出到了剪贴板",
"nodesImported": "导入:",
"nodeCopied": "已复制__count__个节点",
"nodeCopied_plural": "已复制__count__个节点",
"nodeCopied": "已复制 __count__ 个节点",
"nodeCopied_plural": "已复制 __count__ 个节点",
"groupCopied": "复制 __count__ 个组",
"groupCopied_plural": "已复制 __count__ 个groups",
"groupStyleCopied": "已复制组风格",
"invalidFlow": "无效的流程: __message__",
"recoveredNodes": "复原的节点",
"recoveredNodesInfo": "导入节点时此流上的节点缺少有效的流ID。 它们已被添加到此流中,您可以复原或删除它们。",
"recoveredNodesNotification": "<p>导入的节点缺少有效的流ID</p><p>已将它们添加到名为 '__flowName__'的新流中。</p>",
"export": {
"selected": "已选择的节点",
"current": "现在的节点",
@@ -201,13 +232,19 @@
},
"import": {
"import": "导入到",
"importSelected": "导入所选项",
"importCopy": "导入副本",
"viewNodes": "查看节点",
"newFlow": "新流程",
"replace": "置换",
"errors": {
"notArray": "输入的不是JSON数组",
"itemNotObject": "输入的流无效 - 项目__index__不是节点对象",
"itemNotObject": "输入的流无效 - 项目 __index__ 不是节点对象",
"missingId": "输入的流无效-项 __index__ 缺少'id'属性",
"missingType": "输入的流程无效-项__index__缺少'类型'属性"
}
"missingType": "输入的流程无效-项 __index__ 缺少'类型'属性"
},
"conflictNotification1": "您要导入的某些节点已经存在于工作空间中。",
"conflictNotification2": "选择要导入的节点,并确认要替换现有的节点还是导入它们的副本"
},
"copyMessagePath": "已复制路径",
"copyMessageValue": "已复制数值",
@@ -250,7 +287,7 @@
"conflictChecking": "检查是否可以自动合并更改",
"conflictAutoMerge": "此更改不包括冲突,可以自动合并",
"conflictManualMerge": "这些更改包括了在部署之前必须解决的冲突。",
"plusNMore": "+ __count__更多"
"plusNMore": "+ __count__ 更多"
}
},
"eventLog": {
@@ -287,11 +324,11 @@
"newVersionError": "新版本不包含有效的JSON"
},
"subflow": {
"editSubflowInstance": "编辑子流实例__name__",
"editSubflow": "编辑流程模板: __name__",
"editSubflowInstance": "编辑子流实例: __name__",
"editSubflow": "编辑流程模板 __name__",
"edit": "编辑流程模板",
"subflowInstances": "这个子流程模板有__count__个实例",
"subflowInstances_plural": "这个子流程模板有__count__个实例",
"subflowInstances": "这个子流程模板有 __count__ 个实例",
"subflowInstances_plural": "这个子流程模板有 __count__ 个实例",
"editSubflowProperties": "编辑属性",
"input": "输入:",
"output": "输出:",
@@ -308,17 +345,24 @@
"multipleInputsToSelection": "<strong>无法创建子流程</strong>: 多个输入到了选择"
}
},
"group": {
"editGroup": "编辑组: __name__",
"errors": {
"cannotCreateDiffGroups": "无法使用来自不同组的节点创建组",
"cannotAddSubflowPorts": "无法将子流程的端口添加到组"
}
},
"editor": {
"configEdit": "编辑",
"configAdd": "添加",
"configUpdate": "更新",
"configDelete": "删除",
"nodesUse": "__count__个节点使用此配置",
"nodesUse_plural": "__count__个节点使用此配置",
"addNewConfig": "添加新的__type__配置",
"editNode": "编辑__type__节点",
"editConfig": "编辑__type__配置",
"addNewType": "添加新的__type__节点",
"nodesUse": "__count__ 个节点使用此配置",
"nodesUse_plural": "__count__ 个节点使用此配置",
"addNewConfig": "添加新的 __type__ 配置",
"editNode": "编辑 __type__ 节点",
"editConfig": "编辑 __type__ 配置",
"addNewType": "添加新的 __type__ 节点",
"nodeProperties": "节点属性",
"label": "标签",
"color": "颜色",
@@ -337,6 +381,7 @@
"locale": "选择界面语言",
"icon": "图标",
"inputType": "输入类型",
"selectType": "选择类型...",
"inputs": {
"input": "输入",
"select": "选择",
@@ -351,7 +396,8 @@
"bool": "布尔",
"json": "JSON",
"bin": "buffer",
"env": "环境变量"
"env": "环境变量",
"cred": "证书"
},
"menu": {
"input": "输入",
@@ -381,7 +427,7 @@
"scope": "范围",
"unassigned": "未分配",
"global": "全局",
"workspace": "工作",
"workspace": "工作",
"selectAll": "选择所有节点",
"selectAllConnected": "选择所有连接的节点",
"addRemoveNode": "从选择中添加/删除节点",
@@ -460,33 +506,33 @@
"times": {
"seconds": "秒前",
"minutes": "分前",
"minutesV": "__count__分前",
"hoursV": "__count__小时前",
"hoursV_plural": "__count__小时前",
"daysV": "__count__天前",
"daysV_plural": "__count__天前",
"weeksV": "__count__周前",
"weeksV_plural": "__count__周前",
"monthsV": "__count__月前",
"monthsV_plural": "__count__月前",
"yearsV": "__count__年前",
"yearsV_plural": "__count__年前",
"yearMonthsV": "__y__年, __count__月前",
"yearMonthsV_plural": "__y__年, __count__月前",
"yearsMonthsV": "__y__年, __count__月前",
"yearsMonthsV_plural": "__y__年, __count__月前"
"minutesV": "__count__ 分前",
"hoursV": "__count__ 小时前",
"hoursV_plural": "__count__ 小时前",
"daysV": "__count__ 天前",
"daysV_plural": "__count__ 天前",
"weeksV": "__count__ 周前",
"weeksV_plural": "__count__ 周前",
"monthsV": "__count__ 月前",
"monthsV_plural": "__count__ 月前",
"yearsV": "__count__ 年前",
"yearsV_plural": "__count__ 年前",
"yearMonthsV": "__y__ 年, __count__ 月前",
"yearMonthsV_plural": "__y__ 年, __count__ 月前",
"yearsMonthsV": "__y__ 年, __count__ 月前",
"yearsMonthsV_plural": "__y__ 年, __count__ 月前"
},
"nodeCount": "__label__个节点",
"nodeCount_plural": "__label__个节点",
"moduleCount": "__count__个可用模块",
"moduleCount_plural": "__count__个可用模块",
"nodeCount": "__label__ 个节点",
"nodeCount_plural": "__label__ 个节点",
"moduleCount": "__count__ 个可用模块",
"moduleCount_plural": "__count__ 个可用模块",
"inuse": "使用中",
"enableall": "全部启用",
"disableall": "全部禁用",
"enable": "启用",
"disable": "禁用",
"remove": "移除",
"update": "更新至__version__版本",
"update": "更新至 __version__ 版本",
"updated": "已更新",
"install": "安装",
"installed": "已安装",
@@ -498,7 +544,8 @@
"sort": "排序:",
"sortAZ": "a-z顺序",
"sortRecent": "日期顺序",
"more": "增加__count__个",
"more": "增加 __count__ 个",
"upload": "上传模块tgz文件",
"errors": {
"catalogLoadFailed": "无法加载节点目录。<br>查看浏览器控制台了解更多信息",
"installFailed": "无法安装: __module__<br>__message__<br>查看日志了解更多信息",
@@ -539,6 +586,7 @@
"label": "信息",
"node": "节点",
"type": "类型",
"group": "组",
"module": "模组",
"id": "ID",
"status": "状态",
@@ -560,8 +608,30 @@
"subflowDesc": "子流程描述",
"nodeHelp": "节点帮助",
"none": "无",
"arrayItems": "__count__个项目",
"showTips": "您可以从设置面板启用提示信息"
"arrayItems": "__count__ 个项目",
"showTips": "您可以从设置面板启用提示信息",
"outline": "大纲",
"empty": "空的",
"globalConfig": "全局配置节点",
"triggerAction": "触发动作",
"find": "在工作区中查找",
"search": {
"configNodes": "配置节点",
"unusedConfigNodes": "未使用的配置节点",
"invalidNodes": "无效的节点",
"uknownNodes": "未知的节点",
"unusedSubflows": "未使用的子流程"
}
},
"help": {
"name": "帮助",
"label": "帮助",
"search": "搜索帮助",
"nodeHelp": "节点帮助",
"showHelp": "显示帮助",
"showInOutline": "在大纲中显示",
"showTopics": "显示主题",
"noHelp": "未选择帮助主题"
},
"config": {
"name": "配置节点",
@@ -614,9 +684,9 @@
"removeFromProject": "从项目中删除",
"addToProject": "添加到项目",
"files": "文件",
"package": "包",
"flow": "流程",
"credentials": "证书",
"package": "包",
"packageCreate": "保存更改后将创建文件",
"fileNotExist": "文件不存在",
"selectFile": "选择文件",
@@ -628,7 +698,7 @@
"changeTheEncryptionKey": "更改加密密钥",
"currentKey": "当前密钥",
"newKey": "新密钥",
"credentialsAlert": "这将删除所有现有证",
"credentialsAlert": "这将删除所有现有证",
"versionControl": "版本控制",
"branches": "分支",
"noBranches": "没有分支",
@@ -652,6 +722,12 @@
"committerTip": "保留空白以使用系统默认值",
"userName": "用户名",
"email": "电子邮件",
"workflow": "工作流",
"workfowTip": "选择您偏好的工作流",
"workflowManual": "手动",
"workflowManualTip": "所有更改都必须在“历史记录”侧边栏中手动提交",
"workflowAuto": "自动",
"workflowAutoTip": "每次部署后都会自动提交更改",
"sshKeys": "SSH密钥",
"sshKeysTip": "允许您创建到远程git存储库的安全连接。",
"add": "添加密钥",
@@ -668,7 +744,7 @@
"copyPublicKey": "将公钥复制到剪贴板",
"delete": "删除密钥",
"gitConfig": "Git配置",
"deleteConfirm": "您确定要删除SSH密钥__name__吗这不能被撤消。"
"deleteConfirm": "您确定要删除SSH密钥 __name__ 吗?这不能被撤消。"
},
"versionControl": {
"unstagedChanges": "未暂存的变更",
@@ -722,24 +798,24 @@
"pullChanges": "拉取更改",
"history": "历史",
"projectHistory": "项目历史",
"daysAgo": "__count__天前",
"daysAgo_plural": "__count__天前",
"hoursAgo": "__count__小时前",
"hoursAgo_plural": "__count__小时前",
"minsAgo": "__count__分钟前",
"minsAgo_plural": "__count__分钟前",
"daysAgo": "__count__ 天前",
"daysAgo_plural": "__count__ 天前",
"hoursAgo": "__count__ 小时前",
"hoursAgo_plural": "__count__ 小时前",
"minsAgo": "__count__ 分钟前",
"minsAgo_plural": "__count__ 分钟前",
"secondsAgo": "秒前",
"notTracking": "您的本地分支当前未跟踪一个远程分支。",
"statusUnmergedChanged": "您的仓库中有未合并的更改。您需要解决冲突并提交结果。",
"repositoryUpToDate": "您的仓库是最新的。",
"commitsAhead": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。",
"commitsAhead_plural": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。",
"commitsBehind": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。",
"commitsBehind_plural": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。",
"commitsAheadAndBehind1": "您的存储库落后远程仓库__count__次提交",
"commitsAheadAndBehind1_plural": "您的存储库落后远程仓库__count__次提交",
"commitsAheadAndBehind2": "领先远程仓库__count__次提交。",
"commitsAheadAndBehind2_plural": "领先远程仓库__count__次提交。",
"commitsAhead": "您的存储库领先远程仓库 __count__ 次提交。您现在可以推送这些提交。",
"commitsAhead_plural": "您的存储库领先远程仓库 __count__ 次提交。您现在可以推送这些提交。",
"commitsBehind": "您的存储库落后远程仓库 __count__ 次提交。您现在可以拉取这些提交。",
"commitsBehind_plural": "您的存储库落后远程仓库 __count__ 次提交。您现在可以拉取这些提交。",
"commitsAheadAndBehind1": "您的存储库落后远程仓库 __count__ 次提交",
"commitsAheadAndBehind1_plural": "您的存储库落后远程仓库 __count__ 次提交",
"commitsAheadAndBehind2": "领先远程仓库 __count__ 次提交。",
"commitsAheadAndBehind2_plural": "领先远程仓库 __count__ 次提交。",
"commitsAheadAndBehind3": "您必须先拉取远程提交,然后才能进行推送。",
"commitsAheadAndBehind3_plural": "您必须先拉取远程提交,然后才能进行推送。",
"refreshCommitHistory": "刷新提交历史",
@@ -757,7 +833,8 @@
"bin": "二进制流",
"date": "时间戳",
"jsonata": "表达式",
"env": "环境变量"
"env": "环境变量",
"cred": "证书"
}
},
"editableList": {
@@ -977,7 +1054,8 @@
"passphrase": "密码短语",
"retry": "重试",
"update-failed": "无法更新身份验证",
"unhandled": "未处理的错误响应"
"unhandled": "未处理的错误响应",
"host-key-verify-failed": "<p>主机密钥验证失败。</p><p>无法验证存储库主机密钥。请更新您的<code>known_hosts</code>文件,然后重试。</p>"
},
"create-branch-list": {
"invalid": "无效的分支",

View File

@@ -1,15 +1,15 @@
{
"$string": {
"args": "arg",
"desc": "通过以下的类型转换规则将参数*arg*转换成字符串:\n\n - 字符串不转换。\n -函数转换成空的字符串。\n - JSON的值无法用数字表示所以用无限大或者NaN非数表示。\n - 用JSON.stringify函数将其他值转换成JSON字符串。"
"desc": "通过以下的类型转换规则将参数 *arg* 转换成字符串:\n\n - 字符串不转换。\n -函数转换成空的字符串。\n - JSON的值无法用数字表示所以用无限大或者NaN非数表示。\n - 用 `JSON.stringify` 函数将其他值转换成JSON字符串。"
},
"$length": {
"args": "str",
"desc": "输出字符串str的字数。如果str不是字符串,抛出错误。"
"desc": "输出字符串 `str` 的字数。如果 `str` 不是字符串,抛出错误。"
},
"$substring": {
"args": "str, start[, length]",
"desc": "输出`start`位置后的的首次出现的包括`str`的子字符串。 如果`length`被指定,那么的字符串中将只包括前`length`个文字。如果`start`是负数则输出从`str`末尾开始的`length`个文字"
"desc": "输出 `start` 位置后的的首次出现的包括 `str` 的子字符串。 如果 `length` 被指定,那么的字符串中将只包括前 `length` 个文字。如果 `start` 是负数则输出从 `str` 末尾开始的 `length` 个文字"
},
"$substringBefore": {
"args": "str, chars",
@@ -17,11 +17,11 @@
},
"$substringAfter": {
"args": "str, chars",
"desc": "输出str中首次出现的chars之后的子字符串,如果str中不包括chars则输出str。"
"desc": "输出 `str` 中首次出现的 `chars` 之后的子字符串,如果 `str` 中不包括 `chars` 则输出 `str` 。"
},
"$uppercase": {
"args": "str",
"desc": "`将’str中的所有字母变为大写后输出。"
"desc": "将 `str` 中的所有字母变为大写后输出。"
},
"$lowercase": {
"args": "str",
@@ -29,27 +29,27 @@
},
"$trim": {
"args": "str",
"desc": "将以下步骤应用于`str`来去除所有空白文字并实现标准化。\n\n 将全部tab制表符、回车键、换行字符用空白代替。\n- 将连续的空白文字变成一个空白文字。\n- 消除开头和末尾的空白文字。\n\n如果`str`没有被指定(即在无输入参数的情况下调用本函数),将上下文的值作为`str`来使用。 如果`str` 不是字符串则抛出错误。"
"desc": "将以下步骤应用于 `str` 来去除所有空白文字并实现标准化。\n\n 将全部tab制表符、回车键、换行字符用空白代替。\n- 将连续的空白文字变成一个空白文字。\n- 消除开头和末尾的空白文字。\n\n如果 `str` 没有被指定(即在无输入参数的情况下调用本函数),将上下文的值作为 `str` 来使用。 如果 `str` 不是字符串则抛出错误。"
},
"$contains": {
"args": "str, pattern",
"desc": "字符串`str` 和 `pattern`匹配的话输出`true`,不匹配的情况下输出 `false`。 不指定`str`的情况下(比如用一个参数调用本函数时)、将上下文的值作为`str`来使用。参数 `pattern`可以为字符串或正则表达。"
"desc": "字符串 `str` 和 `pattern` 匹配的话输出 `true` ,不匹配的情况下输出 `false` 。 不指定 `str` 的情况下(比如用一个参数调用本函数时)、将上下文的值作为 `str` 来使用。参数 `pattern` 可以为字符串或正则表达。"
},
"$split": {
"args": "str[, separator][, limit]",
"desc": "将参数`str`分解成由子字符串组成的数组。 如果`str`不是字符串抛出错误。可以省略的参数 `separator`中指定字符串`str`的分隔符。分隔符可以是文字或正则表达式。在不指定`separator`的情况下、将分隔符看作空的字符串并把`str`拆分成由单个字母组成的数组。如果`separator`不是字符串则抛出错误。在可省略的参数`limit`中指定分割后的子字符串的最大个数。超出个数的子字符串将被舍弃。如果`limit`没有被指定,`str` 将不考虑子字符串的个数而将字符串完全分隔。如果`limit`是负数则抛出错误。"
"desc": "将参数 `str` 分解成由子字符串组成的数组。 如果 `str` 不是字符串抛出错误。可以省略的参数 `separator` 中指定字符串 `str` 的分隔符。分隔符可以是文字或正则表达式。在不指定 `separator` 的情况下、将分隔符看作空的字符串并把 `str` 拆分成由单个字母组成的数组。如果 `separator` 不是字符串则抛出错误。在可省略的参数 `limit` 中指定分割后的子字符串的最大个数。超出个数的子字符串将被舍弃。如果 `limit` 没有被指定,`str` 将不考虑子字符串的个数而将字符串完全分隔。如果 `limit` 是负数则抛出错误。"
},
"$join": {
"args": "array[, separator]",
"desc": "用可以省略的参数 `separator`来把多个字符串连接。如果`array`不是字符串则抛出错误。 如果没有指定`separator`,则用空字符串来连接字符(即字符串之间没有`separator`)。 如果`separator`不是字符则抛出错误。"
"desc": "用可以省略的参数 `separator` 来把多个字符串连接。如果 `array` 不是字符串则抛出错误。 如果没有指定 `separator` ,则用空字符串来连接字符(即字符串之间没有 `separator` )。 如果 `separator` 不是字符则抛出错误。"
},
"$match": {
"args": "str, pattern [, limit]",
"desc": "对字符串`str`使用正则表达式`pattern`并输出与`str`相匹配的部分信息。"
"desc": "对字符串 `str` 使用正则表达式 `pattern` 并输出与 `str` 相匹配的部分信息。"
},
"$replace": {
"args": "str, pattern, replacement [, limit]",
"desc": "在字符串`str`中搜索`pattern`并用`replacement`来替换。\n\n可选参数`limit`用来指定替换次数的上限。"
"desc": "在字符串 `str` 中搜索 `pattern` 并用 `replacement` 来替换。\n\n可选参数 `limit` 用来指定替换次数的上限。"
},
"$now": {
"args": "",
@@ -65,31 +65,31 @@
},
"$number": {
"args": "arg",
"desc": "用下述的规则将参数 `arg`转换为数值。:\n\n 数值不做转换。\n 将字符串中合法的JSON数値表示转换成数値。\n 其他形式的值则抛出错误。"
"desc": "用下述的规则将参数 `arg` 转换为数值。:\n\n 数值不做转换。\n 将字符串中合法的JSON数値表示转换成数値。\n 其他形式的值则抛出错误。"
},
"$abs": {
"args": "number",
"desc": "输出参数`number`的绝对值。"
"desc": "输出参数 `number` 的绝对值。"
},
"$floor": {
"args": "number",
"desc": "输出比`number`的值小的最大整数。"
"desc": "输出比 `number` 的值小的最大整数。"
},
"$ceil": {
"args": "number",
"desc": "输出比`number`的值大的最小整数。"
"desc": "输出比 `number` 的值大的最小整数。"
},
"$round": {
"args": "number [, precision]",
"desc": "输出四舍五入后的参数`number`。可省略的参数 `precision`指定四舍五入后小数点下的位数。"
"desc": "输出四舍五入后的参数 `number` 。可省略的参数 `precision` 指定四舍五入后小数点下的位数。"
},
"$power": {
"args": "base, exponent",
"desc": "输出底数`base``exponent`次幂。"
"desc": "输出底数 `base``exponent` 次幂。"
},
"$sqrt": {
"args": "number",
"desc": "输出参数 `number`的平方根。"
"desc": "输出参数 `number` 的平方根。"
},
"$random": {
"args": "",
@@ -97,35 +97,35 @@
},
"$millis": {
"args": "",
"desc": "返回从UNIX时间 (1970年1月1日 UTC/GMT的午夜开始到现在的毫秒数。在同一个表达式的测试中所有对`$millis()`的调用将会返回相同的值。"
"desc": "返回从UNIX时间 (1970年1月1日 UTC/GMT的午夜开始到现在的毫秒数。在同一个表达式的测试中所有对 `$millis()` 的调用将会返回相同的值。"
},
"$sum": {
"args": "array",
"desc": "输出数组`array`的总和。如果`array`不是数值则抛出错误。"
"desc": "输出数组 `array` 的总和。如果 `array` 不是数值则抛出错误。"
},
"$max": {
"args": "array",
"desc": "输出数组`array`的最大值。如果`array`不是数值则抛出错误。"
"desc": "输出数组 `array` 的最大值。如果 `array` 不是数值则抛出错误。"
},
"$min": {
"args": "array",
"desc": "输出数组`array`的最小值。如果`array`不是数值则抛出错误。。"
"desc": "输出数组 `array` 的最小值。如果 `array` 不是数值则抛出错误。。"
},
"$average": {
"args": "array",
"desc": "输出数组`array`的平均数。如果`array`不是数值则抛出错误。。"
"desc": "输出数组 `array` 的平均数。如果 `array` 不是数值则抛出错误。。"
},
"$boolean": {
"args": "arg",
"desc": "用下述规则将数据转换成布尔值。:\n\n - 不转换布尔值`Boolean`。\n 将空的字符串`string`转换为`false`\n 将不为空的字符串`string`转换为`true`\n 将为0的数字`number`转换成`false`\n 将不为0的数字`number`转换成`true`\n –将`null`转换成`false`\n –将空的数组`array`转换成`false`\n –如果数组`array`中含有可以转换成`true`的要素则转换成`true`\n –如果`array`中没有可转换成`true`的要素则转换成`false`\n 空的对象`object`转换成`false`\n 非空的对象`object`转换成`true`\n –将函数`function`转换成`false`"
"desc": "用下述规则将数据转换成布尔值。:\n\n - 不转换布尔值 `Boolean` 。\n 将空的字符串 `string` 转换为 `false` \n 将不为空的字符串 `string` 转换为 `true` \n 将为0的数字 `number` 转换成 `false` \n 将不为0的数字 `number` 转换成 `true` \n –将 `null` 转换成 `false` \n –将空的数组 `array` 转换成 `false` \n –如果数组 `array` 中含有可以转换成 `true` 的要素则转换成 `true` \n –如果 `array` 中没有可转换成 `true` 的要素则转换成 `false` \n 空的对象 `object` 转换成 `false` \n 非空的对象 `object` 转换成 `true` \n –将函数 `function` 转换成 `false` "
},
"$not": {
"args": "arg",
"desc": "输出做取反运算后的布尔值。首先将`arg`转换为布尔值。"
"desc": "输出做取反运算后的布尔值。首先将 `arg` 转换为布尔值。"
},
"$exists": {
"args": "arg",
"desc": "如果算式`arg`的值存在则输出`true`。如果算式的值不存在(比如指向不存在区域的引用)则输出`false`。"
"desc": "如果算式 `arg` 的值存在则输出 `true` 。如果算式的值不存在(比如指向不存在区域的引用)则输出 `false` 。"
},
"$count": {
"args": "array",
@@ -137,15 +137,15 @@
},
"$sort": {
"args": "array [, function]",
"desc": "输出排序后的数组`array`。\n\n如果使用了比较函数`function`,则下述两个参数需要被指定。\n\n`function(left, right)`\n\n该比较函数是为了比较left和right两个值而被排序算法调用的。如果用户希望left的值被置于right的值之后那么该函数必须输出布尔值`true`来表示位置交换。而在不需要位置交换时函数必须输出`false`。"
"desc": "输出排序后的数组 `array` 。\n\n如果使用了比较函数 `function` ,则下述两个参数需要被指定。\n\n `function(left, right)` \n\n该比较函数是为了比较left和right两个值而被排序算法调用的。如果用户希望left的值被置于right的值之后那么该函数必须输出布尔值 `true` 来表示位置交换。而在不需要位置交换时函数必须输出 `false` 。"
},
"$reverse": {
"args": "array",
"desc": "输出倒序后的数组`array`。"
"desc": "输出倒序后的数组 `array` 。"
},
"$shuffle": {
"args": "array",
"desc": "输出随机排序后的数组 `array`。"
"desc": "输出随机排序后的数组 `array` 。"
},
"$zip": {
"args": "array, ...",
@@ -157,35 +157,35 @@
},
"$lookup": {
"args": "object, key",
"desc": "输出对象中与参数`key`对应的值。如果第一个参数`object`是数组,那么数组中所有的对象都将被搜索并输出这些对象中与参数`key`对应的值。"
"desc": "输出对象中与参数 `key` 对应的值。如果第一个参数 `object` 是数组,那么数组中所有的对象都将被搜索并输出这些对象中与参数 `key` 对应的值。"
},
"$spread": {
"args": "object",
"desc": "将对象中的键值对分隔成每个要素中只含有一个键值对的数组。如果参数`object`是数组,那么返回值的数组中包含所有对象中的键值对。"
"desc": "将对象中的键值对分隔成每个要素中只含有一个键值对的数组。如果参数 `object` 是数组,那么返回值的数组中包含所有对象中的键值对。"
},
"$merge": {
"args": "array&lt;object&gt;",
"desc": "将输入数组`objects`中所有的键值对合并到一个`object`中并返回。如果输入数组的要素中含有重复的键,则返回的`object`中将只包含数组中最后出现要素的值。如果输入数组中包括对象以外的元素,则抛出错误。"
"desc": "将输入数组 `objects` 中所有的键值对合并到一个 `object` 中并返回。如果输入数组的要素中含有重复的键,则返回的 `object` 中将只包含数组中最后出现要素的值。如果输入数组中包括对象以外的元素,则抛出错误。"
},
"$sift": {
"args": "object, function",
"desc": "输出参数`object`中符合`function`的键值对。\n\n`function`必须含有下述参数。\n\n`function(value [, key [, object]])`"
"desc": "输出参数 `object` 中符合 `function` 的键值对。\n\n `function` 必须含有下述参数。\n\n `function(value [, key [, object]])` "
},
"$each": {
"args": "object, function",
"desc": "将函数`function`应用于`object`中的所有键值对并输出由所有返回值组成的数组。"
"desc": "将函数 `function` 应用于 `object` 中的所有键值对并输出由所有返回值组成的数组。"
},
"$map": {
"args": "array, function",
"desc": "将函数`function`应用于数组`array`中所有的值并输出由返回值组成的数组。\n\n`function`中必须含有下述参数。\n\n`function(value [, index [, array]])`"
"desc": "将函数 `function` 应用于数组 `array` 中所有的值并输出由返回值组成的数组。\n\n `function` 中必须含有下述参数。\n\n`function(value [, index [, array]])` "
},
"$filter": {
"args": "array, function",
"desc": "输出数组`array`中符合函数`function`条件的值组成的数组。\n\n`function`必须包括下述参数。\n\n`function(value [, index [, array]])`"
"desc": "输出数组 `array` 中符合函数 `function` 条件的值组成的数组。\n\n `function` 必须包括下述参数。\n\n `function(value [, index [, array]])`"
},
"$reduce": {
"args": "array, function [, init]",
"desc": "将`function`依次应用于数组中的各要素值。 其中,前一个要素值的计算结果将参与到下一次的函数运算中。。\n\n函数`function`接受两个参数并作为中缀表示法中的操作符。\n\n可省略的参数`init`将作为运算的初始值。"
"desc": "将 `function` 依次应用于数组中的各要素值。 其中,前一个要素值的计算结果将参与到下一次的函数运算中。。\n\n函数 `function` 接受两个参数并作为中缀表示法中的操作符。\n\n可省略的参数 `init` 将作为运算的初始值。"
},
"$flowContext": {
"args": "string",
@@ -197,7 +197,7 @@
},
"$pad": {
"args": "string, width [, char]",
"desc": "根据需要,向字符串`string`的副本中填充文字使该字符串的字数达到`width`的绝对值并返回填充文字后的字符串。\n\n如果`width`的值为正,则向字符串`string`的右侧填充文字,如果`width`为负,则向字符串`string`的左侧填充文字。\n\n可选参数`char`用来指定填充的文字。如果未指定该参数,则填充空白文字。"
"desc": "根据需要,向字符串 `string` 的副本中填充文字使该字符串的字数达到 `width` 的绝对值并返回填充文字后的字符串。\n\n如果 `width` 的值为正,则向字符串 `string` 的右侧填充文字,如果 `width` 为负,则向字符串 `string` 的左侧填充文字。\n\n可选参数 `char` 用来指定填充的文字。如果未指定该参数,则填充空白文字。"
},
"$fromMillis": {
"args": "number",
@@ -205,15 +205,15 @@
},
"$formatNumber": {
"args": "number, picture [, options]",
"desc": "将`number`转换成具有`picture`所指定的数值格式的字符串。\n\n此函数的功能与XPath F&O 3.1规格中定义的XPath/XQuery函数的fn:format-number功能相一致。参数`picture`用于指定数值的转换格式其语法与fn:format-number中的定义一致。\n\n可选的第三参数`options`用来覆盖默认的局部环境格式如小数点分隔符。如果指定该参数那么该参数必须是包含name/value对的对象并且name/value对必须符合XPath F&O 3.1规格中记述的数值格式。"
"desc": "将 `number` 转换成具有 `picture` 所指定的数值格式的字符串。\n\n此函数的功能与XPath F&O 3.1规格中定义的XPath/XQuery函数的fn:format-number功能相一致。参数 `picture` 用于指定数值的转换格式其语法与fn:format-number中的定义一致。\n\n可选的第三参数 `options` 用来覆盖默认的局部环境格式如小数点分隔符。如果指定该参数那么该参数必须是包含name/value对的对象并且name/value对必须符合XPath F&O 3.1规格中记述的数值格式。"
},
"$formatBase": {
"args": "number [, radix]",
"desc": "将`number`变换为以参数`radix`的值为基数形式的字符串。如果不指定`radix`的值则默认基数为10。指定的`radix`值必须在236之间否则抛出错误。"
"desc": "将 `number` 变换为以参数 `radix` 的值为基数形式的字符串。如果不指定 `radix` 的值则默认基数为10。指定的 `radix` 值必须在236之间否则抛出错误。"
},
"$toMillis": {
"args": "timestamp",
"desc": "将ISO 8601格式的字符串`timestamp`转换为从UNIX时间 (1970年1月1日 UTC/GMT的午夜开始到现在的毫秒数。如果该字符串的格式不正确则抛出错误。"
"desc": "将ISO 8601格式的字符串 `timestamp` 转换为从UNIX时间 (1970年1月1日 UTC/GMT的午夜开始到现在的毫秒数。如果该字符串的格式不正确则抛出错误。"
},
"$env": {
"args": "arg",
@@ -221,7 +221,7 @@
},
"$eval": {
"args": "expr [, context]",
"desc": "使用当前上下文来作为评估依据,分析并评估字符串`expr`其中包含文字JSON或JSONata表达式。"
"desc": "使用当前上下文来作为评估依据,分析并评估字符串 `expr` 其中包含文字JSON或JSONata表达式。"
},
"$formatInteger": {
"args": "number, picture",
@@ -233,19 +233,19 @@
},
"$error": {
"args": "[str]",
"desc": "引发错误并显示一条消息。 可选的`str`将替代$error()函数评估的默认消息。"
"desc": "引发错误并显示一条消息。 可选的 `str` 将替代$error()函数评估的默认消息。"
},
"$assert": {
"args": "arg, str",
"desc": "如果`arg`为真,则该函数返回。 如果arg为假则抛出带有str的异常作为异常消息。"
"desc": "如果 `arg` 为真,则该函数返回。 如果arg为假则抛出带有str的异常作为异常消息。"
},
"$single": {
"args": "array, function",
"desc": "返回满足参数function谓语的array参数中的唯一值 (比如传递值时函数返回布尔值“true”)。如果匹配值的数量不唯一时,则抛出异常。\n\n应在以下签名中提供函数`functionvalue [index [array []]]`其中value是数组的每个输入index是该值的位置整个数组作为第三个参数传递。"
"desc": "返回满足参数function谓语的array参数中的唯一值 (比如传递值时函数返回布尔值“true”)。如果匹配值的数量不唯一时,则抛出异常。\n\n应在以下签名中提供函数 `functionvalue [index [array []]]` 其中value是数组的每个输入index是该值的位置整个数组作为第三个参数传递。"
},
"$encodeUrl": {
"args": "str",
"desc": "通过用表示字符的UTF-8编码的一个两个三个或四个转义序列替换某些字符的每个实例对统一资源定位符URL组件进行编码。\n\n示例`$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
"desc": "通过用表示字符的UTF-8编码的一个两个三个或四个转义序列替换某些字符的每个实例对统一资源定位符URL组件进行编码。\n\n示例 `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`"
},
"$encodeUrlComponent": {
"args": "str",
@@ -261,10 +261,14 @@
},
"$distinct": {
"args": "array",
"desc": "返回一个数组,其中重复的值已从`数组`中删除"
"desc": "返回一个数组,其中重复的值已从 `数组` 中删除"
},
"$type": {
"args": "value",
"desc": "以字符串形式返回`值`的类型。 如果该`值`未定义,则将返回`未定义`"
"desc": "以字符串形式返回 `值` 的类型。 如果该 `值` 未定义,则将返回 `未定义` "
},
"$moment": {
"args": "[str]",
"desc": "使用Moment库获取日期对象。"
}
}

View File

@@ -14,7 +14,16 @@
"back": "返回",
"next": "下一步",
"clone": "複製專案",
"cont": "Continue"
"cont": "繼續",
"style": "風格",
"line": "大綱",
"fill": "填充",
"label": "標籤",
"color": "顏色",
"position": "位置",
"enable": "啟用",
"disable": "禁用",
"upload": "上傳"
},
"type": {
"string": "字符串",
@@ -28,6 +37,13 @@
"null": "空"
}
},
"event": {
"loadPalette": "加載控制板",
"loadNodeCatalogs": "加載節點目錄",
"loadNodes": "加載 __count__ 個節點",
"loadFlows": "加載流程",
"importFlows": "往工作區中加載流程"
},
"workspace": {
"defaultName": "流程__number__",
"editFlow": "編輯流程: __name__",
@@ -91,7 +107,12 @@
"projects-new": "新專案",
"projects-open": "開啟專案",
"projects-settings": "專案設定",
"showNodeLabelDefault": "顯示新添加節點的標籤"
"showNodeLabelDefault": "顯示新添加節點的標籤",
"groups": "組",
"groupSelection": "選擇組",
"ungroupSelection": "取消選擇組",
"groupMergeSelection": "合并選擇",
"groupRemoveSelection": "從組中移除"
}
},
"actions": {
@@ -101,7 +122,7 @@
"zoom-in": "放大"
},
"user": {
"loggedInAs": "作為__name__登入",
"loggedInAs": "作為 __name__ 登入",
"username": "帳號",
"password": "密碼",
"login": "登入",
@@ -133,7 +154,7 @@
"error": "<strong>Error</strong>: __message__",
"errors": {
"lostConnection": "丟失與伺服器的連接,重新連接...",
"lostConnectionReconnect": "丟失與伺服器的連接__time__秒後重新連接",
"lostConnectionReconnect": "丟失與伺服器的連接__time__ 秒後重新連接",
"lostConnectionTry": "現在嘗試",
"cannotAddSubflowToItself": "無法向其自身添加子流程",
"cannotAddCircularReference": "無法添加子流程 - 迴圈引用",
@@ -146,7 +167,7 @@
"loaded": "已加載項目'__project__'",
"updated": "已更新項目'__project__'",
"pull": "已重新加載項目'__project__'",
"revert": "項目__project__已還原",
"revert": "項目'__project__'已還原",
"merge-complete": "Git合併完成",
"setupCredentials": "設定證書",
"setupProjectFiles": "設置項目文件",
@@ -171,10 +192,14 @@
"node_plural": "__count__ 多個節點",
"configNode": "__count__ 節點組態",
"configNode_plural": "__count__ 多節點組態",
"group": "__count__ 個組",
"group_plural": "__count__ 個組",
"flow": "__count__ 流程",
"flow_plural": "__count__ 多流程",
"subflow": "__count__ 子流程",
"subflow_plural": "__count__ 多子流程",
"replacedNodes": "__count__ 個節點被置換",
"replacedNodes_plural": "__count__ 個節點被置換",
"pasteNodes": "在這裡粘貼節點",
"selectFile": "匯入所選檔案",
"importNodes": "匯入節點",
@@ -184,9 +209,15 @@
"importUnrecognised_plural": "匯入了無法識別的類型:",
"nodesExported": "節點匯出到了剪貼簿",
"nodesImported": "已匯入:",
"nodeCopied": "已複製__count__個節點",
"nodeCopied_plural": "已複製__count__個節點",
"nodeCopied": "已複製 __count__ 個節點",
"nodeCopied_plural": "已複製 __count__ 個節點",
"groupCopied": "複製 __count__ 個組",
"groupCopied_plural": "已複製 __count__ 個groups",
"groupStyleCopied": "已複製組風格",
"invalidFlow": "無效的流程: __message__",
"recoveredNodes": "復原的節點",
"recoveredNodesInfo": "導入節點時此流上的節點缺少有效的流ID。它們已被添加到此流中您可以復原或刪除它們。",
"recoveredNodesNotification": "<p>導入的節點缺少有效的流ID</p><p>已將它們添加到名為 '__flowName__'的新流中。</p>",
"export": {
"selected": "已選擇的節點",
"current": "現在的節點",
@@ -201,13 +232,19 @@
},
"import": {
"import": "匯入到",
"importSelected": "導入所選項",
"importCopy": "導入副本",
"viewNodes": "查看節點",
"newFlow": "新流程",
"replace": "置換",
"errors": {
"notArray": "輸入的不是JSON數組",
"itemNotObject": "輸入的流程無效-項目__index__不是節點對象",
"missingId": "輸入的流程無效-項__index__缺少“ id”屬性",
"missingType": "輸入的流程無效-項__index__缺少“類型”屬性"
}
"itemNotObject": "輸入的流程無效-項目 __index__ 不是節點對象",
"missingId": "輸入的流程無效-項 __index__ 缺少“ id”屬性",
"missingType": "輸入的流程無效-項 __index__ 缺少“類型”屬性"
},
"conflictNotification1": "您要導入的某些節點已經存在於工作空間中。",
"conflictNotification2": "選擇要導入的節點,並確認要替換現有的節點還是導入它們的副本"
},
"copyMessagePath": "已複製路徑",
"copyMessageValue": "已複製數值",
@@ -250,7 +287,7 @@
"conflictChecking": "檢查是否可以自動合併更改",
"conflictAutoMerge": "此更改不包括衝突,可以自動合併",
"conflictManualMerge": "這些更改包括了在部署之前必須解決的衝突。",
"plusNMore": "+更多的__count__"
"plusNMore": "+更多的 __count__"
}
},
"eventLog": {
@@ -258,8 +295,8 @@
"view": "查看日誌"
},
"diff": {
"unresolvedCount": "__count__個未解決的衝突",
"unresolvedCount_plural": "__count__個未解決的衝突",
"unresolvedCount": "__count__ 個未解決的衝突",
"unresolvedCount_plural": "__count__ 個未解決的衝突",
"globalNodes": "全局節點",
"flowProperties": "流程屬性",
"type": {
@@ -269,11 +306,11 @@
"deleted": "已刪除",
"flowDeleted": "已刪除流程",
"flowAdded": "已添加流程",
"movedTo": "移動至__id__",
"movedFrom": "從__id__移動"
"movedTo": "移動至 __id__",
"movedFrom": "從 __id__ 移動"
},
"nodeCount": "__count__個節點",
"nodeCount_plural": "__count__個節點",
"nodeCount": "__count__ 個節點",
"nodeCount_plural": "__count__ 個節點",
"local": "本地",
"remote": "遠端",
"reviewChanges": "查看變更",
@@ -287,11 +324,11 @@
"newVersionError": "新版本不包含有效的JSON"
},
"subflow": {
"editSubflowInstance": "編輯子流程實例__name__",
"editSubflow": "編輯流程範本: __name__",
"editSubflowInstance": "編輯子流程實例: __name__",
"editSubflow": "編輯流程範本 __name__",
"edit": "編輯流程範本",
"subflowInstances": "這個子流程範本有__count__個實例",
"subflowInstances_plural": "這個子流程範本有__count__個實例",
"subflowInstances": "這個子流程範本有 __count__ 個實例",
"subflowInstances_plural": "這個子流程範本有 __count__ 個實例",
"editSubflowProperties": "編輯屬性",
"input": "輸入:",
"output": "輸出:",
@@ -308,17 +345,24 @@
"multipleInputsToSelection": "<strong>無法創建子流程</strong>: 多個輸入到了選擇"
}
},
"group": {
"editGroup": "編輯組: __name__",
"errors": {
"cannotCreateDiffGroups": "無法使用來自不同組的節點創建組",
"cannotAddSubflowPorts": "無法將子流程的端口添加到組"
}
},
"editor": {
"configEdit": "編輯",
"configAdd": "添加",
"configUpdate": "更新",
"configDelete": "刪除",
"nodesUse": "__count__個節點使用此配置",
"nodesUse_plural": "__count__個節點使用此配置",
"addNewConfig": "添加新的__type__配置",
"editNode": "編輯__type__節點",
"editConfig": "編輯__type__配置",
"addNewType": "添加新的__type__節點",
"nodesUse": "__count__ 個節點使用此配置",
"nodesUse_plural": "__count__ 個節點使用此配置",
"addNewConfig": "添加新的 __type__ 配置",
"editNode": "編輯 __type__ 節點",
"editConfig": "編輯 __type__ 配置",
"addNewType": "添加新的 __type__ 節點",
"nodeProperties": "節點屬性",
"label": "Label",
"color": "顏色",
@@ -337,6 +381,7 @@
"locale": "選擇界面語言",
"icon": "圖標",
"inputType": "輸入類型",
"selectType": "選擇類型...",
"inputs": {
"input": "輸入",
"select": "選擇",
@@ -351,7 +396,8 @@
"bool": "布爾",
"json": "JSON",
"bin": "buffer",
"env": "環境變量"
"env": "環境變量",
"cred": "證書"
},
"menu": {
"input": "輸入",
@@ -405,13 +451,13 @@
"library": "庫",
"openLibrary": "打開庫...",
"saveToLibrary": "保存到庫...",
"typeLibrary": "__type__型別程式庫",
"unnamedType": "無名__type__",
"typeLibrary": "__type__ 型別程式庫",
"unnamedType": "無名 __type__",
"exportedToLibrary": "節點導出到庫",
"dialogSaveOverwrite": "一個叫做__libraryName____libraryType__已經存在您需要覆蓋麼",
"dialogSaveOverwrite": "一個叫做 __libraryName____libraryType__ 已經存在,您需要覆蓋麼?",
"invalidFilename": "無效的檔案名",
"savedNodes": "保存的節點",
"savedType": "已保存__type__",
"savedType": "已保存 __type__",
"saveFailed": "保存失敗: __message__",
"newFolder": "新文件夾",
"types": {
@@ -460,33 +506,33 @@
"times": {
"seconds": "秒前",
"minutes": "分前",
"minutesV": "__count__分前",
"hoursV": "__count__小時前",
"hoursV_plural": "__count__小時前",
"daysV": "__count__天前",
"daysV_plural": "__count__天前",
"weeksV": "__count__周前",
"weeksV_plural": "__count__周前",
"monthsV": "__count__月前",
"monthsV_plural": "__count__月前",
"yearsV": "__count__年前",
"yearsV_plural": "__count__年前",
"yearMonthsV": "__y__年, __count__月前",
"yearMonthsV_plural": "__y__年, __count__月前",
"yearsMonthsV": "__y__年, __count__月前",
"yearsMonthsV_plural": "__y__年, __count__月前"
"minutesV": "__count__ 分前",
"hoursV": "__count__ 小時前",
"hoursV_plural": "__count__ 小時前",
"daysV": "__count__ 天前",
"daysV_plural": "__count__ 天前",
"weeksV": "__count__ 周前",
"weeksV_plural": "__count__ 周前",
"monthsV": "__count__ 月前",
"monthsV_plural": "__count__ 月前",
"yearsV": "__count__ 年前",
"yearsV_plural": "__count__ 年前",
"yearMonthsV": "__y__ 年, __count__ 月前",
"yearMonthsV_plural": "__y__ 年, __count__ 月前",
"yearsMonthsV": "__y__ 年, __count__ 月前",
"yearsMonthsV_plural": "__y__ 年, __count__ 月前"
},
"nodeCount": "__label__個節點",
"nodeCount_plural": "__label__個節點",
"moduleCount": "__count__個可用模組",
"moduleCount_plural": "__count__個可用模組",
"nodeCount": "__label__ 個節點",
"nodeCount_plural": "__label__ 個節點",
"moduleCount": "__count__ 個可用模組",
"moduleCount_plural": "__count__ 個可用模組",
"inuse": "使用中",
"enableall": "全部啟用",
"disableall": "全部禁用",
"enable": "啟用",
"disable": "禁用",
"remove": "移除",
"update": "更新至__version__版本",
"update": "更新至 __version__ 版本",
"updated": "已更新",
"install": "安裝",
"installed": "已安裝",
@@ -498,7 +544,8 @@
"sort": "排序:",
"sortAZ": "a-z順序",
"sortRecent": "日期順序",
"more": "增加__count__個",
"more": "增加 __count__ 個",
"upload": "上傳模塊tgz文件",
"errors": {
"catalogLoadFailed": "無法載入節點目錄。<br>查看瀏覽器控制臺瞭解更多資訊",
"installFailed": "無法安裝: __module__<br>__message__<br>查看日誌瞭解更多資訊",
@@ -539,6 +586,7 @@
"label": "信息",
"node": "節點",
"type": "類型",
"group": "組",
"module": "Module",
"id": "ID",
"status": "狀態",
@@ -560,8 +608,30 @@
"subflowDesc": "子流程描述",
"nodeHelp": "節點幫助",
"none": "無",
"arrayItems": "__count__個項目",
"showTips": "您可以從設置面板啟用提示資訊"
"arrayItems": "__count__ 個項目",
"showTips": "您可以從設置面板啟用提示資訊",
"outline": "大綱",
"empty": "空的",
"globalConfig": "全局配置節點",
"triggerAction": "觸發動作",
"find": "在工作區中查找",
"search": {
"configNodes": "配置節點",
"unusedConfigNodes": "未使用的配置節點",
"invalidNodes": "無效的節點",
"uknownNodes": "未知的節點",
"unusedSubflows": "未使用的子流程"
}
},
"help": {
"name": "幫助",
"label": "幫助",
"search": "搜索幫助",
"nodeHelp": "節點幫助",
"showHelp": "顯示幫助",
"showInOutline": "在大綱中顯示",
"showTopics": "顯示主題",
"noHelp": "未選擇幫助主題"
},
"config": {
"name": "配置節點",
@@ -614,9 +684,9 @@
"removeFromProject": "從項目中刪除",
"addToProject": "添加到項目",
"files": "文件",
"package": "包",
"flow": "流程",
"credentials": "證書",
"package": "包",
"packageCreate": "保存更改後將創建文件",
"fileNotExist": "文件不存在",
"selectFile": "選擇文件",
@@ -652,6 +722,12 @@
"committerTip": "保留空白以使用系統默認值",
"userName": "用戶名",
"email": "電子郵件",
"workflow": "工作流",
"workfowTip": "選擇您偏好的工作流",
"workflowManual": "手動",
"workflowManualTip": "所有更改都必須在“歷史記錄”側邊欄中手動提交",
"workflowAuto": "自動",
"workflowAutoTip": "每次部署後都會自動提交更改",
"sshKeys": "SSH密鑰",
"sshKeysTip": "允許您創建到遠程git存儲庫的安全連接。",
"add": "添加密鑰",
@@ -668,7 +744,7 @@
"copyPublicKey": "將公鑰複製到剪貼板",
"delete": "刪除密鑰",
"gitConfig": "Git配置",
"deleteConfirm": "您確定要刪除SSH密鑰__name__嗎 這不能被撤消。"
"deleteConfirm": "您確定要刪除SSH密鑰 __name__ 嗎? 這不能被撤消。"
},
"versionControl": {
"unstagedChanges": "未暫存的更改",
@@ -722,24 +798,24 @@
"pullChanges": "Pull變更",
"history": "歷史",
"projectHistory": "項目歷史",
"daysAgo": "__count__天前",
"daysAgo_plural": "__count__天前",
"hoursAgo": "__count__小時前",
"hoursAgo_plural": "__count__小時前",
"minsAgo": "__count__分鐘前",
"minsAgo_plural": "__count__分鐘前",
"daysAgo": "__count__ 天前",
"daysAgo_plural": "__count__ 天前",
"hoursAgo": "__count__ 小時前",
"hoursAgo_plural": "__count__ 小時前",
"minsAgo": "__count__ 分鐘前",
"minsAgo_plural": "__count__ 分鐘前",
"secondsAgo": "秒前",
"notTracking": "您的本地分支當前未跟蹤遠程分支。",
"statusUnmergedChanged": "您的存儲庫中有未合併的更改。您需要解決衝突並提交結果。",
"repositoryUpToDate": "您的存儲庫是最新的。",
"commitsAhead": "您的倉庫領先遠程倉庫__count__次提交。您現在可以push這些提交。",
"commitsAhead_plural": "您的倉庫領先遠程倉庫__count__次提交。您現在可以push這些提交。",
"commitsBehind": "您的倉庫落後遠程倉庫__count__次提交。您現在可以pull這些提交。",
"commitsBehind_plural": "您的倉庫落後遠程倉庫__count__次提交。您現在可以pull這些提交。",
"commitsAheadAndBehind1": "您的倉庫落後遠程倉庫__count__次提交",
"commitsAheadAndBehind1_plural": "您的倉庫落後遠程倉庫__count__次提交",
"commitsAheadAndBehind2": "領先遠程倉庫__count__次提交。",
"commitsAheadAndBehind2_plural": "領先遠程倉庫__count__次提交。",
"commitsAhead": "您的倉庫領先遠程倉庫 __count__ 次提交。您現在可以push這些提交。",
"commitsAhead_plural": "您的倉庫領先遠程倉庫 __count__ 次提交。您現在可以push這些提交。",
"commitsBehind": "您的倉庫落後遠程倉庫 __count__ 次提交。您現在可以pull這些提交。",
"commitsBehind_plural": "您的倉庫落後遠程倉庫 __count__ 次提交。您現在可以pull這些提交。",
"commitsAheadAndBehind1": "您的倉庫落後遠程倉庫 __count__ 次提交",
"commitsAheadAndBehind1_plural": "您的倉庫落後遠程倉庫 __count__ 次提交",
"commitsAheadAndBehind2": "領先遠程倉庫 __count__ 次提交。",
"commitsAheadAndBehind2_plural": "領先遠程倉庫 __count__ 次提交。",
"commitsAheadAndBehind3": "您必須先pull遠程提交然後再進行push。",
"commitsAheadAndBehind3_plural": "您必須先pull遠程提交然後再進行push。",
"refreshCommitHistory": "刷新提交歷史",
@@ -757,7 +833,8 @@
"bin": "二進位流",
"date": "時間戳記",
"jsonata": "expression",
"env": "env variable"
"env": "env variable",
"cred": "證書"
}
},
"editableList": {
@@ -977,7 +1054,8 @@
"passphrase": "密碼短語",
"retry": "重試",
"update-failed": "無法更新身份驗證",
"unhandled": "未處理的錯誤響應"
"unhandled": "未處理的錯誤響應",
"host-key-verify-failed": "<p>主機密鑰驗證失敗。</p><p>無法驗證存儲庫主機密鑰。請更新您的<code>known_hosts</code>文件,然後重試。</p>"
},
"create-branch-list": {
"invalid": "無效的分支",

View File

@@ -266,5 +266,9 @@
"$type": {
"args": "value",
"desc": "以字符串形式返回`值`的類型。 如果該`值`未定義,則將返回`未定義`"
},
"$moment": {
"args": "[str]",
"desc": "使用Moment庫獲取日期對象。"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@node-red/editor-client",
"version": "1.1.0-beta.1",
"version": "1.2.3",
"license": "Apache-2.0",
"repository": {
"type": "git",

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,8 @@
ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n# Node-RED Specific Funcs\nsnippet nodes\n node.send(${1:msg})\nsnippet clone\n RED.util.cloneMessage(${1:msg})\nsnippet nodel\n node.log($1)\nsnippet nodew\n node.warn($1)\nsnippet nodee\n node.error($1)\nsnippet noded\n node.debug($1)\nsnippet done\n node.done($1)\nsnippet flowg\n flow.get($1)\nsnippet flows\n flow.set($1, $2)\nsnippet globalg\n global.get($1)\nsnippet globals\n global.set($1, $2)\n',t.scope="nrjavascript"});
(function() {
; (function() {
ace.require(["ace/snippets/nrjavascript"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();

File diff suppressed because one or more lines are too long

View File

@@ -76,13 +76,12 @@ oop.inherits(NRJavaScriptWorker, Mirror);
(function() {
this.setOptions = function(options) {
this.options = options || {
this.options = {
// undef: true,
// unused: true,
esnext: true,
moz: true,
esversion: 9,
devel: true,
browser: true,
browser: false,
node: true,
laxcomma: true,
laxbreak: true,
@@ -92,8 +91,17 @@ oop.inherits(NRJavaScriptWorker, Mirror);
maxerr: 100,
expr: true,
multistr: true,
globalstrict: true
strict: false,
sub: true,
asi: true
};
if (options) {
for (var opt in options) {
if (options.hasOwnProperty(opt)) {
this.options[opt] = options.opt;
}
}
}
this.doc.getValue() && this.deferredUpdate.schedule(100);
};
@@ -119,6 +127,8 @@ oop.inherits(NRJavaScriptWorker, Mirror);
if (!value)
return this.sender.emit("annotate", []);
var originalValue = value;
// [Node-RED] wrap the code in a function
value = "async function __nodered__(msg) {\n"+value+"\n}";
@@ -138,6 +148,7 @@ oop.inherits(NRJavaScriptWorker, Mirror);
continue;
var raw = error.raw;
var type = "warning";
var line = error.line - 2;
if (raw == "Missing semicolon.") {
var str = error.evidence.substr(error.character);
@@ -166,9 +177,62 @@ oop.inherits(NRJavaScriptWorker, Mirror);
type = "info";
}
if (raw === "Unmatched '{a}'." && line === -1) {
// This is an unmatched { error. It has incorrectly matched it
// against the { in the added line. Need to find the next valid {
// This code scans through the original code looking for the first '{'
// that is not in a comment or string.
// It will incorrectly find a '{' if it is inside a regex... but
// at least the error will be shown somwhere. There are only
// so many hours in the day to fix every tiny edge case of an
// edge case.
var inSingleComment = false;
var inMultiComment = false;
var inString = false;
var stringQ;
var lineNumber = 0;
for (var pos = 0;pos<originalValue.length;pos++) {
var c = originalValue[pos];
if (c === "\\") {
pos++;
} else if (inSingleComment) {
if (c === "\n") {
lineNumber++;
inSingleComment = false;
}
} else if (inMultiComment) {
if (c === "*" && originalValue[pos+1] === "/") {
pos++;
inMultiComment = false;
} else if (c === "\n") {
lineNumber++;
}
} else if (inString) {
if (c === stringQ) {
inString = false;
}
} else if (c === "'" || c === "\"") {
inString = true;
stringQ = c;
} else if (c === "/") {
if (originalValue[pos+1] === "/") {
inSingleComment = true;
} else if (originalValue[pos+1] === "*") {
inMultiComment = true;
}
} else if (c === "\n") {
lineNumber++;
} else if (c === "{") {
// found it!
break;
}
}
line = lineNumber;
}
errors.push({
// [Node-RED] offset the row for the added line
row: error.line-2,
row: Math.max(0,line),
column: error.character-1,
text: error.reason,
type: type,

View File

@@ -36,15 +36,15 @@
var evt = arguments[0]
var args = Array.prototype.slice.call(arguments,1);
if (RED.events.DEBUG) {
console.log(evt,args);
console.warn(evt,args);
}
if (handlers[evt]) {
for (var i=0;i<handlers[evt].length;i++) {
try {
handlers[evt][i].apply(null, args);
} catch(err) {
console.log("RED.events.emit error: ["+evt+"] "+(err.toString()));
console.log(err);
console.warn("RED.events.emit error: ["+evt+"] "+(err.toString()));
console.warn(err);
}
}

View File

@@ -808,17 +808,7 @@ RED.nodes.fontAwesome = (function() {
"fa-youtube": "\uf167",
};
var iconList = [];
var isUsed = {};
Object.keys(iconMap).forEach(function(icon) {
var unicode = iconMap[icon];
// skip icons with a same unicode
if (isUsed[unicode] !== true) {
iconList.push(icon);
isUsed[unicode] = true;
}
});
isUsed = undefined;
var iconList = Object.keys(iconMap);
return {
getIconUnicode: function(name) {

View File

@@ -37,22 +37,38 @@ RED.history = (function() {
inverseEv.events.push(r);
}
} else if (ev.t == 'replace') {
inverseEv = {
t: 'replace',
config: RED.nodes.createCompleteNodeSet(),
changed: {},
rev: RED.nodes.version()
};
RED.nodes.clear();
var imported = RED.nodes.import(ev.config);
imported[0].forEach(function(n) {
if (ev.changed[n.id]) {
n.changed = true;
inverseEv.changed[n.id] = true;
}
})
if (ev.complete) {
// This is a replace of everything. We can short-cut
// the logic by clearing everyting first, then importing
// the ev.config.
// Used by RED.diff.mergeDiff
inverseEv = {
t: 'replace',
config: RED.nodes.createCompleteNodeSet(),
changed: {},
rev: RED.nodes.version()
};
RED.nodes.clear();
var imported = RED.nodes.import(ev.config);
imported.nodes.forEach(function(n) {
if (ev.changed[n.id]) {
n.changed = true;
inverseEv.changed[n.id] = true;
}
})
RED.nodes.version(ev.rev);
RED.nodes.version(ev.rev);
} else {
var importMap = {};
ev.config.forEach(function(n) {
importMap[n.id] = "replace";
})
var importedResult = RED.nodes.import(ev.config,{importMap: importMap})
inverseEv = {
t: 'replace',
config: importedResult.removedNodes
}
}
} else if (ev.t == 'add') {
inverseEv = {
t: "delete",
@@ -85,7 +101,7 @@ RED.history = (function() {
}
if (ev.groups) {
inverseEv.groups = [];
for (i=0;i<ev.groups.length;i++) {
for (i = ev.groups.length - 1;i>=0;i--) {
group = ev.groups[i];
modifiedTabs[group.z] = true;
// The order of groups is important
@@ -206,9 +222,6 @@ RED.history = (function() {
RED.nodes.filterNodes({type:"subflow:"+subflow.id}).forEach(function(n) {
n.inputs = subflow.in.length;
n.outputs = subflow.out.length;
while (n.outputs > n.ports.length) {
n.ports.push(n.ports.length);
}
n.resize = true;
n.dirty = true;
});
@@ -217,7 +230,7 @@ RED.history = (function() {
inverseEv.groups = [];
var groupsToAdd = {};
ev.groups.forEach(function(g) { groupsToAdd[g.id] = g; });
for (i=0;i<ev.groups.length;i++) {
for (i = ev.groups.length - 1;i>=0;i--) {
RED.nodes.addGroup(ev.groups[i])
modifiedTabs[ev.groups[i].z] = true;
// The order of groups is important
@@ -334,10 +347,12 @@ RED.history = (function() {
var currentConfigNode = RED.nodes.node(ev.node[i]);
if (currentConfigNode) {
currentConfigNode.users.splice(currentConfigNode.users.indexOf(ev.node),1);
RED.events.emit("nodes:change",currentConfigNode);
}
var newConfigNode = RED.nodes.node(ev.changes[i]);
if (newConfigNode) {
newConfigNode.users.push(ev.node);
RED.events.emit("nodes:change",newConfigNode);
}
}
ev.node[i] = ev.changes[i];
@@ -413,6 +428,7 @@ RED.history = (function() {
}
}
}
ev.node.__outputs = inverseEv.changes.outputs;
RED.editor.updateNodeProperties(ev.node,outputMap);
RED.editor.validateNode(ev.node);
}

View File

@@ -10,6 +10,7 @@
"ctrl-escape": "core:cancel-edit-tray",
"ctrl-d": "core:deploy-flows",
"ctrl-g i": "core:show-info-tab",
"ctrl-g h": "core:show-help-tab",
"ctrl-g d": "core:show-debug-tab",
"ctrl-g c": "core:show-config-tab",
"ctrl-g x": "core:show-context-tab",

View File

@@ -16,7 +16,7 @@
RED.nodes = (function() {
var node_defs = {};
var nodes = [];
var nodes = {};
var nodeTabMap = {};
var configNodes = {};
@@ -189,6 +189,7 @@ RED.nodes = (function() {
})();
function getID() {
// return Math.floor(Math.random()*15728640 + 1048576).toString(16)
return (1+Math.random()*4294967295).toString(16);
}
@@ -196,18 +197,17 @@ RED.nodes = (function() {
if (n.type.indexOf("subflow") !== 0) {
n["_"] = n._def._;
} else {
var subflowId = n.type.substring(8);
var sf = RED.nodes.subflow(subflowId);
if (sf) {
sf.instances.push(sf);
}
n["_"] = RED._;
}
if (n._def.category == "config") {
configNodes[n.id] = n;
} else {
n.ports = [];
if (n.wires && (n.wires.length > n.outputs)) { n.outputs = n.wires.length; }
if (n.outputs) {
for (var i=0;i<n.outputs;i++) {
n.ports.push(i);
}
}
n.dirty = true;
updateConfigNodeUsers(n);
if (n._def.category == "subflows" && typeof n.i === "undefined") {
@@ -217,7 +217,7 @@ RED.nodes = (function() {
});
n.i = nextId+1;
}
nodes.push(n);
nodes[n.id] = n;
if (nodeTabMap[n.z]) {
nodeTabMap[n.z][n.id] = n;
} else {
@@ -234,12 +234,8 @@ RED.nodes = (function() {
function getNode(id) {
if (id in configNodes) {
return configNodes[id];
} else {
for (var n in nodes) {
if (nodes[n].id == id) {
return nodes[n];
}
}
} else if (id in nodes) {
return nodes[id];
}
return null;
}
@@ -253,50 +249,60 @@ RED.nodes = (function() {
delete configNodes[id];
RED.events.emit('nodes:remove',node);
RED.workspaces.refresh();
} else {
node = getNode(id);
if (node) {
nodes.splice(nodes.indexOf(node),1);
if (nodeTabMap[node.z]) {
delete nodeTabMap[node.z][node.id];
}
removedLinks = links.filter(function(l) { return (l.source === node) || (l.target === node); });
removedLinks.forEach(removeLink);
var updatedConfigNode = false;
for (var d in node._def.defaults) {
if (node._def.defaults.hasOwnProperty(d)) {
var property = node._def.defaults[d];
if (property.type) {
var type = registry.getNodeType(property.type);
if (type && type.category == "config") {
var configNode = configNodes[node[d]];
if (configNode) {
updatedConfigNode = true;
if (configNode._def.exclusive) {
removeNode(node[d]);
removedNodes.push(configNode);
} else {
var users = configNode.users;
users.splice(users.indexOf(node),1);
}
} else if (id in nodes) {
node = nodes[id];
delete nodes[id]
if (nodeTabMap[node.z]) {
delete nodeTabMap[node.z][node.id];
}
removedLinks = links.filter(function(l) { return (l.source === node) || (l.target === node); });
removedLinks.forEach(removeLink);
var updatedConfigNode = false;
for (var d in node._def.defaults) {
if (node._def.defaults.hasOwnProperty(d)) {
var property = node._def.defaults[d];
if (property.type) {
var type = registry.getNodeType(property.type);
if (type && type.category == "config") {
var configNode = configNodes[node[d]];
if (configNode) {
updatedConfigNode = true;
if (configNode._def.exclusive) {
removeNode(node[d]);
removedNodes.push(configNode);
} else {
var users = configNode.users;
users.splice(users.indexOf(node),1);
}
}
}
}
}
if (updatedConfigNode) {
RED.workspaces.refresh();
}
try {
if (node._def.oneditdelete) {
node._def.oneditdelete.call(node);
}
} catch(err) {
console.log("oneditdelete",node.id,node.type,err.toString());
}
RED.events.emit('nodes:remove',node);
}
if (node.type.indexOf("subflow:") === 0) {
var subflowId = node.type.substring(8);
var sf = RED.nodes.subflow(subflowId);
if (sf) {
sf.instances.splice(sf.instances.indexOf(node),1);
}
}
if (updatedConfigNode) {
RED.workspaces.refresh();
}
try {
if (node._def.oneditdelete) {
node._def.oneditdelete.call(node);
}
} catch(err) {
console.log("oneditdelete",node.id,node.type,err.toString());
}
RED.events.emit('nodes:remove',node);
}
if (node && node._def.onremove) {
// Deprecated: never documented but used by some early nodes
console.log("Deprecated API warning: node type ",node.type," has an onremove function - should be oneditremove - please report");
@@ -366,10 +372,13 @@ RED.nodes = (function() {
workspacesOrder.splice(workspacesOrder.indexOf(id),1);
var i;
var node;
for (i=0;i<nodes.length;i++) {
node = nodes[i];
if (node.z == id) {
removedNodes.push(node);
// TODO: this should use nodeTabMap
for (i in nodes) {
if (nodes.hasOwnProperty(i)) {
node = nodes[i];
if (node.z == id) {
removedNodes.push(node);
}
}
}
for(i in configNodes) {
@@ -459,6 +468,7 @@ RED.nodes = (function() {
module: "node-red"
}
});
sf.instances = [];
sf._def = RED.nodes.getType("subflow:"+sf.id);
RED.events.emit("subflows:add",sf);
}
@@ -475,17 +485,19 @@ RED.nodes = (function() {
}
function subflowContains(sfid,nodeid) {
for (var i=0;i<nodes.length;i++) {
var node = nodes[i];
if (node.z === sfid) {
var m = /^subflow:(.+)$/.exec(node.type);
if (m) {
if (m[1] === nodeid) {
return true;
} else {
var result = subflowContains(m[1],nodeid);
if (result) {
for (var i in nodes) {
if (nodes.hasOwnProperty(i)) {
var node = nodes[i];
if (node.z === sfid) {
var m = /^subflow:(.+)$/.exec(node.type);
if (m) {
if (m[1] === nodeid) {
return true;
} else {
var result = subflowContains(m[1],nodeid);
if (result) {
return true;
}
}
}
}
@@ -541,6 +553,9 @@ RED.nodes = (function() {
node.id = n.id;
node.type = n.type;
node.z = n.z;
if (node.z === 0 || node.z === "") {
delete node.z;
}
if (n.d === true) {
node.d = true;
}
@@ -599,7 +614,9 @@ RED.nodes = (function() {
node.y = n.y;
node.w = n.w;
node.h = n.h;
node.nodes = node.nodes.map(function(n) { return n.id });
// In 1.1.0, we have seen an instance of this array containing `undefined`
// Until we know how that can happen, add a filter here to remove them
node.nodes = node.nodes.filter(function(n) { return !!n }).map(function(n) { return n.id });
}
if (n._def.category != "config") {
node.x = n.x;
@@ -723,6 +740,16 @@ RED.nodes = (function() {
return node;
}
function createExportableSubflow(id) {
var sf = getSubflow(id);
var nodeSet = [sf];
var sfNodeIds = Object.keys(nodeTabMap[sf.id]||{});
for (var i=0, l=sfNodeIds.length; i<l; i++) {
nodeSet.push(nodeTabMap[sf.id][sfNodeIds[i]]);
}
return createExportableNodeSet(nodeSet);
}
/**
* Converts the current node selection to an exportable JSON Object
**/
@@ -812,9 +839,10 @@ RED.nodes = (function() {
nns.push(convertNode(configNodes[i], exportCredentials));
}
}
for (i=0;i<nodes.length;i++) {
var node = nodes[i];
nns.push(convertNode(node, exportCredentials));
for (i in nodes) {
if (nodes.hasOwnProperty(i)) {
nns.push(convertNode(nodes[i], exportCredentials));
}
}
return nns;
}
@@ -884,11 +912,164 @@ RED.nodes = (function() {
return true;
}
function importNodes(newNodesObj,createNewIds,createMissingWorkspace) {
function identifyImportConflicts(importedNodes) {
var imported = {
tabs: {},
subflows: {},
groups: {},
configs: {},
nodes: {},
all: [],
conflicted: {},
zMap: {},
}
importedNodes.forEach(function(n) {
imported.all.push(n);
if (n.type === "tab") {
imported.tabs[n.id] = n;
} else if (n.type === "subflow") {
imported.subflows[n.id] = n;
} else if (n.type === "group") {
imported.groups[n.id] = n;
} else if (n.hasOwnProperty("x") && n.hasOwnProperty("y")) {
imported.nodes[n.id] = n;
} else {
imported.configs[n.id] = n;
}
var nodeZ = n.z || "__global__";
imported.zMap[nodeZ] = imported.zMap[nodeZ] || [];
imported.zMap[nodeZ].push(n)
if (nodes[n.id] || configNodes[n.id] || workspaces[n.id] || subflows[n.id] || groups[n.id]) {
imported.conflicted[n.id] = n;
}
})
return imported;
}
/**
* Replace the provided nodes.
* This must contain complete Subflow defs or complete Flow Tabs.
* It does not replace an individual node in the middle of a flow.
*/
function replaceNodes(newNodes) {
var zMap = {};
var newSubflows = {};
var newConfigNodes = {};
var removedNodes = [];
// Figure out what we're being asked to replace - subflows/configNodes
// TODO: config nodes
newNodes.forEach(function(n) {
if (n.type === "subflow") {
newSubflows[n.id] = n;
} else if (!n.hasOwnProperty('x') && !n.hasOwnProperty('y')) {
newConfigNodes[n.id] = n;
}
if (n.z) {
zMap[n.z] = zMap[n.z] || [];
zMap[n.z].push(n);
}
})
// Filter out config nodes inside a subflow def that is being replaced
var configNodeIds = Object.keys(newConfigNodes);
configNodeIds.forEach(function(id) {
var n = newConfigNodes[id];
if (newSubflows[n.z]) {
// This config node is in a subflow to be replaced.
// - remove from the list as it'll get handled with the subflow
delete newConfigNodes[id];
}
});
// Rebuild the list of ids
configNodeIds = Object.keys(newConfigNodes);
// ------------------------------
// Replace subflow definitions
//
// For each of the subflows to be replaced:
var newSubflowIds = Object.keys(newSubflows);
newSubflowIds.forEach(function(id) {
var n = newSubflows[id];
// Get a snapshot of the existing subflow definition
removedNodes = removedNodes.concat(createExportableSubflow(id));
// Remove the old subflow definition - but leave the instances in place
var removalResult = RED.subflow.removeSubflow(n.id, true);
// Create the list of nodes for the new subflow def
var subflowNodes = [n].concat(zMap[n.id]);
// Import the new subflow - no clashes should occur as we've removed
// the old version
var result = importNodes(subflowNodes);
newSubflows[id] = getSubflow(id);
})
// Having replaced the subflow definitions, now need to update the
// instance nodes.
RED.nodes.eachNode(function(n) {
if (/^subflow:/.test(n.type)) {
var sfId = n.type.substring(8);
if (newSubflows[sfId]) {
// This is an instance of one of the replaced subflows
// - update the new def's instances array to include this one
newSubflows[sfId].instances.push(n);
// - update the instance's _def to point to the new def
n._def = RED.nodes.getType(n.type);
// - set all the flags so the view refreshes properly
n.dirty = true;
n.changed = true;
n._colorChanged = true;
}
}
})
newSubflowIds.forEach(function(id) {
var n = newSubflows[id];
RED.events.emit("subflows:change",n);
})
// Just in case the imported subflow changed color.
RED.utils.clearNodeColorCache();
// ------------------------------
// Replace config nodes
//
configNodeIds.forEach(function(id) {
removedNodes = removedNodes.concat(convertNode(getNode(id)));
removeNode(id);
importNodes([newConfigNodes[id]])
});
return {
removedNodes: removedNodes
}
}
/**
* Options:
* - generateIds - whether to replace all node ids
* - addFlow - whether to import nodes to a new tab
* - importToCurrent
* - importMap - how to resolve any conflicts.
* - id:import - import as-is
* - id:copy - import with new id
* - id:replace - import over the top of existing
*/
function importNodes(newNodesObj,options) { // createNewIds,createMissingWorkspace) {
options = options || {
generateIds: false,
addFlow: false,
}
options.importMap = options.importMap || {};
var createNewIds = options.generateIds;
var createMissingWorkspace = options.addFlow;
var i;
var n;
var newNodes;
var nodeZmap = {};
var recoveryWorkspace;
if (typeof newNodesObj === "string") {
if (newNodesObj === "") {
return;
@@ -913,14 +1094,59 @@ RED.nodes = (function() {
// copies of the flow would get loaded at the same time.
// If the user hit deploy they would have saved those duplicates.
var seenIds = {};
var existingNodes = [];
var nodesToReplace = [];
newNodes = newNodes.filter(function(n) {
var id = n.id;
if (seenIds[n.id]) {
return false;
}
seenIds[n.id] = true;
if (!options.generateIds) {
if (!options.importMap[id]) {
// No conflict resolution for this node
var existing = nodes[id] || configNodes[id] || workspaces[id] || subflows[id] || groups[id];
if (existing) {
existingNodes.push({existing:existing, imported:n});
}
} else if (options.importMap[id] === "replace") {
nodesToReplace.push(n);
return false;
}
}
return true;
})
if (existingNodes.length > 0) {
var errorMessage = RED._("clipboard.importDuplicate",{count:existingNodes.length});
var nodeList = $("<ul>");
var existingNodesCount = Math.min(5,existingNodes.length);
for (var i=0;i<existingNodesCount;i++) {
var conflict = existingNodes[i];
$("<li>").text(
conflict.existing.id+
" [ "+conflict.existing.type+ ((conflict.imported.type !== conflict.existing.type)?" | "+conflict.imported.type:"")+" ]").appendTo(nodeList)
}
if (existingNodesCount !== existingNodes.length) {
$("<li>").text(RED._("deploy.confirm.plusNMore",{count:existingNodes.length-existingNodesCount})).appendTo(nodeList)
}
var wrapper = $("<p>").append(nodeList);
var existingNodesError = new Error(errorMessage+wrapper.html());
existingNodesError.code = "import_conflict";
existingNodesError.importConfig = identifyImportConflicts(newNodes);
throw existingNodesError;
}
var removedNodes;
if (nodesToReplace.length > 0) {
var replaceResult = replaceNodes(nodesToReplace);
removedNodes = replaceResult.removedNodes;
}
var isInitialLoad = false;
if (!initialLoad) {
isInitialLoad = true;
@@ -929,6 +1155,7 @@ RED.nodes = (function() {
var unknownTypes = [];
for (i=0;i<newNodes.length;i++) {
n = newNodes[i];
var id = n.id;
// TODO: remove workspace in next release+1
if (n.type != "workspace" &&
n.type != "tab" &&
@@ -942,11 +1169,32 @@ RED.nodes = (function() {
if (n.z) {
nodeZmap[n.z] = nodeZmap[n.z] || [];
nodeZmap[n.z].push(n);
} else if (isInitialLoad && n.hasOwnProperty('x') && n.hasOwnProperty('y') && !n.z) {
// Hit the rare issue where node z values get set to 0.
// Repair the flow - but we really need to track that down.
if (!recoveryWorkspace) {
recoveryWorkspace = {
id: RED.nodes.id(),
type: "tab",
disabled: false,
label: RED._("clipboard.recoveredNodes"),
info: RED._("clipboard.recoveredNodesInfo")
}
addWorkspace(recoveryWorkspace);
RED.workspaces.add(recoveryWorkspace);
nodeZmap[recoveryWorkspace.id] = [];
}
n.z = recoveryWorkspace.id;
nodeZmap[recoveryWorkspace.id].push(n);
}
}
if (!isInitialLoad && unknownTypes.length > 0) {
var typeList = "<ul><li>"+unknownTypes.join("</li><li>")+"</li></ul>";
var typeList = $("<ul>");
unknownTypes.forEach(function(t) {
$("<li>").text(t).appendTo(typeList);
})
typeList = typeList[0].outerHTML;
RED.notify("<p>"+RED._("clipboard.importUnrecognised",{count:unknownTypes.length})+"</p>"+typeList,"error",false,10000);
}
@@ -979,17 +1227,22 @@ RED.nodes = (function() {
var workspace_map = {};
var new_subflows = [];
var subflow_map = {};
var subflow_blacklist = {};
var subflow_denylist = {};
var node_map = {};
var new_nodes = [];
var new_links = [];
var new_groups = [];
var new_group_set = new Set();
var nid;
var def;
var configNode;
var missingWorkspace = null;
var d;
if (recoveryWorkspace) {
new_workspaces.push(recoveryWorkspace);
}
// Find all tabs and subflow templates
for (i=0;i<newNodes.length;i++) {
n = newNodes[i];
@@ -1001,7 +1254,10 @@ RED.nodes = (function() {
if (defaultWorkspace == null) {
defaultWorkspace = n;
}
if (createNewIds) {
if (activeWorkspace === 0) {
activeWorkspace = n.id;
}
if (createNewIds || options.importMap[n.id] === "copy") {
nid = getID();
workspace_map[n.id] = nid;
n.id = nid;
@@ -1010,12 +1266,15 @@ RED.nodes = (function() {
RED.workspaces.add(n);
new_workspaces.push(n);
} else if (n.type === "subflow") {
var matchingSubflow = checkForMatchingSubflow(n,nodeZmap[n.id]);
var matchingSubflow;
if (!options.importMap[n.id]) {
matchingSubflow = checkForMatchingSubflow(n,nodeZmap[n.id]);
}
if (matchingSubflow) {
subflow_blacklist[n.id] = matchingSubflow;
subflow_denylist[n.id] = matchingSubflow;
} else {
subflow_map[n.id] = n;
if (createNewIds) {
if (createNewIds || options.importMap[n.id] === "copy") {
nid = getID();
n.id = nid;
}
@@ -1041,7 +1300,7 @@ RED.nodes = (function() {
n.status.id = getID();
}
new_subflows.push(n);
addSubflow(n,createNewIds);
addSubflow(n,createNewIds || options.importMap[n.id] === "copy");
}
}
}
@@ -1061,9 +1320,9 @@ RED.nodes = (function() {
def = registry.getNodeType(n.type);
if (def && def.category == "config") {
var existingConfigNode = null;
if (createNewIds) {
if (createNewIds || options.importMap[n.id] === "copy") {
if (n.z) {
if (subflow_blacklist[n.z]) {
if (subflow_denylist[n.z]) {
continue;
} else if (subflow_map[n.z]) {
n.z = subflow_map[n.z].id;
@@ -1082,23 +1341,24 @@ RED.nodes = (function() {
}
}
}
existingConfigNode = RED.nodes.node(n.id);
if (existingConfigNode) {
if (n.z && existingConfigNode.z !== n.z) {
existingConfigNode = null;
// Check the config nodes on n.z
for (var cn in configNodes) {
if (configNodes.hasOwnProperty(cn)) {
if (configNodes[cn].z === n.z && compareNodes(configNodes[cn],n,false)) {
existingConfigNode = configNodes[cn];
node_map[n.id] = configNodes[cn];
break;
if (options.importMap[n.id] !== "copy") {
existingConfigNode = RED.nodes.node(n.id);
if (existingConfigNode) {
if (n.z && existingConfigNode.z !== n.z) {
existingConfigNode = null;
// Check the config nodes on n.z
for (var cn in configNodes) {
if (configNodes.hasOwnProperty(cn)) {
if (configNodes[cn].z === n.z && compareNodes(configNodes[cn],n,false)) {
existingConfigNode = configNodes[cn];
node_map[n.id] = configNodes[cn];
break;
}
}
}
}
}
}
}
if (!existingConfigNode || existingConfigNode._def.exclusive) { //} || !compareNodes(existingConfigNode,n,true) || existingConfigNode.z !== n.z) {
@@ -1110,6 +1370,9 @@ RED.nodes = (function() {
users:[],
_config:{}
};
if (!n.z) {
delete configNode.z;
}
if (n.hasOwnProperty('d')) {
configNode.d = n.d;
}
@@ -1129,7 +1392,7 @@ RED.nodes = (function() {
}
configNode.label = def.label;
configNode._def = def;
if (createNewIds) {
if (createNewIds || options.importMap[n.id] === "copy") {
configNode.id = getID();
}
node_map[n.id] = configNode;
@@ -1169,8 +1432,8 @@ RED.nodes = (function() {
if (n.hasOwnProperty('g')) {
node.g = n.g;
}
if (createNewIds) {
if (subflow_blacklist[n.z]) {
if (createNewIds || options.importMap[n.id] === "copy") {
if (subflow_denylist[n.z]) {
continue;
} else if (subflow_map[node.z]) {
node.z = subflow_map[node.z].id;
@@ -1217,8 +1480,8 @@ RED.nodes = (function() {
node._config.y = node.y;
} else if (n.type.substring(0,7) === "subflow") {
var parentId = n.type.split(":")[1];
var subflow = subflow_blacklist[parentId]||subflow_map[parentId]||getSubflow(parentId);
if (createNewIds) {
var subflow = subflow_denylist[parentId]||subflow_map[parentId]||getSubflow(parentId);
if (createNewIds || options.importMap[n.id] === "copy") {
parentId = subflow.id;
node.type = "subflow:"+parentId;
node._def = registry.getNodeType(node.type);
@@ -1252,6 +1515,9 @@ RED.nodes = (function() {
delete node.wires;
delete node.inputLabels;
delete node.outputLabels;
if (!n.z) {
delete node.z;
}
}
var orig = {};
for (var p in n) {
@@ -1312,6 +1578,7 @@ RED.nodes = (function() {
new_nodes.push(node);
} else if (node.type === "group") {
new_groups.push(node);
new_group_set.add(node.id);
}
}
}
@@ -1354,9 +1621,9 @@ RED.nodes = (function() {
for (var d3 in n._def.defaults) {
if (n._def.defaults.hasOwnProperty(d3)) {
if (n._def.defaults[d3].type && node_map[n[d3]]) {
n[d3] = node_map[n[d3]].id;
configNode = RED.nodes.node(n[d3]);
if (configNode && configNode.users.indexOf(n) === -1) {
configNode = node_map[n[d3]];
n[d3] = configNode.id;
if (configNode.users.indexOf(n) === -1) {
configNode.users.push(n);
}
} else if (nodeTypeArrayReferences.hasOwnProperty(n.type) && nodeTypeArrayReferences[n.type] === d3 && n[d3] !== undefined && n[d3] !== null) {
@@ -1377,10 +1644,6 @@ RED.nodes = (function() {
return (otherNode && otherNode.z === activeWorkspace)
});
}
// With all properties now remapped to point at valid nodes,
// we can validate the node
RED.editor.validateNode(n);
}
for (i=0;i<new_subflows.length;i++) {
n = new_subflows[i];
@@ -1419,44 +1682,108 @@ RED.nodes = (function() {
delete n.status.wires;
}
}
// Order the groups to ensure they are outer-most to inner-most
var groupDepthMap = {};
for (i=0;i<new_groups.length;i++) {
n = new_groups[i];
if (n.g && node_map[n.g]) {
n.g = node_map[n.g].id;
} else {
if (n.g && !new_group_set.has(n.g)) {
delete n.g;
}
n.nodes = n.nodes.map(function(id) {
return node_map[id];
})
// Just in case the group references a node that doesn't exist for some reason
n.nodes = n.nodes.filter(function(v) {
if (v) {
// Repair any nodes that have forgotten they are in this group
if (v.g !== n.id) {
v.g = n.id;
}
}
return !!v
});
if (!n.g) {
groupDepthMap[n.id] = 0;
}
}
var changedDepth;
do {
changedDepth = false;
for (i=0;i<new_groups.length;i++) {
n = new_groups[i];
if (n.g) {
if (groupDepthMap[n.id] !== groupDepthMap[n.g] + 1) {
groupDepthMap[n.id] = groupDepthMap[n.g] + 1;
changedDepth = true;
}
}
}
} while(changedDepth);
new_groups.sort(function(A,B) {
return groupDepthMap[A.id] - groupDepthMap[B.id];
});
for (i=0;i<new_groups.length;i++) {
n = new_groups[i];
addGroup(n);
}
// Now the nodes have been fully updated, add them.
for (i=0;i<new_nodes.length;i++) {
var node = new_nodes[i];
addNode(node);
}
// Finally validate them all.
// This has to be done after everything is added so that any checks for
// dependent config nodes will pass
for (i=0;i<new_nodes.length;i++) {
var node = new_nodes[i];
RED.editor.validateNode(node);
}
RED.workspaces.refresh();
return [new_nodes,new_links,new_groups,new_workspaces,new_subflows,missingWorkspace];
if (recoveryWorkspace) {
var notification = RED.notify(RED._("clipboard.recoveredNodesNotification",{flowName:RED._("clipboard.recoveredNodes")}),{
type:"warning",
fixed:true,
buttons: [
{text: RED._("common.label.close"), click: function() { notification.close() }}
]
});
}
return {
nodes:new_nodes,
links:new_links,
groups:new_groups,
workspaces:new_workspaces,
subflows:new_subflows,
missingWorkspace: missingWorkspace,
removedNodes: removedNodes
}
}
// TODO: supports filter.z|type
function filterNodes(filter) {
var result = [];
var searchSet = nodes;
var searchSet = null;
var doZFilter = false;
if (filter.hasOwnProperty("z")) {
if (Object.hasOwnProperty("values") && nodeTabMap.hasOwnProperty(filter.z) ) {
searchSet = Object.values(nodeTabMap[filter.z]);
if (nodeTabMap.hasOwnProperty(filter.z)) {
searchSet = Object.keys(nodeTabMap[filter.z]);
} else {
doZFilter = true;
}
}
if (searchSet === null) {
searchSet = Object.keys(nodes);
}
for (var n=0;n<searchSet.length;n++) {
var node = searchSet[n];
var node = nodes[searchSet[n]];
if (filter.hasOwnProperty("type") && node.type !== filter.type) {
continue;
}
@@ -1525,7 +1852,7 @@ RED.nodes = (function() {
}
function clear() {
nodes = [];
nodes = {};
links = [];
nodeTabMap = {};
configNodes = {};
@@ -1543,8 +1870,10 @@ RED.nodes = (function() {
});
defaultWorkspace = null;
initialLoad = null;
workspaces = {};
RED.nodes.dirty(false);
RED.view.redraw(true);
RED.view.redraw(true, true);
RED.palette.refresh();
RED.workspaces.refresh();
RED.sidebar.config.refresh();
@@ -1553,7 +1882,7 @@ RED.nodes = (function() {
RED.events.emit("workspace:clear");
// var node_defs = {};
// var nodes = [];
// var nodes = {};
// var configNodes = {};
// var links = [];
// var defaultWorkspace;
@@ -1613,12 +1942,13 @@ RED.nodes = (function() {
if (configNodes.hasOwnProperty(n.id)) {
delete configNodes[n.id];
} else {
nodes.splice(nodes.indexOf(n),1);
delete nodes[n.id];
if (nodeTabMap[n.z]) {
delete nodeTabMap[n.z][n.id];
}
}
reimportList.push(convertNode(n));
RED.events.emit('nodes:remove',n);
});
// Remove any links between nodes that are going to be reimported.
@@ -1634,9 +1964,9 @@ RED.nodes = (function() {
// Force the redraw to be synchronous so the view updates
// *now* and removes the unknown node
RED.view.redraw(true, true);
var result = importNodes(reimportList,false);
var result = importNodes(reimportList,{generateIds:false});
var newNodeMap = {};
result[0].forEach(function(n) {
result.nodes.forEach(function(n) {
newNodeMap[n.id] = n;
});
RED.nodes.eachLink(function(l) {
@@ -1693,9 +2023,11 @@ RED.nodes = (function() {
groups: function(z) { return groupsByZ[z]||[] },
eachNode: function(cb) {
for (var n=0;n<nodes.length;n++) {
if (cb(nodes[n]) === false) {
break;
for (var id in nodes) {
if (nodes.hasOwnProperty(id)) {
if (cb(nodes[id]) === false) {
break;
}
}
}
},
@@ -1748,6 +2080,8 @@ RED.nodes = (function() {
import: importNodes,
identifyImportConflicts: identifyImportConflicts,
getAllFlowNodes: getAllFlowNodes,
createExportableNodeSet: createExportableNodeSet,
createCompleteNodeSet: createCompleteNodeSet,

View File

@@ -2,6 +2,14 @@
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
if (isIE11) {
// IE11 DOMTokenList.toggle does not support the two-argument variety
window.DOMTokenList.prototype.toggle = function(cl,bo) {
if (arguments.length === 1) {
bo = !this.contains(cl);
}
this[!!bo?"add":"remove"](cl);
}
// IE11 does not provide classList on SVGElements
if (! ("classList" in SVGElement.prototype)) {
Object.defineProperty(SVGElement.prototype, 'classList', Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'classList'));
@@ -29,5 +37,21 @@
}
return result;
}
if (new Set([0]).size === 0) {
// IE does not support passing an iterable to Set constructor
var _Set = Set;
/*global Set:true */
Set = function Set(iterable) {
var set = new _Set();
if (iterable) {
iterable.forEach(set.add, set);
}
return set;
};
Set.prototype = _Set.prototype;
Set.prototype.constructor = Set;
}
}
})();

View File

@@ -178,11 +178,21 @@ var RED = (function() {
var currentHash = window.location.hash;
RED.nodes.version(nodes.rev);
loader.reportProgress(RED._("event.importFlows"),90 )
RED.nodes.import(nodes.flows);
RED.nodes.dirty(false);
RED.view.redraw(true);
if (/^#flow\/.+$/.test(currentHash)) {
RED.workspaces.show(currentHash.substring(6));
try {
RED.nodes.import(nodes.flows);
RED.nodes.dirty(false);
RED.view.redraw(true);
if (/^#flow\/.+$/.test(currentHash)) {
RED.workspaces.show(currentHash.substring(6));
}
} catch(err) {
RED.notify(
RED._("event.importError", {message: err.message}),
{
fixed: true,
type: 'error'
}
);
}
}
done();
@@ -366,13 +376,13 @@ var RED = (function() {
var parts = topic.split("/");
var node = RED.nodes.node(parts[1]);
if (node) {
if (msg.hasOwnProperty("text") && /^[a-zA-Z]/.test(msg.text)) {
if (msg.hasOwnProperty("text") && msg.text !== null && /^[a-zA-Z]/.test(msg.text)) {
msg.text = node._(msg.text.toString(),{defaultValue:msg.text.toString()});
}
node.status = msg;
node.dirtyStatus = true;
node.dirty = true;
RED.view.redraw();
RED.view.redrawStatus(node);
}
});
RED.comms.subscribe("notification/node/#",function(topic,msg) {

View File

@@ -28,6 +28,8 @@ RED.clipboard = (function() {
var libraryBrowser;
var examplesBrowser;
var pendingImportConfig;
function setupDialogs() {
dialog = $('<div id="red-ui-clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
.appendTo("#red-ui-editor")
@@ -42,14 +44,14 @@ RED.clipboard = (function() {
"ui-widget-overlay": "red-ui-editor-dialog"
},
buttons: [
{
{ // red-ui-clipboard-dialog-cancel
id: "red-ui-clipboard-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
{ // red-ui-clipboard-dialog-download
id: "red-ui-clipboard-dialog-download",
class: "primary",
text: RED._("clipboard.download"),
@@ -64,7 +66,7 @@ RED.clipboard = (function() {
$( this ).dialog( "close" );
}
},
{
{ // red-ui-clipboard-dialog-export
id: "red-ui-clipboard-dialog-export",
class: "primary",
text: RED._("clipboard.export.copy"),
@@ -134,14 +136,14 @@ RED.clipboard = (function() {
}
}
},
{
{ // red-ui-clipboard-dialog-ok
id: "red-ui-clipboard-dialog-ok",
class: "primary",
text: RED._("common.label.import"),
click: function() {
var addNewFlow = ($("#red-ui-clipboard-dialog-import-opt > a.selected").attr('id') === 'red-ui-clipboard-dialog-import-opt-new');
if (activeTab === "red-ui-clipboard-dialog-import-tab-clipboard") {
RED.view.importNodes($("#red-ui-clipboard-dialog-import-text").val(),addNewFlow);
importNodes($("#red-ui-clipboard-dialog-import-text").val(),addNewFlow);
} else {
var selectedPath;
if (activeTab === "red-ui-clipboard-dialog-import-tab-library") {
@@ -151,15 +153,51 @@ RED.clipboard = (function() {
}
if (selectedPath.path) {
$.get('library/'+selectedPath.library+'/'+selectedPath.type+'/'+selectedPath.path, function(data) {
RED.view.importNodes(data,addNewFlow);
importNodes(data,addNewFlow);
});
}
}
$( this ).dialog( "close" );
}
},
{ // red-ui-clipboard-dialog-import-conflict
id: "red-ui-clipboard-dialog-import-conflict",
class: "primary",
text: RED._("clipboard.import.importSelected"),
click: function() {
var importMap = {};
$('#red-ui-clipboard-dialog-import-conflicts-list input[type="checkbox"]').each(function() {
importMap[$(this).attr("data-node-id")] = this.checked?"import":"skip";
})
$('.red-ui-clipboard-dialog-import-conflicts-controls input[type="checkbox"]').each(function() {
if (!$(this).attr("disabled")) {
importMap[$(this).attr("data-node-id")] = this.checked?"replace":"copy"
}
})
// skip - don't import
// import - import as-is
// copy - import with new id
// replace - import over the top of existing
pendingImportConfig.importOptions.importMap = importMap;
var newNodes = pendingImportConfig.importNodes.filter(function(n) {
if (!importMap[n.id] || importMap[n.z]) {
importMap[n.id] = importMap[n.z];
}
return importMap[n.id] !== "skip"
})
// console.table(pendingImportConfig.importNodes.map(function(n) { return {id:n.id,type:n.type,result:importMap[n.id]}}))
RED.view.importNodes(newNodes, pendingImportConfig.importOptions);
$( this ).dialog( "close" );
}
}
],
open: function( event, ui ) {
RED.keyboard.disable();
},
close: function(e) {
RED.keyboard.enable();
if (popover) {
popover.close(true);
currentPopoverError = null;
@@ -232,6 +270,14 @@ RED.clipboard = (function() {
'</span>'+
'</div>';
importConflictsDialog =
'<div class="form-row">'+
'<div class="form-row"><p data-i18n="clipboard.import.conflictNotification1"></p><p data-i18n="clipboard.import.conflictNotification2"></p></div>'+
'<div class="red-ui-clipboard-dialog-import-conflicts-list-container">'+
'<div id="red-ui-clipboard-dialog-import-conflicts-list"></div>'+
'</div>'+
'</div>';
}
var validateExportFilenameTimeout
@@ -355,7 +401,7 @@ RED.clipboard = (function() {
}
}
function importNodes(mode) {
function showImportNodes(mode) {
if (disabled) {
return;
}
@@ -441,6 +487,8 @@ RED.clipboard = (function() {
$("#red-ui-clipboard-dialog-cancel").show();
$("#red-ui-clipboard-dialog-export").hide();
$("#red-ui-clipboard-dialog-download").hide();
$("#red-ui-clipboard-dialog-import-conflict").hide();
$("#red-ui-clipboard-dialog-ok").button("disable");
$("#red-ui-clipboard-dialog-import-text").on("keyup", validateImport);
$("#red-ui-clipboard-dialog-import-text").on('paste',function() { setTimeout(validateImport,10)});
@@ -481,7 +529,9 @@ RED.clipboard = (function() {
}
$(".red-ui-clipboard-dialog-box").height(dialogHeight);
dialog.dialog("option","title",RED._("clipboard.importNodes")).dialog("open");
dialog.dialog("option","title",RED._("clipboard.importNodes"))
.dialog("option","width",700)
.dialog("open");
popover = RED.popover.create({
target: $("#red-ui-clipboard-dialog-import-text"),
trigger: "manual",
@@ -490,7 +540,7 @@ RED.clipboard = (function() {
});
}
function exportNodes(mode) {
function showExportNodes(mode) {
if (disabled) {
return;
}
@@ -627,6 +677,8 @@ RED.clipboard = (function() {
$("#red-ui-clipboard-dialog-ok").hide();
$("#red-ui-clipboard-dialog-cancel").hide();
$("#red-ui-clipboard-dialog-export").hide();
$("#red-ui-clipboard-dialog-import-conflict").hide();
var selection = RED.workspaces.selection();
if (selection.length > 0) {
$("#red-ui-clipboard-dialog-export-rng-selected").trigger("click");
@@ -653,12 +705,15 @@ RED.clipboard = (function() {
}
$(".red-ui-clipboard-dialog-box").height(dialogHeight);
dialog.dialog("option","title",RED._("clipboard.exportNodes")).dialog( "open" );
dialog.dialog("option","title",RED._("clipboard.exportNodes"))
.dialog("option","width",700)
.dialog("open");
$("#red-ui-clipboard-dialog-export-text").trigger("focus");
$("#red-ui-clipboard-dialog-cancel").show();
$("#red-ui-clipboard-dialog-export").show();
$("#red-ui-clipboard-dialog-download").show();
$("#red-ui-clipboard-dialog-import-conflict").hide();
}
@@ -718,6 +773,9 @@ RED.clipboard = (function() {
// representation or null
return null;
}
if (value.type === 'undefined') {
return undefined;
}
}
}
return value;
@@ -742,19 +800,315 @@ RED.clipboard = (function() {
}
return result;
}
function importNodes(nodesStr,addFlow) {
var newNodes = nodesStr;
if (typeof nodesStr === 'string') {
try {
nodesStr = nodesStr.trim();
if (nodesStr.length === 0) {
return;
}
newNodes = JSON.parse(nodesStr);
} catch(err) {
var e = new Error(RED._("clipboard.invalidFlow",{message:err.message}));
e.code = "NODE_RED";
throw e;
}
}
var importOptions = {generateIds: false, addFlow: addFlow};
try {
RED.view.importNodes(newNodes, importOptions);
} catch(error) {
// Thrown for import_conflict
confirmImport(error.importConfig, newNodes, importOptions);
}
}
function confirmImport(importConfig,importNodes,importOptions) {
var notification = RED.notify("<p>"+RED._("clipboard.import.conflictNotification1")+"</p>",{
type: "info",
fixed: true,
buttons: [
{text: RED._("common.label.cancel"), click: function() { notification.close(); }},
{text: RED._("clipboard.import.viewNodes"), click: function() {
notification.close();
showImportConflicts(importConfig,importNodes,importOptions);
}},
{text: RED._("clipboard.import.importCopy"), click: function() {
notification.close();
// generateIds=true to avoid conflicts
// and default to the 'old' behaviour around matching
// config nodes and subflows
importOptions.generateIds = true;
RED.view.importNodes(importNodes, importOptions);
}}
]
})
}
function showImportConflicts(importConfig,importNodes,importOptions) {
pendingImportConfig = {
importConfig: importConfig,
importNodes: importNodes,
importOptions: importOptions
}
var id,node;
var treeData = [];
var container;
var addedHeader = false;
for (id in importConfig.subflows) {
if (importConfig.subflows.hasOwnProperty(id)) {
if (!addedHeader) {
treeData.push({gutter:$('<span data-i18n="menu.label.subflows"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
addedHeader = true;
}
node = importConfig.subflows[id];
var isConflicted = importConfig.conflicted[node.id];
var isSelected = !isConflicted;
var elements = getNodeElement(node, isConflicted, isSelected );
container = {
id: node.id,
gutter: elements.gutter.element,
element: elements.element,
class: isSelected?"":"disabled",
deferBuild: true,
children: []
}
treeData.push(container);
if (importConfig.zMap[id]) {
importConfig.zMap[id].forEach(function(node) {
var childElements = getNodeElement(node, importConfig.conflicted[node.id], isSelected, elements.gutter.cb);
container.children.push({
id: node.id,
gutter: childElements.gutter.element,
element: childElements.element,
class: isSelected?"":"disabled"
})
});
}
}
}
addedHeader = false;
for (id in importConfig.tabs) {
if (importConfig.tabs.hasOwnProperty(id)) {
if (!addedHeader) {
treeData.push({gutter:$('<span data-i18n="menu.label.flows"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
addedHeader = true;
}
node = importConfig.tabs[id];
var isConflicted = importConfig.conflicted[node.id];
var isSelected = true;
var elements = getNodeElement(node, isConflicted, isSelected);
container = {
id: node.id,
gutter: elements.gutter.element,
element: elements.element,
icon: "red-ui-icons red-ui-icons-flow",
deferBuild: true,
class: isSelected?"":"disabled",
children: []
}
treeData.push(container);
if (importConfig.zMap[id]) {
importConfig.zMap[id].forEach(function(node) {
var childElements = getNodeElement(node, importConfig.conflicted[node.id], isSelected, elements.gutter.cb);
container.children.push({
id: node.id,
gutter: childElements.gutter.element,
element: childElements.element,
class: isSelected?"":"disabled"
})
// console.log(" ["+(importConfig.conflicted[node.id]?"*":" ")+"] "+node.type+" "+node.id);
});
}
}
}
addedHeader = false;
var extraNodes = [];
importConfig.all.forEach(function(node) {
if (node.type !== "tab" && node.type !== "subflow" && !importConfig.tabs[node.z] && !importConfig.subflows[node.z]) {
var isConflicted = importConfig.conflicted[node.id];
var isSelected = !isConflicted || !importConfig.configs[node.id];
var elements = getNodeElement(node, isConflicted, isSelected);
var item = {
id: node.id,
gutter: elements.gutter.element,
element: elements.element,
class: isSelected?"":"disabled"
}
if (importConfig.configs[node.id]) {
extraNodes.push(item);
} else {
if (!addedHeader) {
treeData.push({gutter:$('<span data-i18n="menu.label.nodes"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
addedHeader = true;
}
treeData.push(item);
}
// console.log("["+(importConfig.conflicted[node.id]?"*":" ")+"] "+node.type+" "+node.id);
}
})
if (extraNodes.length > 0) {
treeData.push({gutter:$('<span data-i18n="menu.label.displayConfig"></span>'), label: '', class:"red-ui-clipboard-dialog-import-conflicts-item-header"})
addedHeader = true;
treeData = treeData.concat(extraNodes);
}
dialogContainer.empty();
dialogContainer.append($(importConflictsDialog));
var nodeList = $("#red-ui-clipboard-dialog-import-conflicts-list").css({position:"absolute",top:0,right:0,bottom:0,left:0}).treeList({
data: treeData
})
dialogContainer.i18n();
var dialogHeight = 400;
var winHeight = $(window).height();
if (winHeight < 600) {
dialogHeight = 400 - (600 - winHeight);
}
$(".red-ui-clipboard-dialog-box").height(dialogHeight);
$("#red-ui-clipboard-dialog-ok").hide();
$("#red-ui-clipboard-dialog-cancel").show();
$("#red-ui-clipboard-dialog-export").hide();
$("#red-ui-clipboard-dialog-download").hide();
$("#red-ui-clipboard-dialog-import-conflict").show();
dialog.dialog("option","title",RED._("clipboard.importNodes"))
.dialog("option","width",500)
.dialog( "open" );
}
function getNodeElement(n, isConflicted, isSelected, parent) {
var element;
if (n.type === "tab") {
element = getFlowLabel(n, isSelected);
} else {
element = getNodeLabel(n, isConflicted, isSelected);
}
var controls = $('<div>',{class:"red-ui-clipboard-dialog-import-conflicts-controls"}).appendTo(element);
controls.on("click", function(evt) { evt.stopPropagation(); });
if (isConflicted && !parent) {
var cb = $('<label><input '+(isSelected?'':'disabled ')+'type="checkbox" data-node-id="'+n.id+'"> <span data-i18n="clipboard.import.replace"></span></label>').appendTo(controls);
if (n.type === "tab" || (n.type !== "subflow" && n.hasOwnProperty("x") && n.hasOwnProperty("y"))) {
cb.hide();
}
}
return {
element: element,
gutter: getGutter(n, isSelected, parent)
}
}
function getGutter(n, isSelected, parent) {
var span = $("<label>",{class:"red-ui-clipboard-dialog-import-conflicts-gutter"});
var cb = $('<input data-node-id="'+n.id+'" type="checkbox" '+(isSelected?"checked":"")+'>').appendTo(span);
if (parent) {
cb.attr("disabled",true);
parent.addChild(cb);
}
span.on("click", function(evt) {
evt.stopPropagation();
})
cb.on("change", function(evt) {
var state = this.checked;
span.parent().toggleClass("disabled",!!!state);
span.parent().find('.red-ui-clipboard-dialog-import-conflicts-controls input[type="checkbox"]').attr("disabled",!!!state);
childItems.forEach(function(c) {
c.attr("checked",state);
c.trigger("change");
});
})
var childItems = [];
var checkbox = {
addChild: function(c) {
childItems.push(c);
}
}
return {
cb: checkbox,
element: span
}
}
function getNodeLabelText(n) {
var label = n.name || n.type+": "+n.id;
if (n._def.label) {
try {
label = (typeof n._def.label === "function" ? n._def.label.call(n) : n._def.label)||"";
} catch(err) {
console.log("Definition error: "+n.type+".label",err);
}
}
var newlineIndex = label.indexOf("\\n");
if (newlineIndex > -1) {
label = label.substring(0,newlineIndex)+"...";
}
return label;
}
function getFlowLabel(n) {
n = JSON.parse(JSON.stringify(n));
n._def = RED.nodes.getType(n.type) || {};
if (n._def) {
n._ = n._def._;
}
var div = $('<div>',{class:"red-ui-info-outline-item red-ui-info-outline-item-flow"});
var contentDiv = $('<div>',{class:"red-ui-search-result-description red-ui-info-outline-item-label"}).appendTo(div);
var label = (typeof n === "string")? n : n.label;
var newlineIndex = label.indexOf("\\n");
if (newlineIndex > -1) {
label = label.substring(0,newlineIndex)+"...";
}
contentDiv.text(label);
// A conflicted flow should not be imported by default.
return div;
}
function getNodeLabel(n, isConflicted) {
n = JSON.parse(JSON.stringify(n));
n._def = RED.nodes.getType(n.type) || {};
if (n._def) {
n._ = n._def._;
}
var div = $('<div>',{class:"red-ui-info-outline-item"});
RED.utils.createNodeIcon(n).appendTo(div);
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
var labelText = getNodeLabelText(n);
var label = $('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).appendTo(contentDiv);
if (labelText) {
label.text(labelText)
} else {
label.html(n.type)
}
return div;
}
return {
init: function() {
setupDialogs();
$('<input type="text" id="red-ui-clipboard-hidden" tabIndex="-1">').appendTo("#red-ui-editor");
RED.actions.add("core:show-export-dialog",exportNodes);
RED.actions.add("core:show-import-dialog",importNodes);
RED.actions.add("core:show-export-dialog",showExportNodes);
RED.actions.add("core:show-import-dialog",showImportNodes);
RED.actions.add("core:show-library-export-dialog",function() { exportNodes('library') });
RED.actions.add("core:show-library-import-dialog",function() { importNodes('library') });
RED.actions.add("core:show-library-export-dialog",function() { showExportNodes('library') });
RED.actions.add("core:show-library-import-dialog",function() { showImportNodes('library') });
RED.actions.add("core:show-examples-import-dialog",function() { importNodes('examples') });
RED.actions.add("core:show-examples-import-dialog",function() { showImportNodes('examples') });
RED.events.on("editor:open",function() { disabled = true; });
RED.events.on("editor:close",function() { disabled = false; });
@@ -788,7 +1142,7 @@ RED.clipboard = (function() {
if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) {
var data = event.originalEvent.dataTransfer.getData("text/plain");
data = data.substring(data.indexOf('['),data.lastIndexOf(']')+1);
RED.view.importNodes(data);
importNodes(data);
} else if ($.inArray("Files",event.originalEvent.dataTransfer.types) != -1) {
var files = event.originalEvent.dataTransfer.files;
if (files.length === 1) {
@@ -796,7 +1150,7 @@ RED.clipboard = (function() {
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
RED.view.importNodes(e.target.result);
importNodes(e.target.result);
};
})(file);
reader.readAsText(file);
@@ -807,8 +1161,8 @@ RED.clipboard = (function() {
});
},
import: importNodes,
export: exportNodes,
import: showImportNodes,
export: showExportNodes,
copyText: copyText
}
})();

View File

@@ -27,26 +27,26 @@
this.partialFlag = false;
this.stateValue = 0;
var initialState = this.element.prop('checked');
this.options = [
this.states = [
$('<span class="red-ui-checkboxSet-option hide"><i class="fa fa-square-o"></i></span>').appendTo(this.uiElement),
$('<span class="red-ui-checkboxSet-option hide"><i class="fa fa-check-square-o"></i></span>').appendTo(this.uiElement),
$('<span class="red-ui-checkboxSet-option hide"><i class="fa fa-minus-square-o"></i></span>').appendTo(this.uiElement)
];
if (initialState) {
this.options[1].show();
this.states[1].show();
} else {
this.options[0].show();
this.states[0].show();
}
this.element.on("change", function() {
if (this.checked) {
that.options[0].hide();
that.options[1].show();
that.options[2].hide();
that.states[0].hide();
that.states[1].show();
that.states[2].hide();
} else {
that.options[1].hide();
that.options[0].show();
that.options[2].hide();
that.states[1].hide();
that.states[0].show();
that.states[2].hide();
}
var isChecked = this.checked;
that.children.forEach(function(child) {
@@ -106,17 +106,17 @@
var trueState = this.partialFlag||state;
this.element.prop('checked',trueState);
if (state === true) {
this.options[0].hide();
this.options[1].show();
this.options[2].hide();
this.states[0].hide();
this.states[1].show();
this.states[2].hide();
} else if (state === false) {
this.options[2].hide();
this.options[1].hide();
this.options[0].show();
this.states[2].hide();
this.states[1].hide();
this.states[0].show();
} else if (state === null) {
this.options[0].hide();
this.options[1].hide();
this.options[2].show();
this.states[0].hide();
this.states[1].hide();
this.states[2].show();
}
if (!suppressEvent) {
this.element.trigger('change',null);

View File

@@ -73,7 +73,7 @@ RED.colorPicker = (function() {
type:"text",
value:colorHiddenInput.val()
}).appendTo(row);
var focusTarget = colorInput;
colorInput.on("change", function (e) {
var color = colorInput.val();
colorHiddenInput.val(color).trigger('change');
@@ -188,8 +188,14 @@ RED.colorPicker = (function() {
refreshDisplay(colorHiddenInput.val())
},50);
colorPanel.show({
target: colorButton
target: colorButton,
onclose: function() {
colorButton.focus();
}
})
if (focusTarget) {
focusTarget.focus();
}
});
setTimeout(function() {
refreshDisplay(colorHiddenInput.val())

View File

@@ -33,7 +33,7 @@
* methods:
* - addItem(itemData)
* - insertItemAt : function(data,index) - add an item at the specified index
* - removeItem(itemData)
* - removeItem(itemData, detach) - remove the item. Optionally detach to preserve any event handlers on the item's label
* - getItemAt(index)
* - indexOf(itemData)
* - width(width)
@@ -91,6 +91,9 @@
if (v!=="auto" && v!=="") {
that.topContainer.css(s,v);
that.uiContainer.css(s,"0");
if (s === "top" && that.options.header) {
that.uiContainer.css(s,"20px")
}
that.element.css(s,'auto');
}
})
@@ -259,28 +262,6 @@
var that = this;
data = data || {};
var li = $('<li>');
var added = false;
if (this.activeSort) {
var items = this.items();
var skip = false;
items.each(function(i,el) {
if (added) { return }
var itemData = el.data('data');
if (that.activeSort(data,itemData) < 0) {
li.insertBefore(el.closest("li"));
added = true;
}
});
}
if (!added) {
if (index <= 0) {
li.prependTo(this.element);
} else if (index > that.element.children().length-1) {
li.appendTo(this.element);
} else {
li.insertBefore(this.element.children().eq(index));
}
}
var row = $('<div/>').addClass("red-ui-editableList-item-content").appendTo(li);
row.data('data',data);
if (this.options.sortable === true) {
@@ -303,6 +284,28 @@
});
});
}
var added = false;
if (this.activeSort) {
var items = this.items();
var skip = false;
items.each(function(i,el) {
if (added) { return }
var itemData = el.data('data');
if (that.activeSort(data,itemData) < 0) {
li.insertBefore(el.closest("li"));
added = true;
}
});
}
if (!added) {
if (index <= 0) {
li.prependTo(this.element);
} else if (index > that.element.children().length-1) {
li.appendTo(this.element);
} else {
li.insertBefore(this.element.children().eq(index));
}
}
if (this.options.addItem) {
var index = that.element.children().length-1;
// setTimeout(function() {
@@ -332,11 +335,15 @@
this.addItem(items[i]);
}
},
removeItem: function(data) {
removeItem: function(data,detach) {
var items = this.element.children().filter(function(f) {
return data === $(this).children(".red-ui-editableList-item-content").data('data');
});
items.remove();
if (detach) {
items.detach();
} else {
items.remove();
}
if (this.options.removeItem) {
this.options.removeItem(data);
}

View File

@@ -158,7 +158,7 @@ RED.menu = (function() {
activeMenu = null;
topMenu.hide();
});
$(".red-ui-menu").hide();
$(".red-ui-menu.red-ui-menu-dropdown").hide();
topMenu.show();
}
})

View File

@@ -84,6 +84,7 @@ RED.popover = (function() {
var targetHeight = target.outerHeight();
var divHeight = div.height();
var divWidth = div.width();
var paddingRight = 10;
var viewportTop = $(window).scrollTop();
var viewportLeft = $(window).scrollLeft();
@@ -105,7 +106,7 @@ RED.popover = (function() {
d = "right";
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
left = targetPos.left+targetWidth+deltaSizes[size].leftRight;
} else if (left+divWidth > viewportRight) {
} else if (left+divWidth+paddingRight > viewportRight) {
d = "left";
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
left = targetPos.left-deltaSizes[size].leftLeft-divWidth;
@@ -278,6 +279,85 @@ RED.popover = (function() {
delay: { show: 750, hide: 50 }
});
},
menu: function(options) {
var list = $('<ul class="red-ui-menu"></ul>');
if (options.style === 'compact') {
list.addClass("red-ui-menu-compact");
}
var menuOptions = options.options || [];
var first;
menuOptions.forEach(function(opt) {
var item = $('<li>').appendTo(list);
var link = $('<a href="#"></a>').text(opt.label).appendTo(item);
link.on("click", function(evt) {
evt.preventDefault();
if (opt.onselect) {
opt.onselect();
}
menu.hide();
})
if (!first) { first = link}
})
var container = RED.popover.panel(list);
var menu = {
show: function(opts) {
$(document).on("keydown.red-ui-menu", function(evt) {
var currentItem = list.find(":focus").parent();
if (evt.keyCode === 40) {
evt.preventDefault();
// DOWN
if (currentItem.length > 0) {
if (currentItem.index() === menuOptions.length-1) {
console.log("WARP TO TOP")
// Wrap to top of list
list.children().first().children().first().focus();
} else {
console.log("GO DOWN ONE")
currentItem.next().children().first().focus();
}
} else {
list.children().first().children().first().focus();
}
} else if (evt.keyCode === 38) {
evt.preventDefault();
// UP
if (currentItem.length > 0) {
if (currentItem.index() === 0) {
console.log("WARP TO BOTTOM")
// Wrap to bottom of list
list.children().last().children().first().focus();
} else {
console.log("GO UP ONE")
currentItem.prev().children().first().focus();
}
} else {
list.children().last().children().first().focus();
}
} else if (evt.keyCode === 27) {
// ESCAPE
evt.preventDefault();
menu.hide(true);
}
evt.stopPropagation();
})
opts.onclose = function() {
$(document).off("keydown.red-ui-menu");
if (options.onclose) {
options.onclose(true);
}
}
container.show(opts);
},
hide: function(cancelled) {
$(document).off("keydown.red-ui-menu");
container.hide(options.disposeOnClose);
if (options.onclose) {
options.onclose(cancelled);
}
}
}
return menu;
},
panel: function(content) {
var panel = $('<div class="red-ui-editor-dialog red-ui-popover-panel"></div>');
panel.css({ display: "none" });
@@ -285,18 +365,21 @@ RED.popover = (function() {
content.appendTo(panel);
var closeCallback;
function hide() {
function hide(dispose) {
$(document).off("mousedown.red-ui-popover-panel-close");
$(document).off("keydown.red-ui-popover-panel-close");
panel.hide();
panel.css({
height: "auto"
});
panel.remove();
if (dispose !== false) {
panel.remove();
}
}
function show(options) {
var closeCallback = options.onclose;
var target = options.target;
var align = options.align || "left";
var align = options.align || "right";
var offset = options.offset || [0,0];
var pos = target.offset();
@@ -313,12 +396,12 @@ RED.popover = (function() {
panelHeight.height(panelHeight+top)
top = 0;
}
if (align === "left") {
if (align === "right") {
panel.css({
top: top+"px",
left: (pos.left+offset[0])+"px",
});
} else if(align === "right") {
} else if (align === "left") {
panel.css({
top: top+"px",
left: (pos.left-panelWidth+offset[0])+"px",
@@ -326,12 +409,22 @@ RED.popover = (function() {
}
panel.slideDown(100);
$(document).on("keydown.red-ui-popover-panel-close", function(event) {
if (event.keyCode === 27) {
// ESCAPE
if (closeCallback) {
closeCallback();
}
hide(options.dispose);
}
});
$(document).on("mousedown.red-ui-popover-panel-close", function(event) {
if(!$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) {
if (closeCallback) {
closeCallback();
}
hide();
hide(options.dispose);
}
// if ($(event.target).closest(target).length) {
// event.preventDefault();

View File

@@ -48,7 +48,7 @@
form.addClass("red-ui-searchBox-form");
}
$('<i class="fa fa-search"></i>').prependTo(this.uiContainer);
this.clearButton = $('<a href="#"><i class="fa fa-times"></i></a>').appendTo(this.uiContainer);
this.clearButton = $('<a class="red-ui-searchBox-clear" href="#"><i class="fa fa-times"></i></a>').appendTo(this.uiContainer);
this.clearButton.on("click",function(e) {
e.preventDefault();
that.element.val("");
@@ -56,6 +56,62 @@
that.element.trigger("focus");
});
if (this.options.options) {
this.uiContainer.addClass("red-ui-searchBox-has-options");
this.optsButton = $('<a class="red-ui-searchBox-opts" href="#"><i class="fa fa-caret-down"></i></a>').appendTo(this.uiContainer);
var menuShown = false;
this.optsMenu = RED.popover.menu({
style: this.options.style,
options: this.options.options.map(function(opt) {
return {
label: opt.label,
onselect: function() {
that.element.val(opt.value+" ");
that._change(opt.value,true);
}
}
}),
onclose: function(cancelled) {
menuShown = false;
that.element.trigger("focus");
},
disposeOnClose: false
});
var showMenu = function() {
menuShown = true;
that.optsMenu.show({
target: that.optsButton,
align: "left",
offset: [that.optsButton.width()-2,-1],
dispose: false
})
}
this.optsButton.on("click",function(e) {
e.preventDefault();
if (!menuShown) {
showMenu();
} else {
// TODO: This doesn't quite work because the panel's own
// mousedown handler triggers a close before this click
// handler fires.
that.optsMenu.hide(true);
}
});
this.optsButton.on("keydown",function(e) {
if (!menuShown && e.keyCode === 40) {
//DOWN
showMenu();
}
});
this.element.on("keydown",function(e) {
if (!menuShown && e.keyCode === 40) {
//DOWN
showMenu();
}
});
}
this.resultCount = $('<span>',{class:"red-ui-searchBox-resultCount hide"}).appendTo(this.uiContainer);
this.element.val("");
@@ -63,6 +119,9 @@
if (evt.keyCode === 27) {
that.element.val("");
}
if (evt.keyCode === 13) {
evt.preventDefault();
}
})
this.element.on("keyup",function(evt) {
that._change($(this).val());

View File

@@ -29,7 +29,7 @@ RED.tabs = (function() {
var currentTabWidth;
var currentActiveTabWidth = 0;
var collapsibleMenu;
var preferredOrder = options.order;
var ul = options.element || $("#"+options.id);
var wrapper = ul.wrap( "<div>" ).parent();
var scrollContainer = ul.wrap( "<div>" ).parent();
@@ -132,11 +132,11 @@ RED.tabs = (function() {
activateTab(id);
}
};
if (tabs[id].pinned) {
pinnedOptions.push(opt);
} else {
// if (tabs[id].pinned) {
// pinnedOptions.push(opt);
// } else {
options.push(opt);
}
// }
});
options = pinnedOptions.concat(options);
collapsibleMenu = RED.menu.init({options: options});
@@ -153,7 +153,7 @@ RED.tabs = (function() {
if (collapsibleMenu.is(":visible")) {
$(document).off("click.red-ui-tabmenu");
} else {
$(".red-ui-menu").hide();
$(".red-ui-menu.red-ui-menu-dropdown").hide();
$(document).on("click.red-ui-tabmenu", function(evt) {
$(document).off("click.red-ui-tabmenu");
collapsibleMenu.hide();
@@ -363,23 +363,39 @@ RED.tabs = (function() {
var tabWidth;
if (options.collapsible) {
var availableCount = collapsedButtonsRow.children().length;
var visibleCount = collapsedButtonsRow.children(":visible").length;
tabWidth = width - collapsedButtonsRow.width()-10;
if (tabWidth < 198) {
var delta = 198 - tabWidth;
var maxTabWidth = 198;
var minTabWidth = 80;
if (tabWidth <= minTabWidth || (tabWidth < maxTabWidth && visibleCount > 5)) {
// The tab is too small. Hide the next button to make room
// Start at the end of the button row, -1 for the menu button
var b = collapsedButtonsRow.find("a:last").prev();
var index = collapsedButtonsRow.children().length - 2;
// Work backwards to find the first visible button
while (b.is(":not(:visible)")) {
b = b.prev();
index--;
}
if (!b.hasClass("red-ui-tab-link-button-pinned")) {
// If it isn't a pinned button, hide it to get the room
if (tabWidth <= minTabWidth || visibleCount>6) {//}!b.hasClass("red-ui-tab-link-button-pinned")) {
b.hide();
}
tabWidth = width - collapsedButtonsRow.width()-10;
tabWidth = Math.max(minTabWidth,width - collapsedButtonsRow.width()-10);
} else {
var space = width - 198 - collapsedButtonsRow.width();
if (visibleCount !== availableCount) {
if (visibleCount < 6) {
tabWidth = minTabWidth;
} else {
tabWidth = maxTabWidth;
}
}
var space = width - tabWidth - collapsedButtonsRow.width();
if (space > 40) {
collapsedButtonsRow.find("a:not(:visible):first").show();
tabWidth = width - collapsedButtonsRow.width()-10;
}
tabWidth = width - collapsedButtonsRow.width()-10;
}
tabs.css({width:tabWidth});
@@ -469,7 +485,7 @@ RED.tabs = (function() {
}
}
return {
var tabAPI = {
addTab: function(tab,targetIndex) {
if (options.onselect) {
var selection = ul.find("li.red-ui-tab.selected");
@@ -531,11 +547,93 @@ RED.tabs = (function() {
evt.preventDefault();
activateTab(tab.id);
});
pinnedLink.data("tabId",tab.id)
if (tab.pinned) {
pinnedLink.addClass("red-ui-tab-link-button-pinned");
pinnedTabsCount++;
}
RED.popover.tooltip($(pinnedLink), tab.name, tab.action);
if (options.onreorder) {
var pinnedLinkIndex;
var pinnedLinks = [];
var startPinnedIndex;
pinnedLink.draggable({
distance: 10,
axis:"x",
containment: ".red-ui-tab-link-buttons",
start: function(event,ui) {
dragActive = true;
$(".red-ui-tab-link-buttons").width($(".red-ui-tab-link-buttons").width());
if (dblClickArmed) { dblClickArmed = false; return false }
collapsedButtonsRow.children().each(function(i) {
pinnedLinks[i] = {
el:$(this),
text: $(this).text(),
left: $(this).position().left,
width: $(this).width(),
menu: $(this).hasClass("red-ui-tab-link-button-menu")
};
if ($(this).is(pinnedLink)) {
pinnedLinkIndex = i;
startPinnedIndex = i;
}
});
collapsedButtonsRow.children().each(function(i) {
if (i!==pinnedLinkIndex) {
$(this).css({
position: 'absolute',
left: pinnedLinks[i].left+"px",
width: pinnedLinks[i].width+2,
transition: "left 0.3s"
});
}
})
if (!pinnedLink.hasClass('active')) {
pinnedLink.css({'zIndex':1});
}
},
drag: function(event,ui) {
ui.position.left += pinnedLinks[pinnedLinkIndex].left;
var tabCenter = ui.position.left + pinnedLinks[pinnedLinkIndex].width/2;
for (var i=0;i<pinnedLinks.length;i++) {
if (i === pinnedLinkIndex || pinnedLinks[i].menu || pinnedLinks[i].el.is(":not(:visible)")) {
continue;
}
if (tabCenter > pinnedLinks[i].left && tabCenter < pinnedLinks[i].left+pinnedLinks[i].width) {
if (i < pinnedLinkIndex) {
pinnedLinks[i].left += pinnedLinks[pinnedLinkIndex].width+8;
pinnedLinks[pinnedLinkIndex].el.detach().insertBefore(pinnedLinks[i].el);
} else {
pinnedLinks[i].left -= pinnedLinks[pinnedLinkIndex].width+8;
pinnedLinks[pinnedLinkIndex].el.detach().insertAfter(pinnedLinks[i].el);
}
pinnedLinks[i].el.css({left:pinnedLinks[i].left+"px"});
pinnedLinks.splice(i, 0, pinnedLinks.splice(pinnedLinkIndex, 1)[0]);
pinnedLinkIndex = i;
break;
}
}
},
stop: function(event,ui) {
dragActive = false;
collapsedButtonsRow.children().css({position:"relative",left:"",transition:""});
$(".red-ui-tab-link-buttons").width('auto');
pinnedLink.css({zIndex:""});
updateTabWidths();
if (startPinnedIndex !== pinnedLinkIndex) {
if (collapsibleMenu) {
collapsibleMenu.remove();
collapsibleMenu = null;
}
var newOrder = $.makeArray(collapsedButtonsRow.children().map(function() { return $(this).data('tabId');}));
tabAPI.order(newOrder);
options.onreorder(newOrder);
}
}
});
}
}
link.on("mouseup",onTabClick);
@@ -565,7 +663,7 @@ RED.tabs = (function() {
if (ul.find("li.red-ui-tab").length == 1) {
activateTab(link);
}
if (options.onreorder) {
if (options.onreorder && !options.collapsible) {
var originalTabOrder;
var tabDragIndex;
var tabElements = [];
@@ -652,6 +750,9 @@ RED.tabs = (function() {
collapsibleMenu.remove();
collapsibleMenu = null;
}
if (preferredOrder) {
tabAPI.order(preferredOrder);
}
},
removeTab: removeTab,
activateTab: activateTab,
@@ -673,10 +774,8 @@ RED.tabs = (function() {
},
selection: getSelection,
order: function(order) {
preferredOrder = order;
var existingTabOrder = $.makeArray(ul.children().map(function() { return $(this).data('tabId');}));
if (existingTabOrder.length !== order.length) {
return
}
var i;
var match = true;
for (i=0;i<order.length;i++) {
@@ -692,12 +791,41 @@ RED.tabs = (function() {
var existingTabs = ul.children().detach().each(function() {
existingTabMap[$(this).data("tabId")] = $(this);
});
var pinnedButtons = {};
if (options.collapsible) {
collapsedButtonsRow.children().detach().each(function() {
var id = $(this).data("tabId");
if (!id) {
id = "__menu__"
}
pinnedButtons[id] = $(this);
});
}
for (i=0;i<order.length;i++) {
existingTabMap[order[i]].appendTo(ul);
if (existingTabMap[order[i]]) {
existingTabMap[order[i]].appendTo(ul);
if (options.collapsible) {
pinnedButtons[order[i]].appendTo(collapsedButtonsRow);
}
delete existingTabMap[order[i]];
}
}
// Add any tabs that aren't known in the order
for (i in existingTabMap) {
if (existingTabMap.hasOwnProperty(i)) {
existingTabMap[i].appendTo(ul);
if (options.collapsible) {
pinnedButtons[i].appendTo(collapsedButtonsRow);
}
}
}
if (options.collapsible) {
pinnedButtons["__menu__"].appendTo(collapsedButtonsRow);
updateTabWidths();
}
}
}
return tabAPI;
}
return {

View File

@@ -37,8 +37,8 @@
invertState = this.options.invertState;
}
var baseClass = this.options.baseClass || "red-ui-button";
var enabledIcon = this.options.enabledIcon || "fa-check-square-o";
var disabledIcon = this.options.disabledIcon || "fa-square-o";
var enabledIcon = this.options.hasOwnProperty('enabledIcon')?this.options.enabledIcon : "fa-check-square-o";
var disabledIcon = this.options.hasOwnProperty('disabledIcon')?this.options.disabledIcon : "fa-square-o";
var enabledLabel = this.options.hasOwnProperty('enabledLabel') ? this.options.enabledLabel : RED._("editor:workspace.enabled");
var disabledLabel = this.options.hasOwnProperty('disabledLabel') ? this.options.disabledLabel : RED._("editor:workspace.disabled");
@@ -46,25 +46,41 @@
this.element.on("focus", function() {
that.button.focus();
});
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"><i class="fa"></i> <span></span></button>');
this.button = $('<button type="button" class="red-ui-toggleButton '+baseClass+' toggle single"></button>');
if (enabledLabel || disabledLabel) {
this.buttonLabel = $("<span>").appendTo(this.button);
}
if (this.options.class) {
this.button.addClass(this.options.class)
}
this.element.after(this.button);
this.buttonIcon = this.button.find("i");
this.buttonLabel = this.button.find("span");
if (enabledIcon && disabledIcon) {
this.buttonIcon = $('<i class="fa"></i>').prependTo(this.button);
}
// Quick hack to find the maximum width of the button
this.button.addClass("selected");
this.buttonIcon.addClass(enabledIcon);
this.buttonLabel.text(enabledLabel);
if (this.buttonIcon) {
this.buttonIcon.addClass(enabledIcon);
}
if (this.buttonLabel) {
this.buttonLabel.text(enabledLabel);
}
var width = this.button.width();
this.button.removeClass("selected");
this.buttonIcon.removeClass(enabledIcon);
that.buttonIcon.addClass(disabledIcon);
that.buttonLabel.text(disabledLabel);
if (this.buttonIcon) {
this.buttonIcon.removeClass(enabledIcon);
that.buttonIcon.addClass(disabledIcon);
}
if (this.buttonLabel) {
that.buttonLabel.text(disabledLabel);
}
width = Math.max(width,this.button.width());
this.buttonIcon.removeClass(disabledIcon);
if (this.buttonIcon) {
this.buttonIcon.removeClass(disabledIcon);
}
// Fix the width of the button so it doesn't jump around when toggled
if (width > 0) {
@@ -73,7 +89,7 @@
this.button.on("click",function(e) {
e.stopPropagation();
if (that.buttonIcon.hasClass(disabledIcon)) {
if (!that.state) {
that.element.prop("checked",!invertState);
} else {
that.element.prop("checked",invertState);
@@ -84,14 +100,24 @@
this.element.on("change", function(e) {
if ($(this).prop("checked") !== invertState) {
that.button.addClass("selected");
that.buttonIcon.addClass(enabledIcon);
that.buttonIcon.removeClass(disabledIcon);
that.buttonLabel.text(enabledLabel);
that.state = true;
if (that.buttonIcon) {
that.buttonIcon.addClass(enabledIcon);
that.buttonIcon.removeClass(disabledIcon);
}
if (that.buttonLabel) {
that.buttonLabel.text(enabledLabel);
}
} else {
that.button.removeClass("selected");
that.buttonIcon.addClass(disabledIcon);
that.buttonIcon.removeClass(enabledIcon);
that.buttonLabel.text(disabledLabel);
that.state = false;
if (that.buttonIcon) {
that.buttonIcon.addClass(disabledIcon);
that.buttonIcon.removeClass(enabledIcon);
}
if (that.buttonLabel) {
that.buttonLabel.text(disabledLabel);
}
}
})
this.element.trigger("change");

View File

@@ -65,7 +65,7 @@
* item.treeList.container
* item.treeList.label - the label element for the item
* item.treeList.parentList - the editableList instance this item is in
* item.treeList.remove() - removes the item from the tree
* item.treeList.remove(detach) - removes the item from the tree. Optionally detach to preserve any event handlers on the item's label
* item.treeList.makeLeaf(detachChildElements) - turns an element with children into a leaf node,
* removing the UI decoration etc.
* detachChildElements - any children with custom
@@ -167,7 +167,7 @@
this._selected = new Set();
this._topList = $('<ol class="red-ui-treeList-list">').css({
position:'absolute',
top: 0,
top:0,
left:0,
right:0,
bottom:0
@@ -181,6 +181,9 @@
that._addSubtree(that._topList,container,item,0);
}
};
if (this.options.header) {
topListOptions.header = this.options.header;
}
if (this.options.rootSortable !== false && !!this.options.sortable) {
topListOptions.sortable = this.options.sortable;
topListOptions.connectWith = '.red-ui-treeList-sortable';
@@ -228,7 +231,7 @@
return candidates[index+1];
}
},
_addChildren: function(container,parent,children,depth) {
_addChildren: function(container,parent,children,depth,onCompleteChildren) {
var that = this;
var subtree = $('<ol class="red-ui-treeList-list">').appendTo(container).editableList({
connectWith: ".red-ui-treeList-sortable",
@@ -263,10 +266,32 @@
if (!!that.options.sortable) {
subtree.addClass('red-ui-treeList-sortable');
}
for (var i=0;i<children.length;i++) {
children[i].parent = parent;
subtree.editableList('addItem',children[i])
var sliceSize = 30;
var index = 0;
var addSlice = function() {
var start = index;
for (var i=0;i<sliceSize;i++) {
index = start+i;
if (index === children.length) {
setTimeout(function() {
if (onCompleteChildren) {
onCompleteChildren();
}
},10);
return;
}
children[index].parent = parent;
subtree.editableList('addItem',children[index])
}
index++;
if (index < children.length) {
setTimeout(function() {
addSlice();
},10);
}
}
addSlice();
subtree.hide()
return subtree;
},
_fixDepths: function(parent,child) {
@@ -311,9 +336,9 @@
this._items[item.id] = item;
item.treeList = {};
item.depth = depth;
item.treeList.remove = function() {
item.treeList.remove = function(detach) {
if (item.treeList.parentList) {
item.treeList.parentList.editableList('removeItem',item);
item.treeList.parentList.editableList('removeItem',item,detach);
}
if (item.parent) {
var index = item.parent.children.indexOf(item);
@@ -322,7 +347,7 @@
}
that._selected.delete(item);
delete item.treeList;
delete(that._items[item.id]);
delete that._items[item.id];
}
item.treeList.insertChildAt = function(newItem,position,select) {
newItem.parent = item;
@@ -338,7 +363,7 @@
}
processChildren(item,newItem);
if (!item.deferBuild) {
if (!item.deferBuild && item.treeList.childList) {
item.treeList.childList.editableList('insertItemAt',newItem,position)
if (select) {
setTimeout(function() {
@@ -346,6 +371,10 @@
},100);
}
that._trigger("sort",null,item);
if (that.activeFilter) {
that.filter(that.activeFilter);
}
}
}
item.treeList.addChild = function(newItem,select) {
@@ -372,9 +401,13 @@
var childrenAdded = false;
var spinner;
var startTime = 0;
var started = Date.now();
var completeBuild = function(children) {
childrenAdded = true;
item.treeList.childList = that._addChildren(container,item,children,depth).hide();
item.treeList.childList = that._addChildren(container,item,children,depth, function() {
if (done) { done(true) }
that._trigger("childrenloaded",null,item)
});
var delta = Date.now() - startTime;
if (delta < 400) {
setTimeout(function() {
@@ -390,8 +423,6 @@
}
}
item.expanded = true;
if (done) { done(true) }
that._trigger("childrenloaded",null,item)
}
if (typeof item.children === 'function') {
item.children(completeBuild,item);
@@ -407,7 +438,7 @@
}
} else {
if (that._loadingData) {
if (that._loadingData || item.children.length > 20) {
item.treeList.childList.show();
} else {
item.treeList.childList.slideDown('fast');
@@ -423,7 +454,11 @@
}
item.expanded = false;
if (item.treeList.container) {
item.treeList.childList.slideUp('fast');
if (item.children.length < 20) {
item.treeList.childList.slideUp('fast');
} else {
item.treeList.childList.hide();
}
item.treeList.container.removeClass("expanded");
}
}
@@ -469,7 +504,8 @@
item.treeList.parentList = parentList;
var label = $("<div>",{class:"red-ui-treeList-label"}).appendTo(container);
var label = $("<div>",{class:"red-ui-treeList-label"});
label.appendTo(container);
item.treeList.label = label;
if (item.class) {
label.addClass(item.class);
@@ -550,7 +586,7 @@
})
if (!item.children) {
item.children = children||[];
item.treeList.childList = that._addChildren(container,item,item.children,depth).hide();
item.treeList.childList = that._addChildren(container,item,item.children,depth);
}
}
@@ -560,7 +596,7 @@
}
if (item.checkbox) {
var selectWrapper = $('<span class="red-ui-treeList-icon"></span>').appendTo(label);
var selectWrapper = $('<span class="red-ui-treeList-icon"></span>');
var cb = $('<input class="red-ui-treeList-checkbox" type="checkbox">').prop('checked',item.selected).appendTo(selectWrapper);
cb.on('click', function(e) {
e.stopPropagation();
@@ -586,6 +622,7 @@
cb.trigger("click");
}
}
selectWrapper.appendTo(label)
} else {
label.on("click", function(e) {
if (!that.options.multi) {
@@ -642,12 +679,13 @@
}
if (item.children) {
if (Array.isArray(item.children) && !item.deferBuild) {
item.treeList.childList = that._addChildren(container,item,item.children,depth).hide();
item.treeList.childList = that._addChildren(container,item,item.children,depth);
}
if (item.expanded) {
item.treeList.expand();
}
}
// label.appendTo(container);
},
empty: function() {
this._topList.editableList('empty');
@@ -772,7 +810,8 @@
return undefined;
}
},
filter: function(filterFunc,expandResults) {
filter: function(filterFunc) {
this.activeFilter = filterFunc;
var totalCount = 0;
var filter = function(item) {
var matchCount = 0;
@@ -796,8 +835,10 @@
}
}
matchCount += childCount;
if (childCount > 0) {
item.treeList.expand();
if (filterFunc && childCount > 0) {
setTimeout(function() {
item.treeList.expand();
},10);
}
}
if (!filterFunc) {

View File

@@ -913,7 +913,7 @@
panel.show({
target:that.optionExpandButton,
onclose:content.onclose,
align: "right"
align: "left"
});
}
})

View File

@@ -1411,7 +1411,7 @@ RED.diff = (function() {
// Restore the original flow so subsequent merge resolutions can properly
// identify new-vs-old
RED.nodes.originalFlow(originalFlow);
imported[0].forEach(function(n) {
imported.nodes.forEach(function(n) {
if (nodeChangedStates[n.id] || localChangedStates[n.id]) {
n.changed = true;
}

View File

@@ -204,32 +204,28 @@ RED.editor = (function() {
node.dirty = true;
node.dirtyStatus = true;
var removedLinks = [];
if (node.ports) {
if (outputMap) {
RED.nodes.eachLink(function(l) {
if (l.source === node && outputMap.hasOwnProperty(l.sourcePort)) {
if (outputMap) {
RED.nodes.eachLink(function(l) {
if (l.source === node) {
if (outputMap.hasOwnProperty(l.sourcePort)) {
if (outputMap[l.sourcePort] === "-1") {
removedLinks.push(l);
} else {
l.sourcePort = outputMap[l.sourcePort];
}
}
});
}
if (node.outputs < node.ports.length) {
while (node.outputs < node.ports.length) {
node.ports.pop();
}
});
}
if (node.hasOwnProperty("__outputs")) {
if (node.outputs < node.__outputs) {
RED.nodes.eachLink(function(l) {
if (l.source === node && l.sourcePort >= node.outputs && removedLinks.indexOf(l) === -1) {
removedLinks.push(l);
}
});
} else if (node.outputs > node.ports.length) {
while (node.outputs > node.ports.length) {
node.ports.push(node.ports.length);
}
}
delete node.__outputs;
}
node.inputs = Math.min(1,Math.max(0,parseInt(node.inputs)));
if (isNaN(node.inputs)) {
@@ -883,13 +879,13 @@ RED.editor = (function() {
var userCount = 0;
var subflowType = "subflow:"+node.id;
RED.nodes.eachNode(function(n) {
if (n.type === subflowType) {
userCount++;
}
});
// RED.nodes.eachNode(function(n) {
// if (n.type === subflowType) {
// userCount++;
// }
// });
$("#red-ui-editor-subflow-user-count")
.text(RED._("subflow.subflowInstances", {count:userCount})).show();
.text(RED._("subflow.subflowInstances", {count:node.instances.length})).show();
}
$('<div class="form-row">'+
@@ -1287,10 +1283,12 @@ RED.editor = (function() {
if (configNode) {
var users = configNode.users;
users.splice(users.indexOf(editing_node),1);
RED.events.emit("nodes:change",configNode);
}
configNode = RED.nodes.node(newValue);
if (configNode) {
configNode.users.push(editing_node);
RED.events.emit("nodes:change",configNode);
}
}
changes[d] = editing_node[d];
@@ -1505,6 +1503,10 @@ RED.editor = (function() {
}
},
open: function(tray, done) {
if (editing_node.hasOwnProperty('outputs')) {
editing_node.__outputs = editing_node.outputs;
}
var trayFooter = tray.find(".red-ui-tray-footer");
var trayBody = tray.find('.red-ui-tray-body');
trayBody.parent().css('overflow','hidden');
@@ -1628,6 +1630,7 @@ RED.editor = (function() {
show: function() {
if (editing_node) {
RED.sidebar.info.refresh(editing_node);
RED.sidebar.help.show(editing_node.type, false);
}
}
}
@@ -1834,6 +1837,7 @@ RED.editor = (function() {
show: function() {
if (editing_config_node) {
RED.sidebar.info.refresh(editing_config_node);
RED.sidebar.help.show(type, false);
}
}
}
@@ -1911,10 +1915,12 @@ RED.editor = (function() {
if (configNode) {
var users = configNode.users;
users.splice(users.indexOf(editing_config_node),1);
RED.events.emit("nodes:change",configNode);
}
configNode = RED.nodes.node(newValue);
if (configNode) {
configNode.users.push(editing_config_node);
RED.events.emit("nodes:change",configNode);
}
}
editing_config_node[d] = newValue;
@@ -2461,7 +2467,7 @@ RED.editor = (function() {
changes[d] = oldValues[d];
changed = true;
}
} else {
} else if (d !== "nodes") {
if (JSON.stringify(oldValues[d]) !== JSON.stringify(editing_node[d])) {
changes[d] = oldValues[d];
changed = true;
@@ -2503,10 +2509,12 @@ RED.editor = (function() {
if (configNode) {
var users = configNode.users;
users.splice(users.indexOf(editing_node),1);
RED.events.emit("nodes:change",configNode);
}
configNode = RED.nodes.node(newValue);
if (configNode) {
configNode.users.push(editing_node);
RED.events.emit("nodes:change",configNode);
}
}
changes[d] = editing_node[d];
@@ -2716,7 +2724,7 @@ RED.editor = (function() {
if (options.globals) {
setTimeout(function() {
if (!!session.$worker) {
session.$worker.send("setOptions", [{globals: options.globals, esversion:6, sub:true, asi:true, maxerr:1000}]);
session.$worker.send("setOptions", [{globals: options.globals, maxerr:1000}]);
}
},100);
}
@@ -2780,7 +2788,13 @@ RED.editor = (function() {
editExpression: function(options) { showTypeEditor("_expression", options) },
editJSON: function(options) { showTypeEditor("_json", options) },
editMarkdown: function(options) { showTypeEditor("_markdown", options) },
editText: function(options) { showTypeEditor("_text", options) },
editText: function(options) {
if (options.mode == "markdown") {
showTypeEditor("_markdown", options)
} else {
showTypeEditor("_text", options)
}
},
editBuffer: function(options) { showTypeEditor("_buffer", options) },
buildEditForm: buildEditForm,
validateNode: validateNode,

View File

@@ -82,12 +82,15 @@ RED.group = (function() {
colorPalette.push('#'+'000000'.slice(0, 6-s.length)+s);
}
var defaultGroupStyle = {};
var defaultGroupStyle = {
label: true,
"label-position": "nw"
};
var groupDef = {
defaults:{
name:{value:""},
style:{value:{}},
style:{value:{label:true}},
nodes:{value:[]}
},
category: "config",
@@ -95,25 +98,25 @@ RED.group = (function() {
var style = this.style || {};
RED.colorPicker.create({
id:"node-input-style-stroke",
value: style.stroke || "#a4a4a4",
value: style.stroke || defaultGroupStyle.stroke || "#a4a4a4",
palette: colorPalette,
cellPerRow: colorCount,
cellWidth: 16,
cellHeight: 16,
cellMargin: 3,
none: true,
opacity: style['stroke-opacity'] || 1.0
opacity: style.hasOwnProperty('stroke-opacity')?style['stroke-opacity']:(defaultGroupStyle.hasOwnProperty('stroke-opacity')?defaultGroupStyle['stroke-opacity']:1.0)
}).appendTo("#node-input-row-style-stroke");
RED.colorPicker.create({
id:"node-input-style-fill",
value: style.fill || "none",
value: style.fill || defaultGroupStyle.fill ||"none",
palette: colorPalette,
cellPerRow: colorCount,
cellWidth: 16,
cellHeight: 16,
cellMargin: 3,
none: true,
opacity: style['fill-opacity'] || 1.0
opacity: style.hasOwnProperty('fill-opacity')?style['fill-opacity']:(defaultGroupStyle.hasOwnProperty('fill-opacity')?defaultGroupStyle['fill-opacity']:1.0)
}).appendTo("#node-input-row-style-fill");
createLayoutPicker({
@@ -123,7 +126,7 @@ RED.group = (function() {
RED.colorPicker.create({
id:"node-input-style-color",
value: style.color || "#a4a4a4",
value: style.color || defaultGroupStyle.color ||"#a4a4a4",
palette: colorPalette,
cellPerRow: colorCount,
cellWidth: 16,
@@ -133,10 +136,9 @@ RED.group = (function() {
$("#node-input-style-label").toggleButton({
enabledLabel: RED._("editor.show"),
disabledLabel: RED._("editor.hide")
disabledLabel: RED._("editor.show"),
})
$("#node-input-style-label").on("change", function(evt) {
$("#node-input-row-style-label-options").toggle($(this).prop("checked"));
})
@@ -160,12 +162,13 @@ RED.group = (function() {
delete this.style.color;
}
if (this.style["stroke-opacity"] === "1") {
delete this.style["stroke-opacity"]
}
if (this.style["fill-opacity"] === "1") {
delete this.style["fill-opacity"]
}
var node = this;
['stroke','fill','stroke-opacity','fill-opacity','color','label-position'].forEach(function(prop) {
if (node.style[prop] === defaultGroupStyle[prop]) {
delete node.style[prop]
}
})
this.resize = true;
},
set:{
@@ -176,10 +179,27 @@ RED.group = (function() {
function init() {
RED.events.on("view:selection-changed",function(selection) {
RED.menu.setDisabled("menu-item-group-group",!!!selection.nodes);
RED.menu.setDisabled("menu-item-group-ungroup",!!!selection.nodes || selection.nodes.filter(function(n) { return n.type==='group'}).length === 0);
RED.menu.setDisabled("menu-item-group-merge",!!!selection.nodes);
RED.menu.setDisabled("menu-item-group-remove",!!!selection.nodes || selection.nodes.filter(function(n) { return !!n.g }).length === 0);
var activateGroup = !!selection.nodes;
var activateUngroup = false;
var activateMerge = false;
var activateRemove = false;
if (activateGroup) {
selection.nodes.forEach(function (n) {
if (n.type === "group") {
activateUngroup = true;
}
if (!!n.g) {
activateRemove = true;
}
});
if (activateUngroup) {
activateMerge = (selection.nodes.length > 1);
}
}
RED.menu.setDisabled("menu-item-group-group", !activateGroup);
RED.menu.setDisabled("menu-item-group-ungroup", !activateUngroup);
RED.menu.setDisabled("menu-item-group-merge", !activateMerge);
RED.menu.setDisabled("menu-item-group-remove", !activateRemove);
});
RED.actions.add("core:group-selection", function() { groupSelection() })
@@ -200,9 +220,18 @@ RED.group = (function() {
stroke: convertColorToHex(groupStyle.stroke),
"stroke-opacity": groupStyle.strokeOpacity,
fill: convertColorToHex(groupStyle.fill),
"fill-opacity": groupStyle.fillOpacity
"fill-opacity": groupStyle.fillOpacity,
label: true,
"label-position": "nw"
}
groupStyleDiv.remove();
groupStyleDiv = $("<div>",{
class:"red-ui-flow-group-label",
style: "position: absolute; top: -1000px;"
}).appendTo(document.body);
groupStyle = getComputedStyle(groupStyleDiv[0]);
defaultGroupStyle.color = convertColorToHex(groupStyle.fill);
groupStyleDiv.remove();
}
function convertColorToHex(c) {
@@ -218,6 +247,7 @@ RED.group = (function() {
var groupStyleClipboard;
function copyGroupStyle() {
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes && selection.nodes.length === 1 && selection.nodes[0].type === 'group') {
groupStyleClipboard = JSON.parse(JSON.stringify(selection.nodes[0].style));
@@ -225,6 +255,7 @@ RED.group = (function() {
}
}
function pasteGroupStyle() {
if (RED.view.state() !== RED.state.DEFAULT) { return }
if (groupStyleClipboard) {
var selection = RED.view.selection();
if (selection.nodes) {
@@ -258,6 +289,7 @@ RED.group = (function() {
}
function groupSelection() {
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
var group = createGroup(selection.nodes);
@@ -274,6 +306,7 @@ RED.group = (function() {
}
}
function ungroupSelection() {
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
var newSelection = [];
@@ -322,8 +355,7 @@ RED.group = (function() {
}
function mergeSelection() {
// TODO: this currently creates an entirely new group. Need to merge properties
// of any existing group
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
var nodes = [];
@@ -351,11 +383,16 @@ RED.group = (function() {
return;
}
}
var existingGroup;
// Second pass, ungroup any groups in the selection and add their contents
// to the selection
for (var i=0; i<selection.nodes.length; i++) {
n = selection.nodes[i];
if (n.type === "group") {
if (!existingGroup) {
existingGroup = n;
}
ungroupHistoryEvent.groups.push(n);
nodes = nodes.concat(ungroup(n));
} else {
@@ -369,6 +406,10 @@ RED.group = (function() {
// Finally, create the new group
var group = createGroup(nodes);
if (group) {
if (existingGroup) {
group.style = existingGroup.style;
group.name = existingGroup.name;
}
RED.view.select({nodes:[group]})
}
historyEvent.events.push({
@@ -382,6 +423,7 @@ RED.group = (function() {
}
function removeSelection() {
if (RED.view.state() !== RED.state.DEFAULT) { return }
var selection = RED.view.selection();
if (selection.nodes) {
var nodes = [];
@@ -598,14 +640,14 @@ RED.group = (function() {
var row = null;
row = $("<div/>").appendTo(picker);
var currentButton;
for (var y=0;y<2;y++) { //red-ui-group-layout-text-pos
var yComponent= "ns"[y];
row = $("<div/>").appendTo(picker);
for (var x=0;x<3;x++) {
var xComponent = ["w","","e"][x];
var val = yComponent+xComponent;
var button = $("<button/>", { class:"red-ui-search-result-node","data-pos":val }).appendTo(row);
var button = $("<button/>", { class:"red-ui-search-result-node red-ui-button","data-pos":val }).appendTo(row);
button.on("click", function (e) {
e.preventDefault();
layoutHiddenInput.val($(this).data("pos"));
@@ -613,15 +655,22 @@ RED.group = (function() {
refreshDisplay();
});
$('<div>',{class:"red-ui-group-layout-picker-cell-text red-ui-group-layout-text-pos-"+val}).appendTo(button);
if (val === layoutHiddenInput.val()) {
currentButton = button;
}
}
}
refreshDisplay();
var layoutPanel = RED.popover.panel(picker);
layoutPanel.show({
target: layoutButton
})
target: layoutButton,
onclose: function() {
layoutButton.focus();
}
});
if (currentButton) {
currentButton.focus();
}
})
refreshDisplay();

View File

@@ -17,6 +17,8 @@ RED.keyboard = (function() {
var isMac = /Mac/i.test(window.navigator.platform);
var handlersActive = true;
var handlers = {};
var partialState;
@@ -225,6 +227,9 @@ RED.keyboard = (function() {
}
}
d3.select(window).on("keydown",function() {
if (!handlersActive) {
return;
}
if (metaKeyCodes[d3.event.keyCode]) {
return;
}
@@ -570,6 +575,13 @@ RED.keyboard = (function() {
return pane;
}
function enable() {
handlersActive = true;
}
function disable() {
handlersActive = false;
}
return {
init: init,
add: addHandler,
@@ -579,7 +591,9 @@ RED.keyboard = (function() {
},
revertToDefault: revertToDefault,
formatKey: formatKey,
validateKey: validateKey
validateKey: validateKey,
disable: disable,
enable: enable
}
})();

View File

@@ -472,6 +472,8 @@ RED.library = (function() {
autoOpen: false,
width: 800,
resizable: false,
open: function( event, ui ) { RED.keyboard.disable() },
close: function( event, ui ) { RED.keyboard.enable() },
classes: {
"ui-dialog": "red-ui-editor-dialog",
"ui-dialog-titlebar-close": "hide",
@@ -556,9 +558,11 @@ RED.library = (function() {
}
],
open: function(e) {
RED.keyboard.disable();
$(this).parent().find(".ui-dialog-titlebar-close").hide();
},
close: function(e) {
RED.keyboard.enable();
if (libraryEditor) {
libraryEditor.destroy();
libraryEditor = null;

View File

@@ -542,8 +542,6 @@ RED.palette.editor = (function() {
return settingsPane;
}
function createSettingsPane() {
settingsPane = $('<div id="red-ui-settings-tab-palette"></div>');
var content = $('<div id="red-ui-palette-editor">'+
@@ -574,7 +572,11 @@ RED.palette.editor = (function() {
minimumActiveTabWidth: 110
});
createNodeTab(content);
createInstallTab(content);
}
function createNodeTab(content) {
var modulesTab = $('<div>',{class:"red-ui-palette-editor-tab"}).appendTo(content);
editorTabs.addTab({
@@ -726,9 +728,9 @@ RED.palette.editor = (function() {
}
}
});
}
function createInstallTab(content) {
var installTab = $('<div>',{class:"red-ui-palette-editor-tab hide"}).appendTo(content);
editorTabs.addTab({
@@ -761,7 +763,6 @@ RED.palette.editor = (function() {
}
});
$('<span>').text(RED._("palette.editor.sort")+' ').appendTo(toolBar);
var sortGroup = $('<span class="button-group"></span>').appendTo(toolBar);
var sortRelevance = $('<a href="#" class="red-ui-palette-editor-install-sort-option red-ui-sidebar-header-button-toggle selected"><i class="fa fa-sort-amount-desc"></i></a>').appendTo(sortGroup);
@@ -795,6 +796,7 @@ RED.palette.editor = (function() {
loadedIndex = {};
initInstallTab();
})
RED.popover.tooltip(refreshButton,RED._("palette.editor.refresh"));
packageList = $('<ol>',{style:"position: absolute;top: 79px;bottom: 0;left: 0;right: 0px;"}).appendTo(installTab).editableList({
addButton: false,
@@ -878,8 +880,87 @@ RED.palette.editor = (function() {
}
});
if (RED.settings.theme('palette.upload') !== false) {
var uploadSpan = $('<span class="button-group">').prependTo(toolBar);
var uploadButton = $('<button type="button" class="red-ui-sidebar-header-button red-ui-palette-editor-upload-button"><label><i class="fa fa-upload"></i><form id="red-ui-palette-editor-upload-form" enctype="multipart/form-data"><input name="tarball" type="file" accept=".tgz"></label></button>').appendTo(uploadSpan);
var uploadInput = uploadButton.find('input[type="file"]');
uploadInput.on("change", function(evt) {
if (this.files.length > 0) {
uploadFilenameLabel.text(this.files[0].name)
uploadToolbar.slideDown(200);
}
})
var uploadToolbar = $('<div class="red-ui-palette-editor-upload"></div>').appendTo(installTab);
var uploadForm = $('<div>').appendTo(uploadToolbar);
var uploadFilename = $('<div class="placeholder-input"><i class="fa fa-upload"></i> </div>').appendTo(uploadForm);
var uploadFilenameLabel = $('<span></span>').appendTo(uploadFilename);
var uploadButtons = $('<div class="red-ui-palette-editor-upload-buttons"></div>').appendTo(uploadForm);
$('<button class="editor-button"></button>').text(RED._("common.label.cancel")).appendTo(uploadButtons).on("click", function(evt) {
evt.preventDefault();
uploadToolbar.slideUp(200);
uploadInput.val("");
});
$('<button class="editor-button primary"></button>').text(RED._("common.label.upload")).appendTo(uploadButtons).on("click", function(evt) {
evt.preventDefault();
var spinner = RED.utils.addSpinnerOverlay(uploadToolbar, true);
var buttonRow = $('<div style="position: relative;bottom: calc(50% + 17px); padding-right: 10px;text-align: right;"></div>').appendTo(spinner);
$('<button class="red-ui-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).on("click", function(evt) {
evt.preventDefault();
RED.actions.invoke("core:show-event-log");
});
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+uploadInput[0].files[0].name);
var data = new FormData();
data.append("tarball",uploadInput[0].files[0]);
var filename = uploadInput[0].files[0].name;
$.ajax({
url: 'nodes',
data: data,
cache: false,
contentType: false,
processData: false,
method: 'POST',
}).always(function(data,textStatus,xhr) {
spinner.remove();
uploadInput.val("");
uploadToolbar.slideUp(200);
}).fail(function(xhr,textStatus,err) {
var message = textStatus;
if (xhr.responseJSON) {
message = xhr.responseJSON.message;
}
var notification = RED.notify(RED._('palette.editor.errors.installFailed',{module: filename,message:message}),{
type: 'error',
modal: true,
fixed: true,
buttons: [
{
text: RED._("common.label.close"),
click: function() {
notification.close();
}
},{
text: RED._("eventLog.view"),
click: function() {
notification.close();
RED.actions.invoke("core:show-event-log");
}
}
]
});
uploadInput.val("");
uploadToolbar.slideUp(200);
})
})
RED.popover.tooltip(uploadButton,RED._("palette.editor.upload"));
}
$('<div id="red-ui-palette-module-install-shade" class="red-ui-palette-module-shade hide"><div class="red-ui-palette-module-shade-status"></div><img src="red/images/spin.svg" class="red-ui-palette-spinner"/></div>').appendTo(installTab);
}
function update(entry,version,url,container,done) {
if (RED.settings.theme('palette.editable') === false) {
done(new Error('Palette not editable'));

View File

@@ -105,7 +105,7 @@ RED.palette = (function() {
for (var i=0;i<words.length;i++) {
var word = words[i];
var sep = (i == 0) ? "" : " ";
var newWidth = RED.view.calculateTextWidth(currentLine+sep+word, "red-ui-palette-label", 0);
var newWidth = RED.view.calculateTextWidth(currentLine+sep+word, "red-ui-palette-label");
if (newWidth < nodeWidth) {
currentLine += sep +word;
} else {
@@ -113,12 +113,12 @@ RED.palette = (function() {
displayLines.push(currentLine);
}
while (true) {
var wordWidth = RED.view.calculateTextWidth(word, "red-ui-palette-label", 0);
var wordWidth = RED.view.calculateTextWidth(word, "red-ui-palette-label");
if (wordWidth >= nodeWidth) {
// break word if too wide
for(var j = word.length; j > 0; j--) {
var s = word.substring(0, j);
var width = RED.view.calculateTextWidth(s, "red-ui-palette-label", 0);
var width = RED.view.calculateTextWidth(s, "red-ui-palette-label");
if (width < nodeWidth) {
displayLines.push(s);
word = word.substring(j);

View File

@@ -166,34 +166,42 @@ RED.projects.settings = (function() {
description.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
}
function editSummary(activeProject, summary, container) {
function editSummary(activeProject, summary, container, version, versionContainer) {
var editButton = container.prev();
editButton.hide();
container.empty();
versionContainer.empty();
var bg = $('<span class="button-row" style="position: relative; float: right; margin-right:0;"></span>').appendTo(container);
var input = $('<input type="text" style="width: calc(100% - 150px); margin-right: 10px;">').val(summary||"").appendTo(container);
var versionInput = $('<input type="text" style="width: calc(100% - 150px); margin-right: 10px;">').val(version||"").appendTo(versionContainer);
$('<button class="red-ui-button">' + RED._("common.label.cancel") + '</button>')
.appendTo(bg)
.on("click", function(evt) {
evt.preventDefault();
updateProjectSummary(activeProject.summary, container);
updateProjectVersion(activeProject.version, versionContainer);
editButton.show();
});
$('<button class="red-ui-button">' + RED._("common.label.save") + '</button>')
.appendTo(bg)
.on("click", function(evt) {
evt.preventDefault();
var v = input.val();
updateProjectSummary(v, container);
var spinner = utils.addSpinnerOverlay(container);
var newSummary = input.val();
var newVersion = versionInput.val();
updateProjectSummary(newSummary, container);
updateProjectVersion(newVersion, versionContainer);
var spinner = utils.addSpinnerOverlay(container).addClass('red-ui-component-spinner-contain');
var done = function(err,res) {
if (err) {
spinner.remove();
return editSummary(activeProject, summary, container);
return editSummary(activeProject, summary, container, version, versionContainer);
}
activeProject.summary = v;
activeProject.summary = newSummary;
activeProject.version = newVersion;
spinner.remove();
updateProjectSummary(activeProject.summary, container);
updateProjectVersion(activeProject.version, versionContainer);
editButton.show();
}
utils.sendRequest({
@@ -214,31 +222,39 @@ RED.projects.settings = (function() {
}
},
}
},{summary:v});
},{summary:newSummary, version: newVersion});
});
}
function updateProjectSummary(summary, container) {
container.empty();
if (summary) {
container.text(summary).removeClass('node-info-node');
container.text(summary).removeClass('red-ui-help-info-none');
} else {
container.text(RED._("sidebar.project.noSummaryAvailable")).addClass('red-ui-help-info-none');
}
}
function updateProjectVersion(version, container) {
container.empty();
if (version) {
container.text(version);
}
}
function createMainPane(activeProject) {
var pane = $('<div id="red-ui-project-settings-tab-main" class="red-ui-project-settings-tab-pane red-ui-help"></div>');
$('<h1>').text(activeProject.name).appendTo(pane);
var summary = $('<div style="position: relative">').appendTo(pane);
var summaryContent = $('<div></div>').appendTo(summary);
var versionContent = $('<div></div>').addClass('red-ui-help-info-none').appendTo(summary);
updateProjectSummary(activeProject.summary, summaryContent);
updateProjectVersion(activeProject.version, versionContent);
if (RED.user.hasPermission("projects.write")) {
$('<button class="red-ui-button red-ui-button-small" style="float: right;">' + RED._('sidebar.project.editDescription') + '</button>')
.prependTo(summary)
.on("click", function(evt) {
evt.preventDefault();
editSummary(activeProject, activeProject.summary, summaryContent);
editSummary(activeProject, activeProject.summary, summaryContent, activeProject.version, versionContent);
});
}
$('<hr>').appendTo(pane);
@@ -1573,8 +1589,6 @@ RED.projects.settings = (function() {
updateForm();
}
function createSettingsPane(activeProject) {
var pane = $('<div id="red-ui-project-settings-tab-settings" class="red-ui-project-settings-tab-pane red-ui-help"></div>');
createFilesSection(activeProject,pane);

View File

@@ -38,13 +38,34 @@ RED.projects.userSettings = (function() {
$('<label for="user-settings-gitconfig-email"></label>').text(RED._("editor:sidebar.project.userSettings.email")).appendTo(row);
gitEmailInput = $('<input type="text" id="user-settings-gitconfig-email">').appendTo(row);
gitEmailInput.val(currentGitSettings.user.email||"");
}
function createWorkflowSection(pane) {
var currentGitSettings = RED.settings.get('git') || {};
currentGitSettings.workflow = currentGitSettings.workflow || {};
currentGitSettings.workflow.mode = currentGitSettings.workflow.mode || "manual";
var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.workflow")).appendTo(pane);
var workflowContainer = $('<div class="red-ui-settings-section"></div>').appendTo(pane);
$('<div class="red-ui-settings-section-description"></div>').appendTo(workflowContainer).text(RED._("editor:sidebar.project.userSettings.workfowTip"));
var row = $('<div class="red-ui-settings-row"></div>').appendTo(workflowContainer);
$('<label><input type="radio" name="user-setting-gitworkflow" value="manual"> <div style="margin-left: 3px; display: inline-block"><div data-i18n="editor:sidebar.project.userSettings.workflowManual"></div><div style="color:#aaa;" data-i18n="editor:sidebar.project.userSettings.workflowManualTip"></div></div></label>').appendTo(row);
row = $('<div class="red-ui-settings-row"></div>').appendTo(workflowContainer);
$('<label><input type="radio" name="user-setting-gitworkflow" value="auto"> <div style="margin-left: 3px; display: inline-block"><div data-i18n="editor:sidebar.project.userSettings.workflowAuto"></div><div style="color:#aaa;" data-i18n="editor:sidebar.project.userSettings.workflowAutoTip"></div></div></label>').appendTo(row);
workflowContainer.find('[name="user-setting-gitworkflow"][type="radio"][value="'+currentGitSettings.workflow.mode+'"]').prop('checked',true)
}
function createSSHKeySection(pane) {
var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.sshKeys")).appendTo(pane);
var container = $('<div class="red-ui-settings-section"></div>').appendTo(pane);
var popover;
var title = $('<h3></h3>').text(RED._("editor:sidebar.project.userSettings.sshKeys")).appendTo(container);
var subtitle = $('<div class="red-ui-settings-section-description"></div>').appendTo(container).text(RED._("editor:sidebar.project.userSettings.sshKeysTip"));
var addKeyButton = $('<button id="user-settings-gitconfig-add-key" class="red-ui-button red-ui-button-small" style="float: right; margin-right: 10px;">'+RED._("editor:sidebar.project.userSettings.add")+'</button>')
@@ -391,6 +412,7 @@ RED.projects.userSettings = (function() {
function createSettingsPane(activeProject) {
var pane = $('<div id="red-ui-settings-tab-gitconfig" class="project-settings-tab-pane red-ui-help"></div>');
createGitUserSection(pane);
createWorkflowSection(pane);
createSSHKeySection(pane);
return pane;
}
@@ -407,6 +429,9 @@ RED.projects.userSettings = (function() {
currentGitSettings.user = currentGitSettings.user || {};
currentGitSettings.user.name = gitUsernameInput.val();
currentGitSettings.user.email = gitEmailInput.val();
currentGitSettings.workflow = currentGitSettings.workflow || {};
currentGitSettings.workflow.mode = $('[name="user-setting-gitworkflow"][type="radio"]:checked').val()
RED.settings.set('git', currentGitSettings);
}
});

View File

@@ -1615,25 +1615,16 @@ RED.projects = (function() {
}
function deleteProject(row,name,done) {
var cover = $('<div>').css({
background:"white",
position:"absolute",
top:0,right:0,bottom:0,left:"100%",
overflow:"hidden",
padding: "5px 20px",
transition: "left 0.4s",
whitespace: "nowrap",
width:"1000px"
}).on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
$('<span>').css({"lineHeight":"40px"}).text(RED._("projects.delete.confirm")).appendTo(cover);
$('<button style="margin-left:20px" class="red-ui-button">'+RED._("common.label.cancel")+'</button>')
var cover = $('<div class="red-ui-projects-dialog-project-list-entry-delete-confirm"></div>').on("click", function(evt) { evt.stopPropagation(); }).appendTo(row);
$('<span>').text(RED._("projects.delete.confirm")).appendTo(cover);
$('<button class="red-ui-button">'+RED._("common.label.cancel")+'</button>')
.appendTo(cover)
.on("click", function(e) {
e.stopPropagation();
cover.remove();
done(true);
});
$('<button style="margin-left:20px" class="red-ui-button primary">'+RED._("common.label.delete")+'</button>')
$('<button class="red-ui-button primary">'+RED._("common.label.delete")+'</button>')
.appendTo(cover)
.on("click", function(e) {
e.stopPropagation();
@@ -2272,6 +2263,12 @@ RED.projects = (function() {
autoOpen: false,
width: 600,
resizable: false,
open: function(e) {
RED.keyboard.disable();
},
close: function(e) {
RED.keyboard.enable();
},
classes: {
"ui-dialog": "red-ui-editor-dialog",
"ui-dialog-titlebar-close": "hide",

View File

@@ -293,14 +293,20 @@ RED.sidebar.versionControl = (function() {
if (activeProject) {
// TODO: this is a full refresh of the files - should be able to
// just do an incremental refresh
allChanges = {};
unstagedChangesList.editableList('empty');
stagedChangesList.editableList('empty');
unmergedChangesList.editableList('empty');
$.getJSON("projects/"+activeProject.name+"/status",function(result) {
refreshFiles(result);
});
var workflowMode = ((RED.settings.get('git') || {}).workflow || {}).mode || "manual";
if (workflowMode === 'auto') {
refresh(true);
} else {
allChanges = {};
unstagedChangesList.editableList('empty');
stagedChangesList.editableList('empty');
unmergedChangesList.editableList('empty');
$.getJSON("projects/"+activeProject.name+"/status",function(result) {
refreshFiles(result);
});
}
}
});
RED.events.on("login",function() {

View File

@@ -26,7 +26,6 @@ RED.search = (function() {
var currentResults = [];
var previousActiveElement;
function indexProperty(node,label,property) {
if (typeof property === 'string' || typeof property === 'number') {
property = (""+property).toLowerCase();
@@ -60,30 +59,70 @@ RED.search = (function() {
}
for (var i=0;i<properties.length;i++) {
if (n.hasOwnProperty(properties[i])) {
if (n.type === "group" && properties[i] === "nodes") {
continue;
}
indexProperty(n, l, n[properties[i]]);
}
}
}
function extractFlag(val, flagName, flags) {
// is:XYZ
var regEx = new RegExp("(?:^| )is:"+flagName+"(?: |$)");
var m = regEx.exec(val);
if (m) {
val = val.replace(regEx," ").trim();
flags[flagName] = true;
}
return val;
}
function extractValue(val, flagName, flags) {
// flagName:XYZ
var regEx = new RegExp("(?:^| )"+flagName+":([^ ]+)(?: |$)");
var m
while(!!(m = regEx.exec(val))) {
val = val.replace(regEx," ").trim();
flags[flagName] = flags[flagName] || [];
flags[flagName].push(m[1]);
}
return val;
}
function search(val) {
var results = [];
var keys = Object.keys(index);
var keys = [];
var typeFilter;
var m = /(?:^| )type:([^ ]+)/.exec(val);
if (m) {
val = val.replace(/(?:^| )type:[^ ]+/,"");
typeFilter = m[1];
}
var flags = {};
val = extractFlag(val,"invalid",flags);
val = extractFlag(val,"unused",flags);
val = extractFlag(val,"config",flags);
val = extractFlag(val,"subflow",flags);
// uses:<node-id>
val = extractValue(val,"uses",flags);
var hasFlags = Object.keys(flags).length > 0;
val = val.trim();
if (val.length > 0 || typeFilter) {
if (val.length > 0 || typeFilter || hasFlags) {
val = val.toLowerCase();
var i;
var j;
var list = [];
var nodes = {};
if (flags.uses) {
keys = flags.uses;
} else {
keys = Object.keys(index);
}
for (i=0;i<keys.length;i++) {
var key = keys[i];
var kpos = keys[i].indexOf(val);
@@ -91,6 +130,34 @@ RED.search = (function() {
var ids = Object.keys(index[key]);
for (j=0;j<ids.length;j++) {
var node = index[key][ids[j]];
var isConfigNode = node.node._def.category === "config" && node.node.type !== 'group';
if (flags.uses && key === node.node.id) {
continue;
}
if (flags.hasOwnProperty("invalid")) {
var nodeIsValid = !node.node.hasOwnProperty("valid") || node.node.valid;
if (flags.invalid === nodeIsValid) {
continue;
}
}
if (flags.hasOwnProperty("config")) {
if (flags.config !== isConfigNode) {
continue;
}
}
if (flags.hasOwnProperty("subflow")) {
if (flags.subflow !== (node.node.type === 'subflow')) {
continue;
}
}
if (flags.hasOwnProperty("unused")) {
var isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) ||
(isConfigNode && node.node.users.length === 0)
if (flags.unused !== isUnused) {
continue;
}
}
if (!typeFilter || node.node.type === typeFilter) {
nodes[node.node.id] = nodes[node.node.id] = {
node: node.node,
@@ -370,15 +437,15 @@ RED.search = (function() {
$("#red-ui-sidebar-shade").on('mousedown',hide);
RED.events.on("workspace:clear", clearIndex)
RED.events.on("workspace:clear", clearIndex);
RED.events.on("flows:add", addItemToIndex)
RED.events.on("flows:remove", removeItemFromIndex)
RED.events.on("flows:change", updateItemOnIndex)
RED.events.on("flows:add", addItemToIndex);
RED.events.on("flows:remove", removeItemFromIndex);
RED.events.on("flows:change", updateItemOnIndex);
RED.events.on("subflows:add", addItemToIndex)
RED.events.on("subflows:remove", removeItemFromIndex)
RED.events.on("subflows:change", updateItemOnIndex)
RED.events.on("subflows:add", addItemToIndex);
RED.events.on("subflows:remove", removeItemFromIndex);
RED.events.on("subflows:change", updateItemOnIndex);
RED.events.on("nodes:add",addItemToIndex);
RED.events.on("nodes:remove",removeItemFromIndex);

View File

@@ -232,7 +232,11 @@ RED.sidebar = (function() {
}
},
// minimumActiveTabWidth: 70,
collapsible: true
collapsible: true,
onreorder: function(order) {
RED.settings.set("editor.sidebar.order",order);
},
order: RED.settings.get("editor.sidebar.order",["info", "help", "version-control", "debug"])
// scrollable: true
});

View File

@@ -284,9 +284,6 @@ RED.subflow = (function() {
}
n.inputs = activeSubflow.in.length;
n.outputs = activeSubflow.out.length;
while (n.outputs < n.ports.length) {
n.ports.pop();
}
n.resize = true;
n.dirty = true;
RED.editor.updateNodeProperties(n);
@@ -456,14 +453,16 @@ RED.subflow = (function() {
$("#red-ui-workspace-chart").css({"margin-top": "0"});
}
function removeSubflow(id) {
function removeSubflow(id, keepInstanceNodes) {
// TODO: A lot of this logic is common with RED.nodes.removeWorkspace
var removedNodes = [];
var removedLinks = [];
var removedGroups = [];
var activeSubflow = RED.nodes.subflow(id);
RED.nodes.eachNode(function(n) {
if (n.type == "subflow:"+id) {
if (!keepInstanceNodes && n.type == "subflow:"+id) {
removedNodes.push(n);
}
if (n.z == id) {
@@ -475,7 +474,9 @@ RED.subflow = (function() {
removedNodes.push(n);
}
});
RED.nodes.groups(id).forEach(function(n) {
removedGroups.push(n);
})
var removedConfigNodes = [];
for (var i=0;i<removedNodes.length;i++) {
var removedEntities = RED.nodes.remove(removedNodes[i].id);
@@ -485,6 +486,18 @@ RED.subflow = (function() {
// TODO: this whole delete logic should be in RED.nodes.removeSubflow..
removedNodes = removedNodes.concat(removedConfigNodes);
removedGroups = RED.nodes.groups(id).filter(function(g) { return !g.g; });
for (i=0;i<removedGroups.length;i++) {
removedGroups[i].nodes.forEach(function(n) {
if (n.type === "group") {
removedGroups.push(n);
}
});
}
// Now remove them in the reverse order
for (i=removedGroups.length-1; i>=0; i--) {
RED.nodes.removeGroup(removedGroups[i]);
}
RED.nodes.removeSubflow(activeSubflow);
RED.workspaces.remove(activeSubflow);
RED.nodes.dirty(true);
@@ -493,6 +506,7 @@ RED.subflow = (function() {
return {
nodes:removedNodes,
links:removedLinks,
groups: removedGroups,
subflows: [activeSubflow]
}
}
@@ -1168,11 +1182,7 @@ RED.subflow = (function() {
default: DEFAULT_ENV_TYPE_LIST,
valueLabel: function(container,value) {
container.css("padding",0);
var innerContainer = $('<div>').css({
"background":"white",
"height":"100%",
"box-sizing": "border-box"
}).appendTo(container);
var innerContainer = $('<div class="red-ui-editor-subflow-env-input-type"></div>').appendTo(container);
var input = $('<div class="placeholder-input">').appendTo(innerContainer);
$('<span><i class="fa fa-i-cursor"></i></span>').appendTo(input);
@@ -1186,10 +1196,7 @@ RED.subflow = (function() {
}
})
} else {
$("<span>").css({
"color":"#aaa",
"padding-left": "4px"
}).text("select types...").appendTo(input);
$('<span class="red-ui-editor-subflow-env-input-type-placeholder"></span>').text(RED._("editor.selectType")).appendTo(input);
}
}
},
@@ -1198,10 +1205,7 @@ RED.subflow = (function() {
label: RED._("typedInput.type.cred"), icon:"fa fa-lock", showLabel: false,
valueLabel: function(container,value) {
container.css("padding",0);
var innerContainer = $('<div>').css({
"background":"white",
"height":"100%",
"box-sizing": "border-box",
var innerContainer = $('<div class="red-ui-editor-subflow-env-input-type">').css({
"border-top-right-radius": "4px",
"border-bottom-right-radius": "4px"
}).appendTo(container);
@@ -1346,11 +1350,7 @@ RED.subflow = (function() {
label:RED._("editor.inputs.spinner"), icon:"fa fa-sort-numeric-asc", showLabel:false,
valueLabel: function(container,value) {
container.css("padding",0);
var innerContainer = $('<div>').css({
"background":"white",
"height":"100%",
"box-sizing": "border-box"
}).appendTo(container);
var innerContainer = $('<div class="red-ui-editor-subflow-env-input-type"></div>').appendTo(container);
var input = $('<div class="placeholder-input">').appendTo(innerContainer);
$('<span><i class="fa fa-sort-numeric-asc"></i></span>').appendTo(input);
@@ -1455,7 +1455,8 @@ RED.subflow = (function() {
}).on("change", function(evt,type) {
if (ui.type === 'input') {
ui.opts.types = inputCellInput.typedInput('value').split(",");
var types = inputCellInput.typedInput('value');
ui.opts.types = (types === "") ? ["str"] : types.split(",");
valueField.typedInput('types',ui.opts.types);
}
});

View File

@@ -62,6 +62,7 @@ RED.sidebar.help = (function() {
panels.ratio(0.3);
helpSearch = $('<input type="text" data-i18n="[placeholder]sidebar.help.search">').appendTo(toolbar).searchBox({
style: "compact",
delay: 100,
change: function() {
var val = $(this).val().toLowerCase();
@@ -260,12 +261,15 @@ RED.sidebar.help = (function() {
}
function show(type) {
RED.sidebar.show("help");
function show(type, bringToFront) {
if (bringToFront !== false) {
RED.sidebar.show("help");
}
if (type) {
hideTOC();
// hideTOC();
showHelp(type);
}
resizeStack();
}
// TODO: DRY - projects.js

View File

@@ -2,6 +2,7 @@ RED.sidebar.info.outliner = (function() {
var treeList;
var searchInput;
var activeSearch;
var projectInfo;
var projectInfoLabel;
var flowList;
@@ -10,6 +11,8 @@ RED.sidebar.info.outliner = (function() {
var objects = {};
var missingParents = {};
var configNodeTypes;
function getFlowData() {
var flowData = [
@@ -19,18 +22,27 @@ RED.sidebar.info.outliner = (function() {
children: []
},
{
id: "__subflow__",
label: RED._("menu.label.subflows"),
children: []
children: [
getEmptyItem("__subflow__")
]
},
{
id: "__global__",
flow: "__global__",
label: RED._("sidebar.info.globalConfig"),
children: []
types: {},
children: [
getEmptyItem("__global__")
]
}
]
flowList = flowData[0];
subflowList = flowData[1];
globalConfigNodes = flowData[2];
configNodeTypes = { __global__: globalConfigNodes};
return flowData;
}
@@ -67,7 +79,7 @@ RED.sidebar.info.outliner = (function() {
try {
label = (typeof n._def.label === "function" ? n._def.label.call(n) : n._def.label)||"";
} catch(err) {
console.log("Definition error: "+type+".label",err);
console.log("Definition error: "+n.type+".label",err);
}
}
var newlineIndex = label.indexOf("\\n");
@@ -134,12 +146,23 @@ RED.sidebar.info.outliner = (function() {
function addControls(n,div) {
var controls = $('<div>',{class:"red-ui-info-outline-item-controls red-ui-info-outline-item-hover-controls"}).appendTo(div);
if (n._def.category === "config" && n.type !== "group") {
var userCountBadge = $('<button type="button" class="red-ui-info-outline-item-control-users red-ui-button red-ui-button-small"><i class="fa fa-toggle-right"></i></button>').text(n.users.length).appendTo(controls).on("click",function(evt) {
evt.preventDefault();
evt.stopPropagation();
RED.search.show("uses:"+n.id);
})
RED.popover.tooltip(userCountBadge,function() { return RED._('editor.nodesUse',{count:n.users.length})});
}
if (n._def.button) {
$('<button type="button" class="red-ui-info-outline-item-control-action red-ui-button red-ui-button-small"><i class="fa fa-toggle-right"></i></button>').appendTo(controls).on("click",function(evt) {
var triggerButton = $('<button type="button" class="red-ui-info-outline-item-control-action red-ui-button red-ui-button-small"><i class="fa fa-toggle-right"></i></button>').appendTo(controls).on("click",function(evt) {
evt.preventDefault();
evt.stopPropagation();
RED.view.clickNodeButton(n);
})
RED.popover.tooltip(triggerButton,RED._("sidebar.info.triggerAction"));
}
// $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-eye"></i></button>').appendTo(controls).on("click",function(evt) {
// evt.preventDefault();
@@ -147,7 +170,7 @@ RED.sidebar.info.outliner = (function() {
// RED.view.reveal(n.id);
// })
if (n.type !== 'group' && n.type !== 'subflow') {
$('<button type="button" class="red-ui-info-outline-item-control-disable red-ui-button red-ui-button-small"><i class="fa fa-circle-thin"></i><i class="fa fa-ban"></i></button>').appendTo(controls).on("click",function(evt) {
var toggleButton = $('<button type="button" class="red-ui-info-outline-item-control-disable red-ui-button red-ui-button-small"><i class="fa fa-circle-thin"></i><i class="fa fa-ban"></i></button>').appendTo(controls).on("click",function(evt) {
evt.preventDefault();
evt.stopPropagation();
if (n.type === 'tab') {
@@ -179,6 +202,9 @@ RED.sidebar.info.outliner = (function() {
RED.view.redraw();
}
});
RED.popover.tooltip(toggleButton,function() {
return RED._("common.label."+(((n.type==='tab' && n.disabled) || (n.type!=='tab' && n.d))?"enable":"disable"));
});
} else {
$('<div class="red-ui-info-outline-item-control-spacer">').appendTo(controls)
}
@@ -203,11 +229,12 @@ RED.sidebar.info.outliner = (function() {
searchInput = $('<input type="text" data-i18n="[placeholder]menu.label.search">').appendTo(toolbar).searchBox({
style: "compact",
delay: 300,
delay: 500,
change: function() {
var val = $(this).val();
var searchResults = RED.search.search(val);
if (val) {
activeSearch = val;
var resultMap = {};
for (var i=0,l=searchResults.length;i<l;i++) {
resultMap[searchResults[i].node.id] = true;
@@ -219,6 +246,7 @@ RED.sidebar.info.outliner = (function() {
return item.id && objects[item.id] && resultMap[item.id]
},true)
} else {
activeSearch = null;
treeList.treeList('filter',null);
var selected = treeList.treeList('selected');
if (selected.id) {
@@ -226,7 +254,14 @@ RED.sidebar.info.outliner = (function() {
}
}
}
},
options: [
{label:RED._("sidebar.info.search.configNodes"), value:"is:config"},
{label:RED._("sidebar.info.search.unusedConfigNodes"), value:"is:config is:unused"},
{label:RED._("sidebar.info.search.invalidNodes"), value: "is:invalid"},
{label:RED._("sidebar.info.search.uknownNodes"), value: "type:unknown"},
{label:RED._("sidebar.info.search.unusedSubflows"), value:"is:subflow is:unused"},
]
});
projectInfo = $('<div class="red-ui-treeList-label red-ui-info-outline-project"><span class="red-ui-treeList-icon"><i class="fa fa-archive"></i></span></div>').hide().appendTo(container)
@@ -277,8 +312,6 @@ RED.sidebar.info.outliner = (function() {
RED.events.on("groups:remove",onObjectRemove);
RED.events.on("groups:change",onNodeChange);
RED.events.on("view:selection-changed", onSelectionChanged);
RED.events.on("workspace:clear", onWorkspaceClear)
return container;
@@ -304,7 +337,7 @@ RED.sidebar.info.outliner = (function() {
flowList.treeList.addChild(objects[ws.id])
objects[ws.id].element.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
objects[ws.id].treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!ws.disabled)
updateSearch();
}
function onFlowChange(n) {
@@ -318,6 +351,7 @@ RED.sidebar.info.outliner = (function() {
existingObject.element.find(".red-ui-info-outline-item-label").text(label);
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
existingObject.treeList.container.toggleClass("red-ui-info-outline-item-disabled", !!n.disabled)
updateSearch();
}
function onFlowsReorder(order) {
var indexMap = {};
@@ -345,7 +379,12 @@ RED.sidebar.info.outliner = (function() {
} else {
objects[sf.id].children.push(getEmptyItem(sf.id));
}
if (empties["__subflow__"]) {
empties["__subflow__"].treeList.remove();
delete empties["__subflow__"];
}
subflowList.treeList.addChild(objects[sf.id])
updateSearch();
}
function onSubflowChange(sf) {
var existingObject = objects[sf.id];
@@ -357,11 +396,12 @@ RED.sidebar.info.outliner = (function() {
sfInstance.treeList.replaceElement(getNodeLabel(n));
}
});
updateSearch();
}
function onNodeChange(n) {
var existingObject = objects[n.id];
var parent = n.g||n.z;
var parent = n.g||n.z||"__global__";
var nodeLabelText = getNodeLabelText(n);
if (nodeLabelText) {
@@ -369,20 +409,77 @@ RED.sidebar.info.outliner = (function() {
} else {
existingObject.element.find(".red-ui-info-outline-item-label").html("&nbsp;");
}
var existingParent = existingObject.parent.id;
if (!existingParent) {
existingParent = existingObject.parent.parent.flow
}
if (parent !== existingParent) {
var parentItem = existingObject.parent;
existingObject.treeList.remove(true);
if (parentItem.children.length === 0) {
if (parentItem.config) {
// this is a config
parentItem.treeList.remove();
// console.log("Removing",n.type,"from",parentItem.parent.id||parentItem.parent.parent.id)
if (parent !== existingObject.parent.id) {
existingObject.treeList.remove();
if (!parent) {
globalConfigNodes.treeList.addChild(existingObject);
delete configNodeTypes[parentItem.parent.id||parentItem.parent.parent.id].types[n.type];
if (parentItem.parent.children.length === 0) {
if (parentItem.parent.id === "__global__") {
parentItem.parent.treeList.addChild(getEmptyItem(parentItem.parent.id));
} else {
delete configNodeTypes[parentItem.parent.parent.id];
parentItem.parent.treeList.remove();
if (parentItem.parent.parent.children.length === 0) {
parentItem.parent.parent.treeList.addChild(getEmptyItem(parentItem.parent.parent.id));
}
}
}
} else {
parentItem.treeList.addChild(getEmptyItem(parentItem.id));
}
}
if (n._def.category === 'config' && n.type !== 'group') {
// This must be a config node that has been rescoped
createFlowConfigNode(parent,n.type);
configNodeTypes[parent].types[n.type].treeList.addChild(objects[n.id]);
} else {
// This is a node that has moved groups
if (empties[parent]) {
empties[parent].treeList.remove();
delete empties[parent];
}
objects[parent].treeList.addChild(existingObject)
}
// if (parent === "__global__") {
// // Global always exists here
// if (!configNodeTypes[parent][n.type]) {
// configNodeTypes[parent][n.type] = {
// config: true,
// label: n.type,
// children: []
// }
// globalConfigNodes.treeList.addChild(configNodeTypes[parent][n.type])
// }
// configNodeTypes[parent][n.type].treeList.addChild(existingObject);
// } else {
// if (empties[parent]) {
// empties[parent].treeList.remove();
// delete empties[parent];
// }
// objects[parent].treeList.addChild(existingObject)
// }
}
existingObject.element.toggleClass("red-ui-info-outline-item-disabled", !!n.d)
if (n._def.category === "config" && n.type !== 'group') {
existingObject.element.find(".red-ui-info-outline-item-control-users").text(n.users.length);
}
updateSearch();
}
function onObjectRemove(n) {
var existingObject = objects[n.id];
@@ -393,21 +490,67 @@ RED.sidebar.info.outliner = (function() {
if (empties[n.id]) {
delete empties[n.id];
}
var parent = existingObject.parent;
if (parent.children.length === 0) {
parent.treeList.addChild(getEmptyItem(parent.id));
if (parent.config) {
// this is a config
parent.treeList.remove();
delete configNodeTypes[parent.parent.id||n.z].types[n.type];
if (parent.parent.children.length === 0) {
if (parent.parent.id === "__global__") {
parent.parent.treeList.addChild(getEmptyItem(parent.parent.id));
} else {
delete configNodeTypes[n.z];
parent.parent.treeList.remove();
if (parent.parent.parent.children.length === 0) {
parent.parent.parent.treeList.addChild(getEmptyItem(parent.parent.parent.id));
}
}
}
} else {
parent.treeList.addChild(getEmptyItem(parent.id));
}
}
}
function getGutter(n) {
var span = $("<span>",{class:"red-ui-info-outline-gutter"});
$('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-search"></i></button>').appendTo(span).on("click",function(evt) {
var revealButton = $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-search"></i></button>').appendTo(span).on("click",function(evt) {
evt.preventDefault();
evt.stopPropagation();
RED.view.reveal(n.id);
})
RED.popover.tooltip(revealButton,RED._("sidebar.info.find"));
return span;
}
function createFlowConfigNode(parent,type) {
// console.log("createFlowConfig",parent,type,configNodeTypes[parent]);
if (empties[parent]) {
empties[parent].treeList.remove();
delete empties[parent];
}
if (!configNodeTypes[parent]) {
// There is no 'config nodes' item in the parent flow
configNodeTypes[parent] = {
config: true,
flow: parent,
types: {},
label: RED._("menu.label.displayConfig"),
children: []
}
objects[parent].treeList.insertChildAt(configNodeTypes[parent],0);
// console.log("CREATED", parent)
}
if (!configNodeTypes[parent].types[type]) {
configNodeTypes[parent].types[type] = {
config: true,
label: type,
children: []
}
configNodeTypes[parent].treeList.addChild(configNodeTypes[parent].types[type]);
// console.log("CREATED", parent,type)
}
}
function onNodeAdd(n) {
objects[n.id] = {
id: n.id,
@@ -422,8 +565,9 @@ RED.sidebar.info.outliner = (function() {
delete missingParents[n.id]
}
}
var parent = n.g||n.z;
if (parent) {
var parent = n.g||n.z||"__global__";
if (n._def.category !== "config" || n.type === 'group') {
if (objects[parent]) {
if (empties[parent]) {
empties[parent].treeList.remove();
@@ -439,12 +583,24 @@ RED.sidebar.info.outliner = (function() {
missingParents[parent].push(objects[n.id])
}
} else {
// No parent - add to Global flow list
globalConfigNodes.treeList.addChild(objects[n.id])
createFlowConfigNode(parent,n.type);
configNodeTypes[parent].types[n.type].treeList.addChild(objects[n.id]);
}
objects[n.id].element.toggleClass("red-ui-info-outline-item-disabled", !!n.d)
updateSearch();
}
var updateSearchTimer;
function updateSearch() {
if (updateSearchTimer) {
clearTimeout(updateSearchTimer)
}
if (activeSearch) {
updateSearchTimer = setTimeout(function() {
searchInput.searchBox("change");
},100);
}
}
function onSelectionChanged(selection) {
// treeList.treeList('clearSelection');
}

View File

@@ -118,6 +118,8 @@ RED.sidebar.info = (function() {
enableOnEdit: true
});
RED.events.on("sidebar:resize", resizeStack);
$(window).on("resize", resizeStack);
$(window).on("focus", resizeStack);
@@ -240,13 +242,8 @@ RED.sidebar.info = (function() {
subflowNode = node;
}
subflowUserCount = 0;
var subflowType = "subflow:"+subflowNode.id;
RED.nodes.eachNode(function(n) {
if (n.type === subflowType) {
subflowUserCount++;
}
});
subflowUserCount = subflowNode.instances.length;
}
propertiesPanelHeaderIcon.empty();

View File

@@ -112,14 +112,14 @@ RED.touch.radialMenu = (function() {
if (!opt.disabled) {
if (p[0]>opt.x-30 && p[0]<opt.x+30 && p[1]>opt.y-30 && p[1]<opt.y+30) {
if (opt !== activeOption) {
opt.el.style("background","#999");
opt.el.classed("selected",true);
activeOption = opt;
}
} else if (opt === activeOption) {
opt.el.style("background","#fff");
activeOption = null;
} else {
opt.el.style("background","#fff");
if (opt === activeOption) {
activeOption = null;
}
opt.el.classed("selected",false);
}
}
}

View File

@@ -241,10 +241,13 @@ RED.typeSearch = (function() {
$(document).off('mousedown.red-ui-type-search');
$(document).off('mouseup.red-ui-type-search');
$(document).off('click.red-ui-type-search');
$(document).off('touchstart.red-ui-type-search');
$(document).off('mousedown.red-ui-type-search');
setTimeout(function() {
$(document).on('mousedown.red-ui-type-search',handleMouseActivity);
$(document).on('mouseup.red-ui-type-search',handleMouseActivity);
$(document).on('click.red-ui-type-search',handleMouseActivity);
$(document).on('touchstart.red-ui-type-search',handleMouseActivity);
},200);
refreshTypeList(opts);
@@ -260,7 +263,9 @@ RED.typeSearch = (function() {
searchResultsDiv.slideDown(300);
setTimeout(function() {
searchResultsDiv.find(".red-ui-editableList-container").scrollTop(0);
searchInput.trigger("focus");
if (!opts.disableFocus) {
searchInput.trigger("focus");
}
},100);
}
function hide(fast) {
@@ -279,6 +284,7 @@ RED.typeSearch = (function() {
$(document).off('mousedown.red-ui-type-search');
$(document).off('mouseup.red-ui-type-search');
$(document).off('click.red-ui-type-search');
$(document).off('touchstart.red-ui-type-search');
}
}
function getTypeLabel(type, def) {

View File

@@ -52,7 +52,9 @@ RED.utils = (function() {
} else if (value === null) {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-null">null</span>');
} else if (typeof value === 'object') {
if (value.hasOwnProperty('type') && value.type === 'Buffer' && value.hasOwnProperty('data')) {
if (value.hasOwnProperty('type') && value.type === 'undefined') {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-null">undefined</span>');
} else if (value.hasOwnProperty('type') && value.type === 'Buffer' && value.hasOwnProperty('data')) {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('buffer['+value.length+']');
} else if (value.hasOwnProperty('type') && value.type === 'array' && value.hasOwnProperty('data')) {
result = $('<span class="red-ui-debug-msg-object-value red-ui-debug-msg-type-meta"></span>').text('array['+value.length+']');
@@ -348,6 +350,8 @@ RED.utils = (function() {
}
if (obj === null || obj === undefined) {
$('<span class="red-ui-debug-msg-type-null">'+obj+'</span>').appendTo(entryObj);
} else if (obj.__enc__ && obj.type === 'undefined') {
$('<span class="red-ui-debug-msg-type-null">undefined</span>').appendTo(entryObj);
} else if (obj.__enc__ && obj.type === 'number') {
e = $('<span class="red-ui-debug-msg-type-number red-ui-debug-msg-object-header"></span>').text(obj.data).appendTo(entryObj);
} else if (typeHint === "function" || (obj.__enc__ && obj.type === 'function')) {

View File

@@ -102,11 +102,13 @@ RED.view.tools = (function() {
node.n.dirty = true;
if (node.n.type === "group") {
RED.group.markDirty(node.n);
minX = Math.min(node.n.x - 5,minX);
minY = Math.min(node.n.y - 5,minY);
} else {
minX = Math.min(node.n.x-node.n.w/2-5,minX);
minY = Math.min(node.n.y-node.n.h/2-5,minY);
}
minX = Math.min(node.n.x-node.n.w/2-5,minX);
minY = Math.min(node.n.y-node.n.h/2-5,minY);
}
if (minX !== 0 || minY !== 0) {
for (var n = 0; n<moving_set.length; n++) {
node = moving_set[n];

File diff suppressed because it is too large Load Diff

View File

@@ -39,7 +39,11 @@ RED.user = (function() {
closeOnEscape: !!opts.cancelable,
width: 600,
resizable: false,
draggable: false
draggable: false,
close: function( event, ui ) {
$("#node-dialog-login").dialog('destroy').remove();
RED.keyboard.enable()
}
});
$("#node-dialog-login-fields").empty();
@@ -98,10 +102,10 @@ RED.user = (function() {
data: body
}).done(function(data,textStatus,xhr) {
RED.settings.set("auth-tokens",data);
$("#node-dialog-login").dialog('destroy').remove();
if (opts.updateMenu) {
updateUserMenu();
}
$("#node-dialog-login").dialog("close");
done();
}).fail(function(jqXHR,textStatus,errorThrown) {
RED.settings.remove("auth-tokens");
@@ -143,7 +147,8 @@ RED.user = (function() {
}
if (opts.cancelable) {
$("#node-dialog-login-cancel").button().on("click", function( event ) {
$("#node-dialog-login").dialog('destroy').remove();
$("#node-dialog-login").dialog('close');
});
}
@@ -152,8 +157,7 @@ RED.user = (function() {
$("#node-dialog-login-image").load(function() {
dialog.dialog("open");
}).attr("src",loginImageSrc);
RED.keyboard.disable();
}
});
}

View File

@@ -67,6 +67,9 @@
text-decoration: none;
color: $primary-text-color;
}
a:focus {
outline: 1px solid $form-input-focus-color;
}
p {
margin: 0 0 10px;

View File

@@ -129,7 +129,7 @@ $workspace-button-color-primary: #eee;
$workspace-button-background-primary: #AD1625;
$workspace-button-background-primary-hover: #6E0A1E;
$workspace-button-color-focus-outline: $form-input-border-color;
$workspace-button-color-focus-outline: $form-input-focus-color;
$shade-color: rgba(160,160,160,0.5);
@@ -289,3 +289,4 @@ $group-default-fill: none;
$group-default-fill-opacity: 1;
$group-default-stroke: #999;
$group-default-stroke-opacity: 1;
$group-default-label-color: #a4a4a4;

View File

@@ -175,3 +175,38 @@
.red-ui-menu-dropdown-submenu.disabled > a:before {
border-right-color: $menuCaret;
}
// Menu NG
ul.red-ui-menu:not(.red-ui-menu-dropdown) {
font-family: $primary-font;
font-size: 12px;
list-style-type: none;
padding: 0;
margin: 0;
li a {
display: block;
padding: 4px 8px 4px 16px;
clear: both;
font-weight: normal;
line-height: 20px;
color: $menuColor;
white-space: nowrap;
text-decoration: none;
&:hover,&:focus {
color: $menuHoverColor;
text-decoration: none;
background-color: $menuHoverBackground;
border: none;
outline: none;
}
}
&.red-ui-menu-compact {
font-size: 12px;
li a {
line-height: 16px;
}
}
}

View File

@@ -410,7 +410,7 @@ button.red-ui-button.red-ui-editor-node-appearance-button {
.red-ui-group-layout-picker {
padding: 5px;
background: $primary-background;
background: $secondary-background;
}
.red-ui-group-layout-picker-cell-text {
position: absolute;
@@ -597,6 +597,7 @@ div.red-ui-button-small.red-ui-color-picker-opacity-slider-handle {
padding: 4px;
color: $secondary-text-color;
font-size: 0.9em;
line-height: 24px;
}
button {
float: right;
@@ -715,6 +716,9 @@ div.red-ui-button-small.red-ui-color-picker-opacity-slider-handle {
button.red-ui-toggleButton.toggle {
text-align: left;
i {
min-width: 15px;
}
}
@@ -828,8 +832,18 @@ span.red-ui-editor-subflow-env-lang-icon {
right: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.red-ui-editor-subflow-env-input-type {
background: $secondary-background;
height: 100%;
box-sizing: border-box;
}
.red-ui-editor-subflow-env-input-type-placeholder {
color: $tertiary-text-color;
padding-left: 4px;
}
// .red-ui-editor-subflow-ui-grid {
// width: 100%;
// .red-ui-editableList-container {

View File

@@ -35,13 +35,21 @@
pointer-events: none;
-webkit-touch-callout: none;
@include disable-selection;
.red-ui-flow-node-label-text {
dominant-baseline: middle;
}
&.red-ui-flow-node-label-right .red-ui-flow-node-label-text {
text-anchor: end;
}
}
.red-ui-flow-port-label {
stroke-width: 0;
fill: $secondary-text-color;
font-size: 16px;
alignment-baseline: middle;
dominant-baseline: middle;
text-anchor: middle;
pointer-events: none;
-webkit-touch-callout: none;
@@ -98,6 +106,11 @@
pointer-events: stroke;
stroke-opacity: 0;
stroke-width: 3;
&.red-ui-flow-group-outline-select-background {
stroke: $view-background;
stroke-width: 6;
}
}
.red-ui-flow-group-body {
pointer-events: none;
@@ -109,6 +122,7 @@
}
.red-ui-flow-group-label {
@include disable-selection;
fill: $group-default-label-color;
}
@@ -126,6 +140,7 @@
}
.red-ui-flow-node-icon-group {
.fa-lg {
@include disable-selection;
stroke: none;
fill: $node-icon-color;
text-anchor: middle;
@@ -145,6 +160,15 @@
.red-ui-flow-node-button {
fill: inherit;
&.red-ui-flow-node-button-disabled {
opacity: 0.4;
.red-ui-flow-node-button-button {
cursor: default;
}
}
}
.red-ui-flow-node-button-button {
cursor: pointer;
}
.red-ui-flow-node-button-background {
fill: $node-background-placeholder;
@@ -227,7 +251,7 @@ g.red-ui-flow-node-selected {
stroke-dasharray: none;
}
}
@each $current-color in red green yellow blue grey {
@each $current-color in red green yellow blue grey gray {
.red-ui-flow-node-status-dot-#{$current-color} {
fill: map-get($node-status-colors,$current-color);
stroke: map-get($node-status-colors,$current-color);
@@ -319,7 +343,10 @@ g.red-ui-flow-link-unknown path.red-ui-flow-link-line {
stroke-dasharray: 10, 4;
}
@keyframes red-ui-flow-port-tooltip-fadeIn { from { opacity:0; } to { opacity:1; } }
// @keyframes *must* be on multiple lines so build-custom-theme can filter them out
@keyframes red-ui-flow-port-tooltip-fadeIn {
from { opacity:0; } to { opacity:1; }
}
.red-ui-flow-port-tooltip {
opacity:0;

View File

@@ -153,3 +153,61 @@
border-top: none;
}
}
.red-ui-clipboard-dialog-import-conflicts-list-container {
min-height: 300px;
position: relative;
li:not(:first-child) .red-ui-clipboard-dialog-import-conflicts-item-header {
// border-top: 1px solid $secondary-border-color;
}
}
.red-ui-clipboard-dialog-import-conflicts-item-header {
background: $tertiary-background;
& > span:first-child {
color: $header-text-color;
padding-left: 4px;
font-size: 12px;
}
}
.red-ui-clipboard-dialog-import-conflicts-controls {
position: absolute;
top:0;
bottom: 0;
right: 0px;
text-align: center;
color: $form-text-color;
.form-row & label {
padding: 2px 0;
line-height: 23px;
margin-bottom: 0;
width: 80px;
display: inline-block;
position: relative;
height: 100%;
width: 80px;
text-align: center;
border-left: 1px solid $secondary-border-color;
}
input[type="checkbox"] {
display: inline-block;
width: auto;
margin: 0;
}
}
#red-ui-clipboard-dialog-import-conflicts-list .disabled .red-ui-info-outline-item {
opacity: 0.4;
}
.form-row label.red-ui-clipboard-dialog-import-conflicts-gutter {
box-sizing: border-box;
width: 22px;
text-align: center;
.red-ui-editor-dialog & input[type="checkbox"] {
width: auto;
padding: 0;
margin: 0;
}
}

View File

@@ -71,38 +71,9 @@
}
.red-ui-notification-shake-horizontal {
-webkit-animation: red-ui-notification-shake-horizontal 0.3s steps(2, end) both;
animation: red-ui-notification-shake-horizontal 0.3s steps(2, end) both;
}
@-webkit-keyframes red-ui-notification-shake-horizontal {
0%,
100% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
10%,
30%,
50%,
70% {
-webkit-transform: translateX(-1px);
transform: translateX(-1px);
}
20%,
40%,
60% {
-webkit-transform: translateX(1px);
transform: translateX(1px);
}
// 80% {
// -webkit-transform: translateX(1px);
// transform: translateX(1px);
// }
// 90% {
// -webkit-transform: translateX(-1px);
// transform: translateX(-1px);
// }
animation: red-ui-notification-shake-horizontal 0.3s steps(2, end) both;
}
// @keyframes *must* be on multiple lines so build-custom-theme can filter them out
@keyframes red-ui-notification-shake-horizontal {
0%,
100% {
@@ -122,12 +93,4 @@
-webkit-transform: translateX(1px);
transform: translateX(1px);
}
// 80% {
// -webkit-transform: translateX(1px);
// transform: translateX(1px);
// }
// 90% {
// -webkit-transform: translateX(-1px);
// transform: translateX(-1px);
// }
}

View File

@@ -237,3 +237,45 @@ ul.red-ui-palette-module-error-list {
#red-ui-palette-module-install-shade {
padding-top: 80px;
}
button.red-ui-palette-editor-upload-button {
padding: 0;
height: 25px;
margin-top: -1px;
input[type="file"] {
opacity: 0;
margin: 0;
height: 0;
width: 0;
}
.red-ui-settings-tabs-content & label {
margin: 0;
min-width: 0;
padding: 2px 8px;
}
form {
width: 0;
}
}
.red-ui-palette-editor-upload {
display: none;
position: absolute;
left: 0;
right: 0;
top: 44px;
padding: 20px;
background: $secondary-background;
border-bottom: 1px $secondary-border-color solid;
box-shadow: 1px 1px 4px $shadow;
.placeholder-input {
width: calc(100% - 180px);
margin: 0;
}
}
.red-ui-palette-editor-upload-buttons {
float: right;
button {
margin-left: 10px;
}
}

View File

@@ -204,7 +204,7 @@
.red-ui-palette-icon-fa {
color: white;
position: absolute;
top: 7px;
top: calc(50% - 7px);
left: 3px;
}
.red-ui-palette-node-small {

View File

@@ -265,6 +265,26 @@
}
}
}
.red-ui-projects-dialog-project-list-entry-delete-confirm {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 100%;
width: 1000px;
overflow: hidden;
padding: 5px 20px;
background: $secondary-background;
transition: left 0.4s;
white-space: nowrap;
> span {
line-height: 40px;
}
button {
margin-left: 20px;
}
}
.red-ui-projects-dialog-screen-create-type {
position: relative;
}

View File

@@ -42,7 +42,11 @@
background: $secondary-background;
border: 2px solid $primary-border-color;
text-align: center;
line-height:50px
line-height:50px;
&.selected {
background: $workspace-button-background-hover;
}
}
.red-ui-editor-radial-menu-opt-disabled {

View File

@@ -29,6 +29,10 @@
.red-ui-searchBox-container {
display: inline-block;
margin-right: 6px;
width: 100%;
}
&:not(.red-ui-type-search) .red-ui-searchBox-container {
width: calc(100% - 30px);
}
}
@@ -46,6 +50,7 @@
border: 1px dashed $primary-border-color;
border-bottom: none;
padding: 0;
width: 100%;
}
.red-ui-search-results-container {
display: none;

View File

@@ -20,6 +20,10 @@
height: 100%;
overflow-y:auto;
@include disable-selection;
&:focus {
outline: none;
}
}
ul.red-ui-sidebar-node-config-list {

View File

@@ -39,6 +39,13 @@
vertical-align: top;
}
button.red-ui-toggleButton.toggle {
text-align: center;
i {
min-width: 10px;
}
}
}
.red-ui-sidebar-context-property {

View File

@@ -321,15 +321,12 @@ div.red-ui-info-table {
border: none;
border-radius: 0;
}
.red-ui-treeList-label {
font-size: 13px;
padding: 2px 0;
overflow: hidden;
}
.red-ui-info-outline-project {
border-bottom: 1px solid $secondary-border-color;
}
}
.red-ui-info-outline,.red-ui-sidebar-help-toc, #red-ui-clipboard-dialog-import-conflicts-list {
.red-ui-info-outline-item {
display: inline-block;
padding: 0;
@@ -366,6 +363,12 @@ div.red-ui-info-table {
}
}
.red-ui-treeList-label {
font-size: 13px;
padding: 2px 0;
overflow: hidden;
}
.red-ui-search-result-node {
width: 24px;
height: 20px;
@@ -387,6 +390,7 @@ div.red-ui-info-table {
color: $secondary-text-color;
}
}
.red-ui-info-outline-item-control-spacer {
display: inline-block;
width: 23px;
@@ -501,7 +505,7 @@ div.red-ui-info-table {
position: absolute;
top: 6px;
right: 8px;
width: calc(100% - 150px);
width: calc(100% - 130px);
max-width: 250px;
background: $palette-header-background;
}

View File

@@ -19,7 +19,7 @@
color: $secondary-text-color;
cursor: pointer;
input {
display:none;
display:none !important;
}
&.disabled {

View File

@@ -18,23 +18,32 @@
.red-ui-searchBox-container {
position: relative;
i {
position: absolute;
top: 9px;
font-size: 10px;
color: $secondary-text-color;
}
i.fa-search {
position: absolute;
pointer-events: none;
left: 8px;
top: 9px;
}
i.fa-caret-down {
position: absolute;
right: 6px;
font-size: 12px;
}
i.fa-times {
position: absolute;
right: 5px;
top: 9px;
right: 4px;
}
form.red-ui-searchBox-form {
margin: 0;
}
a.red-ui-searchBox-opts:hover {
color: $workspace-button-color-hover;
background: $workspace-button-background-hover;
}
input.red-ui-searchBox-input {
border-radius: 0;
border: none;
@@ -57,9 +66,12 @@
right: 0;
top: 0;
bottom: 0;
width: 20px;
width: 16px;
}
a.red-ui-searchBox-clear {
display: none;
}
.red-ui-searchBox-resultCount {
position: absolute;
right: 18px;
@@ -70,15 +82,32 @@
font-size: 9px;
border-radius: 4px;
}
&.red-ui-searchBox-has-options {
a.red-ui-searchBox-clear {
right: 16px;
}
.red-ui-searchBox-resultCount {
right: 33px;
}
input.red-ui-searchBox-input {
padding-right: 33px;
}
}
}
.red-ui-searchBox-compact {
input:focus.red-ui-searchBox-input {
outline: 1px solid $form-input-focus-color;
}
input.red-ui-searchBox-input,input:focus.red-ui-searchBox-input {
border: 1px solid $secondary-border-color;
border-radius: 3px;
font-size: 12px;
height: 26px;
}
i.fa-times,i.fa-search {
i.fa-times,i.fa-search, i.fa-caret-down {
top: 7px;
}
.red-ui-searchBox-resultCount {

View File

@@ -79,7 +79,7 @@
display: table;
clear: both;
}
.uneditable-input, input, textarea {
.uneditable-input, input[type="text"],input[type="password"], textarea {
width: calc(100% - 150px);
}
textarea {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More