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

@ -14,43 +14,40 @@
<?php } else { ?>
<?php echo $page['instructions']; ?>
<?php } ?></p>
<div class="item_group">
<div class="item_group">
<div class="item">
<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>
<div class="item last">
<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>
</div>
</div>
<div class="item">
<label for="paste"><?php echo lang('paste_yourpaste'); ?>
<span class="instruction"><?php echo lang('paste_yourpaste_desc'); ?></span>
<span class="instruction"><a href="#" id="enable_codemirror" data-lang-enablesynhl="<?php echo lang('paste_enablesynhl'); ?>" data-lang-disablesynhl="<?php echo lang('paste_disablesynhl'); ?>"></a></span>
</label>
<textarea id="code" name="code" cols="40" rows="20" tabindex="4"><?php if(isset($paste_set)){ echo $paste_set; }?></textarea>
</div>
</div>
<div class="item_group">
<div class="item">
<label for="snipurl"><?php echo lang('paste_create_shorturl'); ?>
@ -67,7 +64,7 @@
?>
</div>
</div>
<div class="item">
<label for="private"><?php echo lang('paste_private'); ?>
<span class="instruction"><?php echo lang('paste_private_desc'); ?></span>
@ -83,7 +80,7 @@
?>
</div>
</div>
<div class="item">
<label for="expire"><?php echo lang('paste_delete'); ?>
<span class="instruction"><?php echo lang('paste_delete_desc'); ?></span>
@ -106,7 +103,7 @@
echo form_dropdown('expire', $options, $default_expiration, $expire_extra); ?>
</div>
</div>
<?php if($reply){ ?>
<input type="hidden" value="<?php echo $reply; ?>" name="reply" />
<?php } ?>