MCPcopy Index your code
hub / github.com/TruthHun/BookStack / updateValue

Function updateValue

static/wangEditor/js/wangEditor.js:4007–4027  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4005
4006 // 更新内容
4007 function updateValue() {
4008 var $code = menu.$codeTextarea;
4009 var $txt = editor.txt.$txt;
4010 var value = $.trim($code.val()); // 取值
4011
4012 if (!value) {
4013 value = '<p><br></p>';
4014 }
4015
4016 // 过滤js代码
4017 if (editor.config.jsFilter) {
4018
4019 value = value.replace(/<script[\s\S]*?<\/script>/ig, '');
4020 }
4021 // 赋值
4022 try {
4023 $txt.html(value);
4024 } catch (ex) {
4025 // 更新 html 源码出错,一般都是取消了 js 过滤之后,js报错导致的
4026 }
4027 }
4028
4029 // 定义click事件
4030 menu.clickEvent = function (e) {

Callers 1

wangEditor.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected