r62346 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62345‎ | r62346 | r62347 >
Date:00:01, 12 February 2010
Author:werdna
Status:ok
Tags:
Comment:
Update preview.js from trunk -- used for LiquidThreads update
Modified paths:
  • /branches/wmf-deployment/skins/common/preview.js (replaced) (history)

Diff [purge]

Index: branches/wmf-deployment/skins/common/preview.js
@@ -2,15 +2,6 @@
33 * Live preview script for MediaWiki
44 */
55
6 -function setupLivePreview() {
7 - var livePreviewButton = $j('#wpLivePreview');
8 -
9 - $j('#wpPreview').hide();
10 - livePreviewButton.show();
11 -
12 - livePreviewButton.click( doLivePreview );
13 -}
14 -
156 function doLivePreview( e ) {
167 e.preventDefault();
178 var previewText = $j('#wpTextbox1').val();
@@ -23,10 +14,10 @@
2415 'wpEditToken' : editToken, 'wpEdittime': editTime, 'wpStarttime': startTime, 'title' : wgPageName };
2516
2617 // Hide active diff, used templates, old preview if shown
27 - $j('#wikiDiff').slideUp();
28 - $j('#wikiPreview').slideUp();
29 - $j('.templatesUsed').slideUp();
30 - $j('.hiddencats').slideUp();
 18+ var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats',
 19+ '#catlinks'];
 20+
 21+ $j.each( copyElements, function(k,v) { $j(v).fadeOut(); } );
3122
3223 // Display a loading graphic
3324 var loadSpinner = $j('<div class="mw-ajax-loader"/>');
@@ -36,8 +27,6 @@
3728 page.load( wgScript+'?action=submit',
3829 postData,
3930 function() {
40 - var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats',
41 - '#catlinks'];
4231
4332 for( var i=0; i<copyElements.length; ++i) {
4433 // For all the specified elements, find the elements in the loaded page
@@ -49,10 +38,15 @@
5039 $j(copyElements[i]).attr( 'class', newClasses );
5140 }
5241
53 - loadSpinner.remove();
 42+ $j.each( copyElements, function(k,v) {
 43+ // Don't belligerently show elements that are supposed to be hidden
 44+ $j(v).fadeIn( 'fast', function() { $j(this).css('display', ''); } );
 45+ } );
5446
55 - $j('#wikiPreview').slideDown();
 47+ loadSpinner.remove();
5648 } );
5749 }
5850
59 -js2AddOnloadHook( setupLivePreview );
 51+$j(document).ready( function() {
 52+ $j('#wpPreview').click( doLivePreview );
 53+} );
Property changes on: branches/wmf-deployment/skins/common/preview.js
___________________________________________________________________
Name: svn:mergeinfo
6054 + /branches/REL1_15/phase3/skins/common/preview.js:51646
/branches/sqlite/skins/common/preview.js:58211-58321

Status & tagging log