跳转到内容

User:Qinyongr/common.js:修订间差异

计算器百科,非营利的计算器专业知识百科。
Qinyongr留言 | 贡献
无编辑摘要
Qinyongr留言 | 贡献
无编辑摘要
第38行: 第38行:
addPortletLink( 'p-tb', url, 'User rights', 't-userrights', 'List of user groups for ' + user );
addPortletLink( 'p-tb', url, 'User rights', 't-userrights', 'List of user groups for ' + user );
});
});
importScript("User:Qinyongr/adminhighlight.js");

2016年5月2日 (一) 02:36的版本

mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js');
$(function () {
    var hist; var url;
    if (!(hist = document.getElementById('ca-history') )) return;
    if (!(url = hist.getElementsByTagName('a')[0] )) return;
    if (!(url = url.href )) return;
    mw.util.addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
                   wgULS('-{zh-cn:清除缓存;zh-tw:清除快取}-'), 'ca-purge', wgULS('-{zh-cn:更新服务器缓存;zh-tw:更新伺服器快取}-'), '*');
});

//Undorange by Liangent
( function( $, mw ) { mw.loader.using( [
    'mediawiki.util'
], function() { $( function() {
    if ( mw.config.get( 'wgAction' ) == 'history' ) {
        $( '#mw-history-compare .mw-history-compareselectedversions-button' ).after(
            $( '<input type="submit" />' )
                .val( 'UndoRange' )
                .click( function( e ) {
                    $( '#mw-history-compare input[name=diff]' ).attr( 'name', 'undo' );
                    $( '#mw-history-compare input[name=oldid]' ).attr( 'name', 'undoafter' );
                    $( '#mw-history-compare input[name=action]' ).val( 'edit' );
                    $( '<input type="hidden" name="summary" />' ).val(
                        'UndoRange: ' + $( '#mw-history-compare input:checked[name=undoafter]' ).val()
                            + ' ~ ' + $( '#mw-history-compare input:checked[name=undo]' ).val()
                    ).insertAfter( this );
                } )
        );
    }
} ); } ); } )( jQuery, mediaWiki );

addOnloadHook( function() {
	if ( wgNamespaceNumber != 2 && wgNamespaceNumber != 3 ) { // User or User talk
		return;
	}
	var user = wgTitle.split( '/' )[0];
	var url = wgScript + '?title=Special:UserRights&user=' + encodeURIComponent( user );
	addPortletLink( 'p-tb', url, 'User rights', 't-userrights', 'List of user groups for ' + user );
});
importScript("User:Qinyongr/adminhighlight.js");