From c470827c2edaf5403eb083ad5998976b4226fe73 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 21 Feb 2018 14:11:39 +0100 Subject: [PATCH] Moved Fancybox to ExternalScript --- Site/Controls/v5/Meta/ExternalScripts.ascx.cs | 80 +++++++++++-------- Site/Site.csproj | 1 + 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/Site/Controls/v5/Meta/ExternalScripts.ascx.cs b/Site/Controls/v5/Meta/ExternalScripts.ascx.cs index dd732703..5439d84b 100644 --- a/Site/Controls/v5/Meta/ExternalScripts.ascx.cs +++ b/Site/Controls/v5/Meta/ExternalScripts.ascx.cs @@ -22,12 +22,6 @@ namespace Swarmops.Frontend.Controls.Meta { externalScriptUrl = "/Scripts/ExternalScripts"; } - else if (Debugger.IsAttached || - PilotInstallationIds.IsPilot (PilotInstallationIds.DevelopmentSandbox)) - { - externalScriptUrl += "/staging"; - // use staging area for new script versions on Sandbox and for all debugging - } // If we're debugging a seriously experimental new version of JEasyUI, look for it in /Scripts/Experimental // (a folder which doesn't commit to the github repo) @@ -37,41 +31,59 @@ namespace Swarmops.Frontend.Controls.Meta externalScriptUrl = "/Scripts/Experimental"; } - if (Package == "easyui") + StringBuilder scriptRef = new StringBuilder(); + + switch (Package.ToLowerInvariant()) { - StringBuilder scriptRef = new StringBuilder(); + case "easyui": - scriptRef.Append("\r\n"); - scriptRef.Append("\r\n"); - scriptRef.Append("\r\n"); // Supposed to contain all CSS - - if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft) - { scriptRef.Append("\r\n"); + "/easyui/jquery.easyui.min.js\" type=\"text/javascript\">\r\n"); scriptRef.Append("\r\n"); - } + "/easyui/themes/icon.css\" />\r\n"); + scriptRef.Append("\r\n"); // Supposed to contain all CSS - /* -- with the inclusion of the catchall CSS file, this code _should_ no longer be necessary... - string[] controlNames = Controls.Split(','); - foreach (string controlName in controlNames) - { - string controlNameLower = controlName.Trim().ToLowerInvariant(); - if (controlNameLower != "unknown") + if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft) { - scriptRef.AppendFormat ( - "\r\n", - controlNameLower); + scriptRef.Append("\r\n"); + scriptRef.Append("\r\n"); } - }*/ - this.LiteralReference.Text = scriptRef.ToString(); + /* -- with the inclusion of the catchall CSS file, this code _should_ no longer be necessary... + string[] controlNames = Controls.Split(','); + foreach (string controlName in controlNames) + { + string controlNameLower = controlName.Trim().ToLowerInvariant(); + if (controlNameLower != "unknown") + { + scriptRef.AppendFormat ( + "\r\n", + controlNameLower); + } + }*/ + + break; + + case "fancybox": + + scriptRef.Append("\r\n"); + + // If we're including Fancybox, always also include Elevated Zoom, which isn't external + + scriptRef.Append("\r\n"); + + break; + + default: + throw new NotImplementedException("Unimplemented external script package"); } + + this.LiteralReference.Text = scriptRef.ToString(); + } - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/Site/Site.csproj b/Site/Site.csproj index be6cc7d2..9cebf5cf 100644 --- a/Site/Site.csproj +++ b/Site/Site.csproj @@ -1913,6 +1913,7 @@ +