can now change name/description of a playlist.
This commit is contained in:
parent
0da5c340b3
commit
86d1aafed4
|
@ -80,6 +80,9 @@ class LibraryController extends Zend_Controller_Action
|
||||||
'title' => 'Close');
|
'title' => 'Close');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/metadata/format/json/id/#id#', 'callback' => 'window["createPlaylistMetaForm"]'),
|
||||||
|
'title' => 'Edit Metadata');
|
||||||
|
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
|
||||||
'title' => 'Delete');
|
'title' => 'Delete');
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1 @@
|
||||||
<?php
|
<?php echo $this->form; ?>
|
||||||
|
|
||||||
$this->form->setAction($this->url());
|
|
||||||
echo $this->form;
|
|
||||||
|
|
|
@ -328,47 +328,49 @@ function closeSPL() {
|
||||||
$.post(url, noOpenPL);
|
$.post(url, noOpenPL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createPlaylistMetaForm(json) {
|
||||||
|
var submit, form;
|
||||||
|
|
||||||
|
submit = $('<button id="new_playlist_submit">Submit</button>')
|
||||||
|
.button()
|
||||||
|
.click(function(){
|
||||||
|
var url, data;
|
||||||
|
|
||||||
|
url = '/Playlist/metadata/format/json';
|
||||||
|
data = $("#side_playlist form").serialize();
|
||||||
|
|
||||||
|
$.post(url, data, function(json){
|
||||||
|
if(json.form){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
openDiffSPL(json);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
form = $(json.form);
|
||||||
|
|
||||||
|
form.find("input, textarea")
|
||||||
|
.keydown(function(event){
|
||||||
|
//enter was pressed
|
||||||
|
if(event.keyCode === 13) {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#new_playlist_submit").click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$("#side_playlist")
|
||||||
|
.empty()
|
||||||
|
.append(form)
|
||||||
|
.append(submit);
|
||||||
|
}
|
||||||
|
|
||||||
function newSPL() {
|
function newSPL() {
|
||||||
var url;
|
var url;
|
||||||
|
|
||||||
url = '/Playlist/new/format/json';
|
url = '/Playlist/new/format/json';
|
||||||
|
|
||||||
$.post(url, function(json){
|
$.post(url, createPlaylistMetaForm);
|
||||||
var submit, form;
|
|
||||||
|
|
||||||
submit = $('<button id="new_playlist_submit">Submit</button>')
|
|
||||||
.button()
|
|
||||||
.click(function(){
|
|
||||||
var url, data;
|
|
||||||
|
|
||||||
url = '/Playlist/metadata/format/json';
|
|
||||||
data = $("#side_playlist form").serialize();
|
|
||||||
|
|
||||||
$.post(url, data, function(json){
|
|
||||||
if(json.form){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
openDiffSPL(json);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
form = $(json.form);
|
|
||||||
|
|
||||||
form.find("input, textarea")
|
|
||||||
.keydown(function(event){
|
|
||||||
//enter was pressed
|
|
||||||
if(event.keyCode === 13) {
|
|
||||||
event.preventDefault();
|
|
||||||
$("#new_playlist_submit").click();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$("#side_playlist")
|
|
||||||
.empty()
|
|
||||||
.append(form)
|
|
||||||
.append(submit);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteSPL() {
|
function deleteSPL() {
|
||||||
|
|
Loading…
Reference in New Issue