From ce9723240583a61c5e606b31ad6be654cb2a4a5c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 3 Dec 2015 22:59:48 -0500 Subject: [PATCH] update script loading --- .../Api/DashboardService.cs | 27 ++---- .../MediaBrowser.WebDashboard.csproj | 92 +------------------ 2 files changed, 9 insertions(+), 110 deletions(-) diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index c6155b1b33..b9176afc03 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -305,14 +305,8 @@ namespace MediaBrowser.WebDashboard.Api if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) { - // Overwrite certain files with cordova specific versions - var cordovaVersion = Path.Combine(path, "cordova", "registrationservices.js"); - _fileSystem.CopyFile(cordovaVersion, Path.Combine(path, "scripts", "registrationservices.js"), true); - _fileSystem.DeleteFile(cordovaVersion); - // Delete things that are unneeded in an attempt to keep the output as trim as possible _fileSystem.DeleteDirectory(Path.Combine(path, "css", "images", "tour"), true); - _fileSystem.DeleteDirectory(Path.Combine(path, "apiclient", "alt"), true); _fileSystem.DeleteFile(Path.Combine(path, "thirdparty", "jquerymobile-1.4.5", "jquery.mobile-1.4.5.min.map")); @@ -340,12 +334,13 @@ namespace MediaBrowser.WebDashboard.Api CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "headroom.js", "dist", "headroom.min.js"), Path.Combine(path, "bower_components", "headroom.js", "dist", "headroom.min.js")); CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "isMobile", "isMobile.min.js"), Path.Combine(path, "bower_components", "isMobile", "isMobile.min.js")); } - - MinifyCssDirectory(path); - MinifyJsDirectory(path); + else + { + MinifyCssDirectory(path); + MinifyJsDirectory(path); + } await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion); - await DumpJs(creator.DashboardUIPath, path, mode, culture, appVersion); await DumpFile("css/all.css", Path.Combine(path, "css", "all.css"), mode, culture, appVersion).ConfigureAwait(false); @@ -426,7 +421,7 @@ namespace MediaBrowser.WebDashboard.Api private async Task DumpHtml(string source, string destination, string mode, string culture, string appVersion) { - foreach (var file in Directory.GetFiles(source, "*.html", SearchOption.TopDirectoryOnly)) + foreach (var file in Directory.GetFiles(source, "*", SearchOption.TopDirectoryOnly)) { var filename = Path.GetFileName(file); @@ -446,16 +441,6 @@ namespace MediaBrowser.WebDashboard.Api } } - private async Task DumpJs(string source, string mode, string destination, string culture, string appVersion) - { - foreach (var file in Directory.GetFiles(source, "*.js", SearchOption.TopDirectoryOnly)) - { - var filename = Path.GetFileName(file); - - await DumpFile("scripts/" + filename, Path.Combine(destination, "scripts", filename), mode, culture, appVersion).ConfigureAwait(false); - } - } - private async Task DumpFile(string resourceVirtualPath, string destinationFilePath, string mode, string culture, string appVersion) { using (var stream = await GetPackageCreator().GetResource(resourceVirtualPath, mode, culture, appVersion, true).ConfigureAwait(false)) diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index e96bc45dd9..572482798f 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -248,38 +248,13 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - + PreserveNewest - + PreserveNewest - + PreserveNewest @@ -456,33 +431,6 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - PreserveNewest @@ -674,43 +622,9 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - PreserveNewest - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - PreserveNewest