From 5933cc0b09b4f37e7e5f714b23ab5993e6fc0b2c Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sun, 1 Aug 2021 21:25:26 +0300 Subject: upload image by url in web ui --- web/share/js/tools.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/share/js/tools.js') diff --git a/web/share/js/tools.js b/web/share/js/tools.js index b24864e2..10013727 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -211,11 +211,22 @@ export var tools = new function() { }; }; + self.input = new function() { + return { + "getFile": function(el) { + return (el.files.length ? el.files[0] : null); + }, + }; + }; + self.hidden = new function() { return { "setVisible": function(el, visible) { el.classList.toggle("hidden", !visible); }, + "isVisible": function(el) { + return !el.classList.contains("hidden"); + }, }; }; -- cgit v1.2.3