mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
parent
470dcea5b3
commit
7a337edcad
22 changed files with 378 additions and 363 deletions
|
@ -18,81 +18,61 @@
|
|||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Dialog selection to add song to an existing/new playlist */
|
||||
/************************************************************/
|
||||
|
||||
function showPlaylistDialog(item_type, item_id) {
|
||||
/*var parent = this;
|
||||
parent.songId = song_id;
|
||||
|
||||
parent.dialog_buttons = {};
|
||||
this.dialog_buttons[jsSaveTitle] = function() {
|
||||
$.ajax({
|
||||
url : parent.saveUrl,
|
||||
type : 'POST',
|
||||
data : $(parent.editFormId).serializeArray(),
|
||||
success : function(resp){
|
||||
var new_id = $.trim(resp.lastChild.textContent);
|
||||
$("#editdialog").dialog("close");
|
||||
|
||||
// resp should contain the new identifier, otherwise we take the same as the edited item
|
||||
if (new_id == '') {
|
||||
new_id = parent.editId;
|
||||
}
|
||||
|
||||
var url = jsAjaxServer + '/refresh_updated.server.php?action=' + parent.refreshAction + '&id=' + new_id;
|
||||
// Reload only table
|
||||
$('#' + parent.refreshRowPrefix + parent.editId).load(url, function() {
|
||||
// Update the current row identifier with new id
|
||||
$('#' + parent.refreshRowPrefix + parent.editId).attr("id", parent.refreshRowPrefix + new_id);
|
||||
});
|
||||
},
|
||||
error : function(resp){
|
||||
$("#editdialog").dialog("close");
|
||||
}
|
||||
});
|
||||
}
|
||||
this.dialog_buttons[jsCancelTitle] = function() {
|
||||
$("#editdialog").dialog("close");
|
||||
}
|
||||
|
||||
var closeplaylist;
|
||||
function showPlaylistDialog(e, item_type, item_id) {
|
||||
closePlaylistDialog();
|
||||
|
||||
var parent = this;
|
||||
parent.itemType = item_type;
|
||||
parent.itemId = item_id;
|
||||
parent.contentUrl = jsAjaxServer + '/show_edit_playlist.server.php?action=show_edit_object&item_type=' + item_type + '&item_id=' + item_id;
|
||||
parent.editDialogId = '<div id="playlistdialog"></div>';
|
||||
|
||||
$(parent.editDialogId).dialog({
|
||||
title: edit_title,
|
||||
modal: true,
|
||||
dialogClass: 'editdialogstyle',
|
||||
modal: false,
|
||||
dialogClass: 'playlistdialogstyle',
|
||||
resizable: false,
|
||||
width: 600,
|
||||
draggable: false,
|
||||
width: 300,
|
||||
height: 100,
|
||||
autoOpen: false,
|
||||
open: function () {
|
||||
closeplaylist = 1;
|
||||
$(document).bind('click', overlayclickclose);
|
||||
$(this).load(parent.contentUrl, function() {
|
||||
$(this).dialog('option', 'position', 'center');
|
||||
|
||||
if ($('#edit_tags').length > 0) {
|
||||
$("#edit_tags").tagit({
|
||||
allowSpaces: true,
|
||||
singleField: true,
|
||||
singleFieldDelimiter: ',',
|
||||
availableTags: parent.editTagChoices
|
||||
});
|
||||
}
|
||||
$('#playlistdialog').focus();
|
||||
});
|
||||
},
|
||||
focus: function() {
|
||||
closeplaylist = 0;
|
||||
},
|
||||
close: function (e) {
|
||||
$(document).unbind('click');
|
||||
$(this).empty();
|
||||
$(this).dialog("destroy");
|
||||
},
|
||||
buttons: dialog_buttons
|
||||
}
|
||||
});
|
||||
|
||||
$("#editdialog").dialog("open");*/
|
||||
$("#playlistdialog").dialog("option", "position", [e.clientX + 10, e.clientY]);
|
||||
$("#playlistdialog").dialog("open");
|
||||
closeplaylist = 0;
|
||||
}
|
||||
|
||||
function overlayclickclose() {
|
||||
if (closeplaylist) {
|
||||
$('#playlistdialog').dialog('close');
|
||||
}
|
||||
closeplaylist = 1;
|
||||
}
|
||||
|
||||
function closePlaylistDialog() {
|
||||
$("#playlistdialog").dialog("close");
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
$(window).resize(function() {
|
||||
$("#editdialog").dialog("option", "position", ['center', 'center']);
|
||||
});
|
||||
*/
|
||||
|
||||
/***************************************************/
|
||||
/* Edit modal dialog for artists, albums and songs */
|
||||
|
@ -156,6 +136,7 @@ function showEditDialog(edit_type, edit_id, edit_form_id, edit_title, edit_tag_c
|
|||
resizable: false,
|
||||
width: 600,
|
||||
autoOpen: false,
|
||||
show: { effect: "fade", duration: 400 },
|
||||
open: function () {
|
||||
$(this).load(parent.contentUrl, function() {
|
||||
$(this).dialog('option', 'position', 'center');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue