X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fresources%2Fstatic%2Fjavascript%2Fsone.js;h=59135afdbecdf109b4f7f879e95b059d8d197e69;hp=ba78d2c30e35c3b667e5638af4491b49d3c7e55a;hb=56d8cf539156f5949ce33aebf784438c737f84b3;hpb=3793feb13134119c1954c11e92e7f8dd5206fcc1 diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index ba78d2c..59135af 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -601,6 +601,25 @@ function getStatus() { }) } +/** + * Returns the content of the page-id attribute. + * + * @returns The page ID + */ +function getPageId() { + return $("#sone .page-id").text(); +} + +/** + * Returns whether the current page is the index page. + * + * @returns {Boolean} true if the current page is the index page, + * false otherwise + */ +function isIndexPage() { + return getPageId() == "index"; +} + var loadedPosts = {}; var loadedReplies = {};