diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-02-12 19:21:29 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-02-12 19:21:29 +0100 |
| commit | d97107ed5b242a3913df0d88ef4d8374b66ca25c (patch) | |
| tree | 510d8fc249b7ca761a137c61a1a5e1af1c5e3bbe /old/server/app/static/js/util.js | |
| parent | b1df7ef2090f1f3c9e0aeb49f5ffa6a33f4b8226 (diff) | |
begin geocode client
Diffstat (limited to 'old/server/app/static/js/util.js')
| -rw-r--r-- | old/server/app/static/js/util.js | 32 |
1 files changed, 0 insertions, 32 deletions
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(/<script[^>]*>([\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 |
