rule.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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. <script>
  7. // Enter JavaScript-land!
  8. // First, some functions, followed by initialization commands
  9. // Begin BUILDER functions
  10. // source: https://www.codecanal.com/html5-drag-and-copy/
  11. function allowDrop(ev) {
  12. ev.preventDefault();
  13. }
  14. function drag(ev) {
  15. ev.dataTransfer.setData("text", ev.target.id);
  16. }
  17. function drop(ev) {
  18. ev.preventDefault();
  19. var target = ev.target;
  20. // Prevents dropping into text field
  21. if (target.id == "drag-directions") {
  22. target = target.parentElement;
  23. }
  24. // Set up transfer
  25. var data = ev.dataTransfer.getData("text");
  26. // Iff module is from the menu clone it
  27. var module = document.getElementById(data);
  28. if (module.parentElement.id == "module-menu") {
  29. module = module.cloneNode(true);
  30. // Add a corresponding text field
  31. var name = module.innerHTML.replace(/(<([^>]+)>)/ig,'');
  32. var query = "Explain how the <strong>" + name + "</strong> module works.";
  33. addField(query);
  34. }
  35. // append name
  36. module.id += "-dropped";
  37. // display the deletion button
  38. module.children[2].style.display = "inline";
  39. // pop it in!
  40. target.appendChild(module);
  41. // be sure the dummy text is gone
  42. document.getElementById("drag-directions").style.display = "none";
  43. // Send field contents to console to aid in database stuff
  44. console.log(document.getElementById("module-input"));
  45. }
  46. // Adds a new question field
  47. function addField(content) {
  48. // if input is null, add an empty field to the list
  49. // include a field removal button
  50. var destination = document.getElementById("builder-field");
  51. if (content == null) { content = ""; }
  52. var output = '\n<div><div class="field-controls">';
  53. output += '<a onclick="swapSibling(this.parentNode.parentNode,true)"><img src="{% link assets/tabler_icons/chevron-up.svg %}" /></a><br />';
  54. output += '<a onclick="this.parentNode.parentNode.remove()"><img src="{% link assets/tabler_icons/x.svg %}" class="delete-module" /></a><br />';
  55. output += '<a onclick="swapSibling(this.parentNode.parentNode,false)"><img src="{% link assets/tabler_icons/chevron-down.svg %}" /></a></div>';
  56. output += '<span class="question">' + content + '</span>';
  57. output += '<p contenteditable="true" class="editable output" id="custom-field"></p></div>\n';
  58. destination.innerHTML += output;
  59. }
  60. // Moves a text field up or down
  61. // direction is bool: true is up, false is down
  62. function swapSibling(node1, direction) {
  63. var node2 = null;
  64. if (direction == true) {
  65. node2 = node1.previousElementSibling;
  66. if (node2 == null) { return; }
  67. node2.parentNode.replaceChild(node2, node1);
  68. node2.parentNode.insertBefore(node1, node2);
  69. } else {
  70. node2 = node1.nextElementSibling;
  71. if (node2 == null) { return; }
  72. node1.parentNode.replaceChild(node1, node2);
  73. node1.parentNode.insertBefore(node2, node1);
  74. }
  75. console.log(node2);
  76. // cancel if there is no sibling
  77. }
  78. // end BUILDER functions
  79. // toggleVisible(id)
  80. // Toggles the visibility of a given element by given ID
  81. function toggleVisible(id) {
  82. var x = document.getElementById(id);
  83. if (x.style.display === "none") {
  84. x.style.display = "block";
  85. } else {
  86. x.style.display = "none";
  87. }
  88. }
  89. // classDisplayAll(className, value)
  90. // Assigns given display value to all elements with a given className
  91. function classDisplayAll(className, value) {
  92. var elements = document.getElementsByClassName(className);
  93. for (var i = 0; i < elements.length; i++) {
  94. elements[i].style.display = value;
  95. }
  96. }
  97. // toggleEditMode()
  98. // Toggles whether editable fields are editable or not
  99. // and removes editing tools.
  100. function toggleEditMode() {
  101. if (editMode === true) { // switch to preview mode
  102. editMode = false;
  103. classDisplayAll("section","block");
  104. classDisplayAll("button","none");
  105. classDisplayAll("question","none");
  106. classDisplayAll("delete-module","none");
  107. classDisplayAll("module-link","none");
  108. classDisplayAll("field-controls","none");
  109. var editableFields = document.getElementsByClassName("editable");
  110. // de-editable-ize the editable fields
  111. for (var i = 0; i < editableFields.length; i++) {
  112. editableFields[i].contentEditable = "false";
  113. editableFields[i].style.borderStyle = "none";
  114. // Remove empty fields entirely
  115. var content = editableFields[i].innerHTML;
  116. content = content.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  117. if (content === "") {
  118. editableFields[i].style.display = "none";
  119. }
  120. }
  121. // Remove headers of empty sections
  122. // Inefficient! Might be merged with the above iteration
  123. var sections = document.getElementsByClassName("section");
  124. for (var i = 0; i < sections.length; i++) {
  125. var sectionQuestions = sections[i].getElementsByClassName("editable");
  126. var blanks = 0;
  127. for (var x = 0; x < sectionQuestions.length; x++) {
  128. var content = sectionQuestions[x].innerHTML;
  129. content = content.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  130. if (content == "") { blanks++; }
  131. if (blanks == sectionQuestions.length) {
  132. var headerID = "header-s" + (i + 1);
  133. document.getElementById(headerID).style.display = "none";
  134. }
  135. }
  136. }
  137. // Handle links
  138. // TKTK
  139. // Handle author link
  140. var authorName = document.getElementById("author-text").value;
  141. var authorURL = document.getElementById("author-url").value;
  142. if (authorName != "") {
  143. document.getElementById("authorship-words").style.display = "inline";
  144. if (authorURL != "") { // both author and URL present
  145. document.getElementById("authorship-result").innerHTML = "<a href='" + authorURL +"'>" + authorName + "</a>";
  146. document.getElementById("authorship-result").style.display = "inline";
  147. } else { // only authorName present
  148. document.getElementById("authorship-result").innerHTML = authorName;
  149. document.getElementById("authorship-result").style.display = "inline";
  150. }
  151. } else {
  152. document.getElementById("authorship").style.display = "none";
  153. }
  154. // Finally, change button name
  155. document.getElementById("editToggle").innerHTML = "Customize";
  156. } else { // Switch to editMode
  157. editMode = true;
  158. classDisplayAll("button","block");
  159. classDisplayAll("question","block");
  160. classDisplayAll("editable","block");
  161. classDisplayAll("header","block");
  162. classDisplayAll("section","none");
  163. classDisplayAll("link-text","inline");
  164. classDisplayAll("link-url","inline");
  165. classDisplayAll("delete-module","inline");
  166. classDisplayAll("module-link","inline");
  167. classDisplayAll("field-controls","inline");
  168. // link handling TKTK
  169. // author handling
  170. document.getElementById("authorship-result").style.display = "none";
  171. document.getElementById("authorship-words").style.display = "none";
  172. document.getElementById("authorship").style.display = "block";
  173. // make all editable fields visible
  174. var editableFields = document.getElementsByClassName("editable");
  175. for (var i = 0; i < editableFields.length; i++) {
  176. editableFields[i].style.borderStyle = "none none dashed none";
  177. editableFields[i].contentEditable = "true";
  178. }
  179. // Change button name
  180. document.getElementById("editToggle").innerHTML = "Preview";
  181. }
  182. }
  183. // toggleDisplayMode()
  184. // toggles full displayMode, the Rule-only display for a published Rule
  185. // first, initialize variable:
  186. var displayMode = false;
  187. function toggleDisplayMode() {
  188. if (displayMode == false) {
  189. editMode = true;
  190. toggleEditMode(); // turns off editMode
  191. classDisplayAll("site-nav","none");
  192. classDisplayAll("post-header","none");
  193. classDisplayAll("site-footer","none");
  194. document.getElementById("attribution").style.display = "block";
  195. document.getElementById("toggleDisplayMode").style.display = "inline-block";
  196. document.getElementById("publishRule").style.display = "none";
  197. document.getElementById("trash").style.display = "inline-block";
  198. displayMode = true;
  199. } else {
  200. toggleEditMode() // turns on editMode
  201. classDisplayAll("site-nav","block");
  202. classDisplayAll("post-header","block");
  203. classDisplayAll("site-footer","block");
  204. document.getElementById("attribution").style.display = "none";
  205. document.getElementById("toggleDisplayMode").style.display = "none";
  206. document.getElementById("publishRule").style.display = "inline-block";
  207. document.getElementById("trash").style.display = "none";
  208. displayMode = false;
  209. }
  210. }
  211. // textOutput()
  212. // Produces Markdown rendition of Rule from Export button
  213. function textOutput() {
  214. var filename = 'GOVERNANCE.md';
  215. // First, add title, whether there is one or not
  216. var content = '# '+ document.getElementById('communityname').innerHTML + '\n\n';
  217. content = content.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  218. // Now, begin adding other elements
  219. var elements = document.getElementsByClassName('output');
  220. for (var i = 1; i < elements.length; i++) {
  221. var thisBit = elements[i].innerHTML;
  222. thisBit = thisBit.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  223. if (thisBit != "") {
  224. if (elements[i].classList.contains("subhead")) {
  225. // Before printing subhead, make sure it's not empty
  226. var i2 = i + 1;
  227. while ((i2 < elements.length) &&
  228. (!(elements[i2].classList.contains("subhead")))) {
  229. if (elements[i2].innerHTML != "") {
  230. // in this case, it's not empty, so print and move on
  231. content += '## ';
  232. content += thisBit + '\n\n';
  233. break;
  234. } else { i2++; }
  235. } // won't print anything if a subhead has only empty children
  236. } else {
  237. // Non-subhead elements can just go ahead and print
  238. content += thisBit + '\n\n';
  239. }
  240. }
  241. }
  242. // Add authorship block
  243. var authorName = document.getElementById("author-text").value;
  244. var authorURL = document.getElementById("author-url").value;
  245. var authorshipBlock = "---\n\nCreated by ";
  246. if (authorName != "") {
  247. if (authorURL != "") { // both author and URL present
  248. authorshipBlock += ("[" + authorName + "](" + authorURL + ")");
  249. } else { // only authorName present
  250. authorshipBlock += authorName;
  251. }
  252. content += (authorshipBlock + "\n");
  253. }
  254. // Add attribution block
  255. content += document.getElementById('attributionMD').innerHTML;
  256. // Starting here, see https://stackoverflow.com/a/33542499
  257. var blob = new Blob([content], {type: 'text/plain'});
  258. if(window.navigator.msSaveOrOpenBlob) {
  259. window.navigator.msSaveBlob(blob, filename);
  260. }
  261. else{
  262. var elem = window.document.createElement('a');
  263. elem.href = window.URL.createObjectURL(blob);
  264. elem.download = filename;
  265. document.body.appendChild(elem);
  266. elem.click();
  267. document.body.removeChild(elem);
  268. URL.revokeObjectURL(); // This needs an arg but I can't figure out what
  269. }
  270. var myFile = new Blob([fileContent], {type: 'text/plain'});
  271. window.URL = window.URL || window.webkitURL; document.getElementById('download').setAttribute('href',window.URL.createObjectURL(myFile));
  272. document.getElementById('download').setAttribute('download', fileName);
  273. }
  274. // BEGIN Publish tools, via SteinHQ.com
  275. // publishRule()
  276. // Publishes existing fields to new page, /builder/?rule=[ruleID]
  277. // Opens new page in Display mode
  278. function publishRule() {
  279. // Confirm user knows what they're getting into
  280. var r = confirm("Publish to the public Library?");
  281. if (r == false) { return; }
  282. // Proceed with publication
  283. var now = new Date();
  284. // Numerical ID for published Rule
  285. var timeID = now.getTime();
  286. // Readable UTC timestamp
  287. var dateTime = now.getUTCFullYear()+'.'+(now.getUTCMonth()+1)+'.'+now.getUTCDate()
  288. +' '+now.getUTCHours()+":"+ now.getUTCMinutes()+":"+now.getUTCSeconds()
  289. + ' UTC';
  290. // TKTK: Check if ruleID exists; while yes, replace and repeat
  291. var rule = [{
  292. ruleID: timeID,
  293. timestamp: dateTime,
  294. }];
  295. var fields = document.getElementsByClassName("editable");
  296. for (var i = 0; i < fields.length; i++) {
  297. var key = fields[i].id;
  298. var value = "";
  299. if (fields[i].nodeName == "INPUT") { // for <input>
  300. value = fields[i].value.replace(/(<([^>]+)>)/ig,"");
  301. } else { // for other fields
  302. value = fields[i].innerHTML.replace(/(<([^>]+)>)/ig,"");
  303. }
  304. rule[0][key] = value;
  305. }
  306. const store = new SteinStore(
  307. "https://api.steinhq.com/v1/storages/5e8b937ab88d3d04ae0816a5"
  308. );
  309. store.append("rules", rule).then(data => {
  310. window.open("/create/?r=" + timeID, "_self", false);
  311. });
  312. }
  313. // displayRule(ID)
  314. // Displays content based on ID
  315. function displayRule(ID) {
  316. const store = new SteinStore(
  317. "https://api.steinhq.com/v1/storages/5e8b937ab88d3d04ae0816a5"
  318. );
  319. store.read("rules", { search: { ruleID: ID } }).then(data => {
  320. // only runs when we have the data from Goog:
  321. var rule = data[0];
  322. var fields = document.getElementsByClassName("editable");
  323. for (var i = 0; i < fields.length; i++) {
  324. var key = fields[i].id;
  325. var value = rule[key];
  326. if (typeof value === "undefined") {
  327. value = "";
  328. } else if (key.includes("-")) { // links
  329. document.getElementById(key).value = value;
  330. } else {
  331. document.getElementById(key).innerHTML = value;
  332. }
  333. }
  334. // Publish timestamp to Rule
  335. document.getElementById('dateTime').innerHTML = rule['timestamp'];
  336. // Finish
  337. displayMode = false;
  338. toggleDisplayMode();
  339. document.title = rule['communityname'] + " / CommunityRule";
  340. });
  341. }
  342. // deleteRule()
  343. // A temporary placeholder that sends an email requesting rule deletion
  344. function deleteRule() {
  345. var urlParamz = new URLSearchParams(window.location.search);
  346. var rID = urlParamz.get('r');
  347. window.open("mailto:medlab@colorado.edu?subject=Delete Rule request ("
  348. + rID + ")&body=Please explain your rationale:\n");
  349. }
  350. // END Publish tools
  351. // FINALLY, Page loading
  352. // First, grab the current URL
  353. var urlParams = new URLSearchParams(window.location.search);
  354. // Determine if it is a published Rule
  355. if (urlParams.has('r')) {
  356. // If so, grab the Rule from database and enter displayMode
  357. var rID = urlParams.get('r');
  358. displayRule(rID);
  359. } else {
  360. // Otherwise, open in editMode as default
  361. var editMode = true;
  362. // switch out of editMode in special cases
  363. window.onload = function() {
  364. if ((window.location.href.indexOf("/templates/") != -1) ||
  365. (window.location.href.indexOf("/about/") != -1)) {
  366. toggleEditMode();
  367. }
  368. }
  369. }
  370. </script>
  371. <article class="post">
  372. <header class="post-header">
  373. <h1 class="post-title" id="title">
  374. {{ page.title }}
  375. </h1>
  376. <button class="pushButton" id="editToggle" onclick="toggleEditMode()">
  377. Preview</button>
  378. <div class="post-content">
  379. {{ content }}
  380. </div>
  381. </header>
  382. <div id="rulebox">
  383. <span class="question">What is the community’s name?</span>
  384. <h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
  385. <!-- BUILDER -->
  386. <div ondrop="drop(event)" ondragover="allowDrop(event)"
  387. class="modulebox" id="module-input">
  388. <span class="question" id="drag-directions">
  389. Drag modules from the icon at right</span>
  390. <div class="button">
  391. <img src="{% link assets/tabler_icons/tool.svg %}" title="Modules" />
  392. <div class="tooltiptext" id="module-menu">
  393. <!-- Customizable module -->
  394. <span class="module" id="module-custom"
  395. draggable="true" ondragstart="drag(event)">
  396. <input contenteditable="true" placeholder="Custom..." />
  397. <img src="{% link assets/tabler_icons/bulb.svg %}"
  398. draggable="false" />
  399. <a onclick="this.parentNode.remove()" class="delete-module"
  400. style="display:none">
  401. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  402. </span>
  403. <!-- Load preset modules from _data/modules.csv -->
  404. {% for module in site.data.modules %}
  405. <span class="module fixed" id="module-{{ module.id }}"
  406. draggable="true" ondragstart="drag(event)">
  407. <span>{{ module.name }}</span>
  408. <a target="_blank" href="{{ module.url }}" class="module-link">
  409. <img src="{% link assets/tabler_icons/link.svg %}"
  410. draggable="false" /></a>
  411. <a onclick="this.parentNode.remove()" class="delete-module"
  412. style="display:none">
  413. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  414. </span>
  415. {% endfor %}
  416. </div>
  417. </div>
  418. </div>
  419. <div id="builder-field">
  420. </div>
  421. <!-- SECTION S1: BASICS -->
  422. <h2 id="header-s1" class="header">
  423. <img src="{% link assets/tabler_icons/info-circle.svg %}"
  424. class="icons" />
  425. <span class="subhead output">Basics</span>
  426. <button onclick="toggleVisible('s1')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Expand" /></button>
  427. </h2>
  428. <div class="section" id="s1" style="display:none">
  429. <span class="question">What is the basic structure of the community?</span>
  430. <p contenteditable="true" class="editable output" id="structure">{{ page.structure }}</p>
  431. <span class="question">What is the community’s mission?</span>
  432. <p contenteditable="true" class="editable output" id="mission">{{ page.mission }}</p>
  433. <span class="question">What core values does the community hold?</span>
  434. <p contenteditable="true" class="editable output" id="values">{{ page.values }}</p>
  435. <span class="question">What is the legal status of the community’s assets and creations?</span>
  436. <p contenteditable="true" class="editable output" id="legal">{{ page.legal }}</p>
  437. </div><!--hiding section s1-->
  438. <!-- SECTION s2: PARTICIPANTS -->
  439. <h2 id="header-s2" class="header">
  440. <img src="{% link assets/tabler_icons/user.svg %}"
  441. class="icons" />
  442. <span class="subhead output">Participants</span>
  443. <button onclick="toggleVisible('s2')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Expand" /></button>
  444. </h2>
  445. <div class="section" id="s2" style="display:none">
  446. <span class="question">How does someone become a participant?</span>
  447. <p contenteditable="true" class="editable output" id="membership">{{ page.membership }}</p>
  448. <span class="question">How are participants suspended or removed?</span>
  449. <p contenteditable="true" class="editable output" id="removal">{{ page.removal }}</p>
  450. <span class="question">What special roles can participants hold, and how are roles assigned?</span>
  451. <p contenteditable="true" class="editable output" id="roles">{{ page.roles }}</p>
  452. <span class="question">Are there limits on the terms or powers of participant roles?</span>
  453. <p contenteditable="true" class="editable output" id="limits">{{ page.limits }}</p>
  454. </div><!--hiding section s2-->
  455. <!--SECTION s3: POLICY-->
  456. <h2 id="header-s3" class="header">
  457. <img src="{% link assets/tabler_icons/news.svg %}"
  458. class="icons" />
  459. <span class="subhead output">Policy</span>
  460. <button onclick="toggleVisible('s3')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Expand" /></button>
  461. </h2>
  462. <div class="section" id="s3" style="display:none">
  463. <span class="question">What basic rights does this Rule guarantee?</span>
  464. <p contenteditable="true" class="editable output" id="rights">{{ page.rights }}</p>
  465. <span class="question">Who has the capacity to decide on policies, and how do they do so?</span>
  466. <p contenteditable="true" class="editable output" id="decision">{{ page.decision }}</p>
  467. <span class="question">How are policies implemented?</span>
  468. <p contenteditable="true" class="editable output" id="implementation">{{ page.implementation }}</p>
  469. <span class="question">How does the community monitor and evaluate its policy implementation? </span>
  470. <p contenteditable="true" class="editable output" id="oversight">{{ page.oversight }}</p>
  471. </div><!--hiding section s3-->
  472. <!-- SECTION s4: PROCESS -->
  473. <h2 id="header-s4" class="header">
  474. <img src="{% link assets/tabler_icons/refresh.svg %}"
  475. class="icons" />
  476. <span class="subhead output">Process</span>
  477. <button onclick="toggleVisible('s4')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Expand" /></button>
  478. </h2>
  479. <div class="section" id="s4" style="display:none">
  480. <span class="question">Where does the community deliberate about policies and governance?</span>
  481. <p contenteditable="true" class="editable output" id="deliberation">{{ page.deliberation }}</p>
  482. <span class="question">How does the community manage access to administrative accounts and other tools?</span>
  483. <p contenteditable="true" class="editable output" id="access">{{ page.access }}</p>
  484. <span class="question">How does the community manage funds and economic flows?</span>
  485. <p contenteditable="true" class="editable output" id="economics">{{ page.economics }}</p>
  486. <span class="question">How are grievances among participants addressed?</span>
  487. <p contenteditable="true" class="editable output" id="grievances">{{ page.grievances }}</p>
  488. </div><!--hiding section s4-->
  489. <!-- SECTION s5: EVOLUTION -->
  490. <h2 id="header-s5" class="header">
  491. <img src="{% link assets/tabler_icons/adjustments.svg %}"
  492. class="icons" />
  493. <span class="subhead output">Evolution</span>
  494. <button onclick="toggleVisible('s5')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Expand" /></button>
  495. </h2>
  496. <div class="section" id="s5" style="display:none">
  497. <span class="question">Where are policies and records kept?</span>
  498. <p contenteditable="true" class="editable output" id="records">{{ page.records }}</p>
  499. <span class="question">How can this Rule be modified?</span>
  500. <p contenteditable="true" class="editable output" id="modification">{{ page.modification }}</p>
  501. </div><!--hiding section s5-->
  502. <div id="authorship" class="linkbox">
  503. <span id="authorship-words">Created by</span>
  504. <input contenteditable="true" class="editable link-text" id="author-text" placeholder="Created by" />
  505. <span class="link-divider"><img src="{% link assets/tabler_icons/pencil.svg %}" title="Add link" /></span>
  506. <input contenteditable="true" class="editable link-url" id="author-url" placeholder="Creator URL (http://, https://)" type="url" pattern="http://.*|https://.*" />
  507. <span id="authorship-result"></span>
  508. </div>
  509. </div><!--#rulebox-->
  510. <div id="attribution" style="display:none;">
  511. <br />
  512. <p><a href="https://communityrule.info">
  513. <img src="https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %}" alt="CommunityRule derived"></a></p>
  514. <p id="dateTime"></p>
  515. <p>Created with <a href="https://communityrule.info">CommunityRule</a><br />
  516. <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA</a></p>
  517. <p><strong>The Publish feature is experimental. Rules may be removed without notice</strong></p>
  518. </div>
  519. <div id="attributionMD" style="display:none;">
  520. ---
  521. [![CommunityRule derived](https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %})](https://communityrule.info)
  522. [Creative Commons BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)</div>
  523. <button class="pushButton" id="publishRule" onclick="publishRule()"
  524. title="Add to the public Library">Publish</button>
  525. <button class="pushButton" id="toggleDisplayMode" onclick="toggleDisplayMode()"
  526. title="Edit this Rule into a new one">Fork</button>
  527. <button class="pushButton" onclick="textOutput()"
  528. title="Download this Rule as a Markdown text file">Export</button>
  529. <button class="pushButton" id="trash" onclick="deleteRule()">
  530. <img src="{% link assets/tabler_icons/trash.svg %}" title="Rule deletion request" />
  531. </button>
  532. <button class="pushButton"
  533. onclick="javascript:location.href='https://www.colorado.edu/lab/medlab/content/communityrule-user-feedback'">
  534. Feedback
  535. </button>
  536. <div class="question">Publish and Export are not yet available for the modules and associated fields</div>
  537. </article>