Skip to content

Commit

Permalink
update strings
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Feb 26, 2020
1 parent 799f79d commit 713fd41
Show file tree
Hide file tree
Showing 31 changed files with 121 additions and 665 deletions.
2 changes: 1 addition & 1 deletion alert/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
Expand Down
4 changes: 2 additions & 2 deletions deletehelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand Down
4 changes: 4 additions & 0 deletions dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<pre style="text-align:left;font-size:inherit;white-space:pre-wrap;">' + options.preFormattedText+'</pre>';

} else if (options.text) {

dlg.querySelector('.text').innerText = replaceAll(options.text || '', '<br/>', '\n');
Expand Down
11 changes: 4 additions & 7 deletions dialog/dialog.template.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<div class="formDialogHeader formDialogHeader-clear justify-content-center">
<h1 class="formDialogHeaderTitle" style="margin-left:0;margin-top: .5em;padding: 0 1em;"></h1>
<h3 class="formDialogHeaderTitle" style="margin-left:0;margin-top: .5em;padding: 0 1em;"></h3>
</div>

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<div class="dialogContentInner dialog-content-centered" style="padding-top:1em;padding-bottom: 1em; text-align: center;">
<div class="scrollSlider dialogContentInner dialog-content-centered padded-left padded-right">
<div class="text">

<div class="text">

</div>
</div>
</div>
</div>

<div class="formDialogFooter formDialogFooter-clear formDialogFooter-flex" style="padding-bottom: 1.5em;">
<div class="formDialogFooter formDialogFooter-clear formDialogFooter-flex">
</div>
55 changes: 54 additions & 1 deletion dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -196,6 +248,7 @@ define([], function () {
whichAnimationEvent: whichAnimationEvent,
whichAnimationCancelEvent: whichAnimationCancelEvent,
htmlEncode: htmlEncode,
supportsEventListenerOnce: supportsEventListenerOnce
supportsEventListenerOnce: supportsEventListenerOnce,
stripScripts: stripScripts
};
});
2 changes: 1 addition & 1 deletion filtermenu/filtermenu.template.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="dialogContentInner dialog-content-centered" style="padding-top:2em;">
<form class="dialogContentInner dialog-content-centered padded-left padded-right" style="padding-top:2em;">


<div class="checkboxContainer simpleFilter viewSetting" data-settingname="IsFavorite">
Expand Down
18 changes: 3 additions & 15 deletions formdialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
display: flex;
flex-direction: column;
position: relative;
max-height: 100%;
}

.formDialogHeader {
Expand All @@ -23,11 +24,8 @@
}

.dialogContentInner {
padding: .5em 1em 14em 1em;
}

.dialogContentInner-mini {
padding-bottom: 10em;
padding-top: 1em;
padding-bottom: 1em;
}

.dialog-content-centered {
Expand Down Expand Up @@ -103,21 +101,11 @@
.formDialogFooterItem {
max-width: 80%;
}

.dialogContentInner {
padding-left: 1.5em;
padding-right: 1.5em;
}
}

@media all and (min-width: 80em) {

.formDialogFooterItem {
max-width: 70%;
}

.dialogContentInner {
padding-left: 2em;
padding-right: 2em;
}
}
2 changes: 1 addition & 1 deletion imagedownloader/imagedownloader.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<div class="dialogContentInner">
<div class="dialogContentInner padded-left padded-right">
<div class="flex align-items-center justify-content-center flex-wrap-wrap" style="margin: 2em 0;">

<div class="selectContainer">
Expand Down
2 changes: 1 addition & 1 deletion imageeditor/imageeditor.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<div class="dialogContentInner">
<div class="dialogContentInner padded-left padded-right">

<div id="imagesContainer" class="verticalSection">

Expand Down
2 changes: 1 addition & 1 deletion imageuploader/imageuploader.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="dialogContentInner uploadItemImageForm" style="max-width: 100%;">
<form class="dialogContentInner uploadItemImageForm padded-left padded-right" style="max-width: 100%;">

