diff options
Diffstat (limited to 'web/js/tools.js')
-rw-r--r-- | web/js/tools.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/js/tools.js b/web/js/tools.js index 76f27b7d..9f94175a 100644 --- a/web/js/tools.js +++ b/web/js/tools.js @@ -10,6 +10,13 @@ var tools = new function() { return http; }; + this.getCookie = function(name) { + var matches = document.cookie.match(new RegExp( + "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") + "=([^;]*)" // eslint-disable-line no-useless-escape + )); + return (matches ? decodeURIComponent(matches[1]) : ""); + }; + this.setOnClick = function(el, callback) { el.onclick = el.ontouchend = function(event) { event.preventDefault(); |