Make sure it works without javascript

This commit is contained in:
Jordi Boggiano
2012-01-15 18:04:04 +01:00
parent d5f1c61a60
commit d9aca6be76
2 changed files with 9 additions and 3 deletions
+1 -2
View File
@@ -87,9 +87,8 @@ if (isset($_POST['code'])) {
<body>
<div class="output"><?php echo $debugOutput ?></div>
<form method="POST" action="">
<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">
<span class="position">Line: 1, Column: 1</span>
<span class="copy">
+8 -1
View File
@@ -72,10 +72,17 @@
};
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);
// set mode
var PhpMode = require("ace/mode/php").Mode;
PhpMode = require("ace/mode/php").Mode;
editor.getSession().setMode(new PhpMode());
// tab size