Merge branch 'saas' into saas-embed-player

This commit is contained in:
drigato 2015-03-11 17:13:04 -04:00
commit ac2181a52d
40 changed files with 913 additions and 608 deletions

View file

@ -91,16 +91,11 @@ function openAudioPreview(p_event) {
}
}
function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
// we need to remove soundcloud icon from audioFileTitle
var index = audioFileTitle.indexOf("<span class=");
if(index != -1){
audioFileTitle = audioFileTitle.substring(0,index);
}
function open_audio_preview(type, id) {
// The reason that we need to encode artist and title string is that
// sometime they contain '/' or '\' and apache reject %2f or %5f
// so the work around is to encode it twice.
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+encodeURIComponent(encodeURIComponent(audioFileArtist))+'/audioFileTitle/'+encodeURIComponent(encodeURIComponent(audioFileTitle))+'/type/'+type);
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/type/'+type);
_preview_window.focus();
}

View file

@ -652,11 +652,11 @@ var AIRTIME = (function(AIRTIME) {
open_playlist_preview(aData.audioFile, 0);
} else if (aData.ftype === 'audioclip') {
if (isAudioSupported(aData.mime)) {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
open_audio_preview(aData.ftype, aData.id);
}
} else if (aData.ftype == 'stream') {
if (isAudioSupported(aData.mime)) {
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
open_audio_preview(aData.ftype, aData.id);
}
} else if (aData.ftype == 'block' && aData.bl_type == 'static') {
open_block_preview(aData.audioFile, 0);
@ -964,7 +964,7 @@ var AIRTIME = (function(AIRTIME) {
// pl_
open_playlist_preview(playlistIndex, 0);
} else if (data.ftype === 'audioclip' || data.ftype === 'stream') {
open_audio_preview(data.ftype, data.audioFile, data.track_title, data.artist_name);
open_audio_preview(data.ftype, data.id);
} else if (data.ftype === 'block') {
blockIndex = $(this).parent().attr('id').substring(3); // remove
// the

View file

@ -115,6 +115,11 @@ function setSoundCloudCheckBoxListener() {
});
}
function removeLogo() {
$.post(baseUrl+'Preference/remove-logo', function(json){});
location.reload();
}
$(document).ready(function() {
$('.collapsible-header').live('click',function() {
@ -123,10 +128,6 @@ $(document).ready(function() {
return false;
}).next().hide();
$('#logo-remove-btn').click(function() {
$.post(baseUrl+'Preference/remove-logo', function(json){});
});
/* No longer using AJAX for this form. Zend + our code makes it needlessly hard to deal with. -- Albert
$('#pref_save').live('click', function() {
var data = $('#pref_form').serialize();

View file

@ -668,7 +668,7 @@ function setAddShowEvents(form) {
var showId = $("#add_show_id").attr("value");
if (showId && $("#add_show_logo_current").attr("src") !== "") {
var action = '/rest/show-image?id=' + showId;
var action = '/rest/show-image?csrf_token=' + $('#csrf').val() + '&id=' + showId;
$.ajax({
url: action,
@ -748,7 +748,7 @@ function setAddShowEvents(form) {
data: {format: "json", data: data, hosts: hosts, days: days},
success: function(json) {
if (json.showId && image) { // Successfully added the show, and it contains an image to upload
var imageAction = '/rest/show-image?id=' + json.showId;
var imageAction = '/rest/show-image?csrf_token=' + $('#csrf').val() + '&id=' + json.showId;
// perform a second xhttprequest in order to send the show image
$.ajax({