Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | |
59 | 59 | public static function resourceLoaderRegisterModules() { |
60 | 60 | ResourceLoader::register( |
61 | | - 'proofreadpage.page', |
| 61 | + 'ext.proofreadpage.page', |
62 | 62 | new ResourceLoaderFileModule( |
63 | 63 | array( |
64 | 64 | 'scripts' => 'extensions/ProofreadPage/proofread.js', |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | ); |
84 | 84 | |
85 | 85 | ResourceLoader::register( |
86 | | - 'proofreadpage.article', |
| 86 | + 'ext.proofreadpage.article', |
87 | 87 | new ResourceLoaderFileModule( |
88 | 88 | array( |
89 | 89 | 'scripts' => 'extensions/ProofreadPage/proofread_article.js' |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | ); |
93 | 93 | |
94 | 94 | ResourceLoader::register( |
95 | | - 'proofreadpage.index', |
| 95 | + 'ext.proofreadpage.index', |
96 | 96 | new ResourceLoaderFileModule( array( 'scripts' => 'extensions/ProofreadPage/proofread_index.js' ) ) |
97 | 97 | ); |
98 | 98 | |
— | — | @@ -354,7 +354,7 @@ |
355 | 355 | } |
356 | 356 | |
357 | 357 | function prepareIndex( $out ) { |
358 | | - $out->addModules( 'proofreadpage.index' ); |
| 358 | + $out->addModules( 'ext.proofreadpage.index' ); |
359 | 359 | $out->addInlineScript(" |
360 | 360 | var prp_index_attributes = \"" . Xml::escapeJsString( wfMsgForContent( 'proofreadpage_index_attributes' ) ) . "\"; |
361 | 361 | var prp_default_header = \"" . Xml::escapeJsString( wfMsgGetKey( 'proofreadpage_default_header', true, true, false ) ) . "\"; |
— | — | @@ -409,7 +409,7 @@ |
410 | 410 | ); |
411 | 411 | $out->addInlineScript( ResourceLoader::makeConfigSetScript( $jsVars ) ); |
412 | 412 | |
413 | | - $out->addModules( 'proofreadpage.page' ); |
| 413 | + $out->addModules( 'ext.proofreadpage.page' ); |
414 | 414 | |
415 | 415 | return true; |
416 | 416 | } |
— | — | @@ -1523,7 +1523,7 @@ |
1524 | 1524 | $indexlink = $sk->link( $nt, wfMsg( 'proofreadpage_source' ), |
1525 | 1525 | array( 'title' => wfMsg( 'proofreadpage_source_message' ) ) ); |
1526 | 1526 | $out->addInlineScript( ResourceLoader::makeConfigSetScript( array( 'proofreadpage_source_href' => $indexlink ) ) ); |
1527 | | - $out->addModules( 'proofreadpage.article' ); |
| 1527 | + $out->addModules( 'ext.proofreadpage.article' ); |
1528 | 1528 | } |
1529 | 1529 | |
1530 | 1530 | $q0 = $n0 * 100 / $n; |
Index: trunk/extensions/ProofreadPage/proofread_index.js |
— | — | @@ -131,5 +131,4 @@ |
132 | 132 | form.elements['wpTextbox1'].value = result; |
133 | 133 | } |
134 | 134 | |
135 | | -// use hookevent instead of addOnLoadHook, so that the code is evaluated after wikibits.js |
136 | | -hookEvent( 'load', proofreadpage_index_init ); |
\ No newline at end of file |
| 135 | +$(document).ready( proofreadpage_index_init ); |
Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -166,14 +166,8 @@ |
167 | 167 | pageHeader = pageHeader.split( '&' ).join( '&' ); |
168 | 168 | pageFooter = pageFooter.split( '&' ).join( '&' ); |
169 | 169 | |
170 | | - if ( !self.proofreadpage_show_headers ) { |
171 | | - headers_style = 'display:none'; |
172 | | - } else { |
173 | | - headers_style = ''; |
174 | | - } |
175 | | - |
176 | 170 | container.innerHTML = '' + |
177 | | - '<div id="prp_header" style="' + headers_style + '">' + |
| 171 | + '<div id="prp_header" style="">' + |
178 | 172 | '<span style="color:gray;font-size:80%;line-height:100%;">' + |
179 | 173 | escapeQuotesHTML( mediaWiki.msg.get( 'proofreadpage_header' ) ) + '</span>' + |
180 | 174 | '<textarea name="wpHeaderTextbox" rows="2" cols="80" tabindex=1>' + pageHeader + '</textarea><br />' + |
— | — | @@ -181,7 +175,7 @@ |
182 | 176 | escapeQuotesHTML( mediaWiki.msg.get( 'proofreadpage_body' ) ) + '</span></div>' + |
183 | 177 | '<textarea name="wpTextbox1" id="wpTextbox1" tabindex=1 style="height:' + ( self.DisplayHeight - 6 ) + 'px;">' + |
184 | 178 | pageBody + '</textarea>' + |
185 | | - '<div id="prp_footer" style="' + headers_style + '">' + |
| 179 | + '<div id="prp_footer" style="">' + |
186 | 180 | '<span style="color:gray;font-size:80%;line-height:100%;">' + |
187 | 181 | escapeQuotesHTML( mediaWiki.msg.get( 'proofreadpage_footer' ) ) + '</span><br />' + |
188 | 182 | '<textarea name="wpFooterTextbox" rows="2" cols="80" tabindex=1>' + |
— | — | @@ -723,7 +717,7 @@ |
724 | 718 | } |
725 | 719 | |
726 | 720 | function pr_setup() { |
727 | | - self.pr_horiz = ( self.proofreadpage_default_layout ==' horizontal' ); |
| 721 | + self.pr_horiz = ( self.proofreadpage_default_layout == 'horizontal' ); |
728 | 722 | if( !proofreadPageIsEdit ) { |
729 | 723 | pr_horiz = false; |
730 | 724 | } |
— | — | @@ -804,6 +798,11 @@ |
805 | 799 | pr_make_edit_area( self.text_container, new_text.value ); |
806 | 800 | var copywarn = document.getElementById( 'editpage-copywarn' ); |
807 | 801 | f.insertBefore( table, copywarn ); |
| 802 | + if ( !self.proofreadpage_show_headers ) { |
| 803 | + hookEvent( 'load', pr_toggle_visibility ); |
| 804 | + } else { |
| 805 | + hookEvent( 'load', pr_reset_size ); |
| 806 | + } |
808 | 807 | } else { |
809 | 808 | self.text_container.appendChild( new_text ); |
810 | 809 | f.appendChild( self.table ); |
— | — | @@ -951,10 +950,10 @@ |
952 | 951 | } |
953 | 952 | } |
954 | 953 | |
955 | | -addOnloadHook( pr_init ); |
956 | | -addOnloadHook( pr_init_tabs ); |
| 954 | +$(document).ready( pr_init ); |
| 955 | +$(document).ready( pr_init_tabs ); |
| 956 | +$(document).ready( pr_initzoom ); |
957 | 957 | |
958 | | -hookEvent( 'load', pr_initzoom ); |
959 | 958 | |
960 | 959 | /* Quality buttons */ |
961 | 960 | self.pr_add_quality = function( form, value ) { |
— | — | @@ -1032,4 +1031,4 @@ |
1033 | 1032 | } |
1034 | 1033 | } |
1035 | 1034 | |
1036 | | -addOnloadHook( pr_add_quality_buttons ); |
\ No newline at end of file |
| 1035 | +$(document).ready( pr_add_quality_buttons ); |