1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge remote-tracking branch 'upstream/dev' into update-i18n-editor

This commit is contained in:
Hiroyasu Nishiyama 2018-11-14 09:06:05 +09:00
commit cf931e8ddf
8 changed files with 81 additions and 34 deletions

View File

@ -424,6 +424,8 @@
"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",

View File

@ -106,6 +106,7 @@
"warning": "<strong>警告</strong>: __message__",
"warnings": {
"undeployedChanges": "ノードの変更をデプロイしていません",
"nodeActionDisabled": "ノードのアクションは無効になっています",
"nodeActionDisabledSubflow": "ノードのアクションは、サブフロー内で無効になっています",
"missing-types": "不明なノードが存在するため、フローを停止しました。詳細はログを確認してください。",
"safe-mode": "<p>セーフモードでフローを停止しました</p><p>フローを変更し、再起動するために変更をデプロイできます</p>",
@ -160,8 +161,10 @@
"subflow_plural": "__count__ 個のサブフロー",
"selectNodes": "上のテキストを選択し、クリップボードへコピーしてください",
"pasteNodes": "JSON形式のフローデータを貼り付けてください",
"selectFile": "読み込むファイルを選択してください",
"importNodes": "フローをクリップボートから読み込み",
"exportNodes": "フローをクリップボードへ書き出し",
"download": "ダウンロード",
"importUnrecognised": "認識できない型が読み込まれました:",
"importUnrecognised_plural": "認識できない型が読み込まれました:",
"nodesExported": "クリップボードへフローを書き出しました",
@ -510,7 +513,8 @@
"empty": "データが存在しません",
"node": "Node",
"flow": "Flow",
"global": "Global"
"global": "Global",
"deleteConfirm": "データを削除しても良いですか?"
},
"palette": {
"name": "パレットの管理",

View File

@ -955,11 +955,11 @@ RED.nodes = (function() {
def = registry.getNodeType(n.type);
if (!def || def.category != "config") {
var node = {
x:n.x,
y:n.y,
x:parseFloat(n.x || 0),
y:parseFloat(n.y || 0),
z:n.z,
type:0,
wires:n.wires,
wires:n.wires||[],
inputLabels: n.inputLabels,
outputLabels: n.outputLabels,
icon: n.icon,

View File

@ -1612,6 +1612,7 @@ 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();
});

View File

@ -321,7 +321,7 @@ RED.palette.editor = (function() {
var catalogueLoadStart;
var catalogueLoadErrors = false;
var activeSort = sortModulesAZ;
var activeSort = sortModulesRelevance;
function handleCatalogResponse(err,catalog,index,v) {
catalogueLoadStatus.push(err||v);
@ -333,6 +333,9 @@ 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 {
@ -413,6 +416,17 @@ 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);
}
@ -747,32 +761,29 @@ RED.palette.editor = (function() {
$('<span>').text(RED._("palette.editor.sort")+' ').appendTo(toolBar);
var sortGroup = $('<span class="button-group"></span>').appendTo(toolBar);
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 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);
sortAZ.click(function(e) {
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");
sortRecent.removeClass("selected");
activeSort = sortModulesAZ;
activeSort = opt.func;
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) {
@ -814,10 +825,23 @@ 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);
@ -830,6 +854,16 @@ 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 = {

View File

@ -107,8 +107,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 = {
@ -254,10 +254,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);
$("#workspace").toggleClass("workspace-disabled",!!tab.disabled);
RED.sidebar.config.refresh();
RED.view.focus();
},

View File

@ -159,3 +159,8 @@
border-color: #666 !important;
}
}
.red-ui-popover code {
border: none;
background: none;
color: #ccc;
}

View File

@ -410,7 +410,9 @@
"json-error": "JSONの構文解析エラー",
"no-url": "URLが設定されていません",
"deprecated-call": "非推奨の呼び出しです __method__",
"invalid-transport": "httpでないトランスポートが要求されました"
"invalid-transport": "httpでないトランスポートが要求されました",
"timeout-isnan": "タイムアウト値が数値ではないため無視します",
"timeout-isnegative": "タイムアウト値が負数のため無視します"
},
"status": {
"requesting": "要求中"