|
|
|
@ -258,7 +258,6 @@ namespace MediaBrowser.WebDashboard.Api
|
|
|
|
|
|
|
|
|
|
if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
html = ModifyForCordova(html);
|
|
|
|
|
}
|
|
|
|
|
else if (!string.IsNullOrWhiteSpace(path) && !string.Equals(path, "index.html", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
@ -339,41 +338,6 @@ namespace MediaBrowser.WebDashboard.Api
|
|
|
|
|
return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string ModifyForCordova(string html)
|
|
|
|
|
{
|
|
|
|
|
// Replace CORDOVA_REPLACE_SUPPORTER_SUBMIT_START
|
|
|
|
|
html = ReplaceBetween(html, "<!--CORDOVA_REPLACE_SUPPORTER_SUBMIT_START-->", "<!--CORDOVA_REPLACE_SUPPORTER_SUBMIT_END-->", "<i class=\"fa fa-check\"></i><span>${ButtonPurchase}</span>");
|
|
|
|
|
|
|
|
|
|
return html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string ReplaceBetween(string html, string startToken, string endToken, string newHtml)
|
|
|
|
|
{
|
|
|
|
|
var start = html.IndexOf(startToken, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
if (start == -1)
|
|
|
|
|
{
|
|
|
|
|
return html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var end = html.IndexOf(endToken, start, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
|
|
|
|
if (end == -1)
|
|
|
|
|
{
|
|
|
|
|
return html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string result = html.Substring(start, end - start);
|
|
|
|
|
html = html.Replace(result, newHtml);
|
|
|
|
|
|
|
|
|
|
return ReplaceBetween(html, startToken, endToken, newHtml);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string GetLocalizationToken(string phrase)
|
|
|
|
|
{
|
|
|
|
|
return "${" + phrase + "}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the meta tags.
|
|
|
|
|
/// </summary>
|
|
|
|
|