LLWiki正在建设中,欢迎加入我们

“MediaWiki:Gadget-Cat-a-lot.js”的版本间差异

跳转到导航 跳转到搜索
删除2,525字节 、​ 2020年8月11日 (二) 03:17
无编辑摘要
(// Edit via Wikiplus)
// new: added 2012-09-19. Please translate.
// Use user language for i18n
'cat-a-lot-watchlistprefuncatpref': 'Watchlist移除 preference concerning files edited with Cat-a-lot{{Uncategorized}}',
'cat-a-lot-watch_pref': 'According to your general preferences',
'cat-a-lot-watch_nochange': 'Do not change watchstatus',
'cat-a-lot-watch_watch': 'Watch pages edited with Cat-a-lot',
'cat-a-lot-watch_unwatch': 'Remove pages while editing with Cat-a-lot from your watchlist',
'cat-a-lot-minorpref': 'Mark edits as minor (if you generally mark your edits as minor, this won’t change anything)',
'cat-a-lot-editpagespref': 'Allow categorising pages (including categories) that are not files',
'cat-a-lot-docleanuppref': 'Remove {{Check categories}} and other minor cleanup',
'cat-a-lot-uncatpref': 'Remove {{Uncategorized}}',
'cat-a-lot-subcatcountpref': 'Sub-categories to show at most',
'cat-a-lot-config-settings': 'Preferences',
'cat-a-lot-buttonpref': 'Use buttons instead of text-links',
'cat-a-lot-comment-label': wgULS('自定义编辑摘要','自定義編輯摘要'),
'cat-a-lot-edit-question': wgULS('请输入编辑摘要:','請輸入編輯摘要:'),
 
// Progress
// 'cat-a-lot-loading': 'Loading …',
'cat-a-lot-editing': 'Editing page',
'cat-a-lot-of': 'of ',
'cat-a-lot-removed-cat': 'Removed from category $1',
'cat-a-lot-return-to-page': 'Return to page',
// 'cat-a-lot-cat-not-found': 'Category not found.',
 
// as in 17 files selected
'cat-a-lot-files-selected': '{{PLURAL:$1|1=One file|$1 files}} selected.',
'cat-a-lot-pe_file': '$1 {{PLURAL:$1|page|pages}} of $2 affected',
'cat-a-lot-parent-cat': 'Has parent-category: ',
'cat-a-lot-sub-cat': 'Has sub-category: ',
 
// Actions
'cat-a-lot-all': 'all',
'cat-a-lot-none': 'none',
// 'cat-a-lot-none-selected': 'No files selected!', 'Ooui-selectfile-placeholder'
 
// Summaries (project language):
'cat-a-lot-pref-save-summary': 'Updating user preferences',
'cat-a-lot-summary-add': 'Adding [[Category:$1]]',
'cat-a-lot-summary-copy': 'Copying from [[Category:$1]] to [[Category:$2]]',
'cat-a-lot-summary-move': 'Moving from [[Category:$1]] to [[Category:$2]]',
'cat-a-lot-summary-remove': 'Removing from [[Category:$1]]',
'cat-a-lot-prefix-summary': '使用Cat-a-lot小工具',
'cat-a-lot-using-summary': ' using Cat-a-lot'
};
mw.messages.set( msgs );
 
