From 5d4754944298117bf02eef0a6e6cebac872991e9 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sat, 25 Dec 2021 14:17:11 +0300 Subject: [PATCH] Global: Add a CSS style for disabled and loading profile buttons Groups: Add a loading animation --- Web/static/css/style.css | 14 ++++++++++++++ Web/static/img/loading_mini.gif | Bin 0 -> 246 bytes Web/static/js/openvk.cls.js | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100755 Web/static/img/loading_mini.gif diff --git a/Web/static/css/style.css b/Web/static/css/style.css index 10b5d37b..067d4eac 100644 --- a/Web/static/css/style.css +++ b/Web/static/css/style.css @@ -334,6 +334,20 @@ a { width: 150px; } +.profile_link.disable > a, .profile_link.disable { + cursor: not-allowed; + color: grey; +} + +.profile_link.loading > a::after, .profile_link.loading::after { + content: ""; + display: inline-block; + background-image: url('/assets/packages/static/openvk/img/loading_mini.gif'); + width: 30px; + height: 7px; + margin-left: 5px; +} + .page_footer { margin-left: 95px; padding-top: 5px; diff --git a/Web/static/img/loading_mini.gif b/Web/static/img/loading_mini.gif new file mode 100755 index 0000000000000000000000000000000000000000..f8115e79b1fca8bd746728e811c7c5e2171bc30f GIT binary patch literal 246 zcmZ?wbhEHbRAAs>n90P@GG~ixM&H4+HyIch6o0a?axpM7DE{a6a}5c0b_{Se(lcOY z1WM@uF#|{o1C!{S{*|ZS$}j3!-)E_NB*gq)abObkp6LJTZGmHaLF#s|-K zOey|w;-}V*9S94+YGlA_B&OsWA2=(usE0%I`GYB6WB%|+U+0ux(Tijt55hpOVu*pO gpaycv0bPvYJpP$8N{)rUE}i-ATI79?I93L00G5MC{r~^~ literal 0 HcmV?d00001 diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js index 13bdafc4..6d80626e 100644 --- a/Web/static/js/openvk.cls.js +++ b/Web/static/js/openvk.cls.js @@ -93,6 +93,9 @@ document.addEventListener("DOMContentLoaded", function() { //BEGIN let groupName = u(this).attr("data-group-name"); let groupUrl = u(this).attr("data-group-url"); let list = u('#_groupListPinnedGroups'); + + thisButton.nodes[0].classList.add('loading'); + thisButton.nodes[0].classList.add('disable'); let req = await ky(link); if(req.ok == false) { @@ -122,6 +125,9 @@ document.addEventListener("DOMContentLoaded", function() { //BEGIN if(list.nodes[0].children[0].className != "menu_divider" || list.nodes[0].children.length == 1) { list.nodes[0].children[0].remove(); } + + thisButton.nodes[0].classList.remove('loading'); + thisButton.nodes[0].classList.remove('disable'); return false; });