In today's world,
User:Technical 13/Scripts/Gadget-closeRfC.js is a topic of interest that has captured the attention of many people. Whether due to its relevance in society or its impact on daily life,
User:Technical 13/Scripts/Gadget-closeRfC.js has generated a constant debate in different areas. From its influence in politics to its presence in the cultural sphere,
User:Technical 13/Scripts/Gadget-closeRfC.js has managed to position itself as an issue of indisputable importance. Over the years,
User:Technical 13/Scripts/Gadget-closeRfC.js has evolved and adapted to the changing demands of society, making it an extremely interesting topic and worthy of in-depth analysis. Through this article, we will explore the different facets of
User:Technical 13/Scripts/Gadget-closeRfC.js and its impact on the world today.
/*<nowiki>
* Script to help close discussions listed at ]
*/
$( document ).ready( function () {
var initiatedSection = {}, initiatedSections = ;
function createSections() {
$( 'div#mw-content-text' ).find( 'h3' ).each( function( i ) {
$( this ).nextUntil( 'h3' ).wrapAll( '<div id="section_' + i + '" class="initiated">' );
var thisH3Header = $( this );
$( this ).remove();
$( 'div#section_' + i ).prepend( thisH3Header );
} );
}
function createSectionArray() {
$( 'span.wpRfC' ).each( function() {
var initiatedRaw = $( this ).attr( 'class' ).match( /.*?(*)_(*).*/ );
var initiatedType = initiatedRaw;
switch ( initiatedType ) {
case 'tban' :
var initiatedModifier = 10;
break;
case 'afd' :
case 'cfd' :
case 'ffd' :
case 'mfd' :
case 'rfd' :
case 'tfd' :
case 'drv' :
case 'mrv' :
case 'rmv' :
case 'xfd' :
var initiatedModifier = ( 30 / 7 );
break;
default :
var initiatedModifier = 1;
break;
}
var initiatedAgo = initiatedRaw;
var initiatedSorter = Math.floor( initiatedAgo * initiatedModifier );
// console.info( 'Raw: %s :Type: %s :Mod: %s :Ago: %d :Sorter: %d', initiatedRaw, initiatedType, initiatedModifier, initiatedAgo, initiatedSorter );
initiatedSection = { Sorter: initiatedSorter, content: $( this ).parents( 'div.initiated' ).html() };
initiatedSections = initiatedSection;
$( this ).parents( 'div.initiated' ).remove();
} );
}
// Create a deferred object
var dfd = $.Deferred();
dfd.done(
createSections,
createSectionArray
).done( function() {
initiatedSections.sort( function ( a, b ) {
var v = ( a.Sorter > b.Sorter ) ? 1 : ( a.Sorter < b.Sorter ) ? -1 : 0;
return v;
} ).reverse();
var newContent = ;
$.each( initiatedSections, function() {
newContent = $( this ).content;
} );
var uniqueSections = ;
$.each( newContent, function( i, iS ) {
if ( $.inArray( iS, uniqueSections ) === -1 ) {
uniqueSections.push( iS );
}
} );
$( 'div#mw-content-text' ).append( uniqueSections.join( '\n' ) );
// createSections();
// Need to sort the TOC as well
} );
dfd.resolve();
} );
//</nowiki>