CC-4895: Remove all json die() statements from code
- removed json_encode
This commit is contained in:
parent
7bc4151741
commit
525b2dcb33
15 changed files with 43 additions and 51 deletions
|
@ -30,8 +30,7 @@ $(document).ready(function() {
|
|||
var tempFileName = j.tempfilepath;
|
||||
$.get(baseUrl+'Plupload/copyfile/format/json/name/'+
|
||||
encodeURIComponent(file.name)+'/tempname/' +
|
||||
encodeURIComponent(tempFileName), function(json){
|
||||
var jr = jQuery.parseJSON(json);
|
||||
encodeURIComponent(tempFileName), function(jr){
|
||||
if(jr.error !== undefined) {
|
||||
var row = $("<tr/>")
|
||||
.append('<td>' + file.name +'</td>')
|
||||
|
|
|
@ -450,9 +450,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
if ($(this).hasClass('close')) {
|
||||
var sUrl = baseUrl+"playlist/get-block-info";
|
||||
mod.disableUI();
|
||||
$.post(sUrl, {format:"json", id:blockId}, function(json){
|
||||
$.post(sUrl, {format:"json", id:blockId}, function(data){
|
||||
$html = "";
|
||||
var data = $.parseJSON(json);
|
||||
var isStatic = data.isStatic;
|
||||
delete data.type;
|
||||
if (isStatic) {
|
||||
|
@ -643,8 +642,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
obj_id = $('input[id="obj_id"]').val();
|
||||
url = baseUrl+"Playlist/shuffle";
|
||||
enableLoadingIcon();
|
||||
$.post(url, {format: "json", obj_id: obj_id}, function(data){
|
||||
var json = $.parseJSON(data)
|
||||
$.post(url, {format: "json", obj_id: obj_id}, function(json){
|
||||
|
||||
if (json.error !== undefined) {
|
||||
alert(json.error);
|
||||
|
@ -727,8 +725,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
enableLoadingIcon();
|
||||
$.post(save_action,
|
||||
{format: "json", data: criteria, name: block_name, description: block_desc, obj_id: obj_id, type: obj_type, modified: lastMod},
|
||||
function(data){
|
||||
var json = $.parseJSON(data);
|
||||
function(json){
|
||||
if (json.error !== undefined) {
|
||||
alert(json.error);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ $(document).ready(function() {
|
|||
function getDataAndPlot(startTimestamp, endTimestamp){
|
||||
// get data
|
||||
$.get(baseUrl+'Listenerstat/get-data', {startTimestamp: startTimestamp, endTimestamp: endTimestamp}, function(data){
|
||||
data = JSON.parse(data);
|
||||
out = new Object();
|
||||
$.each(data, function(mpName, v){
|
||||
plotData = new Object();
|
||||
|
|
|
@ -480,9 +480,8 @@ function getCriteriaOptionType(e) {
|
|||
return criteriaTypes[criteria];
|
||||
}
|
||||
|
||||
function callback(data, type) {
|
||||
var json = $.parseJSON(data),
|
||||
dt = $('table[id="library_display"]').dataTable();
|
||||
function callback(json, type) {
|
||||
var dt = $('table[id="library_display"]').dataTable();
|
||||
|
||||
if (type == 'shuffle' || type == 'generate') {
|
||||
if (json.error !== undefined) {
|
||||
|
|
|
@ -108,8 +108,7 @@ $(document).ready(function() {
|
|||
var data = $('#pref_form').serialize();
|
||||
var url = baseUrl+'Preference/index';
|
||||
|
||||
$.post(url, {format: "json", data: data}, function(data){
|
||||
var json = $.parseJSON(data);
|
||||
$.post(url, {format: "json", data: data}, function(json){
|
||||
$('#content').empty().append(json.html);
|
||||
$.cookie("default_airtime_locale", $('#locale').val(), {path: '/'});
|
||||
setTimeout(removeSuccessMsg, 5000);
|
||||
|
|
|
@ -77,8 +77,7 @@ function showForIcecast(ele){
|
|||
function checkLiquidsoapStatus(){
|
||||
var url = baseUrl+'Preference/get-liquidsoap-status/format/json';
|
||||
var id = $(this).attr("id");
|
||||
$.post(url, function(json){
|
||||
var json_obj = jQuery.parseJSON(json);
|
||||
$.post(url, function(json_obj){
|
||||
for(var i=0;i<json_obj.length;i++){
|
||||
var obj = json_obj[i];
|
||||
var id;
|
||||
|
@ -441,8 +440,7 @@ $(document).ready(function() {
|
|||
var data = $('#stream_form').serialize();
|
||||
var url = baseUrl+'Preference/stream-setting';
|
||||
|
||||
$.post(url, {format:"json", data: data}, function(data){
|
||||
var json = $.parseJSON(data);
|
||||
$.post(url, {format:"json", data: data}, function(json){
|
||||
$('#content').empty().append(json.html);
|
||||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
|
|
|
@ -87,8 +87,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
// once a track plays out we need to check if we can update
|
||||
// the is_scheduled flag in cc_files
|
||||
$.post(baseUrl+"schedule/update-future-is-scheduled",
|
||||
{"format": "json", "schedId": schedId}, function(json) {
|
||||
var data = $.parseJSON(json);
|
||||
{"format": "json", "schedId": schedId}, function(data) {
|
||||
if (data.redrawLibTable !== undefined && data.redrawLibTable) {
|
||||
$("#library_content").find("#library_display").dataTable().fnStandingRedraw();
|
||||
}
|
||||
|
|
|
@ -189,8 +189,7 @@ $(document).ready(function() {
|
|||
var data = $('#user_form').serialize();
|
||||
var url = baseUrl+'User/add-user';
|
||||
|
||||
$.post(url, {format: "json", data: data}, function(data){
|
||||
var json = $.parseJSON(data);
|
||||
$.post(url, {format: "json", data: data}, function(json){
|
||||
if (json.valid === "true") {
|
||||
$('#content').empty().append(json.html);
|
||||
populateUserTable();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue