Add method to detect whether we’re on the “known Sones” page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 27 Nov 2010 15:07:18 +0000 (16:07 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 27 Nov 2010 15:07:18 +0000 (16:07 +0100)
src/main/resources/static/javascript/sone.js
src/main/resources/templates/knownSones.html

index 60a3848..66aa236 100644 (file)
@@ -660,6 +660,16 @@ function getShownPostId() {
        return $("#sone .post-id").text();
 }
 
+/**
+ * Returns whether the current page is the “known Sones” page.
+ *
+ * @returns {Boolean} <code>true</code> if the current page is the “known
+ *          Sones” page, <code>false</code> otherwise
+ */
+function isKnownSonesPage() {
+       return getPageId() == "known-sones";
+}
+
 var loadedPosts = {};
 var loadedReplies = {};
 
index 4520967..f5907a0 100644 (file)
@@ -1,5 +1,7 @@
 <%include include/head.html>
 
+       <div class="page-id hidden">known-sones</div>
+
        <h1><%= Page.KnownSones.Page.Title|l10n|html></h1>
 
        <div id="known-sones">