From 02f97938ffb63f1e2bb4c8ae18a520ba3fff09a9 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 5 Sep 2015 16:25:58 +0200 Subject: [PATCH] Some fixes to bitcoin address submission --- Logic/Swarm/DashboardTodos.cs | 4 ++-- Site5/Master-v5.master.cs | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Logic/Swarm/DashboardTodos.cs b/Logic/Swarm/DashboardTodos.cs index f9cb0b06..a135cbdb 100644 --- a/Logic/Swarm/DashboardTodos.cs +++ b/Logic/Swarm/DashboardTodos.cs @@ -44,10 +44,10 @@ namespace Swarmops.Logic.Swarm todo.JavaScript = "alertify.prompt(decodeURIComponent('" + Uri.EscapeDataString ( Logic_Swarm_DashboardTodos.Bitcoin_SetPayoutAddress_Prompt.Replace ( - "[SwarmopsInstallationName]", SystemSettings.InstallationName)) + + "[InstallationName]", SystemSettings.InstallationName)) + "' + '

'), function(okPressed, enteredData) { " + " if (okPressed) { " + - "SwarmopsJS.ajaxCall('/Automation/FinancialFunctions.aspx/SetBitcoinPayoutAddress', { bitcoinAddress: 'test' }, function (result) { " + + "SwarmopsJS.ajaxCall('/Automation/FinancialFunctions.aspx/SetBitcoinPayoutAddress', { bitcoinAddress: enteredData }, function (result) { " + "if (result.Success) { alert ('for great justice!'); $('div#divDashboardTodo').fadeOut(); } else { alertify.alert('Could not set payout address: ' + result.DisplayMessage); } " + "} ); " + " }}); return false;"; diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index 794391ae..6430f335 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Web; using System.Web.Security; using System.Web.UI; +using NBitcoin; using Resources; using Swarmops.Interface.Support; using Swarmops.Logic.Financial; @@ -119,7 +120,12 @@ namespace Swarmops this.RepeaterTodoItems.DataSource = todos; this.RepeaterTodoItems.DataBind(); - this.LabelNoTodoItems.Visible = (todos.Count == 0); + + if (todos.Count == 0) + { + // If no todos, hide the entire Todos box + this.LiteralDocumentReadyHook.Text += @"$('div#divDashboardTodo').hide();"; + } // Set up main menu @@ -137,7 +143,7 @@ namespace Swarmops if (dashMessage != null && dashMessage.Value.Length > 0) { - this.LiteralDocumentReadyHook.Text = + this.LiteralDocumentReadyHook.Text += string.Format ("alertify.alert(decodeURIComponent('{0}'));", dashMessage.Value); DashboardMessage.Reset(); }