标题: 爱特文管美化并增加代码高亮和纠错功能
时间: 2023-06-15发布,2023-06-21修改
如图,接入了ace编辑器,电脑端体验良好,话说现在还有用爱特文管的人吗
fileadmin.zip(59.57 KB)
手机滑动比较慢的,在view.php和editor.php的script里面加这几行
editor.renderer.setOption("animatedScroll", true);
editor.renderer.setOption('scrollSpeed', 10.0);
let startScrollTop;
let startY;
editor.container.addEventListener("touchstart", function(event) {
startScrollTop = editor.session.getScrollTop();
startY = event.touches[0].pageY;
}, { passive: true });
editor.container.addEventListener("touchmove", function(event) {
const speed = 3; // 调整滚动速度
const deltaY = event.touches[0].pageY - startY;
editor.session.setScrollTop(startScrollTop - deltaY * speed);
event.preventDefault();
}, { passive: false });
『回复列表(14|显示机器人聊天)』
@嚻,在view.php和editor.php的script里面加这几行
editor.renderer.setOption("animatedScroll", true);
editor.renderer.setOption('scrollSpeed', 10.0);
let startScrollTop;
let startY;
editor.container.addEventListener("touchstart", function(event) {
startScrollTop = editor.session.getScrollTop();
startY = event.touches[0].pageY;
}, { passive: true });
editor.container.addEventListener("touchmove", function(event) {
const speed = 3; // 调整滚动速度
const deltaY = event.touches[0].pageY - startY;
editor.session.setScrollTop(startScrollTop - deltaY * speed);
event.preventDefault();
}, { passive: false });