1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- ---
- layout: default
- ---
- <script>
-
- function printLibrary(sheet) {
- const store = new SteinStore(
- "https://api.steinhq.com/v1/storages/5e8b937ab88d3d04ae0816a5"
- );
- var rules = "";
- store.read(sheet, { limit: 0, offset: 0 }).then(data => {
- rules = data.reverse();
- libHTML = "";
- for (var i = 0; i < rules.length; i++) {
- var title = rules[i]["communityname"];
- if (title == null) { title = "Untitled"; }
- libHTML += "<div class='library-rule-name'>" +
- "<a href='/create/?r=" + rules[i]["ruleID"] + "'>" +
- title + "</a></div>\n";
- var author = rules[i]["author-text"];
- if (author != null) {
- libHTML += "<div class='library-rule-author'>" + author + "</div>";
- }
- var structure = rules[i]["structure"];
- if (structure != null) {
- libHTML += "<p class='library-rule-structure'>" + structure;
- libHTML += "</p>\n\n";
- }
- }
- document.getElementById("librarylist").innerHTML = libHTML;
- });
- }
- // allows for using alt sheets (though rule.html is not equipped)
- var source = "";
- window.onload = function() {
- if ((window.location.href.indexOf("/library/") != -1)) {
- source = "rules";
- }
- printLibrary(source);
- }
- </script>
- <article class="post">
- <header class="post-header">
- <h1 class="post-title">{{ page.title }}</h1>
- </header>
- <div class="post-content">
- {{ content }}
-
- <div id="librarylist">
- </div>
- </div>
- </article>
|