Merge branch '2.2.x' into devel

Conflicts:
	airtime_mvc/application/controllers/ShowbuilderController.php
	airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js
	airtime_mvc/public/js/airtime/common/common.js
This commit is contained in:
denise 2012-10-19 12:50:36 -04:00
commit 7d8079f770
38 changed files with 361 additions and 105 deletions

View file

@ -0,0 +1,5 @@
$(document).ready(function() {
$.ajaxSetup({
cache: false
});
});

View file

@ -123,6 +123,7 @@ function buildplaylist(p_url, p_playIndex) {
var media;
var index;
var total = 0;
var skipped = 0;
for(index in data) {
if (data[index]['type'] == 0) {
@ -146,22 +147,30 @@ function buildplaylist(p_url, p_playIndex) {
artist: data[index]['element_artist'],
wav:data[index]['uri']
};
}
} else {
// skip this track since it's not supported
console.log("continue");
skipped++;
continue;
}
} else if (data[index]['type'] == 1) {
media = {title: data[index]['element_title'],
artist: data[index]['element_artist'],
mp3:data[index]['uri']
};
}
console.log(data[index]);
if (media && isAudioSupported(data[index]['mime'])) {
myPlaylist[index] = media;
// javascript doesn't support associative array with numeric key
// so we need to remove the gap if we skip any of tracks due to
// browser incompatibility.
myPlaylist[index-skipped] = media;
}
// we should create a map according to the new position in the
// player itself total is the index on the player
_idToPostionLookUp[data[index]['element_id']] = total;
total++;
}
_playlist_jplayer.setPlaylist(myPlaylist);
_playlist_jplayer.option("autoPlay", true);
play(p_playIndex);

View file

@ -53,7 +53,8 @@ function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
if(index != -1){
audioFileTitle = audioFileTitle.substring(0,index);
}
openPreviewWindow(baseUrl+'/audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle+'/type/'+type);
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+encodeURIComponent(audioFileArtist)+'/audioFileTitle/'+encodeURIComponent(audioFileTitle)+'/type/'+type);
_preview_window.focus();
}

View file

@ -815,9 +815,10 @@ var AIRTIME = (function(AIRTIME) {
//playlist screen if this is the currently edited playlist.
if ((data.ftype === "playlist" || data.ftype === "block") && screen === "playlist") {
callback = function() {
aMedia = [];
aMedia.push({"id": data.id, "type": data.ftype});
if (confirm('Are you sure you want to delete the selected item?')) {
AIRTIME.playlist.fnDelete(data.id);
AIRTIME.library.fnDeleteItems(aMedia);
}
};
}

View file

@ -367,7 +367,7 @@ var AIRTIME = (function(AIRTIME){
//and verify whether they can be previewed by the browser or not. If not
//then the playlist element is greyed out
mod.validatePlaylistElements = function(){
$.each($(".big_play ui-icon-play"), function(index, value){
$.each($("div .big_play"), function(index, value){
if ($(value).attr('blockId') === undefined) {
var mime = $(value).attr("data-mime-type");
if (isAudioSupported(mime)) {
@ -394,6 +394,31 @@ var AIRTIME = (function(AIRTIME){
},
})
}
} else {
if ($(value).attr('blocktype') === 'dynamic') {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
content: 'Dynamic block is not previewable',
show: 'mouseover',
hide: {
delay: 500,
fixed: true
},
style: {
border: {
width: 0,
radius: 4
},
classes: "ui-tooltip-dark ui-tooltip-rounded"
},
position: {
my: "left bottom",
at: "right center"
},
})
} else {
$(value).bind("click", openAudioPreview);
}
}
});
}

View file

@ -363,7 +363,7 @@ function setupUI() {
$(".playlist_type_help_icon").qtip({
content: {
text: "A static smart block will save the criteria and generate the block content immediately." +
text: "A static smart block will save the criteria and generate the block content immediately. " +
"This allows you to edit and view it in the Library before adding it to a show.<br /><br />" +
"A dynamic smart block will only save the criteria. The block content will get generated upon " +
"adding it to a show. You will not be able to view and edit the content in the Library."

View file

@ -206,7 +206,6 @@ function viewDisplay( view ) {
}
function eventRender(event, element, view) {
getCurrentShow();
$(element).data("event", event);
@ -367,7 +366,9 @@ function checkSCUploadStatus(){
});
});
}
/** This function adds and removes the current
* show icon
*/
function getCurrentShow(){
var url = baseUrl+'/Schedule/get-current-show/format/json',
id,