aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-12-03 22:59:48 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-12-03 22:59:48 -0500
commitce9723240583a61c5e606b31ad6be654cb2a4a5c (patch)
tree3730650446d1b77b47eae0440d71a1583a1667ac
parent80230dcb5cc105fe28daeff35faf0939b24145ed (diff)
update script loading
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs27
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj92
2 files changed, 9 insertions, 110 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index c6155b1b3..b9176afc0 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 e96bc45dd..572482798 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -248,38 +248,13 @@
<Content Include="dashboard-ui\components\requirecss.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\components\tvguide\tvguide.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\components\tvguide\tvguide.template.html">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\android\localsync.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\android\logging.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\fileupload.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\ios\backgroundfetch.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\ios\tabbar.js" />
- <Content Include="dashboard-ui\cordova\ios\vlcplayer.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\localassetmanager.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\prompt.js">
+ <Content Include="dashboard-ui\components\requirehtml.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\cordova\searchmenu.js">
+ <Content Include="dashboard-ui\components\tvguide\tvguide.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\cordova\sharingwidget.js">
+ <Content Include="dashboard-ui\components\tvguide\tvguide.template.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\devices\ie\ie.css">
@@ -456,33 +431,6 @@
<Content Include="dashboard-ui\apiclient\wakeonlan.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\cordova\android\appstorage.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\android\mediasession.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\android\nativedirectorychooser.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\android\vlcplayer.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\back.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\actionsheet.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\ios\orientation.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\volume.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\wakeonlan.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="dashboard-ui\thirdparty\emby-icons.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -674,43 +622,9 @@
<Content Include="dashboard-ui\syncsettings.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\apiclient\alt\bean.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\apiclient\alt\events.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="dashboard-ui\apiclient\connectservice.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\cordova\android\androidcredentials.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\android\iap.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\chromecast.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\connectsdk.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\externalplayer.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\generaldevice.js" />
- <Content Include="dashboard-ui\cordova\iap.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\imagestore.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\registrationservices.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="dashboard-ui\cordova\serverdiscovery.js">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
<Content Include="dashboard-ui\apiclient\deferred.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>