init: function () {
// Prevent historical double marker (maybe remove in future)
if ( /Cat-?a-?lot/i.test( msgs[ 'cat-a-lot-pref-save-summary' ] ) ) { mw.messages.set( { 'cat-a-lot-prefix-summary': '', 'cat-a-lot-using-summary': '' } ); } else {
mw.messages.set( {
'cat-a-lot-pref-save-summary': msgs[ 'cat-a-lot-prefix-summary' ] + msgs[ 'cat-a-lot-pref-save-summary' ] + msgs[ 'cat-a-lot-using-summary' ]
} );
}
 
// TODO: better extern project support for possible change-tag? (needs currently change after init)
if ( project === 'commonswiki' ) { mw.messages.set( { 'cat-a-lot-using-summary': '' } ); } else { // Reset
.appendTo( $head );
$container.one( 'mouseover', function () { // Try load on demand earliest as possible
mw.loader.load( [ 'jquery.uiOOUI'] );
} );
 
.insertBefore( $selections );
}
 
/*
if ( ( mw.util.getParamValue( 'withJS' ) === 'MediaWiki:Gadget-Cat-a-lot.js' &&
!mw.util.getParamValue( 'withCSS' ) ) ||
mw.loader.getState( 'ext.gadget.Cat-a-lot' ) === 'registered' ) {
mw.loader.load( mw.config.get( 'wgServer' ) + '/mediawiki/index.php?title=MediaWiki:Gadget-Cat-a-lot.css&action=raw&ctype=text/css', 'text/css' );
// importStylesheet( 'MediaWiki:Gadget-Cat-a-lot.css' );
}
*/
 
reCat = new RegExp( '^\\s*' + CAL.localizedRegex( 14, 'Category' ) + ':', '' );
} ) );
}
 
} );
},
}
$( '<a>' )
// .attr( 'id', 'cat_a_lot_select_all' )
.text( msg( 'all' ) )
.on( 'click', function () {
}
$selectNone = $( '<a>' )
// .attr( 'id', 'cat_a_lot_select_none' )
.text( msg( 'none' ) )
.on( 'click', function () {
$( this ).toggleClass( 'cat_a_lot_enabled' );
// Load autocomplete on demand
mw.loader.using( 'jquery.uiOOUI', initAutocomplete );
 
if ( !CAL.executed ) {
$.when( mw.loader.using( [
'jquery.uiOOUI',
'jquery.ui',
'jquery.ui',
'mediawiki.api',
'mediawiki.jqueryMsg'
this.labels = this.labels.add( $( 'table.searchResultImage' ).find( 'tr>td:eq(1)' ) );
if ( this.settings.editpages ) { this.labels = this.labels.add( 'div.mw-search-result-heading' ); }
 
break;
case 'category':
file = file.length ? file : label.find( 'a[title]' );
var title = file.attr( 'title' ) ||
CAL.getTitleFromLink( file ) ||
CAL.getTitleFromLink( label.find( 'a' ) ) ||
CAL.getTitleFromLink( label.parent().find( 'a' ) ); // TODO needs optimization
if ( title.indexOf( formattedNS[ 2 ] + ':' ) ) { return [ [ title, label ] ]; }
} );
if ( $( '#cat_a_lot_comment' ).prop( 'checked' ) ) { this.summary = window.prompt( msg( 'edit-question' ), '' ); } // TODO custom pre-value
if ( this.summary !== null ) {
mw.loader.using( [ 'jquery.uiOOUI', 'jquery.spinner', 'mediawiki.util' ], function () {
CAL.showProgress();
CAL.getTargetCat( pages, targetcat, mode );
createCatLinks: function ( symbol, list, table ) {
list.sort();
var button = ( this.settings.button && mw.loader.getState( 'jquery.uiOOUI' ) === 'ready' ) ? 1 : 0;
for ( var c = 0; c < list.length; c++ ) {
var $tr = $( '<tr>' ),
defaults: [ {
name: 'watchlist',
'default': 'preferences',
label_i18n: 'watchlistpref',
select_i18n: {
watch_pref: 'preferences',
watch_nochange: 'nochange',
watch_watch: 'watch',
watch_unwatch: 'unwatch'
}
}, {
name: 'minor',
'default': false,
label_i18n: 'minorpref'
}, {
name: 'editpages',
'default': project !== 'commonswiki', // on Commons false
label_i18n: 'editpagespref',
forcerestart: true
}, {
name: 'docleanup',
'default': false,
label_i18n: 'docleanuppref'
}, {
name: 'subcatcount',
min: 5,
max: 500,
label_i18n: 'subcatcountpref',
forcerestart: true
}, {
name: 'uncat',
'default': project === 'commonswiki', // on Commons truefalse
label_i18n: 'uncatpref'
}, {
name: 'button',
'default': true,
label_i18n: 'buttonpref'
} ]
/* eslint-enable camelcase */
16,874

个编辑

导航菜单