<div class="flex align-items-center" style="margin:1.5em 0;">
<h2 style="margin:0;">${HeaderAddUpdateImage}</h2>
Expand Down
4 changes: 2 additions & 2 deletions itemcontextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
Expand All @@ -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);
}
});

Expand Down
2 changes: 1 addition & 1 deletion itemidentifier/itemidentifier.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<div class="dialogContentInner dialog-content-centered">
<div class="dialogContentInner dialog-content-centered padded-left padded-right">
<form class="popupIdentifyForm" style="margin:auto;">

<p>${HeaderIdentifyItemHelp}</p>
Expand Down
2 changes: 1 addition & 1 deletion metadataeditor/metadataeditor.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="editItemMetadataForm editMetadataForm dialogContentInner dialog-content-centered" style="padding-top:2em;">
<form class="editItemMetadataForm editMetadataForm dialogContentInner dialog-content-centered padded-left padded-right" style="padding-top:2em;">
<div class="metadataFormFields">

<div style="padding: 0 0 10px;">
Expand Down
2 changes: 1 addition & 1 deletion metadataeditor/personeditor.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="popupEditPersonForm dialogContentInner dialog-content-centered" style="padding-top:2em;">
<form class="popupEditPersonForm dialogContentInner dialog-content-centered padded-left padded-right" style="padding-top:2em;">

<div class="inputContainer">
<input type="text" is="emby-input" class="txtPersonName" required="required" label="${LabelName}" />
Expand Down
2 changes: 1 addition & 1 deletion nowplayingbar/nowplayingbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
flex-grow: 1;
font-size: 92%;
margin-right: 2.4em;
margin-left: 1em;
margin-left: .25em;
}

.nowPlayingBarCenter {
Expand Down
20 changes: 1 addition & 19 deletions playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
29 changes: 28 additions & 1 deletion pluginmanager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['events'], function (events) {
define(['events', 'apphost', 'connectionManager'], function (events, appHost, connectionManager) {
'use strict';

// TODO: replace with each plugin version
Expand Down Expand Up @@ -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();
});
2 changes: 1 addition & 1 deletion prompt/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion prompt/prompt.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle"></h3>

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="dialogContentInner dialog-content-centered" style="padding-top:2em;">
<form class="dialogContentInner dialog-content-centered padded-left padded-right" style="padding-top:2em;">
<div class="inputContainer">
<input is="emby-input" type="text" id="txtInput" label="" required="required" />
<div class="fieldDescription"></div>
Expand Down
2 changes: 1 addition & 1 deletion recordingcreator/recordingcreator.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h3 class="formDialogHeaderTitle"></h3>

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="dialogContentInner dialog-content-centered">
<form class="dialogContentInner dialog-content-centered padded-left padded-right">
<div class="recordingDetailsContainer">
<div class="recordingDialog-imageContainer">

Expand Down
2 changes: 1 addition & 1 deletion recordingcreator/recordingeditor.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h3 class="formDialogHeaderTitle">

<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">
<div class="scrollSlider">
<form class="dialogContentInner dialog-content-centered">
<form class="dialogContentInner dialog-content-centered padded-left padded-right">
<br />
<div class="inputContainer">
<div class="flex align-items-center">
Expand Down
2 changes: 1 addition & 1 deletion refreshdialog/refreshdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

html += '<div is="emby-scroller" data-horizontal="false" data-centerfocus="card" class="formDialogContent">';
html += '<div class="scrollSlider">';
html += '<form class="dialogContentInner dialog-content-centered" style="padding-top:2em;">';
html += '<form class="dialogContentInner dialog-content-centered padded-left padded-right" style="padding-top:2em;">';

html += '<div class="fldSelectPlaylist selectContainer">';
html += '<select is="emby-select" id="selectMetadataRefreshMode" label="' + globalize.translate('LabelRefreshMode') + '">';
Expand Down
Loading

0 comments on commit 713fd41

Please sign in to comment.