diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 030dc7f33..2fc77dff4 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -197,13 +197,15 @@ namespace MediaBrowser.WebDashboard.Api
{
var path = request.ResourceName;
+ path = path.Replace("bower_components" + _appHost.ApplicationVersion, "bower_components", StringComparison.OrdinalIgnoreCase);
+
var contentType = MimeTypes.GetMimeType(path);
// Bounce them to the startup wizard if it hasn't been completed yet
if (!_serverConfigurationManager.Configuration.IsStartupWizardCompleted && path.IndexOf("wizard", StringComparison.OrdinalIgnoreCase) == -1 && GetPackageCreator().IsCoreHtml(path))
{
// But don't redirect if an html import is being requested.
- if (path.IndexOf("vulcanize", StringComparison.OrdinalIgnoreCase) == -1 && path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
+ if (path.IndexOf("bower_components", StringComparison.OrdinalIgnoreCase) == -1)
{
Request.Response.Redirect("wizardstart.html");
return null;
@@ -263,22 +265,6 @@ namespace MediaBrowser.WebDashboard.Api
return new PackageCreator(_fileSystem, _localization, Logger, _serverConfigurationManager, _jsonSerializer);
}
- ///
- /// Determines whether the specified path is HTML.
- ///
- /// The path.
- /// true if the specified path is HTML; otherwise, false .
- private bool IsHtml(string path)
- {
- return Path.GetExtension(path).EndsWith("html", StringComparison.OrdinalIgnoreCase);
- }
-
- private void CopyFile(string src, string dst)
- {
- _fileSystem.CreateDirectory(Path.GetDirectoryName(dst));
- _fileSystem.CopyFile(src, dst, true);
- }
-
public async Task Get(GetDashboardPackage request)
{
var path = Path.Combine(_serverConfigurationManager.ApplicationPaths.ProgramDataPath,
@@ -305,60 +291,143 @@ 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"));
-
- _fileSystem.DeleteDirectory(Path.Combine(path, "bower_components"), true);
- _fileSystem.DeleteDirectory(Path.Combine(path, "thirdparty", "viblast"), true);
-
- // But we do need this
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "webcomponentsjs", "webcomponents-lite.js"), Path.Combine(path, "bower_components", "webcomponentsjs", "webcomponents-lite.js"));
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "webcomponentsjs", "webcomponents-lite.min.js"), Path.Combine(path, "bower_components", "webcomponentsjs", "webcomponents-lite.min.js"));
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "velocity", "velocity.min.js"), Path.Combine(path, "bower_components", "velocity", "velocity.min.js"));
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "requirejs", "require.js"), Path.Combine(path, "bower_components", "requirejs", "require.js"));
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "fastclick", "lib", "fastclick.js"), Path.Combine(path, "bower_components", "fastclick", "lib", "fastclick.js"));
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "jquery", "dist", "jquery.min.js"), Path.Combine(path, "bower_components", "jquery", "dist", "jquery.min.js"));
-
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "jstree", "dist", "jstree.min.js"), Path.Combine(path, "bower_components", "jstree", "dist", "jstree.min.js"));
-
- CopyDirectory(Path.Combine(creator.DashboardUIPath, "bower_components", "swipebox", "src", "css"), Path.Combine(path, "bower_components", "swipebox", "src", "css"));
- CopyDirectory(Path.Combine(creator.DashboardUIPath, "bower_components", "swipebox", "src", "js"), Path.Combine(path, "bower_components", "swipebox", "src", "js"));
- CopyDirectory(Path.Combine(creator.DashboardUIPath, "bower_components", "swipebox", "src", "img"), Path.Combine(path, "bower_components", "swipebox", "src", "img"));
-
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "hammerjs", "hammer.min.js"), Path.Combine(path, "bower_components", "hammerjs", "hammer.min.js"));
-
- CopyFile(Path.Combine(creator.DashboardUIPath, "bower_components", "Sortable", "Sortable.min.js"), Path.Combine(path, "bower_components", "Sortable", "Sortable.min.js"));
+ _fileSystem.DeleteFile(Path.Combine(path, "scripts", "registrationservices.js"));
+ }
+
+ // Try to trim the output size a bit
+ var bowerPath = Path.Combine(path, "bower_components");
+
+ if (!string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
+ {
+ var versionedBowerPath = Path.Combine(Path.GetDirectoryName(bowerPath), "bower_components" + _appHost.ApplicationVersion);
+ Directory.Move(bowerPath, versionedBowerPath);
+ bowerPath = versionedBowerPath;
+ }
+
+ DeleteFilesByExtension(bowerPath, ".log");
+ DeleteFilesByExtension(bowerPath, ".txt");
+ DeleteFilesByExtension(bowerPath, ".map");
+ DeleteFilesByExtension(bowerPath, ".md");
+ DeleteFilesByExtension(bowerPath, ".json");
+ DeleteFilesByExtension(bowerPath, ".gz");
+ DeleteFilesByExtension(bowerPath, ".bat");
+ DeleteFilesByName(bowerPath, "copying", true);
+ DeleteFilesByName(bowerPath, "license", true);
+ DeleteFilesByName(bowerPath, "license-mit", true);
+ DeleteFilesByName(bowerPath, "gitignore");
+ DeleteFilesByName(bowerPath, "npmignore");
+ DeleteFilesByName(bowerPath, "jshintrc");
+ DeleteFilesByName(bowerPath, "gruntfile");
+ DeleteFilesByName(bowerPath, "bowerrc");
+ DeleteFilesByName(bowerPath, "jscsrc");
+ DeleteFilesByName(bowerPath, "hero.svg");
+ DeleteFilesByName(bowerPath, "travis.yml");
+ DeleteFilesByName(bowerPath, "build.js");
+ DeleteFilesByName(bowerPath, "editorconfig");
+ DeleteFilesByName(bowerPath, "gitattributes");
+ DeleteFoldersByName(bowerPath, "demo");
+ DeleteFoldersByName(bowerPath, "test");
+ DeleteFoldersByName(bowerPath, "guides");
+ DeleteFoldersByName(bowerPath, "grunt");
+ DeleteFoldersByName(bowerPath, "rollups");
+
+ DeleteCryptoFiles(Path.Combine(bowerPath, "cryptojslib", "components"));
+
+ DeleteFoldersByName(Path.Combine(bowerPath, "jquery"), "src");
+ DeleteFoldersByName(Path.Combine(bowerPath, "jstree"), "src");
+ DeleteFoldersByName(Path.Combine(bowerPath, "Sortable"), "meteor");
+ DeleteFoldersByName(Path.Combine(bowerPath, "Sortable"), "st");
+ DeleteFoldersByName(Path.Combine(bowerPath, "swipebox"), "lib");
+ DeleteFoldersByName(Path.Combine(bowerPath, "swipebox"), "scss");
+
+ if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
+ {
+ // 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.DeleteFile(Path.Combine(path, "thirdparty", "jquerymobile-1.4.5", "jquery.mobile-1.4.5.min.map"));
+ }
+ else
+ {
+ MinifyCssDirectory(path);
+ MinifyJsDirectory(path);
}
-
- MinifyCssDirectory(Path.Combine(path, "css"));
- MinifyJsDirectory(Path.Combine(path, "scripts"));
- MinifyJsDirectory(Path.Combine(path, "apiclient"));
- MinifyJsDirectory(Path.Combine(path, "voice"));
await DumpHtml(creator.DashboardUIPath, path, mode, culture, appVersion);
- await DumpJs(creator.DashboardUIPath, path, mode, culture, appVersion);
- await DumpFile("scripts/all.js", Path.Combine(path, "scripts", "all.js"), mode, culture, appVersion).ConfigureAwait(false);
await DumpFile("css/all.css", Path.Combine(path, "css", "all.css"), mode, culture, appVersion).ConfigureAwait(false);
return "";
}
+ private void DeleteCryptoFiles(string path)
+ {
+ var files = _fileSystem.GetFiles(path)
+ .ToList();
+
+ var keepFiles = new[] { "core-min.js", "md5-min.js", "sha1-min.js" };
+
+ foreach (var file in files)
+ {
+ if (!keepFiles.Contains(file.Name, StringComparer.OrdinalIgnoreCase))
+ {
+ _fileSystem.DeleteFile(file.FullName);
+ }
+ }
+ }
+
+ private void DeleteFilesByExtension(string path, string extension)
+ {
+ var files = _fileSystem.GetFiles(path, true)
+ .Where(i => string.Equals(i.Extension, extension, StringComparison.OrdinalIgnoreCase))
+ .ToList();
+
+ foreach (var file in files)
+ {
+ _fileSystem.DeleteFile(file.FullName);
+ }
+ }
+
+ private void DeleteFilesByName(string path, string name, bool exact = false)
+ {
+ var files = _fileSystem.GetFiles(path, true)
+ .Where(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase) || (!exact && i.Name.IndexOf(name, StringComparison.OrdinalIgnoreCase) != -1))
+ .ToList();
+
+ foreach (var file in files)
+ {
+ _fileSystem.DeleteFile(file.FullName);
+ }
+ }
+
+ private void DeleteFoldersByName(string path, string name)
+ {
+ var directories = _fileSystem.GetDirectories(path, true)
+ .Where(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase))
+ .ToList();
+
+ foreach (var directory in directories)
+ {
+ _fileSystem.DeleteDirectory(directory.FullName, true);
+ }
+ }
+
private void MinifyCssDirectory(string path)
{
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);
+ var text = _fileSystem.ReadAllText(file, Encoding.UTF8);
var result = new KristensenCssMinifier().Minify(text, false, Encoding.UTF8);
@@ -369,7 +438,7 @@ namespace MediaBrowser.WebDashboard.Api
else
{
text = result.MinifiedContent;
- _fileSystem.WriteAllText(file, text, Encoding.UTF8);
+ _fileSystem.WriteAllText(file, text, Encoding.UTF8);
}
}
catch (Exception ex)
@@ -383,9 +452,18 @@ 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);
+ var text = _fileSystem.ReadAllText(file, Encoding.UTF8);
var result = new CrockfordJsMinifier().Minify(text, false, Encoding.UTF8);
@@ -396,7 +474,7 @@ namespace MediaBrowser.WebDashboard.Api
else
{
text = result.MinifiedContent;
- _fileSystem.WriteAllText(file, text, Encoding.UTF8);
+ _fileSystem.WriteAllText(file, text, Encoding.UTF8);
}
}
catch (Exception ex)
@@ -408,7 +486,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);
@@ -424,17 +502,7 @@ namespace MediaBrowser.WebDashboard.Api
foreach (var file in excludeFiles)
{
- _fileSystem.DeleteFile(Path.Combine(destination, file));
- }
- }
-
- 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);
+ _fileSystem.DeleteFile(Path.Combine(destination, file));
}
}
@@ -451,17 +519,17 @@ namespace MediaBrowser.WebDashboard.Api
private void CopyDirectory(string source, string destination)
{
- _fileSystem.CreateDirectory(destination);
+ _fileSystem.CreateDirectory(destination);
//Now Create all of the directories
foreach (string dirPath in Directory.GetDirectories(source, "*",
SearchOption.AllDirectories))
- _fileSystem.CreateDirectory(dirPath.Replace(source, destination));
+ _fileSystem.CreateDirectory(dirPath.Replace(source, destination));
//Copy all the files & Replaces any files with the same name
foreach (string newPath in Directory.GetFiles(source, "*.*",
SearchOption.AllDirectories))
- _fileSystem.CopyFile(newPath, newPath.Replace(source, destination), true);
+ _fileSystem.CopyFile(newPath, newPath.Replace(source, destination), true);
}
}
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
index 3108c2b9a..4bb2f583e 100644
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
@@ -42,12 +42,7 @@ namespace MediaBrowser.WebDashboard.Api
{
Stream resourceStream;
- if (path.Equals("scripts/all.js", StringComparison.OrdinalIgnoreCase))
- {
- resourceStream = await GetAllJavascript(mode, localizationCulture, appVersion, enableMinification).ConfigureAwait(false);
- enableMinification = false;
- }
- else if (path.Equals("css/all.css", StringComparison.OrdinalIgnoreCase))
+ if (path.Equals("css/all.css", StringComparison.OrdinalIgnoreCase))
{
resourceStream = await GetAllCss(enableMinification).ConfigureAwait(false);
enableMinification = false;
@@ -70,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);
}
@@ -226,11 +221,6 @@ namespace MediaBrowser.WebDashboard.Api
public bool IsCoreHtml(string path)
{
- if (path.IndexOf("vulcanize", StringComparison.OrdinalIgnoreCase) != -1)
- {
- return false;
- }
-
if (path.IndexOf(".template.html", StringComparison.OrdinalIgnoreCase) != -1)
{
return false;
@@ -309,21 +299,9 @@ namespace MediaBrowser.WebDashboard.Api
.Replace("
", "-->");
}
- var versionString = !string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase) ? "?v=" + appVersion : string.Empty;
-
- var imports = new[]
- {
- "vulcanize-out.html" + versionString
- };
- var importsHtml = string.Join("", imports.Select(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("
", "
" + GetMetaTags(mode) + GetCommonCss(mode, appVersion));
- html = html.Replace("", GetInitialJavascript(mode, appVersion) + importsHtml + GetCommonJavascript(mode, appVersion) + "");
+ html = html.Replace("", GetCommonJavascript(mode, appVersion) + "");
var bytes = Encoding.UTF8.GetBytes(html);
@@ -333,9 +311,6 @@ namespace MediaBrowser.WebDashboard.Api
private string ModifyForCordova(string html)
{
- // Strip everything between CORDOVA_EXCLUDE_START and CORDOVA_EXCLUDE_END
- html = ReplaceBetween(html, "", "", string.Empty);
-
// Replace CORDOVA_REPLACE_SUPPORTER_SUBMIT_START
html = ReplaceBetween(html, "", "", "${ButtonPurchase} ");
@@ -379,9 +354,10 @@ namespace MediaBrowser.WebDashboard.Api
if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
{
- //sb.Append(" ");
+ sb.Append(" ");
}
+ sb.Append(" ");
sb.Append(" ");
sb.Append(" ");
sb.Append(" ");
@@ -428,35 +404,11 @@ namespace MediaBrowser.WebDashboard.Api
"css/all.css" + versionString
};
- var tags = files.Select(s => string.Format(" ", s)).ToArray();
+ var tags = files.Select(s => string.Format(" ", s)).ToArray();
return string.Join(string.Empty, tags);
}
- ///
- /// Gets the common javascript.
- ///
- /// The mode.
- /// The version.
- /// System.String.
- private string GetInitialJavascript(string mode, string version)
- {
- var builder = new StringBuilder();
-
- var versionString = !string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase) ? "?v=" + version : string.Empty;
-
- var files = new List
- {
- "bower_components/webcomponentsjs/webcomponents-lite.js" + versionString
- };
-
- var tags = files.Select(s => string.Format("", s)).ToArray();
-
- builder.Append(string.Join(string.Empty, tags));
-
- return builder.ToString();
- }
-
///
/// Gets the common javascript.
///
@@ -467,11 +419,25 @@ namespace MediaBrowser.WebDashboard.Api
{
var builder = new StringBuilder();
+ builder.Append("");
+
var versionString = !string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase) ? "?v=" + version : string.Empty;
var files = new List
{
- "scripts/all.js" + versionString
+ "bower_components/requirejs/require.js" + versionString,
+ "scripts/site.js" + versionString
};
if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
@@ -479,168 +445,21 @@ namespace MediaBrowser.WebDashboard.Api
files.Insert(0, "cordova.js");
}
- var tags = files.Select(s => string.Format("", s)).ToArray();
+ var tags = files.Select(s =>
+ {
+ if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1)
+ {
+ return string.Format("", s);
+ }
+ return string.Format("", s);
+
+ }).ToArray();
builder.Append(string.Join(string.Empty, tags));
return builder.ToString();
}
- ///
- /// Gets a stream containing all concatenated javascript
- ///
- /// Task{Stream}.
- private async Task GetAllJavascript(string mode, string culture, string version, bool enableMinification)
- {
- var memoryStream = new MemoryStream();
- var newLineBytes = Encoding.UTF8.GetBytes(Environment.NewLine);
-
- await AppendResource(memoryStream, "bower_components/jquery/dist/jquery.min.js", newLineBytes).ConfigureAwait(false);
-
- //await AppendLocalization(memoryStream, culture, excludePhrases).ConfigureAwait(false);
- await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
-
- if (!string.IsNullOrWhiteSpace(mode))
- {
- var appModeBytes = Encoding.UTF8.GetBytes(string.Format("window.appMode='{0}';", mode));
- await memoryStream.WriteAsync(appModeBytes, 0, appModeBytes.Length).ConfigureAwait(false);
- }
-
- // Write the version string for the dashboard comparison function
- var versionString = string.Format("window.dashboardVersion='{0}';", version);
- var versionBytes = Encoding.UTF8.GetBytes(versionString);
-
- await memoryStream.WriteAsync(versionBytes, 0, versionBytes.Length).ConfigureAwait(false);
- await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
-
- var builder = new StringBuilder();
-
- var commonFiles = new[]
- {
- "bower_components/requirejs/require.js",
- "thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.js",
- "thirdparty/browser.js",
- "thirdparty/jquery.unveil-custom.js",
- "apiclient/logger.js",
- "apiclient/md5.js",
- "apiclient/store.js",
- "apiclient/device.js",
- "apiclient/credentials.js",
- "apiclient/ajax.js",
- "apiclient/events.js",
- "apiclient/deferred.js",
- "apiclient/apiclient.js"
- }.ToList();
-
- commonFiles.Add("apiclient/connectionmanager.js");
-
- foreach (var file in commonFiles)
- {
- using (var fs = _fileSystem.GetFileStream(GetDashboardResourcePath(file), FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true))
- {
- using (var streamReader = new StreamReader(fs))
- {
- var text = await streamReader.ReadToEndAsync().ConfigureAwait(false);
- builder.Append(text);
- builder.Append(Environment.NewLine);
- }
- }
- }
-
- foreach (var file in GetScriptFiles())
- {
- var path = GetDashboardResourcePath("scripts/" + file);
-
- 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);
- builder.Append(text);
- builder.Append(Environment.NewLine);
- }
- }
- }
-
- var js = builder.ToString();
-
- if (enableMinification)
- {
- try
- {
- var result = new CrockfordJsMinifier().Minify(js, false, Encoding.UTF8);
-
- if (result.Errors.Count > 0)
- {
- _logger.Error("Error minifying javascript: " + result.Errors[0].Message);
- }
- else
- {
- js = result.MinifiedContent;
- }
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error minifying javascript", ex);
- }
- }
-
- var bytes = Encoding.UTF8.GetBytes(js);
- await memoryStream.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
-
- memoryStream.Position = 0;
- return memoryStream;
- }
- private IEnumerable GetScriptFiles()
- {
- return new[]
- {
- "extensions.js",
- "globalize.js",
- "site.js",
- "librarybrowser.js",
- "librarylist.js",
- "librarymenu.js",
- "mediacontroller.js",
- "backdrops.js",
- "sync.js",
- "playlistmanager.js",
- "appsettings.js",
- "mediaplayer.js",
- "mediaplayer-video.js",
- "alphapicker.js",
- "notifications.js",
- "remotecontrol.js",
- "search.js",
- "thememediaplayer.js"
- };
- }
-
- ///
- /// Appends the resource.
- ///
- /// The output stream.
- /// The path.
- /// The new line bytes.
- /// Task.
- 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);
- }
-
-
///
/// Gets all CSS.
///
@@ -652,20 +471,9 @@ namespace MediaBrowser.WebDashboard.Api
var files = new[]
{
"thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.theme.css",
- "thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.structure.css",
"css/site.css",
- "css/chromecast.css",
- "css/mediaplayer.css",
- "css/mediaplayer-video.css",
"css/librarymenu.css",
"css/librarybrowser.css",
- "css/card.css",
- "css/notifications.css",
- "css/search.css",
- "css/remotecontrol.css",
- "css/userimage.css",
- "css/nowplaying.css",
- "css/materialize.css",
"thirdparty/paper-button-style.css"
};
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 874729821..10d696ccc 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -44,7 +44,7 @@
v4.5
- Always
+ OnBuildSuccess
@@ -63,8 +63,9 @@
..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll
-
- ..\packages\WebMarkupMin.Core.1.0.0\lib\net40\WebMarkupMin.Core.dll
+
+ False
+ ..\packages\WebMarkupMin.Core.1.0.1\lib\net40\WebMarkupMin.Core.dll
@@ -91,6 +92,11 @@
MediaBrowser.Model
+
+
+ PreserveNewest
+
+
PreserveNewest
@@ -110,67 +116,7 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
-
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
+
PreserveNewest
@@ -179,6 +125,12 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
@@ -224,43 +176,18 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -276,9 +203,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -357,6 +281,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -381,7 +308,7 @@
PreserveNewest
-
+
PreserveNewest
@@ -390,6 +317,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -423,9 +353,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -438,36 +365,6 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -513,15 +410,15 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -539,21 +436,6 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -668,59 +550,12 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -847,9 +682,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -970,18 +802,12 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -1015,18 +841,12 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -1261,30 +1081,9 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -1894,9 +1693,6 @@
PreserveNewest
-
- PreserveNewest
-
PreserveNewest
@@ -1924,12 +1720,6 @@
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
@@ -2419,11 +2209,6 @@
-
-
-
-
-
PreserveNewest
@@ -2724,30 +2509,21 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
PreserveNewest
diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config
index 906f1f4e6..24a8a5316 100644
--- a/MediaBrowser.WebDashboard/packages.config
+++ b/MediaBrowser.WebDashboard/packages.config
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file