@haluo/biz 2.0.19-beta.3 → 2.0.19-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/haluo-biz.js +105 -87
- package/dist/haluo-biz.umd.cjs +110 -91
- package/dist/{squire-raw.7e84068d.js → squire-raw.d3e06d90.js} +1 -0
- package/dist/style.css +8 -0
- package/package.json +1 -1
package/dist/haluo-biz.js
CHANGED
|
@@ -479,8 +479,8 @@ const _sfc_main$7 = {
|
|
|
479
479
|
const target = this.$refs["align"];
|
|
480
480
|
const font = this.$refs["font"];
|
|
481
481
|
const list = this.$refs["list"];
|
|
482
|
-
const
|
|
483
|
-
if ((target == null ? void 0 : target.contains(e)) || (font == null ? void 0 : font.contains(e)) || (list == null ? void 0 : list.contains(e)) || (
|
|
482
|
+
const img = this.$refs["img"];
|
|
483
|
+
if ((target == null ? void 0 : target.contains(e)) || (font == null ? void 0 : font.contains(e)) || (list == null ? void 0 : list.contains(e)) || (img == null ? void 0 : img.contains(e)))
|
|
484
484
|
return;
|
|
485
485
|
this.popoverVisible = false;
|
|
486
486
|
this.popoverVisibleFont = false;
|
|
@@ -3866,8 +3866,8 @@ const _sfc_main$4 = defineComponent({
|
|
|
3866
3866
|
e.target.value = "";
|
|
3867
3867
|
emits("update:imgList", tempImgs);
|
|
3868
3868
|
};
|
|
3869
|
-
const deleteImg = (
|
|
3870
|
-
const arr = props.imgList.filter((item) => item.id !==
|
|
3869
|
+
const deleteImg = (img) => {
|
|
3870
|
+
const arr = props.imgList.filter((item) => item.id !== img.id);
|
|
3871
3871
|
emits("update:imgList", arr);
|
|
3872
3872
|
};
|
|
3873
3873
|
const emitEvent = () => {
|
|
@@ -3930,9 +3930,9 @@ const _sfc_main$4 = defineComponent({
|
|
|
3930
3930
|
const imgList = node.querySelectorAll(".halo-picture-area");
|
|
3931
3931
|
if (imgList && imgList.length) {
|
|
3932
3932
|
const list = [];
|
|
3933
|
-
imgList.forEach((
|
|
3934
|
-
if (!list.includes(
|
|
3935
|
-
list.push(
|
|
3933
|
+
imgList.forEach((img) => {
|
|
3934
|
+
if (!list.includes(img.src)) {
|
|
3935
|
+
list.push(img.src);
|
|
3936
3936
|
}
|
|
3937
3937
|
});
|
|
3938
3938
|
list.forEach((src, i) => {
|
|
@@ -4709,7 +4709,7 @@ const _sfc_main = {
|
|
|
4709
4709
|
me2.editorDom = document.getElementById("editor-content");
|
|
4710
4710
|
me2.editorDom.addEventListener("blur", this.canSetAlign);
|
|
4711
4711
|
if (!window.Squire) {
|
|
4712
|
-
import("./squire-raw.
|
|
4712
|
+
import("./squire-raw.d3e06d90.js").then(function() {
|
|
4713
4713
|
me2.initSquire();
|
|
4714
4714
|
});
|
|
4715
4715
|
} else {
|
|
@@ -4847,7 +4847,7 @@ const _sfc_main = {
|
|
|
4847
4847
|
const data = this.filterHtml(html, type);
|
|
4848
4848
|
return data;
|
|
4849
4849
|
},
|
|
4850
|
-
generateImgHtml(
|
|
4850
|
+
generateImgHtml(img, isGif, desc) {
|
|
4851
4851
|
let descHtml = "";
|
|
4852
4852
|
if (desc) {
|
|
4853
4853
|
descHtml = ` <div
|
|
@@ -4861,7 +4861,7 @@ const _sfc_main = {
|
|
|
4861
4861
|
<div class="show-img-content">
|
|
4862
4862
|
<img
|
|
4863
4863
|
alt
|
|
4864
|
-
src="${
|
|
4864
|
+
src="${img}"
|
|
4865
4865
|
class="detail-imgs"
|
|
4866
4866
|
onerror="onerror=null;src='/static/img/web_img_zhanwei.png'"
|
|
4867
4867
|
/>
|
|
@@ -4888,13 +4888,13 @@ const _sfc_main = {
|
|
|
4888
4888
|
if (node.nodeType === 1) {
|
|
4889
4889
|
if (node.classList.contains("halo-img-content")) {
|
|
4890
4890
|
const children = [...node.childNodes];
|
|
4891
|
-
const
|
|
4892
|
-
const isGif =
|
|
4891
|
+
const img = node.querySelector(".halo-picture-area");
|
|
4892
|
+
const isGif = img.src.indexOf(".gif!nowater") > -1;
|
|
4893
4893
|
if (isGif && type === "preview") {
|
|
4894
|
-
|
|
4894
|
+
img.src = img.src.replace(".gif!nowater", ".gif");
|
|
4895
4895
|
}
|
|
4896
4896
|
if (type === "preview") {
|
|
4897
|
-
node.innerHTML = this.generateImgHtml(
|
|
4897
|
+
node.innerHTML = this.generateImgHtml(img.src, isGif, img.dataset.desc);
|
|
4898
4898
|
return;
|
|
4899
4899
|
}
|
|
4900
4900
|
children.forEach((child) => {
|
|
@@ -4919,9 +4919,9 @@ const _sfc_main = {
|
|
|
4919
4919
|
node.innerHTML = this.generateLinkHtml(a.dataset.url, a.innerText);
|
|
4920
4920
|
return;
|
|
4921
4921
|
}
|
|
4922
|
-
const
|
|
4922
|
+
const img = node.querySelector(".link-img");
|
|
4923
4923
|
const del = node.querySelector(".img-delete");
|
|
4924
|
-
node.removeChild(
|
|
4924
|
+
node.removeChild(img);
|
|
4925
4925
|
node.removeChild(del);
|
|
4926
4926
|
}
|
|
4927
4927
|
}
|
|
@@ -4933,7 +4933,6 @@ const _sfc_main = {
|
|
|
4933
4933
|
},
|
|
4934
4934
|
async parseHtml(html, essayPicRelVOList) {
|
|
4935
4935
|
var _a;
|
|
4936
|
-
const me2 = this;
|
|
4937
4936
|
const div = document.createElement("div");
|
|
4938
4937
|
div.innerHTML = html;
|
|
4939
4938
|
const frag = document.createDocumentFragment();
|
|
@@ -4947,27 +4946,19 @@ const _sfc_main = {
|
|
|
4947
4946
|
} else if (node.tagName.toLowerCase() === "halo-good") {
|
|
4948
4947
|
this.parseGood(node);
|
|
4949
4948
|
} else if (node.classList.contains("halo-img-content")) {
|
|
4950
|
-
const
|
|
4949
|
+
const img = node.querySelector("img");
|
|
4951
4950
|
node.setAttribute("tabindex", -1);
|
|
4952
4951
|
node.setAttribute("draggable", true);
|
|
4953
4952
|
node.setAttribute("contenteditable", false);
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
node.onblur = function(e) {
|
|
4960
|
-
img2.classList.remove("halo-select");
|
|
4961
|
-
me2.selectDom = null;
|
|
4962
|
-
};
|
|
4963
|
-
this.setDragMove(node);
|
|
4964
|
-
const desc = img2.dataset.desc;
|
|
4965
|
-
img2.style.margin = "0";
|
|
4966
|
-
const seamlessFlag = ((_a = JSON.parse(img2.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
4953
|
+
img.setAttribute("draggable", false);
|
|
4954
|
+
this.setListener(node);
|
|
4955
|
+
const desc = img.dataset.desc;
|
|
4956
|
+
img.style.margin = "0";
|
|
4957
|
+
const seamlessFlag = ((_a = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
4967
4958
|
if (essayPicRelVOList) {
|
|
4968
|
-
const arr =
|
|
4959
|
+
const arr = img.src.split("/");
|
|
4969
4960
|
const id = arr[arr.length - 1];
|
|
4970
|
-
|
|
4961
|
+
img.src = essayPicRelVOList.find((obj) => obj.id === String(id)).url;
|
|
4971
4962
|
}
|
|
4972
4963
|
this.insertImgOperateBtns(this.editor, {
|
|
4973
4964
|
content: desc,
|
|
@@ -4985,12 +4976,12 @@ const _sfc_main = {
|
|
|
4985
4976
|
return frag;
|
|
4986
4977
|
},
|
|
4987
4978
|
parseLink(node) {
|
|
4988
|
-
const
|
|
4979
|
+
const img = this.editor.createElement("img", {
|
|
4989
4980
|
class: "link-img",
|
|
4990
4981
|
src: "/static/img/icon_link@3x.png"
|
|
4991
4982
|
});
|
|
4992
4983
|
const del = this.generateDelLinkIcon();
|
|
4993
|
-
node.prepend(
|
|
4984
|
+
node.prepend(img);
|
|
4994
4985
|
node.appendChild(del);
|
|
4995
4986
|
},
|
|
4996
4987
|
parseVideo(node, essayPicRelVOList) {
|
|
@@ -5016,20 +5007,12 @@ const _sfc_main = {
|
|
|
5016
5007
|
e.stopPropagation();
|
|
5017
5008
|
}
|
|
5018
5009
|
});
|
|
5019
|
-
node.onclick = function(e) {
|
|
5020
|
-
me2.selectDom = node;
|
|
5021
|
-
video.classList.add("halo-select");
|
|
5022
|
-
};
|
|
5023
|
-
node.onblur = function(e) {
|
|
5024
|
-
video.classList.remove("halo-select");
|
|
5025
|
-
me2.selectDom = null;
|
|
5026
|
-
};
|
|
5027
5010
|
const replaceBtn = me2.insertVideoBtns(me2.editor, video);
|
|
5028
5011
|
node.appendChild(delBtn);
|
|
5029
5012
|
node.appendChild(replaceBtn);
|
|
5030
5013
|
node.setAttribute("tabindex", -1);
|
|
5031
5014
|
node.setAttribute("draggable", true);
|
|
5032
|
-
me2.
|
|
5015
|
+
me2.setListener(node);
|
|
5033
5016
|
},
|
|
5034
5017
|
async parseArticle(node) {
|
|
5035
5018
|
const data = JSON.parse(node.dataset.article);
|
|
@@ -5168,8 +5151,8 @@ const _sfc_main = {
|
|
|
5168
5151
|
if (this.imgType === "coverImg") {
|
|
5169
5152
|
this.$emit("insertImgs", imgList_new, this.imgType);
|
|
5170
5153
|
} else {
|
|
5171
|
-
imgList_new.forEach((
|
|
5172
|
-
this.imgUploadHandler("img",
|
|
5154
|
+
imgList_new.forEach((img) => {
|
|
5155
|
+
this.imgUploadHandler("img", img.src);
|
|
5173
5156
|
});
|
|
5174
5157
|
}
|
|
5175
5158
|
this.visibleImg = false;
|
|
@@ -5313,8 +5296,8 @@ const _sfc_main = {
|
|
|
5313
5296
|
descInput.disabled = me2.disabled;
|
|
5314
5297
|
descInput.oninput = function(e) {
|
|
5315
5298
|
const parent = me2.findParentByClass(e.target, "halo-img-content");
|
|
5316
|
-
const
|
|
5317
|
-
|
|
5299
|
+
const img = parent.querySelector(".halo-picture-area");
|
|
5300
|
+
img.dataset.desc = e.target.value;
|
|
5318
5301
|
if (e.target.value.length > 49) {
|
|
5319
5302
|
return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
|
|
5320
5303
|
}
|
|
@@ -5465,12 +5448,18 @@ const _sfc_main = {
|
|
|
5465
5448
|
me2.editor.addEventListener("keydown", function(event) {
|
|
5466
5449
|
if (event.keyCode === 8 || event.keyCode === 46) {
|
|
5467
5450
|
try {
|
|
5451
|
+
const selection = getSelection();
|
|
5468
5452
|
if (me2.selectDom && me2.moverClasses.includes(me2.selectDom.className)) {
|
|
5469
|
-
|
|
5453
|
+
const range = document.createRange();
|
|
5454
|
+
range.selectNodeContents(me2.selectDom.previousElementSibling);
|
|
5455
|
+
range.collapse(false);
|
|
5456
|
+
selection.removeAllRanges();
|
|
5457
|
+
selection.addRange(range);
|
|
5458
|
+
const removeDom = me2.selectDom || event.target;
|
|
5459
|
+
removeDom.remove();
|
|
5470
5460
|
me2.selectDom = null;
|
|
5471
5461
|
event.preventDefault();
|
|
5472
5462
|
} else {
|
|
5473
|
-
const selection = getSelection();
|
|
5474
5463
|
if (selection.isCollapsed) {
|
|
5475
5464
|
const node = selection.focusNode;
|
|
5476
5465
|
const offSet = selection.focusOffset;
|
|
@@ -5481,11 +5470,6 @@ const _sfc_main = {
|
|
|
5481
5470
|
if (curSelect) {
|
|
5482
5471
|
previousSibling.click();
|
|
5483
5472
|
previousSibling.focus();
|
|
5484
|
-
const range = document.createRange();
|
|
5485
|
-
range.selectNodeContents(previousSibling);
|
|
5486
|
-
range.collapse(false);
|
|
5487
|
-
selection.removeAllRanges();
|
|
5488
|
-
selection.addRange(range);
|
|
5489
5473
|
event.preventDefault();
|
|
5490
5474
|
}
|
|
5491
5475
|
}
|
|
@@ -5496,6 +5480,9 @@ const _sfc_main = {
|
|
|
5496
5480
|
}
|
|
5497
5481
|
}
|
|
5498
5482
|
});
|
|
5483
|
+
me2.editor.addEventListener("reAddListener", function(event) {
|
|
5484
|
+
me2.setListener();
|
|
5485
|
+
});
|
|
5499
5486
|
me2.editor.addEventListener("willPaste", function(type, handler) {
|
|
5500
5487
|
function validateDom() {
|
|
5501
5488
|
const fragment = type && type.fragment || {};
|
|
@@ -5503,7 +5490,8 @@ const _sfc_main = {
|
|
|
5503
5490
|
tmpNode.appendChild(fragment.cloneNode(true));
|
|
5504
5491
|
const str = tmpNode.innerHTML;
|
|
5505
5492
|
const text = tmpNode.innerText || "";
|
|
5506
|
-
|
|
5493
|
+
const isTextNode = fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName === "#text";
|
|
5494
|
+
type.defaultPrevented = str.indexOf("<img") > -1 || str.indexOf("<video") > -1 || !isTextNode && text.length > 1;
|
|
5507
5495
|
tmpNode = null;
|
|
5508
5496
|
}
|
|
5509
5497
|
validateDom();
|
|
@@ -5593,7 +5581,7 @@ const _sfc_main = {
|
|
|
5593
5581
|
if (isGif) {
|
|
5594
5582
|
src = src.replace(".gif", ".gif!nowater");
|
|
5595
5583
|
}
|
|
5596
|
-
var
|
|
5584
|
+
var img = this.createElement("img", {
|
|
5597
5585
|
"id": isHaloImage ? "" : src,
|
|
5598
5586
|
"src": src,
|
|
5599
5587
|
"class": isHaloImage ? "halo-picture-area" : "halo-picture-area no-upload",
|
|
@@ -5606,7 +5594,7 @@ const _sfc_main = {
|
|
|
5606
5594
|
});
|
|
5607
5595
|
const btns = me2.insertImgOperateBtns(this, data);
|
|
5608
5596
|
var childList = [];
|
|
5609
|
-
childList.push(
|
|
5597
|
+
childList.push(img);
|
|
5610
5598
|
childList.push(...btns);
|
|
5611
5599
|
!isHaloImage && childList.push(loading);
|
|
5612
5600
|
!isHaloImage && childList.push(fail);
|
|
@@ -5617,21 +5605,17 @@ const _sfc_main = {
|
|
|
5617
5605
|
"draggable": "true",
|
|
5618
5606
|
"tabindex": "-1"
|
|
5619
5607
|
}, [...childList]);
|
|
5620
|
-
me2.
|
|
5621
|
-
p.onclick = function(e) {
|
|
5622
|
-
me2.selectDom = p;
|
|
5623
|
-
img2.classList.add("halo-select");
|
|
5624
|
-
};
|
|
5625
|
-
p.onblur = function(e) {
|
|
5626
|
-
img2.classList.remove("halo-select");
|
|
5627
|
-
me2.selectDom = null;
|
|
5628
|
-
};
|
|
5608
|
+
me2.setListener(p);
|
|
5629
5609
|
this.insertElement(p, range);
|
|
5630
5610
|
if (isSeameless) {
|
|
5631
5611
|
me2.removeDefault(p, "nextElementSibling");
|
|
5632
5612
|
me2.removeDefault(p, "previousElementSibling");
|
|
5633
5613
|
} else {
|
|
5634
|
-
|
|
5614
|
+
const pre = p.previousElementSibling;
|
|
5615
|
+
const isBlock = (pre == null ? void 0 : pre.classList.contains("halo-paragraph")) || false;
|
|
5616
|
+
if (isBlock && (!pre.texContent || pre.innerText === "\n")) {
|
|
5617
|
+
pre.remove();
|
|
5618
|
+
}
|
|
5635
5619
|
}
|
|
5636
5620
|
setTimeout(() => {
|
|
5637
5621
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -5681,17 +5665,10 @@ const _sfc_main = {
|
|
|
5681
5665
|
"class": "halo-video-content",
|
|
5682
5666
|
"contenteditable": "false",
|
|
5683
5667
|
"data-video": JSON.stringify(data),
|
|
5684
|
-
"draggable": "true"
|
|
5668
|
+
"draggable": "true",
|
|
5669
|
+
"tabindex": "-1"
|
|
5685
5670
|
}, [video, delBtn, posterBtn]);
|
|
5686
|
-
|
|
5687
|
-
me2.selectDom = p;
|
|
5688
|
-
video.classList.add("halo-select");
|
|
5689
|
-
};
|
|
5690
|
-
p.onblur = function(e) {
|
|
5691
|
-
img.classList.remove("halo-select");
|
|
5692
|
-
me2.selectDom = null;
|
|
5693
|
-
};
|
|
5694
|
-
me2.setDragMove(p);
|
|
5671
|
+
me2.setListener(p);
|
|
5695
5672
|
this.insertElement(p);
|
|
5696
5673
|
setTimeout(() => {
|
|
5697
5674
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -5699,14 +5676,14 @@ const _sfc_main = {
|
|
|
5699
5676
|
};
|
|
5700
5677
|
window.Squire.prototype.insertLink = function(link, text) {
|
|
5701
5678
|
var scrollTop = document.documentElement.scrollTop;
|
|
5702
|
-
var
|
|
5679
|
+
var img = `<img class="link-img" src='/static/img/icon_link@3x.png'></img>`;
|
|
5703
5680
|
var a = `<a class="halo-link-mes" data-url="${link}" target="_blank">${text}</a>`;
|
|
5704
5681
|
const del = me2.generateDelLinkIcon();
|
|
5705
5682
|
var p = this.createElement("DIV", {
|
|
5706
5683
|
"class": "halo-link",
|
|
5707
5684
|
"contenteditable": "false"
|
|
5708
5685
|
});
|
|
5709
|
-
p.innerHTML =
|
|
5686
|
+
p.innerHTML = img + a;
|
|
5710
5687
|
p.appendChild(del);
|
|
5711
5688
|
this.insertElement(p);
|
|
5712
5689
|
setTimeout(() => {
|
|
@@ -5727,6 +5704,47 @@ const _sfc_main = {
|
|
|
5727
5704
|
}
|
|
5728
5705
|
};
|
|
5729
5706
|
},
|
|
5707
|
+
setListener(dom) {
|
|
5708
|
+
const me2 = this;
|
|
5709
|
+
const doms = dom ? [dom] : Array.from(this.editorDom.children);
|
|
5710
|
+
doms.forEach((p) => {
|
|
5711
|
+
if (me2.moverClasses.includes(p.className)) {
|
|
5712
|
+
me2.setDragMove(p);
|
|
5713
|
+
const area = p.firstChild;
|
|
5714
|
+
p.onclick = function() {
|
|
5715
|
+
var _a;
|
|
5716
|
+
if (area.nodeName === "VIDEO" && ((_a = me2.selectDom) == null ? void 0 : _a.className) === "halo-video-content") {
|
|
5717
|
+
me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
|
|
5718
|
+
}
|
|
5719
|
+
me2.selectDom = p;
|
|
5720
|
+
const selected = document.querySelector(".halo-select");
|
|
5721
|
+
selected && selected.classList.remove("halo-select");
|
|
5722
|
+
area.classList.add("halo-select");
|
|
5723
|
+
p.focus();
|
|
5724
|
+
};
|
|
5725
|
+
p.onblur = function(e) {
|
|
5726
|
+
area.classList.remove("halo-select");
|
|
5727
|
+
me2.selectDom = null;
|
|
5728
|
+
};
|
|
5729
|
+
const deleteVideo = p.querySelector(".video-delete");
|
|
5730
|
+
const deleteImg = p.querySelector(".img-delete");
|
|
5731
|
+
if (deleteImg) {
|
|
5732
|
+
deleteImg.onclick = function(e) {
|
|
5733
|
+
if (me2.disabled)
|
|
5734
|
+
return;
|
|
5735
|
+
me2.removeSeamlessLaster(e);
|
|
5736
|
+
p.remove();
|
|
5737
|
+
me2.updateData(true);
|
|
5738
|
+
};
|
|
5739
|
+
}
|
|
5740
|
+
if (deleteVideo) {
|
|
5741
|
+
deleteVideo.onclick = function() {
|
|
5742
|
+
p.remove();
|
|
5743
|
+
};
|
|
5744
|
+
}
|
|
5745
|
+
}
|
|
5746
|
+
});
|
|
5747
|
+
},
|
|
5730
5748
|
removeDefault(next, key) {
|
|
5731
5749
|
const me2 = this;
|
|
5732
5750
|
const cur = next[key];
|
|
@@ -5784,9 +5802,9 @@ const _sfc_main = {
|
|
|
5784
5802
|
count += text.replace(/\n/g, "").length;
|
|
5785
5803
|
isNotParagraph = false;
|
|
5786
5804
|
} else if (value.className === "halo-img-content") {
|
|
5787
|
-
const
|
|
5805
|
+
const img = value.querySelector(".halo-picture-area");
|
|
5788
5806
|
isNotParagraph = false;
|
|
5789
|
-
if (
|
|
5807
|
+
if (img.src.indexOf("jddmoto") === -1 && img.src.indexOf("58moto") === -1) {
|
|
5790
5808
|
hasFailUploadImg = true;
|
|
5791
5809
|
return;
|
|
5792
5810
|
}
|
|
@@ -5887,8 +5905,8 @@ const _sfc_main = {
|
|
|
5887
5905
|
businessId: 2
|
|
5888
5906
|
}).then((_) => {
|
|
5889
5907
|
if (_.data.code === 0 && _.data.data) {
|
|
5890
|
-
const
|
|
5891
|
-
me2.updateImage(
|
|
5908
|
+
const img = _.data.data.thirdPartyImageUrl;
|
|
5909
|
+
me2.updateImage(img, currentImg);
|
|
5892
5910
|
} else {
|
|
5893
5911
|
parent && uploadFailHandler(currentImg);
|
|
5894
5912
|
}
|
|
@@ -5902,10 +5920,10 @@ const _sfc_main = {
|
|
|
5902
5920
|
parent && uploadFailHandler(currentImg);
|
|
5903
5921
|
});
|
|
5904
5922
|
},
|
|
5905
|
-
updateImage(
|
|
5923
|
+
updateImage(img, currentImg = {}) {
|
|
5906
5924
|
const data = JSON.parse(currentImg.getAttribute("data") || "{}");
|
|
5907
|
-
data.img =
|
|
5908
|
-
currentImg.setAttribute("src",
|
|
5925
|
+
data.img = img;
|
|
5926
|
+
currentImg.setAttribute("src", img);
|
|
5909
5927
|
currentImg.setAttribute("data", JSON.stringify(data));
|
|
5910
5928
|
currentImg.className = "halo-picture-area";
|
|
5911
5929
|
const parent = currentImg.parentNode || "";
|
package/dist/haluo-biz.umd.cjs
CHANGED
|
@@ -481,8 +481,8 @@
|
|
|
481
481
|
const target = this.$refs["align"];
|
|
482
482
|
const font = this.$refs["font"];
|
|
483
483
|
const list = this.$refs["list"];
|
|
484
|
-
const
|
|
485
|
-
if ((target == null ? void 0 : target.contains(e)) || (font == null ? void 0 : font.contains(e)) || (list == null ? void 0 : list.contains(e)) || (
|
|
484
|
+
const img = this.$refs["img"];
|
|
485
|
+
if ((target == null ? void 0 : target.contains(e)) || (font == null ? void 0 : font.contains(e)) || (list == null ? void 0 : list.contains(e)) || (img == null ? void 0 : img.contains(e)))
|
|
486
486
|
return;
|
|
487
487
|
this.popoverVisible = false;
|
|
488
488
|
this.popoverVisibleFont = false;
|
|
@@ -3868,8 +3868,8 @@
|
|
|
3868
3868
|
e.target.value = "";
|
|
3869
3869
|
emits("update:imgList", tempImgs);
|
|
3870
3870
|
};
|
|
3871
|
-
const deleteImg = (
|
|
3872
|
-
const arr = props.imgList.filter((item) => item.id !==
|
|
3871
|
+
const deleteImg = (img) => {
|
|
3872
|
+
const arr = props.imgList.filter((item) => item.id !== img.id);
|
|
3873
3873
|
emits("update:imgList", arr);
|
|
3874
3874
|
};
|
|
3875
3875
|
const emitEvent = () => {
|
|
@@ -3932,9 +3932,9 @@
|
|
|
3932
3932
|
const imgList = node.querySelectorAll(".halo-picture-area");
|
|
3933
3933
|
if (imgList && imgList.length) {
|
|
3934
3934
|
const list = [];
|
|
3935
|
-
imgList.forEach((
|
|
3936
|
-
if (!list.includes(
|
|
3937
|
-
list.push(
|
|
3935
|
+
imgList.forEach((img) => {
|
|
3936
|
+
if (!list.includes(img.src)) {
|
|
3937
|
+
list.push(img.src);
|
|
3938
3938
|
}
|
|
3939
3939
|
});
|
|
3940
3940
|
list.forEach((src, i) => {
|
|
@@ -4849,7 +4849,7 @@
|
|
|
4849
4849
|
const data = this.filterHtml(html, type);
|
|
4850
4850
|
return data;
|
|
4851
4851
|
},
|
|
4852
|
-
generateImgHtml(
|
|
4852
|
+
generateImgHtml(img, isGif, desc) {
|
|
4853
4853
|
let descHtml = "";
|
|
4854
4854
|
if (desc) {
|
|
4855
4855
|
descHtml = ` <div
|
|
@@ -4863,7 +4863,7 @@
|
|
|
4863
4863
|
<div class="show-img-content">
|
|
4864
4864
|
<img
|
|
4865
4865
|
alt
|
|
4866
|
-
src="${
|
|
4866
|
+
src="${img}"
|
|
4867
4867
|
class="detail-imgs"
|
|
4868
4868
|
onerror="onerror=null;src='/static/img/web_img_zhanwei.png'"
|
|
4869
4869
|
/>
|
|
@@ -4890,13 +4890,13 @@
|
|
|
4890
4890
|
if (node.nodeType === 1) {
|
|
4891
4891
|
if (node.classList.contains("halo-img-content")) {
|
|
4892
4892
|
const children = [...node.childNodes];
|
|
4893
|
-
const
|
|
4894
|
-
const isGif =
|
|
4893
|
+
const img = node.querySelector(".halo-picture-area");
|
|
4894
|
+
const isGif = img.src.indexOf(".gif!nowater") > -1;
|
|
4895
4895
|
if (isGif && type === "preview") {
|
|
4896
|
-
|
|
4896
|
+
img.src = img.src.replace(".gif!nowater", ".gif");
|
|
4897
4897
|
}
|
|
4898
4898
|
if (type === "preview") {
|
|
4899
|
-
node.innerHTML = this.generateImgHtml(
|
|
4899
|
+
node.innerHTML = this.generateImgHtml(img.src, isGif, img.dataset.desc);
|
|
4900
4900
|
return;
|
|
4901
4901
|
}
|
|
4902
4902
|
children.forEach((child) => {
|
|
@@ -4921,9 +4921,9 @@
|
|
|
4921
4921
|
node.innerHTML = this.generateLinkHtml(a.dataset.url, a.innerText);
|
|
4922
4922
|
return;
|
|
4923
4923
|
}
|
|
4924
|
-
const
|
|
4924
|
+
const img = node.querySelector(".link-img");
|
|
4925
4925
|
const del = node.querySelector(".img-delete");
|
|
4926
|
-
node.removeChild(
|
|
4926
|
+
node.removeChild(img);
|
|
4927
4927
|
node.removeChild(del);
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
@@ -4935,7 +4935,6 @@
|
|
|
4935
4935
|
},
|
|
4936
4936
|
async parseHtml(html, essayPicRelVOList) {
|
|
4937
4937
|
var _a;
|
|
4938
|
-
const me2 = this;
|
|
4939
4938
|
const div = document.createElement("div");
|
|
4940
4939
|
div.innerHTML = html;
|
|
4941
4940
|
const frag = document.createDocumentFragment();
|
|
@@ -4949,27 +4948,19 @@
|
|
|
4949
4948
|
} else if (node.tagName.toLowerCase() === "halo-good") {
|
|
4950
4949
|
this.parseGood(node);
|
|
4951
4950
|
} else if (node.classList.contains("halo-img-content")) {
|
|
4952
|
-
const
|
|
4951
|
+
const img = node.querySelector("img");
|
|
4953
4952
|
node.setAttribute("tabindex", -1);
|
|
4954
4953
|
node.setAttribute("draggable", true);
|
|
4955
4954
|
node.setAttribute("contenteditable", false);
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
node.onblur = function(e) {
|
|
4962
|
-
img2.classList.remove("halo-select");
|
|
4963
|
-
me2.selectDom = null;
|
|
4964
|
-
};
|
|
4965
|
-
this.setDragMove(node);
|
|
4966
|
-
const desc = img2.dataset.desc;
|
|
4967
|
-
img2.style.margin = "0";
|
|
4968
|
-
const seamlessFlag = ((_a = JSON.parse(img2.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
4955
|
+
img.setAttribute("draggable", false);
|
|
4956
|
+
this.setListener(node);
|
|
4957
|
+
const desc = img.dataset.desc;
|
|
4958
|
+
img.style.margin = "0";
|
|
4959
|
+
const seamlessFlag = ((_a = JSON.parse(img.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
4969
4960
|
if (essayPicRelVOList) {
|
|
4970
|
-
const arr =
|
|
4961
|
+
const arr = img.src.split("/");
|
|
4971
4962
|
const id = arr[arr.length - 1];
|
|
4972
|
-
|
|
4963
|
+
img.src = essayPicRelVOList.find((obj) => obj.id === String(id)).url;
|
|
4973
4964
|
}
|
|
4974
4965
|
this.insertImgOperateBtns(this.editor, {
|
|
4975
4966
|
content: desc,
|
|
@@ -4987,12 +4978,12 @@
|
|
|
4987
4978
|
return frag;
|
|
4988
4979
|
},
|
|
4989
4980
|
parseLink(node) {
|
|
4990
|
-
const
|
|
4981
|
+
const img = this.editor.createElement("img", {
|
|
4991
4982
|
class: "link-img",
|
|
4992
4983
|
src: "/static/img/icon_link@3x.png"
|
|
4993
4984
|
});
|
|
4994
4985
|
const del = this.generateDelLinkIcon();
|
|
4995
|
-
node.prepend(
|
|
4986
|
+
node.prepend(img);
|
|
4996
4987
|
node.appendChild(del);
|
|
4997
4988
|
},
|
|
4998
4989
|
parseVideo(node, essayPicRelVOList) {
|
|
@@ -5018,20 +5009,12 @@
|
|
|
5018
5009
|
e.stopPropagation();
|
|
5019
5010
|
}
|
|
5020
5011
|
});
|
|
5021
|
-
node.onclick = function(e) {
|
|
5022
|
-
me2.selectDom = node;
|
|
5023
|
-
video.classList.add("halo-select");
|
|
5024
|
-
};
|
|
5025
|
-
node.onblur = function(e) {
|
|
5026
|
-
video.classList.remove("halo-select");
|
|
5027
|
-
me2.selectDom = null;
|
|
5028
|
-
};
|
|
5029
5012
|
const replaceBtn = me2.insertVideoBtns(me2.editor, video);
|
|
5030
5013
|
node.appendChild(delBtn);
|
|
5031
5014
|
node.appendChild(replaceBtn);
|
|
5032
5015
|
node.setAttribute("tabindex", -1);
|
|
5033
5016
|
node.setAttribute("draggable", true);
|
|
5034
|
-
me2.
|
|
5017
|
+
me2.setListener(node);
|
|
5035
5018
|
},
|
|
5036
5019
|
async parseArticle(node) {
|
|
5037
5020
|
const data = JSON.parse(node.dataset.article);
|
|
@@ -5170,8 +5153,8 @@
|
|
|
5170
5153
|
if (this.imgType === "coverImg") {
|
|
5171
5154
|
this.$emit("insertImgs", imgList_new, this.imgType);
|
|
5172
5155
|
} else {
|
|
5173
|
-
imgList_new.forEach((
|
|
5174
|
-
this.imgUploadHandler("img",
|
|
5156
|
+
imgList_new.forEach((img) => {
|
|
5157
|
+
this.imgUploadHandler("img", img.src);
|
|
5175
5158
|
});
|
|
5176
5159
|
}
|
|
5177
5160
|
this.visibleImg = false;
|
|
@@ -5315,8 +5298,8 @@
|
|
|
5315
5298
|
descInput.disabled = me2.disabled;
|
|
5316
5299
|
descInput.oninput = function(e) {
|
|
5317
5300
|
const parent = me2.findParentByClass(e.target, "halo-img-content");
|
|
5318
|
-
const
|
|
5319
|
-
|
|
5301
|
+
const img = parent.querySelector(".halo-picture-area");
|
|
5302
|
+
img.dataset.desc = e.target.value;
|
|
5320
5303
|
if (e.target.value.length > 49) {
|
|
5321
5304
|
return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
|
|
5322
5305
|
}
|
|
@@ -5467,12 +5450,18 @@
|
|
|
5467
5450
|
me2.editor.addEventListener("keydown", function(event) {
|
|
5468
5451
|
if (event.keyCode === 8 || event.keyCode === 46) {
|
|
5469
5452
|
try {
|
|
5453
|
+
const selection = getSelection();
|
|
5470
5454
|
if (me2.selectDom && me2.moverClasses.includes(me2.selectDom.className)) {
|
|
5471
|
-
|
|
5455
|
+
const range = document.createRange();
|
|
5456
|
+
range.selectNodeContents(me2.selectDom.previousElementSibling);
|
|
5457
|
+
range.collapse(false);
|
|
5458
|
+
selection.removeAllRanges();
|
|
5459
|
+
selection.addRange(range);
|
|
5460
|
+
const removeDom = me2.selectDom || event.target;
|
|
5461
|
+
removeDom.remove();
|
|
5472
5462
|
me2.selectDom = null;
|
|
5473
5463
|
event.preventDefault();
|
|
5474
5464
|
} else {
|
|
5475
|
-
const selection = getSelection();
|
|
5476
5465
|
if (selection.isCollapsed) {
|
|
5477
5466
|
const node = selection.focusNode;
|
|
5478
5467
|
const offSet = selection.focusOffset;
|
|
@@ -5483,11 +5472,6 @@
|
|
|
5483
5472
|
if (curSelect) {
|
|
5484
5473
|
previousSibling.click();
|
|
5485
5474
|
previousSibling.focus();
|
|
5486
|
-
const range = document.createRange();
|
|
5487
|
-
range.selectNodeContents(previousSibling);
|
|
5488
|
-
range.collapse(false);
|
|
5489
|
-
selection.removeAllRanges();
|
|
5490
|
-
selection.addRange(range);
|
|
5491
5475
|
event.preventDefault();
|
|
5492
5476
|
}
|
|
5493
5477
|
}
|
|
@@ -5498,6 +5482,9 @@
|
|
|
5498
5482
|
}
|
|
5499
5483
|
}
|
|
5500
5484
|
});
|
|
5485
|
+
me2.editor.addEventListener("reAddListener", function(event) {
|
|
5486
|
+
me2.setListener();
|
|
5487
|
+
});
|
|
5501
5488
|
me2.editor.addEventListener("willPaste", function(type, handler) {
|
|
5502
5489
|
function validateDom() {
|
|
5503
5490
|
const fragment = type && type.fragment || {};
|
|
@@ -5505,7 +5492,8 @@
|
|
|
5505
5492
|
tmpNode.appendChild(fragment.cloneNode(true));
|
|
5506
5493
|
const str = tmpNode.innerHTML;
|
|
5507
5494
|
const text = tmpNode.innerText || "";
|
|
5508
|
-
|
|
5495
|
+
const isTextNode = fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName === "#text";
|
|
5496
|
+
type.defaultPrevented = str.indexOf("<img") > -1 || str.indexOf("<video") > -1 || !isTextNode && text.length > 1;
|
|
5509
5497
|
tmpNode = null;
|
|
5510
5498
|
}
|
|
5511
5499
|
validateDom();
|
|
@@ -5595,7 +5583,7 @@
|
|
|
5595
5583
|
if (isGif) {
|
|
5596
5584
|
src = src.replace(".gif", ".gif!nowater");
|
|
5597
5585
|
}
|
|
5598
|
-
var
|
|
5586
|
+
var img = this.createElement("img", {
|
|
5599
5587
|
"id": isHaloImage ? "" : src,
|
|
5600
5588
|
"src": src,
|
|
5601
5589
|
"class": isHaloImage ? "halo-picture-area" : "halo-picture-area no-upload",
|
|
@@ -5608,7 +5596,7 @@
|
|
|
5608
5596
|
});
|
|
5609
5597
|
const btns = me2.insertImgOperateBtns(this, data);
|
|
5610
5598
|
var childList = [];
|
|
5611
|
-
childList.push(
|
|
5599
|
+
childList.push(img);
|
|
5612
5600
|
childList.push(...btns);
|
|
5613
5601
|
!isHaloImage && childList.push(loading);
|
|
5614
5602
|
!isHaloImage && childList.push(fail);
|
|
@@ -5619,21 +5607,17 @@
|
|
|
5619
5607
|
"draggable": "true",
|
|
5620
5608
|
"tabindex": "-1"
|
|
5621
5609
|
}, [...childList]);
|
|
5622
|
-
me2.
|
|
5623
|
-
p.onclick = function(e) {
|
|
5624
|
-
me2.selectDom = p;
|
|
5625
|
-
img2.classList.add("halo-select");
|
|
5626
|
-
};
|
|
5627
|
-
p.onblur = function(e) {
|
|
5628
|
-
img2.classList.remove("halo-select");
|
|
5629
|
-
me2.selectDom = null;
|
|
5630
|
-
};
|
|
5610
|
+
me2.setListener(p);
|
|
5631
5611
|
this.insertElement(p, range);
|
|
5632
5612
|
if (isSeameless) {
|
|
5633
5613
|
me2.removeDefault(p, "nextElementSibling");
|
|
5634
5614
|
me2.removeDefault(p, "previousElementSibling");
|
|
5635
5615
|
} else {
|
|
5636
|
-
|
|
5616
|
+
const pre = p.previousElementSibling;
|
|
5617
|
+
const isBlock = (pre == null ? void 0 : pre.classList.contains("halo-paragraph")) || false;
|
|
5618
|
+
if (isBlock && (!pre.texContent || pre.innerText === "\n")) {
|
|
5619
|
+
pre.remove();
|
|
5620
|
+
}
|
|
5637
5621
|
}
|
|
5638
5622
|
setTimeout(() => {
|
|
5639
5623
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -5683,17 +5667,10 @@
|
|
|
5683
5667
|
"class": "halo-video-content",
|
|
5684
5668
|
"contenteditable": "false",
|
|
5685
5669
|
"data-video": JSON.stringify(data),
|
|
5686
|
-
"draggable": "true"
|
|
5670
|
+
"draggable": "true",
|
|
5671
|
+
"tabindex": "-1"
|
|
5687
5672
|
}, [video, delBtn, posterBtn]);
|
|
5688
|
-
|
|
5689
|
-
me2.selectDom = p;
|
|
5690
|
-
video.classList.add("halo-select");
|
|
5691
|
-
};
|
|
5692
|
-
p.onblur = function(e) {
|
|
5693
|
-
img.classList.remove("halo-select");
|
|
5694
|
-
me2.selectDom = null;
|
|
5695
|
-
};
|
|
5696
|
-
me2.setDragMove(p);
|
|
5673
|
+
me2.setListener(p);
|
|
5697
5674
|
this.insertElement(p);
|
|
5698
5675
|
setTimeout(() => {
|
|
5699
5676
|
document.documentElement.scrollTop = scrollTop;
|
|
@@ -5701,14 +5678,14 @@
|
|
|
5701
5678
|
};
|
|
5702
5679
|
window.Squire.prototype.insertLink = function(link, text) {
|
|
5703
5680
|
var scrollTop = document.documentElement.scrollTop;
|
|
5704
|
-
var
|
|
5681
|
+
var img = `<img class="link-img" src='/static/img/icon_link@3x.png'></img>`;
|
|
5705
5682
|
var a = `<a class="halo-link-mes" data-url="${link}" target="_blank">${text}</a>`;
|
|
5706
5683
|
const del = me2.generateDelLinkIcon();
|
|
5707
5684
|
var p = this.createElement("DIV", {
|
|
5708
5685
|
"class": "halo-link",
|
|
5709
5686
|
"contenteditable": "false"
|
|
5710
5687
|
});
|
|
5711
|
-
p.innerHTML =
|
|
5688
|
+
p.innerHTML = img + a;
|
|
5712
5689
|
p.appendChild(del);
|
|
5713
5690
|
this.insertElement(p);
|
|
5714
5691
|
setTimeout(() => {
|
|
@@ -5729,6 +5706,47 @@
|
|
|
5729
5706
|
}
|
|
5730
5707
|
};
|
|
5731
5708
|
},
|
|
5709
|
+
setListener(dom) {
|
|
5710
|
+
const me2 = this;
|
|
5711
|
+
const doms = dom ? [dom] : Array.from(this.editorDom.children);
|
|
5712
|
+
doms.forEach((p) => {
|
|
5713
|
+
if (me2.moverClasses.includes(p.className)) {
|
|
5714
|
+
me2.setDragMove(p);
|
|
5715
|
+
const area = p.firstChild;
|
|
5716
|
+
p.onclick = function() {
|
|
5717
|
+
var _a;
|
|
5718
|
+
if (area.nodeName === "VIDEO" && ((_a = me2.selectDom) == null ? void 0 : _a.className) === "halo-video-content") {
|
|
5719
|
+
me2.setToast("\u4E0D\u652F\u6301\u64AD\u653E");
|
|
5720
|
+
}
|
|
5721
|
+
me2.selectDom = p;
|
|
5722
|
+
const selected = document.querySelector(".halo-select");
|
|
5723
|
+
selected && selected.classList.remove("halo-select");
|
|
5724
|
+
area.classList.add("halo-select");
|
|
5725
|
+
p.focus();
|
|
5726
|
+
};
|
|
5727
|
+
p.onblur = function(e) {
|
|
5728
|
+
area.classList.remove("halo-select");
|
|
5729
|
+
me2.selectDom = null;
|
|
5730
|
+
};
|
|
5731
|
+
const deleteVideo = p.querySelector(".video-delete");
|
|
5732
|
+
const deleteImg = p.querySelector(".img-delete");
|
|
5733
|
+
if (deleteImg) {
|
|
5734
|
+
deleteImg.onclick = function(e) {
|
|
5735
|
+
if (me2.disabled)
|
|
5736
|
+
return;
|
|
5737
|
+
me2.removeSeamlessLaster(e);
|
|
5738
|
+
p.remove();
|
|
5739
|
+
me2.updateData(true);
|
|
5740
|
+
};
|
|
5741
|
+
}
|
|
5742
|
+
if (deleteVideo) {
|
|
5743
|
+
deleteVideo.onclick = function() {
|
|
5744
|
+
p.remove();
|
|
5745
|
+
};
|
|
5746
|
+
}
|
|
5747
|
+
}
|
|
5748
|
+
});
|
|
5749
|
+
},
|
|
5732
5750
|
removeDefault(next, key) {
|
|
5733
5751
|
const me2 = this;
|
|
5734
5752
|
const cur = next[key];
|
|
@@ -5786,9 +5804,9 @@
|
|
|
5786
5804
|
count += text.replace(/\n/g, "").length;
|
|
5787
5805
|
isNotParagraph = false;
|
|
5788
5806
|
} else if (value.className === "halo-img-content") {
|
|
5789
|
-
const
|
|
5807
|
+
const img = value.querySelector(".halo-picture-area");
|
|
5790
5808
|
isNotParagraph = false;
|
|
5791
|
-
if (
|
|
5809
|
+
if (img.src.indexOf("jddmoto") === -1 && img.src.indexOf("58moto") === -1) {
|
|
5792
5810
|
hasFailUploadImg = true;
|
|
5793
5811
|
return;
|
|
5794
5812
|
}
|
|
@@ -5889,8 +5907,8 @@
|
|
|
5889
5907
|
businessId: 2
|
|
5890
5908
|
}).then((_) => {
|
|
5891
5909
|
if (_.data.code === 0 && _.data.data) {
|
|
5892
|
-
const
|
|
5893
|
-
me2.updateImage(
|
|
5910
|
+
const img = _.data.data.thirdPartyImageUrl;
|
|
5911
|
+
me2.updateImage(img, currentImg);
|
|
5894
5912
|
} else {
|
|
5895
5913
|
parent && uploadFailHandler(currentImg);
|
|
5896
5914
|
}
|
|
@@ -5904,10 +5922,10 @@
|
|
|
5904
5922
|
parent && uploadFailHandler(currentImg);
|
|
5905
5923
|
});
|
|
5906
5924
|
},
|
|
5907
|
-
updateImage(
|
|
5925
|
+
updateImage(img, currentImg = {}) {
|
|
5908
5926
|
const data = JSON.parse(currentImg.getAttribute("data") || "{}");
|
|
5909
|
-
data.img =
|
|
5910
|
-
currentImg.setAttribute("src",
|
|
5927
|
+
data.img = img;
|
|
5928
|
+
currentImg.setAttribute("src", img);
|
|
5911
5929
|
currentImg.setAttribute("data", JSON.stringify(data));
|
|
5912
5930
|
currentImg.className = "halo-picture-area";
|
|
5913
5931
|
const parent = currentImg.parentNode || "";
|
|
@@ -9410,8 +9428,8 @@
|
|
|
9410
9428
|
const node2 = nodes[i];
|
|
9411
9429
|
if (node2.nodeType === 1) {
|
|
9412
9430
|
if (node2.classList.contains("halo-img-content")) {
|
|
9413
|
-
var
|
|
9414
|
-
var desc =
|
|
9431
|
+
var img = node2.querySelector("img");
|
|
9432
|
+
var desc = img.dataset.desc;
|
|
9415
9433
|
var textarea = node2.querySelector("textarea");
|
|
9416
9434
|
textarea.innerHTML = "";
|
|
9417
9435
|
textarea.value = desc || "";
|
|
@@ -9424,6 +9442,7 @@
|
|
|
9424
9442
|
var node = root;
|
|
9425
9443
|
node.innerHTML = html;
|
|
9426
9444
|
fixTextarea(node);
|
|
9445
|
+
this.fireEvent("reAddListener", node);
|
|
9427
9446
|
do {
|
|
9428
9447
|
fixCursor(node, root);
|
|
9429
9448
|
} while (node = getNextBlock(node, root));
|
|
@@ -9536,11 +9555,11 @@
|
|
|
9536
9555
|
return this;
|
|
9537
9556
|
};
|
|
9538
9557
|
proto.insertImage = function(src, attributes) {
|
|
9539
|
-
var
|
|
9558
|
+
var img = this.createElement("IMG", mergeObjects({
|
|
9540
9559
|
src
|
|
9541
9560
|
}, attributes, true));
|
|
9542
|
-
this.insertElement(
|
|
9543
|
-
return
|
|
9561
|
+
this.insertElement(img);
|
|
9562
|
+
return img;
|
|
9544
9563
|
};
|
|
9545
9564
|
var linkRegExp = /\b((?:(?:ht|f)tps?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i;
|
|
9546
9565
|
var addLinks = function(frag, root, self2) {
|
package/dist/style.css
CHANGED
|
@@ -821,6 +821,10 @@
|
|
|
821
821
|
top: 0;
|
|
822
822
|
width: 440px;
|
|
823
823
|
height: 100%;
|
|
824
|
+
left: 50%;
|
|
825
|
+
-webkit-transform: translateX(-50%);
|
|
826
|
+
-ms-transform: translateX(-50%);
|
|
827
|
+
transform: translateX(-50%);
|
|
824
828
|
line-height: 25px;
|
|
825
829
|
font-size: 18px;
|
|
826
830
|
z-index: 1;
|
|
@@ -850,6 +854,10 @@
|
|
|
850
854
|
font-weight: 400;
|
|
851
855
|
color: #fff;
|
|
852
856
|
z-index: 1;
|
|
857
|
+
left: 50%;
|
|
858
|
+
-webkit-transform: translateX(-50%);
|
|
859
|
+
-ms-transform: translateX(-50%);
|
|
860
|
+
transform: translateX(-50%);
|
|
853
861
|
width: 90px;
|
|
854
862
|
line-height: 32px;
|
|
855
863
|
height: 32px;
|