让Ace编辑器在Bottle环境中工作所需的最小文件是什么?它们需要放在哪里?

 爱碩爱你_静莫失心 发布于 2023-02-07 11:23

这是Ace编辑器的GitHub仓库:

https://github.com/ajaxorg/ace

我猜测所需的文件是:

JS

https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/ace.js

一个主题

https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/theme-tomorrow.js

一种模式

https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/mode-javascript.js

一位工人

https://raw.github.com/ajaxorg/ace-builds/master/src-noconflict/worker-javascript.js

实施是:

HTML



function foo(items) { var x = "All this is syntax highlighted"; return x; }

CSS

#my_ace_editor {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}

jQuery的

$(document).ready(function() {
var editor = ace.edit("my_ace_editor");
editor.setTheme("ace/theme/tomorrow");
editor.getSession().setMode("ace/mode/javascript");
});

瓶路线

@route('/static/js/ace/')
def server_static_js(filename):
    return static_file(filename, root='/static/js/ace')

我没有收到任何Firebug错误,但Ace编辑器没有显示.

让Ace编辑器在Bottle环境中工作所需的最小文件是什么?它们需要放在哪里?

编辑: 在上面添加CSS规则后显示Ace编辑器.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有