1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

Add Label entity

This commit is contained in:
Afterster 2015-04-21 00:05:41 +02:00
parent 3016b8f138
commit 0a1b46f437
23 changed files with 1194 additions and 5 deletions

View file

@ -198,6 +198,7 @@ function handleShareAction(url) {
/***************************************************/
var tag_choices = undefined;
var label_choices = undefined;
function showEditDialog(edit_type, edit_id, edit_form_id, edit_title, refresh_row_prefix) {
var parent = this;
@ -222,12 +223,29 @@ function showEditDialog(edit_type, edit_id, edit_form_id, edit_title, refresh_ro
}, type: 'post', dataType: 'xml'
});
return;
}
parent.editLabelChoices = new Array();
if (label_choices == undefined && label_choices != '') {
// Load tag map
$.ajax(jsAjaxServer + '/ajax.server.php?page=tag&action=get_labels', {
success: function(data) {
label_choices = $(data).find('content').text();
if (label_choices != '') {
showEditDialog(edit_type, edit_id, edit_form_id, edit_title, refresh_row_prefix);
}
}, type: 'post', dataType: 'xml'
});
return;
}
var splitted = tag_choices.split(',');
var i;
for (i = 0; i < splitted.length; ++i) {
parent.editTagChoices.push($.trim(splitted[i]));
}
splitted = label_choices.split(',');
for (i = 0; i < splitted.length; ++i) {
parent.editLabelChoices.push($.trim(splitted[i]));
}
parent.dialog_buttons = {};
this.dialog_buttons[jsSaveTitle] = function () {
@ -289,6 +307,14 @@ function showEditDialog(edit_type, edit_id, edit_form_id, edit_title, refresh_ro
singleFieldDelimiter: ',',
availableTags: parent.editTagChoices
});
}
if ($('#edit_labels').length > 0) {
$("#edit_labels").tagit({
allowSpaces: true,
singleField: true,
singleFieldDelimiter: ',',
availableTags: parent.editLabelChoices
});
}
});
},