Make sure it works without javascript

master
Jordi Boggiano 13 years ago
parent d5f1c61a60
commit d9aca6be76
  1. 3
      index.php
  2. 9
      php-console.js

@ -87,9 +87,8 @@ if (isset($_POST['code'])) {
<body> <body>
<div class="output"><?php echo $debugOutput ?></div> <div class="output"><?php echo $debugOutput ?></div>
<form method="POST" action=""> <form method="POST" action="">
<div class="input"> <div class="input">
<div class="editor" id="editor"><?php echo (isset($_POST['code']) ? htmlentities($_POST['code'], ENT_QUOTES, 'UTF-8') : null) ?></div> <textarea class="editor" id="editor" name="code"><?php echo (isset($_POST['code']) ? htmlentities($_POST['code'], ENT_QUOTES, 'UTF-8') : null) ?></textarea>
<div class="statusbar"> <div class="statusbar">
<span class="position">Line: 1, Column: 1</span> <span class="position">Line: 1, Column: 1</span>
<span class="copy"> <span class="copy">

@ -72,10 +72,17 @@
}; };
initializeAce = function() { initializeAce = function() {
var PhpMode, code;
code = $('#' + options.editor).text();
$('#' + options.editor)
.replaceWith('<div id="'+options.editor+'" class="'+options.editor+'"></div>')
.text(code);
editor = ace.edit(options.editor); editor = ace.edit(options.editor);
// set mode // set mode
var PhpMode = require("ace/mode/php").Mode; PhpMode = require("ace/mode/php").Mode;
editor.getSession().setMode(new PhpMode()); editor.getSession().setMode(new PhpMode());
// tab size // tab size

Loading…
Cancel
Save