14,061
edits
(Trying 2.41) |
(Add) |
||
Line 540: | Line 540: | ||
} | } | ||
var summary = [] | var summary = []; | ||
var nameSpace = HC.category_canonical; | |||
var cat_point = -1; // Position of removed category; | |||
if ( key ) key = '|' + key; | if ( key ) key = '|' + key; | ||
var keyChange = ( toRemove && toAdd && toRemove === toAdd && toAdd.length ); | |||
var matches; | |||
if ( toRemove && toRemove.length ) { | if ( toRemove && toRemove.length ) { | ||
matches = find_category( wikitext, toRemove ); | matches = find_category( wikitext, toRemove ); | ||
Line 556: | Line 557: | ||
}; | }; | ||
} else { | } else { | ||
var before = wikitext.substring( 0, matches[ 0 ].match.index ) | var before = wikitext.substring( 0, matches[ 0 ].match.index ); | ||
var after = wikitext.substring( matches[ 0 ].match.index + matches[ 0 ].match[ 0 ].length ); | |||
if ( matches.length > 1 ) { | if ( matches.length > 1 ) { | ||
// Remove all occurrences in after | // Remove all occurrences in after | ||
Line 564: | Line 565: | ||
} | } | ||
if ( toAdd ) { | if ( toAdd ) { | ||
nameSpace = matches[ 0 ].match[ 1 ] || nameSpace; | |||
if ( key === null ) key = matches[ 0 ].match[ 2 ]; | if ( key === null ) key = matches[ 0 ].match[ 2 ]; | ||
// Remember the category key, if any. | // Remember the category key, if any. | ||
Line 600: | Line 601: | ||
} | } | ||
} | } | ||
if ( toAdd && toAdd.length ) { | if ( toAdd && toAdd.length ) { | ||
matches = find_category( wikitext, toAdd ); | matches = find_category( wikitext, toAdd ); | ||
if ( matches && matches.length ) { | if ( matches && matches.length ) { | ||
return { | return { | ||
text: wikitext, | text: wikitext, | ||
Line 2,692: | Line 2,691: | ||
config.HotCatUseCategoryLinks : | config.HotCatUseCategoryLinks : | ||
HC.use_up_down ) ); | HC.use_up_down ) ); | ||
HC.listSize = window. | HC.listSize = window.hotcat_listSize || config.HotCatListSize || HC.listSize; | ||
if ( conf.wgDBname !== 'commonswiki' ) HC.changeTag = config.HotCatChangeTag || ''; | if ( conf.wgDBname !== 'commonswiki' ) HC.changeTag = config.HotCatChangeTag || ''; | ||
Line 2,771: | Line 2,770: | ||
if ( isNaN( HC.listSize ) || HC.listSize < 5 ) HC.listSize = 5; | if ( isNaN( HC.listSize ) || HC.listSize < 5 ) HC.listSize = 5; | ||
HC.listSize = Math.min( HC.listSize, | HC.listSize = Math.min( HC.listSize, 15 ); | ||
// Localize search engine names | // Localize search engine names |