[virtualcommons-svn] commit/vcweb: 2 new changesets
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-06-24 01:15:57
|
2 new changesets in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/07eb1c2a5015/ changeset: 07eb1c2a5015 user: alllee date: 2011-06-24 03:13:59 summary: creating base mobile template and adding cookie ajax csrf support affected #: 3 files (1.5 KB) --- a/vcweb/core/templates/base.html Wed Jun 22 09:22:27 2011 -0700 +++ b/vcweb/core/templates/base.html Thu Jun 23 18:13:59 2011 -0700 @@ -13,6 +13,7 @@ <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script><script type='text/javascript' src='{{STATIC_URL}}js/common.js'></script><script type='text/javascript' src='{{STATIC_URL}}js/jquery.qtip-1.0.0-rc3.min.js'></script> + <script type='text/javascript' src='{{STATIC_URL}}js/jquery.cookies.2.2.0.min.js'></script> {% include "includes/jquery.ui.html" %} {% if debug_mode %} {% load dajaxice_templatetags %} --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vcweb/core/templates/mobile/base.html Thu Jun 23 18:13:59 2011 -0700 @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> + <head> + {% block head %} + <title>{% block title %}Virtual Commons Web Environment{% endblock %}</title> + <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b.1/jquery.mobile-1.0b.1.min.css" /> + <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script> + <script type="text/javascript" src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script> + <link href="{{STATIC_URL}}css/mobile.css" rel="stylesheet" type="text/css" media="screen" /> + <!-- vcweb common js --> + {% endblock %} + </head> + <body> + {% block content %} + {% endblock content %} + </body> +</html> --- a/vcweb/static/js/common.js Wed Jun 22 09:22:27 2011 -0700 +++ b/vcweb/static/js/common.js Thu Jun 23 18:13:59 2011 -0700 @@ -28,21 +28,6 @@ } $(document).ajaxSend(function(event, xhr, settings) { - function getCookie(name) { - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } function sameOrigin(url) { // url could be relative or scheme relative or absolute var host = document.location.host; // host + port @@ -58,8 +43,7 @@ function safeMethod(method) { return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); } - if (!safeMethod(settings.type) && sameOrigin(settings.url)) { - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); + xhr.setRequestHeader("X-CSRFToken", $.cookies.get('csrftoken')); } }); http://bitbucket.org/virtualcommons/vcweb/changeset/17ad2eb9169e/ changeset: 17ad2eb9169e user: alllee date: 2011-06-24 03:15:42 summary: pushing cookies to base-vcweb-form dependency affected #: 2 files (193 bytes) --- a/vcweb/core/templates/base.html Thu Jun 23 18:13:59 2011 -0700 +++ b/vcweb/core/templates/base.html Thu Jun 23 18:15:42 2011 -0700 @@ -11,9 +11,8 @@ <link href="{{STATIC_URL}}css/style.css" rel="stylesheet" type="text/css" media="screen" /><!-- vcweb common js --><script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script> + <script type='text/javascript' src='{{STATIC_URL}}js/jquery.qtip-1.0.0-rc3.min.js'></script><script type='text/javascript' src='{{STATIC_URL}}js/common.js'></script> - <script type='text/javascript' src='{{STATIC_URL}}js/jquery.qtip-1.0.0-rc3.min.js'></script> - <script type='text/javascript' src='{{STATIC_URL}}js/jquery.cookies.2.2.0.min.js'></script> {% include "includes/jquery.ui.html" %} {% if debug_mode %} {% load dajaxice_templatetags %} --- a/vcweb/core/templates/includes/jquery.forms.html Thu Jun 23 18:13:59 2011 -0700 +++ b/vcweb/core/templates/includes/jquery.forms.html Thu Jun 23 18:15:42 2011 -0700 @@ -1,1 +1,2 @@ <script type='text/javascript' src='{{STATIC_URL}}js/jquery.validate.min.js'></script> +<script type='text/javascript' src='{{STATIC_URL}}js/jquery.cookies.2.2.0.min.js'></script> Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |