Moved Fancybox to ExternalScript

This commit is contained in:
Rick Falkvinge
2018-02-21 14:11:39 +01:00
parent 7e5f491810
commit c470827c2e
2 changed files with 47 additions and 34 deletions
+46 -34
View File
@@ -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("<script src=\"" + externalScriptUrl +
"/easyui/jquery.easyui.min.js\" type=\"text/javascript\"></script>\r\n");
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/icon.css\" />\r\n");
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/default/easyui.css\" />\r\n"); // Supposed to contain all CSS
if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
{
scriptRef.Append("<script src=\"" + externalScriptUrl +
"/easyui/extensions/easyui-rtl.js\" type=\"text/javascript\"></script>\r\n");
"/easyui/jquery.easyui.min.js\" type=\"text/javascript\"></script>\r\n");
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/extensions/easyui-rtl.css\" />\r\n");
}
"/easyui/themes/icon.css\" />\r\n");
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/default/easyui.css\" />\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 (
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/default/{0}.css\" />\r\n",
controlNameLower);
scriptRef.Append("<script src=\"" + externalScriptUrl +
"/easyui/extensions/easyui-rtl.js\" type=\"text/javascript\"></script>\r\n");
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/extensions/easyui-rtl.css\" />\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 (
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/default/{0}.css\" />\r\n",
controlNameLower);
}
}*/
break;
case "fancybox":
scriptRef.Append("<script src=\"" + externalScriptUrl +
"/fancybox/jquery.fancybox.min.js\" type=\"text/javascript\"></script>\r\n");
// If we're including Fancybox, always also include Elevated Zoom, which isn't external
scriptRef.Append("<script src='/Scripts/jquery.elevateZoom-3.0.8.min.js' type='text/javascript'></script>\r\n");
break;
default:
throw new NotImplementedException("Unimplemented external script package");
}
this.LiteralReference.Text = scriptRef.ToString();
}
}
}
}
+1
View File
@@ -1913,6 +1913,7 @@
<Content Include="Scripts\fancybox\jquery.fancybox-1.3.4.pack.js" />
<Content Include="Scripts\fancybox\jquery.mousewheel-3.0.4.pack.js" />
<Content Include="Scripts\hoverIntent.min.js" />
<Content Include="Scripts\jquery-3.3.1.min.js" />
<Content Include="Scripts\jquery-ui.1.11.1.min.js" />
<Content Include="Scripts\jquery.2.0.3.min.js" />
<Content Include="Scripts\jquery.animate-shadow.js" />