Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente | |||
| playground:playground [2022/06/19 12:23] – admin | playground:playground [2022/06/26 16:41] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | <CSS> | ||
| - | /* ######################################### | ||
| - | /* ######################################### | ||
| - | /* ########### | ||
| - | /* ######################################### | ||
| - | /* ######################################### | ||
| - | |||
| - | .upload { | ||
| - | padding: 3px; | ||
| - | border: 1px double black; | ||
| - | opacity: 0.7; | ||
| - | border-radius: | ||
| - | } | ||
| - | .upload.dragover { | ||
| - | border: 1px dashed black; | ||
| - | opacity: 1.0; | ||
| - | } | ||
| - | </ | ||
| - | <JS> | ||
| - | /* ######################################### | ||
| - | /* ######################################### | ||
| - | /* ########### | ||
| - | /* ######################################### | ||
| - | /* ######################################### | ||
| - | |||
| - | function setdragging(target, | ||
| - | if (on) | ||
| - | target.classList.add(' | ||
| - | else | ||
| - | target.classList.remove(' | ||
| - | } | ||
| - | |||
| - | function printResult(h) { | ||
| - | let oOutput = document.getElementById(' | ||
| - | oOutput.innerHTML = h; | ||
| - | } | ||
| - | |||
| - | |||
| - | function upload_drop(e) { | ||
| - | e.preventDefault(); | ||
| - | setdragging(e.currentTarget, | ||
| - | if (e.dataTransfer == null) return; | ||
| - | fileobj = e.dataTransfer.files[0]; | ||
| - | ajax_file_upload(fileobj); | ||
| - | } | ||
| - | |||
| - | |||
| - | function upload_dragover(e) { | ||
| - | e.preventDefault(); | ||
| - | setdragging(e.currentTarget, | ||
| - | printResult('' | ||
| - | } | ||
| - | |||
| - | function upload_dragleave(e) { | ||
| - | e.preventDefault(); | ||
| - | setdragging(e.currentTarget, | ||
| - | // let target = e.currentTarget; | ||
| - | // printResult( 'leave ' | ||
| - | } | ||
| - | |||
| - | |||
| - | function upload_dragend(e) { | ||
| - | e.preventDefault(); | ||
| - | setdragging(e.currentTarget, | ||
| - | } | ||
| - | |||
| - | |||
| - | function file_explorer() { | ||
| - | let inp = document.getElementById(' | ||
| - | inp.click(); | ||
| - | inp.onchange = function() { | ||
| - | fileobj = document.getElementById(' | ||
| - | ajax_file_upload(fileobj); | ||
| - | }; | ||
| - | } | ||
| - | |||
| - | |||
| - | function ajax_file_upload(file_obj) { | ||
| - | if (file_obj == undefined) return; | ||
| - | let form_data = new FormData(); | ||
| - | form_data.append(' | ||
| - | let xhttp = new XMLHttpRequest(); | ||
| - | xhttp.open(" | ||
| - | xhttp.onload = function(event) { | ||
| - | if (xhttp.status == 200) { | ||
| - | let oOutput = document.getElementById(' | ||
| - | if (typeof oOutput.onplay === ' | ||
| - | oOutput.onplay(this.responseText); | ||
| - | } else { | ||
| - | printResult( "< | ||
| - | } | ||
| - | } else { | ||
| - | printResult( "Error " + xhttp.status + " occurred when trying to upload your file." ); | ||
| - | } | ||
| - | } | ||
| - | xhttp.send(form_data); | ||
| - | } | ||
| - | </JS> | ||
| - | |||
| - | |||
| ====== PlayGround ====== | ====== PlayGround ====== | ||
| - | |||
| - | {{icon> | ||
| - | |||
| - | <col sm=" | ||
| - | <panel type=" | ||
| - | < | ||
| - | <!-- ############################## | ||
| - | <!-- ############################## | ||
| - | <!-- ####### upload HTML ######### --> | ||
| - | <!-- ############################## | ||
| - | <!-- ############################## | ||
| - | <div id=" | ||
| - | < | ||
| - | <input type=" | ||
| - | <input type=" | ||
| - | </ | ||
| - | <div id=" | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | <col sm=" | ||
| - | <panel type=" | ||
| - | < | ||
| - | if(function_exists(' | ||
| - | // use posix to get current uid and gid | ||
| - | $uid = posix_geteuid(); | ||
| - | $usr = posix_getpwuid($uid); | ||
| - | $user = $usr[' | ||
| - | $gid = posix_getegid(); | ||
| - | $grp = posix_getgrgid($gid); | ||
| - | $group = $grp[' | ||
| - | }else{ | ||
| - | // try to create a file and read it's ids | ||
| - | $tmp = tempnam ('/ | ||
| - | $uid = fileowner($tmp); | ||
| - | $gid = filegroup($tmp); | ||
| - | |||
| - | // try to run ls on it | ||
| - | $out = `ls -l $tmp`; | ||
| - | $lst = explode(' | ||
| - | $user = $lst[2]; | ||
| - | $group = $lst[3]; | ||
| - | unlink($tmp); | ||
| - | } | ||
| - | echo "| PHP process ||\n"; | ||
| - | echo "| UID $uid ($user) | GID $gid ($group) |\n"; | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | |||
| - | <php> | ||
| - | require_once (DOKU_INC.' | ||
| - | | ||
| - | echo "< | ||
| - | echo "< | ||
| - | echo "</ | ||
| - | |||
| - | function createButtonCmdWait($cmd) { | ||
| - | echo "< | ||
| - | | ||
| - | if ($retcmd == $cmd) { | ||
| - | | ||
| - | echo " | ||
| - | | ||
| - | echo "</ | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | |||
| - | <col sm=" | ||
| - | <panel type=" | ||
| - | < | ||
| - | Test exec | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | |||
| - | <col sm=" | ||
| - | <panel type=" | ||
| - | <php> | ||
| - | $i=9; | ||
| - | echo "in php i=" | ||
| - | echo " | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | $j=8; | ||
| - | echo " | ||
| - | echo " | ||
| - | // comment | ||
| - | echo " | ||
| - | echo " | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | ~~NOCACHE~~ | ||
| - | |||