'jquery.qunit.completenessTest' => array(
'scripts' => 'resources/jquery/jquery.qunit.completenessTest.js',
),
+ 'jquery.spinner' => array(
+ 'scripts' => 'resources/jquery/jquery.spinner.js',
+ 'styles' => 'resources/jquery/jquery.spinner.css',
+ ),
'jquery.suggestions' => array(
'scripts' => 'resources/jquery/jquery.suggestions.js',
'styles' => 'resources/jquery/jquery.suggestions.css',
--- /dev/null
+.loading-spinner {
+ /* @embed */
+ background: transparent url('images/spinner.gif');
+ height: 16px;
+ width: 16px;
+ display: inline-block;
+ vertical-align: middle;
+}
\ No newline at end of file
--- /dev/null
+/**
+ * Functions to replace injectSpinner which makes img tags with spinners
+ */
+( function( $ ) {
+
+$.extend( {
+ /**
+ * Creates a spinner element
+ *
+ * @param id String id of the spinner
+ * @return jQuery spinner
+ */
+ createSpinner: function( id ) {
+ return $( '<div/>' )
+ .attr({
+ id: 'mw-spinner-' + id,
+ class: 'loading-spinner',
+ title: '...',
+ alt: '...'
+ });
+ },
+
+ /**
+ * Removes a spinner element
+ *
+ * @param id
+ */
+ removeSpinner: function( id ) {
+ $( '#mw-spinner-' + id ).remove();
+ }
+} );
+
+/**
+ * Injects a spinner after the given objects
+ *
+ * @param id String id of the spinner
+ */
+$.fn.injectSpinner = function( id ) {
+ return this.after( $.createSpinner( id ) );
+};
+
+} )( jQuery );
\ No newline at end of file