您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
自动滚动,图片集合,页面旋转,字体放大,去除浮动广告
当前为
// ==UserScript== // @name 手机看图、小说适配 // @namespace http://tampermonkey.net/ // @version 9.500.10.32 // @description 自动滚动,图片集合,页面旋转,字体放大,去除浮动广告 // @author You // @match *://*/* // @require https://cdn.bootcss.com/jquery/3.7.1/jquery.min.js // @run-at document-body // @grant GM_setValue // @grant GM_getValue // @license MIT // ==/UserScript== this.$ = this.jQuery = jQuery.noConflict(true); (function($) { 'use strict'; if (document.querySelector('.JqMA-btn-all') || $(".JqMA-btn-all", window.parent.document).length) { return; } function dqSlt(selectPath) { return $(document.querySelectorAll(selectPath)).add($(document.querySelectorAll('iframe')).contents().find(selectPath)); } function addCss(dom1, style1) { var id1 = "JqMA-" + Math.random().toString(36).replace(".", "") + Math.random().toString(36).replace(".", ""); dqSlt("head").append($("<style>").attr({ id: id1 }).html(`html body ${dom1}{${style1}}`)); return id1; } function removeCss(id1) { if (id1) { dqSlt("#" + id1).remove(); } } function uniqueArr(arr) { for (var i = 0; i < arr.length; i++) { for (var j = i + 1; j < arr.length; j++) { if (JSON.stringify(arr[i]) == JSON.stringify(arr[j])) { arr.splice(j, 1); j--; } } } return arr; } var DSImg = 1; var winWidth = parseInt(dqSlt("html").width()), winProp = window.innerHeight / window.innerWidth, winHeight = parseInt(winWidth * winProp); if (winHeight < 400 || winWidth < 200) { winWidth = 393; winHeight = 767; winProp = 767 / 393; } var winW = winWidth > winHeight ? winHeight * 0.6 : winWidth; var wHeight = winW * 0.1, SPicH = winWidth * 0.125, top = (winHeight - wHeight) * 0.5; var html_style = `html,body { overflow-wrap: break-word !important; scroll-behavior: auto !important; filter: none !important; min-height: ${winHeight}px !important; }`; var inner_style = `.JqMA-inner-all{ position: relative !important; z-index: 2147483646 !important; margin: 0 !important; border: 0 !important; padding: 0 !important; width: 100% !important; display: block !important; overflow-wrap: break-word !important; } .JqMA-inner-html { height: auto !important; } .JqMA-inner-pic, .JqMA-inner-word { height: auto !important; text-align: left !important; margin: ${0.2 * winHeight}px 0 ${0.2 * winHeight}px 0 !important; background: black !important; } .JqMA-inner-word { font-size: ${winW * 0.06}px !important; } .JqMA-inner-pic { font: 0 "Fira Sans", sans-serif !important; } .JqMA-inner-pic, .JqMA-inner-pic *:not(.JqMA-mark-pageNext) { box-sizing: border-box !important; border-radius: 0 !important; float: none !important; opacity: 1 !important; visibility: visible !important; filter: none !important; } .JqMA-inner-pic *{ overflow-wrap: break-word !important; margin: 0 !important; padding: 0 !important; position: static !important; } .JqMA-inner-pic *:not(a){ border: 0 !important; } .JqMA-inner-pic *::before, .JqMA-inner-pic *::after { display: none !important; } .JqMA-inner-pic picture, .JqMA-inner-pic img { display: inline-block !important; width: 100% !important; height: auto !important; user-select: none !important; object-fit: contain !important; background: gray !important; } .JqMA-inner-pic xmp, .JqMA-inner-pic a { color: #F2F2F2 !important; background: black !important; vertical-align: top !important; height: ${SPicH}px !important; overflow: hidden !important; font-size: ${winW * 0.05}px !important; line-height: 1.21 !important; cursor: pointer !important; } .JqMA-inner-pic a:visited { color: #741274 !important; } .JqMA-inner-pic xmp { display: none !important; white-space: pre-wrap !important; white-space: -moz-pre-wrap !important; white-space: -pre-wrap !important; white-space: -o-pre-wrap !important; word-wrap: break-word !important; text-align: inherit !important; width: 75% !important; } .JqMA-inner-pic a{ display: inline-block !important; user-select: none !important; width: 12.5% !important; text-align: center !important; text-decoration: none !important; border: 1px solid red !important; } .JqMA-btn-all, .JqMA-inner-all, .JqMA-inner-pic * { min-width: none !important; max-width: none !important; min-height: none !important; max-height: none !important; } .JqMA-btn-all { color: white !important; display: block !important; background:black !important; text-align: center !important; line-height: 2.8 !important; border-radius: 0 !important; cursor: pointer !important; user-select: none !important; z-index: 999999999999 !important; padding: 0 !important; border: 0 !important; font-weight: bold !important; filter: none !important; position: fixed !important; font-size: ${winW * 0.036}px !important; height: ${wHeight}px !important; width: ${wHeight}px !important; } `; var css_style = `.JqMA-css-blank { margin-top: ${1.5 * winHeight}px !important; } .JqMA-mark-pageNext, .pagetual_pageBar { display: block !important; height: 0 !important; min-height: none !important; margin: 0 !important; border: 0 !important; padding: 0 !important; overflow: hidden !important; } .JqMA-css-textBig,.JqMA-inner-word { text-align: left !important; text-indent: 2em !important; letter-spacing: normal !important; line-height: normal !important; filter: none !important; overflow-wrap: break-word !important; } .JqMA-css-textBig:not(a,a *),.JqMA-inner-word { color: #F2F2F2 !important; background-color: black !important; } .JqMA-css-colorG{ color: green !important; } .JqMA-css-yScroll{ overflow-y: scroll!important; } .JqMA-css-xScroll{ overflow-x: scroll!important; } .JqMA-css-hide_fix { display: none !important; top: 0 !important; } .JqMA-css-fixed { position: fixed !important; } .JqMA-inner-pic .JqMA-css-smallPic { width: 12.5% !important; height: ${SPicH}px !important; overflow: hidden !important; } .JqMA-css-transform,.JqMA-css-rotate { max-height: none !important; height: auto !important; padding-bottom: ${1.5 * winHeight}px !important; } .JqMA-css-transform { transform: translate(0%, 0%) !important; } html body .JqMA-css-xmpBlank { height: ${0.5 *SPicH}px !important; width: 100% !important; text-align: center !important; } .JqMA-css-rotate { float: right !important; position: relative !important; left: -100% !important; transform: rotateZ(-90deg) !important; transform-origin: 100% 0 !important; -webkit-transform: rotateZ(-90deg) !important; -webkit-transform-origin: 100% 0 !important; -moz-transform: rotateZ(-90deg) !important; -moz-transform-origin: 100% 0 !important; width: ${winHeight}px !important; min-width: none !important; max-width: none !important; }`; var jianG = wHeight; var left = 0, left2 = wHeight + left, left3 = wHeight + left2; var leftCss = "left:" + left + "px !important;", leftCss2 = "left:" + left2 + "px !important;", leftCss3 = "left:" + left3 + "px !important;"; var animateTime = 800, scrollNum = parseInt(winHeight * 6 * animateTime / 100000); if (!GM_getValue("scrollJu")) { GM_setValue("scrollJu", 5); } function locHost() { return window.location.host; } var scrollJu = GM_getValue("scrollJu"); if (!GM_getValue("picwh")) { GM_setValue("picwh", 50); } var picwh = locHost() == GM_getValue("picZ_locH") ? GM_getValue("picwh") : 50; function addInput(class1, value1, style1) { $(document.querySelector("html")).append($('<div>').attr({ class: "JqMA-btn-all " + class1, style: style1 + "px !important;" }).html(value1)); } addInput('JqMA-btn-del', 'X', leftCss + "top:" + (top)); addInput('JqMA-btn-width', 'W', leftCss + "top:" + (top - 1 * jianG)); addInput('JqMA-btn-pic', 'P', leftCss + "top:" + (top - 2 * jianG)); addInput('JqMA-btn-down', '▽', leftCss + "top:" + (top - 3 * jianG)); addInput('JqMA-btn-up', '△', leftCss + "top:" + (top - 4 * jianG)); addInput('JqMA-btn-scrollDiv', "O", leftCss + "top:" + (top - 5 * jianG)); addInput('JqMA-btn-search', "S", leftCss + "top:" + (top - 6 * jianG)); addInput('JqMA-btn-transform', "T", leftCss + "top:" + (top + jianG)); addInput('JqMA-btn-jia', '+', leftCss + "top:" + (top + 2 * jianG)); addInput('JqMA-btn-jian', '-', leftCss + "top:" + (top + 3 * jianG)); addInput('JqMA-btn-next', "N", leftCss + "top:" + (top + 4 * jianG)); addInput('JqMA-btn-picwh', picwh, leftCss + "top:" + (top + 5 * jianG)); addInput('JqMA-btn-Ju', scrollJu, leftCss2 + "top:" + (top)); function addInner() { if (!dqSlt(".JqMA-inner-html").length) { $(document.querySelector("body")).prepend($("<div>").attr({ class: "JqMA-mark-pageNext" })).prepend($("<div>").attr({ class: "JqMA-inner-html JqMA-inner-all" })); } } var domNums = []; setTimeout(function() { firstRun(); if (Dtransform == 1) { autoScrollBy(1.5 * winHeight); } setInterval(function() { var domNum_1 = dqSlt("*").length; if (domNums.indexOf(domNum_1) == -1) { domNums.push(domNum_1); firstRun(); } }, 2 * 1000); delHide(); }, 10); function firstRun() { dqSlt("img").one("load", function() { domNums = []; }); $(document.querySelector("body")).append(document.querySelectorAll( "html > *:not(head,.JqMA-btn-all,#pagetual-picker)" )).filter(function() { return $(this).css("overflow-y") == "hidden"; }).addClass("JqMA-css-yScroll"); $(document.querySelector("head:not(.JqMA-mark-addStyle)")).append( $("<style>").html(html_style + inner_style + css_style) ).addClass("JqMA-mark-addStyle"); dqSlt("head:not(.JqMA-mark-addStyle)").append( $("<style>").html(css_style) ).addClass("JqMA-mark-addStyle"); addInner(); if (widthN > 12) { fontInterFn(); } if (picZ) { imgInterFn(); } if (Dtransform) { transformFunc(); } dqSlt("html").off("click.clickScroll").on('click.clickScroll', function(event) { var _target = $(event.target); if (_target.is("a,a *")) { return; } var direction = 1; if (scrollJu < 0) { direction = -1; } if (_target.has(".JqMA-css-textBig").length || _target.is(".JqMA-css-textBig,.JqMA-css-textBig *")) { autoScrollBy(direction * 0.93 * (Drotate ? winWidth : winHeight)); } else if (_target.has("img,picture").length || _target.is("img,.JqMA-inner-pic *")) { if (_target.is("img:not(.JqMA-inner-pic *)") && _target.outerWidth() < 0.2 * winWidth) { return; } autoScrollBy(direction * 0.4 * (Drotate ? winWidth : winHeight)); } }); dqSlt("html").off("touchstart.stopPause").on("touchstart.stopPause", ":not(.JqMA-btn-move)", function() { if (Dscroll) { dqSlt(".JqMA-btn-Ju").trigger("click"); pauseScroll = 1; } }).off("touchend.stopPause").on("touchend.stopPause", function() { stopPause(); }); } var scrollDiv = 0; dqSlt("html").on('click', '.JqMA-btn-scrollDiv', function() { scrollDiv += 1; if (scrollDiv < 2) { dqSlt(".JqMA-btn-scrollDiv").addClass("JqMA-css-colorG"); } else { scrollDiv = 0; dqSlt(".JqMA-btn-scrollDiv").removeClass("JqMA-css-colorG"); } }); $.fn.slideScreen = function(_target, fn, trsTime) { var timeout_1; $(this).on('touchmove', _target, function(event) { if (timeout_1) { clearTimeout(timeout_1) } timeout_1 = setTimeout(function() { fn(event); }, trsTime ? trsTime : 500); }); } dqSlt("html").on('click', '.JqMA-btn-next', function() { var pageDom = dqSlt(".pagetual_pageBar,.JqMA-mark-pageNext,.JqMA-inner-word"); var offsetDiffs = []; pageDom.each(function() { var offsetD = -0.5 * (Drotate ? winWidth : winHeight); if (Drotate) { offsetD += $(this).offset().left - $(window).scrollLeft(); } else { offsetD += $(this).offset().top - $(window).scrollTop(); } if (offsetD > 1) { offsetDiffs.push(offsetD); } }); if (offsetDiffs.length) { offsetDiffs = offsetDiffs.sort(function(a, b) { return a - b; }); autoScrollBy(offsetDiffs[0]); dqSlt(".JqMA-btn-next").html(pageDom.length - offsetDiffs.length); } }).slideScreen('.JqMA-btn-next', function() { var pageDom = dqSlt(".pagetual_pageBar,.JqMA-mark-pageNext,.JqMA-inner-word"); var offsetDiffs = []; pageDom.each(function() { var offsetD = -0.5 * (Drotate ? winWidth : winHeight); if (Drotate) { offsetD += $(this).offset().left - $(window).scrollLeft(); } else { offsetD += $(this).offset().top - $(window).scrollTop(); } if (offsetD < -1) { offsetDiffs.push(offsetD) } }); if (offsetDiffs.length) { offsetDiffs = offsetDiffs.sort(function(a, b) { return b - a; }); autoScrollBy(offsetDiffs[0]); dqSlt(".JqMA-btn-next").html(offsetDiffs.length - 1); } }); function transformFunc() { $(document.querySelector("body")).addClass("JqMA-css-transform"); addInner(); dqSlt(".JqMA-inner-html").addClass("JqMA-css-blank"); if (Dtransform == 1) { dqSlt(":not(.JqMA-css-hide_fix,head *,.JqMA-btn-all,#pagetual-picker)").filter(function() { return /sticky|fixed/.test($(this).css("position")); }).addClass("JqMA-css-hide_fix JqMA-css-fixed"); } else { dqSlt(".JqMA-css-hide_fix").removeClass("JqMA-css-hide_fix"); dqSlt(":not(.JqMA-css-fixed,head *,.JqMA-btn-all,#pagetual-picker)").filter(function() { return /sticky/.test($(this).css("position")); }).addClass("JqMA-css-fixed"); } dqSlt(".JqMA-btn-transform").addClass("JqMA-css-colorG").html("T" + Dtransform); } if (!GM_getValue("Dtransform")) { GM_setValue("Dtransform", 0); } var Dtransform = locHost() == GM_getValue("Dtransform_locH") ? GM_getValue("Dtransform") : 0; dqSlt("html").on('click', '.JqMA-btn-transform', function() { Dtransform += 1; if (Dtransform < 3) { transformFunc(); if (Dtransform == 1) { autoScrollBy(1.5 * winHeight); } } else { Dtransform = 0; dqSlt(".JqMA-css-transform").removeClass("JqMA-css-transform"); dqSlt(".JqMA-css-fixed").removeClass("JqMA-css-fixed"); dqSlt(".JqMA-css-blank").removeClass("JqMA-css-blank"); autoScrollBy(-1.5 * winHeight); dqSlt(".JqMA-btn-transform").removeClass("JqMA-css-colorG").html("T"); } GM_setValue("Dtransform", Dtransform); GM_setValue("Dtransform_locH", locHost()); }); var Drotate = 0; dqSlt(".JqMA-btn-search").addClass("JqMA-css-colorG"); dqSlt("html").on('click', '.JqMA-btn-search', function() { DSImg += 1; if (DSImg == 2) { DSImg = 0; dqSlt(".JqMA-btn-search").removeClass("JqMA-css-colorG"); } else { dqSlt(".JqMA-btn-search").addClass("JqMA-css-colorG"); } if (picZ) { picZ -= 1; dqSlt(".JqMA-btn-pic").trigger("click"); } }).slideScreen('.JqMA-btn-search', function() { var _scrollTop = getScrollTop(), _scrollLeft = getScrollLeft(); autoScrollTo(0); Drotate += 1; if (Drotate < 2) { dqSlt("html,body,div").filter(function() { return $(this).css("overflow-y") != "hidden" && $(this).css("overflow-x") == "hidden" && $(this).height() > 0.5 * winHeight; }).addClass("JqMA-css-xScroll"); setTimeout(function() { $(document.querySelector('body')).addClass("JqMA-css-rotate"); autoScrollTo(_scrollTop * winProp); dqSlt('.JqMA-btn-all').each(function() { var _clone = $(this).clone().addClass("JqMA-btn-left") .css('margin-left', (winHeight * winProp - winWidth * 0.8) + "px"); _clone.appendTo(document.querySelector("html")); }); }, 100); } else { Drotate = 0; setTimeout(function() { dqSlt(".JqMA-css-rotate").removeClass("JqMA-css-rotate"); autoScrollTo(_scrollLeft / winProp); dqSlt(".JqMA-btn-left").remove(); }, 100); } }); function getScrollLeft() { return $(document.querySelector("html")).scrollLeft() + $(document.querySelector("body")).scrollLeft(); } function getScrollTop() { return $(document.querySelector("html")).scrollTop() + $(document.querySelector("body")).scrollTop(); } var pauseScroll = 0, Dpause; dqSlt(".JqMA-btn-Ju,.JqMA-btn-down,.JqMA-btn-up").addClass("JqMA-btn-move"); dqSlt("html").on('click', "a,.JqMA-btn-down,.JqMA-btn-up", function() { if (Dscroll) { dqSlt(".JqMA-btn-Ju").trigger("click"); } setTimeout(function() { if (Dscroll) { dqSlt(".JqMA-btn-Ju").trigger("click"); } }, 210); }); function stopPause() { if (pauseScroll == 1) { clearTimeout(Dpause); Dpause = setTimeout(function() { pauseScroll = 0; if (!Dscroll) { dqSlt(".JqMA-btn-Ju").trigger("click"); } }, 200); } } $(document).scroll(function() { stopPause(); }); function visibleDiv() { return dqSlt("div").filter(function() { return $(this).css("display") != "none" && $(this).css("overflow-y") != "hidden" && $(this).height() > 0.5 * winHeight; }); } function autoScrollBy(scrollBy_Ju, speed = 0) { if (scrollDiv) { visibleDiv().stop().animate({ scrollTop: "+=" + scrollBy_Ju + "px" }, speed, "linear"); } else { if (Drotate) { dqSlt("html,body").stop().animate({ scrollLeft: "+=" + scrollBy_Ju + "px" }, speed, "linear"); } else { dqSlt("html,body").stop().animate({ scrollTop: "+=" + scrollBy_Ju + "px" }, speed, "linear"); } } } function autoScrollTo(scrollTo_Ju, speed = 0) { if (scrollDiv) { visibleDiv().stop().animate({ scrollTop: scrollTo_Ju }, speed, "linear"); } else { if (Drotate) { dqSlt("html,body").stop().animate({ scrollLeft: scrollTo_Ju }, speed, "linear"); } else { dqSlt("html,body").stop().animate({ scrollTop: scrollTo_Ju }, speed, "linear"); } } } dqSlt("html").slideScreen('.JqMA-btn-width', function() { if (dqSlt(".JqMA-inner-word").length) { dqSlt(".JqMA-inner-word").remove(); dqSlt('.JqMA-btn-width').removeClass("JqMA-css-colorG"); } else { var allStr = ""; dqSlt(":not(head *,link,style,script,noscript)").each(function() { var addStr = $(this).clone().children().remove().end().text().replace(/\s+/g, " "); if (addStr.replace(/[^一-鿯0-9]/g, "").length > 6 && !/[^一-鿯]{99}/.test(addStr)) { allStr += "<br><br>"; } allStr += addStr + " "; }); addInner(); dqSlt(".JqMA-inner-html").prepend($("<div>").attr({ class: "JqMA-inner-word JqMA-inner-all" }).html(allStr)); dqSlt('.JqMA-btn-width').addClass("JqMA-css-colorG"); } }); var css_textImg, css_textBig; function fontInterFn() { var fSize = widthN > 12 ? parseInt(winWidth / widthN) : 0; dqSlt(":not(head *,link,style,script,noscript,.JqMA-css-textBig,.JqMA-inner-pic *,.JqMA-btn-all,#pagetual-picker *)").filter(function() { var textLen = $(this).clone().children().remove().end().text() .replace(/[0-9\s]+/g, "").length; if (textLen > 0 && $(this).outerWidth() > 0.5 * winWidth) { if (textLen > 50) { oldFont = parseInt($(this).css("font-size").replace("px", "")); } return true; } return false; }).addClass("JqMA-css-textBig"); var textBig = dqSlt(".JqMA-css-textBig"); removeCss(css_textBig); css_textBig = addCss(".JqMA-css-textBig", "font-size:" + fSize + "px !important;"); var _scale = fSize ? parseInt(fSize / oldFont * 100) / 100 : 1; var DShadow = "grayscale(100%) contrast(200%) brightness(1000%)"; removeCss(css_textImg); css_textImg = addCss(".JqMA-css-textImg", `transform: scale(${_scale}) !important; -webkit-transform: scale(${_scale}) !important; -moz-transform: scale(${_scale}) !important; margin: 0 ${_scale * 9 - 9}px !important; filter: ${DShadow} !important; -webkit-filter: ${DShadow} !important; -moz-filter: ${DShadow} !important;`) textBig.find("em:not(.JqMA-css-textBig),img").filter(function() { return ($(this).is("img") || $(this).css("background-image").split(/[""'']/).length > 1) && $(this).outerWidth() < 0.1 * winWidth; }).addClass("JqMA-css-textImg"); if (fSize) { dqSlt(".JqMA-btn-width").html(21 - widthN); } else { textBig.removeClass("JqMA-css-textBig"); dqSlt(".JqMA-css-textImg").removeClass("JqMA-css-textImg"); dqSlt(".JqMA-btn-width").html("W"); } } if (!GM_getValue("widthN")) { GM_setValue("widthN", 10); } var widthN = locHost() == GM_getValue("widthN_locH") ? GM_getValue("widthN") : 10; dqSlt("html").on('click', '.JqMA-btn-width', function() { oldFont = 22; widthN += 3; if (widthN > 16) { widthN -= 3 * 3; } fontInterFn(); GM_setValue("widthN", widthN); GM_setValue("widthN_locH", locHost()); }); function picSizeOut(_this, picwh_2 = null) { if ($(_this).is("xmp")) { return true; } var natureW = _this.naturalWidth; var natureH = _this.naturalHeight; if (!picwh_2) { picwh_2 = picwh; } return natureW >= picwh_2 && natureH >= picwh_2 && natureW / natureH <= 6; } dqSlt("html").on('click', ".JqMA-btn-picwh", function() { dqSlt(".JqMA-btn-all").each(function() { this.style.setProperty("display", "none", "important"); }); var _outStop = setTimeout(function() { dqSlt("html").off("click.picwh"); dqSlt(".JqMA-btn-all").each(function() { this.style.setProperty("display", "block", "important"); }); }, 3000); setTimeout(function() { dqSlt("html").on("click.picwh", function(event) { var _target = $(event.target); dqSlt("html").off("click.picwh"); dqSlt(".JqMA-btn-all").each(function() { this.style.setProperty("display", "block", "important"); }); clearTimeout(_outStop); if (_target.is(".JqMA-inner-pic img.JqMA-mark-imgLoaded")) { if (_target[0].naturalWidth < _target[0].naturalHeight) { picwh = _target[0].naturalWidth + 1; } else { picwh = _target[0].naturalHeight + 1; } if (picwh < 50) { picwh = 50; } } else { picwh = 50; } picImgFilter(); dqSlt(".JqMA-btn-picwh").html(picwh); locHost() == GM_getValue("picZ_locH") && GM_setValue("picwh", picwh); }); }, 100); }).slideScreen('.JqMA-btn-picwh', function() { picwh -= 50; if (picwh < 50) { picwh = 50; } picImgFilter(); dqSlt(".JqMA-btn-picwh").html(picwh); locHost() == GM_getValue("picZ_locH") && GM_setValue("picwh", picwh); }); function picImgFilter() { if (picZ == 1) { dqSlt(".JqMA-inner-pic br,.JqMA-inner-pic xmp").each(function() { this.style.setProperty("display", "none", "important"); }); dqSlt(".JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() { return picSizeOut(this); }).closest("picture").each(function() { $(this).nextAll("br,xmp").slice(0, 18).each(function() { this.style.setProperty("display", "inline-block", "important"); }); }).removeClass("JqMA-css-smallPic"); dqSlt(".JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() { return !picSizeOut(this); }).closest("picture").addClass("JqMA-css-smallPic"); } else { dqSlt(".JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() { return picSizeOut(this); }).closest("picture").each(function() { this.style.setProperty("display", "inline-block", "important"); }); dqSlt(".JqMA-inner-pic .JqMA-mark-imgLoaded").filter(function() { return !picSizeOut(this); }).closest("picture").each(function() { this.style.setProperty("display", "none", "important"); }); } } dqSlt("html").slideScreen('.JqMA-btn-pic', function() { if (picZ) { picZ -= 1; dqSlt(".JqMA-btn-pic").trigger("click"); } }); if (!GM_getValue("picZ")) { GM_setValue("picZ", 0); } var picZ = locHost() == GM_getValue("picZ_locH") ? GM_getValue("picZ") : 0; dqSlt("html").on('click', ".JqMA-btn-pic", function() { getImgArr(); GM_setValue("picZ", picZ); GM_setValue("picZ_locH", locHost()); GM_setValue("picwh", picwh); }); function getTrim(_str) { try { return _str.trim(); } catch (error) { return null; } } function getAttr(_this, _attr) { return $(_this).attr(_attr) ? getTrim($(_this).attr(_attr)) : null; } function testHref(_href) { return !/^javascript:|^#($|[A-Za-z_][A-Za-z0-9_]*$)/.test(_href); } function returnLength(lStr) { var limitLen = 9; if (picZ == 3) { limitLen = 0; } return lStr.replace(/[0-9\s]+/g, "").replace(/[一-龟]/g, "aa").length > limitLen; } function imgInterFn() { addInner(); if (!dqSlt(".JqMA-inner-pic").length) { dqSlt(".JqMA-inner-html").prepend($("<div>").attr({ class: "JqMA-inner-pic JqMA-inner-all" })); } dqSlt(".JqMA-btn-pic").addClass("JqMA-css-colorG").html("P" + picZ); var newImgArr = []; var _text = dqSlt("html").clone().find("head,link,style,script,noscript").remove().end().text() .match(/http.*?[.](xbm|tif|pjp|svgz|jpg|jpeg|ico|tiff|gif|svg|jfif|webp|png|bmp|pjpeg|avif)/g); if (picZ == 1 || picZ == 3) { dqSlt("a").filter(function() { return testHref(getAttr(this, "href")) && !/_blank/.test(getAttr(this, "target")); }).attr({ target: "_blank", rel: "noopener noreferrer" }).addClass("JqMA-mark-aNewPage"); } dqSlt(":not(picture *,.JqMA-inner-pic *)").filter(function() { return $(this).has("> img").length || $(this).is("a,img,iframe,[poster],.pagetual_pageBar") || $(this).css("background-image").split(/[""'']/).length > 1; }).filter(function() { var _imgOuter = $(this).prop("outerHTML"); if (preImgArr.indexOf(_imgOuter) == -1) { preImgArr.push(_imgOuter); return true; } else { return false; } }).each(function(inum, dom) { var dataObj = [], _img = $(this), _picStr = null, _imgStr = null; if (inum == 0 || (_img.is(".pagetual_pageBar") && inum > 9)) { newImgArr.push($("<div>").attr({ class: "JqMA-mark-pageNext" })); } if (picZ != 3) { if (inum == 0 && _text) { dataObj = dataObj.concat(_text); } if (_img.is("picture")) { _picStr = $("<picture>"); var _picChild; _img.children().each(function() { if ($(this).is("img")) { _picChild = $("<img>").attr({ width: "300", height: "100", alt: "JU-IMG", src: getAttr(this, "src"), }); } else { _picChild = $("<source>"); } _picStr.append(_picChild.attr({ srcset: getAttr(this, "srcset"), media: getAttr(this, "media"), type: getAttr(this, "type"), })); preImgArr.push(getAttr(this, "srcset")); preImgArr.push(getAttr(this, "src")); }); if (preImgArr.indexOf(_picStr.prop("outerHTML")) == -1) { preImgArr.push(_picStr.prop("outerHTML")); newImgArr.push(_picStr); } else { _picStr = null; } } var _backImg = _img.css("background-image").split(/[""'']/); dataObj.push(getAttr(_img, "src")); dataObj.push(getAttr(_img, "poster")); dataObj.push(_backImg.length > 1 ? _backImg[1] : null); if (DSImg != 0) { var _attributes = [], _data = Object.values(_img.data()); _attributes.push(_img[0].attributes); if (_img.is("picture")) { _img.children().each(function() { _attributes.push(this.attributes); _data = _data.concat(Object.values($(this).data())); }); } _attributes.forEach(function(attrs) { $.each(attrs, function(index, item) { if (!/^(src|style|srcset|class|id|type|href|onclick)$|^data-|^:/.test(item.name)) { _data.push(item.value); } }); }); _data.forEach(function(i) { if (typeof i == "object") { try { i = JSON.stringify(i); } catch (error) { return; } } else if (typeof i != "string") { return; } if (/[""'']|%22%2C/.test(i)) { var _isp = i.split(/[""'']|%22/).filter(function(j) { return j.length > 9 && /^http/.test(getTrim(j)); }); dataObj = dataObj.concat(_isp); } else { dataObj.push(i); } }); } dataObj = Array.from(new Set(dataObj)); dataObj.forEach(function(i) { if (typeof i != "string") { return } i = getTrim(i); try { i = decodeURIComponent(i); i = decodeURI(i); i = unescape(i); } catch (error) { console.log(error); } if (/^data:image/.test(i)) { i = i.replace(/[^A-Za-z0-9+/=>;]{0,9}$/, ""); } if (/^[a-z/]/.test(i) && /[?/]/.test(i) && !/[.](txt|shtml|html|htm)$/.test(i) && preImgArr.indexOf(i) == -1) { preImgArr.push(i); if (_img.is("iframe") || /\.(mp4|flv|f4v|webm|m4v|mov|3gp|3g2)(\?|$)/.test(i)) { if (picZ == 1) { _imgStr = $("<br>").attr({ style: "display: none !important;" }).add($("<a>").html(_img.is("iframe") ? "IFRAME" : "VIDEO").attr({ href: i, target: "_blank", rel: "noopener noreferrer", style: "width: 12.5% !important;" })).add($("<xmp>")).add($("<a>").html(_img.is("iframe") ? "IFRAME" : "VIDEO").attr({ href: i, target: "_blank", rel: "noopener noreferrer", style: "width: 12.5% !important;" })); } } else { _imgStr = $("<picture>").append($("<img>").attr({ src: i, loading: "lazy", alt: "JU-IMG", width: "300", height: "100", srcset: getAttr(_img, "srcset") })); } newImgArr.push(_imgStr); } }); } if (_imgStr || _picStr || (picZ == 3 && _img.is("a"))) { var _a = _img.find("a").first(); if (!_a.length) { _a = _img.closest("a"); } var _img_2 = _img; for (var i = 0; i < 9; i++) { if (_a.length || _img_2.is("body")) { break; } else { _a = _img_2.siblings("a").first(); if (!_a.length) { _a = _img_2.siblings().find("a").first(); } _img_2 = _img_2.parent(); } } var _newA = $("<a>").html("IMG"); var _imgText = _img.clone().find("head,link,style,script,noscript").remove().end().text(); var _pStr = (_img.attr("alt") && returnLength(_img.attr("alt")) ? _img.attr("alt") : _img.attr("title") ? _img.attr("title") : returnLength(_imgText) ? _imgText : ""); var _aHref = null; if (_a.length) { _aHref = getAttr(_a, "href"); var _a_2 = _a; for (var i = 0; i < 9; i++) { if (picZ == 3 || _pStr != "" || _a_2.is("body")) { break } else { _imgText = _a_2.clone().find("head,link,style,script,noscript").remove().end().text(); _pStr = (_a_2.attr("title") ? _a_2.attr("title") : returnLength(_imgText) ? _imgText : ""); _a_2 = _a_2.parent(); } } _newA.on("click", function() { _a.trigger("click"); }); if (_aHref) { _newA.attr({ href: _aHref }); if (testHref(_aHref)) { _newA.attr({ target: "_blank", rel: "noopener noreferrer" }); } var hrefImg = _aHref.match(/http.*?[.](xbm|tif|pjp|svgz|jpg|jpeg|ico|tiff|gif|svg|jfif|webp|png|bmp|pjpeg|avif)/g); if (DSImg != 0 && hrefImg && picZ != 3) { hrefImg = hrefImg[0]; try { hrefImg = decodeURIComponent(hrefImg); hrefImg = decodeURI(hrefImg); hrefImg = unescape(hrefImg); } catch (error) { console.log(error); } if (preImgArr.indexOf(hrefImg) == -1) { preImgArr.push(hrefImg); _imgStr = $("<picture>").append($("<img>").attr({ src: hrefImg, loading: "lazy", alt: "JU-IMG", width: "300", height: "100", srcset: getAttr(_img, "srcset") })); newImgArr.push(_imgStr); } } } } if (!(_a.length && _aHref && testHref(_aHref))) { _newA.on("click", function() { _img.trigger("click"); }); } _pStr = getTrim(_pStr).replace(/\s+/g, " ").substring(0, 99); if (picZ == 1 || (picZ == 3 && preImgArr.indexOf(_pStr) == -1)) { preImgArr.push(_pStr); if (picZ == 3) { newImgArr.push($("<xmp>").addClass("JqMA-css-xmpBlank")); } newImgArr.push($("<br>").attr("style", "display: none !important;")); newImgArr.push(_newA); newImgArr.push($("<xmp>").html(_pStr)); newImgArr.push(_newA.clone(true).attr("class", "JqMA-clone-a")); } } }); newImgArr = Array.from(new Set(newImgArr)); if (newImgArr.toString() != imgArr.toString() && newImgArr.length > 1) { var newArrEx = newImgArr.filter(function(n) { return imgArr.indexOf(n) == -1; }); imgArr = imgArr.concat(newArrEx); dqSlt(".JqMA-inner-pic").append(newArrEx); dqSlt(".JqMA-inner-pic img").off("error.imgError").on("error.imgError", function() { if (getAttr(this, "src").indexOf("=http") > -1) { $(this).attr("src", getAttr(this, "src").replace(/(?<==http.*?)&.*$/, "").replace(/^.*=(?=http)/, "")); } if (picZ == 1 && !/^data:image/.test(getAttr(this, "src"))) { $(this).closest("picture").addClass("JqMA-css-smallPic"); } else { $(this).closest("picture").each(function() { this.style.setProperty("display", "none", "important"); }); } }); dqSlt(".JqMA-inner-pic img:not(.JqMA-mark-imgLoaded)").on("load", function() { $(this).addClass("JqMA-mark-imgLoaded"); if (picSizeOut(this)) { if (picZ == 1) { $(this).closest("picture").removeClass("JqMA-css-smallPic") .nextAll("br,xmp").slice(0, 18).each(function() { this.style.setProperty("display", "inline-block", "important"); }); } else { $(this).closest("picture").each(function() { this.style.setProperty("display", "inline-block", "important"); }); } } else { if (picZ == 1) { $(this).closest("picture").addClass("JqMA-css-smallPic"); } else { $(this).closest("picture").each(function() { this.style.setProperty("display", "none", "important"); }); } } }); } if (picZ == 3) { dqSlt(".JqMA-inner-pic xmp,.JqMA-inner-pic br").each(function() { this.style.setProperty("display", "inline-block", "important"); }); } } var imgArr = [], preImgArr = []; function getImgArr() { dqSlt(".JqMA-inner-pic").remove(); dqSlt(".JqMA-mark-aNewPage").removeClass("JqMA-mark-aNewPage").removeAttr("target rel"); picZ += 1; if (picZ < 4) { imgArr = []; preImgArr = []; imgInterFn(); } else { dqSlt(".JqMA-btn-pic").removeClass("JqMA-css-colorG").html("P"); picZ = 0; } } var pageX = []; dqSlt("html").on('click', '.JqMA-btn-down', function() { pageX.unshift([getScrollLeft(), getScrollTop()]); var toHs = []; $(document.querySelectorAll("body > *:not(link,style,script,noscript)")).each(function() { var toH = -0.5 * (Drotate ? winWidth : winHeight); if (Drotate) { toH += $(this).offset().left - $(window).scrollLeft(); } else { toH += $(this).offset().top - $(window).scrollTop(); } toH += $(this).outerHeight(); toHs.push(toH); }); if (!scrollDiv && toHs.length) { toHs.sort(function(a, b) { return b - a; }); autoScrollBy(toHs[0]); } else { autoScrollBy(1000 * winHeight); } }).slideScreen('.JqMA-btn-down,.JqMA-btn-up', function() { if (pageX.length) { pageX = uniqueArr(pageX); autoScrollTo(Drotate ? pageX[0][0] : pageX[0][1]); pageX.splice(0, 1); } }); dqSlt("html").on('click', '.JqMA-btn-up', function() { pageX.unshift([getScrollLeft(), getScrollTop()]); if (scrollDiv) { autoScrollBy(-1000 * winHeight); return; } if (Dtransform) { autoScrollTo(1.5 * winHeight); } else { autoScrollTo(0); } }); function delHide() { dqSlt(".JqMA-btn-all").each(function() { this.style.setProperty("display", "none", "important"); }); dqSlt(".JqMA-btn-del").each(function() { this.style.setProperty("opacity", "0.3", "important"); this.style.setProperty("display", "block", "important"); }); Dhide = 1; } var Dhide = 0; dqSlt("html").on('click', '.JqMA-btn-del', function() { if (!Dhide) { delHide(); } else { Dhide = 0; dqSlt(".JqMA-btn-all").each(function() { this.style.setProperty("opacity", "0.6", 'important'); this.style.setProperty("display", "block", "important"); }); } }).slideScreen('.JqMA-btn-del', function() { dqSlt(".JqMA-btn-all").each(function() { this.style.setProperty("opacity", "0.1", 'important'); }); Dhide = 1; }); dqSlt("html").on('click', '.JqMA-btn-jia', function() { scrollJu += 1; if (scrollJu * scrollNum > winHeight - 20) { scrollJu = 0; } dqSlt(".JqMA-btn-Ju").html(scrollJu); }).slideScreen('.JqMA-btn-jia', function() { scrollJu += 5; if (scrollJu * scrollNum > winHeight - 20) { scrollJu = 0; } dqSlt(".JqMA-btn-Ju").html(scrollJu); }); dqSlt("html").on('click', '.JqMA-btn-jian', function() { scrollJu -= 1; if (-scrollJu * scrollNum > winHeight - 20) { scrollJu = 0; } dqSlt(".JqMA-btn-Ju").html(scrollJu); }).slideScreen('.JqMA-btn-jian', function() { scrollJu -= 5; if (-scrollJu * scrollNum > winHeight - 20) { scrollJu = 0; } dqSlt(".JqMA-btn-Ju").html(scrollJu); }); var Dscroll = 0, timeDown; dqSlt("html").on('click', '.JqMA-btn-Ju', function() { Dscroll += 1; clearInterval(timeDown); if (Dscroll < 2) { dqSlt(".JqMA-btn-Ju").addClass("JqMA-css-colorG"); autoScrollBy(scrollJu * scrollNum, Math.abs(scrollJu * scrollNum) > 0.5 * winHeight ? 0 : animateTime); timeDown = setInterval(function() { autoScrollBy(scrollJu * scrollNum, Math.abs(scrollJu * scrollNum) > 0.5 * winHeight ? 0 : animateTime); }, animateTime + 10); } else { Dscroll = 0; dqSlt("html,body").stop(); visibleDiv().stop(); dqSlt(".JqMA-btn-Ju").removeClass("JqMA-css-colorG"); } GM_setValue("scrollJu", scrollJu); }).slideScreen('.JqMA-btn-Ju', function() { scrollJu = -scrollJu; dqSlt(".JqMA-btn-Ju").html(scrollJu); GM_setValue("scrollJu", scrollJu); }); })(this.jQuery);