MediaWiki:Gadget-wikidebug.js: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
wyswietlaj blad takze w konsoli
dynamicznie aktualizuj licznik bledow oraz ikonke
Linia 34:
'error' : '//upload.wikimedia.org/wikipedia/commons/0/0d/Wikidebug_state_bug_occurred.png'
},
strState = 'active';,
$errorCount = null,
$errorIcon = null;
 
window.onerror = function ( strErrMsg, strFileName, intLine ) {
Linia 45 ⟶ 47:
} );
refreshErrorIndicators();
return false; // forward to default event handler, log on console
};
 
function refreshErrorIndicators() {
if ( $errorCount && $errorIcon ) {
$( '<span>' )errorCount.text( errors.length ? mw.format( '($1)', errors.length ) : '' ),;
$( '<img>' )errorIcon.attr( 'src', stateIcons[ strState ] );
}
}
 
function getBrowser() {
Linia 71 ⟶ 81:
} ).join( '\n' )
).trim();
OOmw.uiloader.alert( $using( '<textarea>oojs-ui-core' ).attrdone( 'rows',function 15 ).text( msg ), {
OO.ui.alert( $( '<textarea>' ).attr( 'rows', 15 ).text( msg ), {
size: 'large',
title size: 'wikidebuglarge',
title: 'wikidebug'
} );
} );
}
 
$( function () {
$errorCount = $( '<span>' );
$errorIcon = $( '<img>' );
refreshErrorIndicators();
$( mw.util.addPortletLink( 'p-personal', '#', 'wikidebug', 'p-wikidebug', 'wikidebug' ) )
.append( [ ' ', $errorCount, $errorIcon ] )
.on( 'click', function ( evtshowInfo ) {;
' ',
$( '<span>' ).text( errors.length ? mw.format( '($1)', errors.length ) : '' ),
$( '<img>' ).attr( 'src', stateIcons[ strState ] )
] )
.on( 'click', function ( evt ) {
mw.loader.using( 'oojs-ui-core' ).done( showInfo );
} );
} );