rule.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ---
  2. layout: default
  3. # This is where most of the code for CommunityRule lives
  4. # Follow comments below in various sections for further explanation
  5. ---
  6. {% include rule-scripts.html %}
  7. <article class="post">
  8. <header class="post-header">
  9. <h1 class="post-title" id="title">
  10. {{ page.title }}
  11. </h1>
  12. <button class="pushButton" id="editToggle" onclick="toggleEditMode()">
  13. Preview</button>
  14. <div class="post-content">
  15. {{ content }}
  16. </div>
  17. </header>
  18. <div id="rulebox">
  19. <span class="prompt">What is the community’s name?</span>
  20. <h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
  21. <span class="prompt">Summarize its structure:</span>
  22. <p contenteditable="true" class="editable output" id="structure">{{ page.structure }}</p>
  23. <!-- RuleBuilder -->
  24. <div id="rule-builder">
  25. <div id="module-input"
  26. ondrop="drop(event)" ondragover="allowDrop(event)">
  27. <span class="prompt" id="drag-directions">Browse modules from below and drag them here.</span>
  28. </div>
  29. <div id="builder-field">
  30. </div>
  31. <div id="module-menu">
  32. <!-- Load preset modules from _modules/ -->
  33. {% assign modules_array = site.modules | sort: "type" %}
  34. {% assign last_type = "" %}
  35. {% for module in modules_array %}
  36. {% if module.layout == "module" %}
  37. {% if module.type != last_type %}
  38. {% if last_type != "" %}</div>{% endif %}
  39. <div class="module-type-header">
  40. <img src="{{ site.baseurl }}/{{ site.data.module_types[module.type].icon }}" />
  41. {{ module.type }}
  42. <button onclick="toggleVisible('module-type-{{ module.type }}')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  43. </div>
  44. <div class="module-questions">{{ site.data.module_types[module.type].question }}</div>
  45. <div id="module-type-{{ module.type }}" style="display: none;">
  46. {% endif %}
  47. {% assign last_type = module.type %}
  48. <span class="module" id="module-{{ module.title | slugify }}"
  49. draggable="true" ondragstart="drag(event)">
  50. <span id="module-name" title="{{ module.summary }}">{{ module.title }}</span>
  51. <a target="_blank" href="{{ module.url }}">
  52. <img title="More info" draggable="false" class="module-logo"
  53. src="{% link assets/tabler_icons/info-circle.svg %}" /></a>
  54. <a onclick="this.parentNode.remove()" class="delete-module"
  55. style="display:none">
  56. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  57. </span>
  58. {% endif %}
  59. {% endfor %}
  60. </div>
  61. <div id="module-custom-container">
  62. <!-- Customizable module -->
  63. <span class="module" id="module-custom"
  64. draggable="true" ondragstart="drag(event)">
  65. <input contenteditable="true" draggable="false" placeholder="Custom module..."/>
  66. <img src="{% link assets/tabler_icons/bulb.svg %}" class="module-logo"
  67. draggable="false" />
  68. <a onclick="this.parentNode.remove()" class="delete-module"
  69. style="display:none">
  70. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  71. </span>
  72. </div>
  73. </div><!-- END module-menu -->
  74. </div><!-- END RuleBuilder -->
  75. <div id="rulewriter-box">
  76. <span class="prompt"></span>
  77. <p id="rulewriter" contenteditable="true" class="editable output"></p>
  78. </div>
  79. <div id="authorship" class="linkbox">
  80. <span id="authorship-words">Created by</span>
  81. <input contenteditable="true" class="editable link-text" id="author-text" placeholder="Created by" />
  82. <span class="link-divider"><img src="{% link assets/tabler_icons/pencil.svg %}" title="Add link" /></span>
  83. <input contenteditable="true" class="editable link-url" id="author-url" placeholder="Creator URL (http://, https://)" type="url" pattern="http://.*|https://.*" />
  84. <span id="authorship-result"></span>
  85. </div>
  86. </div><!--#rulebox-->
  87. <div id="lineage">
  88. <img src="{% link assets/tabler_icons/file.svg %}" title="Derivation lineage" />
  89. <span id="lineage-list"></span>
  90. </div>
  91. <button class="pushButton" id="publishRule" onclick="publishRule()"
  92. title="Add to the public Library">Publish</button>
  93. <button class="pushButton" id="fork" onclick="fork()"
  94. title="Edit this Rule into a new one">Fork</button>
  95. <button class="pushButton" id="discuss-button" onclick="toggleVisible('discuss')"
  96. title="Discuss this Rule with others">Discuss</button>
  97. <button class="pushButton" onclick="textOutput()"
  98. title="Download this Rule as a Markdown text file">Export</button>
  99. <button class="pushButton" id="trash" onclick="deleteRule()">
  100. <img src="{% link assets/tabler_icons/trash.svg %}" title="Rule deletion request" />
  101. </button>
  102. <div id="discuss" style="display:none;">
  103. <button onclick="toggleVisible('discuss')" class="button chevrons" style="display:block;"><img src="{% link assets/tabler_icons/chevrons-up.svg %}" title="Hide" /></button>
  104. <p>Comment function in development! Thanks for your patience.</p>
  105. <!--
  106. <script defer
  107. src="https://comment.medlab.host/js/commento.js"
  108. data-no-fonts="true"
  109. >
  110. </script>
  111. <div id="commento"></div>
  112. -->
  113. </div>
  114. <div id="attribution" style="display:none;">
  115. <br />
  116. <p><a href="https://communityrule.info">
  117. <img src="https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %}" alt="CommunityRule derived"></a></p>
  118. <p id="dateTime"></p>
  119. <p>Created with <a href="https://communityrule.info">CommunityRule</a>,
  120. <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA</a></p>
  121. <p><strong>The Publish feature is experimental. Rules may be removed without notice</strong></p>
  122. </div>
  123. <div id="attributionMD" style="display:none;">
  124. [![CommunityRule derived](https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %})](https://communityrule.info)
  125. [Creative Commons BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)
  126. </div>
  127. </article>