-changed some references from campcaster to airtime in the documentation / comments
This commit is contained in:
parent
f6a56c01a9
commit
20c392343b
45 changed files with 91 additions and 88 deletions
87
public/js/airtime/library/library.js
Normal file
87
public/js/airtime/library/library.js
Normal file
|
@ -0,0 +1,87 @@
|
|||
function getId() {
|
||||
var tr_id = $(this.triggerElement).attr("id");
|
||||
tr_id = tr_id.split("_");
|
||||
|
||||
return tr_id[1];
|
||||
}
|
||||
|
||||
function getType() {
|
||||
var tr_id = $(this.triggerElement).attr("id");
|
||||
tr_id = tr_id.split("_");
|
||||
|
||||
return tr_id[0];
|
||||
}
|
||||
|
||||
function deleteItem(type, id) {
|
||||
var tr_id;
|
||||
|
||||
tr_id = type+"_"+id;
|
||||
|
||||
$("#library_display tr#" +tr_id).remove();
|
||||
}
|
||||
|
||||
function deleteAudioClip(json) {
|
||||
if(json.message) {
|
||||
alert(json.message);
|
||||
return;
|
||||
}
|
||||
|
||||
deleteItem("au", json.id);
|
||||
}
|
||||
|
||||
function deletePlaylist(json) {
|
||||
if(json.message) {
|
||||
alert(json.message);
|
||||
return;
|
||||
}
|
||||
|
||||
deleteItem("pl", json.id);
|
||||
}
|
||||
|
||||
function addLibraryItemEvents() {
|
||||
$('#library_display tr[id ^= "au"]')
|
||||
.draggable({
|
||||
helper: 'clone'
|
||||
});
|
||||
|
||||
$('#library_display tr:not(:first-child)')
|
||||
.jjmenu("rightClick",
|
||||
[{get:"/Library/context-menu/format/json/id/#id#/type/#type#"}],
|
||||
{id: getId, type: getType},
|
||||
{xposition: "mouse", yposition: "mouse"});
|
||||
|
||||
}
|
||||
|
||||
function setLibraryContents(data){
|
||||
$("#library_display tr:not(:first-child)").remove();
|
||||
$("#library_display").append(data);
|
||||
|
||||
addLibraryItemEvents()
|
||||
}
|
||||
|
||||
function setUpLibrary() {
|
||||
|
||||
$("#library_display tr:first-child span.title").data({'ob': 'dc:title', 'order' : 'asc'});
|
||||
$("#library_display tr:first-child span.artist").data({'ob': 'dc:creator', 'order' : 'desc'});
|
||||
$("#library_display tr:first-child span.album").data({'ob': 'dc:source', 'order' : 'asc'});
|
||||
$("#library_display tr:first-child span.track").data({'ob': 'ls:track_num', 'order' : 'asc'});
|
||||
$("#library_display tr:first-child span.length").data({'ob': 'dcterms:extent', 'order' : 'asc'});
|
||||
|
||||
$("#library_display tr:first-child span").click(function(){
|
||||
var url = "/Library/contents/format/html",
|
||||
ob = $(this).data('ob'),
|
||||
order = $(this).data('order');
|
||||
|
||||
//toggle order for next click.
|
||||
if(order === 'asc') {
|
||||
$(this).data('order', 'desc');
|
||||
}
|
||||
else {
|
||||
$(this).data('order', 'asc');
|
||||
}
|
||||
|
||||
$.post(url, {ob: ob, order: order}, setLibraryContents);
|
||||
});
|
||||
|
||||
addLibraryItemEvents()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue