跳转到内容

User:Liangent/common.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
/*
if (window.require === undefined) {
    (function($) {
        var scripts = {'': null};
        window.require = function(files, callback) { // or load anything, eg. css?
            if (!$.isArray(files)) files = [files];
            if (!$.isFunction(callback)) callback = function() {};
            if (files.length != 0) {
                if (files[0].data === undefined) files[0] = {data: new String(files[0])};
                // so data is always ok now.
                if (files[0].src === undefined) files[0].src = 'lib';
                if (files[0].src == 'lib') {
                    files[0].src = 'wiki';
                    var dataLocation = {
                        morebits: 'User:Jimmy_xu_wrk/Friendly/morebits.js',
                        mediawiki: 'User:Liangent/Scripts/Libraries/MediaWiki.js',
                        jqueryui: 'User:Liangent/Scripts/Libraries/jquery-ui.min.js',
                        jquery_cookie: 'User:Liangent/Scripts/Libraries/jquery.cookie.min.js',
                        jquery: ''
                    }[files[0].data];
                    if (dataLocation === undefined) throw files[0].data + ' cannot be found';
                    files[0].data = dataLocation;
                }
                if (files[0].src == 'wiki') {
                    files[0].src = 'uri';
                    if (files[0].data.length != 0) {
                        files[0].data = wgScript + '?title=' + encodeURIComponent(files[0].data) + '&action=raw&ctype=text/javascript';
                    }
                }
                if (files[0].src == 'uri' || files[0].src == 'url') {
                    var ready = function() {
                        window.require(files.slice(1), callback);
                    };
                    if (scripts[files[0].data] === undefined) {
                        scripts[files[0].data] = [ready];
                        $.getScript(files[0].data, function() {
                            var callbacks = scripts[files[0].data];
                            // must do this first. because we have already loaded the script,
                            // new functions pushed into callbacks in callback() will be never executed.
                            // setting scripts[files[0].data] to null stops functions from being
                            // added to callbacks.
                            scripts[files[0].data] = null;
                            $.each(callbacks, function() {
                                this();
                            });
                        });
                    } else if ($.isArray(scripts[files[0].data])) {
                        scripts[files[0].data].push(ready);
                    } else {
                        ready();
                    }
                } else {
                    throw files[0].src + ' is unsupported';
                }
            } else {
                callback();
            }
        };
    })(jQuery);
}
*/
//importScriptURI('/w/extensions/UsabilityInitiative/Resources/jquery.js');
//importStylesheetURI('//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/redmond/jquery-ui.css');
//importScript('User:Liangent/Gadgets/Toolkit/sixdeg.js');
//importScript('User:Liangent/Scripts/cat-a-lot.js');
/*require(['jquery', 'jqueryui', 'mediawiki',
    {src: 'wiki', data: 'User:Jimmy xu wrk/Friendly/main.min.js'},
    {src: 'wiki', data: 'User:Bencmq/NPP.js'}
    ], function() {
    addOnloadHook(function() {
        jQuery('.tabs > ul a').removeAttr('title');
        jQuery('.tabs').tabs();
        MediaWiki.Page().purge();
    });
});*/

//    {src: 'wiki', data: 'User:Liangent/test.js'}

//importScript('User:Liangent/Gadgets/Twinkle/main.js');
//importScript('User:Bencmq/NPP.js');

var summaryAbbreviations = [
    [/\bcopyvio: (.*)$/, '[[WP:C|侵犯版权]]: $1']
];

var popupAdminLinks = true;
var popupShortcutKeys = true;
var popupFixRedirs = true;
var popupRedlinkRemoval = true;
var popupFixDabs = true;
var popupRevertSummaryPrompt = true;

//importScriptURI('http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/js2/mwEmbed/mv_embed.js');
//importScriptURI('http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/js2/ajaxcategories.js');

//wgEditToolbarCGD = true;

//importScript('User:Liangent/Scripts/CatNav.js');
//importScript('User:P1ayer/CatNavStr.js');

//importScriptURI('http://localhost/~liangent/_wmfwikis/zhwiki/common.js');

//importScript('User:Liangent/Scripts/RDT.js');
//importScript('User:Liangent/Gadgets/Toolkit/wordcount.js');
//importScript('User:Liangent/Gadgets/Toolkit/historyug.js');

importScript('User:Liangent/Scripts/AutoTrigger.js');
//importScript('User:Liangent/test.js');
importScript('User:Liangent/Scripts/Links.js');
//importScript('User:Liangent/Scripts/NoteTA2.js');
importScript('User:Liangent/Scripts/UndoRange.js');

importScript('User:Liangent/Scripts/NoEditConflict.js');
importScript('User:Liangent/Scripts/CherryPick.js');
// importScript('User:Liangent/Scripts/TagCommenter.js');

mw.loader.using(['ext.gadget.site-lib'],function(){
    importScript('User:Liangent/rollbackSummary.js');
});

mw.loader.using(['jquery.tipsy'],function(){
    $('.unicode-pua').tipsy({delayOut: 5000});
});

document.write = alert;