Index: trunk/phase3/maintenance/storage/trackBlobs.php |
— | — | @@ -6,6 +6,8 @@ |
7 | 7 | if ( count( $args ) < 1 ) { |
8 | 8 | echo "Usage: php trackBlobs.php <cluster> [... <cluster>]\n"; |
9 | 9 | echo "Adds blobs from a given ES cluster to the blob_tracking table\n"; |
| 10 | + echo "Automatically deletes the tracking table and starts from the start again when restarted.\n"; |
| 11 | + |
10 | 12 | exit( 1 ); |
11 | 13 | } |
12 | 14 | $tracker = new TrackBlobs( $args ); |
— | — | @@ -42,9 +44,11 @@ |
43 | 45 | |
44 | 46 | function initTrackingTable() { |
45 | 47 | $dbw = wfGetDB( DB_MASTER ); |
46 | | - if ( !$dbw->tableExists( 'blob_tracking' ) ) { |
47 | | - $dbw->sourceFile( dirname( __FILE__ ) . '/blob_tracking.sql' ); |
| 48 | + if ( $dbw->tableExists( 'blob_tracking' ) ) { |
| 49 | + $dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_tracking' ) ); |
| 50 | + $dbw->query( 'DROP TABLE ' . $dbw->tableName( 'blob_orphans' ) ); |
48 | 51 | } |
| 52 | + $dbw->sourceFile( dirname( __FILE__ ) . '/blob_tracking.sql' ); |
49 | 53 | } |
50 | 54 | |
51 | 55 | function getTextClause() { |
— | — | @@ -240,11 +244,7 @@ |
241 | 245 | return; |
242 | 246 | } |
243 | 247 | |
244 | | - # Wait until the blob_tracking table is available in the slave |
245 | 248 | $dbw = wfGetDB( DB_MASTER ); |
246 | | - $dbr = wfGetDB( DB_SLAVE ); |
247 | | - $pos = $dbw->getMasterPos(); |
248 | | - $dbr->masterPosWait( $pos, 100000 ); |
249 | 249 | |
250 | 250 | foreach ( $this->clusters as $cluster ) { |
251 | 251 | echo "Searching for orphan blobs in $cluster...\n"; |
Index: trunk/phase3/maintenance/storage/blob_tracking.sql |
— | — | @@ -22,10 +22,16 @@ |
23 | 23 | -- The CGZ content hash, or null |
24 | 24 | bt_cgz_hash varbinary(255), |
25 | 25 | |
| 26 | + -- The URL this blob is to be moved to |
| 27 | + bt_new_url varbinary(255), |
| 28 | + |
| 29 | + -- True if the text table has been updated to point to bt_new_url |
| 30 | + bt_moved bool not null default 0, |
| 31 | + |
26 | 32 | PRIMARY KEY (bt_rev_id, bt_text_id), |
27 | 33 | |
28 | 34 | -- Sort by page for easy CGZ recompression |
29 | | - KEY (bt_page, bt_rev_id), |
| 35 | + KEY (bt_moved, bt_page, bt_rev_id), |
30 | 36 | |
31 | 37 | -- For fast orphan searches |
32 | 38 | KEY (bt_text_id), |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1050,8 +1050,6 @@ |
1051 | 1051 | 'rc_categories_any', |
1052 | 1052 | 'rc-change-size', |
1053 | 1053 | 'newsectionsummary', |
1054 | | - 'rc-enhanced-expand', |
1055 | | - 'rc-enhanced-hide', |
1056 | 1054 | ), |
1057 | 1055 | 'recentchangeslinked' => array( |
1058 | 1056 | 'recentchangeslinked', |
Index: trunk/phase3/skins/common/enhancedchanges.js |
— | — | @@ -1,39 +0,0 @@ |
2 | | -/* |
3 | | - JavaScript file for enhanced recentchanges |
4 | | - */ |
5 | | - |
6 | | -/* |
7 | | - * Add the CSS to hide parts that should be collapsed |
8 | | - * |
9 | | - * We do this with JS so everything will be expanded by default |
10 | | - * if JS is disabled |
11 | | - */ |
12 | | -appendCSS('.mw-changeslist-hidden {'+ |
13 | | - ' display:none;'+ |
14 | | - '}'+ |
15 | | - 'div.mw-changeslist-expanded {'+ |
16 | | - ' display:block;'+ |
17 | | - '}'+ |
18 | | - 'span.mw-changeslist-expanded {'+ |
19 | | - ' display:inline !important;'+ |
20 | | - '}' |
21 | | -); |
22 | | - |
23 | | -/* |
24 | | - * Switch an RC line between hidden/shown |
25 | | - * @param int idNumber : the id number of the RC group |
26 | | -*/ |
27 | | -function toggleVisibility(idNumber) { |
28 | | - var openarrow = document.getElementById("mw-rc-openarrow-"+idNumber); |
29 | | - var closearrow = document.getElementById("mw-rc-closearrow-"+idNumber); |
30 | | - var subentries = document.getElementById("mw-rc-subentries-"+idNumber); |
31 | | - if (openarrow.className == 'mw-changeslist-expanded') { |
32 | | - openarrow.className = 'mw-changeslist-hidden'; |
33 | | - closearrow.className = 'mw-changeslist-expanded'; |
34 | | - subentries.className = 'mw-changeslist-expanded'; |
35 | | - } else { |
36 | | - openarrow.className = 'mw-changeslist-expanded'; |
37 | | - closearrow.className = 'mw-changeslist-hidden'; |
38 | | - subentries.className = 'mw-changeslist-hidden'; |
39 | | - } |
40 | | -} |
Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -104,6 +104,22 @@ |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
| 108 | +// for enhanced RecentChanges |
| 109 | +function toggleVisibility(_levelId, _otherId, _linkId) { |
| 110 | + var thisLevel = document.getElementById(_levelId); |
| 111 | + var otherLevel = document.getElementById(_otherId); |
| 112 | + var linkLevel = document.getElementById(_linkId); |
| 113 | + if (thisLevel.style.display == 'none') { |
| 114 | + thisLevel.style.display = 'block'; |
| 115 | + otherLevel.style.display = 'none'; |
| 116 | + linkLevel.style.display = 'inline'; |
| 117 | + } else { |
| 118 | + thisLevel.style.display = 'none'; |
| 119 | + otherLevel.style.display = 'inline'; |
| 120 | + linkLevel.style.display = 'none'; |
| 121 | + } |
| 122 | +} |
| 123 | + |
108 | 124 | function showTocToggle() { |
109 | 125 | if (document.createTextNode) { |
110 | 126 | // Uses DOM calls to avoid document.write + XHTML issues |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -388,24 +388,7 @@ |
389 | 389 | * Generate a list of changes using an Enhanced system (use javascript). |
390 | 390 | */ |
391 | 391 | class EnhancedChangesList extends ChangesList { |
392 | | - |
393 | 392 | /** |
394 | | - * Add the JavaScript file for enhanced changeslist |
395 | | - * @ return string |
396 | | - */ |
397 | | - public function beginRecentChangesList() { |
398 | | - global $wgStylePath, $wgStyleVersion; |
399 | | - $this->rc_cache = array(); |
400 | | - $this->rcMoveIndex = 0; |
401 | | - $this->rcCacheIndex = 0; |
402 | | - $this->lastdate = ''; |
403 | | - $this->rclistOpen = false; |
404 | | - $script = Xml::tags( 'script', array( |
405 | | - 'type' => 'text/javascript', |
406 | | - 'src' => $wgStylePath . "/common/enhancedchanges.js?$wgStyleVersion" ), '' ); |
407 | | - return $script; |
408 | | - } |
409 | | - /** |
410 | 393 | * Format a line for enhanced recentchange (aka with javascript and block of lines). |
411 | 394 | */ |
412 | 395 | public function recentChangesLine( &$baseRC, $watched = false ) { |
— | — | @@ -613,16 +596,13 @@ |
614 | 597 | |
615 | 598 | $users = ' <span class="changedby">[' . implode( $this->message['semicolon-separator'], $users ) . ']</span>'; |
616 | 599 | |
617 | | - # ID for JS visibility toggle |
618 | | - $jsid = $this->rcCacheIndex; |
619 | | - # onclick handler to toggle hidden/expanded |
620 | | - $toggleLink = "onclick='toggleVisibility($jsid)'"; |
621 | | - # Title for <a> tags |
622 | | - $expandTitle = wfMsg('rc-enhanced-expand'); |
623 | | - $closeTitle = wfMsg('rc-enhanced-hide'); |
624 | | - |
625 | | - $tl = "<span id='mw-rc-openarrow-$jsid' class='mw-changeslist-expanded'><a href='#' $toggleLink title='$expandTitle'>" . $this->sideArrow() . "</a></span>"; |
626 | | - $tl .= "<span id='mw-rc-closearrow-$jsid' class='mw-changeslist-hidden' style='display:none'><a href='#' $toggleLink title='$closeTitle'>" . $this->downArrow() . "</a></span>"; |
| 600 | + # Arrow |
| 601 | + $rci = 'RCI'.$this->rcCacheIndex; |
| 602 | + $rcl = 'RCL'.$this->rcCacheIndex; |
| 603 | + $rcm = 'RCM'.$this->rcCacheIndex; |
| 604 | + $toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')"; |
| 605 | + $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'">' . $this->sideArrow() . '</a></span>'; |
| 606 | + $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'">' . $this->downArrow() . '</a></span>'; |
627 | 607 | $r .= '<td valign="top" style="white-space: nowrap"><tt>'.$tl.' '; |
628 | 608 | |
629 | 609 | # Main line |
— | — | @@ -700,7 +680,7 @@ |
701 | 681 | $r .= "</td></tr></table>\n"; |
702 | 682 | |
703 | 683 | # Sub-entries |
704 | | - $r .= '<div id="mw-rc-subentries-'.$jsid.'" class="mw-changeslist-hidden"><table cellpadding="0" cellspacing="0" border="0" style="background: none">'; |
| 684 | + $r .= '<div id="'.$rci.'" style="display:none;"><table cellpadding="0" cellspacing="0" border="0" style="background: none">'; |
705 | 685 | foreach( $block as $rcObj ) { |
706 | 686 | # Get rc_xxxx variables |
707 | 687 | // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. |
— | — | @@ -779,10 +759,11 @@ |
780 | 760 | * @param string $alt text |
781 | 761 | * @return string HTML <img> tag |
782 | 762 | */ |
783 | | - protected function arrow( $dir ) { |
| 763 | + protected function arrow( $dir, $alt='' ) { |
784 | 764 | global $wgStylePath; |
785 | 765 | $encUrl = htmlspecialchars( $wgStylePath . '/common/images/Arr_' . $dir . '.png' ); |
786 | | - return "<img src=\"$encUrl\" width=\"12\" height=\"12\" />"; |
| 766 | + $encAlt = htmlspecialchars( $alt ); |
| 767 | + return "<img src=\"$encUrl\" width=\"12\" height=\"12\" alt=\"$encAlt\" />"; |
787 | 768 | } |
788 | 769 | |
789 | 770 | /** |
— | — | @@ -793,7 +774,7 @@ |
794 | 775 | protected function sideArrow() { |
795 | 776 | global $wgContLang; |
796 | 777 | $dir = $wgContLang->isRTL() ? 'l' : 'r'; |
797 | | - return $this->arrow( $dir ); |
| 778 | + return $this->arrow( $dir, '+' ); |
798 | 779 | } |
799 | 780 | |
800 | 781 | /** |
— | — | @@ -802,7 +783,7 @@ |
803 | 784 | * @return string HTML <img> tag |
804 | 785 | */ |
805 | 786 | protected function downArrow() { |
806 | | - return $this->arrow( 'd' ); |
| 787 | + return $this->arrow( 'd', '-' ); |
807 | 788 | } |
808 | 789 | |
809 | 790 | /** |
— | — | @@ -810,7 +791,7 @@ |
811 | 792 | * @return string HTML <img> tag |
812 | 793 | */ |
813 | 794 | protected function spacerArrow() { |
814 | | - return $this->arrow( '' ); |
| 795 | + return $this->arrow( '', ' ' ); |
815 | 796 | } |
816 | 797 | |
817 | 798 | /** |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1385,7 +1385,7 @@ |
1386 | 1386 | * to ensure that client-side caches don't keep obsolete copies of global |
1387 | 1387 | * styles. |
1388 | 1388 | */ |
1389 | | -$wgStyleVersion = '183'; |
| 1389 | +$wgStyleVersion = '182'; |
1390 | 1390 | |
1391 | 1391 | |
1392 | 1392 | # Server-side caching: |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1726,8 +1726,6 @@ |
1727 | 1727 | 'rc_categories_any' => 'Any', |
1728 | 1728 | 'rc-change-size' => '$1', # only translate this message to other languages if you have to change it |
1729 | 1729 | 'newsectionsummary' => '/* $1 */ new section', |
1730 | | -'rc-enhanced-expand' => 'Show details (requires JavaScript)', |
1731 | | -'rc-enhanced-hide' => 'Hide details', |
1732 | 1730 | |
1733 | 1731 | # Recent changes linked |
1734 | 1732 | 'recentchangeslinked' => 'Related changes', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -283,8 +283,6 @@ |
284 | 284 | * (bug 14609) User's namespaces to be searched default not updated after adding new namespace |
285 | 285 | * Purge form uses valid XHTML and (bug 8992) uses $wgRequest instead of $_SERVER |
286 | 286 | * (bug 12764) Special:LonelyPages shows transcluded pages |
287 | | -* (bug 16073) Enhanced RecentChanges uses onclick handler with better fallback if |
288 | | - JavaScript is disabled. |
289 | 287 | |
290 | 288 | === API changes in 1.14 === |
291 | 289 | |