Aus OPwiki
(Unterschied zwischen Versionen)
Version vom 17:20, 7. Mär. 2009
if ( wgNamespaceNumber == 6 && wgAction == "view" ) {
addOnloadHook ( init_thumbnail_regenrator ) ;
}
function init_thumbnail_regenrator () {
var urltitle = encodeURIComponent ( wgTitle.split(" ").join("_") ) ;
var a1_i18n = {
'es' : 'Generar miniatura',
'en' : 'Generate thumbnail',
'de' : 'Thumbnail erzeugen'
};
var a2_i18n = {
'es' : 'Purgar página',
'en' : 'Purge page',
'de' : 'Cache leeren'
};
var tb = document.getElementById ( "p-tb" ) ;
var ul = tb.getElementsByTagName("ul")[0] ;
var li1 = document.createElement ( "li" ) ;
var li2 = document.createElement ( "li" ) ;
var a1 = document.createElement ( "a" ) ;
var a2 = document.createElement ( "a" ) ;
a1.appendChild ( document.createTextNode ( a1_i18n[wgUserLanguage] || a1_i18n['en'] ) ) ;
a2.appendChild ( document.createTextNode ( a2_i18n[wgUserLanguage] || a2_i18n['en'] ) ) ;
a1.href = wgScriptPath + "/thumb.php?w=800&f=" + urltitle ;
a2.href = wgScript + "?action=purge&title=Image:" + urltitle ;
li1.appendChild ( a1 ) ;
li2.appendChild ( a2 ) ;
ul.appendChild ( li1 ) ;
ul.appendChild ( li2 ) ;
}