Browse Source

Added Commento commenting functionality, a couple bugfixes

Nathan Schneider 4 years ago
parent
commit
e37b9d5a48
3 changed files with 19 additions and 14 deletions
  1. 1 3
      _includes/rule-scripts.html
  2. 12 10
      _layouts/rule.html
  3. 6 1
      _sass/communityrule.scss

+ 1 - 3
_includes/rule-scripts.html

@@ -268,7 +268,6 @@ https://github.com/Bernardo-Castilho/dragdroptouch -->
   function toggleEditMode() {
       if (editMode === true) { // switch to preview mode
           editMode = false;
-          classDisplayAll("button","none");
           classDisplayAll("prompt","none");
           classDisplayAll("delete-module","none");
           var editableFields = document.getElementsByClassName("editable");  
@@ -313,7 +312,6 @@ https://github.com/Bernardo-Castilho/dragdroptouch -->
           document.getElementById("editToggle").innerHTML = "Customize";
       } else { // Switch to editMode
           editMode = true;
-          classDisplayAll("button","block");
           classDisplayAll("prompt","block");
           classDisplayAll("editable","block");
           // RuleBuilder handling
@@ -606,4 +604,4 @@ https://github.com/Bernardo-Castilho/dragdroptouch -->
           editableElements[i].addEventListener("paste", handleEditablePaste);
       } 
   }
-</script>
+</script>

+ 12 - 10
_layouts/rule.html

@@ -32,12 +32,6 @@ layout: default
     
     <!-- RuleBuilder -->
     <div id="rule-builder">
-
-      <button id="module-toggle" onclick="toggleVisible('module-menu')"
-              class="button" title="Show/hide">
-        <img src="{% link assets/tabler_icons/tool.svg %}" title="Modules" />
-      </button>
-
       <div id="module-input"
            ondrop="drop(event)" ondragover="allowDrop(event)">
         <span class="prompt" id="drag-directions">Browse modules from below and drag them here.</span>
@@ -118,16 +112,24 @@ layout: default
         title="Add to the public Library">Publish</button>
   <button class="pushButton" id="fork" onclick="fork()"
         title="Edit this Rule into a new one">Fork</button>
+  <button class="pushButton" onclick="toggleVisible('discuss')"
+        title="Discuss this Rule with others">Discuss</button>
   <button class="pushButton" onclick="textOutput()"
         title="Download this Rule as a Markdown text file">Export</button>
   <button class="pushButton" id="trash" onclick="deleteRule()">
     <img src="{% link assets/tabler_icons/trash.svg %}" title="Rule deletion request" />
   </button>
-  <button class="pushButton"
-        onclick="javascript:location.href='https://www.colorado.edu/lab/medlab/content/communityrule-user-feedback'">
-    Feedback
-  </button>
 
+  <div id="discuss" style="display:none;">
+    <button onclick="toggleVisible('discuss')" class="button chevrons" style="display:block;"><img src="{% link assets/tabler_icons/chevrons-up.svg %}" title="Hide" /></button>
+    <script defer
+            src="http://comment.medlab.host/js/commento.js"
+            data-no-fonts="true"
+            >
+    </script>
+    <div id="commento"></div>
+  </div>
+  
   <div id="attribution" style="display:none;">
     <br />
     <p><a href="https://communityrule.info">

+ 6 - 1
_sass/communityrule.scss

@@ -266,7 +266,7 @@ Enabling users to add links*/
     clear: both;
 }
 #toggleDisplayMode, #fork {
-    margin: 0 0 10px 0;
+    margin: 0 5px 10px 0;
     display: none;
 }
 #publishRule {
@@ -281,6 +281,11 @@ Enabling users to add links*/
     font-size: .8em;
     text-align: right;
 }
+#attributionMD {
+}
 #trash {
     display: none;
 }
+#discuss {
+    margin: 20px 0 20px 0;
+}