Merge "Use jquery.spinner when console is pending"

This commit is contained in:
jenkins-bot 2013-12-10 22:36:18 +00:00 committed by Gerrit Code Review
commit 3f9377cd70
2 changed files with 5 additions and 1 deletions

View file

@ -82,7 +82,7 @@ $wgResourceModules['ext.scribunto'] = $sbtpl + array(
$wgResourceModules['ext.scribunto.edit'] = $sbtpl + array(
'scripts' => 'ext.scribunto.edit.js',
'styles' => 'ext.scribunto.edit.css',
'dependencies' => array( 'ext.scribunto', 'mediawiki.api' ),
'dependencies' => array( 'ext.scribunto', 'mediawiki.api', 'jquery.spinner' ),
'messages' => array(
'scribunto-console-title',
'scribunto-console-intro',

View file

@ -17,6 +17,7 @@
question,
_in,
_out,
_$spinner,
lastError = null,
sessionContent = null,
sessionKey = null,
@ -31,6 +32,7 @@
function initConsole() {
_in = document.getElementById( "mw-scribunto-input" );
_out = document.getElementById( "mw-scribunto-output" );
_$spinner = $.createSpinner( { size: 'small', type: 'block' } );
recalculateInputHeight();
println( mw.msg( 'scribunto-console-intro' ), 'mw-scribunto-message' );
@ -208,9 +210,11 @@
function setPending() {
pending = true;
_in.readOnly = true;
_$spinner.insertBefore( _in );
}
function clearPending() {
_$spinner.remove();
pending = false;
_in.readOnly = false;
}