mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #2836 from node-red/theme-plugins
Add support for Theme Plugins
This commit is contained in:
@@ -681,9 +681,12 @@ var RED = (function() {
|
||||
$('<span>').html(theme.header.title).appendTo(logo);
|
||||
}
|
||||
}
|
||||
if (theme.themes) {
|
||||
knownThemes = theme.themes;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var knownThemes = null;
|
||||
var initialised = false;
|
||||
|
||||
function init(options) {
|
||||
@@ -703,7 +706,13 @@ var RED = (function() {
|
||||
buildEditor(options);
|
||||
|
||||
RED.i18n.init(options, function() {
|
||||
RED.settings.init(options, loadEditor);
|
||||
RED.settings.init(options, function() {
|
||||
if (knownThemes) {
|
||||
RED.settings.editorTheme = RED.settings.editorTheme || {};
|
||||
RED.settings.editorTheme.themes = knownThemes;
|
||||
}
|
||||
loadEditor();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -109,13 +109,19 @@ RED.userSettings = (function() {
|
||||
function compText(a, b) {
|
||||
return a.text.localeCompare(b.text);
|
||||
}
|
||||
|
||||
|
||||
var viewSettings = [
|
||||
{
|
||||
options: [
|
||||
{setting:"editor-language",local: true, label:"menu.label.view.language",options:function(done){ done([{val:'',text:RED._('menu.label.view.browserDefault')}].concat(RED.settings.theme("languages").map(localeToName).sort(compText))) }},
|
||||
]
|
||||
},{
|
||||
},
|
||||
// {
|
||||
// options: [
|
||||
// {setting:"theme", label:"Theme",options:function(done){ done([{val:'',text:'default'}].concat(RED.settings.theme("themes"))) }},
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
title: "menu.label.view.grid",
|
||||
options: [
|
||||
{setting:"view-show-grid",oldSetting:"menu-menu-item-view-show-grid",label:"menu.label.view.showGrid", default: true, toggle:true,onchange:"core:toggle-show-grid"},
|
||||
|
Reference in New Issue
Block a user