diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 51a1e7a91a..4811a026e2 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -40,6 +40,7 @@ "TitleLiveTV": "Live TV", "TitleSync": "Sync", "ButtonDonate": "Donate", + "LabelRecurringDonationCanBeCancelledHelp": "Recurring donations can be cancelled at any time from within your PayPal account.", "HeaderMyMedia": "My Media", "TitleNotifications": "Notifications", "ErrorLaunchingChromecast": "There was an error launching chromecast. Please ensure your device is connected to your wireless network.", diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index acea93d696..f2999ea027 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1262,7 +1262,6 @@ "HeaderDeveloperInfo": "Developer Info", "HeaderRevisionHistory": "Revision History", "ButtonViewWebsite": "View website", - "LabelRecurringDonationCanBeCancelledHelp": "Recurring donations can be cancelled at any time from within your PayPal account.", "HeaderXmlSettings": "Xml Settings", "HeaderXmlDocumentAttributes": "Xml Document Attributes", "HeaderXmlDocumentAttribute": "Xml Document Attribute", diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 5da1bee1fc..b98dd2930f 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.IO; +using System.Text.RegularExpressions; +using MediaBrowser.Common.IO; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Localization; using MediaBrowser.Model.Logging; @@ -288,17 +289,28 @@ namespace MediaBrowser.WebDashboard.Api private string ModifyForCordova(string html) { // Strip everything between CORDOVA_EXCLUDE_START and CORDOVA_EXCLUDE_END - html = ReplaceBetween(html, "CORDOVA_EXCLUDE_START", "CORDOVA_EXCLUDE_END", string.Empty); + html = ReplaceBetween(html, "", "", string.Empty); // Replace CORDOVA_REPLACE_SUPPORTER_SUBMIT_START - html = ReplaceBetween(html, "CORDOVA_REPLACE_SUPPORTER_SUBMIT_START", "CORDOVA_REPLACE_SUPPORTER_SUBMIT_END", "${ButtonDonate}"); + html = ReplaceBetween(html, "", "", "${ButtonDonate}"); return html; } private string ReplaceBetween(string html, string startToken, string endToken, string newHtml) { - return html; + var start = html.IndexOf(startToken, StringComparison.OrdinalIgnoreCase); + var end = html.IndexOf(endToken, StringComparison.OrdinalIgnoreCase); + + if (start == -1 || end == -1) + { + return html; + } + + string result = html.Substring(start + 1, end - start - 1); + html = html.Replace(result, newHtml); + + return ReplaceBetween(html, startToken, endToken, newHtml); } private string GetLocalizationToken(string phrase) @@ -600,7 +612,6 @@ namespace MediaBrowser.WebDashboard.Api "livetvstatus.js", "loginpage.js", - "logpage.js", "medialibrarypage.js", "metadataconfigurationpage.js", "metadataimagespage.js", @@ -626,15 +637,11 @@ namespace MediaBrowser.WebDashboard.Api "scheduledtaskspage.js", "search.js", "selectserver.js", - "streamingsettings.js", "supporterkeypage.js", - "supporterpage.js", "syncactivity.js", "syncsettings.js", "thememediaplayer.js", - "tvlatest.js", "useredit.js", - "usernew.js", "myprofile.js", "userpassword.js", "userprofilespage.js",