mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix plugin page refresh
This commit is contained in:
parent
37927a9a1a
commit
35f69d09ea
1 changed files with 9 additions and 5 deletions
|
@ -107,10 +107,12 @@ define([], function () {
|
||||||
return str.split(find).join(replace);
|
return str.split(find).join(replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseHtml(html) {
|
function parseHtml(html, hasScript) {
|
||||||
|
|
||||||
html = replaceAll(html, '<!--<script', '<script');
|
if (hasScript) {
|
||||||
html = replaceAll(html, '</script>-->', '</script>');
|
html = replaceAll(html, '<!--<script', '<script');
|
||||||
|
html = replaceAll(html, '</script>-->', '</script>');
|
||||||
|
}
|
||||||
|
|
||||||
var wrapper = document.createElement('div');
|
var wrapper = document.createElement('div');
|
||||||
wrapper.innerHTML = html;
|
wrapper.innerHTML = html;
|
||||||
|
@ -126,13 +128,15 @@ define([], function () {
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
var elem = parseHtml(options.view);
|
var hasScript = options.view.indexOf('<script') != -1;
|
||||||
|
|
||||||
|
var elem = parseHtml(options.view, hasScript);
|
||||||
elem.classList.add('page-view');
|
elem.classList.add('page-view');
|
||||||
elem.setAttribute('data-type', options.type || '');
|
elem.setAttribute('data-type', options.type || '');
|
||||||
elem.setAttribute('data-url', options.url);
|
elem.setAttribute('data-url', options.url);
|
||||||
return {
|
return {
|
||||||
elem: elem,
|
elem: elem,
|
||||||
hasScript: options.view.indexOf('<script') != -1
|
hasScript: hasScript
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue