UNPKG

vue-bbs

Version:

Serverless comment system in Vue

1 lines 10.7 kB
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-bbs"]=t():e["vue-bbs"]=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=70)}({1:function(e,t,n){"use strict";function r(e,t,n,r,i,s,o,a){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),o?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return r}))},117:function(e,t,n){"use strict";n(65)},118:function(e,t,n){(t=n(2)(!1)).push([e.i,".bbs-input-box[data-v-42139f99]{display:flex;align-items:flex-end;justify-content:flex-start;flex-flow:wrap}.bbs-name-avatar[data-v-42139f99]{display:flex;align-items:flex-end;justify-content:flex-start;flex-flow:nowrap}.bbs-input[data-v-42139f99]{position:relative;margin:0;width:100%}@media(min-width: 768px){.bbs-input[data-v-42139f99]{flex:1;min-width:200px;margin:0 24px 0 0}.bbs-input[data-v-42139f99]:last-child{margin:0}}",""]),e.exports=t},15:function(e,t,n){var r=n(35);r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(3).default)("734e1472",r,!0,{})},18:function(e,t,n){var r=n(33);r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(3).default)("59bf309a",r,!0,{})},2:function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"===typeof btoa){var i=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t);return"/*# ".concat(n," */")}(r),s=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(s).concat([i]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"===typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var s=0;s<this.length;s++){var o=this[s][0];null!=o&&(i[o]=!0)}for(var a=0;a<e.length;a++){var l=[].concat(e[a]);r&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},3:function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},i=0;i<t.length;i++){var s=t[i],o=s[0],a={id:e+":"+i,css:s[1],media:s[2],sourceMap:s[3]};r[o]?r[o].parts.push(a):n.push(r[o]={id:o,parts:[a]})}return n}n.r(t),n.d(t,"default",(function(){return b}));var i="undefined"!==typeof document;if("undefined"!==typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var s={},o=i&&(document.head||document.getElementsByTagName("head")[0]),a=null,l=0,c=!1,u=function(){},d=null,f="undefined"!==typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function b(e,t,n,i){c=n,d=i||{};var o=r(e,t);return p(o),function(t){for(var n=[],i=0;i<o.length;i++){var a=o[i];(l=s[a.id]).refs--,n.push(l)}t?p(o=r(e,t)):o=[];for(i=0;i<n.length;i++){var l;if(0===(l=n[i]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete s[l.id]}}}}function p(e){for(var t=0;t<e.length;t++){var n=e[t],r=s[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(h(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var o=[];for(i=0;i<n.parts.length;i++)o.push(h(n.parts[i]));s[n.id]={id:n.id,refs:1,parts:o}}}}function v(){var e=document.createElement("style");return e.type="text/css",o.appendChild(e),e}function h(e){var t,n,r=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(r){if(c)return u;r.parentNode.removeChild(r)}if(f){var i=l++;r=a||(a=v()),t=m.bind(null,r,i,!1),n=m.bind(null,r,i,!0)}else r=v(),t=x.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function m(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,i);else{var s=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(s,o[t]):e.appendChild(s)}}function x(e,t){var n=t.css,r=t.media,i=t.sourceMap;if(r&&e.setAttribute("media",r),d.ssrId&&e.setAttribute("data-vue-ssr-id",t.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}},33:function(e,t,n){(t=n(2)(!1)).push([e.i,".serverless-bbs{--bbs-background-color: #fff;--bbs-primary: #199ed9;--bbs-secondary: #d2791b;--bbs-text-primary: rgba(0, 0, 0, 0.87);--bbs-text-secondary: rgba(0, 0, 0, 0.6);--bbs-text-muted: rgba(0, 0, 0, 0.18);--bbs-separator-color: #c1c1c1;--bbs-separator-background: #f1f1f1;--bbs-success-color: #4caf50;--bbs-error-color: #b71c1c;--bbs-info-color: #2196f3;--bbs-warning-color: #FFC107}*{margin:0;padding:0;box-sizing:border-box}.serverless-bbs{background-color:var(--bbs-background-color);color:var(--bbs-text-primary)}.serverless-bbs a{position:relative;text-decoration:none;color:var(--bbs-info-color)}.serverless-bbs a:hover{color:var(--bbs-primary)}.serverless-bbs .position-relative{position:relative}.serverless-bbs .position-absolute{position:absolute}.serverless-bbs .text-md{font-size:1rem}.serverless-bbs .text-sm{font-size:.8rem}.serverless-bbs .text-left{text-align:left}.serverless-bbs .text-center{text-align:center}.serverless-bbs .text-right{text-align:right}.serverless-bbs .text-secondary{color:var(--bbs-text-secondary)}.serverless-bbs .text-muted{color:var(--bbs-text-muted)}.serverless-bbs .pl-1{padding-left:4px}.serverless-bbs .pl-2{padding-left:8px}.serverless-bbs .mt-2{margin-top:8px}.serverless-bbs .mr-2{margin-right:8px}.serverless-bbs .mr-4{margin-right:16px}.serverless-bbs .highlight-ele{background-color:var(--bbs-primary) !important;color:#fff}.serverless-bbs .highlight-ele *{background-color:var(--bbs-primary) !important;color:#fff}",""]),e.exports=t},34:function(e,t,n){"use strict";n(15)},35:function(e,t,n){(t=n(2)(!1)).push([e.i,"\n.lds-ring[data-v-9b15224e] {\n display: inline-block;\n position: relative;\n background: inherit;\n /*width: 80px;*/\n /*height: 80px;*/\n}\n.lds-ring div[data-v-9b15224e] {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 80%;\n height: 80%;\n margin: 10%;\n border: 3px solid var(--bbs-primary);\n border-radius: 50%;\n animation: lds-ring-data-v-9b15224e 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: var(--bbs-primary) transparent transparent transparent;\n}\n.lds-ring div[data-v-9b15224e]:nth-child(1) {\n animation-delay: -0.45s;\n}\n.lds-ring div[data-v-9b15224e]:nth-child(2) {\n animation-delay: -0.3s;\n}\n.lds-ring div[data-v-9b15224e]:nth-child(3) {\n animation-delay: -0.15s;\n}\n@keyframes lds-ring-data-v-9b15224e {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n\n",""]),e.exports=t},4:function(e,t,n){"use strict";var r={name:"Loading",props:{size:{default:64}}},i=(n(34),n(1)),s=Object(i.a)(r,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"lds-ring serverless-bbs",style:{width:this.size+"px",height:this.size+"px"}},[t("div"),this._v(" "),t("div"),this._v(" "),t("div"),this._v(" "),t("div")])}),[],!1,null,"9b15224e",null);t.a=s.exports},65:function(e,t,n){var r=n(118);r.__esModule&&(r=r.default),"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(3).default)("0b7d74d9",r,!0,{})},70:function(e,t,n){"use strict";n.r(t);var r=n(4),i=(n(18),n(9)),s={name:"ServerlessBBSPageView",components:{Loading:r.a},extends:i.a,props:{uniqStr:{type:String,default:window.location.origin+window.location.pathname},size:{default:16}},data:function(){return{loading:!0,counts:0}},watch:{initialLoading:{immediate:!0,handler:function(e){e||this.init()}}},methods:{init:function(){var e=this;this.loadCounter({rootId:""}).then((function(t){return e.counts=t})).finally((function(){return e.loading=!1}))},loadCounter:function(){return this.fetchPageViews(this.uniqStr,"Vue\u6d4b\u8bd5\u4e3b\u9875")}}},o=(n(117),n(1)),a=Object(o.a)(s,(function(){var e=this.$createElement,t=this._self._c||e;return this.loading||this.initialLoading?t("Loading",{attrs:{size:this.size}}):t("span",[this._v(this._s(this.counts))])}),[],!1,null,"42139f99",null);t.default=a.exports},9:function(e,t,n){"use strict";var r={name:"LayerInterface",data:function(){return{initialLoading:!0}},methods:{serverInit:function(){},fetchPageViews:function(e){},fetchCounts:function(e){},updateComment:function(e,t){},uploadComment:function(e){},fetchCurrentUser:function(){},fetchComments:function(e){}}},i=n(1),s=Object(i.a)(r,(function(){var e=this.$createElement;return(this._self._c||e)("div")}),[],!1,null,"22e30980",null);t.a=s.exports}})}));