mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
1 Commits
file-node-
...
delete-unu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93d5db9752 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,4 +21,3 @@ nodes/core/locales/zz-ZZ
|
||||
packages/node_modules/@node-red/editor-client/public
|
||||
!test/**/node_modules
|
||||
docs
|
||||
!packages/node_modules/**/docs
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/Gruntfile.js
|
||||
/.git/*
|
||||
/lib/*
|
||||
*.backup
|
||||
/public/*
|
||||
|
||||
121
CHANGELOG.md
121
CHANGELOG.md
@@ -1,124 +1,3 @@
|
||||
#### 0.20.0-beta.2: Beta Release
|
||||
|
||||
- Split Node-RED internals into multiple sub-modules
|
||||
|
||||
Editor
|
||||
|
||||
- Allow the editor to use a custom admin api url root
|
||||
- Improve performance of Flow Diff dialog - @TothiViseo #1989
|
||||
- Add 'open project' option to Projects Welcome dialog
|
||||
- Add 'type already registered' check in palette editor
|
||||
- Handle missing tab.disabled property
|
||||
- Handle missing wires prop and string x/y props on import
|
||||
- Add RED.notifications.hide flag - for UI testing
|
||||
- Improve alignment of node label edit inputs
|
||||
- Show arrow-in node when invalid font-awesome icon name was specified for default icon
|
||||
- Add ability to delete context values from sidebar
|
||||
- Allow copy-to-clipboard copy whole tabs
|
||||
- Make disabled flows more obvious in editor
|
||||
- Allow import/export from file in editor
|
||||
- Allow config nodes to be selected in sidebar and deleted
|
||||
- Show port label of subflow with input port
|
||||
- Support ctrl-click selection of flow tabs
|
||||
- Allow left-hand node button to act as toggle
|
||||
- Support dbl-click in tab bar to add new flow in position
|
||||
- Fix duplicate subflow detection on import
|
||||
- Add import notification with info on what has been imported Closes #1862
|
||||
- Show error details when trying to import invalid json
|
||||
- Show default icon when non-existent font-awesome icon was specified
|
||||
- Add configurable option for showing node label
|
||||
- Avoid http redirects as Safari doesn't reuse Auth header Fixes #1903
|
||||
- Tidy up ace tooltip styling
|
||||
- Add event log to editor
|
||||
- Add tooltips to multiple editor elements
|
||||
- Allow palette to be hidden
|
||||
- Add node module into to sidebar and palette popover
|
||||
- Mark all newly imported nodes as changed
|
||||
- Allow a node label to be hidden
|
||||
- Add markdown formatting toolbar
|
||||
- Add markdown toolbar to various editors
|
||||
- Fix i18n handling for ja-JP locale on Safari/MacOS
|
||||
- Add node body tooltip
|
||||
- Decrease opacity of flow-navigator
|
||||
- Update tooltip style
|
||||
- Update ACE to 1.4.1-src-min-noconflict
|
||||
- Cache node locales by language
|
||||
- Show icon element with either icon image or fa-icon
|
||||
- Added font-awesome icons to user defined icon
|
||||
- Update info side bar with node description section
|
||||
- One-click search of config node users
|
||||
- Redesign node edit dialog to tabbed style
|
||||
- Add 'restart flows' option to deploy menu
|
||||
- Add node description property UI
|
||||
|
||||
|
||||
Runtime
|
||||
|
||||
- Allow a project to be loaded from cmdline
|
||||
- Handle lookup of undefined property in Global context Fixes #1978
|
||||
- Refuse to enable Manage Palette if npm too old
|
||||
- Remove restriction on upgrading non-local modules
|
||||
- Remove deprecated Buffer constructor usage Fixes #1709
|
||||
- Update httpServerOptions doc in settings.js
|
||||
- Exclude non-testable .js files from the unit tests
|
||||
- Add --safe mode flag to allow starting without flows running
|
||||
- Add setting-defined accessToken for automated access to the adminAPI - #1789
|
||||
|
||||
Nodes
|
||||
|
||||
- Move all core node EN help to their own locale files - #1990
|
||||
- CSV: better regex for number detection
|
||||
- Debug: hide button if not configured to send to sidebar
|
||||
- Delay: report queue activity when in by-topic mode
|
||||
- Delay: add msg.flush mode
|
||||
- Exec: Preserve existing properties on msg object
|
||||
- File: remove CR/LF from incoming filename
|
||||
- Function: create custom ace javascript mode to handle ES6 Fixes #1911
|
||||
- Function: add env.get
|
||||
- HTTP Request: Add http-proxy config #1913
|
||||
- HTTP Request: add msg.redirectList to output
|
||||
- HTTP Request: add msg.requestTimeout option for per-message setting - @natcl #1959
|
||||
- MQTT: add auto-detect and base64 output to mqtt node Fixes #1912 - @DurandA
|
||||
- MQTT: only unsubscribe node that is being removed
|
||||
- Sentiment: move to node-red-node-sentiment
|
||||
- Switch: add missing edit dialog icon
|
||||
- Tail: move to node-red-node-tail
|
||||
- TCPGet: clear status if user changes target per message
|
||||
- Template: tidy up edit dialog
|
||||
- UDP: more resilient binding to correct port for udp, give input side priority
|
||||
- Split/Join: add msg.reset to info panel
|
||||
- Split/Join: reset join without sending part array
|
||||
- Watch: add msg.filename so can feed direct to file in node
|
||||
- WebSocket: preserve \_session on msg but don't send as part of wholemsg
|
||||
|
||||
|
||||
#### 0.19.5: Maintenance Release
|
||||
|
||||
- Recognize pip installs of RPi.GPIO (#1934)
|
||||
- Merge pull request #1941 from node-red-hitachi/master-batch
|
||||
- Merge pull request #1931 from node-red-hitachi/master-typedinput
|
||||
- Set min value of properties and spinners for batch
|
||||
- Fix that unnecessary optionMenu remains
|
||||
- Merge pull request #1894 from node-red-hitachi/fix-overlapping-file-node-execution
|
||||
- Merge pull request #1924 from imZack/patch-1
|
||||
- Add missing comma
|
||||
- Do not disable context sidebar during node edit Fixes #1921
|
||||
- Don't allow virtual links to be spliced Fixes #1920
|
||||
- Merge project package changes to avoid overwritten changes
|
||||
- Handle manually added project deps that are unused Fixes #1908
|
||||
- update close & input handling of File node
|
||||
- make close handler argument only one
|
||||
- Merge pull request #1907 from amilajack/patch-2
|
||||
- Change repo badge to point to master branch
|
||||
- invoke callbacks if async handler is specified
|
||||
- Merge pull request #1891 from camlow325/resolve-example-path-for-windows-support
|
||||
- Merge pull request #1900 from kazuhitoyokoi/master-addtestcases4settings.js
|
||||
- wait closing while pending messages exist
|
||||
- Add test cases for red/api/editor/settings.js
|
||||
- Ensure all palette categories are opened properly Closes #1893
|
||||
- Resolve path when sending example file for Windows support
|
||||
- fix multiple input message processing of file node
|
||||
|
||||
#### 0.19.4: Maintenance Release
|
||||
|
||||
- Fix race condition in non-cache lfs context Fixes #1888
|
||||
|
||||
92
Gruntfile.js
92
Gruntfile.js
@@ -57,8 +57,7 @@ module.exports = function(grunt) {
|
||||
ignoreLeaks: false,
|
||||
ui: 'bdd',
|
||||
reportFormats: ['lcov','html'],
|
||||
print: 'both',
|
||||
istanbulOptions: ['--no-default-excludes', '-i','**/packages/node_modules/**']
|
||||
print: 'both'
|
||||
},
|
||||
all: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js","test/nodes/**/*_spec.js"] },
|
||||
core: { src: ["test/unit/_spec.js","test/unit/**/*_spec.js"]},
|
||||
@@ -119,7 +118,6 @@ module.exports = function(grunt) {
|
||||
src: [
|
||||
// Ensure editor source files are concatenated in
|
||||
// the right order
|
||||
"packages/node_modules/@node-red/editor-client/src/js/jquery-addons.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/red.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/events.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/i18n.js",
|
||||
@@ -130,12 +128,10 @@ module.exports = function(grunt) {
|
||||
"packages/node_modules/@node-red/editor-client/src/js/text/format.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/state.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/nodes.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/font-awesome.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/history.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/validators.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/utils.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/common/checkboxSet.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/common/panels.js",
|
||||
@@ -159,7 +155,6 @@ module.exports = function(grunt) {
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/palette-editor.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/editor.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/editors/*.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/event-log.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/tray.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js",
|
||||
"packages/node_modules/@node-red/editor-client/src/js/ui/library.js",
|
||||
@@ -231,7 +226,7 @@ module.exports = function(grunt) {
|
||||
messages: {
|
||||
src: [
|
||||
'packages/node_modules/@node-red/nodes/locales/**/*.json',
|
||||
'packages/node_modules/@node-red/editor-client/locales/**/*.json',
|
||||
'packages/node_modules/@node-red/editor-api/lib/editor/locales/**/*.json',
|
||||
'packages/node_modules/@node-red/runtime/locales/**/*.json'
|
||||
]
|
||||
},
|
||||
@@ -286,7 +281,7 @@ module.exports = function(grunt) {
|
||||
json: {
|
||||
files: [
|
||||
'packages/node_modules/@node-red/nodes/locales/**/*.json',
|
||||
'packages/node_modules/@node-red/editor-client/locales/**/*.json',
|
||||
'packages/node_modules/@node-red/editor-api/lib/editor/locales/**/*.json',
|
||||
'packages/node_modules/@node-red/runtime/locales/**/*.json'
|
||||
],
|
||||
tasks: ['jsonlint:messages']
|
||||
@@ -373,16 +368,6 @@ module.exports = function(grunt) {
|
||||
{
|
||||
src: 'CHANGELOG.md',
|
||||
dest: 'packages/node_modules/@node-red/editor-client/public/red/about'
|
||||
},
|
||||
{
|
||||
src: 'CHANGELOG.md',
|
||||
dest: 'packages/node_modules/node-red/'
|
||||
},
|
||||
{
|
||||
cwd: 'packages/node_modules/@node-red/editor-client/src/ace/bin/',
|
||||
src: '**',
|
||||
expand: true,
|
||||
dest: 'packages/node_modules/@node-red/editor-client/public/vendor/ace/'
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -398,28 +383,6 @@ module.exports = function(grunt) {
|
||||
]
|
||||
}
|
||||
},
|
||||
'npm-command': {
|
||||
options: {
|
||||
cmd: "pack",
|
||||
cwd: "<%= paths.dist %>/modules"
|
||||
},
|
||||
'node-red': { options: { args: [__dirname+'/packages/node_modules/node-red'] } },
|
||||
'@node-red/editor-api': { options: { args: [__dirname+'/packages/node_modules/@node-red/editor-api'] } },
|
||||
'@node-red/editor-client': { options: { args: [__dirname+'/packages/node_modules/@node-red/editor-client'] } },
|
||||
'@node-red/nodes': { options: { args: [__dirname+'/packages/node_modules/@node-red/nodes'] } },
|
||||
'@node-red/registry': { options: { args: [__dirname+'/packages/node_modules/@node-red/registry'] } },
|
||||
'@node-red/runtime': { options: { args: [__dirname+'/packages/node_modules/@node-red/runtime'] } },
|
||||
'@node-red/util': { options: { args: [__dirname+'/packages/node_modules/@node-red/util'] } }
|
||||
|
||||
|
||||
},
|
||||
mkdir: {
|
||||
release: {
|
||||
options: {
|
||||
create: ['<%= paths.dist %>/modules']
|
||||
},
|
||||
},
|
||||
},
|
||||
compress: {
|
||||
release: {
|
||||
options: {
|
||||
@@ -434,41 +397,28 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
jsdoc : {
|
||||
modules: {
|
||||
src: [
|
||||
'packages/node_modules/node-red/lib/red.js',
|
||||
'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/util/**/*.js',
|
||||
],
|
||||
runtimeAPI: {
|
||||
src: 'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
||||
options: {
|
||||
destination: 'docs',
|
||||
configure: './jsdoc.json'
|
||||
}
|
||||
},
|
||||
editor: {
|
||||
src: [
|
||||
'packages/node_modules/@node-red/editor-client/src/js'
|
||||
],
|
||||
nodeREDUtil: {
|
||||
src: 'packages/node_modules/@node-red/util/**/*.js',
|
||||
options: {
|
||||
destination: 'packages/node_modules/@node-red/editor-client/docs',
|
||||
destination: 'packages/node_modules/@node-red/util/docs',
|
||||
configure: './jsdoc.json'
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
jsdoc2md: {
|
||||
runtimeAPI: {
|
||||
options: {
|
||||
separators: true
|
||||
},
|
||||
src: [
|
||||
'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'
|
||||
],
|
||||
dest: 'packages/node_modules/@node-red/runtime/docs/api.md'
|
||||
src: 'packages/node_modules/@node-red/runtime/lib/api/*.js',
|
||||
dest: 'docs/runtime-api.md'
|
||||
},
|
||||
nodeREDUtil: {
|
||||
options: {
|
||||
@@ -497,8 +447,6 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-webdriver');
|
||||
grunt.loadNpmTasks('grunt-jsdoc');
|
||||
grunt.loadNpmTasks('grunt-jsdoc-to-markdown');
|
||||
grunt.loadNpmTasks('grunt-npm-command');
|
||||
grunt.loadNpmTasks('grunt-mkdir');
|
||||
|
||||
grunt.registerMultiTask('attachCopyright', function() {
|
||||
var files = this.data.src;
|
||||
@@ -541,15 +489,12 @@ module.exports = function(grunt) {
|
||||
});
|
||||
|
||||
grunt.registerTask('verifyPackageDependencies', function() {
|
||||
var done = this.async();
|
||||
var verifyDependencies = require("./scripts/verify-package-dependencies.js");
|
||||
verifyDependencies().then(function(failures) {
|
||||
if (failures.length > 0) {
|
||||
failures.forEach(f => grunt.log.error(f));
|
||||
grunt.fail.fatal("Failed to verify package dependencies");
|
||||
}
|
||||
done();
|
||||
});
|
||||
var failures = verifyDependencies();
|
||||
if (failures.length > 0) {
|
||||
failures.forEach(f => grunt.log.error(f));
|
||||
grunt.fail.fatal("Failed to verify package dependencies");
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('setDevEnv',
|
||||
@@ -588,12 +533,7 @@ module.exports = function(grunt) {
|
||||
|
||||
grunt.registerTask('release',
|
||||
'Create distribution zip file',
|
||||
['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules']);
|
||||
|
||||
grunt.registerTask('pack-modules',
|
||||
'Create module pack files for release',
|
||||
['mkdir:release','npm-command']);
|
||||
|
||||
['build','verifyPackageDependencies','clean:release','chmod:release','compress:release']);
|
||||
|
||||
grunt.registerTask('coverage',
|
||||
'Run Istanbul code test coverage task',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
http://nodered.org
|
||||
|
||||
[](https://travis-ci.org/node-red/node-red)
|
||||
[](https://travis-ci.org/node-red/node-red)
|
||||
[](https://coveralls.io/r/node-red/node-red?branch=master)
|
||||
|
||||
A visual tool for wiring the Internet of Things.
|
||||
|
||||
52
package.json
52
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "0.20.0-beta.2",
|
||||
"version": "0.20.0-alpha.0",
|
||||
"description": "A visual tool for wiring the Internet of Things",
|
||||
"homepage": "http://nodered.org",
|
||||
"license": "Apache-2.0",
|
||||
@@ -24,40 +24,37 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"ajv": "6.6.1",
|
||||
"basic-auth": "2.0.1",
|
||||
"ajv": "6.5.3",
|
||||
"basic-auth": "2.0.0",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.18.3",
|
||||
"cheerio": "0.22.0",
|
||||
"clone": "2.1.2",
|
||||
"cookie": "0.3.1",
|
||||
"cookie-parser": "1.4.3",
|
||||
"cors": "2.8.5",
|
||||
"cron": "1.5.1",
|
||||
"denque": "1.4.0",
|
||||
"express": "4.16.4",
|
||||
"cors": "2.8.4",
|
||||
"cron": "1.4.1",
|
||||
"denque": "1.3.0",
|
||||
"express": "4.16.3",
|
||||
"express-session": "1.15.6",
|
||||
"fs-extra": "7.0.1",
|
||||
"fs-extra": "5.0.0",
|
||||
"fs.notify": "0.0.4",
|
||||
"hash-sum": "1.0.2",
|
||||
"https-proxy-agent": "2.2.1",
|
||||
"i18next": "12.1.0",
|
||||
"i18next": "11.6.0",
|
||||
"is-utf8": "0.2.1",
|
||||
"js-yaml": "3.12.0",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"jsonata": "1.5.4",
|
||||
"media-typer": "1.0.1",
|
||||
"media-typer": "0.3.0",
|
||||
"memorystore": "1.6.0",
|
||||
"micromatch": "3.1.10",
|
||||
"mime": "2.4.0",
|
||||
"mime": "1.4.1",
|
||||
"mqtt": "2.18.8",
|
||||
"multer": "1.4.1",
|
||||
"mustache": "3.0.1",
|
||||
"node-red-node-email": "1.0.*",
|
||||
"node-red-node-feedparser": "^0.1.14",
|
||||
"multer": "1.3.1",
|
||||
"mustache": "2.3.2",
|
||||
"node-red-node-email": "0.1.*",
|
||||
"node-red-node-feedparser": "^0.1.12",
|
||||
"node-red-node-rbe": "0.2.*",
|
||||
"node-red-node-sentiment": "^0.1.0",
|
||||
"node-red-node-tail": "^0.0.1",
|
||||
"node-red-node-twitter": "^1.1.0",
|
||||
"nopt": "4.0.1",
|
||||
"oauth2orize": "1.11.0",
|
||||
@@ -67,7 +64,7 @@
|
||||
"passport-oauth2-client-password": "0.1.2",
|
||||
"raw-body": "2.3.3",
|
||||
"request": "2.88.0",
|
||||
"semver": "5.6.0",
|
||||
"semver": "5.5.1",
|
||||
"sentiment": "2.1.0",
|
||||
"uglify-js": "3.4.9",
|
||||
"when": "3.7.8",
|
||||
@@ -78,10 +75,10 @@
|
||||
"bcrypt": "~2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chromedriver": "2.43.1",
|
||||
"chromedriver": "^2.41.0",
|
||||
"grunt": "~1.0.3",
|
||||
"grunt-chmod": "~1.1.1",
|
||||
"grunt-cli": "~1.3.2",
|
||||
"grunt-cli": "~1.3.1",
|
||||
"grunt-concurrent": "~2.3.1",
|
||||
"grunt-contrib-clean": "~1.1.0",
|
||||
"grunt-contrib-compress": "~1.4.0",
|
||||
@@ -93,10 +90,8 @@
|
||||
"grunt-jsdoc": "^2.2.1",
|
||||
"grunt-jsdoc-to-markdown": "^4.0.0",
|
||||
"grunt-jsonlint": "~1.1.0",
|
||||
"grunt-mkdir": "~1.0.0",
|
||||
"grunt-mocha-istanbul": "5.0.2",
|
||||
"grunt-nodemon": "~0.4.2",
|
||||
"grunt-npm-command": "~0.1.2",
|
||||
"grunt-sass": "~2.0.0",
|
||||
"grunt-simple-mocha": "~0.4.1",
|
||||
"grunt-webdriver": "^2.0.3",
|
||||
@@ -104,15 +99,14 @@
|
||||
"istanbul": "0.4.5",
|
||||
"minami": "1.2.3",
|
||||
"mocha": "^5.2.0",
|
||||
"mosca": "^2.8.3",
|
||||
"should": "^8.4.0",
|
||||
"sinon": "1.17.7",
|
||||
"stoppable": "^1.1.0",
|
||||
"supertest": "3.3.0",
|
||||
"wdio-chromedriver-service": "^0.1.5",
|
||||
"wdio-mocha-framework": "^0.6.4",
|
||||
"stoppable": "^1.0.6",
|
||||
"supertest": "3.1.0",
|
||||
"wdio-chromedriver-service": "^0.1.3",
|
||||
"wdio-mocha-framework": "^0.6.2",
|
||||
"wdio-spec-reporter": "^0.1.5",
|
||||
"webdriverio": "^4.14.1",
|
||||
"webdriverio": "^4.13.1",
|
||||
"node-red-node-test-helper": "node-red/node-red-node-test-helper",
|
||||
"jsdoc-nr-template": "node-red/jsdoc-nr-template"
|
||||
},
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
src
|
||||
docs
|
||||
@@ -37,20 +37,5 @@ module.exports = {
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
},
|
||||
|
||||
delete: function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
scope: req.params.scope,
|
||||
id: req.params.id,
|
||||
key: req.params[0],
|
||||
store: req.query['store']
|
||||
}
|
||||
runtimeAPI.context.delete(opts).then(function(result) {
|
||||
res.status(204).end();
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,11 +62,6 @@ module.exports = {
|
||||
adminApp.get("/context/:scope(node|flow)/:id",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
||||
adminApp.get("/context/:scope(node|flow)/:id/*",needsPermission("context.read"),context.get,apiUtil.errorHandler);
|
||||
|
||||
// adminApp.delete("/context/:scope(global)",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||
adminApp.delete("/context/:scope(global)/*",needsPermission("context.write"),context.delete,apiUtil.errorHandler);
|
||||
// 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);
|
||||
|
||||
return adminApp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,9 +39,8 @@ server.exchange(oauth2orize.exchange.password(strategies.passwordTokenExchange))
|
||||
function init(_settings,storage) {
|
||||
settings = _settings;
|
||||
if (settings.adminAuth) {
|
||||
var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
|
||||
Users.init(mergedAdminAuth);
|
||||
Tokens.init(mergedAdminAuth,storage);
|
||||
Users.init(settings.adminAuth);
|
||||
Tokens.init(settings.adminAuth,storage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,24 +79,23 @@ function getToken(req,res,next) {
|
||||
function login(req,res) {
|
||||
var response = {};
|
||||
if (settings.adminAuth) {
|
||||
var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
|
||||
if (mergedAdminAuth.type === "credentials") {
|
||||
if (settings.adminAuth.type === "credentials") {
|
||||
response = {
|
||||
"type":"credentials",
|
||||
"prompts":[{id:"username",type:"text",label:"user.username"},{id:"password",type:"password",label:"user.password"}]
|
||||
}
|
||||
} else if (mergedAdminAuth.type === "strategy") {
|
||||
} else if (settings.adminAuth.type === "strategy") {
|
||||
|
||||
var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot;
|
||||
response = {
|
||||
"type":"strategy",
|
||||
"prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
|
||||
"prompts":[{type:"button",label:settings.adminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
|
||||
}
|
||||
if (mergedAdminAuth.strategy.icon) {
|
||||
response.prompts[0].icon = mergedAdminAuth.strategy.icon;
|
||||
if (settings.adminAuth.strategy.icon) {
|
||||
response.prompts[0].icon = settings.adminAuth.strategy.icon;
|
||||
}
|
||||
if (mergedAdminAuth.strategy.image) {
|
||||
response.prompts[0].image = theme.serveFile('/login/',mergedAdminAuth.strategy.image);
|
||||
if (settings.adminAuth.strategy.image) {
|
||||
response.prompts[0].image = theme.serveFile('/login/',settings.adminAuth.strategy.image);
|
||||
}
|
||||
}
|
||||
if (theme.context().login && theme.context().login.image) {
|
||||
@@ -182,12 +180,7 @@ function genericStrategy(adminApp,strategy) {
|
||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||
completeGenerateStrategyAuth
|
||||
);
|
||||
|
||||
var callbackMethodFunc = adminApp.get;
|
||||
if (/^post$/i.test(options.callbackMethod)) {
|
||||
callbackMethodFunc = adminApp.post;
|
||||
}
|
||||
callbackMethodFunc('/auth/strategy/callback',
|
||||
adminApp.get('/auth/strategy/callback',
|
||||
passport.authenticate(strategy.name, {session:false, failureRedirect: settings.httpAdminRoot }),
|
||||
completeGenerateStrategyAuth
|
||||
);
|
||||
|
||||
@@ -25,39 +25,25 @@ function generateToken(length) {
|
||||
|
||||
|
||||
var storage;
|
||||
|
||||
var sessionExpiryTime
|
||||
|
||||
var sessions = {};
|
||||
|
||||
var loadedSessions = null;
|
||||
var apiAccessTokens;
|
||||
var sessionExpiryListeners = [];
|
||||
var expiryTimeout;
|
||||
|
||||
function expireSessions() {
|
||||
if (expiryTimeout) {
|
||||
clearTimeout(expiryTimeout);
|
||||
expiryTimeout = null;
|
||||
}
|
||||
var nextExpiry = Number.MAX_SAFE_INTEGER;
|
||||
var now = Date.now();
|
||||
var modified = false;
|
||||
for (var t in sessions) {
|
||||
if (sessions.hasOwnProperty(t)) {
|
||||
var session = sessions[t];
|
||||
if (!session.hasOwnProperty("expires") || session.expires < now) {
|
||||
sessionExpiryListeners.forEach(listener => { listener(session) })
|
||||
delete sessions[t];
|
||||
modified = true;
|
||||
} else {
|
||||
if (session.expires < nextExpiry) {
|
||||
nextExpiry = session.expires;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nextExpiry < Number.MAX_SAFE_INTEGER) {
|
||||
// Allow 5 seconds grace
|
||||
expiryTimeout = setTimeout(expireSessions,(nextExpiry - Date.now()) + 5000)
|
||||
}
|
||||
if (modified) {
|
||||
return storage.saveSessions(sessions);
|
||||
} else {
|
||||
@@ -77,40 +63,20 @@ function loadSessions() {
|
||||
module.exports = {
|
||||
init: function(adminAuthSettings, _storage) {
|
||||
storage = _storage;
|
||||
|
||||
sessionExpiryListeners = [];
|
||||
|
||||
sessionExpiryTime = adminAuthSettings.sessionExpiryTime || 604800; // 1 week in seconds
|
||||
// At this point, storage will not have been initialised, so defer loading
|
||||
// the sessions until there's a request for them.
|
||||
loadedSessions = null;
|
||||
|
||||
apiAccessTokens = {};
|
||||
if ( Array.isArray(adminAuthSettings.tokens) ) {
|
||||
apiAccessTokens = adminAuthSettings.tokens.reduce(function(prev, current) {
|
||||
prev[current.token] = {
|
||||
user: current.user,
|
||||
scope: current.scope
|
||||
};
|
||||
return prev;
|
||||
}, {});
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
get: function(token) {
|
||||
return loadSessions().then(function() {
|
||||
var info = apiAccessTokens[token] || null;
|
||||
|
||||
if (info) {
|
||||
return Promise.resolve(info);
|
||||
} else {
|
||||
if (sessions[token]) {
|
||||
if (sessions[token].expires < Date.now()) {
|
||||
return expireSessions().then(function() { return null });
|
||||
}
|
||||
if (sessions[token]) {
|
||||
if (sessions[token].expires < Date.now()) {
|
||||
return expireSessions().then(function() { return null });
|
||||
}
|
||||
return Promise.resolve(sessions[token]);
|
||||
}
|
||||
return Promise.resolve(sessions[token]);
|
||||
});
|
||||
},
|
||||
create: function(user,client,scope) {
|
||||
@@ -127,11 +93,6 @@ module.exports = {
|
||||
expires: accessTokenExpiresAt
|
||||
};
|
||||
sessions[accessToken] = session;
|
||||
|
||||
if (!expiryTimeout) {
|
||||
expiryTimeout = setTimeout(expireSessions,(accessTokenExpiresAt - Date.now()) + 5000)
|
||||
}
|
||||
|
||||
return storage.saveSessions(sessions).then(function() {
|
||||
return {
|
||||
accessToken: accessToken,
|
||||
@@ -145,8 +106,5 @@ module.exports = {
|
||||
delete sessions[token];
|
||||
return storage.saveSessions(sessions);
|
||||
});
|
||||
},
|
||||
onSessionExpiry: function(callback) {
|
||||
sessionExpiryListeners.push(callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,19 +40,11 @@ function init(_server,_settings,_runtimeAPI) {
|
||||
settings = _settings;
|
||||
runtimeAPI = _runtimeAPI;
|
||||
Tokens = require("../auth/tokens");
|
||||
Tokens.onSessionExpiry(handleSessionExpiry);
|
||||
Users = require("../auth/users");
|
||||
Permissions = require("../auth/permissions");
|
||||
|
||||
}
|
||||
function handleSessionExpiry(session) {
|
||||
activeConnections.forEach(connection => {
|
||||
if (connection.token === session.accessToken) {
|
||||
connection.ws.send(JSON.stringify({auth:"fail"}));
|
||||
connection.ws.close();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function generateSession(length) {
|
||||
var c = "ABCDEFGHIJKLMNOPQRSTUZWXYZabcdefghijklmnopqrstuvwxyz1234567890";
|
||||
var token = [];
|
||||
@@ -96,7 +88,7 @@ function CommsConnection(ws) {
|
||||
// handleRemoteSubscription(ws,msg.subscribe);
|
||||
}
|
||||
} else {
|
||||
var completeConnection = function(userScope,session,sendAck) {
|
||||
var completeConnection = function(userScope,sendAck) {
|
||||
try {
|
||||
if (!userScope || !Permissions.hasPermission(userScope,"status.read")) {
|
||||
ws.send(JSON.stringify({auth:"fail"}));
|
||||
@@ -104,7 +96,6 @@ function CommsConnection(ws) {
|
||||
} else {
|
||||
pendingAuth = false;
|
||||
addActiveConnection(self);
|
||||
self.token = msg.auth;
|
||||
if (sendAck) {
|
||||
ws.send(JSON.stringify({auth:"ok"}));
|
||||
}
|
||||
@@ -122,29 +113,29 @@ function CommsConnection(ws) {
|
||||
if (user) {
|
||||
self.user = user;
|
||||
log.audit({event: "comms.auth",user:self.user});
|
||||
completeConnection(client.scope,msg.auth,true);
|
||||
completeConnection(client.scope,true);
|
||||
} else {
|
||||
log.audit({event: "comms.auth.fail"});
|
||||
completeConnection(null,null,false);
|
||||
completeConnection(null,false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
log.audit({event: "comms.auth.fail"});
|
||||
completeConnection(null,null,false);
|
||||
completeConnection(null,false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (anonymousUser) {
|
||||
log.audit({event: "comms.auth",user:anonymousUser});
|
||||
self.user = anonymousUser;
|
||||
completeConnection(anonymousUser.permissions,null,false);
|
||||
completeConnection(anonymousUser.permissions,false);
|
||||
//TODO: duplicated code - pull non-auth message handling out
|
||||
if (msg.subscribe) {
|
||||
self.subscribe(msg.subscribe);
|
||||
}
|
||||
} else {
|
||||
log.audit({event: "comms.auth.fail"});
|
||||
completeConnection(null,null,false);
|
||||
completeConnection(null,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,11 +64,6 @@ module.exports = {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (settings.httpServerOptions) {
|
||||
for (var eOption in settings.httpServerOptions) {
|
||||
editorApp.set(eOption, settings.httpServerOptions[eOption]);
|
||||
}
|
||||
}
|
||||
editorApp.get("/",ensureRuntimeStarted,ui.ensureSlash,ui.editor);
|
||||
|
||||
editorApp.get("/icons",needsPermission("nodes.read"),nodes.getIcons,apiUtil.errorHandler);
|
||||
@@ -116,7 +111,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
start: function() {
|
||||
var catalogPath = path.resolve(path.join(path.dirname(require.resolve("@node-red/editor-client")),"locales"));
|
||||
var catalogPath = path.resolve(path.join(__dirname,"locales"));
|
||||
return i18n.registerMessageCatalogs([
|
||||
{namespace: "editor", dir: catalogPath, file:"editor.json"},
|
||||
{namespace: "jsonata", dir: catalogPath, file:"jsonata.json"},
|
||||
|
||||
@@ -21,18 +21,6 @@ var i18n = require("@node-red/util").i18n; // TODO: separate module
|
||||
|
||||
var runtimeAPI;
|
||||
|
||||
function loadResource(lang, namespace) {
|
||||
var catalog = i18n.i.getResourceBundle(lang, namespace);
|
||||
if (!catalog) {
|
||||
var parts = lang.split("-");
|
||||
if (parts.length == 2) {
|
||||
var new_lang = parts[0];
|
||||
return i18n.i.getResourceBundle(new_lang, namespace);
|
||||
}
|
||||
}
|
||||
return catalog;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
init: function(_runtimeAPI) {
|
||||
runtimeAPI = _runtimeAPI;
|
||||
@@ -45,7 +33,7 @@ module.exports = {
|
||||
var prevLang = i18n.i.language;
|
||||
// Trigger a load from disk of the language if it is not the default
|
||||
i18n.i.changeLanguage(lang, function(){
|
||||
var catalog = loadResource(lang, namespace);
|
||||
var catalog = i18n.i.getResourceBundle(lang, namespace);
|
||||
res.json(catalog||{});
|
||||
});
|
||||
i18n.i.changeLanguage(prevLang);
|
||||
|
||||
101
packages/node_modules/@node-red/editor-client/locales/en-US/editor.json → packages/node_modules/@node-red/editor-api/lib/editor/locales/en-US/editor.json
vendored
Executable file → Normal file
101
packages/node_modules/@node-red/editor-client/locales/en-US/editor.json → packages/node_modules/@node-red/editor-api/lib/editor/locales/en-US/editor.json
vendored
Executable file → Normal file
@@ -23,11 +23,11 @@
|
||||
"confirmDelete": "Confirm delete",
|
||||
"delete": "Are you sure you want to delete '__label__'?",
|
||||
"dropFlowHere": "Drop the flow here",
|
||||
"addFlow": "Add Flow",
|
||||
"status": "Status",
|
||||
"enabled": "Enabled",
|
||||
"disabled":"Disabled",
|
||||
"info": "Description"
|
||||
"info": "Description",
|
||||
"tip": "Description accepts Markdown and will appear in the Info tab."
|
||||
},
|
||||
"menu": {
|
||||
"label": {
|
||||
@@ -46,9 +46,6 @@
|
||||
"sidebar": {
|
||||
"show": "Show sidebar"
|
||||
},
|
||||
"palette": {
|
||||
"show": "Show palette"
|
||||
},
|
||||
"settings": "Settings",
|
||||
"userSettings": "User Settings",
|
||||
"nodes": "Nodes",
|
||||
@@ -78,16 +75,9 @@
|
||||
"projects": "Projects",
|
||||
"projects-new": "New",
|
||||
"projects-open": "Open",
|
||||
"projects-settings": "Project Settings",
|
||||
"showNodeLabelDefault": "Show label of newly added nodes"
|
||||
"projects-settings": "Project Settings"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"toggle-navigator": "Toggle navigator",
|
||||
"zoom-out": "Zoom out",
|
||||
"zoom-reset": "Reset zoom",
|
||||
"zoom-in": "Zoom in"
|
||||
},
|
||||
"user": {
|
||||
"loggedInAs": "Logged in as __name__",
|
||||
"username": "Username",
|
||||
@@ -105,10 +95,9 @@
|
||||
"warning": "<strong>Warning</strong>: __message__",
|
||||
"warnings": {
|
||||
"undeployedChanges": "node has undeployed changes",
|
||||
"nodeActionDisabled": "node actions disabled",
|
||||
"nodeActionDisabledSubflow": "node actions disabled within subflow",
|
||||
"nodeActionDisabled": "node actions disabled within subflow",
|
||||
"missing-types": "<p>Flows stopped due to missing node types.</p>",
|
||||
"safe-mode":"<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>",
|
||||
"safe-mode":"<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.",
|
||||
"restartRequired": "Node-RED must be restarted to enable upgraded modules",
|
||||
"credentials_load_failed": "<p>Flows stopped as the credentials could not be decrypted.</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p>",
|
||||
"credentials_load_failed_reset":"<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>",
|
||||
@@ -118,6 +107,7 @@
|
||||
"project_not_found": "<p>Project '__project__' not found.</p>",
|
||||
"git_merge_conflict": "<p>Automatic merging of changes failed.</p><p>Fix the unmerged conflicts then commit the results.</p>"
|
||||
},
|
||||
|
||||
"error": "<strong>Error</strong>: __message__",
|
||||
"errors": {
|
||||
"lostConnection": "Lost connection to server, reconnecting...",
|
||||
@@ -134,7 +124,7 @@
|
||||
"loaded": "Project '__project__' loaded",
|
||||
"updated": "Project '__project__' updated",
|
||||
"pull": "Project '__project__' reloaded",
|
||||
"revert": "Project '__project__' reverted",
|
||||
"revert": "Project '__project__' reloaded",
|
||||
"merge-complete": "Git merge completed"
|
||||
},
|
||||
"label": {
|
||||
@@ -149,24 +139,13 @@
|
||||
},
|
||||
"clipboard": {
|
||||
"nodes": "Nodes",
|
||||
"node": "__count__ node",
|
||||
"node_plural": "__count__ nodes",
|
||||
"configNode": "__count__ configuration node",
|
||||
"configNode_plural": "__count__ configuration nodes",
|
||||
"flow": "__count__ flow",
|
||||
"flow_plural": "__count__ flows",
|
||||
"subflow": "__count__ subflow",
|
||||
"subflow_plural": "__count__ subflows",
|
||||
"selectNodes": "Select the text above and copy to the clipboard.",
|
||||
"pasteNodes": "Paste flow json or",
|
||||
"selectFile": "select a file to import",
|
||||
"pasteNodes": "Paste nodes here",
|
||||
"importNodes": "Import nodes",
|
||||
"exportNodes": "Export nodes",
|
||||
"download": "Download",
|
||||
"exportNodes": "Export nodes to clipboard",
|
||||
"importUnrecognised": "Imported unrecognised type:",
|
||||
"importUnrecognised_plural": "Imported unrecognised types:",
|
||||
"nodesExported": "Nodes exported to clipboard",
|
||||
"nodesImported": "Imported:",
|
||||
"nodeCopied": "__count__ node copied",
|
||||
"nodeCopied_plural": "__count__ nodes copied",
|
||||
"invalidFlow": "Invalid flow: __message__",
|
||||
@@ -180,13 +159,7 @@
|
||||
},
|
||||
"import": {
|
||||
"import": "Import to",
|
||||
"newFlow": "new flow",
|
||||
"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"
|
||||
}
|
||||
"newFlow": "new flow"
|
||||
},
|
||||
"copyMessagePath": "Path copied",
|
||||
"copyMessageValue": "Value copied",
|
||||
@@ -232,10 +205,6 @@
|
||||
"plusNMore": "+ __count__ more"
|
||||
}
|
||||
},
|
||||
"eventLog": {
|
||||
"title": "Event log",
|
||||
"view": "View log"
|
||||
},
|
||||
"diff": {
|
||||
"unresolvedCount": "__count__ unresolved conflict",
|
||||
"unresolvedCount_plural": "__count__ unresolved conflicts",
|
||||
@@ -276,6 +245,7 @@
|
||||
"deleteSubflow": "delete subflow",
|
||||
"info": "Description",
|
||||
"category": "Category",
|
||||
"format":"markdown format",
|
||||
"errors": {
|
||||
"noNodesSelected": "<strong>Cannot create subflow</strong>: no nodes selected",
|
||||
"multipleInputsToSelection": "<strong>Cannot create subflow</strong>: multiple inputs to selection"
|
||||
@@ -293,8 +263,7 @@
|
||||
"editConfig": "Edit __type__ config node",
|
||||
"addNewType": "Add new __type__...",
|
||||
"nodeProperties": "node properties",
|
||||
"label": "Label",
|
||||
"portLabels": "Port labels",
|
||||
"portLabels": "node settings",
|
||||
"labelInputs": "Inputs",
|
||||
"labelOutputs": "Outputs",
|
||||
"settingIcon": "Icon",
|
||||
@@ -303,8 +272,6 @@
|
||||
"searchIcons": "Search icons",
|
||||
"useDefault": "use default",
|
||||
"description": "Description",
|
||||
"show": "Show",
|
||||
"hide": "Hide",
|
||||
"errors": {
|
||||
"scopeChange": "Changing the scope will make it unavailable to nodes in other flows that use it"
|
||||
}
|
||||
@@ -328,7 +295,6 @@
|
||||
"nudgeNode": "Move selected nodes (1px)",
|
||||
"moveNode": "Move selected nodes (20px)",
|
||||
"toggleSidebar": "Toggle sidebar",
|
||||
"togglePalette": "Toggle palette",
|
||||
"copyNode": "Copy selected nodes",
|
||||
"cutNode": "Cut selected nodes",
|
||||
"pasteNode": "Paste nodes",
|
||||
@@ -369,10 +335,6 @@
|
||||
"analysis": "analysis",
|
||||
"advanced": "advanced"
|
||||
},
|
||||
"actions": {
|
||||
"collapse-all": "Collapse all categories",
|
||||
"expand-all": "Expand all categories"
|
||||
},
|
||||
"event": {
|
||||
"nodeAdded": "Node added to palette:",
|
||||
"nodeAdded_plural": "Nodes added to palette",
|
||||
@@ -420,8 +382,6 @@
|
||||
"updated": "updated",
|
||||
"install": "install",
|
||||
"installed": "installed",
|
||||
"conflict": "conflict",
|
||||
"conflictTip": "<p>This module cannot be installed as it includes a<br/>node type that has already been installed</p><p>Conflicts with <code>__module__</code></p>",
|
||||
"loading": "Loading catalogues...",
|
||||
"tab-nodes": "Nodes",
|
||||
"tab-install": "Install",
|
||||
@@ -460,6 +420,7 @@
|
||||
"update": "Update"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
"sidebar": {
|
||||
@@ -469,7 +430,6 @@
|
||||
"label": "info",
|
||||
"node": "Node",
|
||||
"type": "Type",
|
||||
"module": "Module",
|
||||
"id": "ID",
|
||||
"status": "Status",
|
||||
"enabled": "Enabled",
|
||||
@@ -502,6 +462,7 @@
|
||||
"flows": "flows",
|
||||
"filterUnused":"unused",
|
||||
"filterAll":"all",
|
||||
"deleteUnused":"Delete unused",
|
||||
"filtered": "__count__ hidden"
|
||||
},
|
||||
"context": {
|
||||
@@ -512,8 +473,7 @@
|
||||
"empty": "empty",
|
||||
"node": "Node",
|
||||
"flow": "Flow",
|
||||
"global": "Global",
|
||||
"deleteConfirm": "Are you sure you want to delete this item?"
|
||||
"global": "Global"
|
||||
},
|
||||
"palette": {
|
||||
"name": "Palette management",
|
||||
@@ -529,9 +489,7 @@
|
||||
"editDescription": "Edit project description",
|
||||
"editDependencies": "Edit project dependencies",
|
||||
"editReadme": "Edit README.md",
|
||||
"showProjectSettings": "Show project settings",
|
||||
"projectSettings": {
|
||||
"title": "Project Settings",
|
||||
"edit": "edit",
|
||||
"none": "None",
|
||||
"install": "install",
|
||||
@@ -593,11 +551,6 @@
|
||||
"versionControl": {
|
||||
"unstagedChanges": "Unstaged changes",
|
||||
"stagedChanges": "Staged changes",
|
||||
"unstageChange": "Unstage change",
|
||||
"stageChange": "Stage change",
|
||||
"unstageAllChange": "Unstage all changes",
|
||||
"stageAllChange": "Stage all changes",
|
||||
"commitChanges": "Commit changes",
|
||||
"resolveConflicts": "Resolve conflicts",
|
||||
"head": "HEAD",
|
||||
"staged": "Staged",
|
||||
@@ -661,9 +614,7 @@
|
||||
"commitsAheadAndBehind2": "__count__ commit ahead of the remote. ",
|
||||
"commitsAheadAndBehind2_plural": "__count__ commits ahead of the remote. ",
|
||||
"commitsAheadAndBehind3": "You must pull the remote commit down before pushing.",
|
||||
"commitsAheadAndBehind3_plural": "You must pull the remote commits down before pushing.",
|
||||
"refreshCommitHistory": "Refresh commit history",
|
||||
"refreshChanges": "Refresh changes"
|
||||
"commitsAheadAndBehind3_plural": "You must pull the remote commits down before pushing."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -714,20 +665,7 @@
|
||||
"format": "format JSON"
|
||||
},
|
||||
"markdownEditor": {
|
||||
"title": "Markdown editor",
|
||||
"format": "Formatted with markdown",
|
||||
"heading1": "Heading 1",
|
||||
"heading2": "Heading 2",
|
||||
"heading3": "Heading 3",
|
||||
"bold": "Bold",
|
||||
"italic": "Italic",
|
||||
"code": "Code",
|
||||
"ordered-list": "Ordered list",
|
||||
"unordered-list": "Unordered list",
|
||||
"quote": "Quote",
|
||||
"link": "Link",
|
||||
"horizontal-rule": "Horizontal rule",
|
||||
"toggle-preview": "Toggle preview"
|
||||
"title": "Markdown editor"
|
||||
},
|
||||
"bufferEditor": {
|
||||
"title": "Buffer editor",
|
||||
@@ -897,10 +835,5 @@
|
||||
"unexpected": "An unexpected error occurred",
|
||||
"code": "code"
|
||||
}
|
||||
},
|
||||
"editor-tab": {
|
||||
"properties": "Properties",
|
||||
"description": "Description",
|
||||
"appearance": "Appearance"
|
||||
}
|
||||
}
|
||||
1
packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json → packages/node_modules/@node-red/editor-api/lib/editor/locales/en-US/jsonata.json
vendored
Executable file → Normal file
1
packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json → packages/node_modules/@node-red/editor-api/lib/editor/locales/en-US/jsonata.json
vendored
Executable file → Normal file
@@ -115,6 +115,7 @@
|
||||
"args": "array",
|
||||
"desc": "Returns the mean value of an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
||||
},
|
||||
|
||||
"$boolean": {
|
||||
"args": "arg",
|
||||
"desc": "Casts the argument to a Boolean using the following rules:\n\n - `Boolean` : unchanged\n - `string`: empty : `false`\n - `string`: non-empty : `true`\n - `number`: `0` : `false`\n - `number`: non-zero : `true`\n - `null` : `false`\n - `array`: empty : `false`\n - `array`: contains a member that casts to `true` : `true`\n - `array`: all members cast to `false` : `false`\n - `object`: empty : `false`\n - `object`: non-empty : `true`\n - `function` : `false`"
|
||||
131
packages/node_modules/@node-red/editor-client/locales/ja/editor.json → packages/node_modules/@node-red/editor-api/lib/editor/locales/ja/editor.json
vendored
Executable file → Normal file
131
packages/node_modules/@node-red/editor-client/locales/ja/editor.json → packages/node_modules/@node-red/editor-api/lib/editor/locales/ja/editor.json
vendored
Executable file → Normal file
@@ -23,11 +23,11 @@
|
||||
"confirmDelete": "削除の確認",
|
||||
"delete": "本当に '__label__' を削除しますか?",
|
||||
"dropFlowHere": "ここにフローをドロップしてください",
|
||||
"addFlow": "フローの追加",
|
||||
"status": "状態",
|
||||
"enabled": "有効",
|
||||
"disabled": "無効",
|
||||
"info": "詳細"
|
||||
"info": "詳細",
|
||||
"tip": "マークダウン形式で記述した「詳細」は「情報タブ」に表示されます。"
|
||||
},
|
||||
"menu": {
|
||||
"label": {
|
||||
@@ -46,9 +46,6 @@
|
||||
"sidebar": {
|
||||
"show": "サイドバーを表示"
|
||||
},
|
||||
"palette": {
|
||||
"show": "パレットを表示"
|
||||
},
|
||||
"settings": "設定",
|
||||
"userSettings": "ユーザ設定",
|
||||
"nodes": "ノード",
|
||||
@@ -78,16 +75,9 @@
|
||||
"projects": "プロジェクト",
|
||||
"projects-new": "新規",
|
||||
"projects-open": "開く",
|
||||
"projects-settings": "設定",
|
||||
"showNodeLabelDefault": "追加したノードのラベルを表示する"
|
||||
"projects-settings": "設定"
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
"toggle-navigator": "ナビゲータの表示/非表示を切替",
|
||||
"zoom-out": "縮小",
|
||||
"zoom-reset": "拡大/縮小を初期化",
|
||||
"zoom-in": "拡大"
|
||||
},
|
||||
"user": {
|
||||
"loggedInAs": "__name__ としてログインしました",
|
||||
"username": "ユーザ名",
|
||||
@@ -105,10 +95,8 @@
|
||||
"warning": "<strong>警告</strong>: __message__",
|
||||
"warnings": {
|
||||
"undeployedChanges": "ノードの変更をデプロイしていません",
|
||||
"nodeActionDisabled": "ノードのアクションは無効になっています",
|
||||
"nodeActionDisabledSubflow": "ノードのアクションは、サブフロー内で無効になっています",
|
||||
"nodeActionDisabled": "ノードのアクションは、サブフロー内で無効になっています",
|
||||
"missing-types": "不明なノードが存在するため、フローを停止しました。詳細はログを確認してください。",
|
||||
"safe-mode": "<p>セーフモードでフローを停止しました</p><p>フローを変更し、再起動するために変更をデプロイできます</p>",
|
||||
"restartRequired": "更新されたモジュールを有効化するため、Node-REDを再起動する必要があります",
|
||||
"credentials_load_failed": "<p>認証情報を復号できないため、フローを停止しました</p><p>フローの認証情報ファイルは暗号化されています。しかし、プロジェクトの暗号鍵が存在しない、または不正です</p>",
|
||||
"credentials_load_failed_reset": "<p>認証情報を復号できません</p><p>フローの認証情報ファイルは暗号化されています。しかし、プロジェクトの暗号鍵が存在しない、または不正です。</p><p>次回のデプロイでフローの認証情報ファイルがリセットされます。既存フローの認証情報は削除されます。</p>",
|
||||
@@ -125,7 +113,7 @@
|
||||
"lostConnectionTry": "すぐに接続",
|
||||
"cannotAddSubflowToItself": "サブフロー自身を追加できません",
|
||||
"cannotAddCircularReference": "循環参照を検出したため、サブフローを追加できません",
|
||||
"unsupportedVersion": "<p>サポートされていないバージョンのNode.jsを使用しています。</p><p><br/>最新のNode.js LTSに更新してください。</p>",
|
||||
"unsupportedVersion": "サポートされていないバージョンのNode.jsを使用しています。<br/>最新のNode.js LTSに更新してください。",
|
||||
"failedToAppendNode": "<p>'__module__'がロードできませんでした。</p><p>__error__</p>"
|
||||
},
|
||||
"project": {
|
||||
@@ -134,7 +122,7 @@
|
||||
"loaded": "プロジェクト'__project__'をロードしました",
|
||||
"updated": "プロジェクト'__project__'を更新しました",
|
||||
"pull": "プロジェクト'__project__'を再ロードしました",
|
||||
"revert": "プロジェクト'__project__'を取り消しました",
|
||||
"revert": "プロジェクト'__project__'を再ロードしました",
|
||||
"merge-complete": "Gitマージが完了しました"
|
||||
},
|
||||
"label": {
|
||||
@@ -149,24 +137,13 @@
|
||||
},
|
||||
"clipboard": {
|
||||
"nodes": "ノード",
|
||||
"node": "__count__ 個のノード",
|
||||
"node_plural": "__count__ 個のノード",
|
||||
"configNode": "__count__ 個の設定ノード",
|
||||
"configNode_plural": "__count__ 個の設定ノード",
|
||||
"flow": "__count__ 個のフロー",
|
||||
"flow_plural": "__count__ 個のフロー",
|
||||
"subflow": "__count__ 個のサブフロー",
|
||||
"subflow_plural": "__count__ 個のサブフロー",
|
||||
"selectNodes": "上のテキストを選択し、クリップボードへコピーしてください",
|
||||
"pasteNodes": "JSON形式のフローデータを貼り付けてください",
|
||||
"selectFile": "読み込むファイルを選択してください",
|
||||
"importNodes": "フローをクリップボートから読み込み",
|
||||
"exportNodes": "フローをクリップボードへ書き出し",
|
||||
"download": "ダウンロード",
|
||||
"importUnrecognised": "認識できない型が読み込まれました:",
|
||||
"importUnrecognised_plural": "認識できない型が読み込まれました:",
|
||||
"nodesExported": "クリップボードへフローを書き出しました",
|
||||
"nodesImported": "読み込みました:",
|
||||
"nodeCopied": "__count__ 個のノードをコピーしました",
|
||||
"nodeCopied_plural": "__count__ 個のノードをコピーしました",
|
||||
"invalidFlow": "不正なフロー: __message__",
|
||||
@@ -180,13 +157,7 @@
|
||||
},
|
||||
"import": {
|
||||
"import": "読み込み先",
|
||||
"newFlow": "新規のタブ",
|
||||
"errors": {
|
||||
"notArray": "JSON形式の配列ではありません",
|
||||
"itemNotObject": "不正なフロー - __index__ 番目の要素はノードオブジェクトではありません",
|
||||
"missingId": "不正なフロー - __index__ 番目の要素に'id'プロパティがありません",
|
||||
"missingType": "不正なフロー - __index__ 番目の要素に'type'プロパティがありません"
|
||||
}
|
||||
"newFlow": "新規のタブ"
|
||||
},
|
||||
"copyMessagePath": "パスをコピーしました",
|
||||
"copyMessageValue": "値をコピーしました",
|
||||
@@ -200,10 +171,7 @@
|
||||
"modifiedFlowsDesc": "変更したノードを含むフローのみデプロイ",
|
||||
"modifiedNodes": "変更したノード",
|
||||
"modifiedNodesDesc": "変更したノードのみデプロイ",
|
||||
"restartFlows": "フローを再起動",
|
||||
"restartFlowsDesc": "デプロイされた現在のフローを再起動",
|
||||
"successfulDeploy": "デプロイが成功しました",
|
||||
"successfulRestart": "フローの再起動が成功しました",
|
||||
"deployFailed": "デプロイが失敗しました: __message__",
|
||||
"unusedConfigNodes": "使われていない「ノードの設定」があります。",
|
||||
"unusedConfigNodesLink": "設定を参照する",
|
||||
@@ -224,7 +192,7 @@
|
||||
"unknown": "ワークスペースに未知の型のノードがあります。",
|
||||
"confirm": "このままデプロイしても良いですか?",
|
||||
"doNotWarn": "この警告を再度表示しない",
|
||||
"conflict": "フローを編集している間に、他のブラウザがフローをデプロイしました。",
|
||||
"conflict": "フローを編集している間に、他のブラウザがフローをデプロイしました。デプロイを継続すると、他のブラウザがデプロイしたフローが削除されます。",
|
||||
"backgroundUpdate": "サーバ上のフローが更新されました",
|
||||
"conflictChecking": "変更を自動的にマージしてよいか確認してください。",
|
||||
"conflictAutoMerge": "変更の衝突がないため、自動的にマージできます。",
|
||||
@@ -232,10 +200,6 @@
|
||||
"plusNMore": "さらに __count__ 個"
|
||||
}
|
||||
},
|
||||
"eventLog": {
|
||||
"title": "イベントログ",
|
||||
"view": "ログを確認"
|
||||
},
|
||||
"diff": {
|
||||
"unresolvedCount": "未解決の衝突 __count__",
|
||||
"unresolvedCount_plural": "未解決の衝突 __count__",
|
||||
@@ -276,6 +240,7 @@
|
||||
"deleteSubflow": "サブフローを削除",
|
||||
"info": "詳細",
|
||||
"category": "カテゴリ",
|
||||
"format": "マークダウン形式",
|
||||
"errors": {
|
||||
"noNodesSelected": "<strong>サブフローを作成できません</strong>: ノードが選択されていません",
|
||||
"multipleInputsToSelection": "<strong>サブフローを作成できません</strong>: 複数の入力が選択されています"
|
||||
@@ -293,18 +258,15 @@
|
||||
"editConfig": "__type__ ノードの設定を編集",
|
||||
"addNewType": "新規に __type__ を追加...",
|
||||
"nodeProperties": "プロパティ",
|
||||
"label": "ラベル",
|
||||
"portLabels": "ポートラベル",
|
||||
"portLabels": "設定",
|
||||
"labelInputs": "入力",
|
||||
"labelOutputs": "出力",
|
||||
"settingIcon": "アイコン",
|
||||
"noDefaultLabel": "なし",
|
||||
"defaultLabel": "既定のラベルを使用",
|
||||
"defaultLabel": "既定の名前を使用",
|
||||
"searchIcons": "アイコンを検索",
|
||||
"useDefault": "デフォルトを使用",
|
||||
"useDefault": "デフォルトを使用",
|
||||
"description": "詳細",
|
||||
"show": "表示",
|
||||
"hide": "非表示",
|
||||
"errors": {
|
||||
"scopeChange": "スコープの変更は、他のフローで使われているノードを無効にします"
|
||||
}
|
||||
@@ -327,8 +289,7 @@
|
||||
"exportNode": "フローの書き出し",
|
||||
"nudgeNode": "選択したノードを移動(移動量小)",
|
||||
"moveNode": "選択したノードを移動(移動量大)",
|
||||
"toggleSidebar": "サイドバーの表示/非表示",
|
||||
"togglePalette": "パレットの表示/非表示",
|
||||
"toggleSidebar": "サイドバーの表示非表示",
|
||||
"copyNode": "選択したノードをコピー",
|
||||
"cutNode": "選択したノードを切り取り",
|
||||
"pasteNode": "ノードを貼り付け",
|
||||
@@ -369,10 +330,6 @@
|
||||
"analysis": "分析",
|
||||
"advanced": "その他"
|
||||
},
|
||||
"actions": {
|
||||
"collapse-all": "全カテゴリを折畳む",
|
||||
"expand-all": "全カテゴリを展開"
|
||||
},
|
||||
"event": {
|
||||
"nodeAdded": "ノードをパレットへ追加しました:",
|
||||
"nodeAdded_plural": "ノードをパレットへ追加しました",
|
||||
@@ -420,8 +377,6 @@
|
||||
"updated": "更新済",
|
||||
"install": "ノードを追加",
|
||||
"installed": "追加しました",
|
||||
"conflict": "競合",
|
||||
"conflictTip": "<p>インストール済みのノードの種別と競合しているため<br/>ノードをインストールできません</p><p>競合: <code>__module__</code></p>",
|
||||
"loading": "カタログを読み込み中",
|
||||
"tab-nodes": "現在のノード",
|
||||
"tab-install": "ノードを追加",
|
||||
@@ -430,28 +385,28 @@
|
||||
"sortRecent": "日付順",
|
||||
"more": "+ さらに __count__ 個",
|
||||
"errors": {
|
||||
"catalogLoadFailed": "<p>ノードのカタログの読み込みに失敗しました。</p><p>詳細はブラウザのコンソールを確認してください。</p>",
|
||||
"installFailed": "<p.追加処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>",
|
||||
"removeFailed": "<p>削除処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>",
|
||||
"updateFailed": "<p>更新処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>",
|
||||
"enableFailed": "<p>有効化処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>",
|
||||
"disableFailed": "<p>無効化処理が失敗しました: __module__</p><p>__message__</p><p>詳細はログを確認してください。</p>"
|
||||
"catalogLoadFailed": "ノードのカタログの読み込みに失敗しました。<br>詳細はブラウザのコンソールを確認してください。",
|
||||
"installFailed": "追加処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください。",
|
||||
"removeFailed": "削除処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください。",
|
||||
"updateFailed": "更新処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください。",
|
||||
"enableFailed": "有効化処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください。",
|
||||
"disableFailed": "無効化処理が失敗しました: __module__<br>__message__<br>詳細はログを確認してください。"
|
||||
},
|
||||
"confirm": {
|
||||
"install": {
|
||||
"body": "<p>__module__ をインストールします。</p><p>ノードを追加する前に、ドキュメントを確認してください。ノードによっては、モジュールの依存関係を自動的に解決できない場合や、Node-REDの再起動が必要となる場合があります。</p>",
|
||||
"body": "ノードを追加する前に、ドキュメントを確認してください。ノードによっては、モジュールの依存関係を自動的に解決できない場合や、Node-REDの再起動が必要となる場合があります。",
|
||||
"title": "ノードを追加"
|
||||
},
|
||||
"remove": {
|
||||
"body": "<p>__module__ を削除します。</p><p>Node-REDからノードを削除します。ノードはNode-REDが再起動されるまで、リソースを使い続ける可能性があります。</p>",
|
||||
"body": "Node-REDからノードを削除します。ノードはNode-REDが再起動されるまで、リソースを使い続けます。",
|
||||
"title": "ノードを削除"
|
||||
},
|
||||
"update": {
|
||||
"body": "<p>__module__ を更新します。</p><p>更新を完了するには手動でNode-REDを再起動する必要があります。</p>",
|
||||
"body": "更新を完了するには手動でNode-REDを再起動する必要があります。",
|
||||
"title": "ノードの更新"
|
||||
},
|
||||
"cannotUpdate": {
|
||||
"body": "ノードの更新があります。「パレットの管理」の画面では更新されません。<br/><br/>ドキュメントを参照し、ノードの更新手順を確認してください。"
|
||||
"body": "ノードの更新があります。「パレットの管理」の画面では更新されません。ドキュメントを参照し、ノードの更新手順を確認してください。"
|
||||
},
|
||||
"button": {
|
||||
"review": "ノードの情報を参照",
|
||||
@@ -469,7 +424,6 @@
|
||||
"label": "情報",
|
||||
"node": "ノード",
|
||||
"type": "型",
|
||||
"module": "モジュール",
|
||||
"id": "ID",
|
||||
"status": "状態",
|
||||
"enabled": "有効",
|
||||
@@ -478,7 +432,6 @@
|
||||
"instances": "インスタンス",
|
||||
"properties": "プロパティ",
|
||||
"info": "情報",
|
||||
"desc": "詳細",
|
||||
"blank": "ブランク",
|
||||
"null": "ヌル",
|
||||
"showMore": "さらに表示",
|
||||
@@ -512,8 +465,7 @@
|
||||
"empty": "データが存在しません",
|
||||
"node": "Node",
|
||||
"flow": "Flow",
|
||||
"global": "Global",
|
||||
"deleteConfirm": "データを削除しても良いですか?"
|
||||
"global": "Global"
|
||||
},
|
||||
"palette": {
|
||||
"name": "パレットの管理",
|
||||
@@ -529,9 +481,7 @@
|
||||
"editDescription": "プロジェクトの詳細を編集",
|
||||
"editDependencies": "プロジェクトの依存関係を編集",
|
||||
"editReadme": "README.mdを編集",
|
||||
"showProjectSettings": "プロジェクト設定を表示",
|
||||
"projectSettings": {
|
||||
"title": "プロジェクト設定",
|
||||
"edit": "編集",
|
||||
"none": "なし",
|
||||
"install": "インストール",
|
||||
@@ -593,11 +543,6 @@
|
||||
"versionControl": {
|
||||
"unstagedChanges": "ステージングされていない変更",
|
||||
"stagedChanges": "ステージングされた変更",
|
||||
"unstageChange": "ステージングした変更の取り消し",
|
||||
"stageChange": "変更をステージング",
|
||||
"unstageAllChange": "ステージングした全ての変更の取り消し",
|
||||
"stageAllChange": "全ての変更をステージング",
|
||||
"commitChanges": "変更をコミット",
|
||||
"resolveConflicts": "コンフリクトの解決",
|
||||
"head": "最新",
|
||||
"staged": "ステージング",
|
||||
@@ -661,9 +606,7 @@
|
||||
"commitsAheadAndBehind2": "__count__コミット進んでいます。 ",
|
||||
"commitsAheadAndBehind2_plural": "__count__コミット進んでいます。 ",
|
||||
"commitsAheadAndBehind3": "プッシュする前にリモートのコミットをプルしてください。",
|
||||
"commitsAheadAndBehind3_plural": "プッシュする前にリモートのコミットをプルしてください。",
|
||||
"refreshCommitHistory": "コミット履歴を更新",
|
||||
"refreshChanges": "変更を更新"
|
||||
"commitsAheadAndBehind3_plural": "プッシュする前にリモートのコミットをプルしてください。"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -714,20 +657,7 @@
|
||||
"format": "JSONフォーマット"
|
||||
},
|
||||
"markdownEditor": {
|
||||
"title": "マークダウンエディタ",
|
||||
"format": "マークダウン形式で記述",
|
||||
"heading1": "見出しレベル1",
|
||||
"heading2": "見出しレベル2",
|
||||
"heading3": "見出しレベル3",
|
||||
"bold": "太字",
|
||||
"italic": "斜体",
|
||||
"code": "コード",
|
||||
"ordered-list": "箇条書き(番号付き)",
|
||||
"unordered-list": "箇条書き",
|
||||
"quote": "引用",
|
||||
"link": "リンク",
|
||||
"horizontal-rule": "区切り線",
|
||||
"toggle-preview": "プレビュー表示切替え"
|
||||
"title": "マークダウンエディタ"
|
||||
},
|
||||
"bufferEditor": {
|
||||
"title": "バッファエディタ",
|
||||
@@ -791,7 +721,7 @@
|
||||
"repo-not-found": "リポジトリが見つかりません"
|
||||
},
|
||||
"default-files": {
|
||||
"create": "プロジェクト関連ファイルの作成",
|
||||
"create": "プロジェクト関連ファアイルの作成",
|
||||
"desc0": "プロジェクトはフローファイル、README、package.jsonを含みます。",
|
||||
"desc1": "その他、Gitリポジトリで管理したいファイルを含めても構いません。",
|
||||
"desc2": "既存のフローと認証情報ファイルをプロジェクトにコピーします。",
|
||||
@@ -807,7 +737,7 @@
|
||||
"desc4": "認証情報を公開Gitリポジトリに保存する際には、秘密キーフレーズによって暗号化します。",
|
||||
"desc5": "フロー認証情報ファイルはsettingsファイルのcredentialSecretプロパティで暗号化されています。",
|
||||
"desc6": "フロー認証情報ファイルはシステムが生成したキーによって暗号化されています。このプロジェクト用に新しい秘密キーを指定してください。",
|
||||
"desc7": "キーはプロジェクトファイルとは別に保存されます。他のNode-REDでこのプロジェクトを利用するには、このプロジェクトのキーが必要です。",
|
||||
"desc7": "キーはプロジェクトファイルとば別に保存されます。他のNode-REDでこのプロジェクトを利用するには、このプロジェクトのキーが必要です。",
|
||||
"credentials": "認証情報",
|
||||
"enable": "暗号化を有効にする",
|
||||
"disable": "暗号化を無効にする",
|
||||
@@ -897,10 +827,5 @@
|
||||
"unexpected": "予期しないエラーが発生しました",
|
||||
"code": "コード"
|
||||
}
|
||||
},
|
||||
"editor-tab": {
|
||||
"properties": "プロパティ",
|
||||
"description": "説明",
|
||||
"appearance": "外観"
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,8 @@
|
||||
"status": "状态",
|
||||
"enabled": "有效",
|
||||
"disabled": "无效",
|
||||
"info": "详细描述"
|
||||
"info": "详细描述",
|
||||
"tip": "详细描述支持Markdown轻量级标记语言,并将出现在信息标签中。"
|
||||
},
|
||||
"menu": {
|
||||
"label": {
|
||||
@@ -85,7 +86,7 @@
|
||||
"warning": "<strong>警告</strong>: __message__",
|
||||
"warnings": {
|
||||
"undeployedChanges": "节点中存在未部署的更改",
|
||||
"nodeActionDisabledSubflow": "节点动作在子流程中被禁用",
|
||||
"nodeActionDisabled": "节点动作在子流程中被禁用",
|
||||
"missing-types": "流程由于缺少节点类型而停止。请检查日志的详细信息",
|
||||
"restartRequired": "Node-RED必须重新启动,以启用升级的模块"
|
||||
},
|
||||
@@ -190,6 +191,7 @@
|
||||
"output": "输出:",
|
||||
"deleteSubflow": "删除子流程",
|
||||
"info": "详细描述",
|
||||
"format": "标记格式",
|
||||
"errors": {
|
||||
"noNodesSelected": "<strong>无法创建子流程</strong>: 未选择节点",
|
||||
"multipleInputsToSelection": "<strong>无法创建子流程</strong>: 多个输入到了选择"
|
||||
@@ -20,58 +20,6 @@ var apiUtils = require("../util");
|
||||
var runtimeAPI;
|
||||
var needsPermission = require("../auth").needsPermission;
|
||||
|
||||
function listProjects(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
}
|
||||
runtimeAPI.projects.listProjects(opts).then(function(result) {
|
||||
res.json(result);
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
});
|
||||
}
|
||||
function getProject(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
}
|
||||
runtimeAPI.projects.getProject(opts).then(function(data) {
|
||||
if (data) {
|
||||
res.json(data);
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
}
|
||||
function getProjectStatus(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: req.query.remote
|
||||
}
|
||||
runtimeAPI.projects.getStatus(opts).then(function(data){
|
||||
if (data) {
|
||||
res.json(data);
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
}
|
||||
function getProjectRemotes(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
}
|
||||
runtimeAPI.projects.getRemotes(opts).then(function(data) {
|
||||
res.json(data);
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
}
|
||||
module.exports = {
|
||||
init: function(_runtimeAPI) {
|
||||
runtimeAPI = _runtimeAPI;
|
||||
@@ -92,7 +40,16 @@ module.exports = {
|
||||
// Projects
|
||||
|
||||
// List all projects
|
||||
app.get("/", needsPermission("projects.read"),listProjects);
|
||||
app.get("/", needsPermission("projects.read"), function(req,res) {
|
||||
var opts = {
|
||||
user: req.user
|
||||
}
|
||||
runtimeAPI.projects.listProjects(opts).then(function(result) {
|
||||
res.json(result);
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
});
|
||||
});
|
||||
|
||||
// Create project
|
||||
app.post("/", needsPermission("projects.write"), function(req,res) {
|
||||
@@ -117,13 +74,13 @@ module.exports = {
|
||||
|
||||
if (req.body.active) {
|
||||
runtimeAPI.projects.setActiveProject(opts).then(function() {
|
||||
listProjects(req,res);
|
||||
res.redirect(303,req.baseUrl + '/');
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
} else if (req.body.initialise) {
|
||||
runtimeAPI.projects.initialiseProject(opts).then(function() {
|
||||
getProject(req,res);
|
||||
res.redirect(303,req.baseUrl + '/'+ req.params.id);
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -134,7 +91,7 @@ module.exports = {
|
||||
req.body.hasOwnProperty('files') ||
|
||||
req.body.hasOwnProperty('git')) {
|
||||
runtimeAPI.projects.updateProject(opts).then(function() {
|
||||
getProject(req,res);
|
||||
res.redirect(303,req.baseUrl + '/'+ req.params.id);
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -144,7 +101,21 @@ module.exports = {
|
||||
});
|
||||
|
||||
// Get project metadata
|
||||
app.get("/:id", needsPermission("projects.read"), getProject);
|
||||
app.get("/:id", needsPermission("projects.read"), function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
}
|
||||
runtimeAPI.projects.getProject(opts).then(function(data) {
|
||||
if (data) {
|
||||
res.json(data);
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
});
|
||||
|
||||
// Delete project
|
||||
app.delete("/:id", needsPermission("projects.write"), function(req,res) {
|
||||
@@ -161,7 +132,22 @@ module.exports = {
|
||||
|
||||
|
||||
// Get project status - files, commit counts, branch info
|
||||
app.get("/:id/status", needsPermission("projects.read"), getProjectStatus);
|
||||
app.get("/:id/status", needsPermission("projects.read"), function(req,res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id,
|
||||
remote: req.query.remote
|
||||
}
|
||||
runtimeAPI.projects.getStatus(opts).then(function(data){
|
||||
if (data) {
|
||||
res.json(data);
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
// Project file listing
|
||||
@@ -217,7 +203,7 @@ module.exports = {
|
||||
path: req.params[0]
|
||||
}
|
||||
runtimeAPI.projects.stageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/status");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -231,7 +217,7 @@ module.exports = {
|
||||
path: req.body.files
|
||||
}
|
||||
runtimeAPI.projects.stageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/status");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -245,7 +231,7 @@ module.exports = {
|
||||
message: req.body.message
|
||||
}
|
||||
runtimeAPI.projects.commit(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/status");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -259,7 +245,7 @@ module.exports = {
|
||||
path: req.params[0]
|
||||
}
|
||||
runtimeAPI.projects.unstageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/status");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -272,7 +258,7 @@ module.exports = {
|
||||
id: req.params.id
|
||||
}
|
||||
runtimeAPI.projects.unstageFile(opts).then(function() {
|
||||
getProjectStatus(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/status");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -456,7 +442,17 @@ module.exports = {
|
||||
});
|
||||
|
||||
// Get a list of remotes
|
||||
app.get("/:id/remotes", needsPermission("projects.read"), getProjectRemotes);
|
||||
app.get("/:id/remotes", needsPermission("projects.read"), function(req, res) {
|
||||
var opts = {
|
||||
user: req.user,
|
||||
id: req.params.id
|
||||
}
|
||||
runtimeAPI.projects.getRemotes(opts).then(function(data) {
|
||||
res.json(data);
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
});
|
||||
|
||||
// Add a remote
|
||||
app.post("/:id/remotes", needsPermission("projects.write"), function(req,res) {
|
||||
@@ -470,7 +466,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
runtimeAPI.projects.addRemote(opts).then(function(data) {
|
||||
getProjectRemotes(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/remotes");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
@@ -484,7 +480,7 @@ module.exports = {
|
||||
remote: req.params.remoteName
|
||||
}
|
||||
runtimeAPI.projects.removeRemote(opts).then(function(data) {
|
||||
getProjectRemotes(req,res);
|
||||
res.redirect(303,req.baseUrl+"/"+opts.id+"/remotes");
|
||||
}).catch(function(err) {
|
||||
apiUtils.rejectHandler(req,res,err);
|
||||
})
|
||||
|
||||
@@ -17,31 +17,6 @@ var apiUtils = require("../util");
|
||||
var runtimeAPI;
|
||||
var sshkeys = require("./sshkeys");
|
||||
var theme = require("./theme");
|
||||
var clone = require("clone");
|
||||
|
||||
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) {
|
||||
@@ -55,9 +30,7 @@ module.exports = {
|
||||
runtimeAPI.settings.getRuntimeSettings(opts).then(function(result) {
|
||||
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 = themeSettings;
|
||||
}
|
||||
res.json(result);
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@ module.exports = {
|
||||
}
|
||||
runtimeAPI.nodes.getIcon(opts).then(function(data) {
|
||||
if (data) {
|
||||
var contentType = mime.getType(icon);
|
||||
var contentType = mime.lookup(icon);
|
||||
res.set("Content-Type", contentType);
|
||||
res.send(data);
|
||||
} else {
|
||||
|
||||
@@ -28,7 +28,7 @@ var adminApp;
|
||||
var server;
|
||||
var editor;
|
||||
|
||||
function init(settings,_server,storage,runtimeAPI) {
|
||||
function init(_server,settings,storage,runtimeAPI) {
|
||||
server = _server;
|
||||
if (settings.httpAdminRoot !== false) {
|
||||
adminApp = express();
|
||||
@@ -100,5 +100,6 @@ module.exports = {
|
||||
auth: {
|
||||
needsPermission: auth.needsPermission
|
||||
},
|
||||
get httpAdmin() { return adminApp; }
|
||||
get adminApp() { return adminApp; },
|
||||
get server() { return server; }
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-api",
|
||||
"version": "0.20.0-beta.2",
|
||||
"name": "@node-red/editor",
|
||||
"version": "0.20.0-alpha.0",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -8,25 +8,21 @@
|
||||
"url": "https://github.com/node-red/node-red.git"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Nick O'Leary"
|
||||
},
|
||||
{
|
||||
"name": "Dave Conway-Jones"
|
||||
}
|
||||
{ "name": "Nick O'Leary" },
|
||||
{ "name": "Dave Conway-Jones"}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "0.20.0-beta.2",
|
||||
"@node-red/editor-client": "0.20.0-beta.2",
|
||||
"@node-red/util": "*",
|
||||
"@node-red/editor-client": "*",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.18.3",
|
||||
"clone": "2.1.2",
|
||||
"cors": "2.8.5",
|
||||
"cors": "2.8.4",
|
||||
"express-session": "1.15.6",
|
||||
"express": "4.16.4",
|
||||
"express": "4.16.3",
|
||||
"memorystore": "1.6.0",
|
||||
"mime": "2.4.0",
|
||||
"mustache": "3.0.1",
|
||||
"mime": "1.4.1",
|
||||
"mustache": "2.3.2",
|
||||
"oauth2orize": "1.11.0",
|
||||
"passport-http-bearer": "1.0.1",
|
||||
"passport-oauth2-client-password": "0.1.2",
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
src
|
||||
docs
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
{
|
||||
"name": "@node-red/editor-client",
|
||||
"version": "0.20.0-beta.2",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/node-red/node-red.git"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Nick O'Leary"
|
||||
},
|
||||
{
|
||||
"name": "Dave Conway-Jones"
|
||||
}
|
||||
],
|
||||
"main": "./lib/index.js"
|
||||
"name": "@node-red/editor-client",
|
||||
"version": "0.20.0-alpha.0",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/node-red/node-red.git"
|
||||
},
|
||||
"contributors": [
|
||||
{ "name": "Nick O'Leary" },
|
||||
{ "name": "Dave Conway-Jones"}
|
||||
],
|
||||
"main": "./lib/index.js"
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
How to build the custom ACE modes for Node-RED
|
||||
----------------------------------------------
|
||||
|
||||
Node-RED includes custom JSONata and JavaScript modes.
|
||||
|
||||
|
||||
## JSONata
|
||||
|
||||
The `ace/mode/jsonata` mode is maintained under `editor-client/src/vendor/jsonata`.
|
||||
Those files are edited in place and copied into the build by Grunt.
|
||||
|
||||
## JavaScript
|
||||
|
||||
The `ace/mode/nrjavascript` mode is used exclusively by the Function node. It
|
||||
inherits almost entirely from the normal JavaScript mode. The one key difference
|
||||
is that it wraps the code with a Function before parsing. This is required to
|
||||
avoid some false-flagged errors.
|
||||
|
||||
The source of the mode is under `editor-client/src/ace/mode`. If those files are
|
||||
modified in anyway, they *must* be manually built to generate the files under
|
||||
`editor-client/src/ace/bin` and checked in. Those files are the ones the Grunt
|
||||
built copies out in the Node-RED build.
|
||||
|
||||
### Building the mode files
|
||||
|
||||
|
||||
#### Setup build environment
|
||||
|
||||
cd /tmp/
|
||||
git clone https://github.com/ajaxorg/ace.git
|
||||
cd ace
|
||||
npm install
|
||||
|
||||
#### Copy mode src files into build environment
|
||||
|
||||
cd <node-red-source-directory
|
||||
cp packages/node_modules/@node-red/editor-client/src/ace/mode/* \
|
||||
/tmp/ace/lib/ace/mode/
|
||||
|
||||
#### Run the build
|
||||
|
||||
cd /tmp/ace
|
||||
node ./Makefile.dryice.js -m -nc
|
||||
|
||||
#### Copy the built versions back
|
||||
|
||||
cp build/src-min-noconflict/*-nrjavascript.js \
|
||||
<node-red-source-directory>/packages/node_modules/@node-red/editor-client/src/ace/bin/
|
||||
cp build/src-min-noconflict/snippets/nrjavascript.js \
|
||||
<node-red-source-directory>/packages/node_modules/@node-red/editor-client/src/ace/bin/snippets/
|
||||
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
|
||||
ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="nrjavascript"});
|
||||
(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
@@ -1,49 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var JavaScriptMode = require("./javascript").Mode;
|
||||
var WorkerClient = require("../worker/worker_client").WorkerClient;
|
||||
|
||||
var Mode = function() {
|
||||
// Inherit everything from the standard JavaScript mode
|
||||
JavaScriptMode.call(this);
|
||||
};
|
||||
oop.inherits(Mode, JavaScriptMode);
|
||||
|
||||
(function() {
|
||||
// Insert our custom worker
|
||||
this.createWorker = function(session) {
|
||||
var worker = new WorkerClient(["ace"], "ace/mode/nrjavascript_worker", "NRJavaScriptWorker");
|
||||
worker.attachToDocument(session.getDocument());
|
||||
|
||||
worker.on("annotate", function(results) {
|
||||
session.setAnnotations(results.data);
|
||||
});
|
||||
|
||||
worker.on("terminate", function() {
|
||||
session.clearAnnotations();
|
||||
});
|
||||
|
||||
return worker;
|
||||
};
|
||||
|
||||
this.$id = "ace/mode/nrjavascript";
|
||||
}).call(Mode.prototype);
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
@@ -1,189 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var Mirror = require("../worker/mirror").Mirror;
|
||||
var lint = require("./javascript/jshint").JSHINT;
|
||||
|
||||
function startRegex(arr) {
|
||||
return RegExp("^(" + arr.join("|") + ")");
|
||||
}
|
||||
|
||||
var disabledWarningsRe = startRegex([
|
||||
"Bad for in variable '(.+)'.",
|
||||
'Missing "use strict"'
|
||||
]);
|
||||
var errorsRe = startRegex([
|
||||
"Unexpected",
|
||||
"Expected ",
|
||||
"Confusing (plus|minus)",
|
||||
"\\{a\\} unterminated regular expression",
|
||||
"Unclosed ",
|
||||
"Unmatched ",
|
||||
"Unbegun comment",
|
||||
"Bad invocation",
|
||||
"Missing space after",
|
||||
"Missing operator at"
|
||||
]);
|
||||
var infoRe = startRegex([
|
||||
"Expected an assignment",
|
||||
"Bad escapement of EOL",
|
||||
"Unexpected comma",
|
||||
"Unexpected space",
|
||||
"Missing radix parameter.",
|
||||
"A leading decimal point can",
|
||||
"\\['{a}'\\] is better written in dot notation.",
|
||||
"'{a}' used out of scope"
|
||||
]);
|
||||
|
||||
var NRJavaScriptWorker = exports.NRJavaScriptWorker = function(sender) {
|
||||
Mirror.call(this, sender);
|
||||
this.setTimeout(500);
|
||||
this.setOptions();
|
||||
};
|
||||
|
||||
oop.inherits(NRJavaScriptWorker, Mirror);
|
||||
|
||||
(function() {
|
||||
this.setOptions = function(options) {
|
||||
this.options = options || {
|
||||
// undef: true,
|
||||
// unused: true,
|
||||
esnext: true,
|
||||
moz: true,
|
||||
devel: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
laxcomma: true,
|
||||
laxbreak: true,
|
||||
lastsemic: true,
|
||||
onevar: false,
|
||||
passfail: false,
|
||||
maxerr: 100,
|
||||
expr: true,
|
||||
multistr: true,
|
||||
globalstrict: true
|
||||
};
|
||||
this.doc.getValue() && this.deferredUpdate.schedule(100);
|
||||
};
|
||||
|
||||
this.changeOptions = function(newOptions) {
|
||||
oop.mixin(this.options, newOptions);
|
||||
this.doc.getValue() && this.deferredUpdate.schedule(100);
|
||||
};
|
||||
|
||||
this.isValidJS = function(str) {
|
||||
try {
|
||||
// evaluated code can only create variables in this function
|
||||
eval("throw 0;" + str);
|
||||
} catch(e) {
|
||||
if (e === 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
this.onUpdate = function() {
|
||||
var value = this.doc.getValue();
|
||||
value = value.replace(/^#!.*\n/, "\n");
|
||||
if (!value)
|
||||
return this.sender.emit("annotate", []);
|
||||
|
||||
// [Node-RED] wrap the code in a function
|
||||
value = "async function __nodered__(msg) {\n"+value+"\n}";
|
||||
|
||||
var errors = [];
|
||||
// jshint reports many false errors
|
||||
// report them as error only if code is actually invalid
|
||||
var maxErrorLevel = this.isValidJS(value) ? "warning" : "error";
|
||||
|
||||
// var start = new Date();
|
||||
lint(value, this.options, this.options.globals);
|
||||
var results = lint.errors;
|
||||
|
||||
var errorAdded = false;
|
||||
for (var i = 0; i < results.length; i++) {
|
||||
var error = results[i];
|
||||
if (!error)
|
||||
continue;
|
||||
var raw = error.raw;
|
||||
var type = "warning";
|
||||
|
||||
if (raw == "Missing semicolon.") {
|
||||
var str = error.evidence.substr(error.character);
|
||||
str = str.charAt(str.search(/\S/));
|
||||
if (maxErrorLevel == "error" && str && /[\w\d{(['"]/.test(str)) {
|
||||
error.reason = 'Missing ";" before statement';
|
||||
type = "error";
|
||||
} else {
|
||||
type = "info";
|
||||
}
|
||||
}
|
||||
else if (disabledWarningsRe.test(raw)) {
|
||||
continue;
|
||||
}
|
||||
else if (infoRe.test(raw)) {
|
||||
type = "info";
|
||||
}
|
||||
else if (errorsRe.test(raw)) {
|
||||
errorAdded = true;
|
||||
type = maxErrorLevel;
|
||||
}
|
||||
else if (raw == "'{a}' is not defined.") {
|
||||
type = "warning";
|
||||
}
|
||||
else if (raw == "'{a}' is defined but never used.") {
|
||||
type = "info";
|
||||
}
|
||||
|
||||
errors.push({
|
||||
// [Node-RED] offset the row for the added line
|
||||
row: error.line-2,
|
||||
column: error.character-1,
|
||||
text: error.reason,
|
||||
type: type,
|
||||
raw: raw
|
||||
});
|
||||
|
||||
if (errorAdded) {
|
||||
// break;
|
||||
}
|
||||
}
|
||||
// console.log("lint time: " + (new Date() - start));
|
||||
|
||||
this.sender.emit("annotate", errors);
|
||||
};
|
||||
|
||||
}).call(NRJavaScriptWorker.prototype);
|
||||
|
||||
});
|
||||
@@ -75,39 +75,29 @@ RED.comms = (function() {
|
||||
}
|
||||
ws.onmessage = function(event) {
|
||||
var message = JSON.parse(event.data);
|
||||
if (message.auth) {
|
||||
if (pendingAuth) {
|
||||
if (message.auth === "ok") {
|
||||
for (var m = 0; m < message.length; m++) {
|
||||
var msg = message[m];
|
||||
if (pendingAuth && msg.auth) {
|
||||
if (msg.auth === "ok") {
|
||||
pendingAuth = false;
|
||||
completeConnection();
|
||||
} else if (message.auth === "fail") {
|
||||
} else if (msg.auth === "fail") {
|
||||
// anything else is an error...
|
||||
active = false;
|
||||
RED.user.login({updateMenu:true},function() {
|
||||
connectWS();
|
||||
})
|
||||
}
|
||||
} else if (message.auth === "fail") {
|
||||
// Our current session has expired
|
||||
active = false;
|
||||
RED.user.login({updateMenu:true},function() {
|
||||
connectWS();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// Otherwise, 'message' is an array of actual comms messages
|
||||
for (var m = 0; m < message.length; m++) {
|
||||
var msg = message[m];
|
||||
if (msg.topic) {
|
||||
for (var t in subscriptions) {
|
||||
if (subscriptions.hasOwnProperty(t)) {
|
||||
var re = new RegExp("^"+t.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/\/#$/,"(\/.*)?")+"$");
|
||||
if (re.test(msg.topic)) {
|
||||
var subscribers = subscriptions[t];
|
||||
if (subscribers) {
|
||||
for (var i=0;i<subscribers.length;i++) {
|
||||
subscribers[i](msg.topic,msg.data);
|
||||
}
|
||||
else if (msg.topic) {
|
||||
for (var t in subscriptions) {
|
||||
if (subscriptions.hasOwnProperty(t)) {
|
||||
var re = new RegExp("^"+t.replace(/([\[\]\?\(\)\\\\$\^\*\.|])/g,"\\$1").replace(/\+/g,"[^/]+").replace(/\/#$/,"(\/.*)?")+"$");
|
||||
if (re.test(msg.topic)) {
|
||||
var subscribers = subscriptions[t];
|
||||
if (subscribers) {
|
||||
for (var i=0;i<subscribers.length;i++) {
|
||||
subscribers[i](msg.topic,msg.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,831 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
RED.nodes.fontAwesome = (function() {
|
||||
|
||||
var iconMap = {
|
||||
"fa-address-book-o": "\uf2ba",
|
||||
"fa-address-book": "\uf2b9",
|
||||
"fa-address-card-o": "\uf2bc",
|
||||
"fa-address-card": "\uf2bb",
|
||||
"fa-adjust": "\uf042",
|
||||
"fa-align-center": "\uf037",
|
||||
"fa-align-justify": "\uf039",
|
||||
"fa-align-left": "\uf036",
|
||||
"fa-align-right": "\uf038",
|
||||
"fa-ambulance": "\uf0f9",
|
||||
"fa-american-sign-language-interpreting": "\uf2a3",
|
||||
"fa-anchor": "\uf13d",
|
||||
"fa-angle-double-down": "\uf103",
|
||||
"fa-angle-double-left": "\uf100",
|
||||
"fa-angle-double-right": "\uf101",
|
||||
"fa-angle-double-up": "\uf102",
|
||||
"fa-angle-down": "\uf107",
|
||||
"fa-angle-left": "\uf104",
|
||||
"fa-angle-right": "\uf105",
|
||||
"fa-angle-up": "\uf106",
|
||||
"fa-archive": "\uf187",
|
||||
"fa-area-chart": "\uf1fe",
|
||||
"fa-arrow-circle-down": "\uf0ab",
|
||||
"fa-arrow-circle-left": "\uf0a8",
|
||||
"fa-arrow-circle-o-down": "\uf01a",
|
||||
"fa-arrow-circle-o-left": "\uf190",
|
||||
"fa-arrow-circle-o-right": "\uf18e",
|
||||
"fa-arrow-circle-o-up": "\uf01b",
|
||||
"fa-arrow-circle-right": "\uf0a9",
|
||||
"fa-arrow-circle-up": "\uf0aa",
|
||||
"fa-arrow-down": "\uf063",
|
||||
"fa-arrow-left": "\uf060",
|
||||
"fa-arrow-right": "\uf061",
|
||||
"fa-arrow-up": "\uf062",
|
||||
"fa-arrows-alt": "\uf0b2",
|
||||
"fa-arrows-h": "\uf07e",
|
||||
"fa-arrows-v": "\uf07d",
|
||||
"fa-arrows": "\uf047",
|
||||
"fa-asl-interpreting": "\uf2a3",
|
||||
"fa-assistive-listening-systems": "\uf2a2",
|
||||
"fa-asterisk": "\uf069",
|
||||
"fa-at": "\uf1fa",
|
||||
"fa-audio-description": "\uf29e",
|
||||
"fa-automobile": "\uf1b9",
|
||||
"fa-backward": "\uf04a",
|
||||
"fa-balance-scale": "\uf24e",
|
||||
"fa-ban": "\uf05e",
|
||||
"fa-bank": "\uf19c",
|
||||
"fa-bar-chart-o": "\uf080",
|
||||
"fa-bar-chart": "\uf080",
|
||||
"fa-barcode": "\uf02a",
|
||||
"fa-bars": "\uf0c9",
|
||||
"fa-bath": "\uf2cd",
|
||||
"fa-bathtub": "\uf2cd",
|
||||
"fa-battery-0": "\uf244",
|
||||
"fa-battery-1": "\uf243",
|
||||
"fa-battery-2": "\uf242",
|
||||
"fa-battery-3": "\uf241",
|
||||
"fa-battery-4": "\uf240",
|
||||
"fa-battery-empty": "\uf244",
|
||||
"fa-battery-full": "\uf240",
|
||||
"fa-battery-half": "\uf242",
|
||||
"fa-battery-quarter": "\uf243",
|
||||
"fa-battery-three-quarters": "\uf241",
|
||||
"fa-battery": "\uf240",
|
||||
"fa-bed": "\uf236",
|
||||
"fa-beer": "\uf0fc",
|
||||
"fa-bell-o": "\uf0a2",
|
||||
"fa-bell-slash-o": "\uf1f7",
|
||||
"fa-bell-slash": "\uf1f6",
|
||||
"fa-bell": "\uf0f3",
|
||||
"fa-bicycle": "\uf206",
|
||||
"fa-binoculars": "\uf1e5",
|
||||
"fa-birthday-cake": "\uf1fd",
|
||||
"fa-blind": "\uf29d",
|
||||
"fa-bold": "\uf032",
|
||||
"fa-bolt": "\uf0e7",
|
||||
"fa-bomb": "\uf1e2",
|
||||
"fa-book": "\uf02d",
|
||||
"fa-bookmark-o": "\uf097",
|
||||
"fa-bookmark": "\uf02e",
|
||||
"fa-braille": "\uf2a1",
|
||||
"fa-briefcase": "\uf0b1",
|
||||
"fa-bug": "\uf188",
|
||||
"fa-building-o": "\uf0f7",
|
||||
"fa-building": "\uf1ad",
|
||||
"fa-bullhorn": "\uf0a1",
|
||||
"fa-bullseye": "\uf140",
|
||||
"fa-bus": "\uf207",
|
||||
"fa-cab": "\uf1ba",
|
||||
"fa-calculator": "\uf1ec",
|
||||
"fa-calendar-check-o": "\uf274",
|
||||
"fa-calendar-minus-o": "\uf272",
|
||||
"fa-calendar-o": "\uf133",
|
||||
"fa-calendar-plus-o": "\uf271",
|
||||
"fa-calendar-times-o": "\uf273",
|
||||
"fa-calendar": "\uf073",
|
||||
"fa-camera-retro": "\uf083",
|
||||
"fa-camera": "\uf030",
|
||||
"fa-car": "\uf1b9",
|
||||
"fa-caret-down": "\uf0d7",
|
||||
"fa-caret-left": "\uf0d9",
|
||||
"fa-caret-right": "\uf0da",
|
||||
"fa-caret-square-o-down": "\uf150",
|
||||
"fa-caret-square-o-left": "\uf191",
|
||||
"fa-caret-square-o-right": "\uf152",
|
||||
"fa-caret-square-o-up": "\uf151",
|
||||
"fa-caret-up": "\uf0d8",
|
||||
"fa-cart-arrow-down": "\uf218",
|
||||
"fa-cart-plus": "\uf217",
|
||||
"fa-cc": "\uf20a",
|
||||
"fa-certificate": "\uf0a3",
|
||||
"fa-chain-broken": "\uf127",
|
||||
"fa-chain": "\uf0c1",
|
||||
"fa-check-circle-o": "\uf05d",
|
||||
"fa-check-circle": "\uf058",
|
||||
"fa-check-square-o": "\uf046",
|
||||
"fa-check-square": "\uf14a",
|
||||
"fa-check": "\uf00c",
|
||||
"fa-chevron-circle-down": "\uf13a",
|
||||
"fa-chevron-circle-left": "\uf137",
|
||||
"fa-chevron-circle-right": "\uf138",
|
||||
"fa-chevron-circle-up": "\uf139",
|
||||
"fa-chevron-down": "\uf078",
|
||||
"fa-chevron-left": "\uf053",
|
||||
"fa-chevron-right": "\uf054",
|
||||
"fa-chevron-up": "\uf077",
|
||||
"fa-child": "\uf1ae",
|
||||
"fa-circle-o-notch": "\uf1ce",
|
||||
"fa-circle-o": "\uf10c",
|
||||
"fa-circle-thin": "\uf1db",
|
||||
"fa-circle": "\uf111",
|
||||
"fa-clipboard": "\uf0ea",
|
||||
"fa-clock-o": "\uf017",
|
||||
"fa-clone": "\uf24d",
|
||||
"fa-close": "\uf00d",
|
||||
"fa-cloud-download": "\uf0ed",
|
||||
"fa-cloud-upload": "\uf0ee",
|
||||
"fa-cloud": "\uf0c2",
|
||||
"fa-cny": "\uf157",
|
||||
"fa-code-fork": "\uf126",
|
||||
"fa-code": "\uf121",
|
||||
"fa-coffee": "\uf0f4",
|
||||
"fa-cog": "\uf013",
|
||||
"fa-cogs": "\uf085",
|
||||
"fa-columns": "\uf0db",
|
||||
"fa-comment-o": "\uf0e5",
|
||||
"fa-comment": "\uf075",
|
||||
"fa-commenting-o": "\uf27b",
|
||||
"fa-commenting": "\uf27a",
|
||||
"fa-comments-o": "\uf0e6",
|
||||
"fa-comments": "\uf086",
|
||||
"fa-compass": "\uf14e",
|
||||
"fa-compress": "\uf066",
|
||||
"fa-copy": "\uf0c5",
|
||||
"fa-copyright": "\uf1f9",
|
||||
"fa-creative-commons": "\uf25e",
|
||||
"fa-credit-card-alt": "\uf283",
|
||||
"fa-credit-card": "\uf09d",
|
||||
"fa-crop": "\uf125",
|
||||
"fa-crosshairs": "\uf05b",
|
||||
"fa-cube": "\uf1b2",
|
||||
"fa-cubes": "\uf1b3",
|
||||
"fa-cut": "\uf0c4",
|
||||
"fa-cutlery": "\uf0f5",
|
||||
"fa-dashboard": "\uf0e4",
|
||||
"fa-database": "\uf1c0",
|
||||
"fa-deaf": "\uf2a4",
|
||||
"fa-deafness": "\uf2a4",
|
||||
"fa-dedent": "\uf03b",
|
||||
"fa-desktop": "\uf108",
|
||||
"fa-diamond": "\uf219",
|
||||
"fa-dollar": "\uf155",
|
||||
"fa-dot-circle-o": "\uf192",
|
||||
"fa-download": "\uf019",
|
||||
"fa-drivers-license-o": "\uf2c3",
|
||||
"fa-drivers-license": "\uf2c2",
|
||||
"fa-edit": "\uf044",
|
||||
"fa-eject": "\uf052",
|
||||
"fa-ellipsis-h": "\uf141",
|
||||
"fa-ellipsis-v": "\uf142",
|
||||
"fa-envelope-o": "\uf003",
|
||||
"fa-envelope-open-o": "\uf2b7",
|
||||
"fa-envelope-open": "\uf2b6",
|
||||
"fa-envelope-square": "\uf199",
|
||||
"fa-envelope": "\uf0e0",
|
||||
"fa-eraser": "\uf12d",
|
||||
"fa-eur": "\uf153",
|
||||
"fa-euro": "\uf153",
|
||||
"fa-exchange": "\uf0ec",
|
||||
"fa-exclamation-circle": "\uf06a",
|
||||
"fa-exclamation-triangle": "\uf071",
|
||||
"fa-exclamation": "\uf12a",
|
||||
"fa-expand": "\uf065",
|
||||
"fa-external-link-square": "\uf14c",
|
||||
"fa-external-link": "\uf08e",
|
||||
"fa-eye-slash": "\uf070",
|
||||
"fa-eye": "\uf06e",
|
||||
"fa-eyedropper": "\uf1fb",
|
||||
"fa-fast-backward": "\uf049",
|
||||
"fa-fast-forward": "\uf050",
|
||||
"fa-fax": "\uf1ac",
|
||||
"fa-feed": "\uf09e",
|
||||
"fa-female": "\uf182",
|
||||
"fa-fighter-jet": "\uf0fb",
|
||||
"fa-file-archive-o": "\uf1c6",
|
||||
"fa-file-audio-o": "\uf1c7",
|
||||
"fa-file-code-o": "\uf1c9",
|
||||
"fa-file-excel-o": "\uf1c3",
|
||||
"fa-file-image-o": "\uf1c5",
|
||||
"fa-file-movie-o": "\uf1c8",
|
||||
"fa-file-o": "\uf016",
|
||||
"fa-file-pdf-o": "\uf1c1",
|
||||
"fa-file-photo-o": "\uf1c5",
|
||||
"fa-file-picture-o": "\uf1c5",
|
||||
"fa-file-powerpoint-o": "\uf1c4",
|
||||
"fa-file-sound-o": "\uf1c7",
|
||||
"fa-file-text-o": "\uf0f6",
|
||||
"fa-file-text": "\uf15c",
|
||||
"fa-file-video-o": "\uf1c8",
|
||||
"fa-file-word-o": "\uf1c2",
|
||||
"fa-file-zip-o": "\uf1c6",
|
||||
"fa-file": "\uf15b",
|
||||
"fa-files-o": "\uf0c5",
|
||||
"fa-film": "\uf008",
|
||||
"fa-filter": "\uf0b0",
|
||||
"fa-fire-extinguisher": "\uf134",
|
||||
"fa-fire": "\uf06d",
|
||||
"fa-flag-checkered": "\uf11e",
|
||||
"fa-flag-o": "\uf11d",
|
||||
"fa-flag": "\uf024",
|
||||
"fa-flash": "\uf0e7",
|
||||
"fa-flask": "\uf0c3",
|
||||
"fa-floppy-o": "\uf0c7",
|
||||
"fa-folder-o": "\uf114",
|
||||
"fa-folder-open-o": "\uf115",
|
||||
"fa-folder-open": "\uf07c",
|
||||
"fa-folder": "\uf07b",
|
||||
"fa-font": "\uf031",
|
||||
"fa-forward": "\uf04e",
|
||||
"fa-frown-o": "\uf119",
|
||||
"fa-futbol-o": "\uf1e3",
|
||||
"fa-gamepad": "\uf11b",
|
||||
"fa-gavel": "\uf0e3",
|
||||
"fa-gbp": "\uf154",
|
||||
"fa-gear": "\uf013",
|
||||
"fa-gears": "\uf085",
|
||||
"fa-genderless": "\uf22d",
|
||||
"fa-gift": "\uf06b",
|
||||
"fa-glass": "\uf000",
|
||||
"fa-globe": "\uf0ac",
|
||||
"fa-graduation-cap": "\uf19d",
|
||||
"fa-group": "\uf0c0",
|
||||
"fa-h-square": "\uf0fd",
|
||||
"fa-hand-grab-o": "\uf255",
|
||||
"fa-hand-lizard-o": "\uf258",
|
||||
"fa-hand-o-down": "\uf0a7",
|
||||
"fa-hand-o-left": "\uf0a5",
|
||||
"fa-hand-o-right": "\uf0a4",
|
||||
"fa-hand-o-up": "\uf0a6",
|
||||
"fa-hand-paper-o": "\uf256",
|
||||
"fa-hand-peace-o": "\uf25b",
|
||||
"fa-hand-pointer-o": "\uf25a",
|
||||
"fa-hand-rock-o": "\uf255",
|
||||
"fa-hand-scissors-o": "\uf257",
|
||||
"fa-hand-spock-o": "\uf259",
|
||||
"fa-hand-stop-o": "\uf256",
|
||||
"fa-handshake-o": "\uf2b5",
|
||||
"fa-hard-of-hearing": "\uf2a4",
|
||||
"fa-hashtag": "\uf292",
|
||||
"fa-hdd-o": "\uf0a0",
|
||||
"fa-header": "\uf1dc",
|
||||
"fa-headphones": "\uf025",
|
||||
"fa-heart-o": "\uf08a",
|
||||
"fa-heart": "\uf004",
|
||||
"fa-heartbeat": "\uf21e",
|
||||
"fa-history": "\uf1da",
|
||||
"fa-home": "\uf015",
|
||||
"fa-hospital-o": "\uf0f8",
|
||||
"fa-hotel": "\uf236",
|
||||
"fa-hourglass-1": "\uf251",
|
||||
"fa-hourglass-2": "\uf252",
|
||||
"fa-hourglass-3": "\uf253",
|
||||
"fa-hourglass-end": "\uf253",
|
||||
"fa-hourglass-half": "\uf252",
|
||||
"fa-hourglass-o": "\uf250",
|
||||
"fa-hourglass-start": "\uf251",
|
||||
"fa-hourglass": "\uf254",
|
||||
"fa-i-cursor": "\uf246",
|
||||
"fa-id-badge": "\uf2c1",
|
||||
"fa-id-card-o": "\uf2c3",
|
||||
"fa-id-card": "\uf2c2",
|
||||
"fa-ils": "\uf20b",
|
||||
"fa-image": "\uf03e",
|
||||
"fa-inbox": "\uf01c",
|
||||
"fa-indent": "\uf03c",
|
||||
"fa-industry": "\uf275",
|
||||
"fa-info-circle": "\uf05a",
|
||||
"fa-info": "\uf129",
|
||||
"fa-inr": "\uf156",
|
||||
"fa-institution": "\uf19c",
|
||||
"fa-intersex": "\uf224",
|
||||
"fa-italic": "\uf033",
|
||||
"fa-jpy": "\uf157",
|
||||
"fa-key": "\uf084",
|
||||
"fa-keyboard-o": "\uf11c",
|
||||
"fa-krw": "\uf159",
|
||||
"fa-language": "\uf1ab",
|
||||
"fa-laptop": "\uf109",
|
||||
"fa-leaf": "\uf06c",
|
||||
"fa-legal": "\uf0e3",
|
||||
"fa-lemon-o": "\uf094",
|
||||
"fa-level-down": "\uf149",
|
||||
"fa-level-up": "\uf148",
|
||||
"fa-life-bouy": "\uf1cd",
|
||||
"fa-life-buoy": "\uf1cd",
|
||||
"fa-life-ring": "\uf1cd",
|
||||
"fa-life-saver": "\uf1cd",
|
||||
"fa-lightbulb-o": "\uf0eb",
|
||||
"fa-line-chart": "\uf201",
|
||||
"fa-link": "\uf0c1",
|
||||
"fa-list-alt": "\uf022",
|
||||
"fa-list-ol": "\uf0cb",
|
||||
"fa-list-ul": "\uf0ca",
|
||||
"fa-list": "\uf03a",
|
||||
"fa-location-arrow": "\uf124",
|
||||
"fa-lock": "\uf023",
|
||||
"fa-long-arrow-down": "\uf175",
|
||||
"fa-long-arrow-left": "\uf177",
|
||||
"fa-long-arrow-right": "\uf178",
|
||||
"fa-long-arrow-up": "\uf176",
|
||||
"fa-low-vision": "\uf2a8",
|
||||
"fa-magic": "\uf0d0",
|
||||
"fa-magnet": "\uf076",
|
||||
"fa-mail-forward": "\uf064",
|
||||
"fa-mail-reply-all": "\uf122",
|
||||
"fa-mail-reply": "\uf112",
|
||||
"fa-male": "\uf183",
|
||||
"fa-map-marker": "\uf041",
|
||||
"fa-map-o": "\uf278",
|
||||
"fa-map-pin": "\uf276",
|
||||
"fa-map-signs": "\uf277",
|
||||
"fa-map": "\uf279",
|
||||
"fa-mars-double": "\uf227",
|
||||
"fa-mars-stroke-h": "\uf22b",
|
||||
"fa-mars-stroke-v": "\uf22a",
|
||||
"fa-mars-stroke": "\uf229",
|
||||
"fa-mars": "\uf222",
|
||||
"fa-medkit": "\uf0fa",
|
||||
"fa-meh-o": "\uf11a",
|
||||
"fa-mercury": "\uf223",
|
||||
"fa-microchip": "\uf2db",
|
||||
"fa-microphone-slash": "\uf131",
|
||||
"fa-microphone": "\uf130",
|
||||
"fa-minus-circle": "\uf056",
|
||||
"fa-minus-square-o": "\uf147",
|
||||
"fa-minus-square": "\uf146",
|
||||
"fa-minus": "\uf068",
|
||||
"fa-mobile-phone": "\uf10b",
|
||||
"fa-mobile": "\uf10b",
|
||||
"fa-money": "\uf0d6",
|
||||
"fa-moon-o": "\uf186",
|
||||
"fa-mortar-board": "\uf19d",
|
||||
"fa-motorcycle": "\uf21c",
|
||||
"fa-mouse-pointer": "\uf245",
|
||||
"fa-music": "\uf001",
|
||||
"fa-navicon": "\uf0c9",
|
||||
"fa-neuter": "\uf22c",
|
||||
"fa-newspaper-o": "\uf1ea",
|
||||
"fa-object-group": "\uf247",
|
||||
"fa-object-ungroup": "\uf248",
|
||||
"fa-outdent": "\uf03b",
|
||||
"fa-paint-brush": "\uf1fc",
|
||||
"fa-paper-plane-o": "\uf1d9",
|
||||
"fa-paper-plane": "\uf1d8",
|
||||
"fa-paperclip": "\uf0c6",
|
||||
"fa-paragraph": "\uf1dd",
|
||||
"fa-paste": "\uf0ea",
|
||||
"fa-pause-circle-o": "\uf28c",
|
||||
"fa-pause-circle": "\uf28b",
|
||||
"fa-pause": "\uf04c",
|
||||
"fa-paw": "\uf1b0",
|
||||
"fa-pencil-square-o": "\uf044",
|
||||
"fa-pencil-square": "\uf14b",
|
||||
"fa-pencil": "\uf040",
|
||||
"fa-percent": "\uf295",
|
||||
"fa-phone-square": "\uf098",
|
||||
"fa-phone": "\uf095",
|
||||
"fa-photo": "\uf03e",
|
||||
"fa-picture-o": "\uf03e",
|
||||
"fa-pie-chart": "\uf200",
|
||||
"fa-plane": "\uf072",
|
||||
"fa-play-circle-o": "\uf01d",
|
||||
"fa-play-circle": "\uf144",
|
||||
"fa-play": "\uf04b",
|
||||
"fa-plug": "\uf1e6",
|
||||
"fa-plus-circle": "\uf055",
|
||||
"fa-plus-square-o": "\uf196",
|
||||
"fa-plus-square": "\uf0fe",
|
||||
"fa-plus": "\uf067",
|
||||
"fa-podcast": "\uf2ce",
|
||||
"fa-power-off": "\uf011",
|
||||
"fa-print": "\uf02f",
|
||||
"fa-puzzle-piece": "\uf12e",
|
||||
"fa-qrcode": "\uf029",
|
||||
"fa-question-circle-o": "\uf29c",
|
||||
"fa-question-circle": "\uf059",
|
||||
"fa-question": "\uf128",
|
||||
"fa-quote-left": "\uf10d",
|
||||
"fa-quote-right": "\uf10e",
|
||||
"fa-random": "\uf074",
|
||||
"fa-recycle": "\uf1b8",
|
||||
"fa-refresh": "\uf021",
|
||||
"fa-registered": "\uf25d",
|
||||
"fa-remove": "\uf00d",
|
||||
"fa-reorder": "\uf0c9",
|
||||
"fa-repeat": "\uf01e",
|
||||
"fa-reply-all": "\uf122",
|
||||
"fa-reply": "\uf112",
|
||||
"fa-retweet": "\uf079",
|
||||
"fa-rmb": "\uf157",
|
||||
"fa-road": "\uf018",
|
||||
"fa-rocket": "\uf135",
|
||||
"fa-rotate-left": "\uf0e2",
|
||||
"fa-rotate-right": "\uf01e",
|
||||
"fa-rouble": "\uf158",
|
||||
"fa-rss-square": "\uf143",
|
||||
"fa-rss": "\uf09e",
|
||||
"fa-rub": "\uf158",
|
||||
"fa-ruble": "\uf158",
|
||||
"fa-rupee": "\uf156",
|
||||
"fa-s15": "\uf2cd",
|
||||
"fa-save": "\uf0c7",
|
||||
"fa-scissors": "\uf0c4",
|
||||
"fa-search-minus": "\uf010",
|
||||
"fa-search-plus": "\uf00e",
|
||||
"fa-search": "\uf002",
|
||||
"fa-send-o": "\uf1d9",
|
||||
"fa-send": "\uf1d8",
|
||||
"fa-server": "\uf233",
|
||||
"fa-share-square-o": "\uf045",
|
||||
"fa-share-square": "\uf14d",
|
||||
"fa-share": "\uf064",
|
||||
"fa-shekel": "\uf20b",
|
||||
"fa-sheqel": "\uf20b",
|
||||
"fa-shield": "\uf132",
|
||||
"fa-ship": "\uf21a",
|
||||
"fa-shopping-bag": "\uf290",
|
||||
"fa-shopping-basket": "\uf291",
|
||||
"fa-shopping-cart": "\uf07a",
|
||||
"fa-shower": "\uf2cc",
|
||||
"fa-sign-in": "\uf090",
|
||||
"fa-sign-language": "\uf2a7",
|
||||
"fa-sign-out": "\uf08b",
|
||||
"fa-signal": "\uf012",
|
||||
"fa-signing": "\uf2a7",
|
||||
"fa-sitemap": "\uf0e8",
|
||||
"fa-sliders": "\uf1de",
|
||||
"fa-smile-o": "\uf118",
|
||||
"fa-snowflake-o": "\uf2dc",
|
||||
"fa-soccer-ball-o": "\uf1e3",
|
||||
"fa-sort-alpha-asc": "\uf15d",
|
||||
"fa-sort-alpha-desc": "\uf15e",
|
||||
"fa-sort-amount-asc": "\uf160",
|
||||
"fa-sort-amount-desc": "\uf161",
|
||||
"fa-sort-asc": "\uf0de",
|
||||
"fa-sort-desc": "\uf0dd",
|
||||
"fa-sort-down": "\uf0dd",
|
||||
"fa-sort-numeric-asc": "\uf162",
|
||||
"fa-sort-numeric-desc": "\uf163",
|
||||
"fa-sort-up": "\uf0de",
|
||||
"fa-sort": "\uf0dc",
|
||||
"fa-space-shuttle": "\uf197",
|
||||
"fa-spinner": "\uf110",
|
||||
"fa-spoon": "\uf1b1",
|
||||
"fa-square-o": "\uf096",
|
||||
"fa-square": "\uf0c8",
|
||||
"fa-star-half-empty": "\uf123",
|
||||
"fa-star-half-full": "\uf123",
|
||||
"fa-star-half-o": "\uf123",
|
||||
"fa-star-half": "\uf089",
|
||||
"fa-star-o": "\uf006",
|
||||
"fa-star": "\uf005",
|
||||
"fa-step-backward": "\uf048",
|
||||
"fa-step-forward": "\uf051",
|
||||
"fa-stethoscope": "\uf0f1",
|
||||
"fa-sticky-note-o": "\uf24a",
|
||||
"fa-sticky-note": "\uf249",
|
||||
"fa-stop-circle-o": "\uf28e",
|
||||
"fa-stop-circle": "\uf28d",
|
||||
"fa-stop": "\uf04d",
|
||||
"fa-street-view": "\uf21d",
|
||||
"fa-strikethrough": "\uf0cc",
|
||||
"fa-subscript": "\uf12c",
|
||||
"fa-subway": "\uf239",
|
||||
"fa-suitcase": "\uf0f2",
|
||||
"fa-sun-o": "\uf185",
|
||||
"fa-superscript": "\uf12b",
|
||||
"fa-support": "\uf1cd",
|
||||
"fa-table": "\uf0ce",
|
||||
"fa-tablet": "\uf10a",
|
||||
"fa-tachometer": "\uf0e4",
|
||||
"fa-tag": "\uf02b",
|
||||
"fa-tags": "\uf02c",
|
||||
"fa-tasks": "\uf0ae",
|
||||
"fa-taxi": "\uf1ba",
|
||||
"fa-television": "\uf26c",
|
||||
"fa-terminal": "\uf120",
|
||||
"fa-text-height": "\uf034",
|
||||
"fa-text-width": "\uf035",
|
||||
"fa-th-large": "\uf009",
|
||||
"fa-th-list": "\uf00b",
|
||||
"fa-th": "\uf00a",
|
||||
"fa-thermometer-0": "\uf2cb",
|
||||
"fa-thermometer-1": "\uf2ca",
|
||||
"fa-thermometer-2": "\uf2c9",
|
||||
"fa-thermometer-3": "\uf2c8",
|
||||
"fa-thermometer-4": "\uf2c7",
|
||||
"fa-thermometer-empty": "\uf2cb",
|
||||
"fa-thermometer-full": "\uf2c7",
|
||||
"fa-thermometer-half": "\uf2c9",
|
||||
"fa-thermometer-quarter": "\uf2ca",
|
||||
"fa-thermometer-three-quarters": "\uf2c8",
|
||||
"fa-thermometer": "\uf2c7",
|
||||
"fa-thumb-tack": "\uf08d",
|
||||
"fa-thumbs-down": "\uf165",
|
||||
"fa-thumbs-o-down": "\uf088",
|
||||
"fa-thumbs-o-up": "\uf087",
|
||||
"fa-thumbs-up": "\uf164",
|
||||
"fa-ticket": "\uf145",
|
||||
"fa-times-circle-o": "\uf05c",
|
||||
"fa-times-circle": "\uf057",
|
||||
"fa-times-rectangle-o": "\uf2d4",
|
||||
"fa-times-rectangle": "\uf2d3",
|
||||
"fa-times": "\uf00d",
|
||||
"fa-tint": "\uf043",
|
||||
"fa-toggle-down": "\uf150",
|
||||
"fa-toggle-left": "\uf191",
|
||||
"fa-toggle-off": "\uf204",
|
||||
"fa-toggle-on": "\uf205",
|
||||
"fa-toggle-right": "\uf152",
|
||||
"fa-toggle-up": "\uf151",
|
||||
"fa-trademark": "\uf25c",
|
||||
"fa-train": "\uf238",
|
||||
"fa-transgender-alt": "\uf225",
|
||||
"fa-transgender": "\uf224",
|
||||
"fa-trash-o": "\uf014",
|
||||
"fa-trash": "\uf1f8",
|
||||
"fa-tree": "\uf1bb",
|
||||
"fa-trophy": "\uf091",
|
||||
"fa-truck": "\uf0d1",
|
||||
"fa-try": "\uf195",
|
||||
"fa-tty": "\uf1e4",
|
||||
"fa-turkish-lira": "\uf195",
|
||||
"fa-tv": "\uf26c",
|
||||
"fa-umbrella": "\uf0e9",
|
||||
"fa-underline": "\uf0cd",
|
||||
"fa-undo": "\uf0e2",
|
||||
"fa-universal-access": "\uf29a",
|
||||
"fa-university": "\uf19c",
|
||||
"fa-unlink": "\uf127",
|
||||
"fa-unlock-alt": "\uf13e",
|
||||
"fa-unlock": "\uf09c",
|
||||
"fa-unsorted": "\uf0dc",
|
||||
"fa-upload": "\uf093",
|
||||
"fa-usd": "\uf155",
|
||||
"fa-user-circle-o": "\uf2be",
|
||||
"fa-user-circle": "\uf2bd",
|
||||
"fa-user-md": "\uf0f0",
|
||||
"fa-user-o": "\uf2c0",
|
||||
"fa-user-plus": "\uf234",
|
||||
"fa-user-secret": "\uf21b",
|
||||
"fa-user-times": "\uf235",
|
||||
"fa-user": "\uf007",
|
||||
"fa-users": "\uf0c0",
|
||||
"fa-vcard-o": "\uf2bc",
|
||||
"fa-vcard": "\uf2bb",
|
||||
"fa-venus-double": "\uf226",
|
||||
"fa-venus-mars": "\uf228",
|
||||
"fa-venus": "\uf221",
|
||||
"fa-video-camera": "\uf03d",
|
||||
"fa-volume-control-phone": "\uf2a0",
|
||||
"fa-volume-down": "\uf027",
|
||||
"fa-volume-off": "\uf026",
|
||||
"fa-volume-up": "\uf028",
|
||||
"fa-warning": "\uf071",
|
||||
"fa-wheelchair-alt": "\uf29b",
|
||||
"fa-wheelchair": "\uf193",
|
||||
"fa-wifi": "\uf1eb",
|
||||
"fa-window-close-o": "\uf2d4",
|
||||
"fa-window-close": "\uf2d3",
|
||||
"fa-window-maximize": "\uf2d0",
|
||||
"fa-window-minimize": "\uf2d1",
|
||||
"fa-window-restore": "\uf2d2",
|
||||
"fa-won": "\uf159",
|
||||
"fa-wrench": "\uf0ad",
|
||||
"fa-yen": "\uf157"
|
||||
};
|
||||
|
||||
var brandIconMap = {
|
||||
"fa-500px": "\uf26e",
|
||||
"fa-adn": "\uf170",
|
||||
"fa-amazon": "\uf270",
|
||||
"fa-android": "\uf17b",
|
||||
"fa-angellist": "\uf209",
|
||||
"fa-apple": "\uf179",
|
||||
"fa-bandcamp": "\uf2d5",
|
||||
"fa-behance-square": "\uf1b5",
|
||||
"fa-behance": "\uf1b4",
|
||||
"fa-bitbucket-square": "\uf172",
|
||||
"fa-bitbucket": "\uf171",
|
||||
"fa-bitcoin": "\uf15a",
|
||||
"fa-black-tie": "\uf27e",
|
||||
"fa-bluetooth-b": "\uf294",
|
||||
"fa-bluetooth": "\uf293",
|
||||
"fa-btc": "\uf15a",
|
||||
"fa-buysellads": "\uf20d",
|
||||
"fa-cc-amex": "\uf1f3",
|
||||
"fa-cc-diners-club": "\uf24c",
|
||||
"fa-cc-discover": "\uf1f2",
|
||||
"fa-cc-jcb": "\uf24b",
|
||||
"fa-cc-mastercard": "\uf1f1",
|
||||
"fa-cc-paypal": "\uf1f4",
|
||||
"fa-cc-stripe": "\uf1f5",
|
||||
"fa-cc-visa": "\uf1f0",
|
||||
"fa-chrome": "\uf268",
|
||||
"fa-codepen": "\uf1cb",
|
||||
"fa-codiepie": "\uf284",
|
||||
"fa-connectdevelop": "\uf20e",
|
||||
"fa-contao": "\uf26d",
|
||||
"fa-css3": "\uf13c",
|
||||
"fa-dashcube": "\uf210",
|
||||
"fa-delicious": "\uf1a5",
|
||||
"fa-deviantart": "\uf1bd",
|
||||
"fa-digg": "\uf1a6",
|
||||
"fa-dribbble": "\uf17d",
|
||||
"fa-dropbox": "\uf16b",
|
||||
"fa-drupal": "\uf1a9",
|
||||
"fa-edge": "\uf282",
|
||||
"fa-eercast": "\uf2da",
|
||||
"fa-empire": "\uf1d1",
|
||||
"fa-envira": "\uf299",
|
||||
"fa-etsy": "\uf2d7",
|
||||
"fa-expeditedssl": "\uf23e",
|
||||
"fa-fa": "\uf2b4",
|
||||
"fa-facebook-f": "\uf09a",
|
||||
"fa-facebook-official": "\uf230",
|
||||
"fa-facebook-square": "\uf082",
|
||||
"fa-facebook": "\uf09a",
|
||||
"fa-firefox": "\uf269",
|
||||
"fa-first-order": "\uf2b0",
|
||||
"fa-flickr": "\uf16e",
|
||||
"fa-font-awesome": "\uf2b4",
|
||||
"fa-fonticons": "\uf280",
|
||||
"fa-fort-awesome": "\uf286",
|
||||
"fa-forumbee": "\uf211",
|
||||
"fa-foursquare": "\uf180",
|
||||
"fa-free-code-camp": "\uf2c5",
|
||||
"fa-ge": "\uf1d1",
|
||||
"fa-get-pocket": "\uf265",
|
||||
"fa-gg-circle": "\uf261",
|
||||
"fa-gg": "\uf260",
|
||||
"fa-git-square": "\uf1d2",
|
||||
"fa-git": "\uf1d3",
|
||||
"fa-github-alt": "\uf113",
|
||||
"fa-github-square": "\uf092",
|
||||
"fa-github": "\uf09b",
|
||||
"fa-gitlab": "\uf296",
|
||||
"fa-gittip": "\uf184",
|
||||
"fa-glide-g": "\uf2a6",
|
||||
"fa-glide": "\uf2a5",
|
||||
"fa-google-plus-circle": "\uf2b3",
|
||||
"fa-google-plus-official": "\uf2b3",
|
||||
"fa-google-plus-square": "\uf0d4",
|
||||
"fa-google-plus": "\uf0d5",
|
||||
"fa-google-wallet": "\uf1ee",
|
||||
"fa-google": "\uf1a0",
|
||||
"fa-gratipay": "\uf184",
|
||||
"fa-grav": "\uf2d6",
|
||||
"fa-hacker-news": "\uf1d4",
|
||||
"fa-houzz": "\uf27c",
|
||||
"fa-html5": "\uf13b",
|
||||
"fa-imdb": "\uf2d8",
|
||||
"fa-instagram": "\uf16d",
|
||||
"fa-internet-explorer": "\uf26b",
|
||||
"fa-ioxhost": "\uf208",
|
||||
"fa-joomla": "\uf1aa",
|
||||
"fa-jsfiddle": "\uf1cc",
|
||||
"fa-lastfm-square": "\uf203",
|
||||
"fa-lastfm": "\uf202",
|
||||
"fa-leanpub": "\uf212",
|
||||
"fa-linkedin-square": "\uf08c",
|
||||
"fa-linkedin": "\uf0e1",
|
||||
"fa-linode": "\uf2b8",
|
||||
"fa-linux": "\uf17c",
|
||||
"fa-maxcdn": "\uf136",
|
||||
"fa-meanpath": "\uf20c",
|
||||
"fa-medium": "\uf23a",
|
||||
"fa-meetup": "\uf2e0",
|
||||
"fa-mixcloud": "\uf289",
|
||||
"fa-modx": "\uf285",
|
||||
"fa-odnoklassniki-square": "\uf264",
|
||||
"fa-odnoklassniki": "\uf263",
|
||||
"fa-opencart": "\uf23d",
|
||||
"fa-openid": "\uf19b",
|
||||
"fa-opera": "\uf26a",
|
||||
"fa-optin-monster": "\uf23c",
|
||||
"fa-pagelines": "\uf18c",
|
||||
"fa-paypal": "\uf1ed",
|
||||
"fa-pied-piper-alt": "\uf1a8",
|
||||
"fa-pied-piper-pp": "\uf1a7",
|
||||
"fa-pied-piper": "\uf2ae",
|
||||
"fa-pinterest-p": "\uf231",
|
||||
"fa-pinterest-square": "\uf0d3",
|
||||
"fa-pinterest": "\uf0d2",
|
||||
"fa-product-hunt": "\uf288",
|
||||
"fa-qq": "\uf1d6",
|
||||
"fa-quora": "\uf2c4",
|
||||
"fa-ra": "\uf1d0",
|
||||
"fa-ravelry": "\uf2d9",
|
||||
"fa-rebel": "\uf1d0",
|
||||
"fa-reddit-alien": "\uf281",
|
||||
"fa-reddit-square": "\uf1a2",
|
||||
"fa-reddit": "\uf1a1",
|
||||
"fa-renren": "\uf18b",
|
||||
"fa-resistance": "\uf1d0",
|
||||
"fa-safari": "\uf267",
|
||||
"fa-scribd": "\uf28a",
|
||||
"fa-sellsy": "\uf213",
|
||||
"fa-share-alt-square": "\uf1e1",
|
||||
"fa-share-alt": "\uf1e0",
|
||||
"fa-shirtsinbulk": "\uf214",
|
||||
"fa-simplybuilt": "\uf215",
|
||||
"fa-skyatlas": "\uf216",
|
||||
"fa-skype": "\uf17e",
|
||||
"fa-slack": "\uf198",
|
||||
"fa-slideshare": "\uf1e7",
|
||||
"fa-snapchat-ghost": "\uf2ac",
|
||||
"fa-snapchat-square": "\uf2ad",
|
||||
"fa-snapchat": "\uf2ab",
|
||||
"fa-soundcloud": "\uf1be",
|
||||
"fa-spotify": "\uf1bc",
|
||||
"fa-stack-exchange": "\uf18d",
|
||||
"fa-stack-overflow": "\uf16c",
|
||||
"fa-steam-square": "\uf1b7",
|
||||
"fa-steam": "\uf1b6",
|
||||
"fa-stumbleupon-circle": "\uf1a3",
|
||||
"fa-stumbleupon": "\uf1a4",
|
||||
"fa-superpowers": "\uf2dd",
|
||||
"fa-telegram": "\uf2c6",
|
||||
"fa-tencent-weibo": "\uf1d5",
|
||||
"fa-themeisle": "\uf2b2",
|
||||
"fa-trello": "\uf181",
|
||||
"fa-tripadvisor": "\uf262",
|
||||
"fa-tumblr-square": "\uf174",
|
||||
"fa-tumblr": "\uf173",
|
||||
"fa-twitch": "\uf1e8",
|
||||
"fa-twitter-square": "\uf081",
|
||||
"fa-twitter": "\uf099",
|
||||
"fa-usb": "\uf287",
|
||||
"fa-viacoin": "\uf237",
|
||||
"fa-viadeo-square": "\uf2aa",
|
||||
"fa-viadeo": "\uf2a9",
|
||||
"fa-vimeo-square": "\uf194",
|
||||
"fa-vimeo": "\uf27d",
|
||||
"fa-vine": "\uf1ca",
|
||||
"fa-vk": "\uf189",
|
||||
"fa-wechat": "\uf1d7",
|
||||
"fa-weibo": "\uf18a",
|
||||
"fa-weixin": "\uf1d7",
|
||||
"fa-whatsapp": "\uf232",
|
||||
"fa-wikipedia-w": "\uf266",
|
||||
"fa-windows": "\uf17a",
|
||||
"fa-wordpress": "\uf19a",
|
||||
"fa-wpbeginner": "\uf297",
|
||||
"fa-wpexplorer": "\uf2de",
|
||||
"fa-wpforms": "\uf298",
|
||||
"fa-xing-square": "\uf169",
|
||||
"fa-xing": "\uf168",
|
||||
"fa-y-combinator-square": "\uf1d4",
|
||||
"fa-y-combinator": "\uf23b",
|
||||
"fa-yahoo": "\uf19e",
|
||||
"fa-yc-square": "\uf1d4",
|
||||
"fa-yc": "\uf23b",
|
||||
"fa-yelp": "\uf1e9",
|
||||
"fa-yoast": "\uf2b1",
|
||||
"fa-youtube-play": "\uf16a",
|
||||
"fa-youtube-square": "\uf166",
|
||||
"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;
|
||||
|
||||
return {
|
||||
getIconUnicode: function(name) {
|
||||
return iconMap[name] || brandIconMap[name];
|
||||
},
|
||||
getIconList: function() {
|
||||
return iconList;
|
||||
},
|
||||
}
|
||||
})();
|
||||
@@ -91,15 +91,12 @@ RED.history = (function() {
|
||||
} else if (ev.t == "delete") {
|
||||
if (ev.workspaces) {
|
||||
for (i=0;i<ev.workspaces.length;i++) {
|
||||
RED.nodes.addWorkspace(ev.workspaces[i],ev.workspaces[i]._index);
|
||||
RED.workspaces.add(ev.workspaces[i],undefined,ev.workspaces[i]._index);
|
||||
delete ev.workspaces[i]._index;
|
||||
RED.nodes.addWorkspace(ev.workspaces[i]);
|
||||
RED.workspaces.add(ev.workspaces[i]);
|
||||
}
|
||||
}
|
||||
if (ev.subflows) {
|
||||
for (i=0;i<ev.subflows.length;i++) {
|
||||
RED.nodes.addSubflow(ev.subflows[i]);
|
||||
}
|
||||
if (ev.subflow && ev.subflow.subflow) {
|
||||
RED.nodes.addSubflow(ev.subflow.subflow);
|
||||
}
|
||||
if (ev.subflowInputs && ev.subflowInputs.length > 0) {
|
||||
subflow = RED.nodes.subflow(ev.subflowInputs[0].z);
|
||||
@@ -296,7 +293,6 @@ RED.history = (function() {
|
||||
});
|
||||
|
||||
RED.nodes.dirty(ev.dirty);
|
||||
RED.view.select(null);
|
||||
RED.view.redraw(true);
|
||||
RED.palette.refresh();
|
||||
RED.workspaces.refresh();
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Trigger enabled/disabled events when element.prop("disabled",false/true) is
|
||||
* called.
|
||||
* Used by RED.popover to hide a popover when the trigger element is disabled
|
||||
* as a disabled element doesn't emit mouseleave
|
||||
*/
|
||||
jQuery.propHooks.disabled = {
|
||||
set: function (element, value) {
|
||||
if (element.disabled !== value) {
|
||||
element.disabled = value;
|
||||
if (value) {
|
||||
$(element).trigger('disabled');
|
||||
} else {
|
||||
$(element).trigger('enabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -14,19 +14,11 @@
|
||||
"ctrl-e": "core:show-export-dialog",
|
||||
"ctrl-i": "core:show-import-dialog",
|
||||
"ctrl-space": "core:toggle-sidebar",
|
||||
"ctrl-p": "core:toggle-palette",
|
||||
"ctrl-,": "core:show-user-settings",
|
||||
"ctrl-alt-r": "core:show-remote-diff",
|
||||
"ctrl-alt-n": "core:new-project",
|
||||
"ctrl-alt-o": "core:open-project",
|
||||
"ctrl-g v": "core:show-version-control-tab",
|
||||
"ctrl-shift-l": "core:show-event-log"
|
||||
},
|
||||
"sidebar-node-config": {
|
||||
"backspace": "core:delete-config-selection",
|
||||
"delete": "core:delete-config-selection",
|
||||
"ctrl-a": "core:select-all-config-nodes",
|
||||
"ctrl-z": "core:undo"
|
||||
"ctrl-g v": "core:show-version-control-tab"
|
||||
},
|
||||
"workspace": {
|
||||
"backspace": "core:delete-selection",
|
||||
|
||||
@@ -174,7 +174,6 @@ RED.nodes = (function() {
|
||||
},
|
||||
setIconSets: function(sets) {
|
||||
iconSets = sets;
|
||||
iconSets["font-awesome"] = RED.nodes.fontAwesome.getIconList();
|
||||
},
|
||||
getIconSets: function() {
|
||||
return iconSets;
|
||||
@@ -298,14 +297,10 @@ RED.nodes = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function addWorkspace(ws,targetIndex) {
|
||||
function addWorkspace(ws) {
|
||||
workspaces[ws.id] = ws;
|
||||
ws._def = RED.nodes.getType('tab');
|
||||
if (targetIndex === undefined) {
|
||||
workspacesOrder.push(ws.id);
|
||||
} else {
|
||||
workspacesOrder.splice(targetIndex,0,ws.id);
|
||||
}
|
||||
workspacesOrder.push(ws.id);
|
||||
}
|
||||
function getWorkspace(id) {
|
||||
return workspaces[id];
|
||||
@@ -513,12 +508,6 @@ RED.nodes = (function() {
|
||||
node.icon = n.icon;
|
||||
}
|
||||
}
|
||||
if ((!n._def.defaults || !n._def.defaults.hasOwnProperty("l")) && n.hasOwnProperty('l')) {
|
||||
var isLink = /^link (in|out)$/.test(node.type);
|
||||
if (isLink == n.l) {
|
||||
node.l = n.l;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (n.info) {
|
||||
node.info = n.info;
|
||||
@@ -653,39 +642,42 @@ RED.nodes = (function() {
|
||||
}
|
||||
|
||||
function checkForMatchingSubflow(subflow,subflowNodes) {
|
||||
subflowNodes = subflowNodes || [];
|
||||
var i;
|
||||
var match = null;
|
||||
RED.nodes.eachSubflow(function(sf) {
|
||||
if (sf.name != subflow.name ||
|
||||
sf.info != subflow.info ||
|
||||
sf.in.length != subflow.in.length ||
|
||||
sf.out.length != subflow.out.length) {
|
||||
try {
|
||||
RED.nodes.eachSubflow(function(sf) {
|
||||
if (sf.name != subflow.name ||
|
||||
sf.info != subflow.info ||
|
||||
sf.in.length != subflow.in.length ||
|
||||
sf.out.length != subflow.out.length) {
|
||||
return;
|
||||
}
|
||||
var sfNodes = RED.nodes.filterNodes({z:sf.id});
|
||||
if (sfNodes.length != subflowNodes.length) {
|
||||
return;
|
||||
}
|
||||
var sfNodes = RED.nodes.filterNodes({z:sf.id});
|
||||
if (sfNodes.length != subflowNodes.length) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var subflowNodeSet = [subflow].concat(subflowNodes);
|
||||
var sfNodeSet = [sf].concat(sfNodes);
|
||||
var subflowNodeSet = [subflow].concat(subflowNodes);
|
||||
var sfNodeSet = [sf].concat(sfNodes);
|
||||
|
||||
var exportableSubflowNodes = JSON.stringify(subflowNodeSet);
|
||||
var exportableSFNodes = JSON.stringify(createExportableNodeSet(sfNodeSet));
|
||||
var nodeMap = {};
|
||||
for (i=0;i<sfNodes.length;i++) {
|
||||
exportableSubflowNodes = exportableSubflowNodes.replace(new RegExp("\""+subflowNodes[i].id+"\"","g"),'"'+sfNodes[i].id+'"');
|
||||
}
|
||||
exportableSubflowNodes = exportableSubflowNodes.replace(new RegExp("\""+subflow.id+"\"","g"),'"'+sf.id+'"');
|
||||
var exportableSubflowNodes = JSON.stringify(subflowNodeSet);
|
||||
var exportableSFNodes = JSON.stringify(createExportableNodeSet(sfNodeSet));
|
||||
var nodeMap = {};
|
||||
for (i=0;i<sfNodes.length;i++) {
|
||||
exportableSubflowNodes = exportableSubflowNodes.replace(new RegExp("\""+subflowNodes[i].id+"\"","g"),'"'+sfNodes[i].id+'"');
|
||||
}
|
||||
exportableSubflowNodes = exportableSubflowNodes.replace(new RegExp("\""+subflow.id+"\"","g"),'"'+sf.id+'"');
|
||||
|
||||
if (exportableSubflowNodes !== exportableSFNodes) {
|
||||
return;
|
||||
}
|
||||
if (exportableSubflowNodes !== exportableSFNodes) {
|
||||
return;
|
||||
}
|
||||
|
||||
match = sf;
|
||||
return false;
|
||||
});
|
||||
match = sf;
|
||||
throw new Error();
|
||||
});
|
||||
} catch(err) {
|
||||
console.log(err.stack);
|
||||
}
|
||||
return match;
|
||||
}
|
||||
function compareNodes(nodeA,nodeB,idMustMatch) {
|
||||
@@ -765,6 +757,7 @@ RED.nodes = (function() {
|
||||
}
|
||||
if (!isInitialLoad && unknownTypes.length > 0) {
|
||||
var typeList = "<ul><li>"+unknownTypes.join("</li><li>")+"</li></ul>";
|
||||
var type = "type"+(unknownTypes.length > 1?"s":"");
|
||||
RED.notify("<p>"+RED._("clipboard.importUnrecognised",{count:unknownTypes.length})+"</p>"+typeList,"error",false,10000);
|
||||
}
|
||||
|
||||
@@ -955,11 +948,11 @@ RED.nodes = (function() {
|
||||
def = registry.getNodeType(n.type);
|
||||
if (!def || def.category != "config") {
|
||||
var node = {
|
||||
x:parseFloat(n.x || 0),
|
||||
y:parseFloat(n.y || 0),
|
||||
x:n.x,
|
||||
y:n.y,
|
||||
z:n.z,
|
||||
type:0,
|
||||
wires:n.wires||[],
|
||||
wires:n.wires,
|
||||
inputLabels: n.inputLabels,
|
||||
outputLabels: n.outputLabels,
|
||||
icon: n.icon,
|
||||
@@ -967,9 +960,6 @@ RED.nodes = (function() {
|
||||
changed:false,
|
||||
_config:{}
|
||||
};
|
||||
if (n.hasOwnProperty('l')) {
|
||||
node.l = n.l;
|
||||
}
|
||||
if (createNewIds) {
|
||||
if (subflow_blacklist[n.z]) {
|
||||
continue;
|
||||
@@ -1382,41 +1372,31 @@ RED.nodes = (function() {
|
||||
|
||||
eachNode: function(cb) {
|
||||
for (var n=0;n<nodes.length;n++) {
|
||||
if (cb(nodes[n]) === false) {
|
||||
break;
|
||||
}
|
||||
cb(nodes[n]);
|
||||
}
|
||||
},
|
||||
eachLink: function(cb) {
|
||||
for (var l=0;l<links.length;l++) {
|
||||
if (cb(links[l]) === false) {
|
||||
break;
|
||||
}
|
||||
cb(links[l]);
|
||||
}
|
||||
},
|
||||
eachConfig: function(cb) {
|
||||
for (var id in configNodes) {
|
||||
if (configNodes.hasOwnProperty(id)) {
|
||||
if (cb(configNodes[id]) === false) {
|
||||
break;
|
||||
}
|
||||
cb(configNodes[id]);
|
||||
}
|
||||
}
|
||||
},
|
||||
eachSubflow: function(cb) {
|
||||
for (var id in subflows) {
|
||||
if (subflows.hasOwnProperty(id)) {
|
||||
if (cb(subflows[id]) === false) {
|
||||
break;
|
||||
}
|
||||
cb(subflows[id]);
|
||||
}
|
||||
}
|
||||
},
|
||||
eachWorkspace: function(cb) {
|
||||
for (var i=0;i<workspacesOrder.length;i++) {
|
||||
if (cb(workspaces[workspacesOrder[i]]) === false) {
|
||||
break;
|
||||
}
|
||||
cb(workspaces[workspacesOrder[i]]);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -398,10 +398,6 @@ var RED = (function() {
|
||||
// Refresh flow library to ensure any examples are updated
|
||||
RED.library.loadFlowLibrary();
|
||||
});
|
||||
RED.comms.subscribe("event-log/#", function(topic,payload) {
|
||||
var id = topic.substring(9);
|
||||
RED.eventLog.log(id,payload);
|
||||
});
|
||||
}
|
||||
|
||||
function showAbout() {
|
||||
@@ -418,10 +414,10 @@ var RED = (function() {
|
||||
function loadEditor() {
|
||||
var menuOptions = [];
|
||||
if (RED.settings.theme("projects.enabled",false)) {
|
||||
menuOptions.push({id:"menu-item-projects-menu",label:RED._("menu.label.projects"),options:[
|
||||
{id:"menu-item-projects-new",label:RED._("menu.label.projects-new"),disabled:false,onselect:"core:new-project"},
|
||||
{id:"menu-item-projects-open",label:RED._("menu.label.projects-open"),disabled:false,onselect:"core:open-project"},
|
||||
{id:"menu-item-projects-settings",label:RED._("menu.label.projects-settings"),disabled:false,onselect:"core:show-project-settings"}
|
||||
menuOptions.push({id:"menu-item-projects-menu",label:"Projects",options:[
|
||||
{id:"menu-item-projects-new",label:"New",disabled:false,onselect:"core:new-project"},
|
||||
{id:"menu-item-projects-open",label:"Open",disabled:false,onselect:"core:open-project"},
|
||||
{id:"menu-item-projects-settings",label:"Project Settings",disabled:false,onselect:"core:show-project-settings"}
|
||||
]});
|
||||
}
|
||||
|
||||
@@ -438,9 +434,7 @@ var RED = (function() {
|
||||
// {id:"menu-item-bidi-auto",toggle:"text-direction",label:RED._("menu.label.view.auto"), onselect:function(s) { if(s){RED.text.bidi.setTextDirection("auto")}}}
|
||||
// ]},
|
||||
// null,
|
||||
{id:"menu-item-palette",label:RED._("menu.label.palette.show"),toggle:true,onselect:"core:toggle-palette", selected: true},
|
||||
{id:"menu-item-sidebar",label:RED._("menu.label.sidebar.show"),toggle:true,onselect:"core:toggle-sidebar", selected: true},
|
||||
{id:"menu-item-event-log",label:RED._("eventLog.title"),onselect:"core:show-event-log"},
|
||||
null
|
||||
]});
|
||||
menuOptions.push(null);
|
||||
@@ -488,7 +482,6 @@ var RED = (function() {
|
||||
RED.library.init();
|
||||
RED.keyboard.init();
|
||||
RED.palette.init();
|
||||
RED.eventLog.init();
|
||||
if (RED.settings.theme('palette.editable') !== false) {
|
||||
RED.palette.editor.init();
|
||||
} else {
|
||||
|
||||
@@ -1242,7 +1242,7 @@ RED.text.format = (function() {
|
||||
element.dispatchEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var range = selection.getRangeAt(0);
|
||||
var tempRange = range.cloneRange(), startNode, startOffset;
|
||||
startNode = range.startContainer;
|
||||
@@ -1304,7 +1304,7 @@ RED.text.format = (function() {
|
||||
}
|
||||
|
||||
return {
|
||||
/*!
|
||||
/**
|
||||
* Returns the HTML representation of a given structured text
|
||||
* @param text - the structured text
|
||||
* @param type - could be one of filepath, url, email
|
||||
@@ -1315,7 +1315,7 @@ RED.text.format = (function() {
|
||||
getHtml: function (text, type, args, isRtl, locale) {
|
||||
return getHandler(type).format(text, args, isRtl, true, locale);
|
||||
},
|
||||
/*!
|
||||
/**
|
||||
* Handle Structured text correct display for a given HTML element.
|
||||
* @param element - the element : should be of type div contenteditable=true
|
||||
* @param type - could be one of filepath, url, email
|
||||
|
||||
@@ -12,9 +12,9 @@ RED.actions = (function() {
|
||||
function getAction(name) {
|
||||
return actions[name];
|
||||
}
|
||||
function invokeAction(name,args) {
|
||||
function invokeAction(name) {
|
||||
if (actions.hasOwnProperty(name)) {
|
||||
actions[name](args);
|
||||
actions[name]();
|
||||
}
|
||||
}
|
||||
function listActions() {
|
||||
|
||||
@@ -22,8 +22,6 @@ RED.clipboard = (function() {
|
||||
var exportNodesDialog;
|
||||
var importNodesDialog;
|
||||
var disabled = false;
|
||||
var popover;
|
||||
var currentPopoverError;
|
||||
|
||||
function setupDialogs() {
|
||||
dialog = $('<div id="clipboard-dialog" class="hide node-red-dialog"><form class="dialog-form form-horizontal"></form></div>')
|
||||
@@ -49,21 +47,6 @@ RED.clipboard = (function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "clipboard-dialog-download",
|
||||
class: "primary",
|
||||
text: RED._("clipboard.download"),
|
||||
click: function() {
|
||||
var element = document.createElement('a');
|
||||
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent($("#clipboard-export").val()));
|
||||
element.setAttribute('download', "flows.json");
|
||||
element.style.display = 'none';
|
||||
document.body.appendChild(element);
|
||||
element.click();
|
||||
document.body.removeChild(element);
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "clipboard-dialog-copy",
|
||||
class: "primary",
|
||||
@@ -90,10 +73,6 @@ RED.clipboard = (function() {
|
||||
$(this).parent().find(".ui-dialog-titlebar-close").hide();
|
||||
},
|
||||
close: function(e) {
|
||||
if (popover) {
|
||||
popover.close(true);
|
||||
currentPopoverError = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -107,7 +86,7 @@ RED.clipboard = (function() {
|
||||
'<a id="export-range-flow" class="editor-button toggle" href="#" data-i18n="clipboard.export.current"></a>'+
|
||||
'<a id="export-range-full" class="editor-button toggle" href="#" data-i18n="clipboard.export.all"></a>'+
|
||||
'</span>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="form-row">'+
|
||||
'<textarea readonly style="resize: none; width: 100%; border-radius: 4px;font-family: monospace; font-size: 12px; background:#f3f3f3; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-export" rows="5"></textarea>'+
|
||||
'</div>'+
|
||||
@@ -118,13 +97,10 @@ RED.clipboard = (function() {
|
||||
'</span>'+
|
||||
'</div>';
|
||||
|
||||
importNodesDialog =
|
||||
'<div class="form-row"><span data-i18n="clipboard.pasteNodes"></span>'+
|
||||
' <a class="editor-button" id="import-file-upload-btn"><i class="fa fa-upload"></i> <span data-i18n="clipboard.selectFile"></span></a>'+
|
||||
'<input type="file" id="import-file-upload" accept=".json" style="display:none">'+
|
||||
'</div>'+
|
||||
'<div class="form-row">'+
|
||||
'<textarea style="resize: none; width: 100%; border-radius: 0px;font-family: monospace; font-size: 12px; background:#eee; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-import" rows="5"></textarea>'+
|
||||
importNodesDialog = '<div class="form-row">'+
|
||||
'<textarea style="resize: none; width: 100%; border-radius: 0px;font-family: monospace; font-size: 12px; background:#eee; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-import" rows="5" placeholder="'+
|
||||
RED._("clipboard.pasteNodes")+
|
||||
'"></textarea>'+
|
||||
'</div>'+
|
||||
'<div class="form-row">'+
|
||||
'<label style="width:auto;margin-right: 10px;" data-i18n="clipboard.import.import"></label>'+
|
||||
@@ -135,98 +111,21 @@ RED.clipboard = (function() {
|
||||
'</div>';
|
||||
}
|
||||
|
||||
var validateImportTimeout;
|
||||
|
||||
function validateImport() {
|
||||
if (validateImportTimeout) {
|
||||
clearTimeout(validateImportTimeout);
|
||||
var importInput = $("#clipboard-import");
|
||||
var v = importInput.val();
|
||||
v = v.substring(v.indexOf('['),v.lastIndexOf(']')+1);
|
||||
try {
|
||||
JSON.parse(v);
|
||||
importInput.removeClass("input-error");
|
||||
importInput.val(v);
|
||||
$("#clipboard-dialog-ok").button("enable");
|
||||
} catch(err) {
|
||||
if (v !== "") {
|
||||
importInput.addClass("input-error");
|
||||
}
|
||||
$("#clipboard-dialog-ok").button("disable");
|
||||
}
|
||||
validateImportTimeout = setTimeout(function() {
|
||||
var importInput = $("#clipboard-import");
|
||||
var v = importInput.val().trim();
|
||||
if (v === "") {
|
||||
popover.close(true);
|
||||
currentPopoverError = null;
|
||||
importInput.removeClass("input-error");
|
||||
$("#clipboard-dialog-ok").button("disable");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!/^\[[\s\S]*\]$/m.test(v)) {
|
||||
throw new Error(RED._("clipboard.import.errors.notArray"));
|
||||
}
|
||||
var res = JSON.parse(v);
|
||||
for (var i=0;i<res.length;i++) {
|
||||
if (typeof res[i] !== "object") {
|
||||
throw new Error(RED._("clipboard.import.errors.itemNotObject",{index:i}));
|
||||
}
|
||||
if (!res[i].hasOwnProperty('id')) {
|
||||
throw new Error(RED._("clipboard.import.errors.missingId",{index:i}));
|
||||
}
|
||||
if (!res[i].hasOwnProperty('type')) {
|
||||
throw new Error(RED._("clipboard.import.errors.missingType",{index:i}));
|
||||
}
|
||||
}
|
||||
currentPopoverError = null;
|
||||
popover.close(true);
|
||||
importInput.removeClass("input-error");
|
||||
importInput.val(v);
|
||||
$("#clipboard-dialog-ok").button("enable");
|
||||
} catch(err) {
|
||||
if (v !== "") {
|
||||
importInput.addClass("input-error");
|
||||
var errString = err.toString();
|
||||
if (errString !== currentPopoverError) {
|
||||
// Display the error as-is.
|
||||
// Error messages are only in English. Each browser has its
|
||||
// own set of messages with very little consistency.
|
||||
// To provide translated messages this code will either need to:
|
||||
// - reduce everything down to 'unexpected token at position x'
|
||||
// which is the least useful, but most consistent message
|
||||
// - use a custom/library parser that gives consistent messages
|
||||
// which can be translated.
|
||||
var message = $('<div class="clipboard-import-error"></div>').text(errString);
|
||||
var errorPos;
|
||||
// Chrome error messages
|
||||
var m = /at position (\d+)/i.exec(errString);
|
||||
if (m) {
|
||||
errorPos = parseInt(m[1]);
|
||||
} else {
|
||||
// Firefox error messages
|
||||
m = /at line (\d+) column (\d+)/i.exec(errString);
|
||||
if (m) {
|
||||
var line = parseInt(m[1])-1;
|
||||
var col = parseInt(m[2])-1;
|
||||
var lines = v.split("\n");
|
||||
errorPos = 0;
|
||||
for (var i=0;i<line;i++) {
|
||||
errorPos += lines[i].length+1;
|
||||
}
|
||||
errorPos += col;
|
||||
} else {
|
||||
// Safari doesn't provide any position information
|
||||
// IE: tbd
|
||||
}
|
||||
}
|
||||
|
||||
if (errorPos !== undefined) {
|
||||
v = v.replace(/\n/g,"↵");
|
||||
var index = parseInt(m[1]);
|
||||
var parseError = $('<div>').appendTo(message);
|
||||
var code = $('<pre>').appendTo(parseError);
|
||||
$('<span>').text(v.substring(errorPos-12,errorPos)).appendTo(code)
|
||||
$('<span class="error">').text(v.charAt(errorPos)).appendTo(code);
|
||||
$('<span>').text(v.substring(errorPos+1,errorPos+12)).appendTo(code);
|
||||
}
|
||||
popover.close(true).setContent(message).open();
|
||||
currentPopoverError = errString;
|
||||
}
|
||||
} else {
|
||||
currentPopoverError = null;
|
||||
}
|
||||
$("#clipboard-dialog-ok").button("disable");
|
||||
}
|
||||
},100);
|
||||
}
|
||||
|
||||
function importNodes() {
|
||||
@@ -241,7 +140,6 @@ RED.clipboard = (function() {
|
||||
$("#clipboard-dialog-cancel").show();
|
||||
$("#clipboard-dialog-close").hide();
|
||||
$("#clipboard-dialog-copy").hide();
|
||||
$("#clipboard-dialog-download").hide();
|
||||
$("#clipboard-dialog-ok").button("disable");
|
||||
$("#clipboard-import").keyup(validateImport);
|
||||
$("#clipboard-import").on('paste',function() { setTimeout(validateImport,10)});
|
||||
@@ -255,26 +153,7 @@ RED.clipboard = (function() {
|
||||
$(this).addClass('selected');
|
||||
});
|
||||
|
||||
$("#import-file-upload").change(function() {
|
||||
var fileReader = new FileReader();
|
||||
fileReader.onload = function () {
|
||||
$("#clipboard-import").val(fileReader.result);
|
||||
validateImport();
|
||||
};
|
||||
fileReader.readAsText($(this).prop('files')[0]);
|
||||
})
|
||||
$("#import-file-upload-btn").click(function(evt) {
|
||||
evt.preventDefault();
|
||||
$("#import-file-upload").click();
|
||||
})
|
||||
|
||||
dialog.dialog("option","title",RED._("clipboard.importNodes")).dialog("open");
|
||||
popover = RED.popover.create({
|
||||
target: $("#clipboard-import"),
|
||||
trigger: "manual",
|
||||
direction: "bottom",
|
||||
content: ""
|
||||
});
|
||||
}
|
||||
|
||||
function exportNodes() {
|
||||
@@ -323,18 +202,9 @@ RED.clipboard = (function() {
|
||||
var flow = "";
|
||||
var nodes = null;
|
||||
if (type === 'export-range-selected') {
|
||||
var selection = RED.workspaces.selection();
|
||||
if (selection.length > 0) {
|
||||
nodes = [];
|
||||
selection.forEach(function(n) {
|
||||
nodes.push(n);
|
||||
nodes = nodes.concat(RED.nodes.filterNodes({z:n.id}));
|
||||
});
|
||||
} else {
|
||||
nodes = RED.view.selection().nodes||[];
|
||||
}
|
||||
var selection = RED.view.selection();
|
||||
// Don't include the subflow meta-port nodes in the exported selection
|
||||
nodes = RED.nodes.createExportableNodeSet(nodes.filter(function(n) { return n.type !== 'subflow'}));
|
||||
nodes = RED.nodes.createExportableNodeSet(selection.nodes.filter(function(n) { return n.type !== 'subflow'}));
|
||||
} else if (type === 'export-range-flow') {
|
||||
var activeWorkspace = RED.workspaces.active();
|
||||
nodes = RED.nodes.filterNodes({z:activeWorkspace});
|
||||
@@ -364,17 +234,12 @@ RED.clipboard = (function() {
|
||||
$("#clipboard-dialog-cancel").hide();
|
||||
$("#clipboard-dialog-copy").hide();
|
||||
$("#clipboard-dialog-close").hide();
|
||||
var selection = RED.workspaces.selection();
|
||||
if (selection.length > 0) {
|
||||
var selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
$("#export-range-selected").click();
|
||||
} else {
|
||||
selection = RED.view.selection();
|
||||
if (selection.nodes) {
|
||||
$("#export-range-selected").click();
|
||||
} else {
|
||||
$("#export-range-selected").addClass('disabled').removeClass('selected');
|
||||
$("#export-range-flow").click();
|
||||
}
|
||||
$("#export-range-selected").addClass('disabled').removeClass('selected');
|
||||
$("#export-range-flow").click();
|
||||
}
|
||||
if (format === "export-format-full") {
|
||||
$("#export-format-full").click();
|
||||
@@ -400,8 +265,6 @@ RED.clipboard = (function() {
|
||||
$("#clipboard-dialog-cancel").show();
|
||||
$("#clipboard-dialog-copy").show();
|
||||
}
|
||||
$("#clipboard-dialog-download").show();
|
||||
|
||||
}
|
||||
|
||||
function hideDropTarget() {
|
||||
|
||||
@@ -32,7 +32,8 @@ RED.panels = (function() {
|
||||
var startPosition;
|
||||
var panelSizes = [];
|
||||
var modifiedSizes = false;
|
||||
var panelRatio = 0.5;
|
||||
var panelRatio;
|
||||
|
||||
separator.draggable({
|
||||
axis: vertical?"y":"x",
|
||||
containment: container,
|
||||
@@ -61,47 +62,31 @@ RED.panels = (function() {
|
||||
if (options.resize) {
|
||||
options.resize(newSizes[0],newSizes[1]);
|
||||
}
|
||||
panelRatio = newSizes[0]/(size-8);
|
||||
panelRatio = newSizes[0]/size;
|
||||
},
|
||||
stop:function(event,ui) {
|
||||
modifiedSizes = true;
|
||||
}
|
||||
});
|
||||
|
||||
var panel = {
|
||||
ratio: function(ratio) {
|
||||
panelRatio = ratio;
|
||||
modifiedSizes = true;
|
||||
if (ratio === 0 || ratio === 1) {
|
||||
separator.hide();
|
||||
} else {
|
||||
separator.show();
|
||||
}
|
||||
if (vertical) {
|
||||
panel.resize(container.height());
|
||||
} else {
|
||||
panel.resize(container.width());
|
||||
}
|
||||
},
|
||||
return {
|
||||
resize: function(size) {
|
||||
var panelSizes;
|
||||
var panelSizes = [$(children[0]).height(),$(children[1]).height()];
|
||||
if (vertical) {
|
||||
panelSizes = [$(children[0]).height(),$(children[1]).height()];
|
||||
container.height(size);
|
||||
} else {
|
||||
panelSizes = [$(children[0]).width(),$(children[1]).width()];
|
||||
container.width(size);
|
||||
}
|
||||
if (modifiedSizes) {
|
||||
var topPanelSize = panelRatio*(size-8);
|
||||
var bottomPanelSize = size - topPanelSize - 8;
|
||||
var topPanelSize = panelRatio*size;
|
||||
var bottomPanelSize = size - topPanelSize - 48;
|
||||
panelSizes = [topPanelSize,bottomPanelSize];
|
||||
if (vertical) {
|
||||
$(children[0]).outerHeight(panelSizes[0]);
|
||||
$(children[1]).outerHeight(panelSizes[1]);
|
||||
$(children[0]).height(panelSizes[0]);
|
||||
$(children[1]).height(panelSizes[1]);
|
||||
} else {
|
||||
$(children[0]).outerWidth(panelSizes[0]);
|
||||
$(children[1]).outerWidth(panelSizes[1]);
|
||||
$(children[0]).width(panelSizes[0]);
|
||||
$(children[1]).width(panelSizes[1]);
|
||||
}
|
||||
}
|
||||
if (options.resize) {
|
||||
@@ -109,7 +94,6 @@ RED.panels = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -18,19 +18,15 @@ RED.popover = (function() {
|
||||
var deltaSizes = {
|
||||
"default": {
|
||||
top: 10,
|
||||
topTop: 30,
|
||||
leftRight: 17,
|
||||
leftLeft: 25,
|
||||
leftBottom: 8,
|
||||
leftTop: 11
|
||||
},
|
||||
"small": {
|
||||
top: 6,
|
||||
topTop: 20,
|
||||
leftRight: 8,
|
||||
leftLeft: 26,
|
||||
leftBottom: 8,
|
||||
leftTop: 9
|
||||
top: 5,
|
||||
leftRight: 17,
|
||||
leftLeft: 16,
|
||||
leftBottom: 3,
|
||||
}
|
||||
}
|
||||
function createPopover(options) {
|
||||
@@ -38,7 +34,7 @@ RED.popover = (function() {
|
||||
var direction = options.direction || "right";
|
||||
var trigger = options.trigger;
|
||||
var content = options.content;
|
||||
var delay = options.delay || { show: 750, hide: 50 };
|
||||
var delay = options.delay;
|
||||
var autoClose = options.autoClose;
|
||||
var width = options.width||"auto";
|
||||
var size = options.size||"default";
|
||||
@@ -52,7 +48,7 @@ RED.popover = (function() {
|
||||
|
||||
var openPopup = function(instant) {
|
||||
if (active) {
|
||||
div = $('<div class="red-ui-popover"></div>');
|
||||
div = $('<div class="red-ui-popover red-ui-popover-'+direction+'"></div>');
|
||||
if (size !== "default") {
|
||||
div.addClass("red-ui-popover-size-"+size);
|
||||
}
|
||||
@@ -79,50 +75,13 @@ RED.popover = (function() {
|
||||
var targetHeight = target.outerHeight();
|
||||
var divHeight = div.height();
|
||||
var divWidth = div.width();
|
||||
|
||||
var viewportTop = $(window).scrollTop();
|
||||
var viewportLeft = $(window).scrollLeft();
|
||||
var viewportBottom = viewportTop + $(window).height();
|
||||
var viewportRight = viewportLeft + $(window).width();
|
||||
var top = 0;
|
||||
var left = 0;
|
||||
var d = direction;
|
||||
if (d === 'right') {
|
||||
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
|
||||
left = targetPos.left+targetWidth+deltaSizes[size].leftRight;
|
||||
} else if (d === 'left') {
|
||||
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
|
||||
left = targetPos.left-deltaSizes[size].leftLeft-divWidth;
|
||||
} else if (d === 'bottom') {
|
||||
top = targetPos.top+targetHeight+deltaSizes[size].top;
|
||||
left = targetPos.left+targetWidth/2-divWidth/2 - deltaSizes[size].leftBottom;
|
||||
if (left < 0) {
|
||||
d = "right";
|
||||
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
|
||||
left = targetPos.left+targetWidth+deltaSizes[size].leftRight;
|
||||
} else if (left+divWidth > viewportRight) {
|
||||
d = "left";
|
||||
top = targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top;
|
||||
left = targetPos.left-deltaSizes[size].leftLeft-divWidth;
|
||||
if (top+divHeight+targetHeight/2 + 5 > viewportBottom) {
|
||||
top -= (top+divHeight+targetHeight/2 - viewportBottom + 5)
|
||||
}
|
||||
} else if (top+divHeight > viewportBottom) {
|
||||
d = 'top';
|
||||
top = targetPos.top-deltaSizes[size].topTop-divHeight;
|
||||
left = targetPos.left+targetWidth/2-divWidth/2 - deltaSizes[size].leftTop;
|
||||
}
|
||||
} else if (d === 'top') {
|
||||
top = targetPos.top-deltaSizes[size].topTop-divHeight;
|
||||
left = targetPos.left+targetWidth/2-divWidth/2 - deltaSizes[size].leftTop;
|
||||
if (top < 0) {
|
||||
d = 'bottom';
|
||||
top = targetPos.top+targetHeight+deltaSizes[size].top;
|
||||
left = targetPos.left+targetWidth/2-divWidth/2 - deltaSizes[size].leftBottom;
|
||||
}
|
||||
if (direction === 'right') {
|
||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top,left:targetPos.left+targetWidth+deltaSizes[size].leftRight});
|
||||
} else if (direction === 'left') {
|
||||
div.css({top: targetPos.top+targetHeight/2-divHeight/2-deltaSizes[size].top,left:targetPos.left-deltaSizes[size].leftLeft-divWidth});
|
||||
} else if (direction === 'bottom') {
|
||||
div.css({top: targetPos.top+targetHeight+deltaSizes[size].top,left:targetPos.left+targetWidth/2-divWidth/2 - deltaSizes[size].leftBottom});
|
||||
}
|
||||
div.addClass('red-ui-popover-'+d).css({top: top, left: left});
|
||||
|
||||
if (instant) {
|
||||
div.show();
|
||||
} else {
|
||||
@@ -131,11 +90,10 @@ RED.popover = (function() {
|
||||
}
|
||||
}
|
||||
var closePopup = function(instant) {
|
||||
$(document).off('mousedown.modal-popover-close');
|
||||
if (!active) {
|
||||
if (div) {
|
||||
if (instant) {
|
||||
div.remove();
|
||||
$(this).remove();
|
||||
} else {
|
||||
div.fadeOut("fast",function() {
|
||||
$(this).remove();
|
||||
@@ -152,14 +110,12 @@ RED.popover = (function() {
|
||||
active = true;
|
||||
timer = setTimeout(openPopup,delay.show);
|
||||
});
|
||||
target.on('mouseleave disabled', function(e) {
|
||||
target.on('mouseleave', function(e) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
if (active) {
|
||||
active = false;
|
||||
setTimeout(closePopup,delay.hide);
|
||||
}
|
||||
active = false;
|
||||
setTimeout(closePopup,delay.hide);
|
||||
});
|
||||
} else if (trigger === 'click') {
|
||||
target.click(function(e) {
|
||||
@@ -172,29 +128,6 @@ RED.popover = (function() {
|
||||
openPopup();
|
||||
}
|
||||
});
|
||||
if (autoClose) {
|
||||
target.on('mouseleave disabled', function(e) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
if (active) {
|
||||
active = false;
|
||||
setTimeout(closePopup,autoClose);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else if (trigger === 'modal') {
|
||||
$(document).on('mousedown.modal-popover-close', function (event) {
|
||||
var target = event.target;
|
||||
while (target.nodeName !== 'BODY' && target !== div[0]) {
|
||||
target = target.parentElement;
|
||||
}
|
||||
if (target.nodeName === 'BODY') {
|
||||
active = false;
|
||||
closePopup();
|
||||
}
|
||||
});
|
||||
} else if (autoClose) {
|
||||
setTimeout(function() {
|
||||
active = false;
|
||||
@@ -223,25 +156,14 @@ RED.popover = (function() {
|
||||
|
||||
return {
|
||||
create: createPopover,
|
||||
tooltip: function(target,content, action) {
|
||||
var label = content;
|
||||
if (action) {
|
||||
label = function() {
|
||||
var label = content;
|
||||
var shortcut = RED.keyboard.getShortcut(action);
|
||||
if (shortcut && shortcut.key) {
|
||||
label = $('<span>'+content+' <span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span></span>');
|
||||
}
|
||||
return label;
|
||||
}
|
||||
}
|
||||
return RED.popover.create({
|
||||
tooltip: function(target,content) {
|
||||
RED.popover.create({
|
||||
target:target,
|
||||
trigger: "hover",
|
||||
size: "small",
|
||||
direction: "bottom",
|
||||
content: label,
|
||||
delay: { show: 750, hide: 50 }
|
||||
content: content,
|
||||
delay: { show: 550, hide: 10 }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,14 +66,6 @@ RED.stack = (function() {
|
||||
}
|
||||
}
|
||||
entry.expand();
|
||||
} else if (entries.length === 2) {
|
||||
if (entries[0] === entry) {
|
||||
entries[0].collapse();
|
||||
entries[1].expand();
|
||||
} else {
|
||||
entries[1].collapse();
|
||||
entries[0].expand();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
entry.toggle();
|
||||
|
||||
@@ -34,42 +34,13 @@ RED.tabs = (function() {
|
||||
if (options.vertical) {
|
||||
wrapper.addClass("red-ui-tabs-vertical");
|
||||
}
|
||||
if (options.addButton) {
|
||||
if (options.addButton && typeof options.addButton === 'function') {
|
||||
wrapper.addClass("red-ui-tabs-add");
|
||||
var addButton = $('<div class="red-ui-tab-button"><a href="#"><i class="fa fa-plus"></i></a></div>').appendTo(wrapper);
|
||||
addButton.find('a').click(function(evt) {
|
||||
evt.preventDefault();
|
||||
if (typeof options.addButton === 'function') {
|
||||
options.addButton();
|
||||
} else if (typeof options.addButton === 'string') {
|
||||
RED.actions.invoke(options.addButton);
|
||||
}
|
||||
options.addButton();
|
||||
})
|
||||
if (typeof options.addButton === 'string') {
|
||||
var l = options.addButton;
|
||||
if (options.addButtonCaption) {
|
||||
l = options.addButtonCaption
|
||||
}
|
||||
RED.popover.tooltip(addButton,l,options.addButton);
|
||||
}
|
||||
ul.on("dblclick", function(evt) {
|
||||
var existingTabs = ul.children();
|
||||
var clickX = evt.clientX;
|
||||
var targetIndex = 0;
|
||||
existingTabs.each(function(index) {
|
||||
var pos = $(this).offset();
|
||||
if (pos.left > clickX) {
|
||||
return false;
|
||||
}
|
||||
targetIndex = index+1;
|
||||
})
|
||||
if (typeof options.addButton === 'function') {
|
||||
options.addButton({index:targetIndex});
|
||||
} else if (typeof options.addButton === 'string') {
|
||||
RED.actions.invoke(options.addButton,{index:targetIndex});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
var scrollLeft;
|
||||
@@ -92,47 +63,45 @@ RED.tabs = (function() {
|
||||
|
||||
var collapsedButtonsRow = $('<div class="red-ui-tab-link-buttons"></div>').appendTo(wrapper);
|
||||
|
||||
if (options.menu !== false) {
|
||||
var selectButton = $('<a href="#"><i class="fa fa-caret-down"></i></a>').appendTo(collapsedButtonsRow);
|
||||
selectButton.addClass("red-ui-tab-link-button-menu")
|
||||
selectButton.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
if (!collapsibleMenu) {
|
||||
var pinnedOptions = [];
|
||||
var options = [];
|
||||
ul.children().each(function(i,el) {
|
||||
var id = $(el).data('tabId');
|
||||
var opt = {
|
||||
id:"red-ui-tabs-menu-option-"+id,
|
||||
icon: tabs[id].iconClass || defaultTabIcon,
|
||||
label: tabs[id].name,
|
||||
onselect: function() {
|
||||
activateTab(id);
|
||||
}
|
||||
};
|
||||
if (tabs[id].pinned) {
|
||||
pinnedOptions.push(opt);
|
||||
} else {
|
||||
options.push(opt);
|
||||
var selectButton = $('<a href="#"><i class="fa fa-caret-down"></i></a>').appendTo(collapsedButtonsRow);
|
||||
selectButton.addClass("red-ui-tab-link-button-menu")
|
||||
selectButton.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
if (!collapsibleMenu) {
|
||||
var pinnedOptions = [];
|
||||
var options = [];
|
||||
ul.children().each(function(i,el) {
|
||||
var id = $(el).data('tabId');
|
||||
var opt = {
|
||||
id:"red-ui-tabs-menu-option-"+id,
|
||||
icon: tabs[id].iconClass || defaultTabIcon,
|
||||
label: tabs[id].name,
|
||||
onselect: function() {
|
||||
activateTab(id);
|
||||
}
|
||||
});
|
||||
options = pinnedOptions.concat(options);
|
||||
collapsibleMenu = RED.menu.init({id:"debug-message-option-menu",options: options});
|
||||
collapsibleMenu.css({
|
||||
position: "absolute"
|
||||
})
|
||||
collapsibleMenu.on('mouseleave', function(){ $(this).hide() });
|
||||
collapsibleMenu.on('mouseup', function() { $(this).hide() });
|
||||
collapsibleMenu.appendTo("body");
|
||||
}
|
||||
var elementPos = selectButton.offset();
|
||||
};
|
||||
if (tabs[id].pinned) {
|
||||
pinnedOptions.push(opt);
|
||||
} else {
|
||||
options.push(opt);
|
||||
}
|
||||
});
|
||||
options = pinnedOptions.concat(options);
|
||||
collapsibleMenu = RED.menu.init({id:"debug-message-option-menu",options: options});
|
||||
collapsibleMenu.css({
|
||||
top: (elementPos.top+selectButton.height()-20)+"px",
|
||||
left: (elementPos.left - collapsibleMenu.width() + selectButton.width())+"px"
|
||||
position: "absolute"
|
||||
})
|
||||
collapsibleMenu.toggle();
|
||||
collapsibleMenu.on('mouseleave', function(){ $(this).hide() });
|
||||
collapsibleMenu.on('mouseup', function() { $(this).hide() });
|
||||
collapsibleMenu.appendTo("body");
|
||||
}
|
||||
var elementPos = selectButton.offset();
|
||||
collapsibleMenu.css({
|
||||
top: (elementPos.top+selectButton.height()-20)+"px",
|
||||
left: (elementPos.left - collapsibleMenu.width() + selectButton.width())+"px"
|
||||
})
|
||||
}
|
||||
collapsibleMenu.toggle();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -161,86 +130,11 @@ RED.tabs = (function() {
|
||||
ul.children().first().addClass("active");
|
||||
ul.children().addClass("red-ui-tab");
|
||||
|
||||
function getSelection() {
|
||||
var selection = ul.find("li.red-ui-tab.selected");
|
||||
var selectedTabs = [];
|
||||
selection.each(function() {
|
||||
selectedTabs.push(tabs[$(this).find('a').attr('href').slice(1)])
|
||||
})
|
||||
return selectedTabs;
|
||||
}
|
||||
|
||||
function selectionChanged() {
|
||||
options.onselect(getSelection());
|
||||
}
|
||||
|
||||
function onTabClick(evt) {
|
||||
evt.preventDefault();
|
||||
var currentTab = ul.find("li.red-ui-tab.active");
|
||||
var thisTab = $(this).parent();
|
||||
var fireSelectionChanged = false;
|
||||
if (options.onselect) {
|
||||
if (evt.metaKey) {
|
||||
if (thisTab.hasClass("selected")) {
|
||||
thisTab.removeClass("selected");
|
||||
if (thisTab[0] !== currentTab[0]) {
|
||||
// Deselect background tab
|
||||
// - don't switch to it
|
||||
selectionChanged();
|
||||
return;
|
||||
} else {
|
||||
// Deselect current tab
|
||||
// - if nothing remains selected, do nothing
|
||||
// - otherwise switch to first selected tab
|
||||
var selection = ul.find("li.red-ui-tab.selected");
|
||||
if (selection.length === 0) {
|
||||
selectionChanged();
|
||||
return;
|
||||
}
|
||||
thisTab = selection.first();
|
||||
}
|
||||
} else {
|
||||
if (!currentTab.hasClass("selected")) {
|
||||
var currentTabObj = tabs[currentTab.find('a').attr('href').slice(1)];
|
||||
// Auto select current tab
|
||||
currentTab.addClass("selected");
|
||||
}
|
||||
thisTab.addClass("selected");
|
||||
}
|
||||
fireSelectionChanged = true;
|
||||
} else if (evt.shiftKey) {
|
||||
if (currentTab[0] !== thisTab[0]) {
|
||||
var firstTab,lastTab;
|
||||
if (currentTab.index() < thisTab.index()) {
|
||||
firstTab = currentTab;
|
||||
lastTab = thisTab;
|
||||
} else {
|
||||
firstTab = thisTab;
|
||||
lastTab = currentTab;
|
||||
}
|
||||
ul.find("li.red-ui-tab").removeClass("selected");
|
||||
firstTab.addClass("selected");
|
||||
lastTab.addClass("selected");
|
||||
firstTab.nextUntil(lastTab).addClass("selected");
|
||||
}
|
||||
fireSelectionChanged = true;
|
||||
} else {
|
||||
var selection = ul.find("li.red-ui-tab.selected");
|
||||
if (selection.length > 0) {
|
||||
selection.removeClass("selected");
|
||||
fireSelectionChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var thisTabA = thisTab.find("a");
|
||||
function onTabClick() {
|
||||
if (options.onclick) {
|
||||
options.onclick(tabs[thisTabA.attr('href').slice(1)]);
|
||||
}
|
||||
activateTab(thisTabA);
|
||||
if (fireSelectionChanged) {
|
||||
selectionChanged();
|
||||
options.onclick(tabs[$(this).attr('href').slice(1)]);
|
||||
}
|
||||
activateTab($(this));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -261,12 +155,7 @@ RED.tabs = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
function onTabDblClick(evt) {
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
if (evt.metaKey || evt.shiftKey) {
|
||||
return;
|
||||
}
|
||||
function onTabDblClick() {
|
||||
if (options.ondblclick) {
|
||||
options.ondblclick(tabs[$(this).attr('href').slice(1)]);
|
||||
}
|
||||
@@ -368,23 +257,23 @@ RED.tabs = (function() {
|
||||
currentActiveTabWidth = 0;
|
||||
}
|
||||
}
|
||||
// if (options.collapsible) {
|
||||
// console.log(currentTabWidth);
|
||||
// }
|
||||
if (options.collapsible) {
|
||||
console.log(currentTabWidth);
|
||||
}
|
||||
|
||||
tabs.css({width:currentTabWidth});
|
||||
if (tabWidth < 50) {
|
||||
// ul.find(".red-ui-tab-close").hide();
|
||||
ul.find(".red-ui-tab-close").hide();
|
||||
ul.find(".red-ui-tab-icon").hide();
|
||||
ul.find(".red-ui-tab-label").css({paddingLeft:Math.min(12,Math.max(0,tabWidth-38))+"px"})
|
||||
} else {
|
||||
// ul.find(".red-ui-tab-close").show();
|
||||
ul.find(".red-ui-tab-close").show();
|
||||
ul.find(".red-ui-tab-icon").show();
|
||||
ul.find(".red-ui-tab-label").css({paddingLeft:""})
|
||||
}
|
||||
if (currentActiveTabWidth !== 0) {
|
||||
ul.find("li.red-ui-tab.active").css({"width":options.minimumActiveTabWidth});
|
||||
// ul.find("li.red-ui-tab.active .red-ui-tab-close").show();
|
||||
ul.find("li.red-ui-tab.active .red-ui-tab-close").show();
|
||||
ul.find("li.red-ui-tab.active .red-ui-tab-icon").show();
|
||||
ul.find("li.red-ui-tab.active .red-ui-tab-label").css({paddingLeft:""})
|
||||
}
|
||||
@@ -399,13 +288,6 @@ RED.tabs = (function() {
|
||||
|
||||
|
||||
function removeTab(id) {
|
||||
if (options.onselect) {
|
||||
var selection = ul.find("li.red-ui-tab.selected");
|
||||
if (selection.length > 0) {
|
||||
selection.removeClass("selected");
|
||||
selectionChanged();
|
||||
}
|
||||
}
|
||||
var li = ul.find("a[href='#"+id+"']").parent();
|
||||
if (li.hasClass("active")) {
|
||||
var tab = li.prev();
|
||||
@@ -427,26 +309,9 @@ RED.tabs = (function() {
|
||||
}
|
||||
|
||||
return {
|
||||
addTab: function(tab,targetIndex) {
|
||||
if (options.onselect) {
|
||||
var selection = ul.find("li.red-ui-tab.selected");
|
||||
if (selection.length > 0) {
|
||||
selection.removeClass("selected");
|
||||
selectionChanged();
|
||||
}
|
||||
}
|
||||
addTab: function(tab) {
|
||||
tabs[tab.id] = tab;
|
||||
var li = $("<li/>",{class:"red-ui-tab"});
|
||||
if (ul.children().length === 0) {
|
||||
targetIndex = undefined;
|
||||
}
|
||||
if (targetIndex === 0) {
|
||||
li.prependTo(ul);
|
||||
} else if (targetIndex > 0) {
|
||||
li.insertAfter(ul.find("li:nth-child("+(targetIndex)+")"));
|
||||
} else {
|
||||
li.appendTo(ul);
|
||||
}
|
||||
var li = $("<li/>",{class:"red-ui-tab"}).appendTo(ul);
|
||||
li.attr('id',"red-ui-tab-"+(tab.id.replace(".","-")));
|
||||
li.data("tabId",tab.id);
|
||||
|
||||
@@ -471,11 +336,7 @@ RED.tabs = (function() {
|
||||
pinnedLink.insertAfter(collapsedButtonsRow.find("a.red-ui-tab-link-button-pinned:last"));
|
||||
}
|
||||
} else {
|
||||
if (options.menu !== false) {
|
||||
pinnedLink.insertBefore(collapsedButtonsRow.find("a:last"));
|
||||
} else {
|
||||
pinnedLink.appendTo(collapsedButtonsRow);
|
||||
}
|
||||
pinnedLink.insertBefore(collapsedButtonsRow.find("a:last"));
|
||||
}
|
||||
|
||||
pinnedLink.attr('id',li.attr('id')+"-link-button");
|
||||
@@ -492,28 +353,20 @@ RED.tabs = (function() {
|
||||
pinnedLink.addClass("red-ui-tab-link-button-pinned");
|
||||
pinnedTabsCount++;
|
||||
}
|
||||
RED.popover.tooltip($(pinnedLink), tab.name, tab.action);
|
||||
RED.popover.tooltip($(pinnedLink), tab.name);
|
||||
|
||||
}
|
||||
link.on("click",onTabClick);
|
||||
link.on("dblclick",onTabDblClick);
|
||||
|
||||
|
||||
if (tab.closeable) {
|
||||
li.addClass("red-ui-tabs-closeable")
|
||||
var closeLink = $("<a/>",{href:"#",class:"red-ui-tab-close"}).appendTo(li);
|
||||
closeLink.append('<i class="fa fa-times" />');
|
||||
|
||||
closeLink.on("click",function(event) {
|
||||
event.preventDefault();
|
||||
removeTab(tab.id);
|
||||
});
|
||||
}
|
||||
|
||||
var badges = $('<span class="red-ui-tabs-badges"></span>').appendTo(li);
|
||||
if (options.onselect) {
|
||||
$('<i class="red-ui-tabs-badge-changed fa fa-circle"></i>').appendTo(badges);
|
||||
$('<i class="red-ui-tabs-badge-selected fa fa-check-circle"></i>').appendTo(badges);
|
||||
}
|
||||
if (options.onadd) {
|
||||
options.onadd(tab);
|
||||
}
|
||||
@@ -621,7 +474,6 @@ RED.tabs = (function() {
|
||||
tab.find("span.bidiAware").text(label).attr('dir', RED.text.bidi.resolveBaseTextDir(label));
|
||||
updateTabWidths();
|
||||
},
|
||||
selection: getSelection,
|
||||
order: function(order) {
|
||||
var existingTabOrder = $.makeArray(ul.children().map(function() { return $(this).data('tabId');}));
|
||||
if (existingTabOrder.length !== order.length) {
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* options:
|
||||
* - data : array - initial items to display in tree
|
||||
*
|
||||
* methods:
|
||||
* - data(items) - clears existing items and replaces with new data
|
||||
*
|
||||
* events:
|
||||
* - treelistselect : function(event, item) {}
|
||||
*
|
||||
*
|
||||
* data:
|
||||
* [
|
||||
* {
|
||||
* label: 'Local', // label for the item
|
||||
* icon: 'fa fa-rocket', // (optional) icon for the item
|
||||
* selected: true/false, // (optional) if present, display checkbox accordingly
|
||||
* children: [] | function(done) // (optional) an array of child items, or a function
|
||||
* // that will call the `done` callback with an array
|
||||
* // of child items
|
||||
* }
|
||||
* ]
|
||||
*
|
||||
*
|
||||
*
|
||||
* var treeList = $("<div>").css({width: "100%", height: "100%"}).treeList({data:[...]})
|
||||
* treeList.on('treelistselect', function(e,item) { console.log(item)})
|
||||
* treeList.treeList('data',[ ... ] )
|
||||
*
|
||||
*/
|
||||
|
||||
$.widget( "nodered.treeList", {
|
||||
_create: function() {
|
||||
var that = this;
|
||||
|
||||
this.element.addClass('red-ui-treeList');
|
||||
var wrapper = $('<div>',{class:'red-ui-treeList-container'}).appendTo(this.element);
|
||||
|
||||
this._data = [];
|
||||
|
||||
this._topList = $('<ol>').css({
|
||||
position:'absolute',
|
||||
top: 0,
|
||||
left:0,
|
||||
right:0,
|
||||
bottom:0
|
||||
}).appendTo(wrapper).editableList({
|
||||
addButton: false,
|
||||
scrollOnAdd: false,
|
||||
height: '100%',
|
||||
addItem: function(container,i,item) {
|
||||
that._addSubtree(container,item,0);
|
||||
}
|
||||
});
|
||||
if (this.options.data) {
|
||||
this.data(this.options.data);
|
||||
}
|
||||
},
|
||||
_addChildren: function(container,children,depth) {
|
||||
var that = this;
|
||||
var subtree = $('<ol>').appendTo(container).editableList({
|
||||
addButton: false,
|
||||
scrollOnAdd: false,
|
||||
height: 'auto',
|
||||
addItem: function(container,i,item) {
|
||||
that._addSubtree(container,item,depth+1);
|
||||
}
|
||||
});
|
||||
for (var i=0;i<children.length;i++) {
|
||||
subtree.editableList('addItem',children[i])
|
||||
}
|
||||
},
|
||||
_addSubtree: function(container, item, depth) {
|
||||
var that = this;
|
||||
var labelNodeType = "<label>";
|
||||
if (item.children && item.hasOwnProperty('selected')) {
|
||||
labelNodeType = "<div>";
|
||||
}
|
||||
var label = $(labelNodeType,{tabindex:"0",class:"red-ui-treeList-label"}).appendTo(container);
|
||||
if (item.class) {
|
||||
label.addClass(item.class);
|
||||
}
|
||||
label.css({
|
||||
paddingLeft: (depth*15)+'px'
|
||||
})
|
||||
label.on('mouseover',function(e) { that._trigger('itemmouseover',e,item); })
|
||||
label.on('mouseout',function(e) { that._trigger('itemmouseout',e,item); })
|
||||
|
||||
if (item.children) {
|
||||
$('<span class="red-ui-treeList-icon"><i class="fa fa-angle-right" /></span>').appendTo(label);
|
||||
// $('<span class="red-ui-treeList-icon"><i class="fa fa-folder-o" /></span>').appendTo(label);
|
||||
label.click(function(e) {
|
||||
if (!container.hasClass("built") && typeof item.children === 'function') {
|
||||
container.addClass('built');
|
||||
var childrenAdded = false;
|
||||
var spinner;
|
||||
item.children(function(children) {
|
||||
childrenAdded = true;
|
||||
that._addChildren(container,children,depth);
|
||||
if (spinner) {
|
||||
spinner.remove();
|
||||
}
|
||||
});
|
||||
if (!childrenAdded) {
|
||||
spinner = $('<div class="red-ui-treeList-spinner">').css({
|
||||
"background-position": (35+depth*15)+'px 50%'
|
||||
}).appendTo(container);
|
||||
}
|
||||
|
||||
}
|
||||
container.toggleClass("expanded");
|
||||
})
|
||||
} else {
|
||||
$('<span class="red-ui-treeList-icon"></span>').appendTo(label);
|
||||
}
|
||||
if (item.hasOwnProperty('selected')) {
|
||||
var selectWrapper = $('<span class="red-ui-treeList-icon"></span>').appendTo(label);
|
||||
var cb = $('<input type="checkbox">').prop('checked',item.selected).appendTo(selectWrapper);
|
||||
cb.on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
cb.on('change', function(e) {
|
||||
item.selected = this.checked;
|
||||
that._trigger("select",e,item);
|
||||
})
|
||||
} else if (!item.children) {
|
||||
label.click(function(e) {
|
||||
that._trigger("select",e,item)
|
||||
})
|
||||
}
|
||||
if (item.icon) {
|
||||
$('<span class="red-ui-treeList-icon"><i class="'+item.icon+'" /></span>').appendTo(label);
|
||||
}
|
||||
$('<span class="red-ui-treeList-label-text"></span>').html(item.label).appendTo(label);
|
||||
if (item.children) {
|
||||
if (Array.isArray(item.children)) {
|
||||
that._addChildren(container,item.children,depth);
|
||||
}
|
||||
if (item.expanded) {
|
||||
label.click();
|
||||
}
|
||||
}
|
||||
},
|
||||
empty: function() {
|
||||
this._topList.editableList('empty');
|
||||
},
|
||||
data: function(items) {
|
||||
if (items !== undefined) {
|
||||
this._data = items;
|
||||
this._topList.editableList('empty');
|
||||
for (var i=0; i<items.length;i++) {
|
||||
this._topList.editableList('addItem',items[i]);
|
||||
}
|
||||
} else {
|
||||
return this._data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -537,10 +537,6 @@
|
||||
} else {
|
||||
this.selectLabel.text(opt.label);
|
||||
}
|
||||
if (this.optionMenu) {
|
||||
this.optionMenu.remove();
|
||||
this.optionMenu = null;
|
||||
}
|
||||
if (opt.options) {
|
||||
if (this.optionExpandButton) {
|
||||
this.optionExpandButton.hide();
|
||||
@@ -631,6 +627,10 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.optionMenu) {
|
||||
this.optionMenu.remove();
|
||||
this.optionMenu = null;
|
||||
}
|
||||
if (this.optionSelectTrigger) {
|
||||
this.optionSelectTrigger.hide();
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ RED.deploy = (function() {
|
||||
|
||||
var unusedConfigNodes = [];
|
||||
RED.nodes.eachConfig(function(node) {
|
||||
if ((node._def.hasUsers !== false) && (node.users.length === 0)) {
|
||||
if (node.users.length === 0 && (node._def.hasUsers !== false)) {
|
||||
unusedConfigNodes.push(getNodeInfo(node));
|
||||
hasUnusedConfig = true;
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ RED.diff = (function() {
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, false);
|
||||
$('<div/>',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
|
||||
|
||||
return nodeDiv;
|
||||
}
|
||||
@@ -687,7 +687,8 @@ RED.diff = (function() {
|
||||
diff: remoteDiff
|
||||
}
|
||||
}
|
||||
|
||||
createNodePropertiesTable(def,node,localNode,remoteNode).appendTo(div);
|
||||
|
||||
var selectState = "";
|
||||
|
||||
if (conflicted) {
|
||||
@@ -706,10 +707,6 @@ RED.diff = (function() {
|
||||
createNodeConflictRadioBoxes(node,div,localNodeDiv,remoteNodeDiv,false,!conflicted,selectState,CurrentDiff);
|
||||
row.click(function(evt) {
|
||||
$(this).parent().toggleClass('collapsed');
|
||||
|
||||
if($(this).siblings('.node-diff-node-entry-properties').length === 0) {
|
||||
createNodePropertiesTable(def,node,localNode,remoteNode).appendTo(div);
|
||||
}
|
||||
});
|
||||
|
||||
return div;
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* @namespace RED.editor
|
||||
*/
|
||||
RED.editor = (function() {
|
||||
|
||||
|
||||
@@ -25,8 +21,6 @@ RED.editor = (function() {
|
||||
var editing_config_node = null;
|
||||
var subflowEditor;
|
||||
|
||||
var customEditTypes = {};
|
||||
|
||||
var editTrayWidthCache = {};
|
||||
|
||||
function getCredentialsURL(nodeType, nodeID) {
|
||||
@@ -130,9 +124,6 @@ RED.editor = (function() {
|
||||
if (/^\$\([a-zA-Z_][a-zA-Z0-9_]*\)$/.test(value)) {
|
||||
return true;
|
||||
}
|
||||
if (/^\$\{[a-zA-Z_][a-zA-Z0-9_]*\}$/.test(value)) {
|
||||
return true;
|
||||
}
|
||||
if ("required" in definition[property] && definition[property].required) {
|
||||
valid = value !== "";
|
||||
}
|
||||
@@ -578,13 +569,7 @@ RED.editor = (function() {
|
||||
var inputsDiv = $("#node-label-form-inputs");
|
||||
var outputsDiv = $("#node-label-form-outputs");
|
||||
|
||||
var inputCount;
|
||||
if (node.type === 'subflow') {
|
||||
inputCount = node.in.length;
|
||||
} else {
|
||||
inputCount = node.inputs || node._def.inputs || 0;
|
||||
}
|
||||
|
||||
var inputCount = node.inputs || node._def.inputs || 0;
|
||||
var children = inputsDiv.children();
|
||||
var childCount = children.length;
|
||||
if (childCount === 1 && $(children[0]).hasClass('node-label-form-none')) {
|
||||
@@ -603,7 +588,7 @@ RED.editor = (function() {
|
||||
for (i=inputCount;i<childCount;i++) {
|
||||
$(children[i]).remove();
|
||||
}
|
||||
if (inputCount === 0) {
|
||||
if (outputCount === 0) {
|
||||
buildLabelRow().appendTo(inputsDiv);
|
||||
}
|
||||
}
|
||||
@@ -613,11 +598,7 @@ RED.editor = (function() {
|
||||
var formOutputs = $("#node-input-outputs").val();
|
||||
|
||||
if (formOutputs === undefined) {
|
||||
if (node.type === 'subflow') {
|
||||
outputCount = node.out.length;
|
||||
} else {
|
||||
inputCount = node.outputs || node._def.outputs || 0;
|
||||
}
|
||||
outputCount = node.outputs || node._def.outputs || 0;
|
||||
} else if (isNaN(formOutputs)) {
|
||||
var outputMap = JSON.parse(formOutputs);
|
||||
var keys = Object.keys(outputMap);
|
||||
@@ -765,11 +746,11 @@ RED.editor = (function() {
|
||||
var iconDiv = $('<div>',{class:"red-ui-icon-list-icon"}).appendTo(iconList);
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(iconDiv);
|
||||
var colour = RED.utils.getNodeColor(node.type, node._def);
|
||||
var icon_url = RED.settings.apiRootUrl+"icons/"+moduleName+"/"+icon;
|
||||
iconDiv.data('icon',icon_url);
|
||||
var icon_url = "icons/"+moduleName+"/"+icon;
|
||||
iconDiv.data('icon',icon_url)
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
$('<div/>',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
|
||||
|
||||
if (iconPath.module === moduleName && iconPath.file === icon) {
|
||||
iconDiv.addClass("selected");
|
||||
@@ -794,73 +775,6 @@ RED.editor = (function() {
|
||||
function buildAppearanceForm(container,node) {
|
||||
var dialogForm = $('<form class="dialog-form form-horizontal" autocomplete="off"></form>').appendTo(container);
|
||||
|
||||
var i,row;
|
||||
|
||||
$('<div class="form-row">'+
|
||||
'<label for="node-input-show-label-btn" data-i18n="editor.label"></label>'+
|
||||
'<button id="node-input-show-label-btn" class="editor-button" style="min-width: 80px; text-align: left;" type="button"><i id="node-input-show-label-btn-i" class="fa fa-toggle-on"></i> <span id="node-input-show-label-label"></span></button> '+
|
||||
'<input type="checkbox" id="node-input-show-label" style="display: none;"/>'+
|
||||
'</div>').appendTo(dialogForm);
|
||||
|
||||
var setToggleState = function(state) {
|
||||
var i = $("#node-input-show-label-btn-i");
|
||||
if (!state) {
|
||||
i.addClass('fa-toggle-off');
|
||||
i.removeClass('fa-toggle-on');
|
||||
$("#node-input-show-label").prop("checked",false);
|
||||
$("#node-input-show-label-label").text(RED._("editor.hide"));
|
||||
} else {
|
||||
i.addClass('fa-toggle-on');
|
||||
i.removeClass('fa-toggle-off');
|
||||
$("#node-input-show-label").prop("checked",true);
|
||||
$("#node-input-show-label-label").text(RED._("editor.show"));
|
||||
}
|
||||
}
|
||||
dialogForm.find('#node-input-show-label-btn').on("click",function(e) {
|
||||
e.preventDefault();
|
||||
var i = $("#node-input-show-label-btn-i");
|
||||
setToggleState(i.hasClass('fa-toggle-off'));
|
||||
})
|
||||
if (!node.hasOwnProperty("l")) {
|
||||
// Show label if type not link
|
||||
node.l = !/^link (in|out)$/.test(node._def.type);
|
||||
}
|
||||
setToggleState(node.l);
|
||||
|
||||
// If a node has icon property in defaults, the icon of the node cannot be modified. (e.g, ui_button node in dashboard)
|
||||
if ((!node._def.defaults || !node._def.defaults.hasOwnProperty("icon"))) {
|
||||
var iconRow = $('<div class="form-row"></div>').appendTo(dialogForm);
|
||||
$('<label data-i18n="editor.settingIcon">').appendTo(iconRow);
|
||||
|
||||
var iconButton = $('<button class="editor-button" id="node-settings-icon-button">').appendTo(iconRow);
|
||||
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(iconButton);
|
||||
var colour = RED.utils.getNodeColor(node.type, node._def);
|
||||
var icon_url = RED.utils.getNodeIcon(node._def,node);
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
|
||||
iconButton.click(function(e) {
|
||||
e.preventDefault();
|
||||
var iconPath;
|
||||
var icon = $("#node-settings-icon").text()||"";
|
||||
if (icon) {
|
||||
iconPath = RED.utils.separateIconPath(icon);
|
||||
} else {
|
||||
iconPath = RED.utils.getDefaultNodeIcon(node._def, node);
|
||||
}
|
||||
showIconPicker(iconRow,node,iconPath,function(newIcon) {
|
||||
$("#node-settings-icon").text(newIcon||"");
|
||||
var icon_url = RED.utils.getNodeIcon(node._def,{type:node.type,icon:newIcon});
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
});
|
||||
});
|
||||
$('<div id="node-settings-icon">').text(node.icon).appendTo(iconButton);
|
||||
}
|
||||
|
||||
$('<div class="form-row"><span data-i18n="editor.portLabels"></span></div>').appendTo(dialogForm);
|
||||
|
||||
var inputCount = node.inputs || node._def.inputs || 0;
|
||||
var outputCount = node.outputs || node._def.outputs || 0;
|
||||
if (node.type === 'subflow') {
|
||||
@@ -874,7 +788,8 @@ RED.editor = (function() {
|
||||
var inputPlaceholder = node._def.inputLabels?RED._("editor.defaultLabel"):RED._("editor.noDefaultLabel");
|
||||
var outputPlaceholder = node._def.outputLabels?RED._("editor.defaultLabel"):RED._("editor.noDefaultLabel");
|
||||
|
||||
$('<div class="form-row"><span style="margin-left: 50px;" data-i18n="editor.labelInputs"></span><div id="node-label-form-inputs"></div></div>').appendTo(dialogForm);
|
||||
var i,row;
|
||||
$('<div class="form-row"><span data-i18n="editor.labelInputs"></span><div id="node-label-form-inputs"></div></div>').appendTo(dialogForm);
|
||||
var inputsDiv = $("#node-label-form-inputs");
|
||||
if (inputCount > 0) {
|
||||
for (i=0;i<inputCount;i++) {
|
||||
@@ -883,7 +798,7 @@ RED.editor = (function() {
|
||||
} else {
|
||||
buildLabelRow().appendTo(inputsDiv);
|
||||
}
|
||||
$('<div class="form-row"><span style="margin-left: 50px;" data-i18n="editor.labelOutputs"></span><div id="node-label-form-outputs"></div></div>').appendTo(dialogForm);
|
||||
$('<div class="form-row"><span data-i18n="editor.labelOutputs"></span><div id="node-label-form-outputs"></div></div>').appendTo(dialogForm);
|
||||
var outputsDiv = $("#node-label-form-outputs");
|
||||
if (outputCount > 0) {
|
||||
for (i=0;i<outputCount;i++) {
|
||||
@@ -892,6 +807,38 @@ RED.editor = (function() {
|
||||
} else {
|
||||
buildLabelRow().appendTo(outputsDiv);
|
||||
}
|
||||
|
||||
if ((!node._def.defaults || !node._def.defaults.hasOwnProperty("icon"))) {
|
||||
$('<hr>').appendTo(dialogForm);
|
||||
var iconRow = $('<div class="form-row"></div>').appendTo(dialogForm);
|
||||
$('<label style="width: 50px" data-i18n="editor.settingIcon">').appendTo(iconRow);
|
||||
|
||||
var iconButton = $('<button class="editor-button">').appendTo(iconRow);
|
||||
|
||||
var nodeDiv = $('<div>',{class:"red-ui-search-result-node"}).appendTo(iconButton);
|
||||
var colour = RED.utils.getNodeColor(node.type, node._def);
|
||||
var icon_url = RED.utils.getNodeIcon(node._def,node);
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"}).appendTo(nodeDiv);
|
||||
var iconDiv = $('<div/>',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
|
||||
|
||||
iconButton.click(function(e) {
|
||||
e.preventDefault();
|
||||
var iconPath;
|
||||
var icon = $("#node-settings-icon").text()||"";
|
||||
if (icon) {
|
||||
iconPath = RED.utils.separateIconPath(icon);
|
||||
} else {
|
||||
iconPath = RED.utils.getDefaultNodeIcon(node._def, node);
|
||||
}
|
||||
showIconPicker(iconRow,node,iconPath,function(newIcon) {
|
||||
$("#node-settings-icon").text(newIcon||"");
|
||||
var icon_url = RED.utils.getNodeIcon(node._def,{type:node.type,icon:newIcon});
|
||||
iconDiv.css("backgroundImage","url("+icon_url+")");
|
||||
});
|
||||
})
|
||||
$('<div class="uneditable-input" id="node-settings-icon">').text(node.icon).appendTo(iconRow);
|
||||
}
|
||||
}
|
||||
|
||||
function updateLabels(editing_node, changes, outputMap) {
|
||||
@@ -937,9 +884,9 @@ RED.editor = (function() {
|
||||
|
||||
function buildDescriptionForm(container,node) {
|
||||
var dialogForm = $('<form class="dialog-form form-horizontal" autocomplete="off"></form>').appendTo(container);
|
||||
var toolbarRow = $('<div></div>').appendTo(dialogForm);
|
||||
var row = $('<div class="form-row node-text-editor-row" style="position:relative; padding-top: 4px; height: 100%"></div>').appendTo(dialogForm);
|
||||
$('<div style="height: 100%" class="node-text-editor" id="node-info-input-info-editor" ></div>').appendTo(row);
|
||||
$('<div style="position: absolute; right:0; bottom:100%;"><button id="node-info-input-info-expand" class="editor-button editor-button-small"><i class="fa fa-expand"></i></button></div>').appendTo(row);
|
||||
$('<div style="height: 100%;" class="node-text-editor" id="node-info-input-info-editor" ></div>').appendTo(row);
|
||||
var nodeInfoEditor = RED.editor.createEditor({
|
||||
id: "node-info-input-info-editor",
|
||||
mode: 'ace/mode/markdown',
|
||||
@@ -948,6 +895,23 @@ RED.editor = (function() {
|
||||
if (node.info) {
|
||||
nodeInfoEditor.getSession().setValue(node.info, -1);
|
||||
}
|
||||
|
||||
$('#node-info-input-info-expand').click(function(e) {
|
||||
e.preventDefault();
|
||||
var value = nodeInfoEditor.getValue();
|
||||
RED.editor.editMarkdown({
|
||||
value: value,
|
||||
width: "Infinity",
|
||||
cursor: nodeInfoEditor.getCursorPosition(),
|
||||
complete: function(v,cursor) {
|
||||
nodeInfoEditor.setValue(v, -1);
|
||||
nodeInfoEditor.gotoLine(cursor.row+1,cursor.column,false);
|
||||
setTimeout(function() {
|
||||
nodeInfoEditor.focus();
|
||||
},300);
|
||||
}
|
||||
})
|
||||
});
|
||||
return nodeInfoEditor;
|
||||
}
|
||||
|
||||
@@ -1198,42 +1162,6 @@ RED.editor = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$("#node-input-show-label").prop('checked')) {
|
||||
// Not checked - hide label
|
||||
if (!/^link (in|out)$/.test(node.type)) {
|
||||
// Not a link node - default state is true
|
||||
if (node.l !== false) {
|
||||
changes.l = node.l
|
||||
changed = true;
|
||||
}
|
||||
node.l = false;
|
||||
} else {
|
||||
// A link node - default state is false
|
||||
if (node.hasOwnProperty('l') && node.l) {
|
||||
changes.l = node.l
|
||||
changed = true;
|
||||
}
|
||||
delete node.l;
|
||||
}
|
||||
} else {
|
||||
// Checked - show label
|
||||
if (!/^link (in|out)$/.test(node.type)) {
|
||||
// Not a link node - default state is true
|
||||
if (node.hasOwnProperty('l') && !node.l) {
|
||||
changes.l = node.l
|
||||
changed = true;
|
||||
}
|
||||
delete node.l;
|
||||
} else {
|
||||
if (!node.l) {
|
||||
changes.l = node.l
|
||||
changed = true;
|
||||
}
|
||||
node.l = true;
|
||||
}
|
||||
}
|
||||
node.resize = true;
|
||||
|
||||
var oldInfo = node.info;
|
||||
if (nodeInfoEditor) {
|
||||
var newInfo = nodeInfoEditor.getValue();
|
||||
@@ -1339,8 +1267,7 @@ RED.editor = (function() {
|
||||
RED.tray.resize();
|
||||
}
|
||||
},
|
||||
collapsible: true,
|
||||
menu: false
|
||||
collapsible: true
|
||||
});
|
||||
if (editing_node) {
|
||||
RED.sidebar.info.refresh(editing_node);
|
||||
@@ -1361,8 +1288,8 @@ RED.editor = (function() {
|
||||
|
||||
var nodePropertiesTab = {
|
||||
id: "editor-tab-properties",
|
||||
label: RED._("editor-tab.properties"),
|
||||
name: RED._("editor-tab.properties"),
|
||||
label: "Properties",
|
||||
name: "Properties",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-cog"
|
||||
};
|
||||
@@ -1372,8 +1299,8 @@ RED.editor = (function() {
|
||||
if (!node._def.defaults || !node._def.defaults.hasOwnProperty('info')) {
|
||||
var descriptionTab = {
|
||||
id: "editor-tab-description",
|
||||
label: RED._("editor-tab.description"),
|
||||
name: RED._("editor-tab.description"),
|
||||
label: "Description",
|
||||
name: "Description",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-file-text-o",
|
||||
onchange: function() {
|
||||
@@ -1386,8 +1313,8 @@ RED.editor = (function() {
|
||||
|
||||
var appearanceTab = {
|
||||
id: "editor-tab-appearance",
|
||||
label: RED._("editor-tab.appearance"),
|
||||
name: RED._("editor-tab.appearance"),
|
||||
label: "Appearance",
|
||||
name: "Appearance",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-object-group",
|
||||
onchange: function() {
|
||||
@@ -1527,8 +1454,8 @@ RED.editor = (function() {
|
||||
|
||||
var nodePropertiesTab = {
|
||||
id: "editor-tab-cproperties",
|
||||
label: RED._("editor-tab.properties"),
|
||||
name: RED._("editor-tab.properties"),
|
||||
label: "Properties",
|
||||
name: "Properties",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-cog"
|
||||
};
|
||||
@@ -1538,8 +1465,8 @@ RED.editor = (function() {
|
||||
if (!node_def.defaults || !node_def.defaults.hasOwnProperty('info')) {
|
||||
var descriptionTab = {
|
||||
id: "editor-tab-description",
|
||||
label: RED._("editor-tab.description"),
|
||||
name: RED._("editor-tab.description"),
|
||||
label: "Description",
|
||||
name: "Description",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-file-text-o",
|
||||
onchange: function() {
|
||||
@@ -1601,7 +1528,6 @@ RED.editor = (function() {
|
||||
$("#node-config-dialog-user-count").find("span").text(RED._("editor.nodesUse", {count:editing_config_node.users.length})).parent().show();
|
||||
}
|
||||
trayBody.i18n();
|
||||
trayFooter.i18n();
|
||||
finishedBuilding = true;
|
||||
done();
|
||||
});
|
||||
@@ -2051,8 +1977,8 @@ RED.editor = (function() {
|
||||
|
||||
var nodePropertiesTab = {
|
||||
id: "editor-tab-properties",
|
||||
label: RED._("editor-tab.properties"),
|
||||
name: RED._("editor-tab.properties"),
|
||||
label: "Properties",
|
||||
name: "Properties",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-cog"
|
||||
};
|
||||
@@ -2061,8 +1987,8 @@ RED.editor = (function() {
|
||||
|
||||
var descriptionTab = {
|
||||
id: "editor-tab-description",
|
||||
label: RED._("editor-tab.description"),
|
||||
name: RED._("editor-tab.description"),
|
||||
label: "Description",
|
||||
name: "Description",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-file-text-o",
|
||||
onchange: function() {
|
||||
@@ -2074,8 +2000,8 @@ RED.editor = (function() {
|
||||
|
||||
var appearanceTab = {
|
||||
id: "editor-tab-appearance",
|
||||
label: RED._("editor-tab.appearance"),
|
||||
name: RED._("editor-tab.appearance"),
|
||||
label: "Appearance",
|
||||
name: "Appearance",
|
||||
content: $('<div>', {class:"editor-tray-content"}).appendTo(editorContent).hide(),
|
||||
iconClass: "fa fa-object-group",
|
||||
onchange: function() {
|
||||
@@ -2146,7 +2072,7 @@ RED.editor = (function() {
|
||||
}
|
||||
|
||||
function showTypeEditor(type, options) {
|
||||
if (customEditTypes.hasOwnProperty(type)) {
|
||||
if (RED.editor.types.hasOwnProperty(type)) {
|
||||
if (editStack.length > 0) {
|
||||
options.parent = editStack[editStack.length-1].id;
|
||||
}
|
||||
@@ -2155,99 +2081,12 @@ RED.editor = (function() {
|
||||
options.onclose = function() {
|
||||
editStack.pop();
|
||||
}
|
||||
customEditTypes[type].show(options);
|
||||
RED.editor.types[type].show(options);
|
||||
} else {
|
||||
console.log("Unknown type editor:",type);
|
||||
}
|
||||
}
|
||||
|
||||
function createEditor(options) {
|
||||
var el = options.element || $("#"+options.id)[0];
|
||||
var toolbarRow = $("<div>").appendTo(el);
|
||||
el = $("<div>").appendTo(el).addClass("node-text-editor-container")[0];
|
||||
var editor = ace.edit(el);
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
var session = editor.getSession();
|
||||
session.on("changeAnnotation", function () {
|
||||
var annotations = session.getAnnotations() || [];
|
||||
var i = annotations.length;
|
||||
var len = annotations.length;
|
||||
while (i--) {
|
||||
if (/doctype first\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
|
||||
else if (/Unexpected End of file\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
|
||||
}
|
||||
if (len > annotations.length) { session.setAnnotations(annotations); }
|
||||
});
|
||||
if (options.mode) {
|
||||
session.setMode(options.mode);
|
||||
}
|
||||
if (options.foldStyle) {
|
||||
session.setFoldStyle(options.foldStyle);
|
||||
} else {
|
||||
session.setFoldStyle('markbeginend');
|
||||
}
|
||||
if (options.options) {
|
||||
editor.setOptions(options.options);
|
||||
} else {
|
||||
editor.setOptions({
|
||||
enableBasicAutocompletion:true,
|
||||
enableSnippets:true,
|
||||
tooltipFollowsMouse: false
|
||||
});
|
||||
}
|
||||
if (options.readOnly) {
|
||||
editor.setOption('readOnly',options.readOnly);
|
||||
editor.container.classList.add("ace_read-only");
|
||||
}
|
||||
if (options.hasOwnProperty('lineNumbers')) {
|
||||
editor.renderer.setOption('showGutter',options.lineNumbers);
|
||||
}
|
||||
editor.$blockScrolling = Infinity;
|
||||
if (options.value) {
|
||||
session.setValue(options.value,-1);
|
||||
}
|
||||
if (options.globals) {
|
||||
setTimeout(function() {
|
||||
if (!!session.$worker) {
|
||||
session.$worker.send("setOptions", [{globals: options.globals, esversion:6, sub:true, asi:true, maxerr:1000}]);
|
||||
}
|
||||
},100);
|
||||
}
|
||||
if (options.mode === 'ace/mode/markdown') {
|
||||
$(el).addClass("node-text-editor-container-toolbar");
|
||||
editor.toolbar = customEditTypes['_markdown'].buildToolbar(toolbarRow,editor);
|
||||
if (options.expandable !== false) {
|
||||
var expandButton = $('<button class="editor-button" style="float: right;"><i class="fa fa-expand"></i></button>').appendTo(editor.toolbar);
|
||||
|
||||
expandButton.click(function(e) {
|
||||
e.preventDefault();
|
||||
var value = editor.getValue();
|
||||
RED.editor.editMarkdown({
|
||||
value: value,
|
||||
width: "Infinity",
|
||||
cursor: editor.getCursorPosition(),
|
||||
complete: function(v,cursor) {
|
||||
editor.setValue(v, -1);
|
||||
editor.gotoLine(cursor.row+1,cursor.column,false);
|
||||
setTimeout(function() {
|
||||
editor.focus();
|
||||
},300);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
var helpButton = $('<button class="node-text-editor-help editor-button editor-button-small"><i class="fa fa-question"></i></button>').appendTo($(el).parent());
|
||||
RED.popover.create({
|
||||
target: helpButton,
|
||||
trigger: 'click',
|
||||
size: "small",
|
||||
direction: "left",
|
||||
content: RED._("markdownEditor.format"),
|
||||
autoClose: 50
|
||||
});
|
||||
}
|
||||
return editor;
|
||||
}
|
||||
|
||||
return {
|
||||
init: function() {
|
||||
@@ -2260,7 +2099,14 @@ RED.editor = (function() {
|
||||
$("#node-dialog-cancel").click();
|
||||
$("#node-config-dialog-cancel").click();
|
||||
});
|
||||
|
||||
for (var type in RED.editor.types) {
|
||||
if (RED.editor.types.hasOwnProperty(type)) {
|
||||
RED.editor.types[type].init();
|
||||
}
|
||||
}
|
||||
},
|
||||
types: {},
|
||||
edit: showEditDialog,
|
||||
editConfig: showEditConfigNodeDialog,
|
||||
editSubflow: showEditSubflowDialog,
|
||||
@@ -2273,32 +2119,56 @@ RED.editor = (function() {
|
||||
validateNode: validateNode,
|
||||
updateNodeProperties: updateNodeProperties, // TODO: only exposed for edit-undo
|
||||
|
||||
/**
|
||||
* Show a type editor.
|
||||
* @param {string} type - the type to display
|
||||
* @param {object} options - options for the editor
|
||||
* @function
|
||||
* @memberof RED.editor
|
||||
*/
|
||||
showTypeEditor: showTypeEditor,
|
||||
|
||||
/**
|
||||
* Register a type editor.
|
||||
* @param {string} type - the type name
|
||||
* @param {object} options - the editor definition
|
||||
* @function
|
||||
* @memberof RED.editor
|
||||
*/
|
||||
registerTypeEditor: function(type, definition) {
|
||||
customEditTypes[type] = definition;
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a editor ui component
|
||||
* @param {object} options - the editor options
|
||||
* @function
|
||||
* @memberof RED.editor
|
||||
*/
|
||||
createEditor: createEditor
|
||||
createEditor: function(options) {
|
||||
var editor = ace.edit(options.id||options.element);
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
var session = editor.getSession();
|
||||
session.on("changeAnnotation", function () {
|
||||
var annotations = session.getAnnotations() || [];
|
||||
var i = annotations.length;
|
||||
var len = annotations.length;
|
||||
while (i--) {
|
||||
if (/doctype first\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
|
||||
else if (/Unexpected End of file\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); }
|
||||
}
|
||||
if (len > annotations.length) { session.setAnnotations(annotations); }
|
||||
});
|
||||
if (options.mode) {
|
||||
session.setMode(options.mode);
|
||||
}
|
||||
if (options.foldStyle) {
|
||||
session.setFoldStyle(options.foldStyle);
|
||||
} else {
|
||||
session.setFoldStyle('markbeginend');
|
||||
}
|
||||
if (options.options) {
|
||||
editor.setOptions(options.options);
|
||||
} else {
|
||||
editor.setOptions({
|
||||
enableBasicAutocompletion:true,
|
||||
enableSnippets:true
|
||||
});
|
||||
}
|
||||
if (options.readOnly) {
|
||||
editor.setOption('readOnly',options.readOnly);
|
||||
editor.container.classList.add("ace_read-only");
|
||||
}
|
||||
if (options.hasOwnProperty('lineNumbers')) {
|
||||
editor.renderer.setOption('showGutter',options.lineNumbers);
|
||||
}
|
||||
editor.$blockScrolling = Infinity;
|
||||
if (options.value) {
|
||||
session.setValue(options.value,-1);
|
||||
}
|
||||
if (options.globals) {
|
||||
setTimeout(function() {
|
||||
if (!!session.$worker) {
|
||||
session.$worker.send("setOptions", [{globals: options.globals, esversion:6, sub:true, asi:true, maxerr:1000}]);
|
||||
}
|
||||
},100);
|
||||
}
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
(function() {
|
||||
RED.editor.types._buffer = (function() {
|
||||
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_buffer"><div id="node-input-buffer-panels"><div id="node-input-buffer-panel-str" class="red-ui-panel"><div class="form-row" style="margin-bottom: 3px; text-align: right;"><span class="node-input-buffer-type"><i class="fa fa-exclamation-circle"></i> <span id="node-input-buffer-type-string" data-i18n="bufferEditor.modeString"></span><span id="node-input-buffer-type-array" data-i18n="bufferEditor.modeArray"></span></span></div><div class="form-row node-text-editor-row"><div class="node-text-editor" id="node-input-buffer-str"></div></div></div><div id="node-input-buffer-panel-bin" class="red-ui-panel"><div class="form-row node-text-editor-row" style="margin-top: 10px"><div class="node-text-editor" id="node-input-buffer-bin"></div></div></div></div></script>';
|
||||
|
||||
@@ -44,7 +45,10 @@
|
||||
}
|
||||
|
||||
|
||||
var definition = {
|
||||
return {
|
||||
init: function() {
|
||||
$(template).appendTo(document.body);
|
||||
},
|
||||
show: function(options) {
|
||||
var value = options.value;
|
||||
var onComplete = options.complete;
|
||||
@@ -202,7 +206,4 @@
|
||||
RED.tray.show(trayOptions);
|
||||
}
|
||||
}
|
||||
$(template).appendTo(document.body);
|
||||
RED.editor.registerTypeEditor("_buffer", definition);
|
||||
|
||||
})();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
(function() {
|
||||
RED.editor.types._expression = (function() {
|
||||
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_expression">'+
|
||||
@@ -46,7 +46,10 @@
|
||||
'</script>';
|
||||
var expressionTestCache = {};
|
||||
|
||||
var definition = {
|
||||
return {
|
||||
init: function() {
|
||||
$(template).appendTo(document.body);
|
||||
},
|
||||
show: function(options) {
|
||||
var expressionTestCacheId = options.parent||"_";
|
||||
var value = options.value;
|
||||
@@ -346,6 +349,4 @@
|
||||
RED.tray.show(trayOptions);
|
||||
}
|
||||
}
|
||||
$(template).appendTo(document.body);
|
||||
RED.editor.registerTypeEditor("_expression", definition);
|
||||
})();
|
||||
|
||||
@@ -13,12 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
(function() {
|
||||
RED.editor.types._js = (function() {
|
||||
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_js"><div class="form-row node-text-editor-row"><div style="height: 200px;min-height: 150px;" class="node-text-editor" id="node-input-js"></div></div></script>';
|
||||
|
||||
var definition = {
|
||||
return {
|
||||
init: function() {
|
||||
$(template).appendTo(document.body);
|
||||
},
|
||||
show: function(options) {
|
||||
var value = options.value;
|
||||
var onComplete = options.complete;
|
||||
@@ -63,7 +66,7 @@
|
||||
var dialogForm = RED.editor.buildEditForm(tray.find('.editor-tray-body'),'dialog-form',type,'editor');
|
||||
expressionEditor = RED.editor.createEditor({
|
||||
id: 'node-input-js',
|
||||
mode: options.mode || 'ace/mode/javascript',
|
||||
mode: 'ace/mode/javascript',
|
||||
value: value,
|
||||
globals: {
|
||||
msg:true,
|
||||
@@ -96,7 +99,4 @@
|
||||
RED.tray.show(trayOptions);
|
||||
}
|
||||
}
|
||||
$(template).appendTo(document.body);
|
||||
RED.editor.registerTypeEditor("_js", definition);
|
||||
|
||||
})();
|
||||
|
||||
@@ -13,12 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
(function() {
|
||||
RED.editor.types._json = (function() {
|
||||
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_json"><div class="form-row" style="margin-bottom: 3px; text-align: right;"><button id="node-input-json-reformat" class="editor-button editor-button-small"><span data-i18n="jsonEditor.format"></span></button></div><div class="form-row node-text-editor-row"><div style="height: 200px;min-height: 150px;" class="node-text-editor" id="node-input-json"></div></div></script>';
|
||||
|
||||
var definition = {
|
||||
return {
|
||||
init: function() {
|
||||
$(template).appendTo(document.body);
|
||||
},
|
||||
show: function(options) {
|
||||
var value = options.value;
|
||||
var onComplete = options.complete;
|
||||
@@ -112,6 +115,4 @@
|
||||
RED.tray.show(trayOptions);
|
||||
}
|
||||
}
|
||||
$(template).appendTo(document.body);
|
||||
RED.editor.registerTypeEditor("_json", definition);
|
||||
})();
|
||||
|
||||
@@ -13,45 +13,26 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
(function() {
|
||||
RED.editor.types._markdown = (function() {
|
||||
|
||||
var toolbarTemplate = '<div style="margin-bottom: 5px">'+
|
||||
'<span class="button-group">'+
|
||||
'<button class="editor-button" data-style="h1" style="font-size:1.1em; font-weight: bold">h1</button>'+
|
||||
'<button class="editor-button" data-style="h2" style="font-size:1.0em; font-weight: bold">h2</button>'+
|
||||
'<button class="editor-button" data-style="h3" style="font-size:0.9em; font-weight: bold">h3</button>'+
|
||||
'</span>'+
|
||||
'<span class="button-group">'+
|
||||
'<button class="editor-button" data-style="b"><i class="fa fa-bold"></i></button>'+
|
||||
'<button class="editor-button" data-style="i"><i class="fa fa-italic"></i></button>'+
|
||||
'<button class="editor-button" data-style="code"><i class="fa fa-code"></i></button>'+
|
||||
'</span>'+
|
||||
'<span class="button-group">'+
|
||||
'<button class="editor-button" data-style="ol"><i class="fa fa-list-ol"></i></button>'+
|
||||
'<button class="editor-button" data-style="ul"><i class="fa fa-list-ul"></i></button>'+
|
||||
'<button class="editor-button" data-style="bq"><i class="fa fa-quote-left"></i></button>'+
|
||||
'<button class="editor-button" data-style="hr"><i class="fa fa-minus"></i></button>'+
|
||||
'<button class="editor-button" data-style="link"><i class="fa fa-link"></i></button>'+
|
||||
'</span>'
|
||||
'</div>';
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_markdown">'+
|
||||
'<div id="node-input-markdown-panels">'+
|
||||
'<div id="node-input-markdown-panel-editor" class="red-ui-panel">'+
|
||||
'<div style="height: 100%; margin: auto; max-width: 1000px;">'+
|
||||
'<div id="node-input-markdown-toolbar"></div>'+
|
||||
'<div class="node-text-editor" style="height: 100%" id="node-input-markdown"></div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="red-ui-panel">'+
|
||||
'<div class="node-input-markdown-panel-preview node-help"></div>'+
|
||||
'</div>'+
|
||||
'</script>';
|
||||
'<div id="node-input-markdown-panels">'+
|
||||
'<div id="node-input-markdown-panel-editor" class="red-ui-panel">'+
|
||||
'<div class="node-text-editor" style="height: calc(100% - 20px)" id="node-input-markdown"></div>'+
|
||||
'</div>'+
|
||||
'<div class="red-ui-panel">'+
|
||||
'<div id="node-input-markdown-panel-preview" style="padding: 20px;" class="node-help"></div>'+
|
||||
'</div>'+
|
||||
'</script>';
|
||||
|
||||
|
||||
var panels;
|
||||
|
||||
var definition = {
|
||||
return {
|
||||
init: function() {
|
||||
$(template).appendTo(document.body);
|
||||
},
|
||||
show: function(options) {
|
||||
var value = options.value;
|
||||
var onComplete = options.complete;
|
||||
@@ -94,16 +75,15 @@
|
||||
expressionEditor = RED.editor.createEditor({
|
||||
id: 'node-input-markdown',
|
||||
value: value,
|
||||
mode:"ace/mode/markdown",
|
||||
expandable: false
|
||||
mode:"ace/mode/markdown"
|
||||
});
|
||||
var changeTimer;
|
||||
expressionEditor.getSession().on("change", function() {
|
||||
clearTimeout(changeTimer);
|
||||
changeTimer = setTimeout(function() {
|
||||
var currentScrollTop = $(".node-input-markdown-panel-preview").scrollTop();
|
||||
$(".node-input-markdown-panel-preview").html(marked(expressionEditor.getValue()));
|
||||
$(".node-input-markdown-panel-preview").scrollTop(currentScrollTop);
|
||||
var currentScrollTop = $("#node-input-markdown-panel-preview").scrollTop();
|
||||
$("#node-input-markdown-panel-preview").html(marked(expressionEditor.getValue()));
|
||||
$("#node-input-markdown-panel-preview").scrollTop(currentScrollTop);
|
||||
},200);
|
||||
})
|
||||
if (options.header) {
|
||||
@@ -111,7 +91,7 @@
|
||||
}
|
||||
|
||||
if (value) {
|
||||
$(".node-input-markdown-panel-preview").html(marked(expressionEditor.getValue()));
|
||||
$("#node-input-markdown-panel-preview").html(marked(expressionEditor.getValue()));
|
||||
}
|
||||
panels = RED.panels.create({
|
||||
id:"node-input-markdown-panels",
|
||||
@@ -120,23 +100,6 @@
|
||||
expressionEditor.resize();
|
||||
}
|
||||
});
|
||||
panels.ratio(1);
|
||||
|
||||
$('<span class="button-group" style="float:right">'+
|
||||
'<button id="node-btn-markdown-preview" class="editor-button toggle single"><i class="fa fa-eye"></i></button>'+
|
||||
'</span>').appendTo(expressionEditor.toolbar);
|
||||
|
||||
$("#node-btn-markdown-preview").click(function(e) {
|
||||
e.preventDefault();
|
||||
if ($(this).hasClass("selected")) {
|
||||
$(this).removeClass("selected");
|
||||
panels.ratio(1);
|
||||
} else {
|
||||
$(this).addClass("selected");
|
||||
panels.ratio(0.5);
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip($("#node-btn-markdown-preview"), RED._("markdownEditor.toggle-preview"));
|
||||
|
||||
if (options.cursor) {
|
||||
expressionEditor.gotoLine(options.cursor.row+1,options.cursor.column,false);
|
||||
@@ -153,60 +116,7 @@
|
||||
show: function() {}
|
||||
}
|
||||
RED.tray.show(trayOptions);
|
||||
},
|
||||
|
||||
buildToolbar: function(container, editor) {
|
||||
var styleActions = {
|
||||
'h1': { newline: true, before:"# ", tooltip:RED._("markdownEditor.heading1")},
|
||||
'h2': { newline: true, before:"## ", tooltip:RED._("markdownEditor.heading2")},
|
||||
'h3': { newline: true, before:"### ", tooltip:RED._("markdownEditor.heading3")},
|
||||
'b': { before:"**", after: "**", tooltip: RED._("markdownEditor.bold")},
|
||||
'i': { before:"_", after: "_", tooltip: RED._("markdownEditor.italic")},
|
||||
'code': { before:"`", after: "`", tooltip: RED._("markdownEditor.code")},
|
||||
'ol': { before:" * ", newline: true, tooltip: RED._("markdownEditor.ordered-list")},
|
||||
'ul': { before:" - ", newline: true, tooltip: RED._("markdownEditor.unordered-list")},
|
||||
'bq': { before:"> ", newline: true, tooltip: RED._("markdownEditor.quote")},
|
||||
'link': { before:"[", after: "]()", tooltip: RED._("markdownEditor.link")},
|
||||
'hr': { before:"\n---\n\n", tooltip: RED._("markdownEditor.horizontal-rule")}
|
||||
}
|
||||
var toolbar = $(toolbarTemplate).appendTo(container);
|
||||
toolbar.find('button[data-style]').each(function(el) {
|
||||
var style = styleActions[$(this).data('style')];
|
||||
$(this).click(function(e) {
|
||||
e.preventDefault();
|
||||
var current = editor.getSelectedText();
|
||||
var range = editor.selection.getRange();
|
||||
if (style.newline) {
|
||||
var offset = 0;
|
||||
var beforeOffset = ((style.before||"").match(/\n/g)||[]).length;
|
||||
var afterOffset = ((style.after||"").match(/\n/g)||[]).length;
|
||||
for (var i = range.start.row; i<= range.end.row+offset; i++) {
|
||||
if (style.before) {
|
||||
editor.session.insert({row:i, column:0},style.before);
|
||||
offset += beforeOffset;
|
||||
i += beforeOffset;
|
||||
}
|
||||
if (style.after) {
|
||||
editor.session.insert({row:i, column:Infinity},style.after);
|
||||
offset += afterOffset;
|
||||
i += afterOffset;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
editor.session.replace(editor.selection.getRange(), (style.before||"")+current+(style.after||""));
|
||||
if (current === "") {
|
||||
editor.gotoLine(range.start.row+1,range.start.column+(style.before||"").length,false);
|
||||
}
|
||||
}
|
||||
editor.focus();
|
||||
});
|
||||
if (style.tooltip) {
|
||||
RED.popover.tooltip($(this),style.tooltip);
|
||||
}
|
||||
})
|
||||
return toolbar;
|
||||
}
|
||||
}
|
||||
$(template).appendTo(document.body);
|
||||
RED.editor.registerTypeEditor("_markdown", definition);
|
||||
})();
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
RED.eventLog = (function() {
|
||||
|
||||
var template = '<script type="text/x-red" data-template-name="_eventLog"><div class="form-row node-text-editor-row"><div style="height: 100%;min-height: 150px;" class="node-text-editor" id="event-log-editor"></div></div></script>';
|
||||
|
||||
var eventLogEditor;
|
||||
var backlog = [];
|
||||
var shown = false;
|
||||
|
||||
function appendLogLine(line) {
|
||||
backlog.push(line);
|
||||
if (backlog.length > 500) {
|
||||
backlog = backlog.slice(-500);
|
||||
}
|
||||
if (eventLogEditor) {
|
||||
eventLogEditor.getSession().insert({
|
||||
row: eventLogEditor.getSession().getLength(),
|
||||
column: 0
|
||||
}, "\n" + line);
|
||||
eventLogEditor.scrollToLine(eventLogEditor.getSession().getLength());
|
||||
}
|
||||
}
|
||||
return {
|
||||
init: function() {
|
||||
$(template).appendTo(document.body);
|
||||
RED.actions.add("core:show-event-log",RED.eventLog.show);
|
||||
},
|
||||
show: function() {
|
||||
if (shown) {
|
||||
return;
|
||||
}
|
||||
shown = true;
|
||||
var type = "_eventLog"
|
||||
|
||||
var trayOptions = {
|
||||
title: RED._("eventLog.title"),
|
||||
width: Infinity,
|
||||
buttons: [
|
||||
{
|
||||
id: "node-dialog-close",
|
||||
text: RED._("common.label.close"),
|
||||
click: function() {
|
||||
RED.tray.close();
|
||||
}
|
||||
}
|
||||
],
|
||||
resize: function(dimensions) {
|
||||
var rows = $("#dialog-form>div:not(.node-text-editor-row)");
|
||||
var editorRow = $("#dialog-form>div.node-text-editor-row");
|
||||
var height = $("#dialog-form").height();
|
||||
for (var i=0;i<rows.size();i++) {
|
||||
height -= $(rows[i]).outerHeight(true);
|
||||
}
|
||||
height -= (parseInt($("#dialog-form").css("marginTop"))+parseInt($("#dialog-form").css("marginBottom")));
|
||||
$(".node-text-editor").css("height",height+"px");
|
||||
eventLogEditor.resize();
|
||||
},
|
||||
open: function(tray) {
|
||||
var trayBody = tray.find('.editor-tray-body');
|
||||
var dialogForm = RED.editor.buildEditForm(tray.find('.editor-tray-body'),'dialog-form',type,'editor');
|
||||
eventLogEditor = RED.editor.createEditor({
|
||||
id: 'event-log-editor',
|
||||
value: backlog.join("\n"),
|
||||
lineNumbers: false,
|
||||
readOnly: true,
|
||||
options: {
|
||||
showPrintMargin: false
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
eventLogEditor.scrollToLine(eventLogEditor.getSession().getLength());
|
||||
},200);
|
||||
dialogForm.i18n();
|
||||
},
|
||||
close: function() {
|
||||
eventLogEditor.destroy();
|
||||
eventLogEditor = null;
|
||||
shown = false;
|
||||
},
|
||||
show: function() {}
|
||||
}
|
||||
RED.tray.show(trayOptions);
|
||||
},
|
||||
log: function(id,payload) {
|
||||
var ts = (new Date(payload.ts)).toISOString()+" ";
|
||||
if (payload.type) {
|
||||
ts += "["+payload.type+"] "
|
||||
}
|
||||
if (payload.data) {
|
||||
var data = payload.data;
|
||||
if (data.endsWith('\n')) {
|
||||
data = data.substring(0,data.length-1);
|
||||
}
|
||||
var lines = data.split(/\n/);
|
||||
lines.forEach(function(line) {
|
||||
appendLogLine(ts+line);
|
||||
})
|
||||
}
|
||||
},
|
||||
startEvent: function(name) {
|
||||
backlog.push("");
|
||||
backlog.push("-----------------------------------------------------------");
|
||||
backlog.push((new Date()).toISOString()+" "+name);
|
||||
backlog.push("");
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -19,7 +19,7 @@ RED.keyboard = (function() {
|
||||
|
||||
var handlers = {};
|
||||
var partialState;
|
||||
RED.h = handlers;
|
||||
|
||||
var keyMap = {
|
||||
"left":37,
|
||||
"up":38,
|
||||
@@ -161,19 +161,6 @@ RED.h = handlers;
|
||||
return [keycode,modifiers];
|
||||
}
|
||||
|
||||
function matchHandlerToEvent(evt,handler) {
|
||||
var target = evt.target;
|
||||
var depth = 0;
|
||||
while (target.nodeName !== 'BODY' && target.id !== handler.scope) {
|
||||
target = target.parentElement;
|
||||
depth++;
|
||||
}
|
||||
if (target.nodeName === 'BODY' && handler.scope !== "*") {
|
||||
depth = -1;
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
|
||||
function resolveKeyEvent(evt) {
|
||||
var slot = partialState||handlers;
|
||||
if (evt.ctrlKey || evt.metaKey) {
|
||||
@@ -188,7 +175,7 @@ RED.h = handlers;
|
||||
var keyCode = firefoxKeyCodeMap[evt.keyCode] || evt.keyCode;
|
||||
if (slot && slot[keyCode]) {
|
||||
var handler = slot[keyCode];
|
||||
if (!handler.handlers) {
|
||||
if (!handler.scope) {
|
||||
if (partialState) {
|
||||
partialState = null;
|
||||
return resolveKeyEvent(evt);
|
||||
@@ -199,19 +186,14 @@ RED.h = handlers;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
var depth = Infinity;
|
||||
var matchedHandler;
|
||||
var i = 0;
|
||||
var l = handler.handlers.length;
|
||||
for (i=0;i<l;i++) {
|
||||
var d = matchHandlerToEvent(evt,handler.handlers[i]);
|
||||
if (d > -1 && d < depth) {
|
||||
depth = d;
|
||||
matchedHandler = handler.handlers[i];
|
||||
}
|
||||
} else if (handler.scope && handler.scope !== "*") {
|
||||
var target = evt.target;
|
||||
while (target.nodeName !== 'BODY' && target.id !== handler.scope) {
|
||||
target = target.parentElement;
|
||||
}
|
||||
if (target.nodeName === 'BODY') {
|
||||
handler = null;
|
||||
}
|
||||
handler = matchedHandler;
|
||||
}
|
||||
partialState = null;
|
||||
return handler;
|
||||
@@ -283,8 +265,6 @@ RED.h = handlers;
|
||||
slot = slot[key];
|
||||
//slot[key] = {scope: scope, ondown:cbdown};
|
||||
}
|
||||
slot.handlers = slot.handlers || [];
|
||||
slot.handlers.push({scope:scope,ondown:cbdown})
|
||||
slot.scope = scope;
|
||||
slot.ondown = cbdown;
|
||||
}
|
||||
@@ -335,13 +315,11 @@ RED.h = handlers;
|
||||
}
|
||||
delete slot.scope;
|
||||
delete slot.ondown;
|
||||
// TODO: this wipes everything! Need to have something to identify handler
|
||||
delete slot.handlers;
|
||||
}
|
||||
|
||||
var cmdCtrlKey = '<span class="help-key">'+(isMac?'⌘':'Ctrl')+'</span>';
|
||||
|
||||
function formatKey(key,plain) {
|
||||
function formatKey(key) {
|
||||
var formattedKey = isMac?key.replace(/ctrl-?/,"⌘"):key;
|
||||
formattedKey = isMac?formattedKey.replace(/alt-?/,"⌥"):key;
|
||||
formattedKey = formattedKey.replace(/shift-?/,"⇧")
|
||||
@@ -349,9 +327,6 @@ RED.h = handlers;
|
||||
formattedKey = formattedKey.replace(/up/,"↑")
|
||||
formattedKey = formattedKey.replace(/right/,"→")
|
||||
formattedKey = formattedKey.replace(/down/,"↓")
|
||||
if (plain) {
|
||||
return formattedKey;
|
||||
}
|
||||
return '<span class="help-key-block"><span class="help-key">'+formattedKey.split(" ").join('</span> <span class="help-key">')+'</span></span>';
|
||||
}
|
||||
|
||||
|
||||
@@ -458,10 +458,7 @@ RED.library = (function() {
|
||||
click: function() {
|
||||
//TODO: move this to RED.library
|
||||
var flowName = $("#node-input-library-filename").val();
|
||||
flowName = flowName.trim();
|
||||
if(flowName === "" || flowName.endsWith("/")) {
|
||||
RED.notify(RED._("library.invalidFilename"),"warning");
|
||||
} else {
|
||||
if (!/^\s*$/.test(flowName)) {
|
||||
$.ajax({
|
||||
url:'library/flows/'+flowName,
|
||||
type: "POST",
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
RED.notifications = (function() {
|
||||
|
||||
/*
|
||||
If RED.notifications.hide is set to true, all notifications will be hidden.
|
||||
This is to help with UI testing in certain cases and not intended for the
|
||||
end-user.
|
||||
|
||||
// Example usage for a modal dialog with buttons
|
||||
var myNotification = RED.notify("This is the message to display",{
|
||||
modal: true,
|
||||
@@ -112,9 +108,7 @@ RED.notifications = (function() {
|
||||
|
||||
|
||||
$("#notifications").append(n);
|
||||
if (!RED.notifications.hide) {
|
||||
$(n).slideDown(300);
|
||||
}
|
||||
$(n).slideDown(300);
|
||||
n.close = (function() {
|
||||
var nn = n;
|
||||
return function() {
|
||||
@@ -129,13 +123,9 @@ RED.notifications = (function() {
|
||||
notificationButtonWrapper.hide();
|
||||
}
|
||||
}
|
||||
if (!RED.notifications.hide) {
|
||||
$(nn).slideUp(300, function() {
|
||||
nn.parentNode.removeChild(nn);
|
||||
});
|
||||
} else {
|
||||
$(nn).slideUp(300, function() {
|
||||
nn.parentNode.removeChild(nn);
|
||||
}
|
||||
});
|
||||
if (options.modal) {
|
||||
$("#full-shade").hide();
|
||||
}
|
||||
@@ -148,9 +138,7 @@ RED.notifications = (function() {
|
||||
return
|
||||
}
|
||||
nn.hidden = true;
|
||||
if (!RED.notifications.hide) {
|
||||
$(nn).slideUp(300);
|
||||
}
|
||||
$(nn).slideUp(300);
|
||||
}
|
||||
})();
|
||||
n.showNotification = (function() {
|
||||
@@ -160,9 +148,7 @@ RED.notifications = (function() {
|
||||
return
|
||||
}
|
||||
nn.hidden = false;
|
||||
if (!RED.notifications.hide) {
|
||||
$(nn).slideDown(300);
|
||||
}
|
||||
$(nn).slideDown(300);
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ RED.palette.editor = (function() {
|
||||
var catalogueLoadStart;
|
||||
var catalogueLoadErrors = false;
|
||||
|
||||
var activeSort = sortModulesRelevance;
|
||||
var activeSort = sortModulesAZ;
|
||||
|
||||
function handleCatalogResponse(err,catalog,index,v) {
|
||||
catalogueLoadStatus.push(err||v);
|
||||
@@ -333,9 +333,6 @@ RED.palette.editor = (function() {
|
||||
if (m.keywords) {
|
||||
m.index = m.index.concat(m.keywords);
|
||||
}
|
||||
if (m.types) {
|
||||
m.index = m.index.concat(m.types);
|
||||
}
|
||||
if (m.updated_at) {
|
||||
m.timestamp = new Date(m.updated_at).getTime();
|
||||
} else {
|
||||
@@ -416,17 +413,6 @@ RED.palette.editor = (function() {
|
||||
packageList.editableList('addItem',{start:10,more:filteredList.length-10})
|
||||
}
|
||||
}
|
||||
function sortModulesRelevance(A,B) {
|
||||
var currentFilter = searchInput.searchBox('value').trim();
|
||||
if (currentFilter === "") {
|
||||
return sortModulesAZ(A,B);
|
||||
}
|
||||
var i = A.info.index.indexOf(currentFilter) - B.info.index.indexOf(currentFilter);
|
||||
if (i === 0) {
|
||||
return sortModulesAZ(A,B);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
function sortModulesAZ(A,B) {
|
||||
return A.info.id.localeCompare(B.info.id);
|
||||
}
|
||||
@@ -761,29 +747,32 @@ 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="palette-editor-install-sort-option sidebar-header-button-toggle selected"><i class="fa fa-sort-amount-desc"></i></a>').appendTo(sortGroup);
|
||||
var sortAZ = $('<a href="#" class="palette-editor-install-sort-option sidebar-header-button-toggle" data-i18n="palette.editor.sortAZ"></a>').appendTo(sortGroup);
|
||||
var sortRecent = $('<a href="#" class="palette-editor-install-sort-option sidebar-header-button-toggle" data-i18n="palette.editor.sortRecent"></a>').appendTo(sortGroup);
|
||||
var sortAZ = $('<a href="#" class="sidebar-header-button-toggle selected" data-i18n="palette.editor.sortAZ"></a>').appendTo(sortGroup);
|
||||
var sortRecent = $('<a href="#" class="sidebar-header-button-toggle" data-i18n="palette.editor.sortRecent"></a>').appendTo(sortGroup);
|
||||
|
||||
|
||||
var sortOpts = [
|
||||
{button: sortRelevance, func: sortModulesRelevance},
|
||||
{button: sortAZ, func: sortModulesAZ},
|
||||
{button: sortRecent, func: sortModulesRecent}
|
||||
]
|
||||
sortOpts.forEach(function(opt) {
|
||||
opt.button.click(function(e) {
|
||||
e.preventDefault();
|
||||
if ($(this).hasClass("selected")) {
|
||||
return;
|
||||
}
|
||||
$(".palette-editor-install-sort-option").removeClass("selected");
|
||||
$(this).addClass("selected");
|
||||
activeSort = opt.func;
|
||||
refreshFilteredItems();
|
||||
});
|
||||
sortAZ.click(function(e) {
|
||||
e.preventDefault();
|
||||
if ($(this).hasClass("selected")) {
|
||||
return;
|
||||
}
|
||||
$(this).addClass("selected");
|
||||
sortRecent.removeClass("selected");
|
||||
activeSort = sortModulesAZ;
|
||||
refreshFilteredItems();
|
||||
});
|
||||
|
||||
sortRecent.click(function(e) {
|
||||
e.preventDefault();
|
||||
if ($(this).hasClass("selected")) {
|
||||
return;
|
||||
}
|
||||
$(this).addClass("selected");
|
||||
sortAZ.removeClass("selected");
|
||||
activeSort = sortModulesRecent;
|
||||
refreshFilteredItems();
|
||||
});
|
||||
|
||||
|
||||
var refreshSpan = $('<span>').appendTo(toolBar);
|
||||
var refreshButton = $('<a href="#" class="sidebar-header-button"><i class="fa fa-refresh"></i></a>').appendTo(refreshSpan);
|
||||
refreshButton.click(function(e) {
|
||||
@@ -825,23 +814,10 @@ RED.palette.editor = (function() {
|
||||
$('<a target="_blank" class="palette-module-link"><i class="fa fa-external-link"></i></a>').attr('href',entry.url).appendTo(titleRow);
|
||||
var descRow = $('<div class="palette-module-meta"></div>').appendTo(headerRow);
|
||||
$('<div>',{class:"palette-module-description"}).text(entry.description).appendTo(descRow);
|
||||
|
||||
var metaRow = $('<div class="palette-module-meta"></div>').appendTo(headerRow);
|
||||
$('<span class="palette-module-version"><i class="fa fa-tag"></i> '+entry.version+'</span>').appendTo(metaRow);
|
||||
$('<span class="palette-module-updated"><i class="fa fa-calendar"></i> '+formatUpdatedAt(entry.updated_at)+'</span>').appendTo(metaRow);
|
||||
|
||||
var duplicateType = false;
|
||||
if (entry.types && entry.types.length > 0) {
|
||||
|
||||
for (var i=0;i<entry.types.length;i++) {
|
||||
var nodeset = RED.nodes.registry.getNodeSetForType(entry.types[i]);
|
||||
if (nodeset) {
|
||||
duplicateType = nodeset.module;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// $('<div>',{class:"palette-module-meta"}).text(entry.types.join(",")).appendTo(headerRow);
|
||||
}
|
||||
|
||||
var buttonRow = $('<div>',{class:"palette-module-meta"}).appendTo(headerRow);
|
||||
var buttonGroup = $('<div>',{class:"palette-module-button-group"}).appendTo(buttonRow);
|
||||
var installButton = $('<a href="#" class="editor-button editor-button-small"></a>').text(RED._('palette.editor.install')).appendTo(buttonGroup);
|
||||
@@ -854,16 +830,6 @@ RED.palette.editor = (function() {
|
||||
if (nodeEntries.hasOwnProperty(entry.id)) {
|
||||
installButton.addClass('disabled');
|
||||
installButton.text(RED._('palette.editor.installed'));
|
||||
} else if (duplicateType) {
|
||||
installButton.addClass('disabled');
|
||||
installButton.text(RED._('palette.editor.conflict'));
|
||||
RED.popover.create({
|
||||
target:installButton,
|
||||
content: RED._('palette.editor.conflictTip',{module:duplicateType}),
|
||||
trigger:"hover",
|
||||
direction:"bottom",
|
||||
delay:{show:750,hide:50}
|
||||
})
|
||||
}
|
||||
|
||||
object.elements = {
|
||||
@@ -897,35 +863,11 @@ RED.palette.editor = (function() {
|
||||
class: "primary palette-module-install-confirm-button-update",
|
||||
click: function() {
|
||||
var spinner = RED.utils.addSpinnerOverlay(container, true);
|
||||
var buttonRow = $('<div style="position: relative;bottom: calc(50% + 17px); padding-right: 10px;text-align: right;"></div>').appendTo(spinner);
|
||||
$('<button class="editor-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).click(function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+entry.name+" "+version);
|
||||
installNodeModule(entry.name,version,function(xhr) {
|
||||
spinner.remove();
|
||||
if (xhr) {
|
||||
if (xhr.responseJSON) {
|
||||
var notification = RED.notify(RED._('palette.editor.errors.updateFailed',{module: entry.name,message:xhr.responseJSON.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");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
RED.notify(RED._('palette.editor.errors.updateFailed',{module: entry.name,message:xhr.responseJSON.message}));
|
||||
}
|
||||
}
|
||||
done(xhr);
|
||||
@@ -956,35 +898,12 @@ RED.palette.editor = (function() {
|
||||
class: "primary palette-module-install-confirm-button-remove",
|
||||
click: function() {
|
||||
var spinner = RED.utils.addSpinnerOverlay(container, true);
|
||||
var buttonRow = $('<div style="position: relative;bottom: calc(50% + 17px); padding-right: 10px;text-align: right;"></div>').appendTo(spinner);
|
||||
$('<button class="editor-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).click(function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.remove")+" : "+entry.name);
|
||||
removeNodeModule(entry.name, function(xhr) {
|
||||
spinner.remove();
|
||||
if (xhr) {
|
||||
if (xhr.responseJSON) {
|
||||
var notification = RED.notify(RED._('palette.editor.errors.removeFailed',{module: entry.name,message:xhr.responseJSON.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");
|
||||
}
|
||||
}
|
||||
]
|
||||
}); }
|
||||
RED.notify(RED._('palette.editor.errors.removeFailed',{module: entry.name,message:xhr.responseJSON.message}));
|
||||
}
|
||||
}
|
||||
})
|
||||
notification.close();
|
||||
@@ -1021,36 +940,11 @@ RED.palette.editor = (function() {
|
||||
class: "primary palette-module-install-confirm-button-install",
|
||||
click: function() {
|
||||
var spinner = RED.utils.addSpinnerOverlay(container, true);
|
||||
|
||||
var buttonRow = $('<div style="position: relative;bottom: calc(50% + 17px); padding-right: 10px;text-align: right;"></div>').appendTo(spinner);
|
||||
$('<button class="editor-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).click(function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
RED.eventLog.startEvent(RED._("palette.editor.confirm.button.install")+" : "+entry.id+" "+entry.version);
|
||||
installNodeModule(entry.id,entry.version,function(xhr) {
|
||||
spinner.remove();
|
||||
if (xhr) {
|
||||
if (xhr.responseJSON) {
|
||||
var notification = RED.notify(RED._('palette.editor.errors.installFailed',{module: entry.id,message:xhr.responseJSON.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");
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
RED.notify(RED._('palette.editor.errors.installFailed',{module: entry.id,message:xhr.responseJSON.message}));
|
||||
}
|
||||
}
|
||||
done(xhr);
|
||||
|
||||
@@ -20,7 +20,7 @@ RED.palette = (function() {
|
||||
var coreCategories = ['subflows', 'input', 'output', 'function', 'social', 'mobile', 'storage', 'analysis', 'advanced'];
|
||||
|
||||
var categoryContainers = {};
|
||||
var sidebarControls;
|
||||
|
||||
|
||||
function createCategory(originalCategory,rootCategory,category,ns) {
|
||||
if ($("#palette-base-category-"+rootCategory).length === 0) {
|
||||
@@ -110,26 +110,13 @@ RED.palette = (function() {
|
||||
var popOverContent;
|
||||
try {
|
||||
var l = "<p><b>"+RED.text.bidi.enforceTextDirectionWithUCC(label)+"</b></p>";
|
||||
popOverContent = $('<div></div>').append($(l+(info?info:$("script[data-help-name='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim())
|
||||
if (label != type) {
|
||||
l = "<p><b>"+RED.text.bidi.enforceTextDirectionWithUCC(label)+"</b><br/><i>"+type+"</i></p>";
|
||||
}
|
||||
popOverContent = $(l+(info?info:$("script[data-help-name='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim())
|
||||
.filter(function(n) {
|
||||
return (this.nodeType == 1 && this.nodeName == "P") || (this.nodeType == 3 && this.textContent.trim().length > 0)
|
||||
}).slice(0,2));
|
||||
popOverContent.find("a").each(function(){
|
||||
var linkText = $(this).text();
|
||||
$(this).before(linkText);
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
var typeInfo = RED.nodes.getType(type);
|
||||
|
||||
if (typeInfo) {
|
||||
var metaData = "";
|
||||
if (typeInfo && !/^subflow:/.test(type)) {
|
||||
metaData = typeInfo.set.module+" : ";
|
||||
}
|
||||
metaData += type;
|
||||
$('<p>',{style:"font-size: 0.8em"}).text(metaData).appendTo(popOverContent);
|
||||
}
|
||||
}).slice(0,2);
|
||||
} catch(err) {
|
||||
// Malformed HTML may cause errors. TODO: need to understand what can break
|
||||
// NON-NLS: internal debug
|
||||
@@ -142,9 +129,9 @@ RED.palette = (function() {
|
||||
}
|
||||
|
||||
function setIcon(element,sf) {
|
||||
var icon_url = RED.utils.getNodeIcon(sf._def);
|
||||
var iconContainer = element.find(".palette_icon_container");
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
var iconElement = element.find(".palette_icon");
|
||||
var icon_url = RED.utils.getNodeIcon(sf._def,sf);
|
||||
iconElement.attr("style", "background-image: url("+icon_url+")");
|
||||
}
|
||||
|
||||
function escapeNodeType(nt) {
|
||||
@@ -182,7 +169,7 @@ RED.palette = (function() {
|
||||
if (def.icon) {
|
||||
var icon_url = RED.utils.getNodeIcon(def);
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"+(def.align=="right"?" palette_icon_container_right":"")}).appendTo(d);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
$('<div/>',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
|
||||
}
|
||||
|
||||
d.style.backgroundColor = RED.utils.getNodeColor(nt,def);
|
||||
@@ -288,8 +275,7 @@ RED.palette = (function() {
|
||||
}
|
||||
|
||||
for (var i=0;i<nodes.length;i++) {
|
||||
var node = d3.select(nodes[i]);
|
||||
if (node.classed('link_background') && !node.classed('link_link')) {
|
||||
if (d3.select(nodes[i]).classed('link_background')) {
|
||||
var length = nodes[i].getTotalLength();
|
||||
for (var j=0;j<length;j+=10) {
|
||||
var p = nodes[i].getPointAtLength(j);
|
||||
@@ -334,9 +320,9 @@ RED.palette = (function() {
|
||||
}
|
||||
setLabel(nt,$(d),label,nodeInfo);
|
||||
|
||||
var categoryNode = $("#palette-container-"+rootCategory);
|
||||
var categoryNode = $("#palette-container-"+category);
|
||||
if (categoryNode.find(".palette_node").length === 1) {
|
||||
categoryContainers[rootCategory].open();
|
||||
categoryContainers[category].open();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -502,22 +488,6 @@ RED.palette = (function() {
|
||||
}
|
||||
})
|
||||
|
||||
sidebarControls = $('<div class="sidebar-control-left"><i class="fa fa-chevron-left"</div>').appendTo($("#palette"));
|
||||
RED.popover.tooltip(sidebarControls,RED._("keyboard.togglePalette"),"core:toggle-palette");
|
||||
|
||||
sidebarControls.click(function() {
|
||||
RED.menu.toggleSelected("menu-item-palette");
|
||||
})
|
||||
$("#palette").on("mouseenter", function() {
|
||||
sidebarControls.toggle("slide", { direction: "left" }, 200);
|
||||
})
|
||||
$("#palette").on("mouseleave", function() {
|
||||
sidebarControls.hide();
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
var categoryList = coreCategories;
|
||||
if (RED.settings.paletteCategories) {
|
||||
categoryList = RED.settings.paletteCategories;
|
||||
@@ -539,8 +509,6 @@ RED.palette = (function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip($("#palette-collapse-all"),RED._('palette.actions.collapse-all'));
|
||||
|
||||
$("#palette-expand-all").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
for (var cat in categoryContainers) {
|
||||
@@ -549,29 +517,7 @@ RED.palette = (function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip($("#palette-expand-all"),RED._('palette.actions.expand-all'));
|
||||
|
||||
RED.actions.add("core:toggle-palette", function(state) {
|
||||
if (state === undefined) {
|
||||
RED.menu.toggleSelected("menu-item-palette");
|
||||
} else {
|
||||
togglePalette(state);
|
||||
}
|
||||
});
|
||||
}
|
||||
function togglePalette(state) {
|
||||
if (!state) {
|
||||
$("#main-container").addClass("palette-closed");
|
||||
sidebarControls.hide();
|
||||
sidebarControls.find("i").addClass("fa-chevron-right").removeClass("fa-chevron-left");
|
||||
} else {
|
||||
$("#main-container").removeClass("palette-closed");
|
||||
sidebarControls.find("i").removeClass("fa-chevron-right").addClass("fa-chevron-left");
|
||||
}
|
||||
setTimeout(function() { $(window).resize(); } ,200);
|
||||
}
|
||||
|
||||
|
||||
function getCategories() {
|
||||
var categories = [];
|
||||
$("#palette-container .palette-category").each(function(i,d) {
|
||||
|
||||
@@ -49,7 +49,7 @@ RED.projects.settings = (function() {
|
||||
var tabContainer;
|
||||
|
||||
var trayOptions = {
|
||||
title: RED._("sidebar.project.projectSettings.title"),
|
||||
title: RED._("menu.label.userSettings"),
|
||||
buttons: [
|
||||
{
|
||||
id: "node-dialog-ok",
|
||||
@@ -461,11 +461,7 @@ RED.projects.settings = (function() {
|
||||
setTimeout(function() {
|
||||
depsList.editableList('removeItem',entry);
|
||||
refreshModuleInUseCounts();
|
||||
if (modulesInUse.hasOwnProperty(entry.id)) {
|
||||
entry.count = modulesInUse[entry.id].count;
|
||||
} else {
|
||||
entry.count = 0;
|
||||
}
|
||||
entry.count = modulesInUse[entry.id].count;
|
||||
depsList.editableList('addItem',entry);
|
||||
},500);
|
||||
}
|
||||
|
||||
@@ -103,18 +103,6 @@ RED.projects = (function() {
|
||||
return container;
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
// id: "clipboard-dialog-cancel",
|
||||
text: "Open existing project", //RED._("projects.welcome.not-right-now"),
|
||||
class: "secondary",
|
||||
click: function() {
|
||||
createProjectOptions = {
|
||||
action: "open"
|
||||
}
|
||||
show('git-config');
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
// id: "clipboard-dialog-cancel",
|
||||
text: RED._("projects.welcome.not-right-now"),
|
||||
@@ -199,8 +187,6 @@ RED.projects = (function() {
|
||||
show('project-details');
|
||||
} else if (createProjectOptions.action === "clone") {
|
||||
show('clone-project');
|
||||
} else if (createProjectOptions.action === "open") {
|
||||
show('create',{screen:'open'})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,12 +200,12 @@ RED.sidebar.versionControl = (function() {
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
});
|
||||
RED.popover.tooltip(revertButton,RED._("sidebar.project.versionControl.revertChanges"));
|
||||
}
|
||||
bg = $('<span class="button-group"></span>').appendTo(entryTools);
|
||||
if (state !== 'unmerged') {
|
||||
var stageButton = $('<button class="editor-button editor-button-small"><i class="fa fa-'+((state==='unstaged')?"plus":"minus")+'"></i></button>')
|
||||
$('<button class="editor-button editor-button-small"><i class="fa fa-'+((state==='unstaged')?"plus":"minus")+'"></i></button>')
|
||||
.appendTo(bg)
|
||||
.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
@@ -231,7 +231,6 @@ RED.sidebar.versionControl = (function() {
|
||||
}
|
||||
},{});
|
||||
});
|
||||
RED.popover.tooltip(stageButton,RED._("sidebar.project.versionControl."+((state==='unstaged')?"stage":"unstage")+"Change"));
|
||||
}
|
||||
entry["update"+((state==='unstaged')?"Unstaged":"Staged")] = function(entry,status) {
|
||||
container.removeClass();
|
||||
@@ -322,13 +321,12 @@ RED.sidebar.versionControl = (function() {
|
||||
localChanges.content.css({height:"100%"});
|
||||
|
||||
var bg = $('<div style="float: right"></div>').appendTo(localChanges.header);
|
||||
var refreshButton = $('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
$('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
.appendTo(bg)
|
||||
.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
refresh(true);
|
||||
});
|
||||
RED.popover.tooltip(refreshButton,RED._("sidebar.project.versionControl.refreshChanges"));
|
||||
})
|
||||
|
||||
emptyStagedItem = { label: RED._("sidebar.project.versionControl.none") };
|
||||
emptyMergedItem = { label: RED._("sidebar.project.versionControl.conflictResolve") };
|
||||
@@ -345,7 +343,6 @@ RED.sidebar.versionControl = (function() {
|
||||
});
|
||||
updateBulk(toStage,true);
|
||||
});
|
||||
RED.popover.tooltip(stageAllButton,RED._("sidebar.project.versionControl.stageAllChange"));
|
||||
unstagedChangesList = $("<ol>",{style:"position: absolute; top: 30px; bottom: 0; right:0; left:0;"}).appendTo(unstagedContent);
|
||||
unstagedChangesList.editableList({
|
||||
addButton: false,
|
||||
@@ -435,7 +432,7 @@ RED.sidebar.versionControl = (function() {
|
||||
bg = $('<div style="float: right"></div>').appendTo(header);
|
||||
var showCommitBox = function() {
|
||||
commitMessage.val("");
|
||||
submitCommitButton.prop("disabled",true);
|
||||
submitCommitButton.attr("disabled",true);
|
||||
unstagedContent.css("height","30px");
|
||||
if (unmergedContent.is(":visible")) {
|
||||
unmergedContent.css("height","30px");
|
||||
@@ -447,10 +444,10 @@ RED.sidebar.versionControl = (function() {
|
||||
setTimeout(function() {
|
||||
commitBox.css("height","175px");
|
||||
},10);
|
||||
stageAllButton.prop("disabled",true);
|
||||
unstageAllButton.prop("disabled",true);
|
||||
commitButton.prop("disabled",true);
|
||||
abortMergeButton.prop("disabled",true);
|
||||
stageAllButton.attr("disabled",true);
|
||||
unstageAllButton.attr("disabled",true);
|
||||
commitButton.attr("disabled",true);
|
||||
abortMergeButton.attr("disabled",true);
|
||||
commitMessage.focus();
|
||||
}
|
||||
commitButton = $('<button class="editor-button editor-button-small" style="margin-right: 5px;">'+RED._("sidebar.project.versionControl.commit")+'</button>')
|
||||
@@ -460,7 +457,6 @@ RED.sidebar.versionControl = (function() {
|
||||
evt.stopPropagation();
|
||||
showCommitBox();
|
||||
});
|
||||
RED.popover.tooltip(commitButton,RED._("sidebar.project.versionControl.commitChanges"));
|
||||
unstageAllButton = $('<button class="editor-button editor-button-small"><i class="fa fa-minus"></i> '+RED._("sidebar.project.versionControl.all")+'</button>')
|
||||
.appendTo(bg)
|
||||
.click(function(evt) {
|
||||
@@ -472,7 +468,6 @@ RED.sidebar.versionControl = (function() {
|
||||
updateBulk(toUnstage,false);
|
||||
|
||||
});
|
||||
RED.popover.tooltip(unstageAllButton,RED._("sidebar.project.versionControl.unstageAllChange"));
|
||||
|
||||
|
||||
stagedChangesList = $("<ol>",{style:"position: absolute; top: 30px; bottom: 0; right:0; left:0;"}).appendTo(stagedContent);
|
||||
@@ -492,7 +487,7 @@ RED.sidebar.versionControl = (function() {
|
||||
var commitMessage = $('<textarea placeholder='+RED._("sidebar.project.versionControl.commitPlaceholder")+'></textarea>')
|
||||
.appendTo(commitBox)
|
||||
.on("change keyup paste",function() {
|
||||
submitCommitButton.prop('disabled',$(this).val().trim()==="");
|
||||
submitCommitButton.attr('disabled',$(this).val().trim()==="");
|
||||
});
|
||||
var commitToolbar = $('<div class="sidebar-version-control-slide-box-toolbar button-group">').appendTo(commitBox);
|
||||
|
||||
@@ -508,10 +503,10 @@ RED.sidebar.versionControl = (function() {
|
||||
setTimeout(function() {
|
||||
commitBox.hide();
|
||||
},200);
|
||||
stageAllButton.prop("disabled",false);
|
||||
unstageAllButton.prop("disabled",false);
|
||||
commitButton.prop("disabled",false);
|
||||
abortMergeButton.prop("disabled",false);
|
||||
stageAllButton.attr("disabled",false);
|
||||
unstageAllButton.attr("disabled",false);
|
||||
commitButton.attr("disabled",false);
|
||||
abortMergeButton.attr("disabled",false);
|
||||
|
||||
})
|
||||
var submitCommitButton = $('<button class="editor-button">'+RED._("sidebar.project.versionControl.commitCapital")+'</button>')
|
||||
@@ -554,14 +549,13 @@ RED.sidebar.versionControl = (function() {
|
||||
collapsible: true
|
||||
});
|
||||
|
||||
bg = $('<div style="float: right"></div>').appendTo(localHistory.header);
|
||||
refreshButton = $('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
var bg = $('<div style="float: right"></div>').appendTo(localHistory.header);
|
||||
$('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>')
|
||||
.appendTo(bg)
|
||||
.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
refresh(true,true);
|
||||
})
|
||||
RED.popover.tooltip(refreshButton,RED._("sidebar.project.versionControl.refreshCommitHistory"))
|
||||
|
||||
var localBranchToolbar = $('<div class="sidebar-version-control-change-header" style="text-align: right;"></div>').appendTo(localHistory.content);
|
||||
|
||||
@@ -584,7 +578,6 @@ RED.sidebar.versionControl = (function() {
|
||||
},100);
|
||||
}
|
||||
})
|
||||
RED.popover.tooltip(localBranchButton,RED._("sidebar.project.versionControl.changeLocalBranch"))
|
||||
var repoStatusButton = $('<button class="editor-button editor-button-small" style="margin-left: 10px;" id="sidebar-version-control-repo-status-button">'+
|
||||
'<span id="sidebar-version-control-repo-status-stats">'+
|
||||
'<i class="fa fa-long-arrow-up"></i> <span id="sidebar-version-control-commits-ahead"></span> '+
|
||||
@@ -613,7 +606,6 @@ RED.sidebar.versionControl = (function() {
|
||||
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip(repoStatusButton,RED._("sidebar.project.versionControl.manageRemoteBranch"))
|
||||
|
||||
localCommitList = $("<ol>",{style:"position: absolute; top: 30px; bottom: 0px; right:0; left:0;"}).appendTo(localHistory.content);
|
||||
localCommitListShade = $('<div class="component-shade" style="z-Index: 3"></div>').css('top',"30px").hide().appendTo(localHistory.content);
|
||||
@@ -863,8 +855,8 @@ RED.sidebar.versionControl = (function() {
|
||||
} else {
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(RED._("sidebar.project.versionControl.selectUpstreamBranch"));
|
||||
}
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',false);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -878,13 +870,7 @@ RED.sidebar.versionControl = (function() {
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
var spinner = utils.addSpinnerOverlay(remoteBox).addClass("projects-dialog-spinner-contain");
|
||||
var buttonRow = $('<div style="position: relative; bottom: 60px;"></div>').appendTo(spinner);
|
||||
$('<button class="editor-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).click(function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
var activeProject = RED.projects.getActiveProject();
|
||||
RED.eventLog.startEvent("Push changes"+(activeProject.git.branches.remoteAlt?(" : "+activeProject.git.branches.remoteAlt):""));
|
||||
var url = "projects/"+activeProject.name+"/push";
|
||||
if (activeProject.git.branches.remoteAlt) {
|
||||
url+="/"+activeProject.git.branches.remoteAlt;
|
||||
@@ -928,13 +914,7 @@ RED.sidebar.versionControl = (function() {
|
||||
var pullRemote = function(options) {
|
||||
options = options || {};
|
||||
var spinner = utils.addSpinnerOverlay(remoteBox).addClass("projects-dialog-spinner-contain");
|
||||
var buttonRow = $('<div style="position: relative; bottom: 60px;"></div>').appendTo(spinner);
|
||||
$('<button class="editor-button"></button>').text(RED._("eventLog.view")).appendTo(buttonRow).click(function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.actions.invoke("core:show-event-log");
|
||||
});
|
||||
var activeProject = RED.projects.getActiveProject();
|
||||
RED.eventLog.startEvent("Pull changes"+(activeProject.git.branches.remoteAlt?(" : "+activeProject.git.branches.remoteAlt):""));
|
||||
var url = "projects/"+activeProject.name+"/pull";
|
||||
if (activeProject.git.branches.remoteAlt) {
|
||||
url+="/"+activeProject.git.branches.remoteAlt;
|
||||
@@ -1029,7 +1009,6 @@ RED.sidebar.versionControl = (function() {
|
||||
enableOnEdit: false,
|
||||
pinned: true,
|
||||
iconClass: "fa fa-code-fork",
|
||||
action: "core:show-version-control-tab",
|
||||
onchange: function() {
|
||||
setTimeout(function() {
|
||||
sections.resize();
|
||||
@@ -1255,9 +1234,9 @@ RED.sidebar.versionControl = (function() {
|
||||
var unstagedCount = unstagedChangesList.editableList('length');
|
||||
var unmergedCount = unmergedChangesList.editableList('length');
|
||||
|
||||
commitButton.prop('disabled',(isMerging && unmergedCount > 0)||(!isMerging && stagedCount === 0));
|
||||
stageAllButton.prop('disabled',unstagedCount === 0);
|
||||
unstageAllButton.prop('disabled',stagedCount === 0);
|
||||
commitButton.attr('disabled',(isMerging && unmergedCount > 0)||(!isMerging && stagedCount === 0));
|
||||
stageAllButton.attr('disabled',unstagedCount === 0);
|
||||
unstageAllButton.attr('disabled',stagedCount === 0);
|
||||
|
||||
if (stagedCount === 0) {
|
||||
stagedChangesList.editableList('addItem',emptyStagedItem);
|
||||
@@ -1307,9 +1286,9 @@ RED.sidebar.versionControl = (function() {
|
||||
if (result.branches.hasOwnProperty("remoteError") && result.branches.remoteError.code !== 'git_remote_gone') {
|
||||
$("#sidebar-version-control-repo-status-auth-issue").show();
|
||||
$("#sidebar-version-control-repo-status-stats").hide();
|
||||
$('#sidebar-version-control-repo-branch').prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',true);
|
||||
$('#sidebar-version-control-repo-branch').attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',true);
|
||||
$('#sidebar-version-control-repo-toolbar-message').hide();
|
||||
$('#sidebar-version-control-repo-toolbar-error-message').show();
|
||||
} else {
|
||||
@@ -1319,7 +1298,7 @@ RED.sidebar.versionControl = (function() {
|
||||
$("#sidebar-version-control-repo-status-auth-issue").hide();
|
||||
$("#sidebar-version-control-repo-status-stats").show();
|
||||
|
||||
$('#sidebar-version-control-repo-branch').prop('disabled',false);
|
||||
$('#sidebar-version-control-repo-branch').attr('disabled',false);
|
||||
|
||||
$("#sidebar-version-control-repo-status-button").show();
|
||||
if (result.branches.hasOwnProperty('remote')) {
|
||||
@@ -1329,8 +1308,8 @@ RED.sidebar.versionControl = (function() {
|
||||
$('#sidebar-version-control-commits-behind').text("");
|
||||
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(RED._("sidebar.project.versionControl.notTracking"));
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1355,27 +1334,27 @@ RED.sidebar.versionControl = (function() {
|
||||
$('#sidebar-version-control-commits-behind').text(commitsBehind);
|
||||
if (isMerging) {
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(RED._("sidebar.project.versionControl.statusUnmergedChanged"));
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',true);
|
||||
} else if (commitsAhead > 0 && commitsBehind === 0) {
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(RED._("sidebar.project.versionControl.commitsAhead", {count:commitsAhead}));
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',false);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',false);
|
||||
} else if (commitsAhead === 0 && commitsBehind > 0) {
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(RED._("sidebar.project.versionControl.commitsBehind",{ count: commitsBehind }));
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',false);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',false);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',true);
|
||||
} else if (commitsAhead > 0 && commitsBehind > 0) {
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(
|
||||
RED._("sidebar.project.versionControl.commitsAheadAndBehind1",{ count:commitsBehind })+
|
||||
RED._("sidebar.project.versionControl.commitsAheadAndBehind2",{ count:commitsAhead })+
|
||||
RED._("sidebar.project.versionControl.commitsAheadAndBehind3",{ count:commitsBehind }));
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',false);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',false);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',true);
|
||||
} else if (commitsAhead === 0 && commitsBehind === 0) {
|
||||
$('#sidebar-version-control-repo-toolbar-message').text(RED._("sidebar.project.versionControl.repositoryUpToDate"));
|
||||
$("#sidebar-version-control-repo-pull").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").prop('disabled',true);
|
||||
$("#sidebar-version-control-repo-pull").attr('disabled',true);
|
||||
$("#sidebar-version-control-repo-push").attr('disabled',true);
|
||||
}
|
||||
}
|
||||
function show() {
|
||||
|
||||
@@ -203,7 +203,7 @@ RED.search = (function() {
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, true);
|
||||
$('<div/>',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
|
||||
|
||||
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
|
||||
if (node.z) {
|
||||
|
||||
@@ -105,8 +105,6 @@ RED.sidebar = (function() {
|
||||
}
|
||||
|
||||
var sidebarSeparator = {};
|
||||
sidebarSeparator.dragging = false;
|
||||
|
||||
$("#sidebar-separator").draggable({
|
||||
axis: "x",
|
||||
start:function(event,ui) {
|
||||
@@ -116,7 +114,6 @@ RED.sidebar = (function() {
|
||||
sidebarSeparator.start = ui.position.left;
|
||||
sidebarSeparator.chartWidth = $("#workspace").width();
|
||||
sidebarSeparator.chartRight = winWidth-$("#workspace").width()-$("#workspace").offset().left-2;
|
||||
sidebarSeparator.dragging = true;
|
||||
|
||||
if (!RED.menu.isSelected("menu-item-sidebar")) {
|
||||
sidebarSeparator.opening = true;
|
||||
@@ -169,7 +166,6 @@ RED.sidebar = (function() {
|
||||
RED.events.emit("sidebar:resize");
|
||||
},
|
||||
stop:function(event,ui) {
|
||||
sidebarSeparator.dragging = false;
|
||||
if (sidebarSeparator.closing) {
|
||||
$("#sidebar").removeClass("closing");
|
||||
RED.menu.setSelected("menu-item-sidebar",false);
|
||||
@@ -185,27 +181,6 @@ RED.sidebar = (function() {
|
||||
}
|
||||
});
|
||||
|
||||
var sidebarControls = $('<div class="sidebar-control-right"><i class="fa fa-chevron-right"</div>').appendTo($("#sidebar-separator"));
|
||||
sidebarControls.click(function() {
|
||||
sidebarControls.hide();
|
||||
RED.menu.toggleSelected("menu-item-sidebar");
|
||||
})
|
||||
$("#sidebar-separator").on("mouseenter", function() {
|
||||
if (!sidebarSeparator.dragging) {
|
||||
if (RED.menu.isSelected("menu-item-sidebar")) {
|
||||
sidebarControls.find("i").addClass("fa-chevron-right").removeClass("fa-chevron-left");
|
||||
} else {
|
||||
sidebarControls.find("i").removeClass("fa-chevron-right").addClass("fa-chevron-left");
|
||||
}
|
||||
sidebarControls.toggle("slide", { direction: "right" }, 200);
|
||||
}
|
||||
})
|
||||
$("#sidebar-separator").on("mouseleave", function() {
|
||||
if (!sidebarSeparator.dragging) {
|
||||
sidebarControls.hide();
|
||||
}
|
||||
});
|
||||
|
||||
function toggleSidebar(state) {
|
||||
if (!state) {
|
||||
$("#main-container").addClass("sidebar-closed");
|
||||
@@ -240,7 +215,6 @@ RED.sidebar = (function() {
|
||||
toggleSidebar(state);
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip($("#sidebar-separator").find(".sidebar-control-right"),RED._("keyboard.toggleSidebar"),"core:toggle-sidebar");
|
||||
showSidebar();
|
||||
RED.sidebar.info.init();
|
||||
RED.sidebar.config.init();
|
||||
|
||||
@@ -370,7 +370,9 @@ RED.subflow = (function() {
|
||||
return {
|
||||
nodes:removedNodes,
|
||||
links:removedLinks,
|
||||
subflows: [activeSubflow]
|
||||
subflow: {
|
||||
subflow: activeSubflow
|
||||
}
|
||||
}
|
||||
}
|
||||
function init() {
|
||||
|
||||
@@ -15,19 +15,16 @@
|
||||
**/
|
||||
RED.sidebar.config = (function() {
|
||||
|
||||
|
||||
var content = document.createElement("div");
|
||||
content.className = "sidebar-node-config";
|
||||
content.id = "sidebar-node-config";
|
||||
content.tabIndex = 0;
|
||||
|
||||
$('<div class="sidebar-header"><span class="button-group">'+
|
||||
'<a class="sidebar-header-button-toggle selected" id="workspace-config-node-filter-all" href="#"><span data-i18n="sidebar.config.filterAll"></span></a>'+
|
||||
'<a class="sidebar-header-button-toggle" id="workspace-config-node-filter-unused" href="#"><span data-i18n="sidebar.config.filterUnused"></span></a> '+
|
||||
'</span></div>'
|
||||
$('<div class="button-group sidebar-header">'+
|
||||
'<a style="float:left;" class="sidebar-header-button selected" id="workspace-config-node-delete-all" href="#"><span data-i18n="sidebar.config.deleteUnused"></a>'+
|
||||
'<a class="sidebar-header-button-toggle" id="workspace-config-node-filter-all" href="#"><span data-i18n="sidebar.config.filterAll"></span></a>'+
|
||||
'<a class="sidebar-header-button-toggle selected" id="workspace-config-node-filter-unused" href="#"><span data-i18n="sidebar.config.filterUnused"></span></a> '+
|
||||
'</div>'
|
||||
).appendTo(content);
|
||||
|
||||
|
||||
var toolbar = $('<div>'+
|
||||
'<a class="sidebar-footer-button" id="workspace-config-node-collapse-all" href="#"><i class="fa fa-angle-double-up"></i></a> '+
|
||||
'<a class="sidebar-footer-button" id="workspace-config-node-expand-all" href="#"><i class="fa fa-angle-double-down"></i></a>'+
|
||||
@@ -38,7 +35,7 @@ RED.sidebar.config = (function() {
|
||||
var subflowCategories = $("<div>").appendTo(content);
|
||||
|
||||
var showUnusedOnly = false;
|
||||
|
||||
var unused = [];
|
||||
var categories = {};
|
||||
|
||||
function getOrCreateCategory(name,parent,label) {
|
||||
@@ -112,6 +109,17 @@ RED.sidebar.config = (function() {
|
||||
if (A.type > B.type) { return 1;}
|
||||
return 0;
|
||||
});
|
||||
|
||||
unused = nodes.filter(function(n) {
|
||||
return n._def.hasUsers!==false && n.users.length === 0;
|
||||
})
|
||||
|
||||
if (unused.length > 0) {
|
||||
$('#workspace-config-node-delete-all').addClass("selected");
|
||||
} else {
|
||||
$('#workspace-config-node-delete-all').removeClass("selected");
|
||||
}
|
||||
|
||||
if (showUnusedOnly) {
|
||||
var hiddenCount = nodes.length;
|
||||
nodes = nodes.filter(function(n) {
|
||||
@@ -140,37 +148,21 @@ RED.sidebar.config = (function() {
|
||||
}
|
||||
|
||||
var entry = $('<li class="palette_node config_node palette_node_id_'+node.id.replace(/\./g,"-")+'"></li>').appendTo(list);
|
||||
entry.data('node',node.id);
|
||||
$('<div class="palette_label"></div>').text(label).appendTo(entry);
|
||||
if (node._def.hasUsers !== false) {
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container palette_icon_container_right"}).appendTo(entry);
|
||||
if (node.users.length === 0) {
|
||||
iconContainer.text(0);
|
||||
} else {
|
||||
$('<a href="#"/>').click(function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
RED.search.show(node.id);
|
||||
}).text(node.users.length).appendTo(iconContainer);
|
||||
}
|
||||
RED.popover.tooltip(iconContainer,RED._('editor.nodesUse',{count:node.users.length}));
|
||||
var butt = $('<a href="#"/>').click(function(e) { e.preventDefault(); RED.search.show(node.id); }).text(node.users.length).appendTo(iconContainer);
|
||||
if (node.users.length === 0) {
|
||||
entry.addClass("config_node_unused");
|
||||
}
|
||||
}
|
||||
entry.on('click',function(e) {
|
||||
RED.view.select(false);
|
||||
if (e.metaKey) {
|
||||
$(this).toggleClass("selected");
|
||||
} else {
|
||||
$(content).find(".palette_node").removeClass("selected");
|
||||
$(this).addClass("selected");
|
||||
}
|
||||
RED.sidebar.info.refresh(node);
|
||||
});
|
||||
entry.on('dblclick',function(e) {
|
||||
RED.editor.editConfig("", node.type, node.id);
|
||||
});
|
||||
|
||||
var userArray = node.users.map(function(n) { return n.id });
|
||||
entry.on('mouseover',function(e) {
|
||||
RED.nodes.eachNode(function(node) {
|
||||
@@ -241,63 +233,9 @@ RED.sidebar.config = (function() {
|
||||
content: content,
|
||||
toolbar: toolbar,
|
||||
iconClass: "fa fa-cog",
|
||||
action: "core:show-config-tab",
|
||||
onchange: function() { refreshConfigNodeList(); }
|
||||
});
|
||||
RED.actions.add("core:show-config-tab", function() {RED.sidebar.show('config')});
|
||||
RED.actions.add("core:select-all-config-nodes", function() {
|
||||
$(content).find(".palette_node").addClass("selected");
|
||||
})
|
||||
RED.actions.add("core:delete-config-selection", function() {
|
||||
var selectedNodes = [];
|
||||
$(content).find(".palette_node.selected").each(function() {
|
||||
selectedNodes.push($(this).data('node'));
|
||||
});
|
||||
if (selectedNodes.length > 0) {
|
||||
var historyEvent = {
|
||||
t:'delete',
|
||||
nodes:[],
|
||||
changes: {},
|
||||
dirty: RED.nodes.dirty()
|
||||
}
|
||||
selectedNodes.forEach(function(id) {
|
||||
var node = RED.nodes.node(id);
|
||||
try {
|
||||
if (node._def.oneditdelete) {
|
||||
node._def.oneditdelete.call(node);
|
||||
}
|
||||
} catch(err) {
|
||||
console.log("oneditdelete",node.id,node.type,err.toString());
|
||||
}
|
||||
historyEvent.nodes.push(node);
|
||||
for (var i=0;i<node.users.length;i++) {
|
||||
var user = node.users[i];
|
||||
historyEvent.changes[user.id] = {
|
||||
changed: user.changed,
|
||||
valid: user.valid
|
||||
};
|
||||
for (var d in user._def.defaults) {
|
||||
if (user._def.defaults.hasOwnProperty(d) && user[d] == id) {
|
||||
historyEvent.changes[user.id][d] = id
|
||||
user[d] = "";
|
||||
user.changed = true;
|
||||
user.dirty = true;
|
||||
}
|
||||
}
|
||||
RED.editor.validateNode(user);
|
||||
}
|
||||
RED.nodes.remove(id);
|
||||
})
|
||||
RED.nodes.dirty(true);
|
||||
RED.view.redraw(true);
|
||||
RED.history.push(historyEvent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
RED.events.on("view:selection-changed",function() {
|
||||
$(content).find(".palette_node").removeClass("selected");
|
||||
});
|
||||
RED.actions.add("core:show-config-tab",function() {RED.sidebar.show('config')});
|
||||
|
||||
$("#workspace-config-node-collapse-all").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
@@ -317,6 +255,41 @@ RED.sidebar.config = (function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#workspace-config-node-delete-all").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
unused.forEach(function(node) {
|
||||
var configTypeDef = RED.nodes.getType(node.type);
|
||||
if (configTypeDef.oneditdelete) {
|
||||
configTypeDef.oneditdelete.call(node);
|
||||
}
|
||||
var historyEvent = {
|
||||
t:'delete',
|
||||
nodes:[node],
|
||||
changes: {},
|
||||
dirty: RED.nodes.dirty()
|
||||
}
|
||||
for (var i=0; i<node.users.length; i++) {
|
||||
var user = node.users[i];
|
||||
historyEvent.changes[user.id] = {
|
||||
changed: user.changed,
|
||||
valid: user.valid
|
||||
};
|
||||
for (var d in user._def.defaults) {
|
||||
if (user._def.defaults.hasOwnProperty(d) && user[d] == configId) {
|
||||
historyEvent.changes[user.id][d] = configId
|
||||
user[d] = "";
|
||||
user.changed = true;
|
||||
user.dirty = true;
|
||||
}
|
||||
}
|
||||
validateNode(user);
|
||||
}
|
||||
RED.nodes.remove(node.id);
|
||||
RED.nodes.dirty(true);
|
||||
RED.view.redraw(true);
|
||||
RED.history.push(historyEvent);
|
||||
});
|
||||
});
|
||||
$('#workspace-config-node-filter-all').on("click",function(e) {
|
||||
e.preventDefault();
|
||||
if (showUnusedOnly) {
|
||||
@@ -335,10 +308,8 @@ RED.sidebar.config = (function() {
|
||||
refreshConfigNodeList();
|
||||
}
|
||||
});
|
||||
RED.popover.tooltip($('#workspace-config-node-filter-all'),"Show all config nodes");
|
||||
RED.popover.tooltip($('#workspace-config-node-filter-unused'),"Show all unused config nodes");
|
||||
|
||||
}
|
||||
|
||||
function show(id) {
|
||||
if (typeof id === 'boolean') {
|
||||
if (id) {
|
||||
@@ -380,6 +351,7 @@ RED.sidebar.config = (function() {
|
||||
}
|
||||
RED.sidebar.show("config");
|
||||
}
|
||||
|
||||
return {
|
||||
init:init,
|
||||
show:show,
|
||||
|
||||
@@ -132,8 +132,7 @@ RED.sidebar.context = (function() {
|
||||
content: content,
|
||||
toolbar: footerToolbar,
|
||||
// pinned: true,
|
||||
enableOnEdit: true,
|
||||
action: "core:show-context-tab"
|
||||
enableOnEdit: false
|
||||
});
|
||||
|
||||
// var toggleLiveButton = $("#sidebar-context-toggle-live");
|
||||
@@ -237,83 +236,29 @@ RED.sidebar.context = (function() {
|
||||
var propRow = $('<tr class="node-info-node-row"><td class="sidebar-context-property"></td><td></td></tr>').appendTo(container);
|
||||
var obj = $(propRow.children()[0]);
|
||||
obj.text(k);
|
||||
var tools = $('<span class="button-group"></span>');
|
||||
|
||||
var tools = $('<span class="debug-message-tools button-group"></span>').appendTo(obj);
|
||||
var refreshItem = $('<button class="editor-button editor-button-small"><i class="fa fa-refresh"></i></button>').appendTo(tools).click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$.getJSON(baseUrl+"/"+k+"?store="+v.store, function(data) {
|
||||
if (data.msg !== payload || data.format !== format) {
|
||||
payload = data.msg;
|
||||
format = data.format;
|
||||
tools.detach();
|
||||
$(propRow.children()[1]).empty();
|
||||
RED.utils.createObjectElement(RED.utils.decodeObject(payload,format), {
|
||||
typeHint: data.format,
|
||||
sourceId: id+"."+k,
|
||||
tools: tools
|
||||
}).appendTo(propRow.children()[1]);
|
||||
}
|
||||
$(propRow.children()[1]).empty();
|
||||
var payload = data.msg;
|
||||
var format = data.format;
|
||||
payload = RED.utils.decodeObject(payload,format);
|
||||
RED.utils.createObjectElement(payload, {
|
||||
typeHint: data.format,
|
||||
sourceId: id+"."+k
|
||||
}).appendTo(propRow.children()[1]);
|
||||
})
|
||||
});
|
||||
var deleteItem = $('<button class="editor-button editor-button-small"><i class="fa fa-trash"></i></button>').appendTo(tools).click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var popover = RED.popover.create({
|
||||
trigger: 'modal',
|
||||
target: propRow,
|
||||
direction: "left",
|
||||
content: function() {
|
||||
var content = $('<div>');
|
||||
$('<p data-i18n="sidebar.context.deleteConfirm"></p>').appendTo(content);
|
||||
var row = $('<p>').appendTo(content);
|
||||
var bg = $('<span class="button-group"></span>').appendTo(row);
|
||||
$('<button class="editor-button" data-i18n="common.label.cancel"></button>').appendTo(bg).click(function(e) {
|
||||
e.preventDefault();
|
||||
popover.close();
|
||||
});
|
||||
bg = $('<span class="button-group"></span>').appendTo(row);
|
||||
$('<button class="editor-button primary" data-i18n="common.label.delete"></button>').appendTo(bg).click(function(e) {
|
||||
e.preventDefault();
|
||||
popover.close();
|
||||
$.ajax({
|
||||
url: baseUrl+"/"+k+"?store="+v.store,
|
||||
type: "DELETE"
|
||||
}).done(function(data,textStatus,xhr) {
|
||||
$.getJSON(baseUrl+"/"+k+"?store="+v.store, function(data) {
|
||||
if (data.format === 'undefined') {
|
||||
propRow.remove();
|
||||
if (container.children().length === 0) {
|
||||
$('<tr class="node-info-node-row red-ui-search-empty blank" colspan="2"><td data-i18n="sidebar.context.empty"></td></tr>').appendTo(container).i18n();
|
||||
}
|
||||
} else {
|
||||
payload = data.msg;
|
||||
format = data.format;
|
||||
tools.detach();
|
||||
$(propRow.children()[1]).empty();
|
||||
RED.utils.createObjectElement(RED.utils.decodeObject(payload,format), {
|
||||
typeHint: data.format,
|
||||
sourceId: id+"."+k,
|
||||
tools: tools
|
||||
}).appendTo(propRow.children()[1]);
|
||||
}
|
||||
});
|
||||
}).fail(function(xhr,textStatus,err) {
|
||||
|
||||
})
|
||||
});
|
||||
return content.i18n();
|
||||
}
|
||||
});
|
||||
popover.open();
|
||||
|
||||
});
|
||||
var payload = v.msg;
|
||||
var format = v.format;
|
||||
RED.utils.createObjectElement(RED.utils.decodeObject(payload,format), {
|
||||
payload = RED.utils.decodeObject(payload,format);
|
||||
RED.utils.createObjectElement(payload, {
|
||||
typeHint: v.format,
|
||||
sourceId: id+"."+k,
|
||||
tools: tools
|
||||
sourceId: id+"."+k
|
||||
}).appendTo(propRow.children()[1]);
|
||||
if (contextStores.length > 1) {
|
||||
$("<span>",{class:"sidebar-context-property-storename"}).text(v.store).appendTo($(propRow.children()[0]))
|
||||
|
||||
@@ -92,7 +92,6 @@ RED.sidebar.info = (function() {
|
||||
label: RED._("sidebar.info.label"),
|
||||
name: RED._("sidebar.info.name"),
|
||||
iconClass: "fa fa-info",
|
||||
action:"core:show-info-tab",
|
||||
content: content,
|
||||
pinned: true,
|
||||
enableOnEdit: true
|
||||
@@ -133,7 +132,6 @@ RED.sidebar.info = (function() {
|
||||
|
||||
var table = $('<table class="node-info"></table>').appendTo(propertiesSection.content);
|
||||
var tableBody = $('<tbody>').appendTo(table);
|
||||
|
||||
var subflowNode;
|
||||
var subflowUserCount;
|
||||
|
||||
@@ -142,13 +140,12 @@ RED.sidebar.info = (function() {
|
||||
propRow = $('<tr class="node-info-node-row"><td>Project</td><td></td></tr>').appendTo(tableBody);
|
||||
$(propRow.children()[1]).text(activeProject.name||"");
|
||||
$('<tr class="node-info-property-expand blank"><td colspan="2"></td></tr>').appendTo(tableBody);
|
||||
var editProjectButton = $('<button class="editor-button editor-button-small" style="position:absolute;right:2px;"><i class="fa fa-ellipsis-h"></i></button>')
|
||||
$('<button class="editor-button editor-button-small" style="position:absolute;right:2px;"><i class="fa fa-ellipsis-h"></i></button>')
|
||||
.appendTo(propRow.children()[1])
|
||||
.click(function(evt) {
|
||||
evt.preventDefault();
|
||||
RED.projects.editProject();
|
||||
});
|
||||
RED.popover.tooltip(editProjectButton,RED._('sidebar.project.showProjectSettings'));
|
||||
}
|
||||
propertiesSection.container.show();
|
||||
infoSection.container.show();
|
||||
@@ -158,37 +155,11 @@ RED.sidebar.info = (function() {
|
||||
} else if (Array.isArray(node)) {
|
||||
// Multiple things selected
|
||||
// - hide help and info sections
|
||||
|
||||
var types = {
|
||||
nodes:0,
|
||||
flows:0,
|
||||
subflows:0
|
||||
}
|
||||
node.forEach(function(n) {
|
||||
if (n.type === 'tab') {
|
||||
types.flows++;
|
||||
types.nodes += RED.nodes.filterNodes({z:n.id}).length;
|
||||
} else if (n.type === 'subflow') {
|
||||
types.subflows++;
|
||||
} else {
|
||||
types.nodes++;
|
||||
}
|
||||
});
|
||||
helpSection.container.hide();
|
||||
infoSection.container.hide();
|
||||
// - show the count of selected nodes
|
||||
propRow = $('<tr class="node-info-node-row"><td>'+RED._("sidebar.info.selection")+"</td><td></td></tr>").appendTo(tableBody);
|
||||
|
||||
var counts = $('<div>').appendTo($(propRow.children()[1]));
|
||||
if (types.flows > 0) {
|
||||
$('<div>').text(RED._("clipboard.flow",{count:types.flows})).appendTo(counts);
|
||||
}
|
||||
if (types.subflows > 0) {
|
||||
$('<div>').text(RED._("clipboard.subflow",{count:types.subflows})).appendTo(counts);
|
||||
}
|
||||
if (types.nodes > 0) {
|
||||
$('<div>').text(RED._("clipboard.node",{count:types.nodes})).appendTo(counts);
|
||||
}
|
||||
$(propRow.children()[1]).text(RED._("sidebar.info.nodes",{count:node.length}))
|
||||
} else {
|
||||
// A single 'thing' selected.
|
||||
|
||||
@@ -234,7 +205,6 @@ RED.sidebar.info = (function() {
|
||||
$('<span style="float: right; font-size: 0.8em"><i class="fa fa-warning"></i></span>').prependTo($(propRow.children()[1]))
|
||||
}
|
||||
}
|
||||
var count = 0;
|
||||
if (!m && node.type != "subflow") {
|
||||
var defaults;
|
||||
if (node.type === 'unknown') {
|
||||
@@ -246,13 +216,9 @@ RED.sidebar.info = (function() {
|
||||
})
|
||||
} else if (node._def) {
|
||||
defaults = node._def.defaults;
|
||||
propRow = $('<tr class="node-info-property-row'+(expandedSections.property?"":" hide")+'"><td>'+RED._("sidebar.info.module")+"</td><td></td></tr>").appendTo(tableBody);
|
||||
$(propRow.children()[1]).text(RED.nodes.getType(node.type).set.module);
|
||||
count++;
|
||||
}
|
||||
$('<tr class="node-info-property-expand node-info-property-row blank'+(expandedSections.property?"":" hide")+'"><td colspan="2"></td></tr>').appendTo(tableBody);
|
||||
|
||||
if (defaults) {
|
||||
var count = 0;
|
||||
for (var n in defaults) {
|
||||
if (n != "name" && n != "info" && defaults.hasOwnProperty(n)) {
|
||||
var val = node[n];
|
||||
@@ -286,9 +252,9 @@ RED.sidebar.info = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count > 0) {
|
||||
$('<tr class="node-info-property-expand blank"><td colspan="2"><a href="#" class=" node-info-property-header'+(expandedSections.property?" expanded":"")+'"><span class="node-info-property-show-more">'+RED._("sidebar.info.showMore")+'</span><span class="node-info-property-show-less">'+RED._("sidebar.info.showLess")+'</span> <i class="fa fa-caret-down"></i></a></td></tr>').appendTo(tableBody);
|
||||
if (count > 0) {
|
||||
$('<tr class="node-info-property-expand blank"><td colspan="2"><a href="#" class=" node-info-property-header'+(expandedSections.property?" expanded":"")+'"><span class="node-info-property-show-more">'+RED._("sidebar.info.showMore")+'</span><span class="node-info-property-show-less">'+RED._("sidebar.info.showLess")+'</span> <i class="fa fa-caret-down"></i></a></td></tr>').appendTo(tableBody);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (node.type !== 'tab') {
|
||||
@@ -340,20 +306,6 @@ RED.sidebar.info = (function() {
|
||||
$(".node-info-property-row").toggle(expandedSections["property"]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// $('<tr class="blank"><th colspan="2"></th></tr>').appendTo(tableBody);
|
||||
// propRow = $('<tr class="node-info-node-row"><td>Actions</td><td></td></tr>').appendTo(tableBody);
|
||||
// var actionBar = $(propRow.children()[1]);
|
||||
//
|
||||
// // var actionBar = $('<div>',{style:"background: #fefefe; padding: 3px;"}).appendTo(propertiesSection.content);
|
||||
// $('<button type="button" class="editor-button"><i class="fa fa-code"></i></button>').appendTo(actionBar);
|
||||
// $('<button type="button" class="editor-button"><i class="fa fa-code"></i></button>').appendTo(actionBar);
|
||||
// $('<button type="button" class="editor-button"><i class="fa fa-code"></i></button>').appendTo(actionBar);
|
||||
// $('<button type="button" class="editor-button"><i class="fa fa-code"></i></button>').appendTo(actionBar);
|
||||
|
||||
|
||||
|
||||
}
|
||||
function setInfoText(infoText,target) {
|
||||
var info = addTargetToExternalLinks($('<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(infoText)+'">'+infoText+'</span></div>')).appendTo(target);
|
||||
@@ -484,8 +436,6 @@ RED.sidebar.info = (function() {
|
||||
} else {
|
||||
refresh(selection.nodes);
|
||||
}
|
||||
} else if (selection.flows || selection.subflows) {
|
||||
refresh(selection.flows);
|
||||
} else {
|
||||
var activeWS = RED.workspaces.active();
|
||||
|
||||
|
||||
@@ -140,12 +140,11 @@ RED.tray = (function() {
|
||||
|
||||
// tray.body.parent().width(Math.min($("#editor-stack").position().left-8,tray.width));
|
||||
|
||||
|
||||
$("#main-container").scrollLeft(0);
|
||||
el.css({
|
||||
right: -(el.width()+10)+"px",
|
||||
transition: "right 0.25s ease"
|
||||
});
|
||||
$("#workspace").scrollLeft(0);
|
||||
handleWindowResize();
|
||||
openingTray = true;
|
||||
setTimeout(function() {
|
||||
|
||||
@@ -133,7 +133,7 @@ RED.typeSearch = (function() {
|
||||
nodeDiv.css('backgroundColor',colour);
|
||||
|
||||
var iconContainer = $('<div/>',{class:"palette_icon_container"}).appendTo(nodeDiv);
|
||||
RED.utils.createIconElement(icon_url, iconContainer, false);
|
||||
$('<div/>',{class:"palette_icon",style:"background-image: url("+icon_url+")"}).appendTo(iconContainer);
|
||||
|
||||
if (def.inputs > 0) {
|
||||
$('<div/>',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv);
|
||||
@@ -200,7 +200,7 @@ RED.typeSearch = (function() {
|
||||
dialog.hide();
|
||||
searchResultsDiv.hide();
|
||||
}
|
||||
refreshTypeList(opts);
|
||||
refreshTypeList();
|
||||
addCallback = opts.add;
|
||||
closeCallback = opts.close;
|
||||
RED.events.emit("type-search:open");
|
||||
@@ -254,29 +254,21 @@ RED.typeSearch = (function() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
function applyFilter(filter,type,def) {
|
||||
return !filter ||
|
||||
(
|
||||
(!filter.type || type === filter.type) &&
|
||||
(!filter.input || def.inputs > 0) &&
|
||||
(!filter.output || def.outputs > 0)
|
||||
)
|
||||
}
|
||||
function refreshTypeList(opts) {
|
||||
function refreshTypeList() {
|
||||
var i;
|
||||
searchResults.editableList('empty');
|
||||
searchInput.searchBox('value','');
|
||||
selected = -1;
|
||||
var common = [
|
||||
'inject','debug','function','change','switch'
|
||||
].filter(function(t) { return applyFilter(opts.filter,t,RED.nodes.getType(t)); });
|
||||
];
|
||||
|
||||
var recentlyUsed = Object.keys(typesUsed);
|
||||
recentlyUsed.sort(function(a,b) {
|
||||
return typesUsed[b]-typesUsed[a];
|
||||
});
|
||||
recentlyUsed = recentlyUsed.filter(function(t) {
|
||||
return applyFilter(opts.filter,t,RED.nodes.getType(t)) && common.indexOf(t) === -1;
|
||||
return common.indexOf(t) === -1;
|
||||
});
|
||||
|
||||
var items = [];
|
||||
@@ -321,10 +313,8 @@ RED.typeSearch = (function() {
|
||||
searchResults.editableList('addItem', item);
|
||||
}
|
||||
for (i=0;i<items.length;i++) {
|
||||
if (applyFilter(opts.filter,items[i].type,items[i].def)) {
|
||||
items[i].i = index++;
|
||||
searchResults.editableList('addItem', items[i]);
|
||||
}
|
||||
items[i].i = index++;
|
||||
searchResults.editableList('addItem', items[i]);
|
||||
}
|
||||
setTimeout(function() {
|
||||
selected = 0;
|
||||
|
||||
@@ -114,8 +114,7 @@ RED.userSettings = (function() {
|
||||
{
|
||||
title: "menu.label.nodes",
|
||||
options: [
|
||||
{setting:"view-node-status",oldSetting:"menu-menu-item-status",label:"menu.label.displayStatus",default: true, toggle:true,onchange:"core:toggle-status"},
|
||||
{setting:"view-node-show-label",label:"menu.label.showNodeLabelDefault",default: true, toggle:true}
|
||||
{setting:"view-node-status",oldSetting:"menu-menu-item-status",label:"menu.label.displayStatus",default: true, toggle:true,onchange:"core:toggle-status"}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -211,14 +210,14 @@ RED.userSettings = (function() {
|
||||
}
|
||||
}
|
||||
allSettings[opt.setting] = opt;
|
||||
var value = currentEditorSettings.view[opt.setting];
|
||||
if ((value === null || value === undefined) && opt.hasOwnProperty('default')) {
|
||||
value = opt.default;
|
||||
currentEditorSettings.view[opt.setting] = value;
|
||||
editorSettingsChanged = true;
|
||||
}
|
||||
|
||||
if (opt.onchange) {
|
||||
var value = currentEditorSettings.view[opt.setting];
|
||||
if ((value === null || value === undefined) && opt.hasOwnProperty('default')) {
|
||||
value = opt.default;
|
||||
currentEditorSettings.view[opt.setting] = value;
|
||||
editorSettingsChanged = true;
|
||||
}
|
||||
|
||||
var callback = opt.onchange;
|
||||
if (typeof callback === 'string') {
|
||||
callback = RED.actions.get(callback);
|
||||
|
||||
@@ -113,7 +113,7 @@ RED.utils = (function() {
|
||||
var pinnedPaths = {};
|
||||
var formattedPaths = {};
|
||||
|
||||
function addMessageControls(obj,sourceId,key,msg,rootPath,strippedKey,extraTools) {
|
||||
function addMessageControls(obj,sourceId,key,msg,rootPath,strippedKey) {
|
||||
if (!pinnedPaths.hasOwnProperty(sourceId)) {
|
||||
pinnedPaths[sourceId] = {}
|
||||
}
|
||||
@@ -150,10 +150,6 @@ RED.utils = (function() {
|
||||
}).toggleClass("selected",isPinned);
|
||||
obj.toggleClass("debug-message-row-pinned",isPinned);
|
||||
}
|
||||
if (extraTools) {
|
||||
extraTools.addClass("debug-message-tools-other");
|
||||
extraTools.appendTo(tools);
|
||||
}
|
||||
}
|
||||
function checkExpanded(strippedKey,expandPaths,minRange,maxRange) {
|
||||
if (expandPaths && expandPaths.length > 0) {
|
||||
@@ -247,7 +243,6 @@ RED.utils = (function() {
|
||||
var expandPaths = options.expandPaths;
|
||||
var ontoggle = options.ontoggle;
|
||||
var exposeApi = options.exposeApi;
|
||||
var tools = options.tools;
|
||||
|
||||
var subElements = {};
|
||||
var i;
|
||||
@@ -267,7 +262,7 @@ RED.utils = (function() {
|
||||
}
|
||||
header = $('<span class="debug-message-row"></span>').appendTo(element);
|
||||
if (sourceId) {
|
||||
addMessageControls(header,sourceId,path,obj,rootPath,strippedKey,tools);
|
||||
addMessageControls(header,sourceId,path,obj,rootPath,strippedKey);
|
||||
}
|
||||
if (!key) {
|
||||
element.addClass("debug-message-top-level");
|
||||
@@ -711,11 +706,7 @@ RED.utils = (function() {
|
||||
function separateIconPath(icon) {
|
||||
var result = {module: "", file: ""};
|
||||
if (icon) {
|
||||
var index = icon.indexOf('icons/');
|
||||
if (index !== -1) {
|
||||
icon = icon.substring(index+6);
|
||||
}
|
||||
index = icon.indexOf('/');
|
||||
var index = icon.indexOf('/');
|
||||
if (index !== -1) {
|
||||
result.module = icon.slice(0, index);
|
||||
result.file = icon.slice(index + 1);
|
||||
@@ -773,32 +764,17 @@ RED.utils = (function() {
|
||||
} else if (node && node.icon) {
|
||||
var iconPath = separateIconPath(node.icon);
|
||||
if (isIconExists(iconPath)) {
|
||||
if (iconPath.module === "font-awesome") {
|
||||
return node.icon;
|
||||
} else {
|
||||
return RED.settings.apiRootUrl+"icons/" + node.icon;
|
||||
}
|
||||
return RED.settings.apiRootUrl+"icons/" + node.icon;
|
||||
}
|
||||
}
|
||||
|
||||
var iconPath = getDefaultNodeIcon(def, node);
|
||||
if (isIconExists(iconPath)) {
|
||||
if (iconPath.module === "font-awesome") {
|
||||
return iconPath.module+"/"+iconPath.file;
|
||||
} else {
|
||||
return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file;
|
||||
}
|
||||
} else {
|
||||
// This could be a non-core node trying to use a core icon.
|
||||
iconPath.module = 'node-red';
|
||||
if (isIconExists(iconPath)) {
|
||||
return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file;
|
||||
} else if (def.category === 'subflows') {
|
||||
if (def.category === 'subflows') {
|
||||
if (!isIconExists(iconPath)) {
|
||||
return RED.settings.apiRootUrl+"icons/node-red/subflow.png";
|
||||
} else {
|
||||
return RED.settings.apiRootUrl+"icons/node-red/arrow-in.png";
|
||||
}
|
||||
}
|
||||
return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file;
|
||||
}
|
||||
|
||||
function getNodeLabel(node,defaultLabel) {
|
||||
@@ -906,40 +882,6 @@ RED.utils = (function() {
|
||||
return parts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update an icon element and append it to iconContainer.
|
||||
* @param iconUrl - Url of icon.
|
||||
* @param iconContainer - Icon container element with palette_icon_container class.
|
||||
* @param isLarge - Whether the icon size is large.
|
||||
*/
|
||||
function createIconElement(iconUrl, iconContainer, isLarge) {
|
||||
// Removes the previous icon when icon was changed.
|
||||
var iconElement = iconContainer.find(".palette_icon");
|
||||
if (iconElement.length !== 0) {
|
||||
iconElement.remove();
|
||||
}
|
||||
var faIconElement = iconContainer.find("i");
|
||||
if (faIconElement.length !== 0) {
|
||||
faIconElement.remove();
|
||||
}
|
||||
|
||||
// Show either icon image or font-awesome icon
|
||||
var iconPath = separateIconPath(iconUrl);
|
||||
if (iconPath.module === "font-awesome") {
|
||||
var fontAwesomeUnicode = RED.nodes.fontAwesome.getIconUnicode(iconPath.file);
|
||||
if (fontAwesomeUnicode) {
|
||||
var faIconElement = $('<i/>').appendTo(iconContainer);
|
||||
var faLarge = isLarge ? "fa-lg " : "";
|
||||
faIconElement.addClass("palette_icon_fa fa fa-fw " + faLarge + iconPath.file);
|
||||
return;
|
||||
}
|
||||
// If the specified name is not defined in font-awesome, show arrow-in icon.
|
||||
iconUrl = RED.settings.apiRootUrl+"icons/node-red/arrow-in.png"
|
||||
}
|
||||
var imageIconElement = $('<div/>',{class:"palette_icon"}).appendTo(iconContainer);
|
||||
imageIconElement.css("backgroundImage", "url("+iconUrl+")");
|
||||
}
|
||||
|
||||
return {
|
||||
createObjectElement: buildMessageElement,
|
||||
getMessageProperty: getMessageProperty,
|
||||
@@ -952,7 +894,6 @@ RED.utils = (function() {
|
||||
getNodeColor: getNodeColor,
|
||||
addSpinnerOverlay: addSpinnerOverlay,
|
||||
decodeObject: decodeObject,
|
||||
parseContextKey: parseContextKey,
|
||||
createIconElement: createIconElement
|
||||
parseContextKey: parseContextKey
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
zIndex: 101,
|
||||
"border-left": "1px solid #ccc",
|
||||
"border-top": "1px solid #ccc",
|
||||
background: "rgba(245,245,245,0.8)",
|
||||
background: "rgba(245,245,245,0.5)",
|
||||
"box-shadow": "-1px 0 3px rgba(0,0,0,0.1)"
|
||||
});
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
evt.preventDefault();
|
||||
toggle();
|
||||
})
|
||||
RED.popover.tooltip($("#btn-navigate"),RED._('actions.toggle-navigator'),'core:toggle-navigator');
|
||||
},
|
||||
refresh: refreshNodes,
|
||||
resize: resizeNavBorder,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,9 +20,9 @@ RED.workspaces = (function() {
|
||||
var activeWorkspace = 0;
|
||||
var workspaceIndex = 0;
|
||||
|
||||
function addWorkspace(ws,skipHistoryEntry,targetIndex) {
|
||||
function addWorkspace(ws,skipHistoryEntry) {
|
||||
if (ws) {
|
||||
workspace_tabs.addTab(ws,targetIndex);
|
||||
workspace_tabs.addTab(ws);
|
||||
workspace_tabs.resize();
|
||||
} else {
|
||||
var tabId = RED.nodes.id();
|
||||
@@ -31,8 +31,8 @@ RED.workspaces = (function() {
|
||||
} while ($("#workspace-tabs a[title='"+RED._('workspace.defaultName',{number:workspaceIndex})+"']").size() !== 0);
|
||||
|
||||
ws = {type:"tab",id:tabId,disabled: false,info:"",label:RED._('workspace.defaultName',{number:workspaceIndex})};
|
||||
RED.nodes.addWorkspace(ws,targetIndex);
|
||||
workspace_tabs.addTab(ws,targetIndex);
|
||||
RED.nodes.addWorkspace(ws);
|
||||
workspace_tabs.addTab(ws);
|
||||
workspace_tabs.activateTab(tabId);
|
||||
if (!skipHistoryEntry) {
|
||||
RED.history.push({t:'add',workspaces:[ws],dirty:RED.nodes.dirty()});
|
||||
@@ -46,8 +46,6 @@ RED.workspaces = (function() {
|
||||
if (workspaceTabCount === 1) {
|
||||
return;
|
||||
}
|
||||
var workspaceOrder = RED.nodes.getWorkspaceOrder();
|
||||
ws._index = workspaceOrder.indexOf(ws.id);
|
||||
removeWorkspace(ws);
|
||||
var historyEvent = RED.nodes.removeWorkspace(ws.id);
|
||||
historyEvent.t = 'delete';
|
||||
@@ -58,7 +56,7 @@ RED.workspaces = (function() {
|
||||
RED.sidebar.config.refresh();
|
||||
}
|
||||
|
||||
function showEditWorkspaceDialog(id) {
|
||||
function showRenameWorkspaceDialog(id) {
|
||||
var workspace = RED.nodes.workspace(id);
|
||||
RED.view.state(RED.state.EDITING);
|
||||
var tabflowEditor;
|
||||
@@ -107,8 +105,8 @@ RED.workspaces = (function() {
|
||||
changed = true;
|
||||
workspace.info = info;
|
||||
}
|
||||
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',!!workspace.disabled);
|
||||
$("#workspace").toggleClass("workspace-disabled",!!workspace.disabled);
|
||||
$("#red-ui-tab-"+(workspace.id.replace(".","-"))).toggleClass('workspace-disabled',workspace.disabled);
|
||||
// $("#workspace").toggleClass("workspace-disabled",workspace.disabled);
|
||||
|
||||
if (changed) {
|
||||
var historyEvent = {
|
||||
@@ -125,14 +123,6 @@ RED.workspaces = (function() {
|
||||
if (!selection.nodes && !selection.links) {
|
||||
RED.sidebar.info.refresh(workspace);
|
||||
}
|
||||
if (changes.hasOwnProperty('disabled')) {
|
||||
RED.nodes.eachNode(function(n) {
|
||||
if (n.z === workspace.id) {
|
||||
n.dirty = true;
|
||||
}
|
||||
});
|
||||
RED.view.redraw();
|
||||
}
|
||||
}
|
||||
RED.tray.close();
|
||||
}
|
||||
@@ -146,6 +136,7 @@ RED.workspaces = (function() {
|
||||
height -= $(rows[i]).outerHeight(true);
|
||||
}
|
||||
height -= (parseInt($("#dialog-form").css("marginTop"))+parseInt($("#dialog-form").css("marginBottom")));
|
||||
height -= 28;
|
||||
$(".node-text-editor").css("height",height+"px");
|
||||
tabflowEditor.resize();
|
||||
},
|
||||
@@ -159,13 +150,13 @@ RED.workspaces = (function() {
|
||||
|
||||
$('<div class="form-row">'+
|
||||
'<label for="node-input-disabled-btn" data-i18n="editor:workspace.status"></label>'+
|
||||
'<button type="button" id="node-input-disabled-btn" class="editor-button"><i class="fa fa-toggle-on"></i> <span id="node-input-disabled-label"></span></button> '+
|
||||
'<button id="node-input-disabled-btn" class="editor-button"><i class="fa fa-toggle-on"></i> <span id="node-input-disabled-label"></span></button> '+
|
||||
'<input type="checkbox" id="node-input-disabled" style="display: none;"/>'+
|
||||
'</div>').appendTo(dialogForm);
|
||||
|
||||
var row = $('<div class="form-row node-text-editor-row">'+
|
||||
$('<div class="form-row node-text-editor-row">'+
|
||||
'<label for="node-input-info" data-i18n="editor:workspace.info" style="width:300px;"></label>'+
|
||||
'<div style="min-height:250px;" class="node-text-editor" id="node-input-info"></div>'+
|
||||
'<div style="height:250px;" class="node-text-editor" id="node-input-info"></div>'+
|
||||
'</div>').appendTo(dialogForm);
|
||||
tabflowEditor = RED.editor.createEditor({
|
||||
id: 'node-input-info',
|
||||
@@ -173,22 +164,7 @@ RED.workspaces = (function() {
|
||||
value: ""
|
||||
});
|
||||
|
||||
$('#node-info-input-info-expand').click(function(e) {
|
||||
e.preventDefault();
|
||||
var value = tabflowEditor.getValue();
|
||||
RED.editor.editMarkdown({
|
||||
value: value,
|
||||
width: "Infinity",
|
||||
cursor: tabflowEditor.getCursorPosition(),
|
||||
complete: function(v,cursor) {
|
||||
tabflowEditor.setValue(v, -1);
|
||||
tabflowEditor.gotoLine(cursor.row+1,cursor.column,false);
|
||||
setTimeout(function() {
|
||||
tabflowEditor.focus();
|
||||
},300);
|
||||
}
|
||||
})
|
||||
});
|
||||
$('<div class="form-tips" data-i18n="editor:workspace.tip"></div>').appendTo(dialogForm);
|
||||
|
||||
dialogForm.find('#node-input-disabled-btn').on("click",function(e) {
|
||||
var i = $(this).find("i");
|
||||
@@ -248,9 +224,9 @@ RED.workspaces = (function() {
|
||||
}
|
||||
activeWorkspace = tab.id;
|
||||
event.workspace = activeWorkspace;
|
||||
// $("#workspace").toggleClass("workspace-disabled",tab.disabled);
|
||||
RED.events.emit("workspace:change",event);
|
||||
window.location.hash = 'flow/'+tab.id;
|
||||
$("#workspace").toggleClass("workspace-disabled",!!tab.disabled);
|
||||
RED.sidebar.config.refresh();
|
||||
RED.view.focus();
|
||||
},
|
||||
@@ -259,7 +235,7 @@ RED.workspaces = (function() {
|
||||
},
|
||||
ondblclick: function(tab) {
|
||||
if (tab.type != "subflow") {
|
||||
showEditWorkspaceDialog(tab.id);
|
||||
showRenameWorkspaceDialog(tab.id);
|
||||
} else {
|
||||
RED.editor.editSubflow(RED.nodes.subflow(tab.id));
|
||||
}
|
||||
@@ -291,25 +267,11 @@ RED.workspaces = (function() {
|
||||
RED.nodes.dirty(true);
|
||||
setWorkspaceOrder(newOrder);
|
||||
},
|
||||
onselect: function(selectedTabs) {
|
||||
RED.view.select(false)
|
||||
if (selectedTabs.length === 0) {
|
||||
$("#chart svg").css({"pointer-events":"auto",filter:"none"})
|
||||
$("#workspace-toolbar").css({"pointer-events":"auto",filter:"none"})
|
||||
$("#palette-container").css({"pointer-events":"auto",filter:"none"})
|
||||
$(".sidebar-shade").hide();
|
||||
} else {
|
||||
RED.view.select(false)
|
||||
$("#chart svg").css({"pointer-events":"none",filter:"opacity(60%)"})
|
||||
$("#workspace-toolbar").css({"pointer-events":"none",filter:"opacity(60%)"})
|
||||
$("#palette-container").css({"pointer-events":"none",filter:"opacity(60%)"})
|
||||
$(".sidebar-shade").show();
|
||||
}
|
||||
},
|
||||
minimumActiveTabWidth: 150,
|
||||
scrollable: true,
|
||||
addButton: "core:add-flow",
|
||||
addButtonCaption: RED._("workspace.addFlow")
|
||||
addButton: function() {
|
||||
addWorkspace();
|
||||
}
|
||||
});
|
||||
workspaceTabCount = 0;
|
||||
}
|
||||
@@ -339,7 +301,7 @@ RED.workspaces = (function() {
|
||||
workspace_tabs.resize();
|
||||
});
|
||||
|
||||
RED.actions.add("core:add-flow",function(opts) { addWorkspace(undefined,undefined,opts?opts.index:undefined)});
|
||||
RED.actions.add("core:add-flow",addWorkspace);
|
||||
RED.actions.add("core:edit-flow",editWorkspace);
|
||||
RED.actions.add("core:remove-flow",removeWorkspace);
|
||||
|
||||
@@ -347,7 +309,7 @@ RED.workspaces = (function() {
|
||||
}
|
||||
|
||||
function editWorkspace(id) {
|
||||
showEditWorkspaceDialog(id||activeWorkspace);
|
||||
showRenameWorkspaceDialog(id||activeWorkspace);
|
||||
}
|
||||
|
||||
function removeWorkspace(ws) {
|
||||
@@ -357,9 +319,9 @@ RED.workspaces = (function() {
|
||||
if (workspace_tabs.contains(ws.id)) {
|
||||
workspace_tabs.removeTab(ws.id);
|
||||
}
|
||||
if (ws.id === activeWorkspace) {
|
||||
activeWorkspace = 0;
|
||||
}
|
||||
}
|
||||
if (ws.id === activeWorkspace) {
|
||||
activeWorkspace = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,9 +347,6 @@ RED.workspaces = (function() {
|
||||
active: function() {
|
||||
return activeWorkspace
|
||||
},
|
||||
selection: function() {
|
||||
return workspace_tabs.selection();
|
||||
},
|
||||
show: function(id) {
|
||||
if (!workspace_tabs.contains(id)) {
|
||||
var sf = RED.nodes.subflow(id);
|
||||
|
||||
@@ -6,24 +6,3 @@
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
#event-log-editor {
|
||||
.ace_scroller {
|
||||
background: #444;
|
||||
color: #dd9;
|
||||
}
|
||||
.ace_active-line {
|
||||
background: #666 !important;
|
||||
}
|
||||
.ace_selection {
|
||||
background: #999 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.ace_tooltip {
|
||||
background-image: none;
|
||||
background: #fcffdc;
|
||||
border-radius: 4px;
|
||||
@include component-shadow;
|
||||
border-color: $primary-border-color;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ $primary-border-color: #bbbbbb;
|
||||
$secondary-border-color: #dddddd;
|
||||
|
||||
$tab-background-active: #fff;
|
||||
$tab-background-selected: #f9f9f9;
|
||||
$tab-background-inactive: #f0f0f0;
|
||||
$tab-background-hover: #ddd;
|
||||
|
||||
@@ -68,6 +67,3 @@ $editor-button-color: #999;
|
||||
$editor-button-background: #fff;
|
||||
|
||||
$shade-color: rgba(160,160,160,0.5);
|
||||
|
||||
$popover-background: #333;
|
||||
$popover-color: #eee;
|
||||
|
||||
@@ -81,9 +81,6 @@
|
||||
.debug-message-tools-pin {
|
||||
display: inline-block;
|
||||
}
|
||||
.debug-message-tools-other {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,9 +134,6 @@
|
||||
.debug-message-tools-copy {
|
||||
display: none;
|
||||
}
|
||||
.debug-message-tools-other {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.debug-message-payload {
|
||||
display: block;
|
||||
|
||||
@@ -257,11 +257,6 @@
|
||||
background-position: 49% 50%;
|
||||
width: 15px;
|
||||
}
|
||||
.palette_icon_fa {
|
||||
position: relative;
|
||||
top: -2.5px;
|
||||
left: 0px;
|
||||
}
|
||||
.palette_icon_container {
|
||||
width: 18px;
|
||||
}
|
||||
@@ -567,15 +562,9 @@ ul.node-dialog-configm-deploy-list {
|
||||
td.lineno {
|
||||
font-family: monospace;
|
||||
text-align: right;
|
||||
color: #999;
|
||||
color: #aaa;
|
||||
background: #f6f6f6;
|
||||
padding: 1px 5px;
|
||||
&.added {
|
||||
background: #c0f6c0;
|
||||
}
|
||||
&.removed {
|
||||
background: #ffcccc;
|
||||
}
|
||||
}
|
||||
td.lineno:nth-child(3) {
|
||||
border-left: 1px solid $secondary-border-color;
|
||||
@@ -584,20 +573,12 @@ ul.node-dialog-configm-deploy-list {
|
||||
font-family: monospace;
|
||||
white-space: pre-wrap;
|
||||
padding: 1px 5px;
|
||||
border-left: 1px solid #ccc;
|
||||
span.prefix {
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
&.added {
|
||||
border-left-color: #aaeeaa
|
||||
}
|
||||
&.removed {
|
||||
border-left-color: #eebbbb
|
||||
}
|
||||
}
|
||||
td.blank {
|
||||
background: #f6f6f6;
|
||||
@@ -606,7 +587,7 @@ ul.node-dialog-configm-deploy-list {
|
||||
background: #eefaee;
|
||||
}
|
||||
td.removed {
|
||||
background: #ffecec;
|
||||
background: #fadddd;
|
||||
}
|
||||
tr.mergeHeader td {
|
||||
color: #800080;
|
||||
|
||||
@@ -57,10 +57,6 @@
|
||||
.editor-tray-content {
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
.palette_icon_fa {
|
||||
top: 6px;
|
||||
left: 4px;
|
||||
}
|
||||
}
|
||||
.editor-tray-header {
|
||||
@include disable-selection;
|
||||
@@ -209,28 +205,11 @@
|
||||
}
|
||||
|
||||
.node-text-editor {
|
||||
position: relative;
|
||||
.node-text-editor-help {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
right: 1px;
|
||||
border-bottom-right-radius: 5px;
|
||||
z-Index: 8;
|
||||
border-bottom: none;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
.node-text-editor-container {
|
||||
border:1px solid #ccc;
|
||||
border-radius:5px;
|
||||
overflow: hidden;
|
||||
font-size: 14px !important;
|
||||
font-family: Menlo, Consolas, 'DejaVu Sans Mono', Courier, monospace !important;
|
||||
height: 100%;
|
||||
|
||||
&.node-text-editor-container-toolbar {
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
}
|
||||
|
||||
.editor-button {
|
||||
@@ -338,29 +317,20 @@
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
.red-ui-panel {
|
||||
padding: 20px 20px 10px;
|
||||
&:first-child {
|
||||
padding: 20px 20px 0;
|
||||
}
|
||||
&:last-child {
|
||||
padding-top: 60px;
|
||||
background: #f9f9f9;
|
||||
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.node-input-markdown-panel-preview {
|
||||
padding: 10px;
|
||||
border:1px solid #ccc;
|
||||
border-radius:5px;
|
||||
height: calc(100% - 21px);
|
||||
overflow-y: scroll;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#clipboard-hidden {
|
||||
position: absolute;
|
||||
top: -3000px;
|
||||
}
|
||||
.node-label-form-row {
|
||||
margin: 5px 0 0 50px;
|
||||
margin: 5px 0;
|
||||
label {
|
||||
margin-right: 20px;
|
||||
text-align: right;
|
||||
@@ -395,16 +365,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
#node-settings-icon-button {
|
||||
position: relative;
|
||||
padding-left: 30px;
|
||||
width: calc(100% - 150px);
|
||||
.red-ui-search-result-node {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
}
|
||||
}
|
||||
#node-settings-icon {
|
||||
margin-left: 10px;
|
||||
width: calc(100% - 163px);
|
||||
@@ -443,10 +403,6 @@
|
||||
border-color: white;
|
||||
}
|
||||
}
|
||||
.palette_icon_fa {
|
||||
top: 6px;
|
||||
left: 3px;
|
||||
}
|
||||
}
|
||||
.red-ui-icon-list-module {
|
||||
background: $palette-header-background;
|
||||
|
||||
@@ -169,16 +169,7 @@
|
||||
.node_subflow .node {
|
||||
stroke-dasharray:8, 3;
|
||||
}
|
||||
.workspace-disabled {
|
||||
.link_line {
|
||||
stroke-dasharray: 10,5 !important;
|
||||
stroke-width: 2 !important;
|
||||
stroke: $link-subflow-color;
|
||||
}
|
||||
.node {
|
||||
stroke-dasharray: 10,4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.node_quickadd * {
|
||||
stroke-dasharray: 12,3;
|
||||
@@ -194,8 +185,8 @@
|
||||
}
|
||||
|
||||
.port_hovered {
|
||||
stroke: $port-selected-color !important;
|
||||
fill: $port-selected-color !important;
|
||||
stroke: $port-selected-color;
|
||||
fill: $port-selected-color;
|
||||
}
|
||||
|
||||
.port_quick_link {
|
||||
@@ -211,7 +202,7 @@
|
||||
}
|
||||
|
||||
.drag_line {
|
||||
stroke: $node-selected-color !important;
|
||||
stroke: $node-selected-color;
|
||||
stroke-width: 3;
|
||||
fill: none;
|
||||
pointer-events: none;
|
||||
@@ -236,10 +227,10 @@
|
||||
stroke: $link-link-color;
|
||||
fill: none;
|
||||
stroke-dasharray: 15,2;
|
||||
// pointer-events: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
.link_port {
|
||||
fill: #eee;
|
||||
fill: #fff;
|
||||
stroke: $link-link-color;
|
||||
stroke-width: 1;
|
||||
}
|
||||
@@ -290,14 +281,14 @@ g.link_unknown path.link_line {
|
||||
pointer-events: none;
|
||||
|
||||
path {
|
||||
fill: $popover-background;
|
||||
stroke: $popover-background;
|
||||
fill: white;
|
||||
stroke: #999;
|
||||
stroke-width: 1;
|
||||
}
|
||||
}
|
||||
.port_tooltip_label {
|
||||
stroke-width: 0;
|
||||
fill: $popover-color;
|
||||
fill: #666;
|
||||
font-size: 12px;
|
||||
pointer-events: none;
|
||||
-webkit-touch-callout: none;
|
||||
|
||||
@@ -31,20 +31,3 @@
|
||||
#node-select-library li.list-hover {
|
||||
background: #ffffd0;
|
||||
}
|
||||
|
||||
.clipboard-import-error {
|
||||
pre {
|
||||
margin: 10px 0;
|
||||
border: none;
|
||||
color: #666;
|
||||
span {
|
||||
padding: 5px 0;
|
||||
}
|
||||
span.error {
|
||||
padding: 5px;
|
||||
background: #e25151;
|
||||
color: white;
|
||||
margin: 0 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,13 +118,6 @@
|
||||
color: $editor-button-color-primary !important;
|
||||
}
|
||||
}
|
||||
&.secondary {
|
||||
background: none;
|
||||
&:not(:hover) {
|
||||
border-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
.button-group-vertical {
|
||||
@@ -138,27 +131,17 @@
|
||||
|
||||
@mixin workspace-button-toggle {
|
||||
@include workspace-button;
|
||||
color: $workspace-button-toggle-color !important;
|
||||
background:$workspace-button-background-active;
|
||||
margin-bottom: 1px;
|
||||
|
||||
&.single {
|
||||
color: $workspace-button-color !important;
|
||||
&.selected:not(.disabled):not(:disabled) {
|
||||
color: $workspace-button-toggle-color-selected !important;
|
||||
background: $workspace-button-background;
|
||||
|
||||
&.selected:not(.disabled):not(:disabled) {
|
||||
color: $workspace-button-toggle-color !important;
|
||||
background: $workspace-button-background-active;
|
||||
}
|
||||
}
|
||||
&:not(.single) {
|
||||
color: $workspace-button-toggle-color !important;
|
||||
background:$workspace-button-background-active;
|
||||
margin-bottom: 1px;
|
||||
|
||||
&.selected:not(.disabled):not(:disabled) {
|
||||
color: $workspace-button-toggle-color-selected !important;
|
||||
background: $workspace-button-background;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: $form-input-border-selected-color;
|
||||
margin-bottom: 0;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: $form-input-border-selected-color;
|
||||
margin-bottom: 0;
|
||||
&:not(.single) {
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,14 +28,6 @@
|
||||
transition: width 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.palette-closed {
|
||||
#palette { width: 8px; }
|
||||
#palette-search { display: none; }
|
||||
#palette-container { display: none; }
|
||||
#palette-collapse-all { display: none; }
|
||||
#palette-expand-all { display: none; }
|
||||
}
|
||||
|
||||
.palette-expanded {
|
||||
& #palette {
|
||||
width: 380px;
|
||||
@@ -82,6 +74,7 @@
|
||||
@include component-footer-button;
|
||||
}
|
||||
|
||||
|
||||
.palette-category {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
@@ -100,9 +93,6 @@
|
||||
padding-left: 30px;
|
||||
overflow: hidden;
|
||||
user-select: none;
|
||||
&:hover {
|
||||
background: $palette-header-background !important;
|
||||
}
|
||||
}
|
||||
.palette-header > i {
|
||||
position: absolute;
|
||||
@@ -198,12 +188,7 @@
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.palette_icon_fa {
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 3px;
|
||||
}
|
||||
|
||||
.palette_node_small {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
@@ -221,8 +206,4 @@
|
||||
margin-left: -1px;
|
||||
width: 15px;
|
||||
}
|
||||
.palette_icon_fa {
|
||||
top: 2px;
|
||||
left: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,13 +42,11 @@
|
||||
.red-ui-panels.red-ui-panels-horizontal {
|
||||
height: 100%;
|
||||
.red-ui-panel {
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
width: calc(50% - 4px);
|
||||
}
|
||||
.red-ui-panels-separator {
|
||||
vertical-align: top;
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
border-left: 1px solid $secondary-border-color;
|
||||
|
||||
@@ -21,14 +21,12 @@
|
||||
width: auto;
|
||||
padding: 10px;
|
||||
height: auto;
|
||||
background: $popover-background;
|
||||
color: $popover-color;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
|
||||
z-index: 1000;
|
||||
font-size: 14px;
|
||||
line-height: 1.4em;
|
||||
@include component-shadow;
|
||||
border-color: $popover-background;
|
||||
}
|
||||
|
||||
.red-ui-popover:after, .red-ui-popover:before {
|
||||
@@ -53,33 +51,28 @@
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.red-ui-popover.red-ui-popover-top:after, .red-ui-popover.red-ui-popover-top:before {
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.red-ui-popover.red-ui-popover-right:after {
|
||||
border-color: rgba(136, 183, 213, 0);
|
||||
border-right-color: $popover-background;
|
||||
border-right-color: #fff;
|
||||
border-width: 10px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
.red-ui-popover.red-ui-popover-right:before {
|
||||
border-color: rgba(194, 225, 245, 0);
|
||||
border-right-color: $popover-background;
|
||||
border-right-color: $primary-border-color;
|
||||
border-width: 11px;
|
||||
margin-top: -11px;
|
||||
}
|
||||
|
||||
.red-ui-popover.red-ui-popover-left:after {
|
||||
border-color: rgba(136, 183, 213, 0);
|
||||
border-left-color: $popover-background;
|
||||
border-left-color: #fff;
|
||||
border-width: 10px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
.red-ui-popover.red-ui-popover-left:before {
|
||||
border-color: rgba(194, 225, 245, 0);
|
||||
border-left-color: $popover-background;
|
||||
border-left-color: $primary-border-color;
|
||||
border-width: 11px;
|
||||
margin-top: -11px;
|
||||
}
|
||||
@@ -87,80 +80,45 @@
|
||||
|
||||
.red-ui-popover.red-ui-popover-bottom:after {
|
||||
border-color: rgba(136, 183, 213, 0);
|
||||
border-bottom-color: $popover-background;
|
||||
border-bottom-color: #fff;
|
||||
border-width: 10px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.red-ui-popover.red-ui-popover-bottom:before {
|
||||
border-color: rgba(194, 225, 245, 0);
|
||||
border-bottom-color: $popover-background;
|
||||
border-bottom-color: $primary-border-color;
|
||||
border-width: 11px;
|
||||
margin-left: -11px;
|
||||
}
|
||||
|
||||
.red-ui-popover.red-ui-popover-top:after {
|
||||
border-color: rgba(136, 183, 213, 0);
|
||||
border-top-color: $popover-background;
|
||||
border-width: 10px;
|
||||
margin-left: -10px;
|
||||
}
|
||||
.red-ui-popover.red-ui-popover-top:before {
|
||||
border-color: rgba(194, 225, 245, 0);
|
||||
border-top-color: $popover-background;
|
||||
border-width: 11px;
|
||||
margin-left: -11px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.red-ui-popover-size-small {
|
||||
font-size: 12px;
|
||||
padding: 5px 7px;
|
||||
line-height: 1.8em;
|
||||
|
||||
&.red-ui-popover-right:after, &.red-ui-popover-left:after {
|
||||
border-width: 7px;
|
||||
margin-top: -7px;
|
||||
}
|
||||
&.red-ui-popover-right:before, &.red-ui-popover-left:before {
|
||||
border-width: 8px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
&.red-ui-popover-bottom:after, &.red-ui-popover-top:after {
|
||||
border-width: 7px;
|
||||
margin-left: -7px;
|
||||
}
|
||||
&.red-ui-popover-bottom:before, &.red-ui-popover-top:before {
|
||||
border-width: 8px;
|
||||
margin-left: -8px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.red-ui-popover-key {
|
||||
font-size: 11px;
|
||||
font-family: monospace;
|
||||
margin-left: 3px;
|
||||
border: 1px solid #999;
|
||||
border-radius:3px;
|
||||
padding: 1px 2px;
|
||||
}
|
||||
padding: 5px;
|
||||
|
||||
.red-ui-popover .editor-button {
|
||||
&:not(.primary) {
|
||||
color: #444 !important;
|
||||
border-color: rgba(0,0,0,0);
|
||||
&.red-ui-popover-right:after {
|
||||
border-width: 5px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
&.primary {
|
||||
border-color: #bbb;
|
||||
&.red-ui-popover-right:before {
|
||||
border-width: 6px;
|
||||
margin-top: -6px;
|
||||
}
|
||||
&.primary:hover {
|
||||
border-color: #666 !important;
|
||||
|
||||
&.red-ui-popover-left:after {
|
||||
border-width: 5px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
&.red-ui-popover-left:before {
|
||||
border-width: 6px;
|
||||
margin-top: -6px;
|
||||
}
|
||||
&.red-ui-popover-bottom:after {
|
||||
border-width: 5px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
&.red-ui-popover-bottom:before {
|
||||
border-width: 6px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
}
|
||||
.red-ui-popover code {
|
||||
border: none;
|
||||
background: none;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
@@ -62,11 +62,6 @@
|
||||
font-size: 13px;
|
||||
border-left-width: 3px;
|
||||
border-right-width: 3px;
|
||||
.palette_icon_fa {
|
||||
position: relative;
|
||||
top: -2.5px;
|
||||
left: 0px;
|
||||
}
|
||||
}
|
||||
.red-ui-search-result-separator {
|
||||
border-bottom: 3px solid #ddd;
|
||||
@@ -150,10 +145,6 @@
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
.palette_icon_fa {
|
||||
top: 6px;
|
||||
left: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-search-result-node {
|
||||
|
||||
@@ -103,30 +103,3 @@
|
||||
.sidebar-shade {
|
||||
@include shade;
|
||||
}
|
||||
|
||||
|
||||
@mixin sidebar-control {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: calc(50% - 26px);
|
||||
|
||||
padding:15px 8px;
|
||||
border:1px solid #ccc;
|
||||
background:#f9f9f9;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sidebar-control-right {
|
||||
@include sidebar-control;
|
||||
right: calc(100%);
|
||||
border-top-left-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
}
|
||||
.sidebar-control-left {
|
||||
@include sidebar-control;
|
||||
left: calc(100%);
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
@import "ui/common/nodeList";
|
||||
@import "ui/common/checkboxSet";
|
||||
@import "ui/common/stack";
|
||||
@import "ui/common/treeList";
|
||||
|
||||
@import "dragdrop";
|
||||
|
||||
|
||||
@@ -22,50 +22,32 @@
|
||||
@include disable-selection;
|
||||
}
|
||||
|
||||
.config-node-list {
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
.palette_node {
|
||||
overflow: hidden;
|
||||
&.selected {
|
||||
border-color: $node-selected-color;
|
||||
background-color: #eee;
|
||||
}
|
||||
}
|
||||
.palette_label {
|
||||
margin-left: 8px;
|
||||
line-height: 24px;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.palette_icon_container {
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background-color: #e8e8e8;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
a {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
color: #666;
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
background: #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.config_node {
|
||||
width: 160px;
|
||||
height: 30px;
|
||||
background: #f3f3f3;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
.config-node-list {
|
||||
margin: 0;
|
||||
list-style-type: none;
|
||||
|
||||
.palette_label {
|
||||
margin-left: 8px;
|
||||
line-height: 24px;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.palette_icon_container {
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
background-color: #e8e8e8;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
}
|
||||
.config_node {
|
||||
width: 160px;
|
||||
height: 30px;
|
||||
background: #f3f3f3;
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
}
|
||||
.config_node_type {
|
||||
color: #999;
|
||||
|
||||
@@ -57,14 +57,7 @@
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
&.red-ui-tabs-closeable:hover {
|
||||
.red-ui-tabs-badges {
|
||||
display: none;
|
||||
}
|
||||
.red-ui-tab-close {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
a.red-ui-tab-label {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
@@ -104,19 +97,6 @@
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
&.selected {
|
||||
&:not(.active) {
|
||||
background: $tab-background-selected;
|
||||
}
|
||||
font-weight: bold;
|
||||
.red-ui-tabs-badge-selected {
|
||||
display: inline;
|
||||
}
|
||||
.red-ui-tabs-badge-changed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
&:not(.active) a:hover {
|
||||
color: $workspace-button-color-hover;
|
||||
background: $tab-background-hover;
|
||||
@@ -302,20 +282,11 @@ i.red-ui-tab-icon {
|
||||
|
||||
.red-ui-tabs-badges {
|
||||
position: absolute;
|
||||
top:0px;
|
||||
right:0px;
|
||||
width: 20px;
|
||||
pointer-events: none;
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
padding:0px;
|
||||
color: #aaa;
|
||||
top:2px;
|
||||
right:2px;
|
||||
}
|
||||
|
||||
.red-ui-tabs-badges i {
|
||||
display: none;
|
||||
.red-ui-tab-closeable .red-ui-tabs-badges {
|
||||
right: 22px;
|
||||
}
|
||||
|
||||
.red-ui-tab.node_changed img.node_changed {
|
||||
@@ -332,14 +303,13 @@ i.red-ui-tab-icon {
|
||||
vertical-align: top;
|
||||
|
||||
}
|
||||
|
||||
.red-ui-tab-close {
|
||||
display: none;
|
||||
background: $tab-background-inactive;
|
||||
opacity: 0.8;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 30px;
|
||||
line-height: 28px;
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
**/
|
||||
|
||||
.red-ui-treeList {
|
||||
|
||||
}
|
||||
|
||||
.red-ui-treeList-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
background: #f9f9f9;
|
||||
|
||||
border: 1px solid $form-input-border-color;
|
||||
border-radius: 4px;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
.red-ui-editableList-border {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.red-ui-editableList-container {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.red-ui-editableList-container li {
|
||||
padding: 0;
|
||||
border-bottom: none;
|
||||
.red-ui-editableList-container {
|
||||
// margin-left: 15px;
|
||||
}
|
||||
}
|
||||
.red-ui-editableList-item-content {
|
||||
& > .red-ui-treeList-label .fa-angle-right {
|
||||
transition: transform 0.1s ease-in-out;
|
||||
}
|
||||
.red-ui-editableList {
|
||||
display: none;
|
||||
}
|
||||
&.expanded {
|
||||
& > .red-ui-treeList-label .fa-angle-right {
|
||||
transform: rotate(90deg)
|
||||
}
|
||||
& > .red-ui-editableList {
|
||||
display: block
|
||||
}
|
||||
& > .red-ui-treeList-spinner {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
label.red-ui-treeList-label {
|
||||
display: block;
|
||||
width: auto;
|
||||
}
|
||||
.red-ui-treeList-label {
|
||||
@include disable-selection;
|
||||
padding: 6px 0;
|
||||
display: block;
|
||||
color: $form-text-color;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
|
||||
&:hover {
|
||||
background: #f9f9f9;
|
||||
color: $form-text-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
&:focus {
|
||||
outline: none;
|
||||
color: $form-text-color;
|
||||
text-decoration: none;
|
||||
}
|
||||
input {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
.red-ui-treeList-label-text {
|
||||
margin-left: 4px;
|
||||
}
|
||||
.red-ui-treeList-icon {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.red-ui-treeList-spinner {
|
||||
display: none;
|
||||
height: 32px;
|
||||
background: url(images/spin.svg) 50% 50% no-repeat;
|
||||
background-size: auto 20px;
|
||||
}
|
||||
@@ -40,14 +40,10 @@
|
||||
right: 322px;
|
||||
overflow: hidden;
|
||||
@include component-border;
|
||||
transition: left 0.1s ease-in-out;
|
||||
transition: left 0.2s ease-in-out;
|
||||
|
||||
}
|
||||
|
||||
.palette-closed #workspace {
|
||||
left: 7px;
|
||||
}
|
||||
|
||||
.workspace-footer-button {
|
||||
@include component-footer-button;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user