* Added a configuration variable allowing the "break out of framesets" feature
to be switched on and off ($wgBreakFrames). Off by default.
* Allow Xml::check() $attribs parameter to override 'value' attribute
+* DB schema change: added two columns (rc_old_len and rc_new_len) to the recentchanges table to store
+ the text lengths before and after the edit
+* (bug 1085) Made Special:Recentchanges show the character difference between the changed revisions
+
== Languages updated ==
global $wgUseRCPatrol, $wgUser;
return( $wgUseRCPatrol && $wgUser->isAllowed( 'patrol' ) );
}
-
-
}
* Format a line using the old system (aka without any javascript).
*/
function recentChangesLine( &$rc, $watched = false ) {
- global $wgContLang;
+ global $wgContLang, $wgRCShowChangedSize;
$fname = 'ChangesList::recentChangesLineOld';
wfProfileIn( $fname );
-
# Extract DB fields into local scope
extract( $rc->mAttribs );
$this->insertDiffHist($s, $rc, $unpatrolled);
+ if( $wgRCShowChangedSize ) {
+ $s .= $rc->getCharacterDifference() . ' . . ';
+ }
+
# M, N, b and ! (minor, new, bot and unpatrolled)
$s .= ' ' . $this->recentChangesFlags( $rc_type == RC_NEW, $rc_minor, $unpatrolled, '', $rc_bot );
$this->insertArticleLink($s, $rc, $unpatrolled, $watched);
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*/
function recentChangesLine( &$baseRC, $watched = false ) {
- global $wgLang, $wgContLang;
+ global $wgLang, $wgContLang, $wgRCShowChangedSize;
# Create a specialised object
$rc = RCCacheEntry::newFromParent( $baseRC );
}
$time = $wgContLang->time( $rc_timestamp, true, true );
+ # Character diff
+ if( $wgRCShowChangedSize ) {
+ $time .= ' ' . $rc->getCharacterDifference();
+ }
+ $time .= '</tt> ';
$rc->watched = $watched;
$rc->link = $clink;
$rc->timestamp = $time;
* Enhanced RC group
*/
function recentChangesBlockGroup( $block ) {
- global $wgContLang;
+ global $wgContLang, $wgRCShowChangedSize;
$r = '';
# Collate list of users
# Timestamp
$r .= ' '.$block[0]->timestamp.' ';
- $r .= '</tt>';
# Article link
$r .= $this->maybeWatchedLink( $block[0]->link, $block[0]->watched );
* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '32';
+$wgStyleVersion = '33';
+
# Server-side caching:
$wgEnotifMinorEdits = true; # UPO; false: "minor edits" on pages do not trigger notification mails.
# # Attention: _every_ change on a user_talk page trigger a notification mail (if the user is not yet notified)
-
/** Show watching users in recent changes, watchlist and page history views */
$wgRCShowWatchingUsers = false; # UPO
/** Show watching users in Page views */
$wgPageShowWatchingUsers = false;
+/** Show the amount of changed characters in recent changes */
+$wgRCShowChangedSize = true;
+
+/**
+ * If the difference between the character counts of the text
+ * before and after the edit is below that value, the value will be
+ * highlighted on the RC page.
+ */
+$wgRCChangedSizeThreshold = -500;
+
/**
* Show "Updated (since my last visit)" marker in RC view, watchlist and history
* view for watched pages with new changes */
* rc_ip IP address of the user in dotted quad notation
* rc_new obsolete, use rc_type==RC_NEW
* rc_patrolled boolean whether or not someone has marked this edit as patrolled
+ * rc_old_len integer character count of the text before the edit
+ * rc_new_len the same after the edit
*
* mExtra:
* prefixedDBkey prefixed db key, used by external app via msg queue
$oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0,
$newId = 0)
{
+
if ( $bot === 'default' ) {
$bot = $user->isAllowed( 'bot' );
}
'rc_bot' => $bot ? 1 : 0,
'rc_moved_to_ns' => 0,
'rc_moved_to_title' => '',
- 'rc_ip' => $ip,
- 'rc_patrolled' => 0,
- 'rc_new' => 0 # obsolete
+ 'rc_ip' => $ip,
+ 'rc_patrolled' => 0,
+ 'rc_new' => 0, # obsolete
+ 'rc_old_len' => $oldSize,
+ 'rc_new_len' => $newSize
);
$rc->mExtra = array(
return $fullString;
}
+ function getCharacterDifference() {
+ global $wgRCChangedSizeThreshold;
+ $szdiff = $this->mAttribs['rc_new_len'] - $this->mAttribs['rc_old_len'];
+
+ if( $szdiff < $wgRCChangedSizeThreshold ) {
+ return "<span class='mw-plusminus-big'>($szdiff)</span>";
+ } elseif( $szdiff === 0 ) {
+ return "<span class='mw-plusminus-null'>($szdiff)</span>";
+ } elseif( $szdiff > 0 ) {
+ return "<span class='mw-plusminus-pos'>(+$szdiff)</span>";
+ } else {
+ return "<span class='mw-pluminus-neg'>($szdiff)</span>";
+ }
+ }
}
?>
--- /dev/null
+--
+-- patch-rc_new_len.sql
+-- Adds a row to recentchanges to hold the text size after the edit
+-- 2006-12-03
+--
+
+ALTER TABLE /*$wgDBprefix*/recentchanges
+ ADD COLUMN rc_new_len int(10) default 0;
+
--- /dev/null
+--
+-- patch-rc_old_len.sql
+-- Adds a row to recentchanges to hold the text size before the edit
+-- 2006-12-03
+--
+
+ALTER TABLE /*$wgDBprefix*/recentchanges
+ ADD COLUMN rc_old_len int(10) default 0;
+
-- $wgPutIPinRC option is enabled.
rc_ip char(15) NOT NULL default '',
+ -- Text length in characters before
+ -- and after the edit
+ rc_old_len int(10) default '0',
+ rc_new_len int(10) default '0',
+
PRIMARY KEY rc_id (rc_id),
INDEX rc_timestamp (rc_timestamp),
INDEX rc_namespace_title (rc_namespace, rc_title),
-- $wgPutIPinRC option is enabled.
rc_ip char(15) NOT NULL default '',
+ -- Text length in characters before
+ -- and after the edit
+ rc_old_len int(10) default '0',
+ rc_new_len int(10) default '0',
+
PRIMARY KEY rc_id (rc_id),
INDEX rc_timestamp (rc_timestamp),
INDEX rc_namespace_title (rc_namespace, rc_title),
rc_moved_to_title VARCHAR2(255),
rc_patrolled NUMBER(3) DEFAULT 0 NOT NULL,
rc_ip VARCHAR2(40),
+ rc_old_len NUMBER(10) DEFAULT 0,
+ rc_new_len NUMBER(10) DEFAULT 0,
CONSTRAINT rc_pk PRIMARY KEY (rc_id)
);
CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp);
rc_moved_to_ns SMALLINT,
rc_moved_to_title TEXT,
rc_patrolled CHAR NOT NULL DEFAULT '0',
- rc_ip CIDR
+ rc_ip CIDR,
+ rc_old_len INTEGER DEFAULT '0',
+ rc_new_len INTEGER DEFAULT '0',
);
CREATE INDEX rc_timestamp ON recentchanges (rc_timestamp);
CREATE INDEX rc_namespace_title ON recentchanges (rc_namespace, rc_title);
-- $wgPutIPinRC option is enabled.
rc_ip char(15) NOT NULL default '',
+ -- Text length in characters before
+ -- and after the edit
+ rc_old_len int(10) default '0',
+ rc_new_len int(10) default '0',
+
PRIMARY KEY rc_id (rc_id),
INDEX rc_timestamp (rc_timestamp),
INDEX rc_namespace_title (rc_namespace, rc_title),
array( 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
array( 'recentchanges', 'rc_id', 'patch-rc_id.sql' ),
array( 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
+ array( 'recentchanges', 'rc_old_len', 'patch-rc_old_len.sql' ),
+ array( 'recentchanges', 'rc_new_len', 'patch-rc_new_len.sql' ),
array( 'user', 'user_real_name', 'patch-user-realname.sql' ),
array( 'user', 'user_token', 'patch-user_token.sql' ),
array( 'user', 'user_email_token', 'patch-user_email_token.sql' ),
.templatesUsed { margin-top: 1.5em; }
-#toolbar { clear: both; }
\ No newline at end of file
+#toolbar { clear: both; }
+
+.mw-plusminus-bold { font-weight: bold; }
+.mw-plusminus-pos { font-weight: normal; }
+.mw-plusminus-null { color: #aaa; }
+.mw-plusminus-neg { font-weight: normal; }
\ No newline at end of file
.mw-summary-preview {
margin: 0.1em 0;
}
-#toolbar { clear: both; }
\ No newline at end of file
+#toolbar { clear: both; }
+
+.mw-plusminus-bold { font-weight: bold; }
+.mw-plusminus-pos { font-weight: normal; }
+.mw-plusminus-null { color: #aaa; }
+.mw-plusminus-neg { font-weight: normal; }
\ No newline at end of file
}
.templatesUsed { margin-top: 1.5em; }
-#toolbar { clear: both; }
\ No newline at end of file
+#toolbar { clear: both; }
+
+.mw-plusminus-bold { font-weight: bold; }
+.mw-plusminus-pos { font-weight: normal; }
+.mw-plusminus-null { color: #aaa; }
+.mw-plusminus-neg { font-weight: normal; }
\ No newline at end of file