From d97107ed5b242a3913df0d88ef4d8374b66ca25c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 12 Feb 2019 19:21:29 +0100 Subject: begin geocode client --- old/server/app/static/js/util.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 old/server/app/static/js/util.js (limited to 'old/server/app/static/js/util.js') diff --git a/old/server/app/static/js/util.js b/old/server/app/static/js/util.js deleted file mode 100644 index 851f634a..00000000 --- a/old/server/app/static/js/util.js +++ /dev/null @@ -1,32 +0,0 @@ -var is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) -var is_ipad = (navigator.userAgent.match(/iPad/i)) -var is_android = (navigator.userAgent.match(/Android/i)) -var is_mobile = is_iphone || is_ipad || is_android -var is_desktop = ! is_mobile; - -document.body.parentNode.classList.add(is_desktop ? 'desktop' : 'mobile') - -function preventDefault(e){ - e.preventDefault() - e.stopPropagation() -} - -var decodeEntities = (function() { - // this prevents any overhead from creating the object each time - var element = document.createElement('div'); - - function decodeHTMLEntities (str) { - if(str && typeof str === 'string') { - // strip script/html tags - str = str.replace(/]*>([\S\s]*?)<\/script>/gmi, ''); - str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, ''); - element.innerHTML = str; - str = element.textContent; - element.textContent = ''; - } - - return str; - } - - return decodeHTMLEntities; -})(); \ No newline at end of file -- cgit v1.2.3-70-g09d2