User:Chlod/Scripts/WordCount

WordCount
AuthorsGoldenRing, Chlod
Statusworks
UpdatedMarch 29, 2022; 4 years ago (2022-03-29)
Browsersall except (maybe) Internet Explorer 11? haven't tested
SkinsAll skins
SourceUser:Chlod/Scripts/WordCount.js

WordCount is a continuation of GoldenRing's User:GoldenRing/wordcount.js, with some minor tweaks and fixes.

Instead of a direct insert into the p-cactions portlet links, it will use the built-in mw.util.addPortletLink function, fixing the issue where the portlet link no longer appears. In addition, the script will try its best to match any Unicode letter (including letters and characters from other scripts) instead of just Latin alphabet characters (with no accents). Because of this, ことば, 言語, 언어, and بطة are all counted as words now. Despite this, words still need to be separated by whitespace in order to be counted as a word (so 僕の犬は本当にかわいいですようね~ would be considered one word). Such functionality is only because of newer browser technologies, and the script will automatically fall back to counting plain old Latin letters if the features aren't available (e.g. on very old Internet Explorer versions).

This script will not consider text hidden by a strikethrough in the total letter count. It will also automatically enable on Wikipedia:Arbitration/Requests/Case.

Installation

To install the script, add this to your common.js file.

mw.loader.load( '/w/index.php?title=User:Chlod/Scripts/WordCount.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Chlod/Scripts/WordCount.js]]

Source

The source can be found at User:Chlod/Scripts/WordCount.js. The script is licensed under the CC BY-SA 3.0 License.

Discussion

You may visit my talk page if you have any concerns.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.