r65014 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65013‎ | r65014 | r65015 >
Date:09:40, 14 April 2010
Author:thomasv
Status:ok
Tags:
Comment:
load the image after everything, because it can slow things down
Modified paths:
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/proofread.js
@@ -656,10 +656,14 @@
657657
658658
659659
 660+function pr_load_image() {
 661+ pr_container.innerHTML = "<img id=\"ProofReadImage\" src=\""
 662+ + escapeQuotesHTML(proofreadPageViewURL)
 663+ + "\" width=\"" + img_width + "\" />";
 664+}
660665
661666
662667
663 -
664668 function pr_setup() {
665669
666670 self.pr_horiz = (self.proofreadpage_default_layout=='horizontal');
@@ -703,14 +707,12 @@
704708 } else {
705709 //prevent the container from being resized once the image is downloaded.
706710 img_width = pr_horiz?0:parseInt(pr_width/2-70)-20;
707 - pr_container.innerHTML = "<img id=\"ProofReadImage\" src=\""
708 - + escapeQuotesHTML(proofreadPageViewURL)
709 - + "\" width=\"" + img_width + "\" />";
710711 pr_container.onmousedown = pr_grab;
711712 pr_container.onmousemove = pr_move;
712713 if (pr_container.addEventListener)
713714 pr_container.addEventListener('DOMMouseScroll', pr_zoom_wheel, false);
714715 pr_container.onmousewheel = pr_zoom_wheel;//IE,Opera.
 716+ hookEvent( 'load', pr_load_image );
715717 }
716718
717719 table.setAttribute("id", "textBoxTable");

Status & tagging log