Index: branches/wmf-deployment/skins/common/preview.js |
— | — | @@ -2,15 +2,6 @@ |
3 | 3 | * Live preview script for MediaWiki |
4 | 4 | */ |
5 | 5 | |
6 | | -function setupLivePreview() { |
7 | | - var livePreviewButton = $j('#wpLivePreview'); |
8 | | - |
9 | | - $j('#wpPreview').hide(); |
10 | | - livePreviewButton.show(); |
11 | | - |
12 | | - livePreviewButton.click( doLivePreview ); |
13 | | -} |
14 | | - |
15 | 6 | function doLivePreview( e ) { |
16 | 7 | e.preventDefault(); |
17 | 8 | var previewText = $j('#wpTextbox1').val(); |
— | — | @@ -23,10 +14,10 @@ |
24 | 15 | 'wpEditToken' : editToken, 'wpEdittime': editTime, 'wpStarttime': startTime, 'title' : wgPageName }; |
25 | 16 | |
26 | 17 | // 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(); } ); |
31 | 22 | |
32 | 23 | // Display a loading graphic |
33 | 24 | var loadSpinner = $j('<div class="mw-ajax-loader"/>'); |
— | — | @@ -36,8 +27,6 @@ |
37 | 28 | page.load( wgScript+'?action=submit', |
38 | 29 | postData, |
39 | 30 | function() { |
40 | | - var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats', |
41 | | - '#catlinks']; |
42 | 31 | |
43 | 32 | for( var i=0; i<copyElements.length; ++i) { |
44 | 33 | // For all the specified elements, find the elements in the loaded page |
— | — | @@ -49,10 +38,15 @@ |
50 | 39 | $j(copyElements[i]).attr( 'class', newClasses ); |
51 | 40 | } |
52 | 41 | |
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 | + } ); |
54 | 46 | |
55 | | - $j('#wikiPreview').slideDown(); |
| 47 | + loadSpinner.remove(); |
56 | 48 | } ); |
57 | 49 | } |
58 | 50 | |
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 |
60 | 54 | + /branches/REL1_15/phase3/skins/common/preview.js:51646 |
/branches/sqlite/skins/common/preview.js:58211-58321 |