front/layui/lay/modules/layedit.js
(开头部分) 15KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/** layui-v2.5.6 MIT License By https://www.layui.com */ ;
layui.define(["layer", "form"], function(t) {
"use strict";
var e = layui.$,
i = layui.layer,
a = layui.form,
l = (layui.hint(), layui.device()),
n = "layedit",
o = "layui-show",
r = "layui-disabled",
c = function() {
var t = this;
t.index = 0, t.config = {
tool: ["strong", "italic", "underline", "del", "|", "left", "center", "right", "|", "link", "unlink", "face",
"image"
],
hideTool: [],
height: 280
}
};
c.prototype.set = function(t) {
var i = this;
return e.extend(!0, i.config, t), i
}, c.prototype.on = function(t, e) {
return layui.onevent(n, t, e)
}, c.prototype.build = function(t, i) {
i = i || {};
var a = this,
n = a.config,
r = "layui-layedit",
c = e("string" == typeof t ? "#" + t : t),
u = "LAY_layedit_" + ++a.index,
d = c.next("." + r),
y = e.extend({}, n, i),
f = function() {
var t = [],
e = {};
return layui.each(y.hideTool, function(t, i) {
e[i] = !0
}), layui.each(y.tool, function(i, a) {
C[a] && !e[a] && t.push(C[a])
}), t.join("")
}(),
m = e(['<div class="' + r + '">', '<div class="layui-unselect layui-layedit-tool">' + f + "</div>",
'<div class="layui-layedit-iframe">', '<iframe id="' + u + '" name="' + u + '" textarea="' + t +
'" frameborder="0"></iframe>', "</div>", "</div>"
].join(""));
return l.ie && l.ie < 8 ? c.removeClass("layui-hide").addClass(o) : (d[0] && d.remove(), s.call(a, m, c[0], y), c.addClass(
"layui-hide").after(m), a.index)
}, c.prototype.getContent = function(t) {
var e = u(t);
if (e[0]) return d(e[0].document.body.innerHTML)
}, c.prototype.getText = function(t) {
var i = u(t);
if (i[0]) return e(i[0].document.body).text()
}, c.prototype.setContent = function(t, i, a) {
var l = u(t);
l[0] && (a ? e(l[0].document.body).append(i) : e(l[0].document.body).html(i), layedit.sync(t))
}, c.prototype.sync = function(t) {
var i = u(t);
后面还有 343 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。