Commit 950a9edb18fb4f53e39ca0e687f7ef2c20ad2ff5
Exists in
master
and in
21 other branches
Merge remote-tracking branch 'origin/master'
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
public/javascripts/application.js
| ... | ... | @@ -523,8 +523,10 @@ function userDataCallback(data) { |
| 523 | 523 | if (data.login) { |
| 524 | 524 | // logged in |
| 525 | 525 | if (data.chat_enabled) { |
| 526 | - setInterval(function(){ $.getJSON(user_data, chatOnlineUsersDataCallBack)}, 10000); | |
| 526 | + setInterval(function(){ jQuery.getJSON(user_data, chatOnlineUsersDataCallBack)}, 10000); | |
| 527 | 527 | } |
| 528 | + jQuery('head').append('<meta content="authenticity_token" name="csrf-param" />'); | |
| 529 | + jQuery('head').append('<meta content="'+jQuery.cookie("_noosfero_.XSRF-TOKEN")+'" name="csrf-token" />'); | |
| 528 | 530 | } |
| 529 | 531 | if (data.notice) { |
| 530 | 532 | display_notice(data.notice); |
| ... | ... | @@ -546,10 +548,6 @@ jQuery(function($) { |
| 546 | 548 | |
| 547 | 549 | var user_data = noosfero_root() + '/account/user_data'; |
| 548 | 550 | $.getJSON(user_data, userDataCallback) |
| 549 | - if (user_data.login) { | |
| 550 | - $('head').append('<meta content="authenticity_token" name="csrf-param" />'); | |
| 551 | - $('head').append('<meta content="'+$.cookie("_noosfero_.XSRF-TOKEN")+'" name="csrf-token" />'); | |
| 552 | - } | |
| 553 | 551 | |
| 554 | 552 | $.ajaxSetup({ cache: false }); |
| 555 | 553 | ... | ... |