Pārlūkot izejas kodu

Added RuleBuilder to publishRule and displayRule

Nathan Schneider 4 gadi atpakaļ
vecāks
revīzija
7a0a18144f
2 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 0
      _layouts/rule.html
  2. 0 1
      _sass/communityrule.scss

+ 9 - 0
_layouts/rule.html

@@ -403,6 +403,13 @@ layout: default
           ruleID: timeID,
           timestamp: dateTime,
       }];
+      // begin adding data
+      // first, RuleBuilder data
+      document.getElementById("builder-field").innerHTML = ""; // so it doesn't publish
+      if (!builderEmpty()) {
+          rule[0]["builder"] = document.getElementById("module-input").innerHTML;
+      }
+      // next, RuleWriter data
       var fields = document.getElementsByClassName("editable");
       for (var i = 0; i < fields.length; i++) {
           var key = fields[i].id;
@@ -443,6 +450,8 @@ layout: default
                   document.getElementById(key).innerHTML = value;
               }
           }
+          // Add Builder content
+          document.getElementById("module-input").innerHTML = rule["builder"];
           // Publish timestamp to Rule
           document.getElementById('dateTime').innerHTML = rule['timestamp'];
           // Finish

+ 0 - 1
_sass/communityrule.scss

@@ -87,7 +87,6 @@
 }
 .delete-module {
     cursor: pointer;
-    display: none;
 }
 
 .field-controls {