MediaWiki:Gadget-HotCat.js: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Borgx (bicara | kontrib)
k dari en
 
Borgx (bicara | kontrib)
k .
Baris 96:
function hotcat_is_on_blacklist ( cat_title ) {
if ( !cat_title ) return 0 ;
cat_title = cat_title.ucFirst.replace( /CategoryKategori:/gi, "" );
for ( var i = 0 ; i < hotcat_modify_blacklist.length ; i++ ) {
if ( cat_title.substr ( 0 , hotcat_modify_blacklist[i].length ) == hotcat_modify_blacklist[i] ) return 1 ;
Baris 108:
// [[MediaWiki:Red-link-title]] to the category name... we another way to get that category
// name. Lupo, 2008-02-27
var cat_title = span.firstChild.innerHTML; // without "CategoryKategori:"
var sep1 = document.createTextNode ( " " ) ;
Baris 221:
var cat_name = category.replace(/([\\\^\$\.\?\*\+\(\)])/g, "\\$1");
var initial = cat_name.substr (0, 1);
var cat_regex = new RegExp ("\\[\\[\\s*[CcKk]ategoryategori\\s*:\\s*"
+ (initial == "\\"
? initial
Baris 239:
function hotcat_find_ins ( wikitext )
{
var re = /\[\[(?:CategoryKategori):[^\]]+\]\]/ig
var index = -1;
while( re.exec(wikitext) != null ) index = re.lastIndex;
Baris 266:
var matches = hotcat_find_category (t, cat_rm);
if (!matches || matches.length == 0) {
alert ('CategoryKategori "' + cat_rm + '" not found; maybe it is in a template?');
prevent_autocommit = 1;
} else if (matches.length > 1) {
alert ('CategoryKategori "' + cat_rm
+ "\" found several times; don't know which occurrence to remove.");
prevent_autocommit = 1;
Baris 465:
while ( span.firstChild ) span.removeChild ( span.firstChild ) ;
var na = document.createElement ( "a" ) ;
na.href = wgArticlePath.split("$1").join("CategoryKategori:" + encodeURI (text)) ;
na.appendChild ( document.createTextNode ( text ) ) ;
na.setAttribute ( "title" , "CategoryKategori:" + text ) ;
span.appendChild ( na ) ;
var catline = getElementsByClassName ( document , "p" , "catlinks" ) [0] ;
Baris 537:
for ( var i = 0 ; i < pages.length ; i++ ) {
// Strip "Category:" but don't break on titles like "Category:Space: 2001 a space odyssey"
var s = pages[i].getAttribute("title").replace( /CategoryKategori:/gi, "" );
if ( s.substr ( 0 , hotcat_last_v.length ) != hotcat_last_v ) break ;
titles.push ( s ) ;