Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -666,9 +666,9 @@ |
667 | 667 | pr_zoom( 0 ); |
668 | 668 | } |
669 | 669 | |
670 | | -function pr_load_image( view_url ) { |
| 670 | +function pr_load_image( ) { |
671 | 671 | pr_container.innerHTML = '<img id="ProofReadImage" src="' + |
672 | | - escapeQuotesHTML( view_url ) + '" width="' + img_width + '" />'; |
| 672 | + escapeQuotesHTML( self.proofreadPageViewURL ) + '" width="' + img_width + '" />'; |
673 | 673 | pr_zoom( 0 ); |
674 | 674 | } |
675 | 675 | |
— | — | @@ -721,7 +721,7 @@ |
722 | 722 | if( !w ) { |
723 | 723 | w = 1024; /* Default size in edit mode */ |
724 | 724 | } |
725 | | - var view_url = pr_image_url( Math.min( w, self.proofreadPageWidth ) ); |
| 725 | + self.proofreadPageViewURL = pr_image_url( Math.min( w, self.proofreadPageWidth ) ); |
726 | 726 | // prevent the container from being resized once the image is downloaded. |
727 | 727 | img_width = pr_horiz ? 0 : parseInt( pr_width / 2 - 70 ) - 20; |
728 | 728 | pr_container.onmousedown = pr_grab; |
— | — | @@ -730,7 +730,8 @@ |
731 | 731 | pr_container.addEventListener( 'DOMMouseScroll', pr_zoom_wheel, false ); |
732 | 732 | } |
733 | 733 | pr_container.onmousewheel = pr_zoom_wheel; // IE, Opera. |
734 | | - pr_load_image( view_url ); |
| 734 | + /* Load the image after page setup, so that user-defined hooks do not have to wait for it. */ |
| 735 | + hookEvent( 'load', pr_load_image ); |
735 | 736 | } |
736 | 737 | |
737 | 738 | table.setAttribute( 'id', 'textBoxTable' ); |