User:Skyeye fast/common.js

/* Thanks Xiaoyujun, Dianliang233, Lakejason0, MysticNebula70, Hatsuki kiri, SteveZihang, and Lxazl5770 */

// // Wikiplus mw.loader.load('https://wikiplus-app.com/Main.min.js');

// InPageEdit Canary mw.loader.load('https://cdn.jsdelivr.net/gh/dianliang233/inpageedit-v2@patch-1/script.js'); $(function{ $('#ca-view').after( $('',{     id:'ca-quick-edit',      class:'collapsible'    }).append(      $(' ').append( $('',{         href: 'javascript:void(0)'        }) .text('IPE') .click(function{         InPageEdit.edit({ page: mw.config.get('wgPageName'), revision: mw.config.get('wgRevisionId') });       })      )    )  ); });

// JavaScriptWikiBrowser mw.loader.load("https://cdn.jsdelivr.net/gh/dianliang233/dianliang-personal-js-css@master/JWB/load.js");

// Popups mw.loader.load("https://cdn.jsdelivr.net/gh/dianliang233/dianliang-personal-js-css@master/Popups.js"); //// Popups Config window.popupStructure = "menus";

// Sprite Editor mw.loader.load("https://cdn.jsdelivr.net/gh/dianliang233/dianliang-personal-js-css@master/SpriteEditor/Load.js");

// SchnarkSyntaxHighlight mw.loader.load("https://cdn.jsdelivr.net/gh/dianliang233/dianliang-personal-js-css@master/SchnarkSyntaxHighlight.js");

// Clear move/delete reason document.getElementById("wpReason").value = "";

// HotCat mw.loader.load("https://cdn.jsdelivr.net/gh/dianliang233/dianliang-personal-js-css@master/HotCat.js");

// WikiEditor Toolbar mw.loader.load('https://minecraft-zh.gamepedia.com/index.php?title=User:SteveZihang/edittools.js&action=raw&ctype=text/javascript');

mw.loader.load("https://mwashfds.github.io/fds/libs/wmlib.dev.js"); mw.loader.load('https://mwashfds.github.io/mediawiki/gamepedia/ui_translate_zh-CN.js'); mw.loader.load('https://mwashfds.github.io/mediawiki/gamepedia/adremover.dev.js');

/* This imports the latest version of previewTab from Terraria: https://terraria.gamepedia.com/MediaWiki:Gadget-previewTab.css */ //import css before js to reduce CSS Flash $('head').first.append('');

/* This imports the latest version of previewTab from Terraria: https://terraria.gamepedia.com/MediaWiki:Gadget-previewTab.js */ mw.loader.load('https://terraria.gamepedia.com/index.php?title=MediaWiki:Gadget-previewTab.js&action=raw&ctype=text/javascript');

// codeLinks mw.loader.load("https://minecraft.gamepedia.com/index.php?title=User:Majr/codeLinks.js&action=raw&ctype=text/javascript");

// watchlist-log-localization mw.loader.load("https://minecraft-zh.gamepedia.com/index.php?title=User:Dianliang233/js/watchlist-log-localization.js&action=raw&ctype=text/javascript");

// Counter (function($) {       function bytecount(text) {            text = text.replace(/[\u0000-\u007F]/g, '.');            text = text.replace(/[\u0080-\u07FF\uD800-\uDFFF]/g, '..');            text = text.replace(/[\u0800-\uD7FF\uE000-\uFFFF]/g, '...');            return text.length;        };        function cjkcount(text) {            text = text.replace(/\./g, );            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, '.');            text = text.replace(/[^\.]/g, );            return text.length;        };        function getwcbytext(text) {            return text.length + ' character(s) (' + cjkcount(text) + ' CJK) ' +               bytecount(text) + ' byte(s) in UTF-8 encoding'; };       function getsel { if (!window.getSelection) return ''; return getSelection.toString; };       function dowc(event) { $('.wordcount').remove; // or remove after text.length == 0 checking? var text = getsel; if (text.length == 0) return; var divj = $(' ').html(getwcbytext(text)) .css({                   'position': 'fixed',                    'right': '0',                    'bottom': '0',                    'margin': '4px',                    'padding': '6px'                }) .addClass('wordcount ui-state-highlight ui-corner-all') .appendTo('body'); // we hook keyup, so this may make it flickering // eg when shift, ctrl.etc key up               //.hide.fadeIn('slow'); setTimeout(function {               divj.fadeOut('slow');            }, 5000); };       $(document).mouseup(dowc).keyup(dowc); })(jQuery); //