Content deleted Content added
add fix |
geeze, I really should try to finish this |
||
(One intermediate revision by the same user not shown) | |||
Line 44:
//Get date and close. Differs for successful and unsuccessful RFAs
var date;
var successful;
var closer = null; //damn rfarow
if ( wikitext.indexOf("Closed as successful by") > 0 ) {
date = wikitext.slice( wikitext.indexOf(" at "), wikitext.indexOf(" (UTC)"));
successful = true;
if( typeof close === 'undefined' )
close = '
}
else {
date = wikitext.slice( wikitext.indexOf( ", ", votePSN ), wikitext.indexOf( " (UTC)", votePSN ) );
successful = false;▼
//Get close
if( typeof close === 'undefined' ) {
close = wikitext.slice( wikitext.indexOf( "(UTC) - ", votePSN ), wikitext.indexOf( "
//Trim out signature markup (if exists)
var sigStuff = [" <span"," <b"," <i"," \'\'"," --"," <font"," &#"];
for ( i = 0; i < sigStuff.length; i++ ) {
var psnStuff = close.indexOf( sigStuff[i] );
if ( psnStuff > 0 ) {
close = close.slice( 0, psnStuff );
}
}
}
}
var record = "{{Recent RfX|A|" + username + "|" + rfaTotal + "|" + date + "|" + supports + "|" + opposes + "|" + neutrals + "|" + close + "}}";
var rfarow = "{{rfarow|" + username + "|" + rfaTotal + "|" + date + "|" + close + "|" + supports + "|" + opposes + "|" + neutrals + "|" + closer + "}}";
rfaRecent( record );
//Should be good for the new methods. Make sure to test.
incRfaYear( successful );
yearRfas( record );
/*if( successful ) {
srfas( rfarow );
incUAC();
}
else {
UAC( rfarow );
incSRFA();
}*/
} catch ( e ) {
console.log( "Content request error: " + e.message );
Line 127 ⟶ 150:
console.log( "While getting the wikitext, there was an AJAX error." );
} );
}
function incRfaYear( successful ) {
//Incriment Wikipedia:Requests for adminship by year based on param successful
}
function yearRfas( record ) {
//Update Wikipedia:2017 requests for adminship
//Build in to replace 2017 with variable for current year
}
|