From 81f59a853d182d55794ae5824a3f070986d2f2da Mon Sep 17 00:00:00 2001 From: hdoukas Date: Sat, 24 May 2014 14:31:02 +0200 Subject: [PATCH] fixed credentials to never show up in the flow removed credentials from the defaults section in pusher.html, added oneditprepare to read them back from credentials.json when edited --- social/pusher/114-pusher.html | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/social/pusher/114-pusher.html b/social/pusher/114-pusher.html index ea91ebb6..7f07fe57 100644 --- a/social/pusher/114-pusher.html +++ b/social/pusher/114-pusher.html @@ -51,7 +51,6 @@ color:"#A9D0F5", defaults: { // defines the editable properties of the node name: {value:""}, // along with default values. - appkey_sub: {value:"", required:true}, channel: {value:"", required:true}, eventname: {value:"", required:true} }, @@ -77,6 +76,13 @@ success: function(result){} }); }, + oneditprepare: function() { + $.getJSON('pusher/'+this.id,function(data) { + if (data.pusherappkey_sub) { + $('#node-input-appkey_sub').val(data.pusherappkey_sub); + } + }); + }, ondelete: function() { $.ajax({ url: 'pusher/'+this.id, @@ -132,11 +138,9 @@ color:"#A9D0F5", defaults: { // defines the editable properties of the node name: {value:""}, // along with default values. - appid: {value:"", required:true}, - appkey: {value:"", required:true}, - appsecret: {value:"", required:true}, channel: {value:"", required:true}, - eventname: {value:"", required:true} + eventname: {value:"", required:true}, + appid: {value:"", required:true} }, inputs:1, // set the number of inputs - only 0 or 1 outputs:0, // set the number of outputs - 0 to n @@ -165,6 +169,21 @@ success: function(result){} }); }, + oneditprepare: function() { + $.getJSON('pusher/'+this.id,function(data) { + if (data.pusherappid) { + $('#node-input-appid').val(data.pusherappid); + } + if (data.pusherappkey) { + $('#node-input-appkey').val(data.pusherappkey); + } + + if (data.pusherappsecret) { + $('#node-input-appsecret').val(data.pusherappsecret); + } + + }); + }, ondelete: function() { $.ajax({ url: 'pusher/'+this.id,