ace overlay

This commit is contained in:
Claude 2016-09-02 10:50:27 +02:00
parent 71843ce491
commit cf02528157
2 changed files with 23 additions and 16 deletions

View File

@ -240,7 +240,17 @@ ST.filereader = function() {
}
ST.ace = function() {
// prepare the editor, needs to be a div
// replace textarea
var $code = $('#code');
$code.after('<div id="editor" style="left: 10px; width: 703px; height: 312px;"></div>');
$code.remove();
// init ace
ace.config.set("basePath", base_url + "themes/default/js/ace");
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
}
ST.init = function() {

View File

@ -20,16 +20,13 @@
<label for="name"><?php echo lang('paste_author'); ?>
<span class="instruction"><?php echo lang('paste_author_desc'); ?></span>
</label>
<?php $set = array('name' => 'name', 'id' => 'name', 'value' => $name_set, 'maxlength' => '32', 'tabindex' => '1');
echo form_input($set);?>
</div>
<div class="item">
<label for="title"><?php echo lang('paste_title'); ?>
<span class="instruction"><?php echo lang('paste_title_desc'); ?></span>
</label>
<input value="<?php if(isset($title_set)){ echo $title_set; }?>" type="text" id="title" name="title" tabindex="2" maxlength="50" />
</div>
@ -37,7 +34,6 @@
<label for="lang"><?php echo lang('paste_lang'); ?>
<span class="instruction"><?php echo lang('paste_lang_desc'); ?></span>
</label>
<?php $lang_extra = 'id="lang" class="select" tabindex="3"'; echo form_dropdown('lang', $languages, $lang_set, $lang_extra); ?>
</div>
</div>
@ -49,6 +45,7 @@
</label>
<textarea id="code" name="code" cols="40" rows="20" tabindex="4"><?php if(isset($paste_set)){ echo $paste_set; }?></textarea>
</div>
<div class="item_group">