User:Mirinano/global.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// UTC live clock
mw.loader.load( '//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' );
// HotCat
mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript');
// Popups
mw.loader.load('//ja.wikipedia.org/w/index.php?title=User:Was_a_bee/strings-ja.js' + '&action=raw&ctype=text/javascript');
mw.loader.load("//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-popups.js&action=raw&ctype=text/javascript");
popupAdminLinks=true;
popupStructure='shortmenus';
popupShortcutKeys=true;
popupDelay=0.1;
popupHideDelay=0.2;
popupDragHandle=true;
simplePopups=false;
popupFixRedirs=true;
popupRedirAutoClick='wpSave';
popupRedlinkRemoval=false;
popupRevertSummaryPrompt=false;
if( mw.config.get('wgContentLanguage') === 'ja' ) {
// 日本語プロジェクトの要約欄
popupRevertSummary="ID: [[Special:Permalink/%s|%s]] の版へ差し戻し ([[w:ja:WP:POP|ポップアップ]]使用)";
popupQueriedRevertSummary="$3 による $2 (UTC)時点の版 (ID: [[Special:Permalink/$1|$1]] )へ差し戻し ([[w:ja:WP:POP|ポップアップ]]使用)";
popupQueriedRevertToPreviousSummary="$2 (UTC)時点の版 (ID: [[Special:Permalink/$1|$1]] )以前へ差し戻し ([[w:ja:WP:POP|ポップアップ]]使用)";
popupFixRedirsSummary="リダイレクトの[[%s]]を、転送先の[[%s]]に修正 ([[w:ja:WP:POP|ポップアップ]]使用)";
popupFixDabsSummary="曖昧さ回避 [[%s]] を [[%s]] に修正 ([[w:ja:WP:POP|ポップアップ]]使用)";
popupRedlinkSummary="赤リンク [[%]] を除去 ([[w:ja:WP:POP|ポップアップ]]使用)";
} else {
popupRevertSummary="Revert to revision %s using [[w:en:WP:POP|popups]]";
popupQueriedRevertSummary="Revert to revision [[Special:Permalink/$1|$1]] dated $2 by $3 using [[w:en:WP:POP|popups]]";
popupQueriedRevertToPreviousSummary="Revert before revision [[Special:Permalink/$1|$1]] dated $2 using [[w:en:WP:POP|popups]]"; //hide user name
popupFixRedirsSummary="Redirect bypass from [[%s]] to [[%s]] using [[w:en:WP:POP|popups]]";
popupFixDabsSummary="Disambiguate [[%s]] to [[%s]] using [[w:en:WP:POP|popups]]";
popupRedlinkSummary="Removing link to empty page [[%s]] using [[w:en:WP:POP|popups]]";
}
//TwinkleGlobal
if ( (mw.config.get("wgDBname") !== "wikidatawiki") && (mw.config.get("wgDBname") !== "testwikidatawiki") ) { // Don't work in Wikidata
// Fork of Twinkle intended to work on as many wikis as possible
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Xiplus/TwinkleGlobal.js&action=raw&ctype=text/javascript');
}
// Shows the number of active (one log entry in the last 7 days, or as configured) sysops, uses data from the toolserver
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Active_sysops>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/active_sysops.js&action=raw&ctype=text/javascript');
/**********
*** StewardLinks
*** by [[m:User:Erwin]]
**********/
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Erwin/stewardlinks.js&action=raw&ctype=text/javascript');
// Tagger for eg. Speedy deletions
// by [[m:user:Hoo man]] <//meta.wikimedia.org/wiki/User:Hoo_man/tagger.js>
// [[File:Hoo man/tagger.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/tagger.js&action=raw&ctype=text/javascript');
//<nowiki>
if(typeof(taggerConfig) == 'undefined') taggerConfig = {};
taggerConfig.tags = [];
taggerConfig.editSummary = [];
taggerConfig.tags[1] = '{{'+'delete|test page}}';
taggerConfig.editSummary[taggerConfig.tags[1]] = 'deletion request (test page)';
taggerConfig.tags[2] = '{{'+'delete|spam}}';
taggerConfig.editSummary[taggerConfig.tags[2]] = 'deletion request (spam)';
taggerConfig.tags[3] = '{{'+'delete|blanked by the author}}';
taggerConfig.editSummary[taggerConfig.tags[3]] = 'deletion request (blanked by the author)';
taggerConfig.tags[4] = '{{'+'delete|out of project scope}}';
taggerConfig.editSummary[taggerConfig.tags[4]] = 'deletion request (out of project scope)';
taggerConfig.tags[5] = '{{'+'delete|vandalism}}';
taggerConfig.editSummary[taggerConfig.tags[5]] = 'deletion request (vandalism)';
taggerConfig.tags[6] = '{{'+'delete|no useful content}}';
taggerConfig.editSummary[taggerConfig.tags[6]] = 'deletion request (no useful content)';
taggerConfig.tags[7] = '{{'+'delete|wrong language}}';
taggerConfig.editSummary[taggerConfig.tags[7]] = 'deletion request (wrong language)';
taggerConfig.tags[8] = '{{'+'delete|Long-term abuse}}';
taggerConfig.editSummary[taggerConfig.tags[8]] = 'deletion request (created by Long-term abuse)';
taggerConfig.tags[9] = '{{'+'delete|Empty page, No article}}';
taggerConfig.editSummary[taggerConfig.tags[9]] = 'deletion request (Empty page, No article)';
taggerConfig.tags[10] = '{{'+'SD|G3}}';
taggerConfig.editSummary[taggerConfig.tags[10]] = 'SD G3';
taggerConfig.tags.other = 'This is used for the option you have to select to be able to insert a custom template';
if ( mw.config.get("wgDBname") !== "jawikipedia" ) {var disable_tagger = true;}
// Provides several useful functions for rollback (custom edit summary, mark as bot edits and mass revert)
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Smart_rollback>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');
if(typeof(smartRollbackConfig) === 'undefined') smartRollbackConfig = {};
smartRollbackConfig.editSummaries = {};
smartRollbackConfig.editSummaries[1] = 'revert (vandalism)';
smartRollbackConfig.editSummaries[2] = 'revert (test edit)';
smartRollbackConfig.editSummaries[3] = 'Long-term abuse';
smartRollbackConfig.editSummaries[4] = '荒らしによる編集を巻き戻し';
//smartRollbackConfig.editSummaries[5] = '[[Special:Contributions/$2|$2]] ([[User talk:$2|会話]]) による版を $1 による版へ[[H:RV|巻き戻し]](一括)';
//smartRollbackConfig.editSummaries[6] = '';
if(typeof(smartRollbackConfig) === 'undefined') smartRollbackConfig = {};
smartRollbackConfig.enableMarkbotedits = true;
if(typeof(smartRollbackConfig) === 'undefined') smartRollbackConfig = {};
smartRollbackConfig.oneClickBotLinks = true;
jQuery(function ($) {
// 巻き戻しが使えない場所では作動させない
if($('span.mw-rollback-link > a').length > 0) {
// ツールボックスの項目一覧を取得
$toolbox = $('#p-tb > div > ul');
// 新しい項目の作成
$setLink = $('<li/>')
// ID
.attr({
id: "t-rbsummary"
})
// リンク
.append(
$('<a/>')
.text('巻き戻し要約を「Abusive user name」に変更')
.attr({
href: "#"
})
// クリック時の挙動
.click(function(){
// 通常の巻き戻しリンク
$rbAnchor = $('span.mw-rollback-link > a');
// rollBackBot.js で追加されるBotの巻き戻しリンク
//$rbbAnchor = $('span.mw-rollback-link-bot > a');
// 通常の巻き戻しリンクへsummaryパラメータ付与
for(i = 0; i < $rbAnchor.length; i++) {
$rbAnchor.eq(i).attr({
href: $rbAnchor.eq(i).attr("href") + "&summary=" + encodeURIComponent("Abusive user name")
})
}
// Botの巻き戻しリンクがあればこちらにもsummaryパラメータ付与
for(i = 0; i < $rbbAnchor.length; i++) {
$rbbAnchor.eq(i).attr({
href: $rbbAnchor.eq(i).attr("href") + "&summary=" + encodeURIComponent("Abusive user name")
})
}
// ツールボックスに追加した項目を使用不能にする
$('#t-rbsummary > a')
.unbind()
.click(function(){
return false;
})
.text('巻き戻し要約を変更中です');
return false;
})
)
$toolbox.append($setLink);
}
})