From 3e3b388ca7a4692ff7307e1b031494a80043ec9b Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 8 Sep 2014 14:41:39 +0100 Subject: [PATCH] Prevent adding empty twitter creds Closes #372 --- nodes/core/social/27-twitter.html | 5 +++-- public/red/ui/editor.js | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nodes/core/social/27-twitter.html b/nodes/core/social/27-twitter.html index 44417b598..99d452137 100644 --- a/nodes/core/social/27-twitter.html +++ b/nodes/core/social/27-twitter.html @@ -30,8 +30,8 @@ pathname += "/"; } var callback = encodeURIComponent(location.protocol+"//"+location.hostname+":"+location.port+pathname+"twitter-credentials/"+twitterConfigNodeId+"/auth/callback"); - - $("#node-config-twitter-row").html('Click here to authenticate with Twitter.'); + $("#node-config-dialog-ok").button("disable"); + $("#node-config-twitter-row").html('
Click here to authenticate with Twitter.
'); $("#node-config-twitter-start").click(function() { twitterConfigNodeIntervalId = window.setTimeout(pollTwitterCredentials,2000); }); @@ -45,6 +45,7 @@ if (data.screen_name) { updateTwitterScreenName(data.screen_name); twitterConfigNodeIntervalId = null; + $("#node-config-dialog-ok").button("enable"); } else { twitterConfigNodeIntervalId = window.setTimeout(pollTwitterCredentials,2000); } diff --git a/public/red/ui/editor.js b/public/red/ui/editor.js index 38f669ee9..70a77622e 100644 --- a/public/red/ui/editor.js +++ b/public/red/ui/editor.js @@ -122,6 +122,7 @@ RED.editor = (function() { width: 500, buttons: [ { + id: "node-dialog-ok", text: "Ok", click: function() { if (editing_node) { @@ -237,6 +238,7 @@ RED.editor = (function() { } }, { + id: "node-dialog-cancel", text: "Cancel", click: function() { $( this ).dialog( "close" ); @@ -562,6 +564,7 @@ RED.editor = (function() { closeOnEscape: false, buttons: [ { + id: "node-config-dialog-ok", text: "Ok", click: function() { var configProperty = $(this).dialog('option','node-property'); @@ -611,6 +614,7 @@ RED.editor = (function() { } }, { + id: "node-config-dialog-cancel", text: "Cancel", click: function() { var configType = $(this).dialog('option','node-type');