first pass at a colored, unified diff, using a fake longest common subsequence algorithm that doesn't quite work exactly the way i want
This commit is contained in:
parent
649def05df
commit
dc4cb8dcf9
@ -53,9 +53,7 @@
|
|||||||
|
|
||||||
<h1>Diff r<?php echo $this->diff->oldRevision->revision; ?>/r<?php echo $this->diff->newRevision->revision;?></h1>
|
<h1>Diff r<?php echo $this->diff->oldRevision->revision; ?>/r<?php echo $this->diff->newRevision->revision;?></h1>
|
||||||
|
|
||||||
<div class="wikidiff">
|
<div class="wikidiff"><?php echo $this->diff->getInlineDiff(); ?></div>
|
||||||
<pre><?php echo $this->diff->getDiff(); ?></pre>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@
|
|||||||
$link = $this->wikiPath . '/' . $this->pageName;
|
$link = $this->wikiPath . '/' . $this->pageName;
|
||||||
$link .= '?diff[' . $previous->revision . ',' . $revision .']';
|
$link .= '?diff[' . $previous->revision . ',' . $revision .']';
|
||||||
$affectedBytes = strlen($history->wikitext) - strlen($previous->wikitext);
|
$affectedBytes = strlen($history->wikitext) - strlen($previous->wikitext);
|
||||||
|
$affectedBytes = (($affectedBytes >= 0) ? '+' : '') . $affectedBytes;
|
||||||
$affectedBytes = '<a href="' . $link .'">' . $affectedBytes . ' bytes</a>';
|
$affectedBytes = '<a href="' . $link .'">' . $affectedBytes . ' bytes</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,4 +180,23 @@ ul.menu {
|
|||||||
}
|
}
|
||||||
.wikicontent {
|
.wikicontent {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
.wikidiff {
|
||||||
|
white-space: pre;
|
||||||
|
font-family: "Courier New", monospace;
|
||||||
|
font-size: 125%;
|
||||||
|
border: 2px solid #000000;
|
||||||
|
padding: 4px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.wikidiff del, .wikidiff ins {
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.wikidiff del {
|
||||||
|
background-color: #FFCCEE;
|
||||||
|
}
|
||||||
|
.wikidiff ins {
|
||||||
|
background-color: #CCFFCC;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user