|
|
| Línea 3: |
Línea 3: |
| font-family: "Liberation Sans", Arial, Helvetica, FreeSans, sans-serif; | | font-family: "Liberation Sans", Arial, Helvetica, FreeSans, sans-serif; |
| } | | } |
|
| |
|
| |
|
| /** Template stylings **/ | | /** Template stylings **/ |
| Línea 202: |
Línea 201: |
| margin: 4px; | | margin: 4px; |
| } | | } |
|
| |
| /**
| |
| * Frame parser (for [[Template:Grid]])
| |
| *
| |
| * Requests the urls for all the animated grids on a page in 2
| |
| * API requests (due to a bug, 1 API request when it is fixed)
| |
| * and appends them to the correct location.
| |
| */
| |
| var baseURL = '/', wikiURL = '/wiki/', $grids = $( '.grid' ), titles = [], titleCount = 0, section = 0;
| |
| if ( $grids.length ) {
| |
| $grids.each( function() {
| |
| var imgs = $( this ).data( 'imgs' ), mod = $( this ).data( 'mod' );
| |
| if ( !imgs ) {
| |
| return true;
| |
| }
| |
|
| |
| imgs = imgs.split( ';' );
| |
| imgs.shift();
| |
| $.each( imgs, function() {
| |
| if ( !this.trim() ) {
| |
| return true;
| |
| }
| |
|
| |
| if ( titleCount === 50 ) {
| |
| titleCount = 0;
| |
| section++;
| |
| }
| |
| if ( !titles[section] ) {
| |
| titles[section] = '';
| |
| }
| |
|
| |
| if ( this.indexOf( ':' ) > -1 ) {
| |
| this.replace( /([^:]*):?([^,]*)/, function( $, mod, name ) {
| |
| if ( mod.trim().toLowerCase() === 'v' || mod.trim().toLowerCase() === 'vanilla' ) {
| |
| if ( titles[section].indexOf( 'File:Grid ' + name.trim() + '.png' ) < 0 ) {
| |
| titles[section] += 'File:Grid ' + name.trim() + '.png|';
| |
| titleCount++;
| |
| }
| |
| } else {
| |
| if ( titles[section].indexOf( 'File:Grid ' + name.trim() + ' (' + mod.trim() + ').png' ) < 0 ) {
| |
| titles[section] += 'File:Grid ' + name.trim() + ' (' + mod.trim() + ').png|';
| |
| titleCount++;
| |
| }
| |
| }
| |
| } );
| |
| } else {
| |
| this.replace( /([^,]*)/, function( $, name ) {
| |
| if ( !mod || mod.trim().toLowerCase() === 'v' || mod.trim().toLowerCase() === 'vanilla' ) {
| |
| if ( titles[section].indexOf( 'File:Grid ' + name.trim() + '.png' ) < 0 ) {
| |
| titles[section] += 'File:Grid ' + name.trim() + '.png|';
| |
| titleCount++;
| |
| }
| |
| } else {
| |
| if ( titles[section].indexOf( 'File:Grid ' + name.trim() + ' (' + mod.trim() + ').png' ) < 0 ) {
| |
| titles[section] += 'File:Grid ' + name.trim() + ' (' + mod.trim() + ').png|';
| |
| titleCount++;
| |
| }
| |
| }
| |
| } );
| |
| }
| |
| } );
| |
| } );
| |
|
| |
|
| |
| /* [[Template:Infobox]], [[Template:Infobox row]] */ | | /* [[Template:Infobox]], [[Template:Infobox row]] */ |
| .notaninfobox { | | .notaninfobox { |