@node-red/editor-api 1.3.3 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/admin/plugins.js +4 -6
- package/lib/editor/theme.js +12 -0
- package/package.json +4 -4
package/lib/admin/plugins.js
CHANGED
|
@@ -17,9 +17,8 @@ module.exports = {
|
|
|
17
17
|
})
|
|
18
18
|
} else {
|
|
19
19
|
opts.lang = apiUtils.determineLangFromHeaders(req.acceptsLanguages());
|
|
20
|
-
if (/[^
|
|
21
|
-
|
|
22
|
-
return;
|
|
20
|
+
if (/[^0-9a-z=\-\*]/i.test(opts.lang)) {
|
|
21
|
+
opts.lang = "en-US";
|
|
23
22
|
}
|
|
24
23
|
runtimeAPI.plugins.getPluginConfigs(opts).then(function(configs) {
|
|
25
24
|
res.send(configs);
|
|
@@ -32,9 +31,8 @@ module.exports = {
|
|
|
32
31
|
lang: req.query.lng,
|
|
33
32
|
req: apiUtils.getRequestLogObject(req)
|
|
34
33
|
}
|
|
35
|
-
if (/[^
|
|
36
|
-
|
|
37
|
-
return;
|
|
34
|
+
if (/[^0-9a-z=\-\*]/i.test(opts.lang)) {
|
|
35
|
+
opts.lang = "en-US";
|
|
38
36
|
}
|
|
39
37
|
runtimeAPI.plugins.getPluginCatalogs(opts).then(function(result) {
|
|
40
38
|
res.json(result);
|
package/lib/editor/theme.js
CHANGED
|
@@ -129,6 +129,14 @@ module.exports = {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
themeContext.page.title = theme.page.title || themeContext.page.title;
|
|
132
|
+
|
|
133
|
+
// Store the resolved urls to these resources so nodes (such as Debug)
|
|
134
|
+
// can access them
|
|
135
|
+
theme.page._ = {
|
|
136
|
+
css: themeContext.page.css,
|
|
137
|
+
scripts: themeContext.page.scripts,
|
|
138
|
+
favicon: themeContext.page.favicon
|
|
139
|
+
}
|
|
132
140
|
}
|
|
133
141
|
|
|
134
142
|
if (theme.header) {
|
|
@@ -223,6 +231,8 @@ module.exports = {
|
|
|
223
231
|
themePlugin.path
|
|
224
232
|
);
|
|
225
233
|
themeContext.page.css = cssFiles.concat(themeContext.page.css || [])
|
|
234
|
+
theme.page = theme.page || {_:{}}
|
|
235
|
+
theme.page._.css = cssFiles.concat(theme.page._.css || [])
|
|
226
236
|
}
|
|
227
237
|
if (themePlugin.scripts) {
|
|
228
238
|
const scriptFiles = serveFilesFromTheme(
|
|
@@ -232,6 +242,8 @@ module.exports = {
|
|
|
232
242
|
themePlugin.path
|
|
233
243
|
)
|
|
234
244
|
themeContext.page.scripts = scriptFiles.concat(themeContext.page.scripts || [])
|
|
245
|
+
theme.page = theme.page || {_:{}}
|
|
246
|
+
theme.page._.scripts = scriptFiles.concat(theme.page._.scripts || [])
|
|
235
247
|
}
|
|
236
248
|
}
|
|
237
249
|
activeThemeInitialised = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-red/editor-api",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@node-red/util": "1.3.
|
|
20
|
-
"@node-red/editor-client": "1.3.
|
|
19
|
+
"@node-red/util": "1.3.7",
|
|
20
|
+
"@node-red/editor-client": "1.3.7",
|
|
21
21
|
"bcryptjs": "2.4.3",
|
|
22
22
|
"body-parser": "1.19.0",
|
|
23
23
|
"clone": "2.1.2",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"passport-http-bearer": "1.0.1",
|
|
33
33
|
"passport-oauth2-client-password": "0.1.2",
|
|
34
34
|
"passport": "0.4.1",
|
|
35
|
-
"ws": "6.2.
|
|
35
|
+
"ws": "6.2.2"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
38
|
"bcrypt": "3.0.6"
|