3ème essaie
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 1780eb9b84
commit 682658bc03

@ -129,18 +129,3 @@ function run() {
}
}
function saveCode(index, enigmeId) {
console.log("saveCode");
console.log("[Savecode]index : " + index, "[Savecode]enigmeId : " + enigmeId);
var xhr = new XMLHttpRequest();
// xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCode', true);
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCodeMulti', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
// console.log('saveCode'+xhr.responseText);
};
var searchParams = new URLSearchParams(window.location.search);
xhr.send("code=" + editor.getValue() + "&index=" + index, "&enigmeId=" + enigmeId);
}

@ -167,9 +167,25 @@
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js"
type="text/javascript" charset="utf-8"></script>
<script src="View/src/JS/baseMulti.js">
</script>
<script>
var index = '<?php echo $index; ?>';
var enigmeId = '<?php echo $enigme->getIdEnigme(); ?>';
console.log("Index&enigme"index + enigmeId);
function saveCode(index, enigmeId) {
console.log("saveCode");
console.log("[Savecode]index : " + index, "[Savecode]enigmeId : " + enigmeId);
var xhr = new XMLHttpRequest();
// xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCode', true);
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCodeMulti', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
console.log('[SaveCode] '+xhr.responseText);
};
var searchParams = new URLSearchParams(window.location.search);
xhr.send("code=" + editor.getValue() + "&index=" + index, "&enigmeId=" + enigmeId);
}
document.getElementById ('editor').addEventListener('input', saveCode(index, enigmeId));
</script>
<?php

Loading…
Cancel
Save