* SVG files will now show the actual width in the SVG's specified units
in the metadata box.
* Added ResourceLoader module "jquery.jStorage".
+* (bug 39273) Added AJAX support for "Show changes" (diff) in LivePreview.
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
* (bug 27111) Cascading foreign file repos now fetch shared descriptions properly.
* EXIF below sea level GPS altitude data is now shown correctly.
* (bug 39284) jquery.tablesorter should not consider "."" or "?"" to be a currency.
+* (bug 39273) "Show changes" should not be incorrectly displayed in the Live Preview state.
=== API changes in 1.20 ===
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
$( mw ).trigger( 'LivePreviewPrepare' );
var postData = $('#editform').formToArray();
- postData.push( { 'name' : 'wpPreview', 'value' : '1' } );
+ postData.push( { 'name' : e.target.name, 'value' : '1' } );
// Hide active diff, used templates, old preview if shown
- var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats',
+ var copyElements = ['#wikiPreview', '#wikiDiff', '.templatesUsed', '.hiddencats',
'#catlinks', '#p-lang', '.mw-summary-preview'];
var copySelector = copyElements.join(',');
$( '.editCheckboxes' ).before( $( '<div>' ).addClass( 'mw-summary-preview' ) );
}
- $( '#wpPreview' ).click( doLivePreview );
+ // construct space for diff if missing. also load diff styles.
+ if ( !document.getElementById( 'wikiDiff' ) && document.getElementById( 'wikiPreview' ) ) {
+ $( '#wikiPreview' ).after( $( '<div>' ).attr( 'id', 'wikiDiff' ) );
+ // diff styles are by default only loaded when needed
+ // if there was no diff container, we can expect the styles not to be there either
+ mw.loader.load( 'mediawiki.action.history.diff' );
+ }
+
+ $( '#wpPreview, #wpDiff' ).click( doLivePreview );
} );
}) ( jQuery );