<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://zh.enter-politics.com/index.php?action=history&amp;feed=atom&amp;title=User%3AKomacyaN%2Fjs%2FWordcount.js</id>
	<title>User:KomacyaN/js/Wordcount.js - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://zh.enter-politics.com/index.php?action=history&amp;feed=atom&amp;title=User%3AKomacyaN%2Fjs%2FWordcount.js"/>
	<link rel="alternate" type="text/html" href="https://zh.enter-politics.com/index.php?title=User:KomacyaN/js/Wordcount.js&amp;action=history"/>
	<updated>2026-07-11T20:20:35Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://zh.enter-politics.com/index.php?title=User:KomacyaN/js/Wordcount.js&amp;diff=10660&amp;oldid=prev</id>
		<title>白龙：建立内容为“(function($) {         function bytecount(text) {             text = text.replace(/[\u0000-\u007F]/g, '.');             text = text.replace(/[\u0080-\u07FF\uD800-…”的新页面</title>
		<link rel="alternate" type="text/html" href="https://zh.enter-politics.com/index.php?title=User:KomacyaN/js/Wordcount.js&amp;diff=10660&amp;oldid=prev"/>
		<updated>2022-10-31T10:18:13Z</updated>

		<summary type="html">&lt;p&gt;建立内容为“(function($) {         function bytecount(text) {             text = text.replace(/[\u0000-\u007F]/g, &amp;#039;.&amp;#039;);             text = text.replace(/[\u0080-\u07FF\uD800-…”的新页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;(function($) {&lt;br /&gt;
        function bytecount(text) {&lt;br /&gt;
            text = text.replace(/[\u0000-\u007F]/g, '.');&lt;br /&gt;
            text = text.replace(/[\u0080-\u07FF\uD800-\uDFFF]/g, '..');&lt;br /&gt;
            text = text.replace(/[\u0800-\uD7FF\uE000-\uFFFF]/g, '...');&lt;br /&gt;
            return text.length;&lt;br /&gt;
        };&lt;br /&gt;
        function cjkcount(text) {&lt;br /&gt;
            text = text.replace(/\./g, '');&lt;br /&gt;
            text = text.replace(/[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FCC\uF900-\uFA6D\uFA70-\uFAD9]|[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/g, '.');&lt;br /&gt;
            text = text.replace(/[^\.]/g, '');&lt;br /&gt;
            return text.length;&lt;br /&gt;
        };&lt;br /&gt;
        function getwcbytext(text) {&lt;br /&gt;
            return text.length + ' character(s) (' + cjkcount(text) + ' CJK)&amp;lt;br /&amp;gt;' +&lt;br /&gt;
                bytecount(text) + ' byte(s) in UTF-8 encoding';&lt;br /&gt;
        };&lt;br /&gt;
        function getsel() {&lt;br /&gt;
            if (!window.getSelection) return '';&lt;br /&gt;
            return getSelection().toString();&lt;br /&gt;
        };&lt;br /&gt;
        function dowc(event) {&lt;br /&gt;
            $('.wordcount').remove(); // or remove after text.length == 0 checking?&lt;br /&gt;
            var text = getsel();&lt;br /&gt;
            if (text.length == 0) return;&lt;br /&gt;
            var divj = $('&amp;lt;div&amp;gt;').html(getwcbytext(text))&lt;br /&gt;
                .css({&lt;br /&gt;
                    'position': 'fixed',&lt;br /&gt;
                    'left': '0',&lt;br /&gt;
                    'bottom': '0',&lt;br /&gt;
                    'margin': '6px',&lt;br /&gt;
                    'padding': '8px',&lt;br /&gt;
                    &amp;quot;color&amp;quot;: &amp;quot;whitesmoke&amp;quot;,&lt;br /&gt;
                    &amp;quot;background&amp;quot;: &amp;quot;rgb(255,165,0)&amp;quot;,&lt;br /&gt;
                    &amp;quot;border&amp;quot;: &amp;quot;transparent&amp;quot;,&lt;br /&gt;
                    &amp;quot;z-index&amp;quot;: &amp;quot;100&amp;quot;&lt;br /&gt;
                })&lt;br /&gt;
                .addClass('wordcount ui-state-highlight ui-corner-all')&lt;br /&gt;
                .appendTo('body');&lt;br /&gt;
                // we hook keyup, so this may make it flickering&lt;br /&gt;
                // eg when shift, ctrl.etc key up&lt;br /&gt;
                //.hide().fadeIn('slow');&lt;br /&gt;
            setTimeout(function() {&lt;br /&gt;
                divj.fadeOut('slow');&lt;br /&gt;
            }, 6666);&lt;br /&gt;
        };&lt;br /&gt;
        $(document).mouseup(dowc).keyup(dowc);&lt;br /&gt;
    })(jQuery);&lt;br /&gt;
//改自星海姐的[[User:星海子/js/Wordcount.js]]，仅修改颜色。&lt;/div&gt;</summary>
		<author><name>白龙</name></author>
	</entry>
</feed>