CC-4605: Some AJAX calls are cached

This commit is contained in:
Martin Konecny 2012-10-19 11:07:37 -04:00
parent d838d8ae30
commit ffca5b42a8
8 changed files with 28 additions and 5 deletions

View File

@ -360,7 +360,7 @@ function controlSwitchLight(){
} }
function getScheduleFromServer(){ function getScheduleFromServer(){
$.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ $.ajax({ cache: false, url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){
parseItems(data.entries); parseItems(data.entries);
parseSourceStatus(data.source_status); parseSourceStatus(data.source_status);
parseSwitchStatus(data.switch_status); parseSwitchStatus(data.switch_status);

View File

@ -479,6 +479,7 @@ var AIRTIME = (function(AIRTIME) {
"fnStateSave": function (oSettings, oData) { "fnStateSave": function (oSettings, oData) {
localStorage.setItem('datatables-library', JSON.stringify(oData)); localStorage.setItem('datatables-library', JSON.stringify(oData));
$.ajax({ $.ajax({
cache: false,
url: "/usersettings/set-library-datatable", url: "/usersettings/set-library-datatable",
type: "POST", type: "POST",
data: {settings : oData, format: "json"}, data: {settings : oData, format: "json"},
@ -542,6 +543,7 @@ var AIRTIME = (function(AIRTIME) {
aoData.push( { name: "type", value: type} ); aoData.push( { name: "type", value: type} );
$.ajax( { $.ajax( {
"cache": false,
"dataType": 'json', "dataType": 'json',
"type": "POST", "type": "POST",
"url": sSource, "url": sSource,
@ -883,6 +885,7 @@ var AIRTIME = (function(AIRTIME) {
} }
request = $.ajax({ request = $.ajax({
cache: false,
url: "/library/context-menu", url: "/library/context-menu",
type: "GET", type: "GET",
data: {id : data.id, type: data.ftype, format: "json", "screen": screen}, data: {id : data.id, type: data.ftype, format: "json", "screen": screen},

View File

@ -21,6 +21,7 @@ $(document).ready(function(){
click: function() { click: function() {
var url = '/Usersettings/remindme'; var url = '/Usersettings/remindme';
$.ajax({ $.ajax({
cache: false,
url: url, url: url,
data: {format:"json"} data: {format:"json"}
}); });
@ -34,6 +35,7 @@ $(document).ready(function(){
click: function() { click: function() {
var url ='/Usersettings/remindme-never'; var url ='/Usersettings/remindme-never';
$.ajax({ $.ajax({
cache: false,
url: url, url: url,
data: {format:"json"} data: {format:"json"}
}); });

View File

@ -54,6 +54,7 @@ var AIRTIME = (function(AIRTIME) {
aoData.push( { name: "format", value: "json"} ); aoData.push( { name: "format", value: "json"} );
$.ajax( { $.ajax( {
"cache": false,
"dataType": 'json', "dataType": 'json',
"type": "GET", "type": "GET",
"url": sSource, "url": sSource,
@ -183,4 +184,4 @@ $(document).ready(function(){
oTable.fnDraw(); oTable.fnDraw();
}); });
}); });

View File

@ -36,6 +36,7 @@ function confirmCancelShow(show_instance_id){
if (confirm('Cancel Current Show?')) { if (confirm('Cancel Current Show?')) {
var url = "/Schedule/cancel-current-show"; var url = "/Schedule/cancel-current-show";
$.ajax({ $.ajax({
cache: false,
url: url, url: url,
data: {format: "json", id: show_instance_id}, data: {format: "json", id: show_instance_id},
success: function(data){ success: function(data){
@ -50,6 +51,7 @@ function confirmCancelRecordedShow(show_instance_id){
var url = "/Schedule/cancel-current-show"; var url = "/Schedule/cancel-current-show";
$.ajax({ $.ajax({
url: url, url: url,
cache: false,
data: {format: "json", id: show_instance_id}, data: {format: "json", id: show_instance_id},
success: function(data){ success: function(data){
scheduleRefetchEvents(data); scheduleRefetchEvents(data);
@ -289,7 +291,7 @@ function alertShowErrorAndReload(){
} }
$(document).ready(function() { $(document).ready(function() {
$.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar $.ajax({ cache: false, url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
, error:function(jqXHR, textStatus, errorThrown){}}); , error:function(jqXHR, textStatus, errorThrown){}});
setInterval(checkCalendarSCUploadStatus, 5000); setInterval(checkCalendarSCUploadStatus, 5000);
@ -459,6 +461,7 @@ $(document).ready(function() {
} }
$.ajax({ $.ajax({
cache: false,
url: "/schedule/make-context-menu", url: "/schedule/make-context-menu",
type: "GET", type: "GET",
data: {id : data.id, format: "json"}, data: {id : data.id, format: "json"},

View File

@ -326,6 +326,7 @@ var AIRTIME = (function(AIRTIME){
} }
$.ajax({ $.ajax({
"cache": false,
"dataType": "json", "dataType": "json",
"type": "POST", "type": "POST",
"url": sSource, "url": sSource,
@ -379,6 +380,7 @@ var AIRTIME = (function(AIRTIME){
localStorage.setItem('datatables-timeline', JSON.stringify(oData)); localStorage.setItem('datatables-timeline', JSON.stringify(oData));
$.ajax({ $.ajax({
cache: false,
url: "/usersettings/set-timeline-datatable", url: "/usersettings/set-timeline-datatable",
type: "POST", type: "POST",
data: {settings : oData, format: "json"}, data: {settings : oData, format: "json"},
@ -1003,6 +1005,7 @@ var AIRTIME = (function(AIRTIME){
if (confirm(msg)) { if (confirm(msg)) {
var url = "/Schedule/cancel-current-show"; var url = "/Schedule/cancel-current-show";
$.ajax({ $.ajax({
cache: false,
url: url, url: url,
data: {format: "json", id: data.instance}, data: {format: "json", id: data.instance},
success: function(data){ success: function(data){
@ -1181,6 +1184,7 @@ var AIRTIME = (function(AIRTIME){
} }
request = $.ajax({ request = $.ajax({
cache: false,
url: "/showbuilder/context-menu", url: "/showbuilder/context-menu",
type: "GET", type: "GET",
data: {id : data.id, format: "json"}, data: {id : data.id, format: "json"},

View File

@ -168,6 +168,7 @@ AIRTIME = (function(AIRTIME) {
schedTable.fnDraw(); schedTable.fnDraw();
$.ajax({ $.ajax({
cache: false,
url: "/usersettings/set-now-playing-screen-settings", url: "/usersettings/set-now-playing-screen-settings",
type: "POST", type: "POST",
data: {settings : {library : true}, format: "json"}, data: {settings : {library : true}, format: "json"},
@ -192,6 +193,7 @@ AIRTIME = (function(AIRTIME) {
schedTable.fnDraw(); schedTable.fnDraw();
$.ajax({ $.ajax({
cache: false,
url: "/usersettings/set-now-playing-screen-settings", url: "/usersettings/set-now-playing-screen-settings",
type: "POST", type: "POST",
data: {settings : {library : false}, format: "json"}, data: {settings : {library : false}, format: "json"},
@ -257,6 +259,7 @@ AIRTIME = (function(AIRTIME) {
} }
$.ajax( { $.ajax( {
"cache": false,
"dataType": "json", "dataType": "json",
"type": "GET", "type": "GET",
"url": "/showbuilder/check-builder-feed", "url": "/showbuilder/check-builder-feed",

View File

@ -24,13 +24,19 @@ function populateForm(entries){
} }
function rowClickCallback(row_id){ function rowClickCallback(row_id){
$.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){ $.ajax({ cache: false,
url: '/User/get-user-data/id/'+ row_id +'/format/json',
dataType:"json",
success:function(data){
populateForm(data.entries); populateForm(data.entries);
}}); }});
} }
function removeUserCallback(row_id, nRow){ function removeUserCallback(row_id, nRow){
$.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){ $.ajax({ cache: false,
url: '/User/remove-user/id/'+ row_id +'/format/json',
dataType:"text",
success:function(data){
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow); var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
}}); }});
} }
@ -67,6 +73,7 @@ $(document).ready(function() {
"sAjaxSource": "/User/get-user-data-table-info/format/json", "sAjaxSource": "/User/get-user-data-table-info/format/json",
"fnServerData": function ( sSource, aoData, fnCallback ) { "fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( { $.ajax( {
"cache": false,
"dataType": 'json', "dataType": 'json',
"type": "POST", "type": "POST",
"url": sSource, "url": sSource,