X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/6dc154ec98d58159b3e75447ce7b7fe5642acec4..a5cf02e922943b84bb998f80cd40072f1ff87cf5:/philo/static/philo/js/TagCreation.js diff --git a/philo/static/philo/js/TagCreation.js b/philo/static/philo/js/TagCreation.js deleted file mode 100644 index a23e609..0000000 --- a/philo/static/philo/js/TagCreation.js +++ /dev/null @@ -1,111 +0,0 @@ -var tagCreation = window.tagCreation; - -(function($) { - location_re = new RegExp("^https?:\/\/" + window.location.host + "/") - - $('html').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 = $.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; - } - if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url)) || location_re.test(settings.url)) { - // Only send the token to relative URLs i.e. locally. - xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); - } - }); - tagCreation = { - 'cache': {}, - 'addTagFromSlug': function(triggeringLink) { - var id = triggeringLink.id.replace(/^ajax_add_/, '') + '_input'; - var slug = document.getElementById(id).value; - - var name = slug.split(' '); - for(var i=0;i