* (bug 9417) Uploading new versions of images when using Postgres no longer
throws warnings.
* (bug 9908) Using tsearch2 with Postgres 8.1 no longer gives an error.
-* (bug 1438) Fix for diff table layout on very wide lines for Gecko and
- Opera-based browsers (incomplete, does not fix KHTML or MSIE)
+* (bug 1438) Fix for diff table layout on very wide lines.
+ Diff style rules have been broken out to common/diff.css,
+ and the dupes removed from the default skin files.
+ Skins can still override the default rules.
== MediaWiki API changes since 1.10 ==
* to ensure that client-side caches don't keep obsolete copies of global
* styles.
*/
-$wgStyleVersion = '68';
+$wgStyleVersion = '69';
# Server-side caching:
return;
}
+ $wgOut->addStyle( 'common/diff.css' );
$wgOut->setArticleFlag( false );
if ( ! $this->loadRevisionData() ) {
$t = $this->mTitle->getPrefixedText() . " (Diff: {$this->mOldid}, {$this->mNewid})";
$ntitle = '<span class="history-deleted">'.$ntitle.'</span>';
}
$header = "
- <table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>
+ <table class='diff'>
+ <col class='diff-marker' />
+ <col class='diff-content' />
+ <col class='diff-marker' />
+ <col class='diff-content' />
<tr>
- <td colspan='2' width='50%' align='center' class='diff-otitle'>{$otitle}</td>
- <td colspan='2' width='50%' align='center' class='diff-ntitle'>{$ntitle}</td>
+ <td colspan='2' class='diff-otitle'>{$otitle}</td>
+ <td colspan='2' class='diff-ntitle'>{$ntitle}</td>
</tr>
";
# HTML-escape parameter before calling this
function addedLine( $line ) {
- return "<td>+</td><td class='diff-addedline'><div>{$line}</div></td>";
+ return $this->wrapLine( '+', 'diff-addedline', $line );
}
# HTML-escape parameter before calling this
function deletedLine( $line ) {
- return "<td>-</td><td class='diff-deletedline'><div>{$line}</div></td>";
+ return $this->wrapLine( '-', 'diff-deletedline', $line );
}
# HTML-escape parameter before calling this
function contextLine( $line ) {
- return "<td> </td><td class='diff-context'><div>{$line}</div></td>";
+ return $this->wrapLine( ' ', 'diff-context', $line );
+ }
+
+ private function wrapLine( $marker, $class, $line ) {
+ if( $line !== '' ) {
+ // The <div> wrapper is needed for 'overflow: auto' style to scroll properly
+ $line = "<div>$line</div>";
+ }
+ return "<td class='diff-marker'>$marker</td><td class='$class'>$line</td>";
}
function emptyLine() {
function addMeta( $name, $val ) { array_push( $this->mMetatags, array( $name, $val ) ); }
function addKeyword( $text ) { array_push( $this->mKeywords, $text ); }
function addScript( $script ) { $this->mScripts .= "\t\t".$script; }
+ function addStyle( $style ) {
+ global $wgStylePath;
+ $this->addLink(
+ array(
+ 'rel' => 'stylesheet',
+ 'href' => $wgStylePath . '/' . $style ) );
+ }
/**
* Add a self-contained script tag with the given contents
background-color:#f9f9f9;
border:1px dashed #aaaaaa;
}
-/*
-** Diff rendering
-*/
-table.diff { background:white; }
-td.diff-otitle { background:#ffffff; }
-td.diff-ntitle { background:#ffffff; }
-td.diff-addedline {
- background:#ccffcc;
- font-size: smaller;
-}
-td.diff-deletedline {
- background:#ffffaa;
- font-size: smaller;
-}
-td.diff-context {
- background:#eeeeee;
- font-size: smaller;
-}
-.diffchange { color: red; text-decoration: none; }
a.external { color: #3366bb; }
border:1px dashed #aaaaaa;
}
-table.diff { background:white; }
-td.diff-otitle { background:#cccccc; }
-td.diff-ntitle { background:#cccccc; }
-td.diff-addedline {
- background:#ccffcc;
- font-size: 94%;
-}
-td.diff-deletedline {
- background:#ffffaa;
- font-size: 94%;
-}
-td.diff-context {
- background:#eeeeee;
- font-size: 94%;
-}
-.diffchange {
- color: red;
- font-weight: bold;
- text-decoration: none;
-}
-
img { border: none; }
img.tex { vertical-align: middle; }
span.texhtml { font-family: serif; }
--- /dev/null
+/*
+** Diff rendering
+*/
+table.diff, td.diff-otitle, td.diff-ntitle {
+ background-color: white;
+}
+td.diff-otitle,
+td.diff-ntitle {
+ text-align: center;
+}
+td.diff-marker {
+ text-align: right;
+}
+td.diff-addedline {
+ background: #cfc;
+ font-size: smaller;
+}
+td.diff-deletedline {
+ background: #ffa;
+ font-size: smaller;
+}
+td.diff-context {
+ background: #eee;
+ font-size: smaller;
+}
+.diffchange {
+ color: red;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+table.diff {
+ border: none;
+ width: 98%;
+ border-spacing: 4px;
+
+ /* Fixed layout is required to ensure that cells containing long URLs
+ don't widen in Safari, Internet Explorer, or iCab */
+ table-layout: fixed;
+}
+table.diff td {
+ padding: 0;
+}
+table.diff col.diff-marker {
+ width: 2%;
+}
+table.diff col.diff-content {
+ width: 48%;
+}
+table.diff td div {
+ /* Scrollbars will be added for very wide cells
+ instead of text overflowing or widening */
+ overflow: auto;
+}
border: 1px dashed #aaa;
}
-/*
-** Diff rendering
-*/
-table.diff, td.diff-otitle, td.diff-ntitle {
- background-color: white;
-}
-td.diff-addedline {
- background: #cfc;
- font-size: smaller;
-}
-td.diff-deletedline {
- background: #ffa;
- font-size: smaller;
-}
-td.diff-context {
- background: #eee;
- font-size: smaller;
-}
-.diffchange {
- color: red;
- font-weight: bold;
-}
-
/*
** keep the whitespace in front of the ^=, hides rule from konqueror
** this is css3, the validator doesn't like it when validating as css2
border: 1px dashed #aaa;
}
-/*
-** Diff rendering
-*/
-table.diff, td.diff-otitle, td.diff-ntitle {
- background-color: white;
-}
-td.diff-addedline {
- background: #cfc;
- font-size: smaller;
-}
-td.diff-deletedline {
- background: #ffa;
- font-size: smaller;
-}
-td.diff-context {
- background: #eee;
- font-size: smaller;
-}
-.diffchange {
- color: red;
- font-weight: bold;
- text-decoration: none;
-}
-
-table.diff td div {
- overflow: auto;
-}
-
/*
** keep the whitespace in front of the ^=, hides rule from konqueror
** this is css3, the validator doesn't like it when validating as css2