Wikipedia:Technik/Archiv/MediaWiki:Gadget-ImageSiblings.js und Benutzer:Fomafix/Gadget-ImageSiblings.js: Unterschied zwischen den Seiten
Erscheinungsbild
(Unterschied zwischen Seiten)
Inhalt gelöscht Inhalt hinzugefügt
Leyo (Diskussion | Beiträge) K siehe Disk |
Übernommen von https://de.wikipedia.org/w/index.php?title=MediaWiki:Gadget-ImageSiblings.js&oldid=96883149 Änderungen: protokollrelative Links, mw:ResourceLoader/JavaScript Deprecations, mw:Manual:Coding conventions/JavaScript. |
||
Zeile 1: | Zeile 1: | ||
⚫ | |||
function commonsSiblingsAddScript(url) { |
|||
⚫ | |||
var script = document.createElement('script'); |
|||
jQuery( document ).ready( function ( $ ) { |
|||
script.src = url; |
|||
mw.loader.load( '//toolserver.org/~magnus/file_siblings.php?' + $.param( |
|||
document.body.appendChild(script); |
|||
⚫ | |||
} |
|||
? { |
|||
language: 'commons', |
|||
project: 'wikimedia', |
|||
sort_by_date: 0, |
|||
sib_cat: 1, |
|||
sib_gal: 1, |
|||
mode: 'json', |
|||
file: mw.config.get( 'wgTitle' ), |
|||
⚫ | |||
⚫ | |||
} : { |
|||
language: 'de', |
|||
project: 'wikipedia', |
|||
sort_by_date: 0, |
|||
sib_cat: 1, |
|||
sib_gal: 0, |
|||
mode: 'json', |
|||
file: mw.config.get( 'wgTitle' ), |
|||
⚫ | |||
} |
|||
) ); |
|||
} ); |
|||
function |
function file_siblings_callback( html ) { |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
return; |
|||
} |
|||
⚫ | |||
if ( cd ) { // Commons |
|||
url = "http://toolserver.org/~magnus/file_siblings.php?language=commons&project=wikimedia&sort_by_date=0&sib_cat=1&sib_gal=1&mode=json&file=" + escape ( wgTitle ) ; |
|||
⚫ | |||
⚫ | |||
} else { // Local |
|||
url = "http://toolserver.org/~magnus/file_siblings.php?language=de&project=wikipedia&sort_by_date=0&sib_cat=1&sib_gal=0&mode=json&file=" + escape ( wgTitle ) ; |
|||
⚫ | |||
} |
|||
commonsSiblingsAddScript ( url ) ; |
|||
} |
} |
||
function file_siblings_callback ( html ) { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
addOnloadHook(commonsSiblingsInit); |
Version vom 6. Januar 2012, 23:22 Uhr
if ( mw.config.get( 'wgNamespaceNumber' ) === 6
&& mw.config.get( 'wgAction' ) === 'view' )
jQuery( document ).ready( function ( $ ) {
mw.loader.load( '//toolserver.org/~magnus/file_siblings.php?' + $.param(
document.getElementById( 'commons_descr' )
? {
language: 'commons',
project: 'wikimedia',
sort_by_date: 0,
sib_cat: 1,
sib_gal: 1,
mode: 'json',
file: mw.config.get( 'wgTitle' ),
uselang: mw.config.get( 'wgUserLanguage' ),
message: 'Verwandte Bilder auf<br /><a href="//commons.wikimedia.org/">Wikimedia Commons</a>'
} : {
language: 'de',
project: 'wikipedia',
sort_by_date: 0,
sib_cat: 1,
sib_gal: 0,
mode: 'json',
file: mw.config.get( 'wgTitle' ),
message: 'Verwandte Bilder (lokal)'
}
) );
} );
function file_siblings_callback( html ) {
var file = document.getElementById( 'file' );
file.innerHTML = html + file.innerHTML;
// jQuery( '#file_siblings_table' ).fadeTo( 'fast', 0.5 );
}