Initial commit: queue workspace
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
var inlineTags = {
|
||||
abbr: 1,
|
||||
b: 1,
|
||||
big: 1,
|
||||
code: 1,
|
||||
del: 1,
|
||||
em: 1,
|
||||
i: 1,
|
||||
ins: 1,
|
||||
label: 1,
|
||||
q: 1,
|
||||
small: 1,
|
||||
span: 1,
|
||||
strong: 1
|
||||
}
|
||||
module.exports = {
|
||||
// 从顶层标签的样式中取出一些给 rich-text
|
||||
getStyle: function(style) {
|
||||
if (style) {
|
||||
var i, j, res = '';
|
||||
if ((i = style.indexOf('display')) != -1)
|
||||
res = style.substring(i, (j = style.indexOf(';', i)) == -1 ? style.length : j);
|
||||
if ((i = style.indexOf('float')) != -1)
|
||||
res += ';' + style.substring(i, (j = style.indexOf(';', i)) == -1 ? style.length : j);
|
||||
return res;
|
||||
}
|
||||
},
|
||||
// 处理懒加载
|
||||
getNode: function(item, imgLoad) {
|
||||
if (!imgLoad && item.attrs.i != '0') {
|
||||
var img = {
|
||||
name: 'img',
|
||||
attrs: JSON.parse(JSON.stringify(item.attrs))
|
||||
}
|
||||
delete img.attrs.src;
|
||||
img.attrs.style += ';width:20px;height:20px';
|
||||
return [img];
|
||||
} else return [item];
|
||||
},
|
||||
// 是否通过 rich-text 显示
|
||||
useRichText: function(item) {
|
||||
return !item.c && !inlineTags[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/jyf-parser/libs/trees"],{"04a0":function(t,e,r){"use strict";e["a"]=function(t){t.options.wxsCallMethods||(t.options.wxsCallMethods=[])}},"2c50":function(t,e,r){"use strict";r.r(e);var i=r("552c"),n=r("78cd");for(var o in n)["default"].indexOf(o)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(o);r("ad1f");var s=r("828b"),a=r("04a0"),c=Object(s["a"])(n["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);"function"===typeof a["a"]&&Object(a["a"])(c),e["default"]=c.exports},"38c4":function(t,e,r){"use strict";(function(t,i){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,t.Parser={};var n={components:{trees:function(){Promise.resolve().then(function(){return resolve(r("2c50"))}.bind(null,r)).catch(r.oe)}},name:"trees",data:function(){return{controls:{},imgLoad:!1,loadVideo:!0}},props:{nodes:Array,lazyLoad:Boolean},mounted:function(){this.top=this.$parent;while("parser"!=this.top.$options.name){if(this.top.top){this.top=this.top.top;break}this.top=this.top.$parent}},beforeDestroy:function(){this.observer&&this.observer.disconnect()},methods:{play:function(t){if(this.top.videoContexts.length>1&&this.top.autopause)for(var e=this.top.videoContexts.length;e--;)this.top.videoContexts[e].id!=t.currentTarget.dataset.id&&this.top.videoContexts[e].pause()},imgtap:function(e){var r=e.currentTarget.dataset.attrs;if(!r.ignore){var n=!0,o={id:e.target.id,src:r.src,ignore:function(){return n=!1}};if(t.Parser.onImgtap&&t.Parser.onImgtap(o),this.top.$emit("imgtap",o),n){var s=this.top.imgList,a=s[r.i]?parseInt(r.i):(s=[r.src],0);i.previewImage({current:a,urls:s})}}},imglongtap:function(t){var e=t.item.dataset.attrs;e.ignore||this.top.$emit("imglongtap",{id:t.target.id,src:e.src})},linkpress:function(e){var r=!0,n=e.currentTarget.dataset.attrs;if(n.ignore=function(){return r=!1},t.Parser.onLinkpress&&t.Parser.onLinkpress(n),this.top.$emit("linkpress",n),r){if(n["app-id"])return i.navigateToMiniProgram({appId:n["app-id"],path:n.path});n.href&&("#"==n.href[0]?this.top.useAnchor&&this.top.navigateTo({id:n.href.substring(1)}):0==n.href.indexOf("http")||0==n.href.indexOf("//")?i.setClipboardData({data:n.href,success:function(){return i.showToast({title:"链接已复制"})}}):i.navigateTo({url:n.href}))}},error:function(t){var e,r=t.currentTarget,n=r.dataset.from;if("video"==n||"audio"==n){var o=this.controls[r.id]?this.controls[r.id].index+1:1;o<r.dataset.source.length&&this.$set(this.controls,r.id+".index",o),"video"==n&&(e=i.createVideoContext(r.id,this))}this.top&&this.top.$emit("error",{source:n,target:r,errMsg:t.detail.errMsg,errCode:t.detail.errCode,context:e})},_loadVideo:function(t){this.$set(this.controls,t.currentTarget.id,{play:!0,index:0})}}};e.default=n}).call(this,r("0ee4"),r("df3c")["default"])},"552c":function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return n})),r.d(e,"a",(function(){}));var i=function(){var t=this.$createElement;this._self._c},n=[]},"78cd":function(t,e,r){"use strict";r.r(e);var i=r("38c4"),n=r.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){r.d(e,t,(function(){return i[t]}))}(o);e["default"]=n.a},ad1f:function(t,e,r){"use strict";var i=r("bd21"),n=r.n(i);n.a},bd21:function(t,e,r){}}]);
|
||||
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
|
||||
'components/jyf-parser/libs/trees-create-component',
|
||||
{
|
||||
'components/jyf-parser/libs/trees-create-component':(function(module, exports, __webpack_require__){
|
||||
__webpack_require__('df3c')['createComponent'](__webpack_require__("2c50"))
|
||||
})
|
||||
},
|
||||
[['components/jyf-parser/libs/trees-create-component']]
|
||||
]);
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"trees": "/components/jyf-parser/libs/trees"
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,18 @@
|
||||
._a{display:inline;color:#366092;word-break:break-all;padding:1.5px 0 1.5px 0}._hover{opacity:.7;text-decoration:underline}._img{display:inline-block;text-indent:0}:host{display:inline}.interlayer{align-content:inherit;align-items:inherit;display:inherit;flex-direction:inherit;flex-wrap:inherit;justify-content:inherit;width:100%;white-space:inherit}._b,
|
||||
._strong{font-weight:700}._blockquote,
|
||||
._div,
|
||||
._p,
|
||||
._ol,
|
||||
._ul,
|
||||
._li{display:block}._code{font-family:monospace}._del{text-decoration:line-through}._em,
|
||||
._i{font-style:italic}._h1{font-size:2em}._h2{font-size:1.5em}._h3{font-size:1.17em}._h5{font-size:.83em}._h6{font-size:.67em}._h1,
|
||||
._h2,
|
||||
._h3,
|
||||
._h4,
|
||||
._h5,
|
||||
._h6{display:block;font-weight:700}._ins{text-decoration:underline}._li{flex:1;width:0}._ol-bef{margin-right:5px;text-align:right;width:36px}._ul-bef{line-height:normal;margin:0 12px 0 23px}._ol-bef,
|
||||
._ul_bef{flex:none;-webkit-user-select:none;user-select:none}._ul-p1{display:inline-block;height:.3em;line-height:.3em;overflow:hidden;width:.3em}._ul-p2{border:.05em solid #000;border-radius:50%;display:inline-block;height:.23em;width:.23em}._q::before{content:'"'}._q::after{content:'"'}._sub{font-size:smaller;vertical-align:sub}._sup{font-size:smaller;vertical-align:super}.__bdo,
|
||||
.__bdi,
|
||||
.__ruby,
|
||||
.__rt,
|
||||
._entity{display:inline-block}._video{background-color:#000;display:inline-block;height:225px;position:relative;width:300px}._video::after{border-color:transparent transparent transparent #fff;border-style:solid;border-width:15px 0 15px 30px;content:"";left:50%;margin:-15px 0 0 -15px;position:absolute;top:50%}
|
||||
Reference in New Issue
Block a user