diff options
author | Ivan Davydov <lotigara@lotigara.ru> | 2025-06-24 14:03:34 +0300 |
---|---|---|
committer | Ivan Davydov <lotigara@lotigara.ru> | 2025-06-24 14:03:34 +0300 |
commit | a2e3bec40f5851be70299e7513967a0f5d042bf9 (patch) | |
tree | 5234a58ac93fa6c4752075a5128f183da0725c13 /public/_/script.js |
Initial commitmaster
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'); +} +})(); |