1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update dialogs

This commit is contained in:
Luke Pulverenti 2016-03-06 13:09:20 -05:00
parent 0491ae9a7c
commit 325d331160
26 changed files with 104 additions and 162 deletions

View file

@ -1,4 +1,4 @@
define(['paperdialoghelper', 'paper-input', 'paper-button', 'jqmcollapsible', 'paper-checkbox'], function (paperDialogHelper) {
define(['paperdialoghelper', 'paper-input', 'paper-button', 'emby-collapsible', 'paper-checkbox'], function (paperDialogHelper) {
function renderLibrarySharingList(context, result) {
@ -110,8 +110,6 @@
dlg.innerHTML = html;
document.body.appendChild(dlg);
// needed for the collapsible
$(dlg.querySelector('form')).trigger('create');
paperDialogHelper.open(dlg);

View file

@ -15,14 +15,11 @@
<br />
<div data-role="collapsible">
<h2>${HeaderShareMediaFolders}</h2>
<div>
<div class="librarySharingList" style="margin-top:1em;">
<emby-collapsible title="${HeaderShareMediaFolders}">
<div class="librarySharingList">
</div>
</div>
</div>
</emby-collapsible>
<p class="fieldDescription" style="margin-top:.5em;">${MessageGuestSharingPermissionsHelp}</p>
<br />
<button type="submit" data-role="none" class="clearButton">

View file

@ -56,7 +56,7 @@
}
function renderRemoteImages(page, imagesResult, imageType, startIndex, limit) {
$('.availableImagesPaging', page).html(getPagingHtml(startIndex, limit, imagesResult.TotalRecordCount)).trigger('create');
$('.availableImagesPaging', page).html(getPagingHtml(startIndex, limit, imagesResult.TotalRecordCount));
var html = '';

View file

@ -87,7 +87,7 @@
html += getSearchResultHtml(result, i);
}
var elem = $('.identificationSearchResultList', page).html(html).trigger('create');
var elem = $('.identificationSearchResultList', page).html(html);
$('.searchImage', elem).on('click', function () {
@ -266,7 +266,7 @@
$('#txtLookupYear', page).val(item.ProductionYear);
}
$('.identifyProviderIds', page).html(html).trigger('create');
$('.identifyProviderIds', page).html(html);
page.querySelector('.dialogHeaderTitle').innerHTML = Globalize.translate('HeaderIdentify');
});

View file

@ -8,8 +8,11 @@
function onSubmit() {
if (paths.length == 0) {
Dashboard.alert({
message: Globalize.translate('PleaseAddAtLeastOneFolder')
require(['alert'], function (alert) {
alert({
text: Globalize.translate('PleaseAddAtLeastOneFolder'),
type: 'error'
});
});
return false;
}
@ -89,7 +92,7 @@
function onAddButtonClick() {
var page = $(this).parents('.editorContent')[0];
var page = $(this).parents('.popupEditor')[0];
require(['directorybrowser'], function (directoryBrowser) {
@ -165,13 +168,12 @@
return p.toLowerCase() != location.toLowerCase();
});
var page = $(this).parents('.editorContent')[0];
var page = $(this).parents('.popupEditor')[0];
renderPaths(page);
}
function onDialogClosed() {
$(this).remove();
Dashboard.hideLoadingMsg();
currentDeferred.resolveWith(null, [hasChanges]);
}
@ -198,43 +200,31 @@
size: 'small',
// In (at least) chrome this is causing the text field to not be editable
modal: false
modal: false,
removeOnClose: true
});
dlg.classList.add('ui-body-a');
dlg.classList.add('background-theme-a');
dlg.classList.add('popupEditor');
var html = '';
html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" mini class="btnCloseDialog" tabindex="-1"></paper-fab>';
var title = Globalize.translate('ButtonAddMediaLibrary');
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + title + '</div>';
html += '</h2>';
html += '<div class="editorContent" style="max-width:800px;margin:auto;">';
html += Globalize.translateDocument(template);
html += '</div>';
dlg.innerHTML = html;
dlg.innerHTML = Globalize.translateDocument(template);
document.body.appendChild(dlg);
var editorContent = dlg.querySelector('.editorContent');
initEditor(editorContent, options.collectionTypeOptions);
initEditor(dlg, options.collectionTypeOptions);
$(dlg).on('iron-overlay-closed', onDialogClosed);
dlg.addEventListener('iron-overlay-closed', onDialogClosed);
paperDialogHelper.open(dlg);
$('.btnCloseDialog', dlg).on('click', function () {
dlg.querySelector('.btnCancel').addEventListener('click', function () {
paperDialogHelper.close(dlg);
});
paths = [];
renderPaths(editorContent);
renderPaths(dlg);
}
xhr.send();

View file

@ -1,5 +1,11 @@
<form style="max-width:100%;">
<br />
<div class="dialogHeader">
<paper-icon-button icon="arrow-back" class="btnCancel" tabindex="-1"></paper-icon-button>
<div class="dialogHeaderTitle">
${ButtonAddMediaLibrary}
</div>
</div>
<form style="margin:auto;">
<div id="fldCollectionType">
<label for="selectCollectionType">${LabelContentType}</label>
<select id="selectCollectionType" data-mini="true" required="required"></select>

View file

@ -575,7 +575,7 @@
html += '</div>';
}
var elem = $('.externalIds', context).html(html).trigger('create');
var elem = $('.externalIds', context).html(html);
$('.txtExternalId', elem).on('change', onExternalIdChange).trigger('change');
}

View file

@ -157,7 +157,7 @@
html += '</div>';
}
var elem = $('.subtitleList', page).html(html).trigger('create');
var elem = $('.subtitleList', page).html(html);
$('.btnViewSubtitles', elem).on('click', function () {
@ -267,7 +267,7 @@
html += '</div>';
}
var elem = $('.subtitleResults', page).html(html).trigger('create');
var elem = $('.subtitleResults', page).html(html);
$('.btnViewSubtitle', elem).on('click', function () {