mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 20:41:20 -05:00
get content
This commit is contained in:
parent
5badad6222
commit
8531d66b8a
@ -241,16 +241,26 @@ ST.filereader = function() {
|
||||
|
||||
ST.ace = function() {
|
||||
// prepare the editor, needs to be a div
|
||||
// replace textarea
|
||||
var $code = $('#code');
|
||||
|
||||
// exit if there is no code textarea
|
||||
if ($code.length < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// replace textarea
|
||||
$code.after('<div id="editor" style="left: 10px; width: 703px; height: 312px;"></div>');
|
||||
$code.remove();
|
||||
$code.hide();
|
||||
|
||||
// init ace
|
||||
ace.config.set("basePath", base_url + "themes/default/js/ace");
|
||||
var editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/clouds");
|
||||
editor.getSession().setValue($code.val());
|
||||
editor.getSession().setMode("ace/mode/javascript");
|
||||
editor.getSession().on('change', function(e) {
|
||||
$code.val(editor.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
ST.init = function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user