@jx3box/jx3box-editor 1.1.6 → 1.1.7
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/assets/js/pz_iframe.js +30 -0
- package/package.json +1 -1
- package/src/Article.vue +3 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import $ from "jquery";
|
|
2
|
+
function buildIframe(str){
|
|
3
|
+
let _str = new URLSearchParams(str);
|
|
4
|
+
let mode = _str.get('mode')
|
|
5
|
+
|
|
6
|
+
if(mode == 'vertical'){
|
|
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>`
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function renderPzIframe(selector = ".e-pz-iframe"){
|
|
14
|
+
try {
|
|
15
|
+
$(selector).each(function(i, ele) {
|
|
16
|
+
// 获取嵌入源地址
|
|
17
|
+
let url = $(this).text();
|
|
18
|
+
|
|
19
|
+
// 构建嵌入源码
|
|
20
|
+
let code = buildIframe(url)
|
|
21
|
+
|
|
22
|
+
// 挂载点
|
|
23
|
+
$(this).after(code);
|
|
24
|
+
});
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default renderPzIframe
|
package/package.json
CHANGED
package/src/Article.vue
CHANGED
|
@@ -90,6 +90,7 @@ import renderTalent2 from "../assets/js/talent2";
|
|
|
90
90
|
import renderKatex from "../assets/js/katex";
|
|
91
91
|
import renderCode from "../assets/js/code";
|
|
92
92
|
import renderImgPreview from "../assets/js/renderImgPreview";
|
|
93
|
+
import renderPzIframe from '../assets/js/pz_iframe'
|
|
93
94
|
|
|
94
95
|
// 剑三
|
|
95
96
|
import Item from "./Item";
|
|
@@ -191,6 +192,8 @@ export default {
|
|
|
191
192
|
renderTalent2();
|
|
192
193
|
// 物品
|
|
193
194
|
renderJx3Element(this);
|
|
195
|
+
// 配装
|
|
196
|
+
renderPzIframe();
|
|
194
197
|
},
|
|
195
198
|
doDir: function () {
|
|
196
199
|
// 显示局部
|