۵٬۱۲۳
ویرایش
بدون خلاصۀ ویرایش |
برچسب: خنثیسازی |
||
خط ۱: | خط ۱: | ||
/** | /** | ||
* Cat-a-lot | * Cat-a-lot | ||
خط ۳۷: | خط ۳۰: | ||
userGrp = mw.config.get( 'wgUserGroups' ), | userGrp = mw.config.get( 'wgUserGroups' ), | ||
project = mw.config.get( 'wgDBname' ); | project = mw.config.get( 'wgDBname' ); | ||
var msgs = { | var msgs = { | ||
خط ۴۳: | خط ۳۵: | ||
// new: added 2012-09-19. Please translate. | // new: added 2012-09-19. Please translate. | ||
// Use user language for i18n | // Use user language for i18n | ||
'cat-a-lot-watchlistpref' | 'cat-a-lot-watchlistpref': 'Watchlist preference concerning files edited with Cat-a-lot', | ||
'cat-a-lot-watch_pref' | 'cat-a-lot-watch_pref': 'According to your general preferences', | ||
'cat-a-lot-watch_nochange' : ' | 'cat-a-lot-watch_nochange': 'Do not change watchstatus', | ||
'cat-a-lot-watch_watch' | 'cat-a-lot-watch_watch': 'Watch pages edited with Cat-a-lot', | ||
'cat-a-lot-watch_unwatch' | 'cat-a-lot-watch_unwatch': 'Remove pages while editing with Cat-a-lot from your watchlist', | ||
'cat-a-lot-minorpref' | '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' | 'cat-a-lot-editpagespref': 'Allow categorising pages (including categories) that are not files', | ||
'cat-a-lot-docleanuppref' | 'cat-a-lot-docleanuppref': 'Remove {{Check categories}} and other minor cleanup', | ||
'cat-a-lot-uncatpref' | 'cat-a-lot-uncatpref': 'Remove {{Uncategorized}}', | ||
'cat-a-lot-subcatcountpref': ' | 'cat-a-lot-subcatcountpref': 'Sub-categories to show at most', | ||
'cat-a-lot-config-settings': ' | 'cat-a-lot-config-settings': 'Preferences', | ||
'cat-a-lot-buttonpref' | 'cat-a-lot-buttonpref': 'Use buttons instead of text-links', | ||
'cat-a-lot-comment-label' | 'cat-a-lot-comment-label': 'Custom edit comment', | ||
'cat-a-lot-edit-question' | 'cat-a-lot-edit-question': 'Why is this change necessary?', | ||
// Progress | // Progress | ||
// 'cat-a-lot-loading' | // 'cat-a-lot-loading': 'Loading …', | ||
'cat-a-lot-editing' | 'cat-a-lot-editing': 'Editing page', | ||
'cat-a-lot-of' | 'cat-a-lot-of': 'of ', | ||
'cat-a-lot-skipped-already' | 'cat-a-lot-skipped-already': 'The following {{PLURAL:$1|1=page was|$1 pages were}} skipped, because the page was already in the category:', | ||
'cat-a-lot-skipped-not-found': ' | 'cat-a-lot-skipped-not-found': 'The following {{PLURAL:$1|1=page was|$1 pages were}} skipped, because the old category could not be found:', | ||
'cat-a-lot-skipped-server' | 'cat-a-lot-skipped-server': 'The following {{PLURAL:$1|1=page|$1 pages}} couldn’t be changed, since there were problems connecting to the server:', | ||
'cat-a-lot-all-done' | 'cat-a-lot-all-done': 'All pages are processed.', | ||
'cat-a-lot-done' | 'cat-a-lot-done': 'Done!', // mw.msg("Feedback-close") | ||
'cat-a-lot-added-cat' | 'cat-a-lot-added-cat': 'Added category $1', | ||
'cat-a-lot-copied-cat' | 'cat-a-lot-copied-cat': 'Copied to category $1', | ||
'cat-a-lot-moved-cat' | 'cat-a-lot-moved-cat': 'Moved to category $1', | ||
'cat-a-lot-removed-cat' | 'cat-a-lot-removed-cat': 'Removed from category $1', | ||
// 'cat-a-lot-return-to-page': ' | // 'cat-a-lot-return-to-page': 'Return to page', | ||
// 'cat-a-lot-cat-not-found' : ' | // 'cat-a-lot-cat-not-found': 'Category not found.', | ||
// as in 17 files selected | // as in 17 files selected | ||
'cat-a-lot-files-selected': '{{PLURAL:$1|1= | '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 | // Actions | ||
'cat-a-lot-copy': ' | 'cat-a-lot-copy': 'Copy', | ||
'cat-a-lot-move': ' | 'cat-a-lot-move': 'Move', | ||
'cat-a-lot-add': ' | 'cat-a-lot-add': 'Add', | ||
// 'cat-a-lot-remove-from-cat': 'Remove from this category', | // 'cat-a-lot-remove-from-cat': 'Remove from this category', | ||
'cat-a-lot-overcat': ' | 'cat-a-lot-overcat': 'Check over-categorization', | ||
'cat-a-lot-enter-name': ' | 'cat-a-lot-enter-name': 'Enter category name', | ||
'cat-a-lot-select': ' | 'cat-a-lot-select': 'Select', | ||
'cat-a-lot-all': ' | 'cat-a-lot-all': 'all', | ||
'cat-a-lot-none': ' | 'cat-a-lot-none': 'none', | ||
// 'cat-a-lot-none-selected': 'No files selected!', 'Ooui-selectfile-placeholder' | // 'cat-a-lot-none-selected': 'No files selected!', 'Ooui-selectfile-placeholder' | ||
'cat-a-lot-pref-save-summary': ' | // Summaries (project language): | ||
'cat-a-lot-summary-add' | 'cat-a-lot-pref-save-summary': 'Updating user preferences', | ||
'cat-a-lot-summary-copy' | 'cat-a-lot-summary-add': 'Adding [[Category:$1]]', | ||
'cat-a-lot-summary-move' | 'cat-a-lot-summary-copy': 'Copying from [[Category:$1]] to [[Category:$2]]', | ||
'cat-a-lot-summary-remove' | 'cat-a-lot-summary-move': 'Moving from [[Category:$1]] to [[Category:$2]]', | ||
'cat-a-lot-prefix-summary' | 'cat-a-lot-summary-remove': 'Removing from [[Category:$1]]', | ||
'cat-a-lot-using-summary' | 'cat-a-lot-prefix-summary': '', | ||
'cat-a-lot-using-summary': ' using [[c:Help:Cat-a-lot|Cat-a-lot]]' | |||
}; | }; | ||
mw.messages.set( msgs ); | mw.messages.set( msgs ); | ||
خط ۱۳۱: | خط ۱۰۶: | ||
var $body, $container, $dataContainer, $searchInputContainer, $searchInput, $resultList, $markCounter, $selections, | var $body, $container, $dataContainer, $searchInputContainer, $searchInput, $resultList, $markCounter, $selections, | ||
$selectFiles, $selectPages, $selectNone, $selectInvert, $settingsWrapper, $settingsLink, $head, $link, $overcat, | $selectFiles, $selectPages, $selectNone, $selectInvert, $settingsWrapper, $settingsLink, $head, $link, $overcat, | ||
commonsURL = 'https:// | commonsURL = 'https://wikihaj.com/index.php', | ||
is_rtl = $( 'body' ).hasClass( 'rtl' ), | is_rtl = $( 'body' ).hasClass( 'rtl' ), | ||
reCat, // localized category search regexp | reCat, // localized category search regexp | ||
خط ۲۱۷: | خط ۱۹۲: | ||
href: commonsURL + '?title=Special:MyLanguage/Help:Gadget-Cat-a-lot', | href: commonsURL + '?title=Special:MyLanguage/Help:Gadget-Cat-a-lot', | ||
target: '_blank', | target: '_blank', | ||
style: 'float: | style: 'float:left', | ||
title: ( $( '#n-help a' ).attr( 'title' ) || '' ) + ' (v. ' + this.version + ')' | title: ( $( '#n-help a' ).attr( 'title' ) || '' ) + ' (v. ' + this.version + ')' | ||
} ).text( '?' ) ); | } ).text( '?' ) ); | ||
خط ۲۸۴: | خط ۲۵۹: | ||
$( '.ui-autocomplete' ) | $( '.ui-autocomplete' ) | ||
.position( { | .position( { | ||
my: | my: is_rtl ? 'left bottom' : 'right bottom', | ||
at: | at: is_rtl ? 'left top' : 'right top', | ||
of: $searchInput | of: $searchInput | ||
} ); | } ); | ||
خط ۳۴۷: | خط ۳۲۲: | ||
'jquery.ui.draggable', | 'jquery.ui.draggable', | ||
'jquery.ui.button', | 'jquery.ui.button', | ||
'mediawiki.api', | 'mediawiki.api.messages', | ||
'mediawiki.jqueryMsg' | 'mediawiki.jqueryMsg' | ||
] ), $.ready ) | ] ), $.ready ) | ||
خط ۸۱۱: | خط ۷۸۶: | ||
case 'add': | case 'add': | ||
text = addCategory( text, targetcat ); | text = addCategory( text, targetcat ); | ||
sumCmt = msg( 'summary-add' ).replace( | sumCmt = msg( 'summary-add' ).replace( /\$1/g, targetcat ); | ||
sumCmtShort = '+[[' + catNS + targetcat + ']]'; | sumCmtShort = '+[[' + catNS + targetcat + ']]'; | ||
break; | break; | ||
case 'copy': | case 'copy': | ||
text = text.replace( this.regexCatBuilder( sourcecat ), '[[' + catNS + sourcecat + '$1]]\n[[' + catNS + targetcat + '$1]]\n' ); | text = text.replace( this.regexCatBuilder( sourcecat ), '[[' + catNS + sourcecat + '$1]]\n[[' + catNS + targetcat + '$1]]\n' ); | ||
sumCmt = msg( 'summary-copy' ).replace( | sumCmt = msg( 'summary-copy' ).replace( /\$1/g, sourcecat ).replace( /\$2/g, targetcat ); | ||
sumCmtShort = '+[[' + catNS + sourcecat + ']]' + arr + '[[' + catNS + targetcat + ']]'; | sumCmtShort = '+[[' + catNS + sourcecat + ']]' + arr + '[[' + catNS + targetcat + ']]'; | ||
// If category is added through template: | // If category is added through template: | ||
خط ۸۲۴: | خط ۷۹۹: | ||
case 'move': | case 'move': | ||
text = text.replace( this.regexCatBuilder( sourcecat ), '[[' + catNS + targetcat + '$1]]\n' ); | text = text.replace( this.regexCatBuilder( sourcecat ), '[[' + catNS + targetcat + '$1]]\n' ); | ||
sumCmt = msg( 'summary-move' ).replace( | sumCmt = msg( 'summary-move' ).replace( /\$1/g, sourcecat ).replace( /\$2/g, targetcat ); | ||
sumCmtShort = '±[[' + catNS + sourcecat + ']]' + arr + '[[' + catNS + targetcat + ']]'; | sumCmtShort = '±[[' + catNS + sourcecat + ']]' + arr + '[[' + catNS + targetcat + ']]'; | ||
break; | break; | ||
case 'remove': | case 'remove': | ||
text = text.replace( this.regexCatBuilder( targetcat ), '' ); | text = text.replace( this.regexCatBuilder( targetcat ), '' ); | ||
sumCmt = msg( 'summary-remove' ).replace( | sumCmt = msg( 'summary-remove' ).replace( /\$1/g, targetcat ); | ||
sumCmtShort = '-[[' + catNS + targetcat + ']]'; | sumCmtShort = '-[[' + catNS + targetcat + ']]'; | ||
break; | break; | ||
خط ۱٬۰۵۹: | خط ۱٬۰۳۴: | ||
if ( button ) { | if ( button ) { | ||
$buttons.slice( -1 )[ 0 ].button( { | $buttons.slice( -1 )[ 0 ].button( { | ||
icons: { primary: 'ui-icon-arrowthick-1- | icons: { primary: 'ui-icon-arrowthick-1-e' }, | ||
showLabel: false, | showLabel: false, | ||
text: false | text: false | ||
خط ۱٬۳۲۱: | خط ۱٬۲۹۶: | ||
$link.after( $( '<a>' ) | $link.after( $( '<a>' ) | ||
.text( '–' ) | .text( '–' ) | ||
.css( { fontWeight: 'bold', | .css( { fontWeight: 'bold', marginright: '.7em' } ) | ||
.one( 'click', this.minimize ) | .one( 'click', this.minimize ) | ||
); | ); | ||
خط ۱٬۳۳۵: | خط ۱٬۳۱۰: | ||
.css( { | .css( { | ||
maxHeight: '', | maxHeight: '', | ||
width | width: '' | ||
} ); | } ); | ||
}, | }, |
ویرایش