You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(43) |
Nov
(73) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(34) |
Feb
(110) |
Mar
(24) |
Apr
(44) |
May
(37) |
Jun
(22) |
Jul
(20) |
Aug
(28) |
Sep
(50) |
Oct
(11) |
Nov
(132) |
Dec
(595) |
2002 |
Jan
(1099) |
Feb
(579) |
Mar
(63) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(125) |
Sep
(101) |
Oct
(25) |
Nov
(34) |
Dec
(47) |
2003 |
Jan
(82) |
Feb
(182) |
Mar
(71) |
Apr
(3) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
(14) |
Oct
(6) |
Nov
(124) |
Dec
(68) |
2004 |
Jan
(64) |
Feb
(191) |
Mar
(199) |
Apr
(298) |
May
(252) |
Jun
(426) |
Jul
(134) |
Aug
(13) |
Sep
(96) |
Oct
(75) |
Nov
(232) |
Dec
(171) |
2005 |
Jan
(205) |
Feb
(165) |
Mar
(8) |
Apr
(74) |
May
(21) |
Jun
(19) |
Jul
(37) |
Aug
(69) |
Sep
(141) |
Oct
(118) |
Nov
(31) |
Dec
(7) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
(35) |
Apr
(24) |
May
(34) |
Jun
(29) |
Jul
(5) |
Aug
(38) |
Sep
(30) |
Oct
(37) |
Nov
(30) |
Dec
(86) |
2007 |
Jan
(414) |
Feb
(40) |
Mar
(18) |
Apr
(10) |
May
(66) |
Jun
(60) |
Jul
(105) |
Aug
(55) |
Sep
(64) |
Oct
(7) |
Nov
(11) |
Dec
(5) |
2008 |
Jan
(26) |
Feb
(28) |
Mar
(79) |
Apr
(34) |
May
(61) |
Jun
(24) |
Jul
(29) |
Aug
(160) |
Sep
(62) |
Oct
(70) |
Nov
(32) |
Dec
(14) |
2009 |
Jan
(140) |
Feb
(135) |
Mar
(153) |
Apr
(53) |
May
(24) |
Jun
(138) |
Jul
(90) |
Aug
(46) |
Sep
(72) |
Oct
(84) |
Nov
(32) |
Dec
(4) |
2010 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(55) |
May
(89) |
Jun
(131) |
Jul
(41) |
Aug
(38) |
Sep
(42) |
Oct
(11) |
Nov
(27) |
Dec
(54) |
2011 |
Jan
(127) |
Feb
(16) |
Mar
(71) |
Apr
(52) |
May
(32) |
Jun
(31) |
Jul
(4) |
Aug
|
Sep
(45) |
Oct
(26) |
Nov
(36) |
Dec
(10) |
2012 |
Jan
(23) |
Feb
(6) |
Mar
(13) |
Apr
(18) |
May
(1) |
Jun
(4) |
Jul
(3) |
Aug
(12) |
Sep
(57) |
Oct
(96) |
Nov
(163) |
Dec
(124) |
2013 |
Jan
(11) |
Feb
(17) |
Mar
(7) |
Apr
(48) |
May
(15) |
Jun
(29) |
Jul
(12) |
Aug
|
Sep
(9) |
Oct
|
Nov
|
Dec
(3) |
2014 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
(8) |
Jun
(90) |
Jul
(104) |
Aug
(12) |
Sep
(81) |
Oct
(139) |
Nov
(111) |
Dec
(64) |
2015 |
Jan
(46) |
Feb
(74) |
Mar
(56) |
Apr
(61) |
May
(3) |
Jun
(7) |
Jul
(11) |
Aug
(5) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
(15) |
2016 |
Jan
(25) |
Feb
(33) |
Mar
(24) |
Apr
(4) |
May
(24) |
Jun
(3) |
Jul
(75) |
Aug
|
Sep
(2) |
Oct
(38) |
Nov
(4) |
Dec
(18) |
2017 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(14) |
Jun
|
Jul
(5) |
Aug
(9) |
Sep
|
Oct
(23) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(9) |
Apr
(60) |
May
(1) |
Jun
|
Jul
(13) |
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(15) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
2021 |
Jan
(24) |
Feb
(33) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(64) |
Jul
(71) |
Aug
(114) |
Sep
(82) |
Oct
(32) |
Nov
(76) |
Dec
(86) |
2022 |
Jan
(162) |
Feb
(41) |
Mar
(11) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2023 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2024 |
Jan
(7) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(90) |
Mar
(19) |
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Geoffrey T. D. <da...@us...> - 2001-12-15 02:40:45
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv6386/lib Modified Files: diff.php Log Message: Back off to word-level diffs rather than character-level diffs in changed blocks of text. (It's much cleaner when there are major changes within a block.) Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** diff.php 2001/12/14 20:15:02 1.19 --- diff.php 2001/12/15 02:40:42 1.20 *************** *** 44,55 **** function _lines($lines, $class, $prefix = ' ', $elem = false) { foreach ($lines as $line) { ! if (!trim($line)) ! $line = ' '; ! elseif ($elem) $line = QElement($elem, $line); echo Element('div', array('class' => $class), Element('tt', array('class' => 'prefix'), $prefix) ! . " $line") . "\n"; } } --- 44,53 ---- function _lines($lines, $class, $prefix = ' ', $elem = false) { foreach ($lines as $line) { ! if ($elem) $line = QElement($elem, $line); echo Element('div', array('class' => $class), Element('tt', array('class' => 'prefix'), $prefix) ! . " $line ") . "\n"; } } *************** *** 61,123 **** $this->_lines($lines, 'deleted', '-', 'del'); } function _added($lines) { $this->_lines($lines, 'added', '+', 'ins'); } ! function _pack_in_span($chars, $elem) { ! $end_span = ""; ! $packed = ''; ! foreach ($chars as $c) { ! if ($c == "\n") { ! $packed .= $end_span; ! $end_span = ""; ! } ! elseif (!$end_span) { ! $packed .= "<$elem>"; ! $end_span = "</$elem>"; ! } ! $packed .= htmlspecialchars($c); ! } ! return $packed . $end_span; } ! ! function _split_to_chars($lines) { ! // Split into characters --- there must be a better way ... ! $joined = implode("\n", $lines); ! $split = array(); ! for ($i = 0; $i < strlen($joined); $i++) ! $split[$i] = $joined[$i]; ! return $split; } - function _changed($orig, $final) { ! // Compute character-wise diff in changed region. ! $diff = new Diff($this->_split_to_chars($orig), ! $this->_split_to_chars($final)); $orig = $final = ''; foreach ($diff->edits as $edit) { ! switch ($edit->type) { ! case 'copy': ! $packed = implode('', $edit->orig); ! $orig .= $packed; ! $final .= $packed; ! break; ! case 'add': ! $final .= $this->_pack_in_span($edit->final, 'ins'); ! break; ! case 'delete': ! $orig .= $this->_pack_in_span($edit->orig, 'del'); ! break; ! case 'change': ! $orig .= $this->_pack_in_span($edit->orig, 'del'); ! $final .= $this->_pack_in_span($edit->final, 'ins'); ! break; } } ! $this->_lines(explode("\n", $orig), 'changed', '-'); ! $this->_lines(explode("\n", $final), 'changed', '+'); } } --- 59,106 ---- $this->_lines($lines, 'deleted', '-', 'del'); } + function _added($lines) { $this->_lines($lines, 'added', '+', 'ins'); } ! function _pack($bits, $tag) { ! $packed = htmlspecialchars(implode("", $bits)); ! return "<$tag>" ! . str_replace("\n", "<tt> </tt></$tag>\n<$tag>", ! $packed) ! . "</$tag>"; } ! ! function _split($lines) { ! preg_match_all('/ ( [^\S\n]+ | [[:alnum:]]+ | . ) (?: (?!< \n) [^\S\n])? /xs', ! implode("\n", $lines), ! $m); ! return array($m[0], $m[1]); } function _changed($orig, $final) { ! list ($orig_words, $orig_stripped) = $this->_split($orig); ! list ($final_words, $final_stripped) = $this->_split($final); + // Compute character-wise diff in changed region. + $diff = new MappedDiff($orig_words, $final_words, + $orig_stripped, $final_stripped); + $orig = $final = ''; foreach ($diff->edits as $edit) { ! if ($edit->type == 'copy') { ! $orig .= implode('', $edit->orig); ! $final .= implode('', $edit->final); ! } ! else { ! if ($edit->orig) ! $orig .= $this->_pack($edit->orig, 'del'); ! if ($edit->final) ! $final .= $this->_pack($edit->final, 'ins'); } } ! $this->_lines(explode("\n", $orig), 'original', '-'); ! $this->_lines(explode("\n", $final), 'final', '+'); } } |
From: Geoffrey T. D. <da...@us...> - 2001-12-15 02:39:45
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv6297/lib Modified Files: difflib.php Log Message: New class MappedDiff to support trailing-space insentive diffs (and the like). Index: difflib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/difflib.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** difflib.php 2001/12/14 20:15:02 1.2 --- difflib.php 2001/12/15 02:39:43 1.3 *************** *** 27,37 **** var $type = 'copy'; ! function _DiffOp_Copy ($lines) { ! $this->orig = $lines; ! $this->final = &$this->orig; } function reverse() { ! return $this; } } --- 27,39 ---- var $type = 'copy'; ! function _DiffOp_Copy ($orig, $final = false) { ! if (!is_array($final)) ! $final = $orig; ! $this->orig = $orig; ! $this->final = $final; } function reverse() { ! return new _DiffOp_Copy($this->final, $this->orig); } } *************** *** 608,611 **** --- 610,679 ---- } } + + + if (!function_exists('array_map')) { + function array_map($map_func, $array) { + $result = array(); + foreach ($array as $x) + $result[] = call_user_func($map_func, $x); + return $result; + } + } + + + /** + * FIXME: bad name. + */ + class MappedDiff + extends Diff + { + /** + * Constructor. + * + * Computes diff between sequences of strings. + * + * This can be used to compute things like + * case-insensitve diffs, or diffs which ignore + * changes in white-space. + * + * @param $from_lines array An array of strings. + * (Typically these are lines from a file.) + * + * @param $to_lines array An array of strings. + * + * @param $mapped_from_lines array This array should + * have the same size number of elements as $from_lines. + * The elements in $mapped_from_lines and + * $mapped_to_lines are what is actually compared + * when computing the diff. + * + * @param $mapped_to_lines array This array should + * have the same number of elements as $to_lines. + */ + function MappedDiff($from_lines, $to_lines, + $mapped_from_lines, $mapped_to_lines) { + + assert(sizeof($from_lines) == sizeof($mapped_from_lines)); + assert(sizeof($to_lines) == sizeof($mapped_to_lines)); + + $this->Diff($mapped_from_lines, $mapped_to_lines); + + $xi = $yi = 0; + for ($i = 0; $i < sizeof($this->edits); $i++) { + $orig = &$this->edits[$i]->orig; + if (is_array($orig)) { + $orig = array_slice($from_lines, $xi, sizeof($orig)); + $xi += sizeof($orig); + } + + $final = &$this->edits[$i]->final; + if (is_array($final)) { + $final = array_slice($to_lines, $yi, sizeof($final)); + $yi += sizeof($final); + } + } + } + } + /** |
From: Geoffrey T. D. <da...@us...> - 2001-12-15 02:36:59
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv5381/lib/plugin Modified Files: PageHistory.php Log Message: Use GET instead of POST for diff form action. (There are no side effects of viewing a diff, so POST is not really appropriate.) Index: PageHistory.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/PageHistory.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** PageHistory.php 2001/12/14 20:28:02 1.1 --- PageHistory.php 2001/12/15 02:36:56 1.2 *************** *** 104,113 **** 'name' => 'action', 'value' => 'diff')); ! $html[] = Element('input', array('type' => 'hidden', ! 'name' => 'pagename', ! 'value' => $pagename)); ! $action = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; ! return Element('form', array('method' => 'post', 'action' => $action, 'name' => 'diff-select'), --- 104,118 ---- 'name' => 'action', 'value' => 'diff')); ! if (USE_PATH_INFO) { ! $action = WikiURL($pagename); ! } ! else { ! $action = SCRIPT_NAME; ! $html[] = Element('input', array('type' => 'hidden', ! 'name' => 'pagename', ! 'value' => $pagename)); ! } ! return Element('form', array('method' => 'get', 'action' => $action, 'name' => 'diff-select'), |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 23:01:57
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv19410/lib/plugin Modified Files: RecentChanges.php Log Message: Fix <wiki:history> link in RSS. Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** RecentChanges.php 2001/12/14 20:32:02 1.7 --- RecentChanges.php 2001/12/14 23:01:55 1.8 *************** *** 39,42 **** --- 39,49 ---- } + function historyURL ($rev) { + $page = $rev->getPage(); + return WikiURL(_("PageHistory"), + array('page' => $page->getName()), + $this->_absurls); + } + function pageURL ($rev) { $params = array(); *************** *** 289,295 **** 'wiki:status' => $this->status($rev), 'wiki:diff' => $this->diffURL($rev), ! 'wiki:history' => WikiURL($pagename, ! array('action' => 'info'), ! 'absurl') ); } --- 296,300 ---- 'wiki:status' => $this->status($rev), 'wiki:diff' => $this->diffURL($rev), ! 'wiki:history' => $this->historyURL($rev) ); } |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 22:20:47
|
Update of /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend In directory usw-pr-cvs1:/tmp/cvs-serv9722/lib/WikiDB/backend Modified Files: PearDB.php Log Message: SF bug #492511: Don't assume DB:isManip() exists. Index: PearDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB/backend/PearDB.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** PearDB.php 2001/12/03 03:18:34 1.11 --- PearDB.php 2001/12/14 22:20:44 1.12 *************** *** 682,690 **** */ function _is_false_error($error) { ! $code = $error->getCode(); $query = $this->_dbh->last_query; ! return ($code == DB_ERROR ! && ! DB::isManip($query) ! && preg_match('/^\s*"?(LOCK|UNLOCK)\s/', $query)); } --- 682,709 ---- */ function _is_false_error($error) { ! if ($error->getCode() != DB_ERROR) ! return false; ! $query = $this->_dbh->last_query; ! ! if (! preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE' ! . '|DROP|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s/', $query)) { ! // Last query was not of the sort which doesn't return any data. ! return false; ! } ! ! if (! in_array('ismanip', get_class_methods('DB'))) { ! // Pear shipped with PHP 4.0.4pl1 (and before, presumably) ! // does not have the DB::isManip method. ! return true; ! } ! ! if (DB::isManip($query)) { ! // If Pear thinks it's an isManip then it wouldn't have thrown ! // the error we're testing for.... ! return false; ! } ! ! return true; } |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 22:17:27
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9291/lib Modified Files: loadsave.php Log Message: Fix typo/bug. Index: loadsave.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/loadsave.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** loadsave.php 2001/12/11 18:21:38 1.14 --- loadsave.php 2001/12/14 22:17:24 1.15 *************** *** 145,149 **** echo "<br>$enc_name ... "; ! if($pagename != $filename) echo "<small>saved as $filename</small> ... "; --- 145,149 ---- echo "<br>$enc_name ... "; ! if($page->getName() != $filename) echo "<small>saved as $filename</small> ... "; |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 21:00:50
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv21515/pgsrc Modified Files: RecentChanges Log Message: Add link to RecentEdits. Index: RecentChanges =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/pgsrc/RecentChanges,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** RecentChanges 2001/09/18 19:16:23 1.16 --- RecentChanges 2001/12/14 21:00:47 1.17 *************** *** 9,13 **** Content-Transfer-Encoding: binary ! The most recently changed pages are listed below. Show changes for: [1 day|phpwiki:?days=1] | [3 days|phpwiki:?days=3] | [7 days|phpwiki:?days=7] | [30 days|phpwiki:?days=30] | [90 days|phpwiki:?days=90] | [...|phpwiki:?days=-1] --- 9,13 ---- Content-Transfer-Encoding: binary ! The most recently changed pages are listed below. See RecentEdits for a list of all recent changes. Show changes for: [1 day|phpwiki:?days=1] | [3 days|phpwiki:?days=3] | [7 days|phpwiki:?days=7] | [30 days|phpwiki:?days=30] | [90 days|phpwiki:?days=90] | [...|phpwiki:?days=-1] |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:32:05
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv13707/lib/plugin Modified Files: RecentChanges.php Log Message: Fix typo. Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** RecentChanges.php 2001/12/14 20:24:25 1.6 --- RecentChanges.php 2001/12/14 20:32:02 1.7 *************** *** 19,23 **** function include_versions_in_URLs() { ! return (bool) $this->args['show_all']; } --- 19,23 ---- function include_versions_in_URLs() { ! return (bool) $this->_args['show_all']; } |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:29:53
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv12707 Modified Files: phpwiki-heavy.css phpwiki.css Log Message: Minor adjustments to style for RSS and link icons. Index: phpwiki-heavy.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/phpwiki-heavy.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** phpwiki-heavy.css 2001/12/13 16:48:48 1.2 --- phpwiki-heavy.css 2001/12/14 20:29:49 1.3 *************** *** 31,34 **** --- 31,37 ---- } + /* Link icons */ + img.linkicon { vertical-align: middle; } + /**************************************************************** ** Index: phpwiki.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/phpwiki.css,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** phpwiki.css 2001/12/13 16:48:48 1.11 --- phpwiki.css 2001/12/14 20:29:50 1.12 *************** *** 172,182 **** * No border on external link icons. */ ! img.linkicon { ! border: none; ! margin-right: 0.5ex; ! margin-left: 0.25ex; ! vertical-align: middle /* bottom */; ! } ! /* * Put a border around wikiaction forms: --- 172,182 ---- * No border on external link icons. */ ! img.linkicon, img.rssicon { border: 0px; } ! img.rssicon { vertical-align: top; } ! /* This screws up NS4, moved to phpwiki-heavy.css ! img.linkicon { vertical-align: middle; } ! */ ! ! /* * Put a border around wikiaction forms: |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:28:05
|
Update of /cvsroot/phpwiki/phpwiki/templates In directory usw-pr-cvs1:/tmp/cvs-serv11990/templates Modified Files: browse.html Log Message: New PageHistory plugin replaces action=info and lib/pageinfo.php. Index: browse.html =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/templates/browse.html,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** browse.html 2001/12/12 16:58:57 1.26 --- browse.html 2001/12/14 20:28:02 1.27 *************** *** 86,90 **** | <a class="wikiadmin" href="${ACTION}remove">$_("Remove page")</a> <?php } ?> ! | <a class="wikiaction" href="${ACTION}info">$_("History")</a> <?php if ($IS_CURRENT) { ?> | <a class="wikiaction" href="${ACTION}diff&previous=major">$_("Diff")</a> --- 86,90 ---- | <a class="wikiadmin" href="${ACTION}remove">$_("Remove page")</a> <?php } ?> ! | <?plugin-link PageHistory page="[pagename]" description=_("List PageHistory for [pagename]")?> <?php if ($IS_CURRENT) { ?> | <a class="wikiaction" href="${ACTION}diff&previous=major">$_("Diff")</a> |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:28:05
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv11990/lib Modified Files: main.php Removed Files: pageinfo.php Log Message: New PageHistory plugin replaces action=info and lib/pageinfo.php. Index: main.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/main.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** main.php 2001/12/07 22:13:51 1.19 --- main.php 2001/12/14 20:28:02 1.20 *************** *** 133,140 **** savePage($dbi, $request); break; - case 'info': - $request->compress_output(); - include "lib/pageinfo.php"; - break; case 'diff': $request->compress_output(); --- 133,136 ---- --- pageinfo.php DELETED --- |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:28:05
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv11990/lib/plugin Added Files: PageHistory.php Log Message: New PageHistory plugin replaces action=info and lib/pageinfo.php. ***** Error reading new file: [Errno 2] No such file or directory: 'PageHistory.php' |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:28:05
|
Update of /cvsroot/phpwiki/phpwiki/pgsrc In directory usw-pr-cvs1:/tmp/cvs-serv11990/pgsrc Added Files: PageHistory Log Message: New PageHistory plugin replaces action=info and lib/pageinfo.php. --- NEW FILE --- >From hos...@da... Fri Dec 14 11:38:20 PST 2001 Subject: PageHistory From: hos...@da... (PhpWiki) Date: Fri, 31 Aug 2001 22:07:14 -0700 Mime-Version: 1.0 Content-Type: application/x-phpwiki; pagename=PageHistory; flags=PAGE_LOCKED Content-Transfer-Encoding: binary <?plugin PageHistory?> |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:24:28
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv11289/lib/plugin Modified Files: RecentChanges.php Log Message: Big refactor/cleanup in part to allow for code sharing with the (forthcoming) PageHistory plugin. Index: RecentChanges.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** RecentChanges.php 2001/12/11 22:45:39 1.5 --- RecentChanges.php 2001/12/14 20:24:25 1.6 *************** *** 3,134 **** /** */ - define('RSS_ENCODING', 'ISO-8859-1'); ! class WikiPlugin_RecentChanges ! extends WikiPlugin { ! var $name = 'RecentChanges'; ! function getDefaultArguments() { ! return array('days' => 2, ! 'show_minor' => false, ! 'show_major' => true, ! 'show_all' => false, ! 'limit' => false, ! 'format' => false); } ! function run($dbi, $argstr, $request) { ! $args = $this->getArgs($argstr, $request); ! extract($args); ! $params = array('include_minor_revisions' => $show_minor, ! 'exclude_major_revisions' => !$show_major, ! 'include_all_revisions' => $show_all); ! if ($days > 0.0) ! $params['since'] = time() - 24 * 3600 * $days; ! ! $changes = $dbi->mostRecent($params); ! if ($request->getArg('action') != 'browse') ! $format = false; // default -> HTML ! switch ($format) { ! case 'rss': ! if (!$args['limit']) ! $args['limit'] = 15; ! header("Content-Type: application/xml; charset=" . RSS_ENCODING); ! ! $xml = $this->__format_as_rss($changes, $args, $request); ! printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); ! printf("<!-- Generated by PhpWiki:\n%s-->\n", $GLOBALS['RCS_IDS']); ! echo $xml; ! ExitWiki(); ! break; default: ! return $this->__format_as_html($changes, $args, $request); ! break; } } ! function __format_as_html($changes, $args, $request) { ! global $dateformat; ! global $WikiNameRegexp; ! ! $last_date = ''; ! $lines = array(); ! $diffargs = array('action' => 'diff'); - // FIXME: add XML icon (and link) to title? $rss_url = $request->getURLtoSelf(array('format' => 'rss')); ! $rss_icon = Element('a', array('href' => $rss_url), ! Element('img', array('src' => DataURL('images/rss.png'), ! 'alt' => 'RSS available', ! 'class' => 'linkicon'))); ! ! $html = Element('h3', htmlspecialchars(_("RecentChanges")) . " $rss_icon"); ! $limit = $args['limit']; while ($rev = $changes->next()) { ! $created = $rev->get('mtime'); ! $date = strftime($dateformat, $created); ! $time = strftime("%l:%M %p", $created); // Make configurable. ! if ($date != $last_date) { if ($lines) { ! $html .= Element('ul', join("\n", $lines)); $lines = array(); } ! $html .= Element('p',QElement('b', $date)); $last_date = $date; } ! $page = $rev->getPage(); ! $pagename = $page->getName(); - if ($args['show_all']) { - // FIXME: should set previous, too, if showing only minor or major revs. - // or maybe difftype. - $diffargs['version'] = $rev->getVersion(); - } - - $diff = QElement('a', - array('href' => WikiURL($pagename, $diffargs)), - "(diff)"); - - $wikipage = LinkWikiWord($page->getName()); - $author = $rev->get('author'); - if (preg_match("/^$WikiNameRegexp\$/", $author)) - $author = LinkWikiWord($author); - else - $author = htmlspecialchars($author); ! $summary = $rev->get('summary'); ! if ($summary) ! $summary = QElement('b', "[$summary]"); ! ! $lines[] = Element('li', ! "$diff $wikipage $time $summary ... $author"); ! if ($limit && --$limit <= 0) ! break; ! } ! if ($lines) ! $html .= Element('ul', join("\n", $lines)); ! ! return $html; } ! function __format_as_rss($changes, $args, $request) { include_once('lib/RssWriter.php'); $rss = new RssWriter; $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); ! $chan = array('title' => WIKI_NAME, ! 'dc:description' => _("RecentChanges"), ! 'link' => $rc_url, ! 'dc:date' => Iso8601DateTime(time())); /* FIXME: other things one might like in <channel>: --- 3,259 ---- /** */ ! ! ! class _RecentChanges_Formatter { ! var $_absurls = false; ! function _RecentChanges_Formatter ($rc_args) { ! $this->_args = $rc_args; ! $this->_diffargs = array('action' => 'diff'); ! ! if ($rc_args['show_major'] && !$rc_args['show_minor']) ! $this->_diffargs['previous'] = 'major'; } ! function include_versions_in_URLs() { ! return (bool) $this->args['show_all']; ! } ! ! function date ($rev) { ! return strftime($GLOBALS['dateformat'], $rev->get('mtime')); ! } ! function time ($rev) { ! // FIXME: Make configurable. ! return strftime("%l:%M %p", $rev->get('mtime')); ! } ! function diffURL ($rev) { ! $args = $this->_diffargs; ! if ($this->include_versions_in_URLs()) ! $args['version'] = $rev->getVersion(); ! $page = $rev->getPage(); ! return WikiURL($page->getName(), $args, $this->_absurls); ! } ! function pageURL ($rev) { ! $params = array(); ! if ($this->include_versions_in_URLs()) ! $params['version'] = $rev->getVersion(); ! $page = $rev->getPage(); ! return WikiURL($page->getName(), $params, $this->_absurls); ! } ! ! function authorURL($author) { ! global $WikiNameRegexp, $dbi; ! ! if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author)) ! return WikiURL($author); ! return false; ! } ! ! ! function status ($rev) { ! if ($rev->hasDefaultContents()) ! return 'deleted'; ! $page = $rev->getPage(); ! $prev = $page->getRevisionBefore($rev->getVersion()); ! if ($prev->hasDefaultContents()) ! return 'new'; ! return 'updated'; ! } ! ! function importance ($rev) { ! return $rev->get('is_minor_edit') ? 'minor' : 'major'; ! } ! ! function summary($rev) { ! if ( ($summary = $rev->get('summary')) ) ! return $summary; ! ! switch ($this->status($rev)) { ! case 'deleted': ! return _("Deleted."); ! case 'new': ! return _("New page."); default: ! return ''; } } + } ! class _RecentChanges_HtmlFormatter ! extends _RecentChanges_Formatter ! { ! function diffLink ($rev) { ! return QElement('a', array('href' => $this->diffURL($rev)), ! _("(diff)")); ! } ! function pageLink ($rev) { ! $page = $rev->getPage(); ! return QElement('a', array('href' => $this->pageURL($rev), 'class' => 'wiki'), ! $page->getName()); ! } ! ! function authorLink ($rev) { ! $author = $rev->get('author'); ! if ( ($url = $this->authorURL($author)) ) ! return QElement('a', array('href' => $url, 'class' => 'wiki'), $author); ! else ! return htmlspecialchars($author); ! } ! ! function rss_icon () { ! global $request; $rss_url = $request->getURLtoSelf(array('format' => 'rss')); ! return Element('a', array('href' => $rss_url), ! Element('img', array('src' => DataURL('images/rss.png'), ! 'alt' => _("RSS available"), ! 'class' => 'rssicon'))); ! } ! ! function description () { ! extract($this->_args); ! ! // FIXME: say something about show_all. ! ! if ($show_major && $show_minor) ! $edits = _("edits"); ! elseif ($show_major) ! $edits = _("major edits"); ! else ! $edits = _("minor edits"); ! ! if ($limit > 0) { ! if ($days > 0) ! $desc = sprintf(_("The %d most recent %s during the past %.1f days are listed below."), ! $limit, $edits, $days); ! else ! $desc = sprintf(_("The %d most recent %s are listed below."), ! $limit, $edits); ! } ! else { ! if ($days > 0) ! $desc = sprintf(_("The most recent %s during the past %.1f days are listed below."), ! $edits, $days); ! else ! $desc = sprintf(_("All %s are listed below."), $edits); ! } ! return htmlspecialchars($desc); ! } ! ! function title () { ! return htmlspecialchars(_("RecentChanges")) . "\n" . $this->rss_icon(); ! } ! ! function format ($changes) { ! $html[] = Element('h2', $this->title()); ! if (($desc = $this->description())) ! $html[] = Element('p', $desc); ! ! $last_date = ''; ! $lines = array(); ! while ($rev = $changes->next()) { ! if (($date = $this->date($rev)) != $last_date) { if ($lines) { ! $html[] = Element('ul', join("\n", $lines)); $lines = array(); } ! $html[] = QElement('h3', $date); $last_date = $date; } ! $lines[] = $this->format_revision($rev); ! } ! if ($lines) ! $html[] = Element('ul', join("\n", $lines)); ! return join("\n", $html) . "\n"; ! } ! ! function format_revision ($rev) { ! if ( ($summary = $this->summary($rev)) ) ! $summary = QElement('b', "[$summary]"); ! ! $class = 'rc-' . $this->importance($rev); ! ! return Element('li', array('class' => $class), ! implode(' ', array( $this->diffLink($rev), ! $this->pageLink($rev), ! $this->time($rev), ! $summary, ! '...', ! $this->authorLink($rev) ))); ! } ! } ! class _RecentChanges_RssFormatter ! extends _RecentChanges_Formatter ! { ! var $_absurls = true; ! function time ($rev) { ! return Iso8601DateTime($rev->get('mtime')); } ! function pageURI ($rev) { ! $page = $rev->getPage(); ! return WikiURL($page->getName(), ! array('version' => $rev->getVersion()), ! 'absurl'); ! } ! ! function format ($changes) { include_once('lib/RssWriter.php'); $rss = new RssWriter; + + + $rss->channel($this->channel_properties()); + + if (($props = $this->image_properties())) + $rss->image($props); + if (($props = $this->textinput_properties())) + $rss->textinput($props); + + while ($rev = $changes->next()) { + $rss->addItem($this->item_properties($rev), + $this->pageURI($rev)); + } + + $rss->finish(); + printf("\n<!-- Generated by PhpWiki:\n%s-->\n", $GLOBALS['RCS_IDS']); + ExitWiki(); // NORETURN!!!! + } + + function image_properties () { + return array('title' => WIKI_NAME, + 'link' => WikiURL(_("HomePage"), false, 'absurl'), + 'url' => DataURL($GLOBALS['logo'])); + } + + function textinput_properties () { + return array('title' => _("Search"), + 'description' => _("Title Search"), + 'name' => 's', + 'link' => WikiURL(_("TitleSearch"), false, 'absurl')); + } + + function channel_properties () { + global $request; + $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl'); ! return array('title' => WIKI_NAME, ! 'dc:description' => _("RecentChanges"), ! 'link' => $rc_url, ! 'dc:date' => Iso8601DateTime(time())); /* FIXME: other things one might like in <channel>: *************** *** 146,201 **** * rss091:copyright */ ! $rss->channel($chan, $rc_url); ! $rss->image(array('title' => 'PhpWiki', // FIXME: this should be a config define ! 'link' => WikiURL(_("HomePage"), false, 'absurl'), ! 'url' => DataURL($GLOBALS['logo']))); ! ! $rss->textinput(array('title' => _("Search"), ! 'description' => _("Title Search"), ! 'name' => 's', ! 'link' => WikiURL(_("TitleSearch"), false, 'absurl'))); ! $limit = $args['limit']; ! while ($rev = $changes->next()) { ! $page = $rev->getPage(); ! $urlargs = array(); ! if ($args['show_all']) { ! // FIXME: should set previous, too, if showing only minor or major revs. ! // or maybe difftype. ! $urlargs['version'] = $rev->getVersion(); ! } ! ! $pagename = $page->getName(); ! ! $item = array('title' => split_pagename($pagename), ! 'description' => $rev->get('summary'), ! 'link' => WikiURL($pagename, $urlargs, 'absurl'), ! 'dc:date' => Iso8601DateTime($rev->get('mtime')), ! 'dc:contributor' => $rev->get('author'), ! 'wiki:version' => $rev->getVersion(), ! 'wiki:importance' => $rev->get('is_minor_edit') ? 'minor' : 'major', ! // wiki:status = 'new' | 'updated' | 'deleted' ! 'wiki:diff' => WikiURL($pagename, ! array_merge($urlargs, ! array('action' => 'diff', ! 'previous' => 'major')), ! 'absurl'), ! 'wiki:history' => WikiURL($pagename, ! array('action' => 'info'), ! 'absurl') ! ); ! $uri = WikiURL($pagename, array('version' => $rev->getVersion()), 'absurl'); ! $rss->addItem($item, $uri); ! if ($limit && --$limit <= 0) ! break; ! } ! return $rss->asXML(); } }; --- 271,358 ---- * rss091:copyright */ + } + + + + + function item_properties ($rev) { + $page = $rev->getPage(); + $pagename = $page->getName(); + + return array( 'title' => split_pagename($pagename), + 'description' => $this->summary($rev), + 'link' => $this->pageURL($rev), + 'dc:date' => $this->time($rev), + 'dc:contributor' => $rev->get('author'), + 'wiki:version' => $rev->getVersion(), + 'wiki:importance' => $this->importance($rev), + 'wiki:status' => $this->status($rev), + 'wiki:diff' => $this->diffURL($rev), + 'wiki:history' => WikiURL($pagename, + array('action' => 'info'), + 'absurl') + ); + } + } + + class WikiPlugin_RecentChanges + extends WikiPlugin + { + var $name = 'RecentChanges'; + + function getDefaultArguments() { + return array('days' => 2, + 'show_minor' => false, + 'show_major' => true, + 'show_all' => false, + 'limit' => false, + 'format' => false); + } ! function getArgs ($argstr, $request, $defaults = false) { ! $args = WikiPlugin::getArgs($argstr, $request, $defaults); ! if ($request->getArg('action') != 'browse') ! $args['format'] = false; // default -> HTML ! ! if ($args['format'] == 'rss' && empty($args['limit'])) ! $args['limit'] = 15; // Fix default value for RSS. ! return $args; ! } ! ! function getMostRecentParams ($args) { ! extract($args); ! $params = array('include_minor_revisions' => $show_minor, ! 'exclude_major_revisions' => !$show_major, ! 'include_all_revisions' => !empty($show_all)); + if ($limit > 0) + $params['limit'] = $limit; ! if ($days > 0.0) ! $params['since'] = time() - 24 * 3600 * $days; ! return $params; ! } ! ! function getChanges ($dbi, $args) { ! return $dbi->mostRecent($this->getMostRecentParams($args)); ! } ! function format ($changes, $args) { ! if ($args['format'] == 'rss') ! $fmt = new _RecentChanges_RssFormatter($args); ! else ! $fmt = new _RecentChanges_HtmlFormatter($args); ! return $fmt->format($changes); ! } ! ! ! function run ($dbi, $argstr, $request) { ! $args = $this->getArgs($argstr, $request); ! // Hack alert: format() is a NORETURN for rss formatters. ! return $this->format($this->getChanges($dbi, $args), $args); } }; |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:22:15
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory usw-pr-cvs1:/tmp/cvs-serv10942/lib/plugin Modified Files: TitleSearch.php Log Message: Remove obsolete FIXME note. Index: TitleSearch.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/TitleSearch.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** TitleSearch.php 2001/09/18 19:19:05 1.1 --- TitleSearch.php 2001/12/14 20:22:12 1.2 *************** *** 12,16 **** function getDefaultArguments() { - // FIXME: how to exclude multiple pages? return array('s' => false, 'auto_redirect' => false, --- 12,15 ---- |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:16:56
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9554/lib Modified Files: RssWriter.php Log Message: Modified semantics. RssWriter now writes its output directly (like ZipWriter) rather than returning it in a string. Index: RssWriter.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/RssWriter.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** RssWriter.php 2001/12/07 22:15:43 1.1 --- RssWriter.php 2001/12/14 20:16:53 1.2 *************** *** 115,118 **** --- 115,120 ---- }; + // Encoding for RSS output. + define('RSS_ENCODING', 'ISO-8859-1'); /** *************** *** 168,172 **** // 'description', 'URI' function addItem($properties, $uri = false) { ! $this->_items[] = $this->__node('item', $properties, $uri); } --- 170,174 ---- // 'description', 'URI' function addItem($properties, $uri = false) { ! $this->_items[] = $this->__node('item', $properties, $uri); } *************** *** 177,181 **** function image($properties, $uri = false) { $this->_image = $this->__node('image', $properties, $uri); - } --- 179,182 ---- *************** *** 218,232 **** $this->add($items); $this->_finished = true; } /** ! * Get XML representation of RSS. */ ! function asXML () { ! $this->finish(); ! return $this->asString(); } ! /** * Create a new RDF <i>typedNode</i>. --- 219,237 ---- $this->add($items); + $this->__spew(); $this->_finished = true; } + /** ! * Write output to HTTP client. */ ! function __spew() { ! header("Content-Type: application/xml; charset=" . RSS_ENCODING); ! printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); ! echo $this->asString(); } ! ! /** * Create a new RDF <i>typedNode</i>. |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:15:07
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9036/lib Modified Files: diff.php difflib.php Log Message: Added a few comments. Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** diff.php 2001/12/13 18:29:24 1.18 --- diff.php 2001/12/14 20:15:02 1.19 *************** *** 11,14 **** --- 11,23 ---- require_once('lib/difflib.php'); + /** + * HTML unified diff formatter. + * + * This class formats a diff into a CSS-based + * unified diff format. + * + * Within groups of changed lines, diffs are highlit + * at the character-diff level. + */ class HtmlUnifiedDiffFormatter extends UnifiedDiffFormatter { *************** *** 114,117 **** --- 123,136 ---- } + /** + * HTML table-based unified diff formatter. + * + * This class formats a diff into a table-based + * unified diff format. (Similar to what was produced + * by previous versions of PhpWiki.) + * + * Within groups of changed lines, diffs are highlit + * at the character-diff level. + */ class TableUnifiedDiffFormatter extends HtmlUnifiedDiffFormatter { Index: difflib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/difflib.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** difflib.php 2001/12/13 05:10:04 1.1 --- difflib.php 2001/12/14 20:15:02 1.2 *************** *** 19,26 **** var $final; - function _DiffOp () { - trigger_error("pure virtual", E_USER_ERROR); - } - function reverse() { trigger_error("pure virtual", E_USER_ERROR); --- 19,22 ---- *************** *** 97,100 **** --- 93,99 ---- * Finally, some ideas (subdivision by NCHUNKS > 2, and some optimizations) * are my own. + * + * @author Geoffrey T. Dairiki + * @access private */ class _DiffEngine *************** *** 476,480 **** /** ! * Class representing a diff between two files. */ class Diff --- 475,479 ---- /** ! * Class representing a 'diff' between two sequences of strings. */ class Diff *************** *** 483,487 **** /** ! * Compute diff between lists of strings. */ function Diff($from_lines, $to_lines) { --- 482,491 ---- /** ! * Constructor. ! * Computes diff between sequences of strings. ! * ! * @param $from_lines array An array of strings. ! * (Typically these are lines from a file.) ! * @param $to_lines array An array of strings. */ function Diff($from_lines, $to_lines) { *************** *** 498,504 **** * $diff = new Diff($lines1, $lines2); * $rev = $diff->reverse(); ! * ! * // reconstruct $lines1 from $lines2: ! * $out = $rev->apply($lines2); */ function reverse () { --- 502,507 ---- * $diff = new Diff($lines1, $lines2); * $rev = $diff->reverse(); ! * @return object A Diff object representing the inverse of the ! * original diff. */ function reverse () { *************** *** 512,516 **** /** ! * Return true if two files were equal. */ function isEmpty () { --- 515,521 ---- /** ! * Check for empty diff. ! * ! * @return bool True iff two sequences were identical. */ function isEmpty () { *************** *** 526,529 **** --- 531,536 ---- * * This is mostly for diagnostic purposed. + * + * @return int The length of the LCS. */ function lcs () { *************** *** 538,541 **** --- 545,553 ---- /** * Get the original set of lines. + * + * This reconstructs the $from_lines parameter passed to the + * constructor. + * + * @return array The original sequence of strings. */ function orig() { *************** *** 551,554 **** --- 563,571 ---- /** * Get the final set of lines. + * + * This reconstructs the $to_lines parameter passed to the + * constructor. + * + * @return array The sequence of strings. */ function final() { *************** *** 592,600 **** } class DiffFormatter { var $leading_context_lines = 0; var $trailing_context_lines = 0; ! function format($diff) { --- 609,643 ---- } + /** + * A class to format Diffs + * + * This class formats the diff in classic diff format. + * It is intended that this class be customized via inheritance, + * to obtain fancier outputs. + */ class DiffFormatter { + /** + * Number of leading context "lines" to preserve. + * + * This should be left at zero for this class, but subclasses + * may want to set this to other values. + */ var $leading_context_lines = 0; + + /** + * Number of trailing context "lines" to preserve. + * + * This should be left at zero for this class, but subclasses + * may want to set this to other values. + */ var $trailing_context_lines = 0; ! ! /** ! * Format a diff. ! * ! * @param $diff object A Diff object. ! * @return string The formatted output. ! */ function format($diff) { *************** *** 674,678 **** $this->_end_block(); } ! function _start_diff() { } --- 717,721 ---- $this->_end_block(); } ! function _start_diff() { } *************** *** 720,723 **** --- 763,771 ---- } + /** + * "Unified" diff formatter. + * + * This class formats the diff in classic "unified diff" format. + */ class UnifiedDiffFormatter extends DiffFormatter { |
From: Geoffrey T. D. <da...@us...> - 2001-12-14 20:13:24
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv8470/lib Modified Files: WikiPlugin.php Log Message: Bug fix. Index: WikiPlugin.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiPlugin.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** WikiPlugin.php 2001/09/18 19:16:23 1.1 --- WikiPlugin.php 2001/12/14 20:13:20 1.2 *************** *** 29,33 **** if (isset($argstr_args[$arg])) $args[$arg] = $argstr_args[$arg]; ! elseif ( ($argval = $request->getArg($arg)) ) $args[$arg] = $argval; elseif (isset($argstr_defaults[$arg])) --- 29,33 ---- if (isset($argstr_args[$arg])) $args[$arg] = $argstr_args[$arg]; ! elseif ( ($argval = $request->getArg($arg)) !== false ) $args[$arg] = $argval; elseif (isset($argstr_defaults[$arg])) *************** *** 103,107 **** $link_defaults = $this->getDefaultLinkArguments(); $defaults = array_merge($defaults, $link_defaults); ! $args = $this->getArgs($argstr, $request, $defaults); $plugin = $this->getName(); --- 103,107 ---- $link_defaults = $this->getDefaultLinkArguments(); $defaults = array_merge($defaults, $link_defaults); ! $args = $this->getArgs($argstr, $request, $defaults); $plugin = $this->getName(); |
From: Geoffrey T. D. <da...@us...> - 2001-12-13 20:10:31
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv6255/lib Modified Files: pageinfo.php Log Message: JavaScript cleanup. Index: pageinfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pageinfo.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** pageinfo.php 2001/12/13 18:29:24 1.13 --- pageinfo.php 2001/12/13 20:10:26 1.14 *************** *** 44,48 **** 'name' => 'versions[]', 'value' => $version, - 'onClick' => "check_cb(this);", 'checked' => ($i++ <= 1)))); --- 44,47 ---- *************** *** 73,111 **** $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; ! $jscript = 'function check_cb(checkbox) { // If more than two diff selection checkboxes are checked, // uncheck some. (But don\'t uncheck either the currently // clicked or the previously clicked box.) - form = checkbox.form; ! selected = checkbox.value; ! previous = form.previous_selection; ! form.previous_selection = selected; ! ! deletable = new Array(); ! nchecked = 0; ! for (i = 0; i < form.elements.length; i++) { ! cb = form.elements[i]; ! if (cb.name != "versions[]" || ! cb.checked) ! continue; ! ! nchecked++; ! if (cb.value != selected && cb.value != previous) ! deletable[deletable.length] = cb; } - for (i = 0; i < nchecked - 2; i++) ! deletable[i].checked = false; ! }'; ! ! $html = Element('script', array('language' => 'JavaScript'), ! "<!-- //\n$jscript\n//-->") . "\n"; ! $html .= Element('p', ! htmlspecialchars(gettext("Currently archived versions of")) ! . " " ! . LinkExistingWikiWord($pagename)) . "\n"; ! $html .= Element('form', $formargs, $table); echo GeneratePage('MESSAGE', $html, gettext("Revision History: ") . $pagename); --- 72,113 ---- $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; + $formargs['name'] = 'diff-select'; ! ! ! $html = Element('p', ! htmlspecialchars(gettext("Currently archived versions of")) ! . " " ! . LinkExistingWikiWord($pagename)) . "\n"; ! $html .= Element('form', $formargs, $table); ! ! $html .= Element('script', array('language' => 'JavaScript'), ! '<!-- // ! var versionCheckboxes = document.forms["diff-select"].elements["versions[]"]; ! var previousSelection; ! ! function _diffcheck_cb() { // If more than two diff selection checkboxes are checked, // uncheck some. (But don\'t uncheck either the currently // clicked or the previously clicked box.) ! var nchecked = 0; ! var uncheckable = new Array(); ! for (i = 0; i < versionCheckboxes.length; i++) { ! var cb = versionCheckboxes[i]; ! if (cb.checked) { ! nchecked++; ! if (cb != this && cb != previousSelection) ! uncheckable[uncheckable.length] = cb; ! } } for (i = 0; i < nchecked - 2; i++) ! uncheckable[i].checked = false; ! previousSelection = this; ! } ! for (i = 0; i < versionCheckboxes.length; i++) ! versionCheckboxes[i].onclick = _diffcheck_cb; ! //-->') . "\n"; echo GeneratePage('MESSAGE', $html, gettext("Revision History: ") . $pagename); |
From: Geoffrey T. D. <da...@us...> - 2001-12-13 18:29:28
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv11426/lib Modified Files: diff.php pageinfo.php Log Message: Experiment with more compact diff selection: single column of checkboxes instead of two columns of radio boxes. Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** diff.php 2001/12/13 05:10:04 1.17 --- diff.php 2001/12/13 18:29:24 1.18 *************** *** 184,192 **** function showDiff ($dbi, $request) { $pagename = $request->getArg('pagename'); ! $version = $request->getArg('version'); ! $previous = $request->getArg('previous'); $page = $dbi->getPage($pagename); - if ($version) { if (!($new = $page->getRevision($version))) --- 184,198 ---- function showDiff ($dbi, $request) { $pagename = $request->getArg('pagename'); ! if (is_array($versions = $request->getArg('versions'))) { ! // Version selection from pageinfo.php display: ! rsort($versions); ! list ($version, $previous) = $versions; ! } ! else { ! $version = $request->getArg('version'); ! $previous = $request->getArg('previous'); ! } $page = $dbi->getPage($pagename); if ($version) { if (!($new = $page->getRevision($version))) Index: pageinfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/pageinfo.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** pageinfo.php 2001/10/29 18:24:26 1.12 --- pageinfo.php 2001/12/13 18:29:24 1.13 *************** *** 12,17 **** "\n" . Element('th', 'Version') . "\n" ! . Element('th', 'Newer') . "\n" ! . Element('th', 'Older') . "\n" . Element('th', 'Created') . "\n" . Element('th', 'Summary') . "\n" --- 12,16 ---- "\n" . Element('th', 'Version') . "\n" ! . Element('th', 'Diff') . "\n" . Element('th', 'Created') . "\n" . Element('th', 'Summary') . "\n" *************** *** 42,56 **** $cols[] = Element('td', array('align' => 'center'), ! QElement('input', array('type' => 'radio', ! 'name' => 'version', 'value' => $version, ! 'checked' => $i == 0))); - $cols[] = Element('td', array('align' => 'center'), - QElement('input', array('type' => 'radio', - 'name' => 'previous', - 'value' => $version, - 'checked' => $i++ == 1))); - $cols[] = QElement('td', array('align' => 'right'), strftime($datetimeformat, $rev->get('mtime')) --- 41,50 ---- $cols[] = Element('td', array('align' => 'center'), ! QElement('input', array('type' => 'checkbox', ! 'name' => 'versions[]', 'value' => $version, ! 'onClick' => "check_cb(this);", ! 'checked' => ($i++ <= 1)))); $cols[] = QElement('td', array('align' => 'right'), strftime($datetimeformat, $rev->get('mtime')) *************** *** 79,87 **** $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; ! $html = Element('p', htmlspecialchars(gettext("Currently archived versions of")) . " " ! . LinkExistingWikiWord($pagename)); $html .= Element('form', $formargs, $table); --- 73,110 ---- $formargs['action'] = USE_PATH_INFO ? WikiURL($pagename) : SCRIPT_NAME; $formargs['method'] = 'post'; + + $jscript = 'function check_cb(checkbox) { + // If more than two diff selection checkboxes are checked, + // uncheck some. (But don\'t uncheck either the currently + // clicked or the previously clicked box.) + form = checkbox.form; + + selected = checkbox.value; + previous = form.previous_selection; + form.previous_selection = selected; + + deletable = new Array(); + nchecked = 0; + for (i = 0; i < form.elements.length; i++) { + cb = form.elements[i]; + if (cb.name != "versions[]" || ! cb.checked) + continue; + + nchecked++; + if (cb.value != selected && cb.value != previous) + deletable[deletable.length] = cb; + } + + for (i = 0; i < nchecked - 2; i++) + deletable[i].checked = false; + }'; + + $html = Element('script', array('language' => 'JavaScript'), + "<!-- //\n$jscript\n//-->") . "\n"; ! $html .= Element('p', htmlspecialchars(gettext("Currently archived versions of")) . " " ! . LinkExistingWikiWord($pagename)) . "\n"; $html .= Element('form', $formargs, $table); |
From: Geoffrey T. D. <da...@us...> - 2001-12-13 16:48:51
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv10373 Modified Files: phpwiki.css phpwiki-heavy.css Log Message: Tune-ups for diff output: bolder colors, NS4 cleanup. Index: phpwiki.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/phpwiki.css,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** phpwiki.css 2001/12/13 05:10:04 1.10 --- phpwiki.css 2001/12/13 16:48:48 1.11 *************** *** 226,251 **** } ! /* Diff output */ ! .diff .block { ! padding: 0.5ex 0.5em; ! margin: 0.5ex 0; ! border: 0.1px; /* hack for NS4 to get background color filled in whole div */ ! } .diff .block tt { font-weight: bold; } ! .diff .block div { position: relative; padding-left: 1.5em; } .diff .prefix { position: absolute; left: 0.5em; top: 0; } .diff .block { background: #ccc; } - .diff .context { background: white; } ! .diff .deleted { background: #fee; } ! .diff .added { background: #efe; } ! .diff .changed { background: #ffb; } ! .diff del { background: #fbb; font-weight: bold; text-decoration: none; } ! .diff ins { background: #bfb; font-weight: bold; text-decoration: none; } - /* For emacs users * --- 226,252 ---- } ! /**************************************************************** ! ** ! ** Diff Output ! ** ! *****************************************************************/ ! .diff .block { padding: 0.5ex 0.5em; margin: 0.5ex 0; } .diff .block tt { font-weight: bold; } ! /* These screw up NS4 --- moved to phpwiki-heavy.css ! .diff .block div { position: relative; padding-left: 1.5em; } .diff .prefix { position: absolute; left: 0.5em; top: 0; } + */ .diff .block { background: #ccc; } .diff .context { background: white; } ! .diff .deleted { background: #fcc; } ! .diff .added { background: #cfc; } ! .diff .changed { background: #ff6; } ! /* These don't work in NS4 -- it completely ignores <del> and <ins>. */ ! .diff del { background: #f99; font-weight: bold; text-decoration: none; } ! .diff ins { background: #9f9; font-weight: bold; text-decoration: none; } /* For emacs users * Index: phpwiki-heavy.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/phpwiki-heavy.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** phpwiki-heavy.css 2001/09/18 19:16:23 1.1 --- phpwiki-heavy.css 2001/12/13 16:48:48 1.2 *************** *** 31,32 **** --- 31,41 ---- } + /**************************************************************** + ** + ** Diff Output + ** + *****************************************************************/ + .diff .block div { position: relative; padding-left: 1.5em; } + .diff .prefix { position: absolute; left: 0.5em; top: 0; } + + |
From: Carsten K. <car...@us...> - 2001-12-13 08:22:50
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv9306/phpwiki/lib Modified Files: FileFinder.php Log Message: Permanently added Mac OS X pear path as this is unlikely to change in the near future. Also added a sample error message which would indicate when the include_path needs to be defined. Index: FileFinder.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/FileFinder.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** FileFinder.php 2001/10/29 20:43:18 1.3 --- FileFinder.php 2001/12/13 08:22:47 1.4 *************** *** 187,191 **** '/usr/local/share/php', '/usr/local/lib/php4', ! '/usr/local/lib/php')); } } --- 187,192 ---- '/usr/local/share/php', '/usr/local/lib/php4', ! '/usr/local/lib/php', ! '/System/Library/PHP')); } } |
From: Carsten K. <car...@us...> - 2001-12-13 08:22:46
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv9285/phpwiki Modified Files: index.php Log Message: Permanently added Mac OS X pear path as this is unlikely to change in the near future. Also added a sample error message which would indicate when the include_path needs to be defined. Index: index.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/index.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** index.php 2001/12/11 22:41:38 1.39 --- index.php 2001/12/13 08:22:43 1.40 *************** *** 29,32 **** --- 29,36 ---- // /System/Library/PHP // + // The above examples are already included by PhpWiki. + // You shouldn't have to change this unless you see a WikiFatalError: + // lib/FileFinder.php:82: Fatal[256]: DB.php: file not found + // //ini_set('include_path', '.:/where/you/installed/phpwiki'); |
From: Geoffrey T. D. <da...@us...> - 2001-12-13 05:10:07
|
Update of /cvsroot/phpwiki/phpwiki In directory usw-pr-cvs1:/tmp/cvs-serv6353 Modified Files: phpwiki.css Log Message: Refactor diff code: o Code clean-up and refactor. o Split the PhpWiki-independent part of the code into lib/difflib.php. o New CSS-formatted unified diff output replaces old table-heavy format. o Add character-level diffs. Issues: o New CSS-formatted diffs are very ugly in NS4 (and probably other oldish browsers.) o Character-level diffs may be overkill. Maybe back off to word-level diffs? Index: phpwiki.css =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/phpwiki.css,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** phpwiki.css 2001/12/11 22:45:38 1.9 --- phpwiki.css 2001/12/13 05:10:04 1.10 *************** *** 225,241 **** margin: 0.5ex 0px; } ! ! .diff-added { ! background: #cfc; ! } ! .diff-deleted { ! background: #fcc; ! } ! .diff-unchanged { ! background: white; ! } ! .diff-notation { ! background: #ccc; ! } /* For emacs users --- 225,250 ---- margin: 0.5ex 0px; } ! ! /* Diff output */ ! .diff .block { ! padding: 0.5ex 0.5em; ! margin: 0.5ex 0; ! border: 0.1px; /* hack for NS4 to get background color filled in whole div */ ! } ! .diff .block tt { font-weight: bold; } ! ! .diff .block div { position: relative; padding-left: 1.5em; } ! .diff .prefix { position: absolute; left: 0.5em; top: 0; } ! ! .diff .block { background: #ccc; } ! ! .diff .context { background: white; } ! .diff .deleted { background: #fee; } ! .diff .added { background: #efe; } ! .diff .changed { background: #ffb; } ! ! .diff del { background: #fbb; font-weight: bold; text-decoration: none; } ! .diff ins { background: #bfb; font-weight: bold; text-decoration: none; } ! /* For emacs users |
From: Geoffrey T. D. <da...@us...> - 2001-12-13 05:10:07
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv6353/lib Modified Files: diff.php Added Files: difflib.php Log Message: Refactor diff code: o Code clean-up and refactor. o Split the PhpWiki-independent part of the code into lib/difflib.php. o New CSS-formatted unified diff output replaces old table-heavy format. o Add character-level diffs. Issues: o New CSS-formatted diffs are very ugly in NS4 (and probably other oldish browsers.) o Character-level diffs may be overkill. Maybe back off to word-level diffs? ***** Error reading new file: [Errno 2] No such file or directory: 'difflib.php' Index: diff.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/diff.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** diff.php 2001/12/11 05:51:10 1.16 --- diff.php 2001/12/13 05:10:04 1.17 *************** *** 3,1025 **** // diff.php // ! // A PHP diff engine for phpwiki. // ! // Copyright (C) 2000 Geoffrey T. Dairiki <da...@da...> // You may copy this code freely under the conditions of the GPL. // ! // FIXME: possibly remove assert()'s for production version? [...1185 lines suppressed...] *************** *** 1143,1149 **** } else { ! //$fmt = new WikiDiffFormatter; ! $fmt = new WikiUnifiedDiffFormatter; ! $html .= $fmt->format($diff, $old->getContent()); } } --- 278,287 ---- } else { ! // New CSS formatted unified diffs (ugly in NS4). ! $fmt = new HtmlUnifiedDiffFormatter; ! ! // Use this for old table-formatted diffs. ! //$fmt = new TableUnifiedDiffFormatter; ! $html .= $fmt->format($diff); } } |