From df0add0a184166d9a0967d79fb038a357d64479b Mon Sep 17 00:00:00 2001 From: Falkvinge Date: Mon, 14 Nov 2016 18:39:34 +0100 Subject: [PATCH] Lots of work on a slider toggle control --- Site/App_GlobalResources/Global.designer.cs | 4 +- Site/App_GlobalResources/Global.resx | 2 +- Site/Bases/MasterV5Base.cs | 11 -- Site/Controls/v5/Base/AjaxToggleSlider.ascx | 144 ++++++++++-------- .../Controls/v5/Base/AjaxToggleSlider.ascx.cs | 19 ++- Site/Master-v5.master | 24 ++- Site/Master-v5.master.designer.cs | 4 +- Site/web.config | 1 + 8 files changed, 109 insertions(+), 100 deletions(-) diff --git a/Site/App_GlobalResources/Global.designer.cs b/Site/App_GlobalResources/Global.designer.cs index 6e4c8035..52b36054 100644 --- a/Site/App_GlobalResources/Global.designer.cs +++ b/Site/App_GlobalResources/Global.designer.cs @@ -19,7 +19,7 @@ namespace Resources { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option or rebuild the Visual Studio project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Global { @@ -1447,7 +1447,7 @@ namespace Resources { } /// - /// Looks up a localized string similar to 2FA (disabling quarantines login). + /// Looks up a localized string similar to Two-factor authentication (disabling quarantines login). /// internal static string Master_EditPerson2FAEnable { get { diff --git a/Site/App_GlobalResources/Global.resx b/Site/App_GlobalResources/Global.resx index 9f415979..ac2a1918 100644 --- a/Site/App_GlobalResources/Global.resx +++ b/Site/App_GlobalResources/Global.resx @@ -740,7 +740,7 @@ Twitter ID - 2FA (disabling quarantines login) + Two-factor authentication (disabling quarantines login) This means that a disabling of two-factor authentication will notify the user and lock them out from logging back on for a while, typically 48 hours or seven days. diff --git a/Site/Bases/MasterV5Base.cs b/Site/Bases/MasterV5Base.cs index 328379fa..04c8ccef 100644 --- a/Site/Bases/MasterV5Base.cs +++ b/Site/Bases/MasterV5Base.cs @@ -64,18 +64,7 @@ namespace Swarmops.Frontend } - // Common localizations - // ReSharper disable InconsistentNaming - public string Localized_SwitchLabelOn_Upper - { - get { return CommonV5.JavascriptEscape(Resources.Global.Global_On.ToUpperInvariant()); } - } - - public string Localized_SwitchLabelOff_Upper - { - get { return CommonV5.JavascriptEscape(Resources.Global.Global_Off.ToUpperInvariant()); } - } } } \ No newline at end of file diff --git a/Site/Controls/v5/Base/AjaxToggleSlider.ascx b/Site/Controls/v5/Base/AjaxToggleSlider.ascx index a1575731..0e728598 100644 --- a/Site/Controls/v5/Base/AjaxToggleSlider.ascx +++ b/Site/Controls/v5/Base/AjaxToggleSlider.ascx @@ -2,99 +2,109 @@ -
+
diff --git a/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs b/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs index 78ab36d9..396445c8 100644 --- a/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs +++ b/Site/Controls/v5/Base/AjaxToggleSlider.ascx.cs @@ -12,12 +12,25 @@ namespace Swarmops.Frontend.Controls.Base { protected void Page_Load(object sender, EventArgs e) { - + this.ToggleSliderLabel.Text = this.Label; } public string Label { get; set; } - public string CallbackUrl { get; set; } - public string OnClientChange { get; set; } + public string AjaxCallbackUrl { get; set; } + public string OnChange { get; set; } public string Cookie { get; set; } + public bool InitialValue { get; set; } + + + // ReSharper disable InconsistentNaming + public string Localized_SwitchLabelOn_Upper + { + get { return CommonV5.JavascriptEscape(Resources.Global.Global_On.ToUpperInvariant()); } + } + + public string Localized_SwitchLabelOff_Upper + { + get { return CommonV5.JavascriptEscape(Resources.Global.Global_Off.ToUpperInvariant()); } + } } } \ No newline at end of file diff --git a/Site/Master-v5.master b/Site/Master-v5.master index 799e0b74..fcfc940b 100644 --- a/Site/Master-v5.master +++ b/Site/Master-v5.master @@ -259,7 +259,7 @@

PERSONNAME:

​
-

+