<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://library.hmoegirl.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-heimu-toggle.js</id>
	<title>MediaWiki:Gadget-heimu-toggle.js - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://library.hmoegirl.com/index.php?action=history&amp;feed=atom&amp;title=MediaWiki%3AGadget-heimu-toggle.js"/>
	<link rel="alternate" type="text/html" href="https://library.hmoegirl.com/index.php?title=MediaWiki:Gadget-heimu-toggle.js&amp;action=history"/>
	<updated>2026-07-27T23:01:07Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://library.hmoegirl.com/index.php?title=MediaWiki:Gadget-heimu-toggle.js&amp;diff=45&amp;oldid=prev</id>
		<title>艾代米尔：​创建页面，内容为“// &lt;pre&gt; (function() {     function heimu_toggle() {         if (!$(&#039;.heimu, .colormu&#039;)[0] || $(&#039;#heimu_toggle&#039;)[0]) return;         $(&quot;.colormu&quot;).each(function() {             this.dataset.backgroundColor = $(this).css(&quot;background-color&quot;);         });         var body = document.body,             html = document.documentElement;         var innerWidth = window.innerWidth;         var scrollbarWidth;         switch (&quot;scroll&quot;) {             case getComputedStyle…”</title>
		<link rel="alternate" type="text/html" href="https://library.hmoegirl.com/index.php?title=MediaWiki:Gadget-heimu-toggle.js&amp;diff=45&amp;oldid=prev"/>
		<updated>2026-07-24T10:01:42Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“// &amp;lt;pre&amp;gt; (function() {     function heimu_toggle() {         if (!$(&amp;#039;.heimu, .colormu&amp;#039;)[0] || $(&amp;#039;#heimu_toggle&amp;#039;)[0]) return;         $(&amp;quot;.colormu&amp;quot;).each(function() {             this.dataset.backgroundColor = $(this).css(&amp;quot;background-color&amp;quot;);         });         var body = document.body,             html = document.documentElement;         var innerWidth = window.innerWidth;         var scrollbarWidth;         switch (&amp;quot;scroll&amp;quot;) {             case getComputedStyle…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;// &amp;lt;pre&amp;gt;&lt;br /&gt;
(function() {&lt;br /&gt;
    function heimu_toggle() {&lt;br /&gt;
        if (!$(&amp;#039;.heimu, .colormu&amp;#039;)[0] || $(&amp;#039;#heimu_toggle&amp;#039;)[0]) return;&lt;br /&gt;
        $(&amp;quot;.colormu&amp;quot;).each(function() {&lt;br /&gt;
            this.dataset.backgroundColor = $(this).css(&amp;quot;background-color&amp;quot;);&lt;br /&gt;
        });&lt;br /&gt;
        var body = document.body,&lt;br /&gt;
            html = document.documentElement;&lt;br /&gt;
        var innerWidth = window.innerWidth;&lt;br /&gt;
        var scrollbarWidth;&lt;br /&gt;
        switch (&amp;quot;scroll&amp;quot;) {&lt;br /&gt;
            case getComputedStyle(body).overflowY:&lt;br /&gt;
                scrollbarWidth = innerWidth - body.clientWidth;&lt;br /&gt;
                break;&lt;br /&gt;
            case getComputedStyle(html).overflowY:&lt;br /&gt;
                scrollbarWidth = innerWidth - html.clientWidth;&lt;br /&gt;
                break;&lt;br /&gt;
            default:&lt;br /&gt;
                var backup = body.style.overflowY;&lt;br /&gt;
                body.style.overflowY = &amp;quot;scroll&amp;quot;;&lt;br /&gt;
                scrollbarWidth = innerWidth - body.clientWidth;&lt;br /&gt;
                body.style.overflowY = backup;&lt;br /&gt;
        }&lt;br /&gt;
        var btn = $(&amp;#039;&amp;lt;div/&amp;gt;&amp;#039;, {&lt;br /&gt;
            id: &amp;#039;heimu_toggle&amp;#039;,&lt;br /&gt;
            text: &amp;#039;半隐黑幕&amp;#039;,&lt;br /&gt;
            css: {&lt;br /&gt;
                &amp;#039;user-select&amp;#039;: &amp;#039;none&amp;#039;,&lt;br /&gt;
            },&lt;br /&gt;
        }).appendTo(document.body).on(&amp;#039;click&amp;#039;, function() {&lt;br /&gt;
            if ($(&amp;#039;body.heimu_toggle_on&amp;#039;)[0]) $(this).text(&amp;#039;半隐黑幕&amp;#039;);&lt;br /&gt;
            else $(this).text(&amp;#039;隐藏黑幕&amp;#039;);&lt;br /&gt;
            $(document.body).toggleClass(&amp;#039;heimu_toggle_on&amp;#039;);&lt;br /&gt;
            $(&amp;quot;.colormu&amp;quot;).each(function() {&lt;br /&gt;
                if ($(this).hasClass(&amp;quot;colormu_toggle_on&amp;quot;)) {&lt;br /&gt;
                    $(this).removeClass(&amp;quot;colormu_toggle_on&amp;quot;);&lt;br /&gt;
                    $(this).css(&amp;quot;background-color&amp;quot;, this.dataset.backgroundColor);&lt;br /&gt;
                } else {&lt;br /&gt;
                    $(this).addClass(&amp;quot;colormu_toggle_on&amp;quot;);&lt;br /&gt;
                    $(this).css(&amp;quot;background-color&amp;quot;, this.dataset.backgroundColor.replace(&amp;quot;rgb&amp;quot;, &amp;quot;rgba&amp;quot;).replace(&amp;quot;)&amp;quot;, &amp;quot;, .17)&amp;quot;));&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        });&lt;br /&gt;
        if (scrollbarWidth === 0) {&lt;br /&gt;
            btn.css(&amp;quot;right&amp;quot;, &amp;quot;20px&amp;quot;); // 修复新版 Chrome 的自动隐藏式滚动条导致的按钮被覆盖 chrome://flags/#overlay-scrollbars&lt;br /&gt;
        }&lt;br /&gt;
        if ($(&amp;#039;.backToTop&amp;#039;)[0]) $(window).on(&amp;#039;scroll&amp;#039;, function() {&lt;br /&gt;
            $(document).scrollTop() &amp;gt; 0 ? btn.css(&amp;#039;bottom&amp;#039;, &amp;#039;193px&amp;#039;) : btn.css(&amp;#039;bottom&amp;#039;, &amp;#039;100px&amp;#039;);&lt;br /&gt;
        }).scroll();&lt;br /&gt;
        if (mw.config.get(&amp;#039;AnnToolsHeimuToggleDefaultOn&amp;#039;)) btn.click();&lt;br /&gt;
        else mw.config.set(&amp;#039;AnnToolsHeimuToggleDefaultOn&amp;#039;, true);&lt;br /&gt;
    }&lt;br /&gt;
    setInterval(heimu_toggle, 3000);&lt;br /&gt;
})();&lt;br /&gt;
// &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>艾代米尔</name></author>
	</entry>
</feed>