From d5a1fb1a15133b1acbf9f6fd98b577404bb807d6 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 3 Apr 2016 15:27:50 +0100 Subject: [PATCH] Add 'N' next to new pages in recent changes --- build/index.php | 12 +++++++++--- module_index.json | 2 +- modules/feature-recent-changes.php | 10 +++++++--- settings.fragment.php | 2 ++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/build/index.php b/build/index.php index 1d272c8..5971e4a 100644 --- a/build/index.php +++ b/build/index.php @@ -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; } .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; } /* #ffdb6d #36962c */"; @@ -1613,7 +1615,7 @@ register_module([ if(isset($pageindex->$pageDisplayName) and !empty($pageindex->$pageDisplayName->redirect)) $pageDisplayName = "$pageDisplayName"; - $content .= "\t\t\t
  • $pageDisplayName ✎ $rchange->user ($size_display)
  • \n"; + $content .= "\t\t\tnewpage) ? " class='newpage'" : "") . ">$pageDisplayName ✎ $rchange->user ($size_display)\n"; } $content .= "\t\t"; } @@ -1636,13 +1638,17 @@ register_module([ $size_diff = $newsize - $oldsize; $recentchanges = json_decode(file_get_contents($paths->recentchanges), true); - array_unshift($recentchanges, [ + $newchange = [ + "type" => "edit", "timestamp" => time(), "page" => $env->page, "user" => $env->user, "newsize" => $newsize, "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 // been asked to. diff --git a/module_index.json b/module_index.json index d1eca48..63da429 100644 --- a/module_index.json +++ b/module_index.json @@ -41,7 +41,7 @@ "author": "Starbeamrainbowlabs", "description": "Adds recent changes. Access through the 'recent-changes' action.", "id": "feature-recent-changes", - "lastupdate": 1459627889, + "lastupdate": 1459693632, "optional": false }, { diff --git a/modules/feature-recent-changes.php b/modules/feature-recent-changes.php index 4c5fe43..9c2162c 100644 --- a/modules/feature-recent-changes.php +++ b/modules/feature-recent-changes.php @@ -51,7 +51,7 @@ register_module([ if(isset($pageindex->$pageDisplayName) and !empty($pageindex->$pageDisplayName->redirect)) $pageDisplayName = "$pageDisplayName"; - $content .= "\t\t\t
  • $pageDisplayName ✎ $rchange->user ($size_display)
  • \n"; + $content .= "\t\t\tnewpage) ? " class='newpage'" : "") . ">$pageDisplayName ✎ $rchange->user ($size_display)\n"; } $content .= "\t\t"; } @@ -74,13 +74,17 @@ register_module([ $size_diff = $newsize - $oldsize; $recentchanges = json_decode(file_get_contents($paths->recentchanges), true); - array_unshift($recentchanges, [ + $newchange = [ + "type" => "edit", "timestamp" => time(), "page" => $env->page, "user" => $env->user, "newsize" => $newsize, "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 // been asked to. diff --git a/settings.fragment.php b/settings.fragment.php index 00e17f1..39ccf33 100644 --- a/settings.fragment.php +++ b/settings.fragment.php @@ -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; } .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; } /* #ffdb6d #36962c */";