From 4cdd0d11bc78b191628e23bdfb4c654ebc0ac113 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 1 Oct 2016 17:23:14 +0200 Subject: [PATCH] Changed loc convention (this removes a JS warning) --- Site/Pages/v5/Swarm/AddPerson.aspx | 10 ++--- Site/Pages/v5/Swarm/AddPerson.aspx.cs | 37 ++++++++++++--- .../Pages/v5/Swarm/AddPerson.aspx.designer.cs | 45 ------------------- 3 files changed, 36 insertions(+), 56 deletions(-) diff --git a/Site/Pages/v5/Swarm/AddPerson.aspx b/Site/Pages/v5/Swarm/AddPerson.aspx index 857127a7..b6ea7f6f 100644 --- a/Site/Pages/v5/Swarm/AddPerson.aspx +++ b/Site/Pages/v5/Swarm/AddPerson.aspx @@ -149,17 +149,17 @@ if (msg.d != true) { isValid = false; $('#<%= TextDateOfBirth.ClientID %>').addClass("entryError"); - alertify.error(""); + alertify.error(SwarmopsJS.unescape('<%= this.Localized_ErrorDate %>')); $('#<%=this.TextDateOfBirth.ClientID %>').focus(); } } }); } - isValid = ValidateTextField('#<%= TextCity.ClientID %>', "") && isValid; - isValid = ValidateTextField('#<%= TextStreet1.ClientID %>', "") && isValid; - isValid = ValidateTextField('#<%= TextMail.ClientID %>', "") && isValid; - isValid = ValidateTextField('#<%= TextName.ClientID %>', "") && isValid; // TODO: Actually validate geography? + isValid = ValidateTextField('#<%= TextCity.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ErrorCity %>')) && isValid; + isValid = ValidateTextField('#<%= TextStreet1.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ErrorStreet %>')) && isValid; + isValid = ValidateTextField('#<%= TextMail.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ErrorMail %>')) && isValid; + isValid = ValidateTextField('#<%= TextName.ClientID %>', SwarmopsJS.unescape('<%= this.Localized_ErrorName %>')) && isValid; // TODO: Actually validate geography? return isValid; } diff --git a/Site/Pages/v5/Swarm/AddPerson.aspx.cs b/Site/Pages/v5/Swarm/AddPerson.aspx.cs index 7c2e2175..87237197 100644 --- a/Site/Pages/v5/Swarm/AddPerson.aspx.cs +++ b/Site/Pages/v5/Swarm/AddPerson.aspx.cs @@ -67,12 +67,6 @@ namespace Swarmops.Frontend.Pages.v5.Swarm private void Localize() { - this.LiteralErrorCity.Text = Resources.Pages.Swarm.AddPerson_ErrorCity; - this.LiteralErrorMail.Text = Resources.Pages.Swarm.AddPerson_ErrorMail; - this.LiteralErrorName.Text = Resources.Pages.Swarm.AddPerson_ErrorName; - this.LiteralErrorStreet.Text = Resources.Pages.Swarm.AddPerson_ErrorStreet; - this.LiteralErrorDate.Text = Resources.Pages.Swarm.AddPerson_ErrorDate; - this.LabelName.Text = Resources.Global.Global_Name; this.LabelCountry.Text = Resources.Global.Global_Country; this.LabelMail.Text = Resources.Global.Global_Mail; @@ -139,5 +133,36 @@ namespace Swarmops.Frontend.Pages.v5.Swarm this.TextName.Focus(); this.LiteralLoadAlert.Text = Resources.Pages.Swarm.AddPerson_PersonSuccessfullyRegistered; } + + + // ReSharper disable once InconsistentNaming + public string Localized_ErrorDate + { + get { return JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorDate); } + } + + // ReSharper disable once InconsistentNaming + public string Localized_ErrorMail + { + get { return JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorMail); } + } + + // ReSharper disable once InconsistentNaming + public string Localized_ErrorCity + { + get { return JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorCity); } + } + + // ReSharper disable once InconsistentNaming + public string Localized_ErrorStreet + { + get { return JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorStreet); } + } + + // ReSharper disable once InconsistentNaming + public string Localized_ErrorName + { + get { return JavascriptEscape(Resources.Pages.Swarm.AddPerson_ErrorName); } + } } } \ No newline at end of file diff --git a/Site/Pages/v5/Swarm/AddPerson.aspx.designer.cs b/Site/Pages/v5/Swarm/AddPerson.aspx.designer.cs index d92decf9..f9e07511 100644 --- a/Site/Pages/v5/Swarm/AddPerson.aspx.designer.cs +++ b/Site/Pages/v5/Swarm/AddPerson.aspx.designer.cs @@ -12,51 +12,6 @@ namespace Swarmops.Frontend.Pages.v5.Swarm { public partial class AddPerson { - /// - /// LiteralErrorDate control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal LiteralErrorDate; - - /// - /// LiteralErrorCity control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal LiteralErrorCity; - - /// - /// LiteralErrorStreet control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal LiteralErrorStreet; - - /// - /// LiteralErrorMail control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal LiteralErrorMail; - - /// - /// LiteralErrorName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal LiteralErrorName; - /// /// LiteralLoadAlert control. ///