Some fixes to bitcoin address submission

This commit is contained in:
Rick Falkvinge
2015-09-05 16:25:58 +02:00
parent 825353e126
commit 02f97938ff
2 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -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)) +
"' + '<br/><br/>'), 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;";
+8 -2
View File
@@ -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();
}