e.preventDefault();
+ // Deprecated: Use mw.hook instead
$( mw ).trigger( 'LivePreviewPrepare' );
$wikiPreview = $( '#wikiPreview' );
// Load new preview data.
// TODO: This should use the action=parse API instead of loading the entire page
- // Though that requires figuring out how to conver that raw data into proper HTML.
+ // Though that requires figuring out how to convert that raw data into proper HTML.
$previewDataHolder.load( targetUrl + ' ' + copySelectors.join( ',' ), postData, function () {
var i, $from;
// Copy the contents of the specified elements from the loaded page to the real page.
.attr( 'class', $from.attr( 'class' ) );
}
+ // Deprecated: Use mw.hook instead
+ $( mw ).trigger( 'LivePreviewDone', [copySelectors] );
+
+ mw.hook( 'wikipage.content' ).fire( $wikiPreview );
+
$spinner.remove();
$copyElements.animate( {
opacity: 1
}, 'fast' );
-
- $( mw ).trigger( 'LivePreviewDone', [copySelectors] );
} );
}