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

merge from dev

This commit is contained in:
Luke Pulverenti 2015-12-14 10:43:03 -05:00
parent 1c8f02ce0f
commit 33b01d778c
911 changed files with 34157 additions and 57125 deletions

View file

@ -1,4 +1,4 @@
define([], function () {
define(['components/paperdialoghelper', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function (paperDialogHelper) {
var currentDeferred;
var hasChanges;
@ -10,14 +10,14 @@
var refreshAfterChange = currentOptions.refresh;
ApiClient.addMediaPath(virtualFolder.Name, path, refreshAfterChange).done(function () {
ApiClient.addMediaPath(virtualFolder.Name, path, refreshAfterChange).then(function () {
hasChanges = true;
refreshLibraryFromServer(page);
}).fail(function () {
}, function () {
Dashboard.showError(Globalize.translate('ErrorAddingMediaPathToVirtualFolder'));
Dashboard.alert(Globalize.translate('ErrorAddingMediaPathToVirtualFolder'));
});
}
@ -36,14 +36,14 @@
var refreshAfterChange = currentOptions.refresh;
ApiClient.removeMediaPath(virtualFolder.Name, location, refreshAfterChange).done(function () {
ApiClient.removeMediaPath(virtualFolder.Name, location, refreshAfterChange).then(function () {
hasChanges = true;
refreshLibraryFromServer($(button).parents('.editorContent')[0]);
}).fail(function () {
}, function () {
Dashboard.showError(Globalize.translate('DefaultErrorMessage'));
Dashboard.alert(Globalize.translate('DefaultErrorMessage'));
});
}
});
@ -70,7 +70,7 @@
function refreshLibraryFromServer(page) {
ApiClient.getVirtualFolders().done(function (result) {
ApiClient.getVirtualFolders().then(function (result) {
var library = result.filter(function (f) {
@ -140,53 +140,50 @@
currentDeferred = deferred;
hasChanges = false;
require(['components/paperdialoghelper'], function () {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/medialibraryeditor/medialibraryeditor.template.html', true);
HttpClient.send({
xhr.onload = function (e) {
type: 'GET',
url: 'components/medialibraryeditor/medialibraryeditor.template.html'
var template = this.response;
var dlg = paperDialogHelper.createDialog({
size: 'small',
theme: 'a',
}).done(function (template) {
var dlg = PaperDialogHelper.createDialog({
size: 'small',
theme: 'a',
// In (at least) chrome this is causing the text field to not be editable
modal: false
});
var html = '';
html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" mini class="btnCloseDialog"></paper-fab>';
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + options.library.Name + '</div>';
html += '</h2>';
html += '<div class="editorContent" style="max-width:800px;margin:auto;">';
html += Globalize.translateDocument(template);
html += '</div>';
dlg.innerHTML = html;
document.body.appendChild(dlg);
var editorContent = dlg.querySelector('.editorContent');
initEditor(editorContent, options);
$(dlg).on('iron-overlay-closed', onDialogClosed);
PaperDialogHelper.openWithHash(dlg, 'medialibraryeditor');
$('.btnCloseDialog', dlg).on('click', function () {
PaperDialogHelper.close(dlg);
});
refreshLibraryFromServer(editorContent);
// In (at least) chrome this is causing the text field to not be editable
modal: false
});
});
var html = '';
html += '<h2 class="dialogHeader">';
html += '<paper-fab icon="arrow-back" mini class="btnCloseDialog"></paper-fab>';
html += '<div style="display:inline-block;margin-left:.6em;vertical-align:middle;">' + options.library.Name + '</div>';
html += '</h2>';
html += '<div class="editorContent" style="max-width:800px;margin:auto;">';
html += Globalize.translateDocument(template);
html += '</div>';
dlg.innerHTML = html;
document.body.appendChild(dlg);
var editorContent = dlg.querySelector('.editorContent');
initEditor(editorContent, options);
$(dlg).on('iron-overlay-closed', onDialogClosed);
paperDialogHelper.open(dlg);
$('.btnCloseDialog', dlg).on('click', function () {
paperDialogHelper.close(dlg);
});
refreshLibraryFromServer(editorContent);
}
xhr.send();
return deferred.promise();
};