From 713fd410339fec5c175b872c035246a209fa0897 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 26 Feb 2020 18:46:06 -0500 Subject: [PATCH] update strings --- alert/alert.js | 2 +- deletehelper.js | 4 +- dialog/dialog.js | 4 + dialog/dialog.template.html | 11 +- dom.js | 55 +- filtermenu/filtermenu.template.html | 2 +- formdialog.css | 18 +- imagedownloader/imagedownloader.template.html | 2 +- imageeditor/imageeditor.template.html | 2 +- imageuploader/imageuploader.template.html | 2 +- itemcontextmenu.js | 4 +- itemidentifier/itemidentifier.template.html | 2 +- metadataeditor/metadataeditor.template.html | 2 +- metadataeditor/personeditor.template.html | 2 +- nowplayingbar/nowplayingbar.css | 2 +- playback/playbackmanager.js | 20 +- pluginmanager.js | 29 +- prompt/prompt.js | 2 +- prompt/prompt.template.html | 2 +- .../recordingcreator.template.html | 2 +- .../recordingeditor.template.html | 2 +- refreshdialog/refreshdialog.js | 2 +- registrationservices/registrationservices.js | 6 +- router.js | 2 +- strings/en-US.json | 6 +- subtitleeditor/subtitleeditor.css | 3 - subtitleeditor/subtitleeditor.js | 541 ------------------ subtitleeditor/subtitleeditor.template.html | 49 -- sync/sync.js | 2 +- sync/syncjobeditor.js | 2 +- viewsettings/viewsettings.template.html | 2 +- 31 files changed, 121 insertions(+), 665 deletions(-) delete mode 100644 subtitleeditor/subtitleeditor.css delete mode 100644 subtitleeditor/subtitleeditor.js delete mode 100644 subtitleeditor/subtitleeditor.template.html diff --git a/alert/alert.js b/alert/alert.js index ce434bac..42442ce2 100644 --- a/alert/alert.js +++ b/alert/alert.js @@ -16,7 +16,7 @@ define(['dialog', 'globalize'], function (dialog, globalize) { var items = []; items.push({ - name: globalize.translate('ButtonGotIt'), + name: options.confirmText || globalize.translate('ButtonGotIt'), id: 'ok', type: 'submit' }); diff --git a/deletehelper.js b/deletehelper.js index cb8b093b..38a8433f 100644 --- a/deletehelper.js +++ b/deletehelper.js @@ -39,7 +39,7 @@ define(['connectionManager', 'confirm', 'appRouter', 'globalize'], function (con }).then(function () { - return ApiClient.uninstallPlugin(item.Id).then(function () { + return apiClient.uninstallPlugin(item.Id).then(function () { return onItemDeleted(options); }); @@ -63,7 +63,7 @@ define(['connectionManager', 'confirm', 'appRouter', 'globalize'], function (con }).then(function () { - return ApiClient.deleteUser(item.Id).then(function () { + return apiClient.deleteUser(item.Id).then(function () { return onItemDeleted(options); }); diff --git a/dialog/dialog.js b/dialog/dialog.js index 4400840d..ad1bbe52 100644 --- a/dialog/dialog.js +++ b/dialog/dialog.js @@ -52,6 +52,10 @@ define(['dialogHelper', 'dom', 'layoutManager', 'globalize', 'require', 'materia dlg.querySelector('.text').innerHTML = options.html; + } else if (options.preFormattedText) { + + dlg.querySelector('.text').innerHTML = '
' + options.preFormattedText+'
'; + } else if (options.text) { dlg.querySelector('.text').innerText = replaceAll(options.text || '', '
', '\n'); diff --git a/dialog/dialog.template.html b/dialog/dialog.template.html index 6493aef0..b67f34f3 100644 --- a/dialog/dialog.template.html +++ b/dialog/dialog.template.html @@ -1,17 +1,14 @@ 
-

+

-
-
+
+
-
- -
-
+
\ No newline at end of file diff --git a/dom.js b/dom.js index 5ded0d11..8856ac18 100644 --- a/dom.js +++ b/dom.js @@ -184,6 +184,58 @@ define([], function () { return supportsCaptureOption; } + function removeAttributes(elem) { + var whitelist = []; + + var attributes = elem.attributes; + var i = attributes.length; + while (i--) { + var attr = attributes[i]; + if (whitelist.indexOf(attr.name) === -1) { + elem.removeAttributeNode(attr); + } + } + } + + function stripScriptsWithDom(s) { + var div = document.createElement('div'); + div.innerHTML = s; + var scripts = div.getElementsByTagName('script'); + var i = scripts.length; + while (i--) { + scripts[i].parentNode.removeChild(scripts[i]); + } + + var elems = div.getElementsByTagName("*"); + var length; + + for (i = 0, length = elems.length; i < length; i++) { + //Remove all onmouseover, onmouseout, onclick eventhandlers from element + var elem = elems[i]; + + removeAttributes(elem); + + if (elem.tagName === "A") { + + //if the href values of the link tags start with javascript: then set href="#"" + if (elem.href.indexOf('javascript') === 0) { + elem.setAttribute("href", "#"); + } + } + } + + return div.innerHTML; + } + + function stripScripts(s) { + + try { + return stripScriptsWithDom(s); + } + catch (err) { + return htmlEncode(s); + } + } return { parentWithAttribute: parentWithAttribute, @@ -196,6 +248,7 @@ define([], function () { whichAnimationEvent: whichAnimationEvent, whichAnimationCancelEvent: whichAnimationCancelEvent, htmlEncode: htmlEncode, - supportsEventListenerOnce: supportsEventListenerOnce + supportsEventListenerOnce: supportsEventListenerOnce, + stripScripts: stripScripts }; }); \ No newline at end of file diff --git a/filtermenu/filtermenu.template.html b/filtermenu/filtermenu.template.html index 2dfb2dcb..d5a9d59d 100644 --- a/filtermenu/filtermenu.template.html +++ b/filtermenu/filtermenu.template.html @@ -1,6 +1,6 @@
-
+
diff --git a/formdialog.css b/formdialog.css index b21916a0..a778fe22 100644 --- a/formdialog.css +++ b/formdialog.css @@ -2,6 +2,7 @@ display: flex; flex-direction: column; position: relative; + max-height: 100%; } .formDialogHeader { @@ -23,11 +24,8 @@ } .dialogContentInner { - padding: .5em 1em 14em 1em; -} - -.dialogContentInner-mini { - padding-bottom: 10em; + padding-top: 1em; + padding-bottom: 1em; } .dialog-content-centered { @@ -103,11 +101,6 @@ .formDialogFooterItem { max-width: 80%; } - - .dialogContentInner { - padding-left: 1.5em; - padding-right: 1.5em; - } } @media all and (min-width: 80em) { @@ -115,9 +108,4 @@ .formDialogFooterItem { max-width: 70%; } - - .dialogContentInner { - padding-left: 2em; - padding-right: 2em; - } } diff --git a/imagedownloader/imagedownloader.template.html b/imagedownloader/imagedownloader.template.html index 0d2e5a93..4682e413 100644 --- a/imagedownloader/imagedownloader.template.html +++ b/imagedownloader/imagedownloader.template.html @@ -7,7 +7,7 @@

-
+
diff --git a/imageeditor/imageeditor.template.html b/imageeditor/imageeditor.template.html index 1b1e7509..2fd54ccb 100644 --- a/imageeditor/imageeditor.template.html +++ b/imageeditor/imageeditor.template.html @@ -7,7 +7,7 @@

-
+
diff --git a/imageuploader/imageuploader.template.html b/imageuploader/imageuploader.template.html index be55bf2b..7c6540d8 100644 --- a/imageuploader/imageuploader.template.html +++ b/imageuploader/imageuploader.template.html @@ -7,7 +7,7 @@

- +

${HeaderAddUpdateImage}

diff --git a/itemcontextmenu.js b/itemcontextmenu.js index 74110002..ff35664f 100644 --- a/itemcontextmenu.js +++ b/itemcontextmenu.js @@ -718,7 +718,7 @@ define(['dom', 'userSettings', 'apphost', 'globalize', 'connectionManager', 'ite var refreshAfterChange = dom.parentWithClass(button, 'page').getAttribute('data-refreshlibrary') === 'true'; - return ApiClient.removeVirtualFolder(virtualFolder, refreshAfterChange); + return apiClient.removeVirtualFolder(virtualFolder, refreshAfterChange); }); }); } @@ -740,7 +740,7 @@ define(['dom', 'userSettings', 'apphost', 'globalize', 'connectionManager', 'ite var refreshAfterChange = dom.parentWithClass(button, 'page').getAttribute('data-refreshlibrary') === 'true'; - return ApiClient.renameVirtualFolder(virtualFolder, newName, refreshAfterChange); + return apiClient.renameVirtualFolder(virtualFolder, newName, refreshAfterChange); } }); diff --git a/itemidentifier/itemidentifier.template.html b/itemidentifier/itemidentifier.template.html index f72fbd74..bbbdcf1a 100644 --- a/itemidentifier/itemidentifier.template.html +++ b/itemidentifier/itemidentifier.template.html @@ -7,7 +7,7 @@

-
+

${HeaderIdentifyItemHelp}

diff --git a/metadataeditor/metadataeditor.template.html b/metadataeditor/metadataeditor.template.html index dac4a4ec..154e86df 100644 --- a/metadataeditor/metadataeditor.template.html +++ b/metadataeditor/metadataeditor.template.html @@ -16,7 +16,7 @@

- +
diff --git a/metadataeditor/personeditor.template.html b/metadataeditor/personeditor.template.html index a96a6d59..26ae3640 100644 --- a/metadataeditor/personeditor.template.html +++ b/metadataeditor/personeditor.template.html @@ -7,7 +7,7 @@

- +
diff --git a/nowplayingbar/nowplayingbar.css b/nowplayingbar/nowplayingbar.css index e9fe27c9..13c49e82 100644 --- a/nowplayingbar/nowplayingbar.css +++ b/nowplayingbar/nowplayingbar.css @@ -57,7 +57,7 @@ flex-grow: 1; font-size: 92%; margin-right: 2.4em; - margin-left: 1em; + margin-left: .25em; } .nowPlayingBarCenter { diff --git a/playback/playbackmanager.js b/playback/playbackmanager.js index df925986..64a1b05c 100644 --- a/playback/playbackmanager.js +++ b/playback/playbackmanager.js @@ -385,27 +385,9 @@ var maxValues = getAudioMaxValues(deviceProfile); - var streamUrls = []; - var enableRemoteMedia = apphost.supports('remoteaudio'); - for (var i = 0, length = items.length; i < length; i++) { - - var item = items[i]; - var streamUrl; - - if (item.MediaType === 'Audio') { - streamUrl = apiClient.getAudioStreamUrl(item, audioTranscodingProfile, audioDirectPlayContainers, maxValues.maxAudioBitrate || maxBitrate, maxValues.maxAudioSampleRate, maxValues.maxAudioBitDepth, startPosition, enableRemoteMedia); - } - - streamUrls.push(streamUrl || ''); - - if (i === 0) { - startPosition = 0; - } - } - - return Promise.resolve(streamUrls); + return apiClient.getAudioStreamUrls(items, audioTranscodingProfile, audioDirectPlayContainers, maxValues.maxAudioBitrate || maxBitrate, maxValues.maxAudioSampleRate, maxValues.maxAudioBitDepth, startPosition, enableRemoteMedia); } function setStreamUrlIntoAllMediaSources(mediaSources, streamUrl) { diff --git a/pluginmanager.js b/pluginmanager.js index 9e93f2a0..986d73f8 100644 --- a/pluginmanager.js +++ b/pluginmanager.js @@ -1,4 +1,4 @@ -define(['events'], function (events) { +define(['events', 'apphost', 'connectionManager'], function (events, appHost, connectionManager) { 'use strict'; // TODO: replace with each plugin version @@ -249,5 +249,32 @@ define(['events'], function (events) { return !disallowPlugins; }; + PluginManager.prototype.getConfigurationPageUrl = function (name) { + + if (appHost.supports('multiserver')) { + + return "configurationpageext?name=" + encodeURIComponent(name); + + } else { + + return "configurationpage?name=" + encodeURIComponent(name); + } + }; + + PluginManager.prototype.getConfigurationResourceUrl = function (name) { + + if (appHost.supports('multiserver')) { + + return connectionManager.currentApiClient().getUrl('web/ConfigurationPage', + { + name: name + }); + + } else { + + return this.getConfigurationPageUrl(name); + } + }; + return new PluginManager(); }); \ No newline at end of file diff --git a/prompt/prompt.js b/prompt/prompt.js index b2e755b7..7fabaad8 100644 --- a/prompt/prompt.js +++ b/prompt/prompt.js @@ -31,7 +31,7 @@ define(['dialogHelper', 'layoutManager', 'globalize', 'dom', 'require', 'materia if (layoutManager.tv) { } else { - dlg.querySelector('.dialogContentInner').classList.add('dialogContentInner-mini'); + dlg.querySelector('.dialogContentInner').style['padding-bottom'] = '10em'; dlg.classList.add('dialog-fullscreen-lowres'); } diff --git a/prompt/prompt.template.html b/prompt/prompt.template.html index 3c8f8492..458c8d4b 100644 --- a/prompt/prompt.template.html +++ b/prompt/prompt.template.html @@ -7,7 +7,7 @@

- +
diff --git a/recordingcreator/recordingcreator.template.html b/recordingcreator/recordingcreator.template.html index 63b9faaf..b38f17d6 100644 --- a/recordingcreator/recordingcreator.template.html +++ b/recordingcreator/recordingcreator.template.html @@ -5,7 +5,7 @@

- +
diff --git a/recordingcreator/recordingeditor.template.html b/recordingcreator/recordingeditor.template.html index bca3a844..83d94d5c 100644 --- a/recordingcreator/recordingeditor.template.html +++ b/recordingcreator/recordingeditor.template.html @@ -7,7 +7,7 @@

- +
diff --git a/refreshdialog/refreshdialog.js b/refreshdialog/refreshdialog.js index 98d746ce..06f16486 100644 --- a/refreshdialog/refreshdialog.js +++ b/refreshdialog/refreshdialog.js @@ -20,7 +20,7 @@ html += '
'; html += '
'; - html += ''; + html += ''; html += '
'; html += ' -
- -
-
- -
${RequireHashMatchHelp}
-
-
- -
${SearchForForcedSubtitlesOnlyHelp}
-
- - - - -
-
- ${NoSubtitleSearchResultsFound} -
-
-
-
-
\ No newline at end of file diff --git a/sync/sync.js b/sync/sync.js index d9f97305..389126aa 100644 --- a/sync/sync.js +++ b/sync/sync.js @@ -595,7 +595,7 @@ html += '
'; html += '
'; - html += '
'; + html += ''; html += '
'; diff --git a/sync/syncjobeditor.js b/sync/syncjobeditor.js index 0f581676..7712bb72 100644 --- a/sync/syncjobeditor.js +++ b/sync/syncjobeditor.js @@ -466,7 +466,7 @@ html += '
'; html += '
'; - html += ''; + html += ''; html += '
'; diff --git a/viewsettings/viewsettings.template.html b/viewsettings/viewsettings.template.html index 9a6e80e1..44fe2887 100644 --- a/viewsettings/viewsettings.template.html +++ b/viewsettings/viewsettings.template.html @@ -1,6 +1,6 @@
- +