From: MatmaRex Date: Thu, 9 Aug 2012 16:16:27 +0000 (+0200) Subject: (bug 8618) support for summary preview in live preview X-Git-Tag: 1.31.0-rc.0~22610^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=fbc46fec2c1f8bb8512cbdd50ae4e0efea7303f4;p=lhc%2Fweb%2Fwiklou.git (bug 8618) support for summary preview in live preview We have to check for the existence of .mw-summary-preview and add it if it's missing. See change Idda2e6f7 for more details; this change is analogous. Change-Id: I4f4f91ed3b51a54b645bca9697c2840b717bddf6 --- diff --git a/skins/common/preview.js b/skins/common/preview.js index de4bcff88f..a332a8e4d6 100644 --- a/skins/common/preview.js +++ b/skins/common/preview.js @@ -12,7 +12,7 @@ // Hide active diff, used templates, old preview if shown var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats', - '#catlinks', '#p-lang']; + '#catlinks', '#p-lang', '.mw-summary-preview']; var copySelector = copyElements.join(','); $.each( copyElements, function(k,v) { $(v).fadeOut('fast'); } ); @@ -130,6 +130,11 @@ $( '#p-tb' ).after( $( '
' ).attr( 'id', 'p-lang' ) ); } + // construct space for summary preview if missing + if ( $( '.mw-summary-preview' ).length === 0 ) { + $( '.editCheckboxes' ).before( $( '
' ).addClass( 'mw-summary-preview' ) ); + } + $( '#wpPreview' ).click( doLivePreview ); } ); }) ( jQuery );