* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '83';
+$wgStyleVersion = '84';
# Server-side caching:
wfProfileOut( $fname );
return $bar;
}
-}
-
+
+}
\ No newline at end of file
$output = $wgParser->parse( $revision->getText(), $title, new ParserOptions() );
return $output->getText();
}
- return '';
+ return wfMsgHtml( 'license-nopreview' );
}
/**
<tr>" );
if( $useAjaxLicencePreview ) {
$wgOut->addHtml( "
- <td id=\"mw-licence-preview\" colspan=\"2\"></td>
+ <td></td>
+ <td id=\"mw-licence-preview\"></td>
</tr>
<tr>" );
}
'license' => 'Licensing',
'nolicense' => 'None selected',
'licenses' => '-', # don't translate or duplicate this message to other languages
+'license-nopreview' => '(Preview not available)',
'upload_source_url' => ' (a valid, publicly accessible URL)',
'upload_source_file' => ' (a file on your computer)',
'license',
'nolicense',
'licenses',
+ 'license-nopreview',
'upload_source_url',
'upload_source_file',
),
if( licence in this.responseCache ) {
this.showPreview( this.responseCache[licence] );
} else {
+ injectSpinner( document.getElementById( 'wpLicense' ), 'licence' );
sajax_do_call( 'UploadForm::ajaxGetLicencePreview', [licence],
function( result ) {
wgUploadLicenceObj.processResult( result, licence );
},
'processResult' : function( result, licence ) {
+ removeSpinner( 'licence' );
this.showPreview( result.responseText );
this.responseCache[licence] = result.responseText;
},
'showPreview' : function( preview ) {
var previewPanel = document.getElementById( 'mw-licence-preview' );
- if( previewPanel.innerHTML != preview ) {
+ if( previewPanel.innerHTML != preview )
previewPanel.innerHTML = preview;
- }
}
-
+
}
addOnloadHook( licenseSelectorFixup );
\ No newline at end of file
return true;
}
+/**
+ * Inject a cute little progress spinner after the specified element
+ *
+ * @param element Element to inject after
+ * @param id Identifier string (for use with removeSpinner(), below)
+ */
+function injectSpinner( element, id ) {
+ var spinner = document.createElement( "img" );
+ spinner.id = "mw-spinner-" + id;
+ spinner.src = stylepath + "/common/images/spinner.gif";
+ spinner.alt = spinner.title = "...";
+ if( element.nextSibling ) {
+ element.parentNode.insertBefore( spinner, element.nextSibling );
+ } else {
+ element.parentNode.appendChild( spinner );
+ }
+}
+
+/**
+ * Remove a progress spinner added with injectSpinner()
+ *
+ * @param id Identifier string
+ */
+function removeSpinner( id ) {
+ var spinner = document.getElementById( "mw-spinner-" + id );
+ if( spinner ) {
+ spinner.parentNode.removeChild( spinner );
+ }
+}
+
function runOnloadHook() {
// don't run anything below this for non-dom browsers
if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName)) {