Browse Source

Added rudimentary output button

Nathan Schneider 5 years ago
parent
commit
4e04cd90e3
2 changed files with 24 additions and 6 deletions
  1. 23 5
      _layouts/rule.html
  2. 1 1
      _rules/do-ocracy.md

+ 23 - 5
_layouts/rule.html

@@ -69,6 +69,16 @@ layout: default
   padding: 5px;
   font-size: 1.2em;
 }
+#displayRule {
+  clear: both;
+  border: 1px solid gray;
+  color: gray;
+  background-color: white;
+  text-align: center;
+  border-radius: 6px;
+  padding: 5px;
+  font-size: 1.2em;
+}
 #basicstructure {
   font-size: 1.3em;
 }
@@ -116,7 +126,7 @@ layout: default
               editableFields[i].style.borderStyle = "none none dashed none";
               editableFields[i].contentEditable = "true";
           }
-          document.getElementById("editToggle").innerHTML = "Display";
+          document.getElementById("editToggle").innerHTML = "Preview";
       }
   }
 
@@ -127,6 +137,14 @@ layout: default
           toggleEditMode();
       }
   }
+
+  function displayRule() {
+      var ruleboxEl = document.getElementById('rulebox').outerHTML;    
+      document.write(ruleboxEl);
+      editMode = true;
+      toggleEditMode();
+  }
+  
 </script>
 
 <article class="post">
@@ -137,7 +155,7 @@ layout: default
     </h1>
   </header>
 
-  <button id="editToggle" onclick="toggleEditMode()">Display</button>
+  <button id="editToggle" onclick="toggleEditMode()">Preview</button>
 
   <div class="post-content">    
     {{ content }}
@@ -256,8 +274,8 @@ layout: default
   
   </div><!--#rulebox-->
 
-  <p>The suggested modules are linked to (in progress) entries at <a target="_blank" href="https://medlabboulder.gitlab.io/democraticmediums/">Democratic Mediums</a>.</p>
-
-  <p>To save work, copy the text from this page to another document, or use your browser’s save function or print the page to PDF. Improved saving functionality will be forthcoming.</p>
+  <p>When you're finished, use the button below and print, copy/paste, or save your Rule to where your community can keep track of it and edit it in the future. <strong>You won't be able to edit here after displaying.</strong></p>
   
+  <button id="displayRule" onclick="displayRule()">Display Rule</button>
+    
 </article>

+ 1 - 1
_rules/do-ocracy.md

@@ -21,4 +21,4 @@ modification: A proposal to change this Rule goes for a vote before all members
 
 Use this template as-is or edit it to adapt it to your community.
 
-Blends [do-ocracy](https://communitywiki.org/wiki/DoOcracy) and [lazy consensus](https://community.apache.org/committers/lazyConsensus.html).
+Blends [do-ocracy](https://medlabboulder.gitlab.io/democraticmediums/mediums/do-ocracy/) and [lazy consensus](https://medlabboulder.gitlab.io/democraticmediums/mediums/lazy_consensus/).