1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Add 'N' next to new pages in recent changes

This commit is contained in:
Starbeamrainbowlabs 2016-04-03 15:27:50 +01:00
parent 254476c94c
commit d5a1fb1a15
4 changed files with 19 additions and 7 deletions

View file

@ -353,6 +353,8 @@ textarea ~ input[type=submit] { margin: 0.5rem 0.8rem; padding: 0.5rem; font-wei
.nochange { color: rgb(132, 123, 199); font-style: italic; } .nochange { color: rgb(132, 123, 199); font-style: italic; }
.significant { font-weight: bolder; font-size: 1.1rem; } .significant { font-weight: bolder; font-size: 1.1rem; }
.newpage::before { content: \"N\"; margin: 0 0.3em 0 -1em; font-weight: bolder; text-decoration: underline dotted; }
footer { padding: 2rem; } footer { padding: 2rem; }
/* #ffdb6d #36962c */"; /* #ffdb6d #36962c */";
@ -1613,7 +1615,7 @@ register_module([
if(isset($pageindex->$pageDisplayName) and !empty($pageindex->$pageDisplayName->redirect)) if(isset($pageindex->$pageDisplayName) and !empty($pageindex->$pageDisplayName->redirect))
$pageDisplayName = "<em>$pageDisplayName</em>"; $pageDisplayName = "<em>$pageDisplayName</em>";
$content .= "\t\t\t<li><a href='?page=" . rawurlencode($rchange->page) . "'>$pageDisplayName</a> <span class='editor'>&#9998; $rchange->user</span> <time class='cursor-query' title='" . date("l jS \of F Y \a\\t h:ia T", $rchange->timestamp) . "'>" . human_time_since($rchange->timestamp) . "</time> <span class='$size_display_class' title='$title_display'>($size_display)</span></li>\n"; $content .= "\t\t\t<li" . (!empty($rchange->newpage) ? " class='newpage'" : "") . "><a href='?page=" . rawurlencode($rchange->page) . "'>$pageDisplayName</a> <span class='editor'>&#9998; $rchange->user</span> <time class='cursor-query' title='" . date("l jS \of F Y \a\\t h:ia T", $rchange->timestamp) . "'>" . human_time_since($rchange->timestamp) . "</time> <span class='$size_display_class' title='$title_display'>($size_display)</span></li>\n";
} }
$content .= "\t\t</ul>"; $content .= "\t\t</ul>";
} }
@ -1636,13 +1638,17 @@ register_module([
$size_diff = $newsize - $oldsize; $size_diff = $newsize - $oldsize;
$recentchanges = json_decode(file_get_contents($paths->recentchanges), true); $recentchanges = json_decode(file_get_contents($paths->recentchanges), true);
array_unshift($recentchanges, [ $newchange = [
"type" => "edit",
"timestamp" => time(), "timestamp" => time(),
"page" => $env->page, "page" => $env->page,
"user" => $env->user, "user" => $env->user,
"newsize" => $newsize, "newsize" => $newsize,
"sizediff" => $size_diff "sizediff" => $size_diff
]); ];
if($oldsize == 0)
$newchange["newpage"] = true;
array_unshift($recentchanges, $newchange);
// Limit the number of entries in the recent changes file if we've // Limit the number of entries in the recent changes file if we've
// been asked to. // been asked to.

View file

@ -41,7 +41,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds recent changes. Access through the 'recent-changes' action.", "description": "Adds recent changes. Access through the 'recent-changes' action.",
"id": "feature-recent-changes", "id": "feature-recent-changes",
"lastupdate": 1459627889, "lastupdate": 1459693632,
"optional": false "optional": false
}, },
{ {

View file

@ -51,7 +51,7 @@ register_module([
if(isset($pageindex->$pageDisplayName) and !empty($pageindex->$pageDisplayName->redirect)) if(isset($pageindex->$pageDisplayName) and !empty($pageindex->$pageDisplayName->redirect))
$pageDisplayName = "<em>$pageDisplayName</em>"; $pageDisplayName = "<em>$pageDisplayName</em>";
$content .= "\t\t\t<li><a href='?page=" . rawurlencode($rchange->page) . "'>$pageDisplayName</a> <span class='editor'>&#9998; $rchange->user</span> <time class='cursor-query' title='" . date("l jS \of F Y \a\\t h:ia T", $rchange->timestamp) . "'>" . human_time_since($rchange->timestamp) . "</time> <span class='$size_display_class' title='$title_display'>($size_display)</span></li>\n"; $content .= "\t\t\t<li" . (!empty($rchange->newpage) ? " class='newpage'" : "") . "><a href='?page=" . rawurlencode($rchange->page) . "'>$pageDisplayName</a> <span class='editor'>&#9998; $rchange->user</span> <time class='cursor-query' title='" . date("l jS \of F Y \a\\t h:ia T", $rchange->timestamp) . "'>" . human_time_since($rchange->timestamp) . "</time> <span class='$size_display_class' title='$title_display'>($size_display)</span></li>\n";
} }
$content .= "\t\t</ul>"; $content .= "\t\t</ul>";
} }
@ -74,13 +74,17 @@ register_module([
$size_diff = $newsize - $oldsize; $size_diff = $newsize - $oldsize;
$recentchanges = json_decode(file_get_contents($paths->recentchanges), true); $recentchanges = json_decode(file_get_contents($paths->recentchanges), true);
array_unshift($recentchanges, [ $newchange = [
"type" => "edit",
"timestamp" => time(), "timestamp" => time(),
"page" => $env->page, "page" => $env->page,
"user" => $env->user, "user" => $env->user,
"newsize" => $newsize, "newsize" => $newsize,
"sizediff" => $size_diff "sizediff" => $size_diff
]); ];
if($oldsize == 0)
$newchange["newpage"] = true;
array_unshift($recentchanges, $newchange);
// Limit the number of entries in the recent changes file if we've // Limit the number of entries in the recent changes file if we've
// been asked to. // been asked to.

View file

@ -350,6 +350,8 @@ textarea ~ input[type=submit] { margin: 0.5rem 0.8rem; padding: 0.5rem; font-wei
.nochange { color: rgb(132, 123, 199); font-style: italic; } .nochange { color: rgb(132, 123, 199); font-style: italic; }
.significant { font-weight: bolder; font-size: 1.1rem; } .significant { font-weight: bolder; font-size: 1.1rem; }
.newpage::before { content: \"N\"; margin: 0 0.3em 0 -1em; font-weight: bolder; text-decoration: underline dotted; }
footer { padding: 2rem; } footer { padding: 2rem; }
/* #ffdb6d #36962c */"; /* #ffdb6d #36962c */";