diff options
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/DashboardService.cs | 26 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/PackageCreator.cs | 29 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 9 |
3 files changed, 29 insertions, 35 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 386a387f5..c6155b1b3 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -340,11 +340,9 @@ 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.Combine(path, "css")); - MinifyJsDirectory(Path.Combine(path, "scripts")); - MinifyJsDirectory(Path.Combine(path, "apiclient")); - MinifyJsDirectory(Path.Combine(path, "voice")); + + MinifyCssDirectory(path); + MinifyJsDirectory(path); await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion); await DumpJs(creator.DashboardUIPath, path, mode, culture, appVersion); @@ -358,6 +356,15 @@ namespace MediaBrowser.WebDashboard.Api { foreach (var file in Directory.GetFiles(path, "*.css", SearchOption.AllDirectories)) { + if (file.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) != -1) + { + continue; + } + if (file.IndexOf("bower_", StringComparison.OrdinalIgnoreCase) != -1) + { + continue; + } + try { var text = _fileSystem.ReadAllText(file, Encoding.UTF8); @@ -385,6 +392,15 @@ namespace MediaBrowser.WebDashboard.Api { foreach (var file in Directory.GetFiles(path, "*.js", SearchOption.AllDirectories)) { + if (file.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) != -1) + { + continue; + } + if (file.IndexOf("bower_", StringComparison.OrdinalIgnoreCase) != -1) + { + continue; + } + try { var text = _fileSystem.ReadAllText(file, Encoding.UTF8); diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index a01430840..56344d299 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -65,14 +65,14 @@ namespace MediaBrowser.WebDashboard.Api } else if (IsFormat(path, "js")) { - if (path.IndexOf("thirdparty", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1) + if (path.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1) { resourceStream = await ModifyJs(resourceStream, enableMinification).ConfigureAwait(false); } } else if (IsFormat(path, "css")) { - if (path.IndexOf("thirdparty", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1) + if (path.IndexOf(".min.", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1) { resourceStream = await ModifyCss(resourceStream, enableMinification).ConfigureAwait(false); } @@ -462,31 +462,6 @@ namespace MediaBrowser.WebDashboard.Api } /// <summary> - /// Appends the resource. - /// </summary> - /// <param name="outputStream">The output stream.</param> - /// <param name="path">The path.</param> - /// <param name="newLineBytes">The new line bytes.</param> - /// <returns>Task.</returns> - private async Task AppendResource(Stream outputStream, string path, byte[] newLineBytes) - { - path = GetDashboardResourcePath(path); - - using (var fs = _fileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true)) - { - using (var streamReader = new StreamReader(fs)) - { - var text = await streamReader.ReadToEndAsync().ConfigureAwait(false); - var bytes = Encoding.UTF8.GetBytes(text); - await outputStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false); - } - } - - await outputStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false); - } - - - /// <summary> /// Gets all CSS. /// </summary> /// <returns>Task{Stream}.</returns> diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index b5879836f..aa74e5966 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -245,6 +245,9 @@ <Content Include="dashboard-ui\components\prompt.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\components\requirecss.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\components\tvguide\tvguide.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -528,6 +531,9 @@ <Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jqm.checkbox.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jqm.widget.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\thirdparty\jquerymobile-1.4.5\jquery.mobile.custom.icons.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -1249,9 +1255,6 @@ <Content Include="dashboard-ui\apiclient\store.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\thirdparty\cast_sender.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="dashboard-ui\thirdparty\jquery.unveil-custom.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
|
