CC-3817 : Should use soundcloud icon for recorded & uploaded shows in timeline for past shows to match calendar

This commit is contained in:
Naomi Aro 2013-05-28 14:27:59 -04:00
parent 51573d36c9
commit 4d1a15b7ca
4 changed files with 68 additions and 73 deletions

View file

@ -593,12 +593,12 @@ var AIRTIME = (function(AIRTIME) {
"fnRowCallback": AIRTIME.library.fnRowCallback,
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
//add soundcloud icon
if (aData.soundcloud_status !== undefined) {
if (aData.soundcloud_status === "-2") {
if (aData.soundcloud_id !== undefined) {
if (aData.soundcloud_id === "-2") {
$(nRow).find("td.library_title").append('<span class="small-icon progress"/>');
} else if (aData.soundcloud_status === "-3") {
} else if (aData.soundcloud_id === "-3") {
$(nRow).find("td.library_title").append('<span class="small-icon sc-error"/>');
} else if (aData.soundcloud_status !== null) {
} else if (aData.soundcloud_id !== null) {
$(nRow).find("td.library_title").append('<span class="small-icon soundcloud"/>');
}
}
@ -1140,10 +1140,13 @@ function checkLibrarySCUploadStatus(){
setTimeout(checkLibrarySCUploadStatus, 5000);
}
function addQtipToSCIcons(){
$(".progress, .soundcloud, .sc-error").live('mouseover', function(){
function addQtipToSCIcons() {
$("#content")
.on('mouseover', ".progress, .soundcloud, .sc-error", function() {
var id = $(this).parent().parent().data("aData").id;
var aData = $(this).parents("tr").data("aData"),
id = aData.id,
sc_id = aData.soundcloud_id;
if ($(this).hasClass("progress")){
$(this).qtip({
@ -1163,24 +1166,15 @@ function addQtipToSCIcons(){
classes: "ui-tooltip-dark file-md-long"
},
show: {
ready: true // Needed to make it show on first mouseover
// event
ready: true // Needed to make it show on first mouseover event
}
});
}
else if($(this).hasClass("soundcloud")){
var sc_id = $(this).parent().parent().data("aData").soundcloud_id;
else if ($(this).hasClass("soundcloud")){
$(this).qtip({
content: {
text: $.i18n._("Retrieving data from the server..."),
ajax: {
url: baseUrl+"Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
this.set('content.text', $.i18n._("The soundcloud id for this file is: ")+json.sc_id);
}
}
text: $.i18n._("The soundcloud id for this file is: ") + sc_id
},
position:{
adjust: {
@ -1195,11 +1189,11 @@ function addQtipToSCIcons(){
classes: "ui-tooltip-dark file-md-long"
},
show: {
ready: true // Needed to make it show on first mouseover
// event
ready: true // Needed to make it show on first mouseover event
}
});
}else if($(this).hasClass("sc-error")){
}
else if ($(this).hasClass("sc-error")) {
$(this).qtip({
content: {
text: $.i18n._("Retreiving data from the server..."),
@ -1227,8 +1221,7 @@ function addQtipToSCIcons(){
classes: "ui-tooltip-dark file-md-long"
},
show: {
ready: true // Needed to make it show on first mouseover
// event
ready: true // Needed to make it show on first mouseover event
}
});
}