diff options
Diffstat (limited to 'public/_/script.js')
-rw-r--r-- | public/_/script.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/public/_/script.js b/public/_/script.js new file mode 100644 index 0000000..05b3b3a --- /dev/null +++ b/public/_/script.js @@ -0,0 +1,14 @@ +(function(){ +var q = document.querySelector.bind(document); +var qa = document.querySelectorAll.bind(document); +window.lib = {}; +lib.elems = {}; +lib.isListPage = !!q('.posts'); +lib.isArticle = !lib.isListPage; +if (lib.isListPage) { +lib.elems.posts = [].slice.call(qa('.post')); +lib.elems.postsContainer = q('.posts'); +} else { +lib.elems.post = q('.post'); +} +})(); |