Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php |
— | — | @@ -85,11 +85,7 @@ |
86 | 86 | 'proofreadpage.article', |
87 | 87 | new ResourceLoaderFileModule( |
88 | 88 | array( |
89 | | - 'scripts' => 'extensions/ProofreadPage/proofread_article.js', |
90 | | - 'messages'=> array( |
91 | | - 'proofreadpage_source', |
92 | | - 'proofreadpage_source_message' |
93 | | - ) |
| 89 | + 'scripts' => 'extensions/ProofreadPage/proofread_article.js' |
94 | 90 | ) |
95 | 91 | ) |
96 | 92 | ); |
— | — | @@ -357,11 +353,6 @@ |
358 | 354 | return true; |
359 | 355 | } |
360 | 356 | |
361 | | - function prepareArticle( $out ) { |
362 | | - $out->addModules( 'proofreadpage.article' ); |
363 | | - $this->displayProofreadingStatus( $out ); |
364 | | - } |
365 | | - |
366 | 357 | function prepareIndex( $out ) { |
367 | 358 | $out->addModules( 'proofreadpage.index' ); |
368 | 359 | $out->addInlineScript(" |
— | — | @@ -1420,7 +1411,7 @@ |
1421 | 1412 | * |
1422 | 1413 | * @param $out Object: OutputPage object |
1423 | 1414 | */ |
1424 | | - function displayProofreadingStatus( $out ) { |
| 1415 | + function prepareArticle( $out ) { |
1425 | 1416 | global $wgTitle, $wgUser; |
1426 | 1417 | |
1427 | 1418 | $id = $wgTitle->mArticleID; |
— | — | @@ -1528,7 +1519,11 @@ |
1529 | 1520 | $indexlink = ''; |
1530 | 1521 | if( $indextitle ) { |
1531 | 1522 | $sk = $wgUser->getSkin(); |
1532 | | - $indexlink = $sk->makeKnownLink( "$index_namespace:$indextitle", '[index]' ); |
| 1523 | + $nt = Title::makeTitleSafe( $index_ns_index, $indextitle ); |
| 1524 | + $indexlink = $sk->link( $nt, wfMsg( 'proofreadpage_source' ), |
| 1525 | + array( 'title' => wfMsg( 'proofreadpage_source_message' ) ) ); |
| 1526 | + $out->addInlineScript( ResourceLoader::makeConfigSetScript( array( 'proofreadpage_source_href' => $indexlink ) ) ); |
| 1527 | + $out->addModules( 'proofreadpage.article' ); |
1533 | 1528 | } |
1534 | 1529 | |
1535 | 1530 | $q0 = $n0 * 100 / $n; |
— | — | @@ -1546,7 +1541,6 @@ |
1547 | 1542 | <td align=center class='quality1' width=\"$q1\"></td> |
1548 | 1543 | <td align=center class='quality0' width=\"$q0\"></td> |
1549 | 1544 | $void_cell |
1550 | | -<td ><span id=pr_index style=\"visibility:hidden;\">$indexlink</span></td> |
1551 | 1545 | </tr></table>"; |
1552 | 1546 | $out->setSubtitle( $out->getSubtitle() . $output ); |
1553 | 1547 | return true; |
Index: trunk/extensions/ProofreadPage/proofread_article.js |
— | — | @@ -2,24 +2,7 @@ |
3 | 3 | |
4 | 4 | /* add backlink to index page */ |
5 | 5 | function pr_add_source() { |
6 | | - var a = document.getElementById( 'ca-nstab-main' ); |
7 | | - if( !a ) { |
8 | | - return; |
9 | | - } |
10 | | - var q = document.getElementById( 'pr_index' ); |
11 | | - if( q ) { |
12 | | - href = q.firstChild; |
13 | | - if( !href ) { |
14 | | - return; |
15 | | - } |
16 | | - q.removeChild( href ); |
17 | | - href.innerHTML = mediaWiki.msg.get( 'proofreadpage_source' ); |
18 | | - href.setAttribute( 'title', mediaWiki.msg.get( 'proofreadpage_source_message' ) ); |
19 | | - var new_li = document.createElement( 'li' ); |
20 | | - new_li.appendChild( href ); |
21 | | - var new_span = document.createElement( 'span' ); |
22 | | - new_span.appendChild( new_li ); |
23 | | - a.parentNode.insertBefore( new_span, a.nextSibling ); |
24 | | - } |
| 6 | + $( '#ca-nstab-main' ).after( '<li><span>' + proofreadpage_source_href + '</span></li>' ); |
25 | 7 | } |
26 | | -addOnloadHook( pr_add_source ); |
\ No newline at end of file |
| 8 | + |
| 9 | +$(document).ready( pr_add_source ); |