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

Make all dialog buttons consistent with editor tray

This commit is contained in:
Nick O'Leary 2016-05-03 21:36:22 +01:00
parent ce25fc658b
commit fa90eeac55
6 changed files with 79 additions and 41 deletions

View File

@ -23,7 +23,7 @@ RED.clipboard = (function() {
var importNodesDialog; var importNodesDialog;
function setupDialogs() { function setupDialogs() {
dialog = $('<div id="clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>') dialog = $('<div id="clipboard-dialog" class="hide node-red-dialog"><form class="dialog-form form-horizontal"></form></div>')
.appendTo("body") .appendTo("body")
.dialog({ .dialog({
modal: true, modal: true,
@ -31,14 +31,6 @@ RED.clipboard = (function() {
width: 500, width: 500,
resizable: false, resizable: false,
buttons: [ buttons: [
{
id: "clipboard-dialog-ok",
text: RED._("common.label.ok"),
click: function() {
RED.view.importNodes($("#clipboard-import").val());
$( this ).dialog( "close" );
}
},
{ {
id: "clipboard-dialog-cancel", id: "clipboard-dialog-cancel",
text: RED._("common.label.cancel"), text: RED._("common.label.cancel"),
@ -48,10 +40,20 @@ RED.clipboard = (function() {
}, },
{ {
id: "clipboard-dialog-close", id: "clipboard-dialog-close",
class: "primary",
text: RED._("common.label.close"), text: RED._("common.label.close"),
click: function() { click: function() {
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
},
{
id: "clipboard-dialog-ok",
class: "primary",
text: RED._("common.label.import"),
click: function() {
RED.view.importNodes($("#clipboard-import").val());
$( this ).dialog( "close" );
}
} }
], ],
open: function(e) { open: function(e) {

View File

@ -254,7 +254,14 @@ RED.library = (function() {
height: 450, height: 450,
buttons: [ buttons: [
{ {
text: RED._("common.label.ok"), text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.load"),
class: "primary",
click: function() { click: function() {
if (selectedLibraryItem) { if (selectedLibraryItem) {
for (var i=0;i<options.fields.length;i++) { for (var i=0;i<options.fields.length;i++) {
@ -265,12 +272,6 @@ RED.library = (function() {
} }
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
},
{
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
} }
], ],
open: function(e) { open: function(e) {
@ -359,15 +360,16 @@ RED.library = (function() {
height: 230, height: 230,
buttons: [ buttons: [
{ {
text: RED._("common.label.ok"), text: RED._("common.label.cancel"),
click: function() { click: function() {
saveToLibrary(true);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
}, },
{ {
text: RED._("common.label.cancel"), text: RED._("common.label.save"),
class: "primary",
click: function() { click: function() {
saveToLibrary(true);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
} }
@ -381,15 +383,16 @@ RED.library = (function() {
height: 230, height: 230,
buttons: [ buttons: [
{ {
text: RED._("common.label.ok"), text: RED._("common.label.cancel"),
click: function() { click: function() {
saveToLibrary(false);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
}, },
{ {
text: RED._("common.label.cancel"), text: RED._("common.label.save"),
class: "primary",
click: function() { click: function() {
saveToLibrary(false);
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
} }
@ -432,9 +435,17 @@ RED.library = (function() {
resizable: false, resizable: false,
title: RED._("library.exportToLibrary"), title: RED._("library.exportToLibrary"),
buttons: [ buttons: [
{
id: "library-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{ {
id: "library-dialog-ok", id: "library-dialog-ok",
text: RED._("common.label.ok"), class: "primary",
text: RED._("common.label.export"),
click: function() { click: function() {
//TODO: move this to RED.library //TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val(); var flowName = $("#node-input-library-filename").val();
@ -457,13 +468,6 @@ RED.library = (function() {
} }
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
},
{
id: "library-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
} }
], ],
open: function(e) { open: function(e) {

View File

@ -134,7 +134,14 @@ RED.workspaces = (function() {
} }
}, },
{ {
text: RED._("common.label.ok"), text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.done"),
class: "primary",
click: function() { click: function() {
var workspace = $(this).dialog('option','workspace'); var workspace = $(this).dialog('option','workspace');
var label = $( "#node-input-workspace-name" ).val(); var label = $( "#node-input-workspace-name" ).val();
@ -146,13 +153,8 @@ RED.workspaces = (function() {
} }
$( this ).dialog( "close" ); $( this ).dialog( "close" );
} }
},
{
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
} }
], ],
open: function(e) { open: function(e) {
RED.keyboard.disable(); RED.keyboard.disable();

View File

@ -71,7 +71,8 @@
button { button {
@include workspace-button; @include workspace-button;
padding: 0.4em 1em; font-size: 14px;
padding: 6px 14px;
margin-right: 8px; margin-right: 8px;
color: $editor-button-color-primary; color: $editor-button-color-primary;
&.leftButton { &.leftButton {
@ -83,7 +84,6 @@
} }
&:not(.primary) { &:not(.primary) {
background: none; background: none;
&:hover { &:hover {
color: $editor-button-color-primary; color: $editor-button-color-primary;
} }

View File

@ -73,6 +73,32 @@
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: none; float: none;
} }
.ui-dialog-buttonset button {
@include workspace-button;
font-size: 14px;
padding: 6px 14px;
margin-right: 8px;
color: $editor-button-color-primary;
&.leftButton {
float: left;
margin-top: 7px;
}
&:not(.leftButton):not(:last-child) {
margin-right: 16px;
}
&:not(.primary) {
background: none;
&:hover {
color: $editor-button-color-primary;
}
}
.ui-button-text {
padding: 0;
}
}
.ui-dialog .ui-dialog-buttonpane { .ui-dialog .ui-dialog-buttonpane {
padding: .3em 1em .5em 1em; padding: .3em 1em .5em 1em;
} }

View File

@ -6,7 +6,11 @@
"done":"Done", "done":"Done",
"cancel": "Cancel", "cancel": "Cancel",
"delete": "Delete", "delete": "Delete",
"close": "Close" "close": "Close",
"load": "Load",
"save": "Save",
"import": "Import",
"export": "Export"
} }
}, },
"workspace": { "workspace": {
@ -196,7 +200,7 @@
}, },
"sidebar": { "sidebar": {
"info": { "info": {
"name": "Information", "name": "Node information",
"label": "info", "label": "info",
"node": "Node", "node": "Node",
"type": "Type", "type": "Type",