X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/d8d6976f3a0646a05e052d33294e3c8c44c5eed3..53e7a83e124b274f887d368fca7623bba6a6107c:/philo/static/admin/js/TagCreation.js diff --git a/philo/static/admin/js/TagCreation.js b/philo/static/admin/js/TagCreation.js deleted file mode 100644 index d08d41e..0000000 --- a/philo/static/admin/js/TagCreation.js +++ /dev/null @@ -1,101 +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