Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loading: function (prefixCls) {
if (!globalMask) {
globalMask = new Overlay({
x: 0,
width: UA.ie === 6 ? Dom.docWidth() : '100%',
y: 0,
// 指定全局 loading zIndex 值
'zIndex': Editor.baseZIndex(Editor.ZIndexManager.LOADING),
prefixCls: prefixCls + 'editor-',
elCls: prefixCls + 'editor-global-loading'
});
}
globalMask.set('height', Dom.docHeight());
globalMask.show();
globalMask.loading();
},
unloading: function () {
cfg = visit1_17_1(cfg || {});
_$jscoverage['/contextmenu.js'].lineData[19]++;
var event = cfg.event;
_$jscoverage['/contextmenu.js'].lineData[20]++;
if (visit2_20_1(event)) {
_$jscoverage['/contextmenu.js'].lineData[21]++;
delete cfg.event;
}
_$jscoverage['/contextmenu.js'].lineData[24]++;
cfg.prefixCls = self.get('prefixCls') + 'editor-';
_$jscoverage['/contextmenu.js'].lineData[25]++;
cfg.editor = self;
_$jscoverage['/contextmenu.js'].lineData[26]++;
cfg.focusable = 1;
_$jscoverage['/contextmenu.js'].lineData[27]++;
cfg.zIndex = Editor.baseZIndex(Editor.ZIndexManager.POPUP_MENU);
_$jscoverage['/contextmenu.js'].lineData[29]++;
var menu = new Menu.PopupMenu(cfg);
_$jscoverage['/contextmenu.js'].lineData[31]++;
focusFix.init(menu);
_$jscoverage['/contextmenu.js'].lineData[33]++;
menu.on('afterRenderUI', function() {
_$jscoverage['/contextmenu.js'].functionData[2]++;
_$jscoverage['/contextmenu.js'].lineData[34]++;
menu.get('el').on('keydown', function(e) {
_$jscoverage['/contextmenu.js'].functionData[3]++;
_$jscoverage['/contextmenu.js'].lineData[35]++;
if (visit3_35_1(e.keyCode === Event.KeyCode.ESC)) {
_$jscoverage['/contextmenu.js'].lineData[36]++;
menu.hide();
}
});
var Editor = require('editor');
var Overlay = require('overlay');
var focusFix = require('./focus-fix');
module.exports = Overlay.extend({
bindUI: function () {
focusFix.init(this);
}
}, {
ATTRS: {
prefixCls: {
value: 'ks-editor-'
},
'zIndex': {
value: Editor.baseZIndex(Editor.ZIndexManager.OVERLAY)
}
}
});
KISSY.add("editor/plugin/overlay", ["editor", "overlay", "./focus-fix"], function(S, require) {
var Editor = require("editor");
var Overlay = require("overlay");
var focusFix = require("./focus-fix");
return Overlay.extend({bindUI:function() {
focusFix.init(this)
}}, {ATTRS:{prefixCls:{value:"ks-editor-"}, zIndex:{value:Editor.baseZIndex(Editor.ZIndexManager.OVERLAY)}}})
});
click: function () {
var self = this, smiley, checked = self.get('checked');
if (checked) {
if (!(smiley = self.smiley)) {
smiley = self.smiley = new Overlay4E({
content: util.substitute(smileyMarkup, {
prefixCls: prefixCls
}),
focus4e: false,
width: 300,
elCls: prefixCls + 'editor-popup',
zIndex: Editor.baseZIndex(Editor.ZIndexManager.POPUP_MENU),
mask: false
}).render();
smiley.get('el').on('click', function (ev) {
var t = $(ev.target),
icon;
if (t.nodeName() === 'a' &&
(icon = t.attr('data-icon'))) {
var img = $('<img src="' +
icon + '">', editor.get('document')[0]);
editor.insertElement(img);
}
});
smiley.on('hide', function () {
self.set('checked', false);
});
KISSY.add("editor/plugin/bubble", ["overlay", "editor"], function(S, require) {
var Overlay = require("overlay");
var Editor = require("editor");
var logger = S.getLogger("s/editor");
var BUBBLE_CFG = {zIndex:Editor.baseZIndex(Editor.ZIndexManager.BUBBLE_VIEW), elCls:"{prefixCls}editor-bubble", prefixCls:"{prefixCls}editor-", effect:{effect:"fade", duration:0.3}};
function inRange(t, b, r) {
return t <= r && b >= r
}
function overlap(b1, b2) {
var b1Top = b1.get("y"), b1Bottom = b1Top + b1.get("el").outerHeight(), b2Top = b2.get("y"), b2Bottom = b2Top + b2.get("el").outerHeight();
return inRange(b1Top, b1Bottom, b2Bottom) || inRange(b1Top, b1Bottom, b2Top)
}
function getTopPosition(self) {
var archor = null, editor = self.get("editor"), myBubbles = editor.getControls();
S.each(myBubbles, function(bubble) {
if(bubble.isKeBubble && bubble !== self && bubble.get("visible") && overlap(self, bubble)) {
if(!archor) {
archor = bubble
}else {
if(archor.get("y") < bubble.get("y")) {
archor = bubble
show: function () {
var self = this; //在 show 之前调用
//在 show 之前调用
self.center();
var y = self.get('y'); //居中有点偏下
//居中有点偏下
if (y - Dom.scrollTop() > 200) {
y = Dom.scrollTop() + 200;
self.set('y', y);
}
self.callSuper();
}
}, {
ATTRS: {
prefixCls: { value: 'ks-editor-' },
'zIndex': { value: Editor.baseZIndex(Editor.ZIndexManager.OVERLAY) }
}
});
});
'left:-8px;' +
'top:-10px;' +
'border-top-color:white;' +
'">' +
'' +
'');
help.append(arrow);
help.css({
border: '1px solid #ACB4BE',
'text-align': 'left'
});
self.helpPopup = new Overlay({
content: help,
prefixCls: prefixCls + 'editor-',
width: help.width() + 'px',
zIndex: Editor.baseZIndex(Editor.ZIndexManager.OVERLAY),
mask: false
}).render();
self.helpPopup.get('el')
.css('border', 'none');
self.helpPopup.arrow = arrow;
},
_realHelp: function () {
if (visit15_219_1(!ie)) {
_$jscoverage['/cmd.js'].lineData[220]++;
Dom.css(doc.body, {
width: 0,
height: 0,
overflow: 'hidden'});
} else {
_$jscoverage['/cmd.js'].lineData[226]++;
doc.body.style.overflow = 'hidden';
}
_$jscoverage['/cmd.js'].lineData[228]++;
doc.documentElement.style.overflow = 'hidden';
_$jscoverage['/cmd.js'].lineData[230]++;
editorEl.css({
position: 'absolute',
zIndex: Editor.baseZIndex(Editor.ZIndexManager.MAXIMIZE),
width: viewportWidth + 'px'});
_$jscoverage['/cmd.js'].lineData[235]++;
iframe.css({
zIndex: Editor.baseZIndex(Editor.ZIndexManager.MAXIMIZE - 5),
height: viewportHeight + 'px',
width: viewportWidth + 'px'});
_$jscoverage['/cmd.js'].lineData[240]++;
editorEl.offset({
left: 0,
top: 0});
_$jscoverage['/cmd.js'].lineData[244]++;
iframe.css({
left: 0,
top: 0});
_$jscoverage['/cmd.js'].lineData[249]++;
textareaEl.parent().css({
_$jscoverage['/draft.js'].lineData[218]++;
var arrowCss = 'height:0;' + 'position:absolute;' + 'font-size:0;' + 'width:0;' + 'border:8px #000 solid;' + 'border-color:#000 transparent transparent transparent;' + 'border-style:solid dashed dashed dashed;';
_$jscoverage['/draft.js'].lineData[225]++;
var arrow = new Node('<div style="' + arrowCss + 'border-top-color:#CED5E0;' + '">' + '<div style="' + arrowCss + 'left:-8px;' + 'top:-10px;' + 'border-top-color:white;' + '">' + '</div>' + '</div>');
_$jscoverage['/draft.js'].lineData[237]++;
help.append(arrow);
_$jscoverage['/draft.js'].lineData[238]++;
help.css({
border: '1px solid #ACB4BE',
'text-align': 'left'});
_$jscoverage['/draft.js'].lineData[242]++;
self.helpPopup = new Overlay({
content: help,
prefixCls: prefixCls + 'editor-',
width: help.width() + 'px',
zIndex: Editor.baseZIndex(Editor.ZIndexManager.OVERLAY),
mask: false}).render();
_$jscoverage['/draft.js'].lineData[250]++;
self.helpPopup.get('el').css('border', 'none');
_$jscoverage['/draft.js'].lineData[251]++;
self.helpPopup.arrow = arrow;
},
_realHelp: function() {