From 7948412d7b688ecbd631b630338dae48f49050d0 Mon Sep 17 00:00:00 2001 From: the1812 Date: Wed, 5 Dec 2018 15:39:11 +0800 Subject: [PATCH] Check webkit prefix --- bilibili-evolved.offline.user.js | 2 +- bilibili-evolved.preview-offline.user.js | 2 +- min/gui-settings.min.js | 2 +- utils/gui-settings/gui-settings.js | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bilibili-evolved.offline.user.js b/bilibili-evolved.offline.user.js index 711853da5..03f654a05 100644 --- a/bilibili-evolved.offline.user.js +++ b/bilibili-evolved.offline.user.js @@ -892,7 +892,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.html"] = ``; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/version.txt"] = `1.6.4`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/icons.min.css"] = `.icons-enabled [class^=icon-]{width:24px;height:24px;display:inline-block;}.icons-enabled [class^=icon-]::after{content:"";width:24px;height:24px;display:inline-block;}.icons-enabled .icon-view::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-clear::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-download::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-update::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-info::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-settings::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-widgets::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-cancel::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-ok::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-video::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-style::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-tool::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-touch::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-other::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-arrow::after{background-image:url('data:image/svg+xml;utf-8,')}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(t,e)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={forceWideMinWidth:t=>t,customStyleColor:e=>{const n=e.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(e.length<7){return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`}else{return e}}else{return t.customStyleColor}},blurBackgroundOpacity:e=>{const n=e.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const t=parseFloat(e);if(t>=0&&t<=1){return e}}return t.blurBackgroundOpacity},defaultPlayerMode:e=>{if(["常规","宽屏","网页全屏"].indexOf(e)!==-1){return e}return t.defaultPlayerMode}};function o(t){let e=t.nextElementSibling;const n=[];while(e!==null&&!e.classList.contains("category")){n.push(e);e=e.nextElementSibling}return n}function s(t,e){const n=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const t={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}else{return e}}i.darkScheduleStart=(e=>s(e,t.darkScheduleStart));i.darkScheduleEnd=(e=>s(e,t.darkScheduleEnd));function c(t,e){const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e}i.blurBackgroundOpacity=(e=>c(e,t.blurBackgroundOpacity));i.customControlBackgroundOpacity=(e=>c(e,t.customControlBackgroundOpacity));function r(t,e,n){$(`input[type='checkbox'][key='${t}']`).prop("checked",n);$(`input[type='text'][key='${t}']`).val(n)}function a(){for(const e in t){r(e,undefined,t[e])}}function u(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const t=i.customStyleColor($("input[key='customStyleColor']").val());const n=e.color.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`)});$("input[type='text'][key]").each((e,n)=>{$(n).attr("placeholder",t[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const t=$(".predefined-colors");t.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",t=>{t.currentTarget.classList.toggle("folded");o(t.currentTarget).forEach(t=>t.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",t=>{$(t.currentTarget).parent().toggleClass("opened")});onSettingsChange(r)}function l(){const e=()=>{$("input[type='checkbox'][key]").each((e,n)=>{t[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((e,n)=>{const o=$(n);const s=o.attr("key");const c=i[s](o.val());t[s]=c;o.val(c)});saveSettings(t)};$("input[type='checkbox'][key]").on("change",()=>e());$("input[type='text'][key]").on("change",()=>e())}function d(){const t={};$(`input[dependencies]`).each((e,n)=>{const i=$(n).attr("dependencies");if(i){t[$(n).attr("key")]=i}});const e=e=>{const n=e.prop("checked");for(const i in t){const o=t[i].split(" ");if(o.indexOf(e.attr("key"))!==-1){let t=true;if(n&&o.every(t=>$(`input[key='${t}']`).prop("checked"))){t=false}const e=$(`li:has(input[key='${i}'])`);const s=t?"addClass":"removeClass";e[s]("disabled");$(`input[key='${i}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",t=>e($(t.target))).each((t,n)=>e($(n)))}function g(t){if($(".gui-settings").length===0){t.append(`
\n
\n \n
\n
\n \n
\n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-box,.gui-settings-mask").addClass("opened")});$(".gui-settings-widgets").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-mask").addClass("opened")})}e.applyStyle("guiSettingsStyle")}function p(){const t=$(".predefined-colors-grid");for(const e of Object.values(n)){$(`
`).appendTo(t).css("background",e).attr("data-color",e).on("click",t=>{$(`input[key='customStyleColor']`).val($(t.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function h(){if(t.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function y(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function f(){$(".gui-settings-content ul li.category").each((t,e)=>{$(e).click()})}function k(){if(!CSS.supports("backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);t.blurVideoControl=false;saveSettings(t)}}g($("body"));const b=e.data.guiSettingsDom.text;if(b){$("body").append(b);u();y();a();d();p();l();f();k()}new SpinQuery(()=>$("body"),t=>t.length>0&&!(unsafeWindow.parent.window===unsafeWindow),t=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(t,e)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={forceWideMinWidth:t=>t,customStyleColor:e=>{const n=e.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(e.length<7){return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`}else{return e}}else{return t.customStyleColor}},blurBackgroundOpacity:e=>{const n=e.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const t=parseFloat(e);if(t>=0&&t<=1){return e}}return t.blurBackgroundOpacity},defaultPlayerMode:e=>{if(["常规","宽屏","网页全屏"].indexOf(e)!==-1){return e}return t.defaultPlayerMode}};function o(t){let e=t.nextElementSibling;const n=[];while(e!==null&&!e.classList.contains("category")){n.push(e);e=e.nextElementSibling}return n}function s(t,e){const n=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const t={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}else{return e}}i.darkScheduleStart=(e=>s(e,t.darkScheduleStart));i.darkScheduleEnd=(e=>s(e,t.darkScheduleEnd));function c(t,e){const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e}i.blurBackgroundOpacity=(e=>c(e,t.blurBackgroundOpacity));i.customControlBackgroundOpacity=(e=>c(e,t.customControlBackgroundOpacity));function r(t,e,n){$(`input[type='checkbox'][key='${t}']`).prop("checked",n);$(`input[type='text'][key='${t}']`).val(n)}function a(){for(const e in t){r(e,undefined,t[e])}}function u(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const t=i.customStyleColor($("input[key='customStyleColor']").val());const n=e.color.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`)});$("input[type='text'][key]").each((e,n)=>{$(n).attr("placeholder",t[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const t=$(".predefined-colors");t.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",t=>{t.currentTarget.classList.toggle("folded");o(t.currentTarget).forEach(t=>t.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",t=>{$(t.currentTarget).parent().toggleClass("opened")});onSettingsChange(r)}function l(){const e=()=>{$("input[type='checkbox'][key]").each((e,n)=>{t[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((e,n)=>{const o=$(n);const s=o.attr("key");const c=i[s](o.val());t[s]=c;o.val(c)});saveSettings(t)};$("input[type='checkbox'][key]").on("change",()=>e());$("input[type='text'][key]").on("change",()=>e())}function d(){const t={};$(`input[dependencies]`).each((e,n)=>{const i=$(n).attr("dependencies");if(i){t[$(n).attr("key")]=i}});const e=e=>{const n=e.prop("checked");for(const i in t){const o=t[i].split(" ");if(o.indexOf(e.attr("key"))!==-1){let t=true;if(n&&o.every(t=>$(`input[key='${t}']`).prop("checked"))){t=false}const e=$(`li:has(input[key='${i}'])`);const s=t?"addClass":"removeClass";e[s]("disabled");$(`input[key='${i}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",t=>e($(t.target))).each((t,n)=>e($(n)))}function p(t){if($(".gui-settings").length===0){t.append(`
\n
\n \n
\n
\n \n
\n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-box,.gui-settings-mask").addClass("opened")});$(".gui-settings-widgets").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-mask").addClass("opened")})}e.applyStyle("guiSettingsStyle")}function g(){const t=$(".predefined-colors-grid");for(const e of Object.values(n)){$(`
`).appendTo(t).css("background",e).attr("data-color",e).on("click",t=>{$(`input[key='customStyleColor']`).val($(t.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function h(){if(t.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function y(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function k(){$(".gui-settings-content ul li.category").each((t,e)=>{$(e).click()})}function f(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);t.blurVideoControl=false;saveSettings(t)}}p($("body"));const b=e.data.guiSettingsDom.text;if(b){$("body").append(b);u();y();a();d();g();l();k();f()}new SpinQuery(()=>$("body"),t=>t.length>0&&!(unsafeWindow.parent.window===unsafeWindow),t=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-styles.min.js"] = (()=>{return(l,e)=>{if(l.useDarkStyle){e.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),l=>l.removeClass("custom-scrollbar"));if($("#banner_link").length===0||$("#banner_link").length>0&&l.overrideNavBar&&!l.showBanner){e.applyImportantStyle("darkStyleNavBar")}e.applyStyle("darkStyle");e.applyImportantStyle("darkStyleImportant")}else{$("#bilibili-scrollbar-style,#bilibili-new-style-dark-nav-bar,#bilibili-new-style-dark,#bilibili-new-style-dark-important").remove()}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/new-styles.min.js"] = (()=>{return(e,t)=>{if(document.URL===`https://h.bilibili.com/`){return}SpinQuery.any(()=>$(".custom-scrollbar"),e=>e.removeClass("custom-scrollbar"));const l={selectors:["div.nav-con.fl","#link-navbar-vm",".link-navbar",".nav-header-wrapper",".z_top .z_header"],get allSelectors(){return this.selectors.reduce((e,t)=>e+","+t)},get navbar(){let e=null;for(const t of this.selectors){e=e||document.querySelector(t)}return e},supports(e){if(e instanceof Element){const t=parseInt(window.getComputedStyle(e).height);const l=[60,50,0,56];return l.indexOf(t)!==-1}return false}};SpinQuery.any(()=>$(l.allSelectors),()=>{const e=l.navbar;if(l.supports(e)){t.applyStyle("style","bilibili-style-optimization")}else{t.applyStyle("oldStyle","bilibili-style-optimization")}})}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/override-navbar.min.js"] = (()=>{return(e,t)=>{new SpinQuery(()=>$(".head-content.bili-wrapper>div.search").not(".filter-item"),e=>e.length>0&&$(".nav-con.fr").length>0,e=>{e.detach().insertAfter($(document.querySelector(".nav-con.fr")))}).start()}})(); diff --git a/bilibili-evolved.preview-offline.user.js b/bilibili-evolved.preview-offline.user.js index 01b39f78a..b105bb127 100644 --- a/bilibili-evolved.preview-offline.user.js +++ b/bilibili-evolved.preview-offline.user.js @@ -892,7 +892,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.html"] = ``; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/version.txt"] = `1.6.4`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/icons.min.css"] = `.icons-enabled [class^=icon-]{width:24px;height:24px;display:inline-block;}.icons-enabled [class^=icon-]::after{content:"";width:24px;height:24px;display:inline-block;}.icons-enabled .icon-view::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-clear::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-download::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-update::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-info::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-settings::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-widgets::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-cancel::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-ok::after{background-image:url('data:image/svg+xml;utf-8,');}.icons-enabled .icon-video::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-style::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-tool::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-touch::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-other::after{background-image:url('data:image/svg+xml;utf-8, ');}.icons-enabled .icon-arrow::after{background-image:url('data:image/svg+xml;utf-8,')}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(t,e)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={forceWideMinWidth:t=>t,customStyleColor:e=>{const n=e.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(e.length<7){return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`}else{return e}}else{return t.customStyleColor}},blurBackgroundOpacity:e=>{const n=e.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const t=parseFloat(e);if(t>=0&&t<=1){return e}}return t.blurBackgroundOpacity},defaultPlayerMode:e=>{if(["常规","宽屏","网页全屏"].indexOf(e)!==-1){return e}return t.defaultPlayerMode}};function o(t){let e=t.nextElementSibling;const n=[];while(e!==null&&!e.classList.contains("category")){n.push(e);e=e.nextElementSibling}return n}function s(t,e){const n=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const t={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}else{return e}}i.darkScheduleStart=(e=>s(e,t.darkScheduleStart));i.darkScheduleEnd=(e=>s(e,t.darkScheduleEnd));function c(t,e){const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e}i.blurBackgroundOpacity=(e=>c(e,t.blurBackgroundOpacity));i.customControlBackgroundOpacity=(e=>c(e,t.customControlBackgroundOpacity));function r(t,e,n){$(`input[type='checkbox'][key='${t}']`).prop("checked",n);$(`input[type='text'][key='${t}']`).val(n)}function a(){for(const e in t){r(e,undefined,t[e])}}function u(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const t=i.customStyleColor($("input[key='customStyleColor']").val());const n=e.color.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`)});$("input[type='text'][key]").each((e,n)=>{$(n).attr("placeholder",t[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const t=$(".predefined-colors");t.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",t=>{t.currentTarget.classList.toggle("folded");o(t.currentTarget).forEach(t=>t.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",t=>{$(t.currentTarget).parent().toggleClass("opened")});onSettingsChange(r)}function l(){const e=()=>{$("input[type='checkbox'][key]").each((e,n)=>{t[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((e,n)=>{const o=$(n);const s=o.attr("key");const c=i[s](o.val());t[s]=c;o.val(c)});saveSettings(t)};$("input[type='checkbox'][key]").on("change",()=>e());$("input[type='text'][key]").on("change",()=>e())}function d(){const t={};$(`input[dependencies]`).each((e,n)=>{const i=$(n).attr("dependencies");if(i){t[$(n).attr("key")]=i}});const e=e=>{const n=e.prop("checked");for(const i in t){const o=t[i].split(" ");if(o.indexOf(e.attr("key"))!==-1){let t=true;if(n&&o.every(t=>$(`input[key='${t}']`).prop("checked"))){t=false}const e=$(`li:has(input[key='${i}'])`);const s=t?"addClass":"removeClass";e[s]("disabled");$(`input[key='${i}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",t=>e($(t.target))).each((t,n)=>e($(n)))}function g(t){if($(".gui-settings").length===0){t.append(`
\n
\n \n
\n
\n \n
\n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-box,.gui-settings-mask").addClass("opened")});$(".gui-settings-widgets").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-mask").addClass("opened")})}e.applyStyle("guiSettingsStyle")}function p(){const t=$(".predefined-colors-grid");for(const e of Object.values(n)){$(`
`).appendTo(t).css("background",e).attr("data-color",e).on("click",t=>{$(`input[key='customStyleColor']`).val($(t.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function h(){if(t.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function y(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function f(){$(".gui-settings-content ul li.category").each((t,e)=>{$(e).click()})}function k(){if(!CSS.supports("backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);t.blurVideoControl=false;saveSettings(t)}}g($("body"));const b=e.data.guiSettingsDom.text;if(b){$("body").append(b);u();y();a();d();p();l();f();k()}new SpinQuery(()=>$("body"),t=>t.length>0&&!(unsafeWindow.parent.window===unsafeWindow),t=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(t,e)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={forceWideMinWidth:t=>t,customStyleColor:e=>{const n=e.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(e.length<7){return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`}else{return e}}else{return t.customStyleColor}},blurBackgroundOpacity:e=>{const n=e.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const t=parseFloat(e);if(t>=0&&t<=1){return e}}return t.blurBackgroundOpacity},defaultPlayerMode:e=>{if(["常规","宽屏","网页全屏"].indexOf(e)!==-1){return e}return t.defaultPlayerMode}};function o(t){let e=t.nextElementSibling;const n=[];while(e!==null&&!e.classList.contains("category")){n.push(e);e=e.nextElementSibling}return n}function s(t,e){const n=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const t={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}else{return e}}i.darkScheduleStart=(e=>s(e,t.darkScheduleStart));i.darkScheduleEnd=(e=>s(e,t.darkScheduleEnd));function c(t,e){const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e}i.blurBackgroundOpacity=(e=>c(e,t.blurBackgroundOpacity));i.customControlBackgroundOpacity=(e=>c(e,t.customControlBackgroundOpacity));function r(t,e,n){$(`input[type='checkbox'][key='${t}']`).prop("checked",n);$(`input[type='text'][key='${t}']`).val(n)}function a(){for(const e in t){r(e,undefined,t[e])}}function u(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const t=i.customStyleColor($("input[key='customStyleColor']").val());const n=e.color.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`)});$("input[type='text'][key]").each((e,n)=>{$(n).attr("placeholder",t[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const t=$(".predefined-colors");t.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",t=>{t.currentTarget.classList.toggle("folded");o(t.currentTarget).forEach(t=>t.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",t=>{$(t.currentTarget).parent().toggleClass("opened")});onSettingsChange(r)}function l(){const e=()=>{$("input[type='checkbox'][key]").each((e,n)=>{t[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((e,n)=>{const o=$(n);const s=o.attr("key");const c=i[s](o.val());t[s]=c;o.val(c)});saveSettings(t)};$("input[type='checkbox'][key]").on("change",()=>e());$("input[type='text'][key]").on("change",()=>e())}function d(){const t={};$(`input[dependencies]`).each((e,n)=>{const i=$(n).attr("dependencies");if(i){t[$(n).attr("key")]=i}});const e=e=>{const n=e.prop("checked");for(const i in t){const o=t[i].split(" ");if(o.indexOf(e.attr("key"))!==-1){let t=true;if(n&&o.every(t=>$(`input[key='${t}']`).prop("checked"))){t=false}const e=$(`li:has(input[key='${i}'])`);const s=t?"addClass":"removeClass";e[s]("disabled");$(`input[key='${i}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",t=>e($(t.target))).each((t,n)=>e($(n)))}function p(t){if($(".gui-settings").length===0){t.append(`
\n
\n \n
\n
\n \n
\n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-box,.gui-settings-mask").addClass("opened")});$(".gui-settings-widgets").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-mask").addClass("opened")})}e.applyStyle("guiSettingsStyle")}function g(){const t=$(".predefined-colors-grid");for(const e of Object.values(n)){$(`
`).appendTo(t).css("background",e).attr("data-color",e).on("click",t=>{$(`input[key='customStyleColor']`).val($(t.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function h(){if(t.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function y(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function k(){$(".gui-settings-content ul li.category").each((t,e)=>{$(e).click()})}function f(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);t.blurVideoControl=false;saveSettings(t)}}p($("body"));const b=e.data.guiSettingsDom.text;if(b){$("body").append(b);u();y();a();d();g();l();k();f()}new SpinQuery(()=>$("body"),t=>t.length>0&&!(unsafeWindow.parent.window===unsafeWindow),t=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-styles.min.js"] = (()=>{return(l,e)=>{if(l.useDarkStyle){e.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),l=>l.removeClass("custom-scrollbar"));if($("#banner_link").length===0||$("#banner_link").length>0&&l.overrideNavBar&&!l.showBanner){e.applyImportantStyle("darkStyleNavBar")}e.applyStyle("darkStyle");e.applyImportantStyle("darkStyleImportant")}else{$("#bilibili-scrollbar-style,#bilibili-new-style-dark-nav-bar,#bilibili-new-style-dark,#bilibili-new-style-dark-important").remove()}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/new-styles.min.js"] = (()=>{return(e,t)=>{if(document.URL===`https://h.bilibili.com/`){return}SpinQuery.any(()=>$(".custom-scrollbar"),e=>e.removeClass("custom-scrollbar"));const l={selectors:["div.nav-con.fl","#link-navbar-vm",".link-navbar",".nav-header-wrapper",".z_top .z_header"],get allSelectors(){return this.selectors.reduce((e,t)=>e+","+t)},get navbar(){let e=null;for(const t of this.selectors){e=e||document.querySelector(t)}return e},supports(e){if(e instanceof Element){const t=parseInt(window.getComputedStyle(e).height);const l=[60,50,0,56];return l.indexOf(t)!==-1}return false}};SpinQuery.any(()=>$(l.allSelectors),()=>{const e=l.navbar;if(l.supports(e)){t.applyStyle("style","bilibili-style-optimization")}else{t.applyStyle("oldStyle","bilibili-style-optimization")}})}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/override-navbar.min.js"] = (()=>{return(e,t)=>{new SpinQuery(()=>$(".head-content.bili-wrapper>div.search").not(".filter-item"),e=>e.length>0&&$(".nav-con.fr").length>0,e=>{e.detach().insertAfter($(document.querySelector(".nav-con.fr")))}).start()}})(); diff --git a/min/gui-settings.min.js b/min/gui-settings.min.js index c2d46605b..d0b23a48e 100644 --- a/min/gui-settings.min.js +++ b/min/gui-settings.min.js @@ -1 +1 @@ -(()=>{return(t,e)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={forceWideMinWidth:t=>t,customStyleColor:e=>{const n=e.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(e.length<7){return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`}else{return e}}else{return t.customStyleColor}},blurBackgroundOpacity:e=>{const n=e.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const t=parseFloat(e);if(t>=0&&t<=1){return e}}return t.blurBackgroundOpacity},defaultPlayerMode:e=>{if(["常规","宽屏","网页全屏"].indexOf(e)!==-1){return e}return t.defaultPlayerMode}};function o(t){let e=t.nextElementSibling;const n=[];while(e!==null&&!e.classList.contains("category")){n.push(e);e=e.nextElementSibling}return n}function s(t,e){const n=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const t={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}else{return e}}i.darkScheduleStart=(e=>s(e,t.darkScheduleStart));i.darkScheduleEnd=(e=>s(e,t.darkScheduleEnd));function c(t,e){const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e}i.blurBackgroundOpacity=(e=>c(e,t.blurBackgroundOpacity));i.customControlBackgroundOpacity=(e=>c(e,t.customControlBackgroundOpacity));function r(t,e,n){$(`input[type='checkbox'][key='${t}']`).prop("checked",n);$(`input[type='text'][key='${t}']`).val(n)}function a(){for(const e in t){r(e,undefined,t[e])}}function u(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const t=i.customStyleColor($("input[key='customStyleColor']").val());const n=e.color.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`)});$("input[type='text'][key]").each((e,n)=>{$(n).attr("placeholder",t[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const t=$(".predefined-colors");t.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",t=>{t.currentTarget.classList.toggle("folded");o(t.currentTarget).forEach(t=>t.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",t=>{$(t.currentTarget).parent().toggleClass("opened")});onSettingsChange(r)}function l(){const e=()=>{$("input[type='checkbox'][key]").each((e,n)=>{t[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((e,n)=>{const o=$(n);const s=o.attr("key");const c=i[s](o.val());t[s]=c;o.val(c)});saveSettings(t)};$("input[type='checkbox'][key]").on("change",()=>e());$("input[type='text'][key]").on("change",()=>e())}function d(){const t={};$(`input[dependencies]`).each((e,n)=>{const i=$(n).attr("dependencies");if(i){t[$(n).attr("key")]=i}});const e=e=>{const n=e.prop("checked");for(const i in t){const o=t[i].split(" ");if(o.indexOf(e.attr("key"))!==-1){let t=true;if(n&&o.every(t=>$(`input[key='${t}']`).prop("checked"))){t=false}const e=$(`li:has(input[key='${i}'])`);const s=t?"addClass":"removeClass";e[s]("disabled");$(`input[key='${i}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",t=>e($(t.target))).each((t,n)=>e($(n)))}function g(t){if($(".gui-settings").length===0){t.append(`
\n
\n \n
\n
\n \n
\n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-box,.gui-settings-mask").addClass("opened")});$(".gui-settings-widgets").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-mask").addClass("opened")})}e.applyStyle("guiSettingsStyle")}function p(){const t=$(".predefined-colors-grid");for(const e of Object.values(n)){$(`
`).appendTo(t).css("background",e).attr("data-color",e).on("click",t=>{$(`input[key='customStyleColor']`).val($(t.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function h(){if(t.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function y(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function f(){$(".gui-settings-content ul li.category").each((t,e)=>{$(e).click()})}function k(){if(!CSS.supports("backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);t.blurVideoControl=false;saveSettings(t)}}g($("body"));const b=e.data.guiSettingsDom.text;if(b){$("body").append(b);u();y();a();d();p();l();f();k()}new SpinQuery(()=>$("body"),t=>t.length>0&&!(unsafeWindow.parent.window===unsafeWindow),t=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); \ No newline at end of file +(()=>{return(t,e)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={forceWideMinWidth:t=>t,customStyleColor:e=>{const n=e.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(e.length<7){return`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`}else{return e}}else{return t.customStyleColor}},blurBackgroundOpacity:e=>{const n=e.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const t=parseFloat(e);if(t>=0&&t<=1){return e}}return t.blurBackgroundOpacity},defaultPlayerMode:e=>{if(["常规","宽屏","网页全屏"].indexOf(e)!==-1){return e}return t.defaultPlayerMode}};function o(t){let e=t.nextElementSibling;const n=[];while(e!==null&&!e.classList.contains("category")){n.push(e);e=e.nextElementSibling}return n}function s(t,e){const n=t.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const t={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(t);return`${t.hour}:${t.minute<10?"0"+t.minute:t.minute}`}else{return e}}i.darkScheduleStart=(e=>s(e,t.darkScheduleStart));i.darkScheduleEnd=(e=>s(e,t.darkScheduleEnd));function c(t,e){const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e}i.blurBackgroundOpacity=(e=>c(e,t.blurBackgroundOpacity));i.customControlBackgroundOpacity=(e=>c(e,t.customControlBackgroundOpacity));function r(t,e,n){$(`input[type='checkbox'][key='${t}']`).prop("checked",n);$(`input[type='text'][key='${t}']`).val(n)}function a(){for(const e in t){r(e,undefined,t[e])}}function u(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const t=i.customStyleColor($("input[key='customStyleColor']").val());const n=e.color.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`)});$("input[type='text'][key]").each((e,n)=>{$(n).attr("placeholder",t[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const t=$(".predefined-colors");t.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",t=>{t.currentTarget.classList.toggle("folded");o(t.currentTarget).forEach(t=>t.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",t=>{$(t.currentTarget).parent().toggleClass("opened")});onSettingsChange(r)}function l(){const e=()=>{$("input[type='checkbox'][key]").each((e,n)=>{t[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((e,n)=>{const o=$(n);const s=o.attr("key");const c=i[s](o.val());t[s]=c;o.val(c)});saveSettings(t)};$("input[type='checkbox'][key]").on("change",()=>e());$("input[type='text'][key]").on("change",()=>e())}function d(){const t={};$(`input[dependencies]`).each((e,n)=>{const i=$(n).attr("dependencies");if(i){t[$(n).attr("key")]=i}});const e=e=>{const n=e.prop("checked");for(const i in t){const o=t[i].split(" ");if(o.indexOf(e.attr("key"))!==-1){let t=true;if(n&&o.every(t=>$(`input[key='${t}']`).prop("checked"))){t=false}const e=$(`li:has(input[key='${i}'])`);const s=t?"addClass":"removeClass";e[s]("disabled");$(`input[key='${i}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",t=>e($(t.target))).each((t,n)=>e($(n)))}function p(t){if($(".gui-settings").length===0){t.append(`
\n
\n \n
\n
\n \n
\n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-box,.gui-settings-mask").addClass("opened")});$(".gui-settings-widgets").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-mask").addClass("opened")})}e.applyStyle("guiSettingsStyle")}function g(){const t=$(".predefined-colors-grid");for(const e of Object.values(n)){$(`
`).appendTo(t).css("background",e).attr("data-color",e).on("click",t=>{$(`input[key='customStyleColor']`).val($(t.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function h(){if(t.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function y(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function k(){$(".gui-settings-content ul li.category").each((t,e)=>{$(e).click()})}function f(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);t.blurVideoControl=false;saveSettings(t)}}p($("body"));const b=e.data.guiSettingsDom.text;if(b){$("body").append(b);u();y();a();d();g();l();k();f()}new SpinQuery(()=>$("body"),t=>t.length>0&&!(unsafeWindow.parent.window===unsafeWindow),t=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); \ No newline at end of file diff --git a/utils/gui-settings/gui-settings.js b/utils/gui-settings/gui-settings.js index d80dffa7c..25a711282 100644 --- a/utils/gui-settings/gui-settings.js +++ b/utils/gui-settings/gui-settings.js @@ -300,7 +300,8 @@ } function checkCompatibility() { - if (!CSS.supports("backdrop-filter", "blur(24px)")) + if (!CSS.supports("backdrop-filter", "blur(24px)") + && !CSS.supports("-webkit-backdrop-filter", "blur(24px)")) { $("input[key=blurVideoControl]").prop("disabled", true); settings.blurVideoControl = false;