Fix indentation

(imported from commit 8f4880ceaa2e84fa842ba195ebe40800fc168eab)
This commit is contained in:
Keegan McAllister
2012-09-07 14:18:34 -04:00
parent 7d51dfc0a7
commit 1211995d2e

View File

@@ -19,27 +19,27 @@ $(function () {
}); });
$.ajaxSetup({ $.ajaxSetup({
beforeSend: function (xhr, settings) { beforeSend: function (xhr, settings) {
function getCookie(name) { function getCookie(name) {
var cookieValue = null; var cookieValue = null;
if (document.cookie && document.cookie != '') { if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';'); var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) { for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]); var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want? // Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) { if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break; break;
} }
} }
} }
return cookieValue; return cookieValue;
} }
if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) { if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
// Only send the token to relative URLs i.e. locally. // Only send the token to relative URLs i.e. locally.
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
} }
} }
}); });
function sub(zephyr_class) { function sub(zephyr_class) {
@@ -196,10 +196,10 @@ var goto_pressed = false;
$(function () { $(function () {
$('input, textarea, button').focus(function () { $('input, textarea, button').focus(function () {
allow_hotkeys = false; allow_hotkeys = false;
}); });
$('input, textarea, button').blur(function () { $('input, textarea, button').blur(function () {
allow_hotkeys = true; allow_hotkeys = true;
}); });
}); });