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.
10 lines
8.2 KiB
10 lines
8.2 KiB
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/jyf-Parser/index"],{3158:function(t,e,n){"use strict";n.r(e);var r=n("d6bd"),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"78fa":function(t,e,n){},"8cbb":function(t,e,n){"use strict";var r=n("78fa"),i=n.n(r);i.a},"99e9":function(t,e,n){"use strict";n.r(e);var r=n("b5b4"),i=n("3158");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("8cbb");var a=n("828b"),s=Object(a["a"])(i["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);e["default"]=s.exports},b5b4:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var r=function(){var t=this.$createElement,e=(this._self._c,!this.html[0].name&&!this.html[0].type&&!this.nodes.length),n=this.nodes.length;this.$mp.data=Object.assign({},{$root:{g0:e,g1:n}})},i=[]},d6bd:function(t,e,n){"use strict";(function(t,r){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("3b2d"));function a(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var l=n("f6c9").parseHtmlSync,c=getApp().parserCache={},u=n("d0e4"),f=n("e696"),d=function(t){if(0!=t.indexOf("http"))return t;for(var e="",n=0;n<t.length;n++)if(e+=Math.random()>=.5?t[n].toUpperCase():t[n].toLowerCase(),"/"==t[n]&&"/"!=t[n-1]&&"/"!=t[n+1])break;return e+=t.substring(n+1),e},h={name:"parser",data:function(){return{showAnimation:{},controls:{},nodes:[]}},components:{trees:function(){n.e("components/jyf-Parser/trees").then(function(){return resolve(n("3cfa"))}.bind(null,n)).catch(n.oe)}},props:{html:{type:null,default:null},autocopy:{type:Boolean,default:!0},autopause:{type:Boolean,default:!0},autopreview:{type:Boolean,default:!0},autosetTitle:{type:Boolean,default:!0},domain:{type:String,default:null},imgMode:{type:String,default:"default"},lazyLoad:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},tagStyle:{type:Object,default:function(){return{}}},showWithAnimation:{type:Boolean,default:!1},useAnchor:{type:Boolean,default:!1},useCache:{type:Boolean,default:!1}},watch:{html:function(t){this.setContent(t,void 0,!0)}},mounted:function(){this.imgList=[],this.imgList.each=function(t){for(var e=0;e<this.length;e++){var n=t(this[e],e,this);n&&(this.includes(n)?this[e]=d(n):this[e]=n)}},this.setContent(this.html,void 0,!0)},methods:{setContent:function(e,n,i){var s=this;if("object"==(0,o.default)(n))for(var h in n)h=h.replace(/-(\w)/g,(function(){return arguments[1].toUpperCase()})),this[h]=n[h];if(this.showWithAnimation&&(this.showAnimation="transition:400ms ease 0ms;transition-property:transform,opacity;transform-origin:50% 50% 0;-webkit-transition:400ms ease 0ms;-webkit-transform:;-webkit-transition-property:transform,opacity;-webkit-transform-origin:50% 50% 0;opacity: 1"),e)if("string"==typeof e){var m;if(this.useCache){var p=function(t){for(var e=0,n=5381,r=t.length;e<r;e++)n+=(n<<5)+t.charCodeAt(e);return n}(e);c[p]?m=c[p]:(m=l(e,this),c[p]=m)}else m=l(e,this);this.nodes=m,this.$emit("parse",m)}else if(e.constructor==Array){if(this.nodes=i?[]:e,e.length&&"Parser"!=e[0].PoweredBy){var v={_imgNum:0,_videoNum:0,_audioNum:0,_domain:this.domain,_protocol:this.domain?this.domain.includes("://")?this.domain.split("://")[0]:"http":void 0,_STACK:[],CssHandler:new u(this.tagStyle)};v.CssHandler.getStyle("");(function t(e){var n,r=a(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("text"!=i.type){for(var o in i.attrs=i.attrs||{},i.attrs)f.trustAttrs[o]?"string"!=typeof i.attrs[o]&&(i.attrs[o]=i.attrs[o].toString()):i.attrs[o]=void 0;f.LabelAttrsHandler(i,v),f.blockTags[i.name]?i.name="div":f.trustTags[i.name]||(i.name="span"),i.children&&i.children.length?(v._STACK.push(i),t(i.children),v._STACK.pop()):i.children=void 0}}}catch(s){r.e(s)}finally{r.f()}})(e),this.nodes=e}}else{if("object"!=(0,o.default)(e)||!e.nodes)return this.$emit("error",{source:"parse",errMsg:"传入的nodes数组格式不正确!应该传入的类型是array,实际传入的类型是:"+(0,o.default)(e.nodes)});this.nodes=e.nodes,console.warn("Parser 类型错误:object 类型已废弃,请直接将 html 设置为 object.nodes (array 类型)")}else{if(i)return;this.nodes=[]}this.$nextTick((function(){s.imgList.length=0,s.videoContexts=[];(function e(n){var i,o=a(n);try{var l=function(){var n=i.value;if("trees"==n.$options.name){c=!1;var o,l=a(n.nodes);try{for(l.s();!(o=l.n()).done;)u=o.value,u.continue||("img"==u.name?(u.attrs.src&&u.attrs.i&&(-1==s.imgList.indexOf(u.attrs.src)?s.imgList[u.attrs.i]=u.attrs.src:s.imgList[u.attrs.i]=d(u.attrs.src)),c||(c=!0,s.lazyLoad&&t.createIntersectionObserver?(n._observer&&n._observer.disconnect(),n._observer=t.createIntersectionObserver(n),n._observer.relativeToViewport({top:1e3,bottom:1e3}).observe(".img",(function(t){n.imgLoad=!0,n._observer.disconnect(),n._observer=null}))):n.imgLoad=!0)):"video"==u.name?(f=t.createVideoContext(u.attrs.id,n),f.id=u.attrs.id,s.videoContexts.push(f)):"audio"==u.name&&u.attrs.autoplay?r.createAudioContext(u.attrs.id,n).play():"title"==u.name&&"text"==u.children[0].type&&u.children[0].text&&s.autosetTitle&&t.setNavigationBarTitle({title:u.children[0].text}))}catch(h){l.e(h)}finally{l.f()}}n.$children.length&&e(n.$children)};for(o.s();!(i=o.n()).done;){var c,u,f;l()}}catch(h){o.e(h)}finally{o.f()}})(s.$children),t.createSelectorQuery().in(s).select("._contain").boundingClientRect((function(t){s.$emit("ready",t)})).exec()}))},getText:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="",n=function n(r){if("text"==r.type)return e+=r.text;t&&(("p"==r.name||"div"==r.name||"tr"==r.name||"li"==r.name||/h[1-6]/.test(r.name))&&e&&"\n"!=e[e.length-1]||"br"==r.name)&&(e+="\n");var i,o=a(r.children||[]);try{for(o.s();!(i=o.n()).done;){var s=i.value;n(s)}}catch(l){o.e(l)}finally{o.f()}t&&("p"==r.name||"div"==r.name||"tr"==r.name||"li"==r.name||/h[1-6]/.test(r.name))&&e&&"\n"!=e[e.length-1]?e+="\n":t&&"td"==r.name&&(e+="\t")},r=this.nodes&&this.nodes.length?this.nodes:this.html[0]&&(this.html[0].name||this.html[0].type)?this.html:[];if(!r.length)return"";var i,o=a(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;n(s)}}catch(l){o.e(l)}finally{o.f()}return e},navigateTo:function(e){var n=this,r=function(r,i){var o=t.createSelectorQuery().in(i||n);o.select(r).boundingClientRect(),o.selectViewport().scrollOffset(),o.exec((function(n){if(!n||!n[0])return e.fail?e.fail({errMsg:"Label Not Found"}):null;t.pageScrollTo({scrollTop:n[1].scrollTop+n[0].top,success:e.success,fail:e.fail})}))};e.id?r("._contain >>> #"+e.id+", ._contain >>> ."+e.id):r("._contain")},getVideoContext:function(t){if(!t)return this.videoContexts;var e,n=a(this.videoContexts);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.id==t)return r}}catch(i){n.e(i)}finally{n.f()}return null}}};e.default=h}).call(this,n("df3c")["default"],n("3223")["default"])}}]);
|
|
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
|
'components/jyf-Parser/index-create-component',
|
|
{
|
|
'components/jyf-Parser/index-create-component':(function(module, exports, __webpack_require__){
|
|
__webpack_require__('df3c')['createComponent'](__webpack_require__("99e9"))
|
|
})
|
|
},
|
|
[['components/jyf-Parser/index-create-component']]
|
|
]);
|
|
|