diff options
Diffstat (limited to 'MediaBrowser.WebDashboard/Api/PackageCreator.cs')
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/PackageCreator.cs | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index dd1eba9a5..033ffd5f3 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -274,10 +274,26 @@ namespace MediaBrowser.WebDashboard.Api var version = GetType().Assembly.GetName().Version; - var imports = "<link rel=\"import\" href=\"thirdparty/polymer/polymer.html\">"; - imports = ""; - - html = html.Replace("<head>", "<head>" + GetMetaTags(mode) + GetCommonCss(mode, version) + GetCommonJavascript(mode, version) + imports); + var imports = new string[] + { + "bower_components/paper-button/paper-button.html", + "bower_components/paper-toast/paper-toast.html", + "bower_components/paper-spinner/paper-spinner.html", + "bower_components/paper-fab/paper-fab.html", + "bower_components/paper-dialog/paper-dialog.html", + "bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html", + "bower_components/neon-animation/animations/scale-up-animation.html", + "bower_components/neon-animation/animations/fade-out-animation.html", + //"bower_components/paper-icon-button/paper-icon-button.html", + "thirdparty/emby-icons.html" + }; + var importsHtml = string.Join("", imports.Select(i => "<link rel=\"import\" href=\"" + i + "\">").ToArray()); + + // It would be better to make polymer completely dynamic and loaded on demand, but seeing issues with that + // In chrome it is causing the body to be hidden while loading, which leads to width-check methods to return 0 for everything + //imports = ""; + + html = html.Replace("<head>", "<head>" + GetMetaTags(mode) + GetCommonCss(mode, version) + GetCommonJavascript(mode, version) + importsHtml); var bytes = Encoding.UTF8.GetBytes(html); @@ -333,13 +349,13 @@ namespace MediaBrowser.WebDashboard.Api if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) { - sb.Append("<meta http-equiv=\"Content-Security-Policy\" content=\"default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'\">"); + //sb.Append("<meta http-equiv=\"Content-Security-Policy\" content=\"default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'\">"); } sb.Append("<meta http-equiv=\"X-UA-Compatibility\" content=\"IE=Edge\">"); sb.Append("<meta name=\"format-detection\" content=\"telephone=no\">"); sb.Append("<meta name=\"msapplication-tap-highlight\" content=\"no\">"); - sb.Append("<meta name=\"viewport\" content=\"user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi\">"); + sb.Append("<meta name=\"viewport\" content=\"user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width\">"); sb.Append("<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">"); sb.Append("<meta name=\"mobile-web-app-capable\" content=\"yes\">"); sb.Append("<meta name=\"application-name\" content=\"Emby\">"); @@ -371,7 +387,6 @@ namespace MediaBrowser.WebDashboard.Api var files = new[] { - "thirdparty/jquerymobile-1.4.5/jquery.mobile-1.4.5.min.css", "thirdparty/fontawesome/css/font-awesome.min.css" + versionString, "thirdparty/materialicons/style.css" + versionString, "css/all.css" + versionString @@ -396,7 +411,7 @@ namespace MediaBrowser.WebDashboard.Api var files = new List<string> { - //"thirdparty/webcomponentsjs/webcomponents-lite.min.js", + "bower_components/webcomponentsjs/webcomponents-lite.min.js", "scripts/all.js" + versionString }; @@ -615,6 +630,12 @@ namespace MediaBrowser.WebDashboard.Api /// <returns>Task{Stream}.</returns> private async Task<Stream> GetAllCss(bool enableMinification) { + var memoryStream = new MemoryStream(); + var newLineBytes = Encoding.UTF8.GetBytes(Environment.NewLine); + + await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.theme.min.css", newLineBytes).ConfigureAwait(false); + await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.structure.min.css", newLineBytes).ConfigureAwait(false); + var files = new[] { "site.css", @@ -634,7 +655,6 @@ namespace MediaBrowser.WebDashboard.Api "userimage.css", "livetv.css", "nowplaying.css", - "icons.css", "materialize.css" }; @@ -678,7 +698,8 @@ namespace MediaBrowser.WebDashboard.Api } } - var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(css)); + var bytes = Encoding.UTF8.GetBytes(css); + memoryStream.Write(bytes, 0, bytes.Length); memoryStream.Position = 0; return memoryStream; |
