| Index: trunk/phase3/maintenance/archives/patch-rc_new_len.sql |
| — | — | @@ -0,0 +1,9 @@ |
| | 2 | +-- |
| | 3 | +-- patch-rc_new_len.sql |
| | 4 | +-- Adds a row to recentchanges to hold the text size after the edit |
| | 5 | +-- 2006-12-03 |
| | 6 | +-- |
| | 7 | + |
| | 8 | +ALTER TABLE /*$wgDBprefix*/recentchanges |
| | 9 | + ADD COLUMN rc_new_len int(10) default 0; |
| | 10 | + |
| Property changes on: trunk/phase3/maintenance/archives/patch-rc_new_len.sql |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 11 | + native |
| Index: trunk/phase3/maintenance/archives/patch-rc_old_len.sql |
| — | — | @@ -0,0 +1,9 @@ |
| | 2 | +-- |
| | 3 | +-- patch-rc_old_len.sql |
| | 4 | +-- Adds a row to recentchanges to hold the text size before the edit |
| | 5 | +-- 2006-12-03 |
| | 6 | +-- |
| | 7 | + |
| | 8 | +ALTER TABLE /*$wgDBprefix*/recentchanges |
| | 9 | + ADD COLUMN rc_old_len int(10) default 0; |
| | 10 | + |
| Property changes on: trunk/phase3/maintenance/archives/patch-rc_old_len.sql |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| 1 | 11 | + native |
| Index: trunk/phase3/maintenance/postgres/tables.sql |
| — | — | @@ -310,7 +310,9 @@ |
| 311 | 311 | rc_moved_to_ns SMALLINT, |
| 312 | 312 | rc_moved_to_title TEXT, |
| 313 | 313 | rc_patrolled CHAR NOT NULL DEFAULT '0', |
| 314 | | - rc_ip CIDR |
| | 314 | + rc_ip CIDR, |
| | 315 | + rc_old_len INTEGER DEFAULT '0', |
| | 316 | + rc_new_len INTEGER DEFAULT '0', |
| 315 | 317 | ); |
| 316 | 318 | CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp); |
| 317 | 319 | CREATE INDEX rc_namespace_title ON recentchanges (rc_namespace, rc_title); |
| Index: trunk/phase3/maintenance/updaters.inc |
| — | — | @@ -43,6 +43,8 @@ |
| 44 | 44 | array( 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ), |
| 45 | 45 | array( 'recentchanges', 'rc_id', 'patch-rc_id.sql' ), |
| 46 | 46 | array( 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ), |
| | 47 | + array( 'recentchanges', 'rc_old_len', 'patch-rc_old_len.sql' ), |
| | 48 | + array( 'recentchanges', 'rc_new_len', 'patch-rc_new_len.sql' ), |
| 47 | 49 | array( 'user', 'user_real_name', 'patch-user-realname.sql' ), |
| 48 | 50 | array( 'user', 'user_token', 'patch-user_token.sql' ), |
| 49 | 51 | array( 'user', 'user_email_token', 'patch-user_email_token.sql' ), |
| Index: trunk/phase3/maintenance/oracle/tables.sql |
| — | — | @@ -229,6 +229,8 @@ |
| 230 | 230 | rc_moved_to_title VARCHAR2(255), |
| 231 | 231 | rc_patrolled NUMBER(3) DEFAULT 0 NOT NULL, |
| 232 | 232 | rc_ip VARCHAR2(40), |
| | 233 | + rc_old_len NUMBER(10) DEFAULT 0, |
| | 234 | + rc_new_len NUMBER(10) DEFAULT 0, |
| 233 | 235 | CONSTRAINT rc_pk PRIMARY KEY (rc_id) |
| 234 | 236 | ); |
| 235 | 237 | CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp); |
| Index: trunk/phase3/maintenance/mysql5/tables.sql |
| — | — | @@ -811,6 +811,11 @@ |
| 812 | 812 | -- $wgPutIPinRC option is enabled. |
| 813 | 813 | rc_ip char(15) NOT NULL default '', |
| 814 | 814 | |
| | 815 | + -- Text length in characters before |
| | 816 | + -- and after the edit |
| | 817 | + rc_old_len int(10) default '0', |
| | 818 | + rc_new_len int(10) default '0', |
| | 819 | + |
| 815 | 820 | PRIMARY KEY rc_id (rc_id), |
| 816 | 821 | INDEX rc_timestamp (rc_timestamp), |
| 817 | 822 | INDEX rc_namespace_title (rc_namespace, rc_title), |
| Index: trunk/phase3/maintenance/mysql5/tables-binary.sql |
| — | — | @@ -820,6 +820,11 @@ |
| 821 | 821 | -- $wgPutIPinRC option is enabled. |
| 822 | 822 | rc_ip char(15) NOT NULL default '', |
| 823 | 823 | |
| | 824 | + -- Text length in characters before |
| | 825 | + -- and after the edit |
| | 826 | + rc_old_len int(10) default '0', |
| | 827 | + rc_new_len int(10) default '0', |
| | 828 | + |
| 824 | 829 | PRIMARY KEY rc_id (rc_id), |
| 825 | 830 | INDEX rc_timestamp (rc_timestamp), |
| 826 | 831 | INDEX rc_namespace_title (rc_namespace, rc_title), |
| Index: trunk/phase3/maintenance/tables.sql |
| — | — | @@ -798,6 +798,11 @@ |
| 799 | 799 | -- $wgPutIPinRC option is enabled. |
| 800 | 800 | rc_ip char(15) NOT NULL default '', |
| 801 | 801 | |
| | 802 | + -- Text length in characters before |
| | 803 | + -- and after the edit |
| | 804 | + rc_old_len int(10) default '0', |
| | 805 | + rc_new_len int(10) default '0', |
| | 806 | + |
| 802 | 807 | PRIMARY KEY rc_id (rc_id), |
| 803 | 808 | INDEX rc_timestamp (rc_timestamp), |
| 804 | 809 | INDEX rc_namespace_title (rc_namespace, rc_title), |
| Index: trunk/phase3/skins/chick/main.css |
| — | — | @@ -494,4 +494,9 @@ |
| 495 | 495 | |
| 496 | 496 | .templatesUsed { margin-top: 1.5em; } |
| 497 | 497 | |
| 498 | | -#toolbar { clear: both; } |
| \ No newline at end of file |
| | 498 | +#toolbar { clear: both; } |
| | 499 | + |
| | 500 | +.mw-plusminus-bold { font-weight: bold; } |
| | 501 | +.mw-plusminus-pos { font-weight: normal; } |
| | 502 | +.mw-plusminus-null { color: #aaa; } |
| | 503 | +.mw-plusminus-neg { font-weight: normal; } |
| \ No newline at end of file |
| Index: trunk/phase3/skins/monobook/main.css |
| — | — | @@ -1540,4 +1540,9 @@ |
| 1541 | 1541 | .mw-summary-preview { |
| 1542 | 1542 | margin: 0.1em 0; |
| 1543 | 1543 | } |
| 1544 | | -#toolbar { clear: both; } |
| \ No newline at end of file |
| | 1544 | +#toolbar { clear: both; } |
| | 1545 | + |
| | 1546 | +.mw-plusminus-bold { font-weight: bold; } |
| | 1547 | +.mw-plusminus-pos { font-weight: normal; } |
| | 1548 | +.mw-plusminus-null { color: #aaa; } |
| | 1549 | +.mw-plusminus-neg { font-weight: normal; } |
| \ No newline at end of file |
| Index: trunk/phase3/skins/simple/main.css |
| — | — | @@ -437,4 +437,9 @@ |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | .templatesUsed { margin-top: 1.5em; } |
| 441 | | -#toolbar { clear: both; } |
| \ No newline at end of file |
| | 441 | +#toolbar { clear: both; } |
| | 442 | + |
| | 443 | +.mw-plusminus-bold { font-weight: bold; } |
| | 444 | +.mw-plusminus-pos { font-weight: normal; } |
| | 445 | +.mw-plusminus-null { color: #aaa; } |
| | 446 | +.mw-plusminus-neg { font-weight: normal; } |
| \ No newline at end of file |
| Index: trunk/phase3/includes/RecentChange.php |
| — | — | @@ -24,6 +24,8 @@ |
| 25 | 25 | * rc_ip IP address of the user in dotted quad notation |
| 26 | 26 | * rc_new obsolete, use rc_type==RC_NEW |
| 27 | 27 | * rc_patrolled boolean whether or not someone has marked this edit as patrolled |
| | 28 | + * rc_old_len integer character count of the text before the edit |
| | 29 | + * rc_new_len the same after the edit |
| 28 | 30 | * |
| 29 | 31 | * mExtra: |
| 30 | 32 | * prefixedDBkey prefixed db key, used by external app via msg queue |
| — | — | @@ -212,6 +214,7 @@ |
| 213 | 215 | $oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0, |
| 214 | 216 | $newId = 0) |
| 215 | 217 | { |
| | 218 | + |
| 216 | 219 | if ( $bot === 'default' ) { |
| 217 | 220 | $bot = $user->isAllowed( 'bot' ); |
| 218 | 221 | } |
| — | — | @@ -240,9 +243,11 @@ |
| 241 | 244 | 'rc_bot' => $bot ? 1 : 0, |
| 242 | 245 | 'rc_moved_to_ns' => 0, |
| 243 | 246 | 'rc_moved_to_title' => '', |
| 244 | | - 'rc_ip' => $ip, |
| 245 | | - 'rc_patrolled' => 0, |
| 246 | | - 'rc_new' => 0 # obsolete |
| | 247 | + 'rc_ip' => $ip, |
| | 248 | + 'rc_patrolled' => 0, |
| | 249 | + 'rc_new' => 0, # obsolete |
| | 250 | + 'rc_old_len' => $oldSize, |
| | 251 | + 'rc_new_len' => $newSize |
| 247 | 252 | ); |
| 248 | 253 | |
| 249 | 254 | $rc->mExtra = array( |
| — | — | @@ -522,5 +527,19 @@ |
| 523 | 528 | return $fullString; |
| 524 | 529 | } |
| 525 | 530 | |
| | 531 | + function getCharacterDifference() { |
| | 532 | + global $wgRCChangedSizeThreshold; |
| | 533 | + $szdiff = $this->mAttribs['rc_new_len'] - $this->mAttribs['rc_old_len']; |
| | 534 | + |
| | 535 | + if( $szdiff < $wgRCChangedSizeThreshold ) { |
| | 536 | + return "<span class='mw-plusminus-big'>($szdiff)</span>"; |
| | 537 | + } elseif( $szdiff === 0 ) { |
| | 538 | + return "<span class='mw-plusminus-null'>($szdiff)</span>"; |
| | 539 | + } elseif( $szdiff > 0 ) { |
| | 540 | + return "<span class='mw-plusminus-pos'>(+$szdiff)</span>"; |
| | 541 | + } else { |
| | 542 | + return "<span class='mw-pluminus-neg'>($szdiff)</span>"; |
| | 543 | + } |
| | 544 | + } |
| 526 | 545 | } |
| 527 | 546 | ?> |
| Index: trunk/phase3/includes/ChangesList.php |
| — | — | @@ -212,8 +212,6 @@ |
| 213 | 213 | global $wgUseRCPatrol, $wgUser; |
| 214 | 214 | return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) ); |
| 215 | 215 | } |
| 216 | | - |
| 217 | | - |
| 218 | 216 | } |
| 219 | 217 | |
| 220 | 218 | |
| — | — | @@ -225,12 +223,11 @@ |
| 226 | 224 | * Format a line using the old system (aka without any javascript). |
| 227 | 225 | */ |
| 228 | 226 | function recentChangesLine( &$rc, $watched = false ) { |
| 229 | | - global $wgContLang; |
| | 227 | + global $wgContLang, $wgRCShowChangedSize; |
| 230 | 228 | |
| 231 | 229 | $fname = 'ChangesList::recentChangesLineOld'; |
| 232 | 230 | wfProfileIn( $fname ); |
| 233 | 231 | |
| 234 | | - |
| 235 | 232 | # Extract DB fields into local scope |
| 236 | 233 | extract( $rc->mAttribs ); |
| 237 | 234 | |
| — | — | @@ -258,6 +255,10 @@ |
| 259 | 256 | |
| 260 | 257 | $this->insertDiffHist($s, $rc, $unpatrolled); |
| 261 | 258 | |
| | 259 | + if( $wgRCShowChangedSize ) { |
| | 260 | + $s .= $rc->getCharacterDifference() . ' . . '; |
| | 261 | + } |
| | 262 | + |
| 262 | 263 | # M, N, b and ! (minor, new, bot and unpatrolled) |
| 263 | 264 | $s .= ' ' . $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '', $rc_bot ); |
| 264 | 265 | $this->insertArticleLink($s, $rc, $unpatrolled, $watched); |
| — | — | @@ -293,7 +294,7 @@ |
| 294 | 295 | * Format a line for enhanced recentchange (aka with javascript and block of lines). |
| 295 | 296 | */ |
| 296 | 297 | function recentChangesLine( &$baseRC, $watched = false ) { |
| 297 | | - global $wgLang, $wgContLang; |
| | 298 | + global $wgLang, $wgContLang, $wgRCShowChangedSize; |
| 298 | 299 | |
| 299 | 300 | # Create a specialised object |
| 300 | 301 | $rc = RCCacheEntry::newFromParent( $baseRC ); |
| — | — | @@ -343,6 +344,11 @@ |
| 344 | 345 | } |
| 345 | 346 | |
| 346 | 347 | $time = $wgContLang->time( $rc_timestamp, true, true ); |
| | 348 | + # Character diff |
| | 349 | + if( $wgRCShowChangedSize ) { |
| | 350 | + $time .= ' ' . $rc->getCharacterDifference(); |
| | 351 | + } |
| | 352 | + $time .= '</tt> '; |
| 347 | 353 | $rc->watched = $watched; |
| 348 | 354 | $rc->link = $clink; |
| 349 | 355 | $rc->timestamp = $time; |
| — | — | @@ -403,7 +409,7 @@ |
| 404 | 410 | * Enhanced RC group |
| 405 | 411 | */ |
| 406 | 412 | function recentChangesBlockGroup( $block ) { |
| 407 | | - global $wgContLang; |
| | 413 | + global $wgContLang, $wgRCShowChangedSize; |
| 408 | 414 | $r = ''; |
| 409 | 415 | |
| 410 | 416 | # Collate list of users |
| — | — | @@ -456,7 +462,6 @@ |
| 457 | 463 | |
| 458 | 464 | # Timestamp |
| 459 | 465 | $r .= ' '.$block[0]->timestamp.' '; |
| 460 | | - $r .= '</tt>'; |
| 461 | 466 | |
| 462 | 467 | # Article link |
| 463 | 468 | $r .= $this->maybeWatchedLink( $block[0]->link, $block[0]->watched ); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -1048,8 +1048,9 @@ |
| 1049 | 1049 | * to ensure that client-side caches don't keep obsolete copies of global |
| 1050 | 1050 | * styles. |
| 1051 | 1051 | */ |
| 1052 | | -$wgStyleVersion = '32'; |
| | 1052 | +$wgStyleVersion = '33'; |
| 1053 | 1053 | |
| | 1054 | + |
| 1054 | 1055 | # Server-side caching: |
| 1055 | 1056 | |
| 1056 | 1057 | /** |
| — | — | @@ -1095,12 +1096,21 @@ |
| 1096 | 1097 | $wgEnotifMinorEdits = true; # UPO; false: "minor edits" on pages do not trigger notification mails. |
| 1097 | 1098 | # # Attention: _every_ change on a user_talk page trigger a notification mail (if the user is not yet notified) |
| 1098 | 1099 | |
| 1099 | | - |
| 1100 | 1100 | /** Show watching users in recent changes, watchlist and page history views */ |
| 1101 | 1101 | $wgRCShowWatchingUsers = false; # UPO |
| 1102 | 1102 | /** Show watching users in Page views */ |
| 1103 | 1103 | $wgPageShowWatchingUsers = false; |
| | 1104 | +/** Show the amount of changed characters in recent changes */ |
| | 1105 | +$wgRCShowChangedSize = true; |
| | 1106 | + |
| 1104 | 1107 | /** |
| | 1108 | + * If the difference between the character counts of the text |
| | 1109 | + * before and after the edit is below that value, the value will be |
| | 1110 | + * highlighted on the RC page. |
| | 1111 | + */ |
| | 1112 | +$wgRCChangedSizeThreshold = -500; |
| | 1113 | + |
| | 1114 | +/** |
| 1105 | 1115 | * Show "Updated (since my last visit)" marker in RC view, watchlist and history |
| 1106 | 1116 | * view for watched pages with new changes */ |
| 1107 | 1117 | $wgShowUpdatedMarker = true; |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -254,8 +254,12 @@ |
| 255 | 255 | * Added a configuration variable allowing the "break out of framesets" feature |
| 256 | 256 | to be switched on and off ($wgBreakFrames). Off by default. |
| 257 | 257 | * Allow Xml::check() $attribs parameter to override 'value' attribute |
| | 258 | +* DB schema change: added two columns (rc_old_len and rc_new_len) to the recentchanges table to store |
| | 259 | + the text lengths before and after the edit |
| | 260 | +* (bug 1085) Made Special:Recentchanges show the character difference between the changed revisions |
| 258 | 261 | |
| 259 | 262 | |
| | 263 | + |
| 260 | 264 | == Languages updated == |
| 261 | 265 | |
| 262 | 266 | * Bishnupriya Manipuri (bpy) |