mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-14 05:08:51 +01:00
hopefully fix #1109 where I think the csrf change in rails 2.3.11 messes up our expiry checking
This commit is contained in:
parent
da93b82b2b
commit
4cca813bc7
2 changed files with 14 additions and 6 deletions
|
|
@ -843,6 +843,7 @@ function default_ajax_options_for_submit(ajax_type, element_to_block) {
|
|||
context: element_to_block,
|
||||
data: "_source_view=" + SOURCE_VIEW,
|
||||
beforeSend: function() {
|
||||
// console.debug('data: '+this.data);
|
||||
if (this.context) {
|
||||
$(this.context).block({
|
||||
message: null
|
||||
|
|
@ -913,12 +914,16 @@ $(document).ajaxSend(function(event, request, settings) {
|
|||
});
|
||||
|
||||
function setup_periodic_check(url_for_check, interval_in_sec, method) {
|
||||
var ajaxMethod = (method ? method : "GET");
|
||||
|
||||
function check_remote() {
|
||||
$.ajax(default_ajax_options_for_scripts(ajaxMethod, url_for_check, null));
|
||||
}
|
||||
setInterval(check_remote, interval_in_sec*1000);
|
||||
setInterval(
|
||||
function(){
|
||||
var settings = default_ajax_options_for_scripts( method ? method : "GET", url_for_check, null);
|
||||
if(typeof(AUTH_TOKEN) != 'undefined'){
|
||||
settings.data += "&authenticity_token=" + encodeURIComponent( AUTH_TOKEN )
|
||||
}
|
||||
$.ajax(settings);
|
||||
},
|
||||
interval_in_sec*1000
|
||||
);
|
||||
}
|
||||
|
||||
function update_order(event, ui){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue