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:

​
-

+
@@ -355,15 +355,6 @@ // This JavaScript block is for the Master Modal Person Editor. - $(document).ready(function() { - $('.MasterToggles').toggles( - { text: { - on: SwarmopsJS.unescape('<%= this.Localized_SwitchLabelOn_Upper %>'), - off: SwarmopsJS.unescape('<%= this.Localized_SwitchLabelOff_Upper %>') - } - }).change(function() {}); - }); - function masterBeginEditPerson(personId) { _master_PersonEditedId = personId; @@ -415,6 +406,15 @@ var _master_PersonEditLoading = false; + function masterPersonEditorOnToggle(newValue, fieldName, controlName) { + // Do the AJAX call from here, as we need to also pass along the person ID of the person edited + // (the AjaxToggleSlider auto-callback is disabled for this reason) + + + alert("Field Change: " + fieldName + " changed to '" + newValue + "'"); + } + + function masterPersonEditorOnFieldChange(newValue, fieldName, controlName) { // Do the AJAX call from here, as we need to also pass along the person ID of the person edited // (the AjaxTextBox auto-callback is disabled for this reason, code duplicated here) @@ -458,10 +458,6 @@ window[controlName + "_updateFailAnimate"](result.NewValue); }); - - - //alert("Field Change: " + fieldName + " changed to '" + newValue + "'"); - } function masterEndEditPerson() { diff --git a/Site/Master-v5.master.designer.cs b/Site/Master-v5.master.designer.cs index c78ff67e..2d0e0807 100644 --- a/Site/Master-v5.master.designer.cs +++ b/Site/Master-v5.master.designer.cs @@ -373,13 +373,13 @@ namespace Swarmops.Frontend { protected global::System.Web.UI.WebControls.Label MasterLabelEditPersonHeaderSecurityProvisioning; /// - /// MasterLabelEditPersonSecurity2FA control. + /// MasterToggleEditPerson2FA control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Label MasterLabelEditPersonSecurity2FA; + protected global::Swarmops.Frontend.Controls.Base.AjaxToggleSlider MasterToggleEditPerson2FA; /// /// MasterLabelEditPersonResetPassword control. diff --git a/Site/web.config b/Site/web.config index b0caa90c..7535026e 100644 --- a/Site/web.config +++ b/Site/web.config @@ -33,6 +33,7 @@ +