@jx3box/jx3box-editor 3.0.12 → 3.0.13
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/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import $ from "jquery";
|
|
2
|
-
function buildIframe(str){
|
|
2
|
+
function buildIframe(str) {
|
|
3
3
|
let _str = new URLSearchParams(str);
|
|
4
|
-
let mode = _str.get(
|
|
4
|
+
let mode = _str.get("mode");
|
|
5
5
|
|
|
6
|
-
if(mode ==
|
|
7
|
-
return `<iframe class="w-pz-iframe" src="${str}" scrolling="no" width="750" height="3468" style="border:none;background:none;max-width:100%;overflow:hidden;"></iframe
|
|
8
|
-
}else{
|
|
9
|
-
return `<iframe class="w-pz-iframe" src="${str}" scrolling="no" width="1280" height="720" style="border:none;background:none;max-width:100%;overflow:hidden;"></iframe
|
|
6
|
+
if (mode == "vertical") {
|
|
7
|
+
return `<div class="w-pz-iframe-wrap"><iframe class="w-pz-iframe" src="${str}" scrolling="no" width="750" height="3468" style="border:none;background:none;max-width:100%;overflow:hidden;"></iframe></div>`;
|
|
8
|
+
} else {
|
|
9
|
+
return `<div class="w-pz-iframe-wrap"><iframe class="w-pz-iframe" src="${str}" scrolling="no" width="1280" height="720" style="border:none;background:none;max-width:100%;overflow:hidden;"></iframe></div>`;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
function renderPzIframe(selector = ".e-pz-iframe"){
|
|
13
|
+
function renderPzIframe(selector = ".e-pz-iframe") {
|
|
14
14
|
try {
|
|
15
|
-
$(selector).each(function(i, ele) {
|
|
15
|
+
$(selector).each(function (i, ele) {
|
|
16
16
|
// 获取嵌入源地址
|
|
17
|
-
let url =
|
|
17
|
+
let url = $(this).text();
|
|
18
18
|
|
|
19
19
|
// 构建嵌入源码
|
|
20
|
-
let code = buildIframe(url)
|
|
20
|
+
let code = buildIframe(url);
|
|
21
21
|
|
|
22
22
|
// 挂载点
|
|
23
23
|
$(this).after(code);
|
|
@@ -27,4 +27,4 @@ function renderPzIframe(selector = ".e-pz-iframe"){
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export default renderPzIframe
|
|
30
|
+
export default renderPzIframe;
|