update 2023-03-21 10:14:08

This commit is contained in:
github-actions[bot] 2023-03-21 10:14:08 +08:00
parent aabc8e5d1b
commit 39e1b9fefb
3 changed files with 46 additions and 42 deletions

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Design Theme
LUCI_DEPENDS:=
PKG_VERSION:=5.5.4
PKG_RELEASE:=20230320
PKG_VERSION:=5.5.5
PKG_RELEASE:=20230321
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -1,43 +1,47 @@
(function ($) {
const global = $('head #global-scroll');
const isMobile = /phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);
function settingGlobalScroll() {
if (!isMobile && global.length === 0) {
const style = document.createElement('style');
style.id = 'global-scroll';
style.textContent = `::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }`;
$('head').append(style);
} else if (isMobile && global.length > 0) {
global.remove();
const global = $('head #global-scroll');
const isMobile = /phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);
function settingGlobalScroll() {
if (!isMobile && global.length === 0) {
const style = document.createElement('style');
style.id = 'global-scroll';
style.textContent = `::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }`;
$('head').append(style);
} else if (isMobile && global.length > 0) {
global.remove();
}
}
document.addEventListener("DOMContentLoaded", function () {
// Fixed scrollbar styles for browsers on different platforms
settingGlobalScroll();
if (self.location.pathname.includes("status/realtime")) {
const nodeStatusRealtime = $('.node-status-realtime');
// .node-status-realtime embed[src="/luci-static/resources/bandwidth.svg"] + div + br + table
// .node-status-realtime embed[src="/luci-static/resources/wifirate.svg"] + div + br + table
// .node-status-realtime embed[src="/luci-static/resources/wireless.svg"] + div + br + table
const selectorValues = ['bandwidth', 'wifirate', 'wireless'];
for (let i = 0; i < selectorValues.length; i++) {
const value = selectorValues[i];
const target = nodeStatusRealtime.find(`embed[src="/luci-static/resources/${value}.svg"] + div + br + table`);
if (target.length) {
const div = document.createElement('div');
div.style.overflowX = 'auto';
target.before(div);
const newTarget = target.clone();
target.remove();
div.appendChild(newTarget[0]);
}
}
}
const nodeStatusRealtime = $('.node-status-realtime');
});
$(document).ready(() => {
// Fixed scrollbar styles for browsers on different platforms
settingGlobalScroll();
// .node-status-realtime embed[src="/luci-static/resources/bandwidth.svg"] + div + br + table
// .node-status-realtime embed[src="/luci-static/resources/wifirate.svg"] + div + br + table
// .node-status-realtime embed[src="/luci-static/resources/wireless.svg"] + div + br + table
const selectorValues = ['bandwidth', 'wifirate', 'wireless'];
selectorValues.forEach(value => {
const target = nodeStatusRealtime.find(`embed[src="/luci-static/resources/${value}.svg"] + div + br + table`);
if (target.length) {
const div = document.createElement('div');
div.style.overflowX = 'auto';
target.before(div);
const newTarget = target.clone();
target.remove();
div.appendChild(newTarget[0]);
}
});
});
// Fixed scrollbar styles for browsers on different platforms
$(window).resize(() => {
settingGlobalScroll();
});
})(jQuery);
// Fixed scrollbar styles for browsers on different platforms
$(window).resize(() => {
settingGlobalScroll();
});
})(jQuery);

View File

@ -1,2 +1,2 @@
(function($){const global=$('head #global-scroll');const isMobile=/phone|pad|pod|iPhone|iPod|ios|iOS|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent);function settingGlobalScroll(){if(!isMobile&&global.length===0){const style=document.createElement('style');style.id='global-scroll';style.textContent=`::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: var(--scrollbarColor); border-radius: 2px; }`;$('head').append(style);}else if(isMobile&&global.length>0){global.remove();}}
const nodeStatusRealtime=$('.node-status-realtime');$(document).ready(()=>{settingGlobalScroll();const selectorValues=['bandwidth','wifirate','wireless'];selectorValues.forEach(value=>{const target=nodeStatusRealtime.find(`embed[src="/luci-static/resources/${value}.svg"] + div + br + table`);if(target.length){const div=document.createElement('div');div.style.overflowX='auto';target.before(div);const newTarget=target.clone();target.remove();div.appendChild(newTarget[0]);}});});$(window).resize(()=>{settingGlobalScroll();});})(jQuery);
document.addEventListener("DOMContentLoaded",function(){settingGlobalScroll();if(self.location.pathname.includes("status/realtime")){const nodeStatusRealtime=$('.node-status-realtime');const selectorValues=['bandwidth','wifirate','wireless'];for(let i=0;i<selectorValues.length;i++){const value=selectorValues[i];const target=nodeStatusRealtime.find(`embed[src="/luci-static/resources/${value}.svg"] + div + br + table`);if(target.length){const div=document.createElement('div');div.style.overflowX='auto';target.before(div);const newTarget=target.clone();target.remove();div.appendChild(newTarget[0]);}}}});$(window).resize(()=>{settingGlobalScroll();});})(jQuery);