@haluo/biz 2.0.19-beat → 2.0.19-beat.1
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 +64 -49
- package/dist/haluo-biz.umd.cjs +69 -54
- package/dist/style.css +1 -1
- 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 img2 = 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)) || (img2 == null ? void 0 : img2.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 = (img2) => {
|
|
3870
|
+
const arr = props.imgList.filter((item) => item.id !== img2.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((img2) => {
|
|
3934
|
+
if (!list.includes(img2.src)) {
|
|
3935
|
+
list.push(img2.src);
|
|
3936
3936
|
}
|
|
3937
3937
|
});
|
|
3938
3938
|
list.forEach((src, i) => {
|
|
@@ -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(img2, 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="${img2}"
|
|
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 img2 = node.querySelector(".halo-picture-area");
|
|
4892
|
+
const isGif = img2.src.indexOf(".gif!nowater") > -1;
|
|
4893
4893
|
if (isGif && type === "preview") {
|
|
4894
|
-
|
|
4894
|
+
img2.src = img2.src.replace(".gif!nowater", ".gif");
|
|
4895
4895
|
}
|
|
4896
4896
|
if (type === "preview") {
|
|
4897
|
-
node.innerHTML = this.generateImgHtml(
|
|
4897
|
+
node.innerHTML = this.generateImgHtml(img2.src, isGif, img2.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 img2 = node.querySelector(".link-img");
|
|
4923
4923
|
const del = node.querySelector(".img-delete");
|
|
4924
|
-
node.removeChild(
|
|
4924
|
+
node.removeChild(img2);
|
|
4925
4925
|
node.removeChild(del);
|
|
4926
4926
|
}
|
|
4927
4927
|
}
|
|
@@ -4947,29 +4947,29 @@ const _sfc_main = {
|
|
|
4947
4947
|
} else if (node.tagName.toLowerCase() === "halo-good") {
|
|
4948
4948
|
this.parseGood(node);
|
|
4949
4949
|
} else if (node.classList.contains("halo-img-content")) {
|
|
4950
|
-
const
|
|
4950
|
+
const img2 = node.querySelector("img");
|
|
4951
4951
|
node.setAttribute("tabindex", -1);
|
|
4952
4952
|
node.setAttribute("draggable", true);
|
|
4953
4953
|
node.setAttribute("contenteditable", false);
|
|
4954
|
-
|
|
4954
|
+
img2.setAttribute("draggable", false);
|
|
4955
4955
|
node.onclick = function(e) {
|
|
4956
4956
|
me2.selectDom = node;
|
|
4957
|
-
|
|
4957
|
+
img2.classList.add("halo-select");
|
|
4958
4958
|
e.stopPropagation();
|
|
4959
4959
|
};
|
|
4960
4960
|
node.onblur = function(e) {
|
|
4961
|
-
|
|
4961
|
+
img2.classList.remove("halo-select");
|
|
4962
4962
|
me2.selectDom = null;
|
|
4963
4963
|
e.stopPropagation();
|
|
4964
4964
|
};
|
|
4965
4965
|
this.setDragMove(node);
|
|
4966
|
-
const desc =
|
|
4967
|
-
|
|
4968
|
-
const seamlessFlag = ((_a = JSON.parse(
|
|
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";
|
|
4969
4969
|
if (essayPicRelVOList) {
|
|
4970
|
-
const arr =
|
|
4970
|
+
const arr = img2.src.split("/");
|
|
4971
4971
|
const id = arr[arr.length - 1];
|
|
4972
|
-
|
|
4972
|
+
img2.src = essayPicRelVOList.find((obj) => obj.id === String(id)).url;
|
|
4973
4973
|
}
|
|
4974
4974
|
this.insertImgOperateBtns(this.editor, {
|
|
4975
4975
|
content: desc,
|
|
@@ -4987,12 +4987,12 @@ const _sfc_main = {
|
|
|
4987
4987
|
return frag;
|
|
4988
4988
|
},
|
|
4989
4989
|
parseLink(node) {
|
|
4990
|
-
const
|
|
4990
|
+
const img2 = this.editor.createElement("img", {
|
|
4991
4991
|
class: "link-img",
|
|
4992
4992
|
src: "/static/img/icon_link@3x.png"
|
|
4993
4993
|
});
|
|
4994
4994
|
const del = this.generateDelLinkIcon();
|
|
4995
|
-
node.prepend(
|
|
4995
|
+
node.prepend(img2);
|
|
4996
4996
|
node.appendChild(del);
|
|
4997
4997
|
},
|
|
4998
4998
|
parseVideo(node, essayPicRelVOList) {
|
|
@@ -5018,8 +5018,15 @@ const _sfc_main = {
|
|
|
5018
5018
|
e.stopPropagation();
|
|
5019
5019
|
}
|
|
5020
5020
|
});
|
|
5021
|
-
node.onclick = function() {
|
|
5022
|
-
me2.
|
|
5021
|
+
node.onclick = function(e) {
|
|
5022
|
+
me2.selectDom = node;
|
|
5023
|
+
video.classList.add("halo-select");
|
|
5024
|
+
e.stopPropagation();
|
|
5025
|
+
};
|
|
5026
|
+
node.onblur = function(e) {
|
|
5027
|
+
video.classList.remove("halo-select");
|
|
5028
|
+
me2.selectDom = null;
|
|
5029
|
+
e.stopPropagation();
|
|
5023
5030
|
};
|
|
5024
5031
|
const replaceBtn = me2.insertVideoBtns(me2.editor, video);
|
|
5025
5032
|
node.appendChild(delBtn);
|
|
@@ -5165,8 +5172,8 @@ const _sfc_main = {
|
|
|
5165
5172
|
if (this.imgType === "coverImg") {
|
|
5166
5173
|
this.$emit("insertImgs", imgList_new, this.imgType);
|
|
5167
5174
|
} else {
|
|
5168
|
-
imgList_new.forEach((
|
|
5169
|
-
this.imgUploadHandler("img",
|
|
5175
|
+
imgList_new.forEach((img2) => {
|
|
5176
|
+
this.imgUploadHandler("img", img2.src);
|
|
5170
5177
|
});
|
|
5171
5178
|
}
|
|
5172
5179
|
this.visibleImg = false;
|
|
@@ -5310,8 +5317,8 @@ const _sfc_main = {
|
|
|
5310
5317
|
descInput.disabled = me2.disabled;
|
|
5311
5318
|
descInput.oninput = function(e) {
|
|
5312
5319
|
const parent = me2.findParentByClass(e.target, "halo-img-content");
|
|
5313
|
-
const
|
|
5314
|
-
|
|
5320
|
+
const img2 = parent.querySelector(".halo-picture-area");
|
|
5321
|
+
img2.dataset.desc = e.target.value;
|
|
5315
5322
|
if (e.target.value.length > 49) {
|
|
5316
5323
|
return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
|
|
5317
5324
|
}
|
|
@@ -5469,12 +5476,14 @@ const _sfc_main = {
|
|
|
5469
5476
|
const selection = getSelection();
|
|
5470
5477
|
if (selection.isCollapsed) {
|
|
5471
5478
|
const node = selection.focusNode;
|
|
5479
|
+
const offSet = selection.focusOffset;
|
|
5472
5480
|
const previousSibling = node.previousElementSibling || node.parentNode.previousElementSibling || {};
|
|
5473
5481
|
const isPre = me2.moverClasses.includes(previousSibling.className);
|
|
5474
|
-
|
|
5475
|
-
|
|
5482
|
+
if (isPre && offSet === 0) {
|
|
5483
|
+
const curSelect = previousSibling.querySelector("img") || previousSibling.querySelector("video");
|
|
5484
|
+
event.preventDefault();
|
|
5476
5485
|
me2.selectDom = previousSibling;
|
|
5477
|
-
|
|
5486
|
+
curSelect.classList.add("halo-select");
|
|
5478
5487
|
}
|
|
5479
5488
|
}
|
|
5480
5489
|
}
|
|
@@ -5580,7 +5589,7 @@ const _sfc_main = {
|
|
|
5580
5589
|
if (isGif) {
|
|
5581
5590
|
src = src.replace(".gif", ".gif!nowater");
|
|
5582
5591
|
}
|
|
5583
|
-
var
|
|
5592
|
+
var img2 = this.createElement("img", {
|
|
5584
5593
|
"id": isHaloImage ? "" : src,
|
|
5585
5594
|
"src": src,
|
|
5586
5595
|
"class": isHaloImage ? "halo-picture-area" : "halo-picture-area no-upload",
|
|
@@ -5593,7 +5602,7 @@ const _sfc_main = {
|
|
|
5593
5602
|
});
|
|
5594
5603
|
const btns = me2.insertImgOperateBtns(this, data);
|
|
5595
5604
|
var childList = [];
|
|
5596
|
-
childList.push(
|
|
5605
|
+
childList.push(img2);
|
|
5597
5606
|
childList.push(...btns);
|
|
5598
5607
|
!isHaloImage && childList.push(loading);
|
|
5599
5608
|
!isHaloImage && childList.push(fail);
|
|
@@ -5607,11 +5616,11 @@ const _sfc_main = {
|
|
|
5607
5616
|
me2.setDragMove(p);
|
|
5608
5617
|
p.onclick = function(e) {
|
|
5609
5618
|
me2.selectDom = p;
|
|
5610
|
-
|
|
5619
|
+
img2.classList.add("halo-select");
|
|
5611
5620
|
e.stopPropagation();
|
|
5612
5621
|
};
|
|
5613
5622
|
p.onblur = function(e) {
|
|
5614
|
-
|
|
5623
|
+
img2.classList.remove("halo-select");
|
|
5615
5624
|
me2.selectDom = null;
|
|
5616
5625
|
e.stopPropagation();
|
|
5617
5626
|
};
|
|
@@ -5673,7 +5682,13 @@ const _sfc_main = {
|
|
|
5673
5682
|
"draggable": "true"
|
|
5674
5683
|
}, [video, delBtn, posterBtn]);
|
|
5675
5684
|
p.onclick = function() {
|
|
5676
|
-
me2.
|
|
5685
|
+
me2.selectDom = p;
|
|
5686
|
+
video.classList.add("halo-select");
|
|
5687
|
+
};
|
|
5688
|
+
p.onblur = function(e) {
|
|
5689
|
+
img.classList.remove("halo-select");
|
|
5690
|
+
me2.selectDom = null;
|
|
5691
|
+
e.stopPropagation();
|
|
5677
5692
|
};
|
|
5678
5693
|
me2.setDragMove(p);
|
|
5679
5694
|
this.insertElement(p);
|
|
@@ -5683,14 +5698,14 @@ const _sfc_main = {
|
|
|
5683
5698
|
};
|
|
5684
5699
|
window.Squire.prototype.insertLink = function(link, text) {
|
|
5685
5700
|
var scrollTop = document.documentElement.scrollTop;
|
|
5686
|
-
var
|
|
5701
|
+
var img2 = `<img class="link-img" src='/static/img/icon_link@3x.png'></img>`;
|
|
5687
5702
|
var a = `<a class="halo-link-mes" data-url="${link}" target="_blank">${text}</a>`;
|
|
5688
5703
|
const del = me2.generateDelLinkIcon();
|
|
5689
5704
|
var p = this.createElement("DIV", {
|
|
5690
5705
|
"class": "halo-link",
|
|
5691
5706
|
"contenteditable": "false"
|
|
5692
5707
|
});
|
|
5693
|
-
p.innerHTML =
|
|
5708
|
+
p.innerHTML = img2 + a;
|
|
5694
5709
|
p.appendChild(del);
|
|
5695
5710
|
this.insertElement(p);
|
|
5696
5711
|
setTimeout(() => {
|
|
@@ -5768,9 +5783,9 @@ const _sfc_main = {
|
|
|
5768
5783
|
count += text.replace(/\n/g, "").length;
|
|
5769
5784
|
isNotParagraph = false;
|
|
5770
5785
|
} else if (value.className === "halo-img-content") {
|
|
5771
|
-
const
|
|
5786
|
+
const img2 = value.querySelector(".halo-picture-area");
|
|
5772
5787
|
isNotParagraph = false;
|
|
5773
|
-
if (
|
|
5788
|
+
if (img2.src.indexOf("jddmoto") === -1 && img2.src.indexOf("58moto") === -1) {
|
|
5774
5789
|
hasFailUploadImg = true;
|
|
5775
5790
|
return;
|
|
5776
5791
|
}
|
|
@@ -5871,8 +5886,8 @@ const _sfc_main = {
|
|
|
5871
5886
|
businessId: 2
|
|
5872
5887
|
}).then((_) => {
|
|
5873
5888
|
if (_.data.code === 0 && _.data.data) {
|
|
5874
|
-
const
|
|
5875
|
-
me2.updateImage(
|
|
5889
|
+
const img2 = _.data.data.thirdPartyImageUrl;
|
|
5890
|
+
me2.updateImage(img2, currentImg);
|
|
5876
5891
|
} else {
|
|
5877
5892
|
parent && uploadFailHandler(currentImg);
|
|
5878
5893
|
}
|
|
@@ -5886,10 +5901,10 @@ const _sfc_main = {
|
|
|
5886
5901
|
parent && uploadFailHandler(currentImg);
|
|
5887
5902
|
});
|
|
5888
5903
|
},
|
|
5889
|
-
updateImage(
|
|
5904
|
+
updateImage(img2, currentImg = {}) {
|
|
5890
5905
|
const data = JSON.parse(currentImg.getAttribute("data") || "{}");
|
|
5891
|
-
data.img =
|
|
5892
|
-
currentImg.setAttribute("src",
|
|
5906
|
+
data.img = img2;
|
|
5907
|
+
currentImg.setAttribute("src", img2);
|
|
5893
5908
|
currentImg.setAttribute("data", JSON.stringify(data));
|
|
5894
5909
|
currentImg.className = "halo-picture-area";
|
|
5895
5910
|
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 img2 = 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)) || (img2 == null ? void 0 : img2.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 = (img2) => {
|
|
3872
|
+
const arr = props.imgList.filter((item) => item.id !== img2.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((img2) => {
|
|
3936
|
+
if (!list.includes(img2.src)) {
|
|
3937
|
+
list.push(img2.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(img2, 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="${img2}"
|
|
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 img2 = node.querySelector(".halo-picture-area");
|
|
4894
|
+
const isGif = img2.src.indexOf(".gif!nowater") > -1;
|
|
4895
4895
|
if (isGif && type === "preview") {
|
|
4896
|
-
|
|
4896
|
+
img2.src = img2.src.replace(".gif!nowater", ".gif");
|
|
4897
4897
|
}
|
|
4898
4898
|
if (type === "preview") {
|
|
4899
|
-
node.innerHTML = this.generateImgHtml(
|
|
4899
|
+
node.innerHTML = this.generateImgHtml(img2.src, isGif, img2.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 img2 = node.querySelector(".link-img");
|
|
4925
4925
|
const del = node.querySelector(".img-delete");
|
|
4926
|
-
node.removeChild(
|
|
4926
|
+
node.removeChild(img2);
|
|
4927
4927
|
node.removeChild(del);
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
@@ -4949,29 +4949,29 @@
|
|
|
4949
4949
|
} else if (node.tagName.toLowerCase() === "halo-good") {
|
|
4950
4950
|
this.parseGood(node);
|
|
4951
4951
|
} else if (node.classList.contains("halo-img-content")) {
|
|
4952
|
-
const
|
|
4952
|
+
const img2 = node.querySelector("img");
|
|
4953
4953
|
node.setAttribute("tabindex", -1);
|
|
4954
4954
|
node.setAttribute("draggable", true);
|
|
4955
4955
|
node.setAttribute("contenteditable", false);
|
|
4956
|
-
|
|
4956
|
+
img2.setAttribute("draggable", false);
|
|
4957
4957
|
node.onclick = function(e) {
|
|
4958
4958
|
me2.selectDom = node;
|
|
4959
|
-
|
|
4959
|
+
img2.classList.add("halo-select");
|
|
4960
4960
|
e.stopPropagation();
|
|
4961
4961
|
};
|
|
4962
4962
|
node.onblur = function(e) {
|
|
4963
|
-
|
|
4963
|
+
img2.classList.remove("halo-select");
|
|
4964
4964
|
me2.selectDom = null;
|
|
4965
4965
|
e.stopPropagation();
|
|
4966
4966
|
};
|
|
4967
4967
|
this.setDragMove(node);
|
|
4968
|
-
const desc =
|
|
4969
|
-
|
|
4970
|
-
const seamlessFlag = ((_a = JSON.parse(
|
|
4968
|
+
const desc = img2.dataset.desc;
|
|
4969
|
+
img2.style.margin = "0";
|
|
4970
|
+
const seamlessFlag = ((_a = JSON.parse(img2.getAttribute("data"))) == null ? void 0 : _a.seamlessFlag) || "0";
|
|
4971
4971
|
if (essayPicRelVOList) {
|
|
4972
|
-
const arr =
|
|
4972
|
+
const arr = img2.src.split("/");
|
|
4973
4973
|
const id = arr[arr.length - 1];
|
|
4974
|
-
|
|
4974
|
+
img2.src = essayPicRelVOList.find((obj) => obj.id === String(id)).url;
|
|
4975
4975
|
}
|
|
4976
4976
|
this.insertImgOperateBtns(this.editor, {
|
|
4977
4977
|
content: desc,
|
|
@@ -4989,12 +4989,12 @@
|
|
|
4989
4989
|
return frag;
|
|
4990
4990
|
},
|
|
4991
4991
|
parseLink(node) {
|
|
4992
|
-
const
|
|
4992
|
+
const img2 = this.editor.createElement("img", {
|
|
4993
4993
|
class: "link-img",
|
|
4994
4994
|
src: "/static/img/icon_link@3x.png"
|
|
4995
4995
|
});
|
|
4996
4996
|
const del = this.generateDelLinkIcon();
|
|
4997
|
-
node.prepend(
|
|
4997
|
+
node.prepend(img2);
|
|
4998
4998
|
node.appendChild(del);
|
|
4999
4999
|
},
|
|
5000
5000
|
parseVideo(node, essayPicRelVOList) {
|
|
@@ -5020,8 +5020,15 @@
|
|
|
5020
5020
|
e.stopPropagation();
|
|
5021
5021
|
}
|
|
5022
5022
|
});
|
|
5023
|
-
node.onclick = function() {
|
|
5024
|
-
me2.
|
|
5023
|
+
node.onclick = function(e) {
|
|
5024
|
+
me2.selectDom = node;
|
|
5025
|
+
video.classList.add("halo-select");
|
|
5026
|
+
e.stopPropagation();
|
|
5027
|
+
};
|
|
5028
|
+
node.onblur = function(e) {
|
|
5029
|
+
video.classList.remove("halo-select");
|
|
5030
|
+
me2.selectDom = null;
|
|
5031
|
+
e.stopPropagation();
|
|
5025
5032
|
};
|
|
5026
5033
|
const replaceBtn = me2.insertVideoBtns(me2.editor, video);
|
|
5027
5034
|
node.appendChild(delBtn);
|
|
@@ -5167,8 +5174,8 @@
|
|
|
5167
5174
|
if (this.imgType === "coverImg") {
|
|
5168
5175
|
this.$emit("insertImgs", imgList_new, this.imgType);
|
|
5169
5176
|
} else {
|
|
5170
|
-
imgList_new.forEach((
|
|
5171
|
-
this.imgUploadHandler("img",
|
|
5177
|
+
imgList_new.forEach((img2) => {
|
|
5178
|
+
this.imgUploadHandler("img", img2.src);
|
|
5172
5179
|
});
|
|
5173
5180
|
}
|
|
5174
5181
|
this.visibleImg = false;
|
|
@@ -5312,8 +5319,8 @@
|
|
|
5312
5319
|
descInput.disabled = me2.disabled;
|
|
5313
5320
|
descInput.oninput = function(e) {
|
|
5314
5321
|
const parent = me2.findParentByClass(e.target, "halo-img-content");
|
|
5315
|
-
const
|
|
5316
|
-
|
|
5322
|
+
const img2 = parent.querySelector(".halo-picture-area");
|
|
5323
|
+
img2.dataset.desc = e.target.value;
|
|
5317
5324
|
if (e.target.value.length > 49) {
|
|
5318
5325
|
return me2.setToast("\u9650\u523650\u4E2A\u5B57\u7B26");
|
|
5319
5326
|
}
|
|
@@ -5471,12 +5478,14 @@
|
|
|
5471
5478
|
const selection = getSelection();
|
|
5472
5479
|
if (selection.isCollapsed) {
|
|
5473
5480
|
const node = selection.focusNode;
|
|
5481
|
+
const offSet = selection.focusOffset;
|
|
5474
5482
|
const previousSibling = node.previousElementSibling || node.parentNode.previousElementSibling || {};
|
|
5475
5483
|
const isPre = me2.moverClasses.includes(previousSibling.className);
|
|
5476
|
-
|
|
5477
|
-
|
|
5484
|
+
if (isPre && offSet === 0) {
|
|
5485
|
+
const curSelect = previousSibling.querySelector("img") || previousSibling.querySelector("video");
|
|
5486
|
+
event.preventDefault();
|
|
5478
5487
|
me2.selectDom = previousSibling;
|
|
5479
|
-
|
|
5488
|
+
curSelect.classList.add("halo-select");
|
|
5480
5489
|
}
|
|
5481
5490
|
}
|
|
5482
5491
|
}
|
|
@@ -5582,7 +5591,7 @@
|
|
|
5582
5591
|
if (isGif) {
|
|
5583
5592
|
src = src.replace(".gif", ".gif!nowater");
|
|
5584
5593
|
}
|
|
5585
|
-
var
|
|
5594
|
+
var img2 = this.createElement("img", {
|
|
5586
5595
|
"id": isHaloImage ? "" : src,
|
|
5587
5596
|
"src": src,
|
|
5588
5597
|
"class": isHaloImage ? "halo-picture-area" : "halo-picture-area no-upload",
|
|
@@ -5595,7 +5604,7 @@
|
|
|
5595
5604
|
});
|
|
5596
5605
|
const btns = me2.insertImgOperateBtns(this, data);
|
|
5597
5606
|
var childList = [];
|
|
5598
|
-
childList.push(
|
|
5607
|
+
childList.push(img2);
|
|
5599
5608
|
childList.push(...btns);
|
|
5600
5609
|
!isHaloImage && childList.push(loading);
|
|
5601
5610
|
!isHaloImage && childList.push(fail);
|
|
@@ -5609,11 +5618,11 @@
|
|
|
5609
5618
|
me2.setDragMove(p);
|
|
5610
5619
|
p.onclick = function(e) {
|
|
5611
5620
|
me2.selectDom = p;
|
|
5612
|
-
|
|
5621
|
+
img2.classList.add("halo-select");
|
|
5613
5622
|
e.stopPropagation();
|
|
5614
5623
|
};
|
|
5615
5624
|
p.onblur = function(e) {
|
|
5616
|
-
|
|
5625
|
+
img2.classList.remove("halo-select");
|
|
5617
5626
|
me2.selectDom = null;
|
|
5618
5627
|
e.stopPropagation();
|
|
5619
5628
|
};
|
|
@@ -5675,7 +5684,13 @@
|
|
|
5675
5684
|
"draggable": "true"
|
|
5676
5685
|
}, [video, delBtn, posterBtn]);
|
|
5677
5686
|
p.onclick = function() {
|
|
5678
|
-
me2.
|
|
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
|
+
e.stopPropagation();
|
|
5679
5694
|
};
|
|
5680
5695
|
me2.setDragMove(p);
|
|
5681
5696
|
this.insertElement(p);
|
|
@@ -5685,14 +5700,14 @@
|
|
|
5685
5700
|
};
|
|
5686
5701
|
window.Squire.prototype.insertLink = function(link, text) {
|
|
5687
5702
|
var scrollTop = document.documentElement.scrollTop;
|
|
5688
|
-
var
|
|
5703
|
+
var img2 = `<img class="link-img" src='/static/img/icon_link@3x.png'></img>`;
|
|
5689
5704
|
var a = `<a class="halo-link-mes" data-url="${link}" target="_blank">${text}</a>`;
|
|
5690
5705
|
const del = me2.generateDelLinkIcon();
|
|
5691
5706
|
var p = this.createElement("DIV", {
|
|
5692
5707
|
"class": "halo-link",
|
|
5693
5708
|
"contenteditable": "false"
|
|
5694
5709
|
});
|
|
5695
|
-
p.innerHTML =
|
|
5710
|
+
p.innerHTML = img2 + a;
|
|
5696
5711
|
p.appendChild(del);
|
|
5697
5712
|
this.insertElement(p);
|
|
5698
5713
|
setTimeout(() => {
|
|
@@ -5770,9 +5785,9 @@
|
|
|
5770
5785
|
count += text.replace(/\n/g, "").length;
|
|
5771
5786
|
isNotParagraph = false;
|
|
5772
5787
|
} else if (value.className === "halo-img-content") {
|
|
5773
|
-
const
|
|
5788
|
+
const img2 = value.querySelector(".halo-picture-area");
|
|
5774
5789
|
isNotParagraph = false;
|
|
5775
|
-
if (
|
|
5790
|
+
if (img2.src.indexOf("jddmoto") === -1 && img2.src.indexOf("58moto") === -1) {
|
|
5776
5791
|
hasFailUploadImg = true;
|
|
5777
5792
|
return;
|
|
5778
5793
|
}
|
|
@@ -5873,8 +5888,8 @@
|
|
|
5873
5888
|
businessId: 2
|
|
5874
5889
|
}).then((_) => {
|
|
5875
5890
|
if (_.data.code === 0 && _.data.data) {
|
|
5876
|
-
const
|
|
5877
|
-
me2.updateImage(
|
|
5891
|
+
const img2 = _.data.data.thirdPartyImageUrl;
|
|
5892
|
+
me2.updateImage(img2, currentImg);
|
|
5878
5893
|
} else {
|
|
5879
5894
|
parent && uploadFailHandler(currentImg);
|
|
5880
5895
|
}
|
|
@@ -5888,10 +5903,10 @@
|
|
|
5888
5903
|
parent && uploadFailHandler(currentImg);
|
|
5889
5904
|
});
|
|
5890
5905
|
},
|
|
5891
|
-
updateImage(
|
|
5906
|
+
updateImage(img2, currentImg = {}) {
|
|
5892
5907
|
const data = JSON.parse(currentImg.getAttribute("data") || "{}");
|
|
5893
|
-
data.img =
|
|
5894
|
-
currentImg.setAttribute("src",
|
|
5908
|
+
data.img = img2;
|
|
5909
|
+
currentImg.setAttribute("src", img2);
|
|
5895
5910
|
currentImg.setAttribute("data", JSON.stringify(data));
|
|
5896
5911
|
currentImg.className = "halo-picture-area";
|
|
5897
5912
|
const parent = currentImg.parentNode || "";
|
|
@@ -9394,8 +9409,8 @@
|
|
|
9394
9409
|
const node2 = nodes[i];
|
|
9395
9410
|
if (node2.nodeType === 1) {
|
|
9396
9411
|
if (node2.classList.contains("halo-img-content")) {
|
|
9397
|
-
var
|
|
9398
|
-
var desc =
|
|
9412
|
+
var img2 = node2.querySelector("img");
|
|
9413
|
+
var desc = img2.dataset.desc;
|
|
9399
9414
|
var textarea = node2.querySelector("textarea");
|
|
9400
9415
|
textarea.innerHTML = "";
|
|
9401
9416
|
textarea.value = desc || "";
|
|
@@ -9520,11 +9535,11 @@
|
|
|
9520
9535
|
return this;
|
|
9521
9536
|
};
|
|
9522
9537
|
proto.insertImage = function(src, attributes) {
|
|
9523
|
-
var
|
|
9538
|
+
var img2 = this.createElement("IMG", mergeObjects({
|
|
9524
9539
|
src
|
|
9525
9540
|
}, attributes, true));
|
|
9526
|
-
this.insertElement(
|
|
9527
|
-
return
|
|
9541
|
+
this.insertElement(img2);
|
|
9542
|
+
return img2;
|
|
9528
9543
|
};
|
|
9529
9544
|
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;
|
|
9530
9545
|
var addLinks = function(frag, root, self2) {
|
package/dist/style.css
CHANGED