From 3e7b5bf04908dbcf14bbeafc052bce9c51bb6b2c Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 18 Dec 2018 23:25:23 +0300 Subject: refactoring --- web/share/js/tools.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web/share/js/tools.js') diff --git a/web/share/js/tools.js b/web/share/js/tools.js index 80b074ee..fbd5abc6 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -1,6 +1,8 @@ var tools = new function() { var __debug = (new URL(window.location.href)).searchParams.get("debug"); + this.forEach = (...args) => Array.prototype.forEach.call(...args); + this.makeRequest = function(method, url, callback, body=null, content_type=null) { var http = new XMLHttpRequest(); http.open(method, url, true); @@ -134,3 +136,4 @@ var tools = new function() { var $ = (id) => document.getElementById(id); var $$ = (cls) => document.getElementsByClassName(cls); +var $$$ = (selector) => document.querySelectorAll(selector); -- cgit v1.2.3