Line 53: | Line 53: | ||
<h4>Created by <a style="color:inherit" href="mailto:11murfitta@judd.kent.sch.uk">Aleksandur Murfitt</a>, content by the Judd_UK team</h4> | <h4>Created by <a style="color:inherit" href="mailto:11murfitta@judd.kent.sch.uk">Aleksandur Murfitt</a>, content by the Judd_UK team</h4> | ||
</footer> | </footer> | ||
+ | <div id="ting"></div> | ||
<template></template> | <template></template> | ||
<div id="content-template" style="display:none"></div> | <div id="content-template" style="display:none"></div> | ||
− | + | <script> | |
+ | function editable(){ | ||
+ | qs(".JC #content-body").contentEditable = 'true'; | ||
+ | qs(".JC #content-body").oninput = function(){ | ||
+ | qs('textarea').value = "<div>" + qs('.JC #content-body').innerHTML+"<\/div><html><script>window.location='/Team:Judd_UK/" + page.replace("*", "/") + "'<\/script><\/html>"; | ||
+ | qsa("img").forEach(function(e){e.oncontextmenu = function(o){o.target.classList.toggle("left");o.preventDefault()}}); | ||
+ | }; | ||
+ | qs("textarea").oninput = function(){ | ||
+ | qs('.JC #content-body').innerHTML = qs('textarea').value; | ||
+ | qsa("img").forEach(function(e){e.oncontextmenu = function(o){o.target.classList.toggle("left");o.preventDefault()}}); | ||
+ | }; | ||
+ | var safety = page; | ||
+ | AJAX('https://2017.igem.org/Team:Judd_UK/Pages/' + safety +'?action=edit', function(e){ | ||
+ | qs('#ting').innerHTML=e.responseText; | ||
+ | qs('textarea').style.display = "none"; | ||
+ | qs('#wpSummary').style.display = "none"; | ||
+ | qs('.editCheckboxes').style.display = "none"; | ||
+ | qs('#editpage-copywarn').style.display = "none"; | ||
+ | qs('#wpPreview').style.display = "none"; | ||
+ | qs('#wpDiff').style.display = "none"; | ||
+ | qs('.cancelLink').style.display = "none"; | ||
+ | qs('.editHelp').style.display = "none"; | ||
+ | qsa("label")[1].innerHTML="Editing " + safety; | ||
+ | }) | ||
+ | } | ||
+ | </script> | ||
</div> | </div> | ||
</html> | </html> |
Revision as of 14:12, 13 December 2017