From fbc46fec2c1f8bb8512cbdd50ae4e0efea7303f4 Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Thu, 9 Aug 2012 18:16:27 +0200 Subject: [PATCH] (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 --- skins/common/preview.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ); -- 2.20.1