You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
7.5 KiB
11 lines
7.5 KiB
1 year ago
|
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/jyf-parser/jyf-parser"],{"5f95":function(t,e,i){"use strict";var n=i("63b07"),s=i.n(n);s.a},"63b07":function(t,e,i){},a757:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=(this._self._c,this.nodes.length);this.$mp.data=Object.assign({},{$root:{g0:e}})},s=[]},d4cd:function(t,e,i){"use strict";(function(t,n){var s=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=s(i("7037")),o={},r=t.getFileSystemManager?t.getFileSystemManager():null,c=i("8d55");function h(t){for(var e=t.length,i=5381;e--;)i+=(i<<5)+t.charCodeAt(e);return i}var l={name:"parser",data:function(){return{scaleAm:"",showAm:"",imgs:[],nodes:[]}},components:{trees:function(){i.e("components/jyf-parser/libs/trees").then(function(){return resolve(i("c97e"))}.bind(null,i)).catch(i.oe)}},props:{html:null,autopause:{type:Boolean,default:!0},autosetTitle:{type:Boolean,default:!0},compress:Number,useCache:Boolean,xml:Boolean,domain:String,gestureZoom:Boolean,lazyLoad:Boolean,selectable:Boolean,tagStyle:Object,showWithAnimation:Boolean,useAnchor:Boolean},watch:{html:function(t){this.setContent(t)}},mounted:function(){this.imgList=[],this.imgList.each=function(t){for(var e=0,i=this.length;e<i;e++)this.setItem(e,t(this[e],e,this))},this.imgList.setItem=function(t,e){var i=this;if(void 0!=t&&e){if(0==e.indexOf("http")&&this.includes(e)){for(var s,a="",o=0;s=e[o];o++){if("/"==s&&"/"!=e[o-1]&&"/"!=e[o+1])break;a+=Math.random()>.5?s.toUpperCase():s}return a+=e.substr(o),this[t]=a}if(this[t]=e,e.includes("data:image")){var c,h=e.match(/data:image\/(\S+?);(\S+?),(.+)/);if(!h)return;c="".concat(n.env.USER_DATA_PATH,"/").concat(Date.now(),".").concat(h[1]),r&&r.writeFile({filePath:c,data:h[3],encoding:h[2],success:function(){return i[t]=c}})}}},this.html&&this.setContent(this.html)},beforeDestroy:function(){this.imgList.each((function(e){e&&e.includes(t.env.USER_DATA_PATH)&&r&&r.unlink({filePath:e})})),clearInterval(this._timer)},methods:{setContent:function(e,i){var n,s,r=this;if(!e)return this.nodes=[];if("string"==typeof e){var l=new c(e,this);if(this.useCache){var u=h(e);o[u]?n=o[u]:(n=l.parse(),o[u]=n)}else n=l.parse();this.$emit("parse",n)}else if("[object Array]"==Object.prototype.toString.call(e)){if(e.length&&"Parser"!=e[0].PoweredBy){var f=new c(e,this);(function t(e){for(var i,n=0;i=e[n];n++)if("text"!=i.type){for(var s in i.attrs=i.attrs||{},i.attrs)"string"!=typeof i.attrs[s]&&(i.attrs[s]=i.attrs[s].toString());f.matchAttr(i,f),i.children&&i.children.length?(f.STACK.push(i),t(i.children),f.popNode(f.STACK.pop())):i.children=void 0}})(e)}n=e}else{if("object"!=(0,a.default)(e)||!e.nodes)return;n=e.nodes}this.nodes=i?this.nodes.concat(n):n,n.length&&n[0].title&&this.autosetTitle&&t.setNavigationBarTitle({title:n[0].title}),this.$nextTick((function(){r.imgList.length=0,r.videoContexts=[];(function e(i){for(var n,s=function(i,n){if("trees"==n.$options.name)for(o=n.nodes.length;c=n.nodes[--o];)c.c||("img"==c.name?(r.imgList.setItem(c.attrs.i,c.attrs.src),n.observer||n.imgLoad||"0"==c.attrs.i||(r.lazyLoad&&t.createIntersectionObserver?(n.observer=t.createIntersectionObserver(n),n.observer.relativeToViewport({top:900,bottom:900}).observe("._img",(function(){n.imgLoad=!0,n.observer.disconnect()}))):n.imgLoad=!0)):"video"==c.name&&(h=t.createVideoContext(c.attrs.id,n),h.id=c.attrs.id,r.videoContexts.push(h)));n.$children.length&&e(n.$children)},a=0;n=i[a++];){var o,c,h;s(0,n)}})(r.$children)})),clearInterval(this._timer),this._timer=setInterval((function(){r.createSelectorQuery().select("#top").boundingClientRect().exec((function(t){r.width=t[0].width,t[0].height==s&&(r.$emit("ready",t[0]),clearInterval(r._timer)),s=t[0].height}))}),350),this.showWithAnimation&&!i&&(this.showAm="animation:show .5s")},getText:function(){for(var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.nodes,i="",n=0;t=e[n++];)if("text"==t.type)i+=t.text.replace(/
|
||
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||
|
'components/jyf-parser/jyf-parser-create-component',
|
||
|
{
|
||
|
'components/jyf-parser/jyf-parser-create-component':(function(module, exports, __webpack_require__){
|
||
|
__webpack_require__('543d')['createComponent'](__webpack_require__("dce2"))
|
||
|
})
|
||
|
},
|
||
|
[['components/jyf-parser/jyf-parser-create-component']]
|
||
|
]);
|