Bug 23580. Add two new jquery events, LivePreviewPrepare and LivePreviewDone.
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Fri, 21 May 2010 14:02:15 +0000 (14:02 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Fri, 21 May 2010 14:02:15 +0000 (14:02 +0000)
Scripts like Navigation Popups can use this to bind to these events so they can
setup their code to work with the previews.

Patch by User:Amalthea

CREDITS
RELEASE-NOTES
skins/common/preview.js

diff --git a/CREDITS b/CREDITS
index c364add..2db17bf 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -66,6 +66,7 @@ following names for their contribution to the product.
 == Patch Contributors ==
 * Agbad
 * Ahmad Sherif
+* Amalthea
 * Antonio Ospite
 * Azliq7
 * Bawolff
index 132b974..2cd206d 100644 (file)
@@ -73,6 +73,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 23429) Added new hook WatchlistEditorBuildRemoveLine
 * (bug 18488) Added maintenance script refreshCategoryCounts.php
 * (bug 22844) Added support for WinCache object caching
+* (bug 23580) Add two new events to LivePreview so that scripts can be
+  notified about the beginning and finishing of LivePreview actions
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index 7ad3df0..d78a62b 100644 (file)
@@ -4,6 +4,8 @@
 
 function doLivePreview( e ) {
        e.preventDefault();
+
+       $j( mw ).trigger( 'LivePreviewPrepare' );
        
        var postData = $j('#editform').formToArray();
        postData.push( { 'name' : 'wpPreview', 'value' : '1' } );
@@ -45,6 +47,8 @@ function doLivePreview( e ) {
                        } );
                        
                        loadSpinner.remove();
+
+                       $j( mw ).trigger( 'LivePreviewDone', [copyElements] );
                } );
 }