Merge saas-dev into soundcloud

This commit is contained in:
Duncan Sommerville 2015-06-10 16:08:52 -04:00
commit 459f9494c3
373 changed files with 6577 additions and 10376 deletions

View file

@ -132,22 +132,6 @@ function setCollapsibleWidgetJsCode() {
$('#thirdPartyApi-element input').click(x);
}
//function setSoundCloudCheckBoxListener() {
// var subCheckBox= $("#UseSoundCloud,#SoundCloudDownloadbleOption");
// var mainCheckBox= $("#UploadToSoundcloudOption");
// subCheckBox.change(function(e){
// if (subCheckBox.is(':checked')) {
// mainCheckBox.attr("checked", true);
// }
// });
//
// mainCheckBox.change(function(e){
// if (!mainCheckBox.is(':checked')) {
// $("#UseSoundCloud,#SoundCloudDownloadbleOption").attr("checked", false);
// }
// });
//}
function removeLogo() {
$.post(baseUrl+'Preference/remove-logo', function(json){});
location.reload();
@ -190,7 +174,6 @@ $(document).ready(function() {
showErrorSections();
//setSoundCloudCheckBoxListener();
setMailServerInputReadonly();
setSystemFromEmailReadonly();
setConfigureMailServerListener();

View file

@ -194,31 +194,6 @@ function eventRender(event, element, view) {
$(element).find(".fc-event-content").append(div);
}
//add the record/rebroadcast/soundcloud icons if needed
//if (event.record === 1) {
// if (view.name === 'agendaDay' || view.name === 'agendaWeek') {
// if (event.soundcloud_id === -1) {
// $(element).find(".fc-event-time").before('<span class="small-icon recording"></span>');
// } else if ( event.soundcloud_id > 0) {
// $(element).find(".fc-event-time").before('<span class="small-icon recording"></span><span class="small-icon soundcloud"></span>');
// } else if (event.soundcloud_id === -2) {
// $(element).find(".fc-event-time").before('<span class="small-icon recording"></span><span class="small-icon progress"></span>');
// } else if (event.soundcloud_id === -3) {
// $(element).find(".fc-event-time").before('<span class="small-icon recording"></span><span class="small-icon sc-error"></span>');
// }
// } else if (view.name === 'month') {
// if(event.soundcloud_id === -1) {
// $(element).find(".fc-event-title").after('<span class="small-icon recording"></span>');
// } else if (event.soundcloud_id > 0) {
// $(element).find(".fc-event-title").after('<span class="small-icon recording"></span><span class="small-icon soundcloud"></span>');
// } else if (event.soundcloud_id === -2) {
// $(element).find(".fc-event-title").after('<span class="small-icon recording"></span><span class="small-icon progress"></span>');
// } else if (event.soundcloud_id === -3) {
// $(element).find(".fc-event-title").after('<span class="small-icon recording"></span><span class="small-icon sc-error"></span>');
// }
// }
//}
if (event.record === 0 && event.rebroadcast === 0) {
if (view.name === 'agendaDay' || view.name === 'agendaWeek') {

View file

@ -63,25 +63,6 @@ function confirmCancelRecordedShow(show_instance_id){
}
}
//function uploadToSoundCloud(show_instance_id, el){
//
// var url = baseUrl+"Schedule/upload-to-sound-cloud",
// $el = $(el),
// $span = $el.find(".soundcloud");
//
// $.post(url, {id: show_instance_id, format: "json"});
//
// //first upload to soundcloud.
// if ($span.length === 0){
// $span = $("<span/>", {"class": "progress"});
//
// $el.find(".fc-event-title").after($span);
// }
// else {
// $span.removeClass("soundcloud").addClass("progress");
// }
//}
function checkCalendarSCUploadStatus(){
var url = baseUrl+'Library/get-upload-to-soundcloud-status',
span,
@ -421,24 +402,6 @@ $(document).ready(function() {
oItems.content.callback = callback;
}
//define a soundcloud upload callback.
//if (oItems.soundcloud_upload !== undefined) {
//
// callback = function() {
// uploadToSoundCloud(data.id, this.context);
// };
// oItems.soundcloud_upload.callback = callback;
//}
//define a view on soundcloud callback.
//if (oItems.soundcloud_view !== undefined) {
//
// callback = function() {
// window.open(oItems.soundcloud_view.url);
// };
// oItems.soundcloud_view.callback = callback;
//}
//define a cancel recorded show callback.
if (oItems.cancel_recorded !== undefined) {

View file

@ -0,0 +1,151 @@
/**
* Do some cleanup when we get a success response from a POST request
* during setup
* @param data the POST request return data
* @param e the jquery event
*/
function cleanupStep(data, e) {
showFeedback(data);
// If there are no errors, we can continue with
// the installation process
if (data.errors.length == 0) {
// Call nextSlide from the submit button's context
nextSlide.call($(e.target));
}
removeOverlay();
}
/**
* Display the form feedback when we get POST results
* @param data the POST request return data
*/
function showFeedback(data) {
toggleMessage(data.message);
for (var i = 0; i < data.errors.length; i++) {
$("#" + data.errors[i]).parent().addClass("has-error has-feedback");
}
if (data.errors.length > 0) {
$(".help-message").addClass("has-error");
$(".has-error .form-control-feedback").show();
} else {
$(".help-message").addClass("has-success");
}
}
/**
* Reset form feedback when resubmitting
*/
function resetFeedback() {
$(".form-control-feedback").hide();
$(".has-success, .has-error, .has-feedback").removeClass("has-success has-error has-feedback");
}
/**
* Show the return message from the POST request, then set a timeout to hide it again
* @param msg the return message from the POST request
*/
function toggleMessage(msg) {
/*
* Since setting display:none; on this element causes odd behaviour
* with bootstrap, hide() the element so we can formSlide it in.
* This is only really only necessary the first time this
* function is called after page load.
*/
var help = $(".help-message");
help.html(msg).show();
}
/**
* Show the overlay and loading gif
*/
function addOverlay() {
$("body").append("<div id='overlay'></div><img src='css/images/file_import_loader.gif' id='loadingImage'/>");
}
/**
* Remove the overlay and loading gif
*/
function removeOverlay() {
var overlay = $("#overlay, #loadingImage");
$("#loadingImage").fadeOut(250);
$("#overlay").fadeOut(500, function() {
overlay.remove();
});
}
function formSlide(dir) {
var delta = (dir == "next") ? "-=100%" : "+=100%",
parent = $(this).parents("div.form-wrapper"),
toForm = (dir == "next") ? parent.next() : parent.prev();
parent.find(".btn").attr("disabled", "disabled");
toForm.find(".btn").removeAttr("disabled");
toForm.find(":input :first").focus();
$(".form-slider").animate({left: delta}, 500);
var stepCount = $("#stepCount"),
steps = parseInt(stepCount.html());
stepCount.html((dir == "next") ? (steps + 1) : (steps - 1));
hideRMQForm();
}
/**
* Fade out the previous setup step and fade in the next one
*/
function nextSlide() {
formSlide.call($(this), "next");
}
/**
* Fade out the current setup step and fade in the previous one
*/
function prevSlide() {
formSlide.call($(this), "prev");
}
/**
* Hide the RMQ form when the slider is called to avoid showing
* scrollbars on slider panels that fit vertically
*/
function hideRMQForm() {
$("#rmqFormBody").slideUp(500);
$("#advCaret").removeClass("caret-up");
}
function submitForm(e, obj) {
resetFeedback();
e.preventDefault();
var d = $(e.target).serializeArray();
addOverlay();
// Append .promise().done() rather than using a
// callback to avoid call duplication
$("#overlay, #loadingImage").fadeIn(500).promise().done(function() {
// Proxy function for passing the event to the cleanup function
var cleanupProxy = function(data) {
cleanupStep.call(this, data, e);
};
$.post('setup/setup-functions.php?obj=' + obj, d, cleanupProxy, "json");
});
}
$(function() {
// Stop the user from dragging the slider
$(".form-slider").draggable('disable');
$(".btn").attr("disabled", "disabled");
$("form:first .btn").removeAttr("disabled");
window.onresize = function() {
var headerHeight = $(".header").outerHeight(),
viewport = $(".viewport"),
viewportHeight = viewport.outerHeight();
// If the viewport would go outside the page bounds,
// shrink it to fit the window
if (viewportHeight + headerHeight > window.innerHeight) {
viewport.css("height", window.innerHeight - headerHeight);
}
// Otherwise, go back to what we have in the stylesheet
else {
viewport.css("height", "");
}
};
});