articleCommentFlex.js 46 KB

12
  1. var require,define;!function(t){if(!require){var e=document.getElementsByTagName("head")[0],n={},r={},o={},i={},a={},c={},u=function(t,n){if(!(t in i)){i[t]=!0;var r=document.createElement("script");if(n){var o=setTimeout(n,require.timeout);r.onerror=function(){clearTimeout(o),n()};var a=function(){clearTimeout(o)};"onload"in r?r.onload=a:r.onreadystatechange=function(){("loaded"===this.readyState||"complete"===this.readyState)&&a()}}return r.type="text/javascript",r.src=t,e.appendChild(r),r}},s=function(t,e,r){var o=n[t]||(n[t]=[]);o.push(e);var i,s=a[t]||a[t+".js"]||{},l=s.pkg;i=l?c[l].url:s.url||t,u(i,r&&function(){r(t)})};define=function(t,e){t=t.replace(/\.js$/i,""),r[t]=e;var o=n[t];if(o){for(var i=0,a=o.length;a>i;i++)o[i]();delete n[t]}},require=function(t){if(t&&t.splice)return require.async.apply(this,arguments);t=require.alias(t);var e=o[t];if(e)return e.exports;var n=r[t];if(!n)throw"[ModJS] Cannot find module `"+t+"`";e=o[t]={exports:{}};var i="function"==typeof n?n.apply(e,[require,e.exports,e]):n;return i&&(e.exports=i),e.exports&&!e.exports["default"]&&(e.exports["default"]=e.exports),e.exports},require.async=function(e,n,o){function i(t){for(var e,n=0,m=t.length;m>n;n++){var f=require.alias(t[n]);f in r?(e=a[f]||a[f+".js"],e&&"deps"in e&&i(e.deps)):f in u||(u[f]=!0,l++,s(f,c,o),e=a[f]||a[f+".js"],e&&"deps"in e&&i(e.deps))}}function c(){if(0===l--){for(var r=[],o=0,i=e.length;i>o;o++)r[o]=require(e[o]);n&&n.apply(t,r)}}"string"==typeof e&&(e=[e]);var u={},l=0;i(e),c()},require.resourceMap=function(t){var e,n;n=t.res;for(e in n)n.hasOwnProperty(e)&&(a[e]=n[e]);n=t.pkg;for(e in n)n.hasOwnProperty(e)&&(c[e]=n[e])},require.loadJs=function(t){u(t)},require.loadCss=function(t){if(t.content){var n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t.content:n.innerHTML=t.content,e.appendChild(n)}else if(t.url){var r=document.createElement("link");r.href=t.url,r.rel="stylesheet",r.type="text/css",e.appendChild(r)}},require.alias=function(t){return t.replace(/\.js$/i,"")},require.timeout=5e3}}(this),define("src/modules/underscore/underscore",function(t,e,n){(function(){function t(t){function e(e,n,r,o,i,a){for(;i>=0&&a>i;i+=t){var c=o?o[i]:i;r=n(r,e[c],c,e)}return r}return function(n,r,o,i){r=y(r,i,4);var a=!C(n)&&b.keys(n),c=(a||n).length,u=t>0?0:c-1;return arguments.length<3&&(o=n[a?a[u]:u],u+=t),e(n,r,o,a,u,c)}}function r(t){return function(e,n,r){n=w(n,r);for(var o=null!=e&&e.length,i=t>0?0:o-1;i>=0&&o>i;i+=t)if(n(e[i],i,e))return i;return-1}}function o(t,e){var n=T.length,r=t.constructor,o=b.isFunction(r)&&r.prototype||u,i="constructor";for(b.has(t,i)&&!b.contains(e,i)&&e.push(i);n--;)i=T[n],i in t&&t[i]!==o[i]&&!b.contains(e,i)&&e.push(i)}var i=this,a=i._,c=Array.prototype,u=Object.prototype,s=Function.prototype,l=c.push,m=c.slice,f=u.toString,d=u.hasOwnProperty,p=Array.isArray,h=Object.keys,g=s.bind,_=Object.create,v=function(){},b=function M(t){return t instanceof M?t:this instanceof M?void(this._wrapped=t):new M(t)};"undefined"!=typeof e?("undefined"!=typeof n&&n.exports&&(e=n.exports=b),e._=b):i._=b,b.VERSION="1.8.2";var y=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return function(){return t.apply(e,arguments)}},w=function(t,e,n){return null==t?b.identity:b.isFunction(t)?y(t,e,n):b.isObject(t)?b.matcher(t):b.property(t)};b.iteratee=function(t,e){return w(t,e,1/0)};var x=function(t,e){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var o=1;r>o;o++)for(var i=arguments[o],a=t(i),c=a.length,u=0;c>u;u++){var s=a[u];e&&void 0!==n[s]||(n[s]=i[s])}return n}},k=function(t){if(!b.isObject(t))return{};if(_)return _(t);v.prototype=t;var e=new v;return v.prototype=null,e},A=Math.pow(2,53)-1,C=function(t){var e=null!=t&&t.length;return"number"==typeof e&&e>=0&&A>=e};b.each=b.forEach=function(t,e,n){e=y(e,n);var r,o;if(C(t))for(r=0,o=t.length;o>r;r++)e(t[r],r,t);else{var i=b.keys(t);for(r=0,o=i.length;o>r;r++)e(t[i[r]],i[r],t)}return t},b.map=b.collect=function(t,e,n){e=w(e,n);for(var r=!C(t)&&b.keys(t),o=(r||t).length,i=Array(o),a=0;o>a;a++){var c=r?r[a]:a;i[a]=e(t[c],c,t)}return i},b.reduce=b.foldl=b.inject=t(1),b.reduceRight=b.foldr=t(-1),b.find=b.detect=function(t,e,n){var r;return r=C(t)?b.findIndex(t,e,n):b.findKey(t,e,n),void 0!==r&&-1!==r?t[r]:void 0},b.filter=b.select=function(t,e,n){var r=[];return e=w(e,n),b.each(t,function(t,n,o){e(t,n,o)&&r.push(t)}),r},b.reject=function(t,e,n){return b.filter(t,b.negate(w(e)),n)},b.every=b.all=function(t,e,n){e=w(e,n);for(var r=!C(t)&&b.keys(t),o=(r||t).length,i=0;o>i;i++){var a=r?r[i]:i;if(!e(t[a],a,t))return!1}return!0},b.some=b.any=function(t,e,n){e=w(e,n);for(var r=!C(t)&&b.keys(t),o=(r||t).length,i=0;o>i;i++){var a=r?r[i]:i;if(e(t[a],a,t))return!0}return!1},b.contains=b.includes=b.include=function(t,e,n){return C(t)||(t=b.values(t)),b.indexOf(t,e,"number"==typeof n&&n)>=0},b.invoke=function(t,e){var n=m.call(arguments,2),r=b.isFunction(e);return b.map(t,function(t){var o=r?e:t[e];return null==o?o:o.apply(t,n)})},b.pluck=function(t,e){return b.map(t,b.property(e))},b.where=function(t,e){return b.filter(t,b.matcher(e))},b.findWhere=function(t,e){return b.find(t,b.matcher(e))},b.max=function(t,e,n){var r,o,i=-1/0,a=-1/0;if(null==e&&null!=t){t=C(t)?t:b.values(t);for(var c=0,u=t.length;u>c;c++)r=t[c],r>i&&(i=r)}else e=w(e,n),b.each(t,function(t,n,r){o=e(t,n,r),(o>a||o===-1/0&&i===-1/0)&&(i=t,a=o)});return i},b.min=function(t,e,n){var r,o,i=1/0,a=1/0;if(null==e&&null!=t){t=C(t)?t:b.values(t);for(var c=0,u=t.length;u>c;c++)r=t[c],i>r&&(i=r)}else e=w(e,n),b.each(t,function(t,n,r){o=e(t,n,r),(a>o||1/0===o&&1/0===i)&&(i=t,a=o)});return i},b.shuffle=function(t){for(var e,n=C(t)?t:b.values(t),r=n.length,o=Array(r),i=0;r>i;i++)e=b.random(0,i),e!==i&&(o[i]=o[e]),o[e]=n[i];return o},b.sample=function(t,e,n){return null==e||n?(C(t)||(t=b.values(t)),t[b.random(t.length-1)]):b.shuffle(t).slice(0,Math.max(0,e))},b.sortBy=function(t,e,n){return e=w(e,n),b.pluck(b.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var j=function(t){return function(e,n,r){var o={};return n=w(n,r),b.each(e,function(r,i){var a=n(r,i,e);t(o,r,a)}),o}};b.groupBy=j(function(t,e,n){b.has(t,n)?t[n].push(e):t[n]=[e]}),b.indexBy=j(function(t,e,n){t[n]=e}),b.countBy=j(function(t,e,n){b.has(t,n)?t[n]++:t[n]=1}),b.toArray=function(t){return t?b.isArray(t)?m.call(t):C(t)?b.map(t,b.identity):b.values(t):[]},b.size=function(t){return null==t?0:C(t)?t.length:b.keys(t).length},b.partition=function(t,e,n){e=w(e,n);var r=[],o=[];return b.each(t,function(t,n,i){(e(t,n,i)?r:o).push(t)}),[r,o]},b.first=b.head=b.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:b.initial(t,t.length-e)},b.initial=function(t,e,n){return m.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},b.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:b.rest(t,Math.max(0,t.length-e))},b.rest=b.tail=b.drop=function(t,e,n){return m.call(t,null==e||n?1:e)},b.compact=function(t){return b.filter(t,b.identity)};var $=function N(t,e,n,r){for(var o=[],i=0,a=r||0,c=t&&t.length;c>a;a++){var u=t[a];if(C(u)&&(b.isArray(u)||b.isArguments(u))){e||(u=N(u,e,n));var s=0,l=u.length;for(o.length+=l;l>s;)o[i++]=u[s++]}else n||(o[i++]=u)}return o};b.flatten=function(t,e){return $(t,e,!1)},b.without=function(t){return b.difference(t,m.call(arguments,1))},b.uniq=b.unique=function(t,e,n,r){if(null==t)return[];b.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=w(n,r));for(var o=[],i=[],a=0,c=t.length;c>a;a++){var u=t[a],s=n?n(u,a,t):u;e?(a&&i===s||o.push(u),i=s):n?b.contains(i,s)||(i.push(s),o.push(u)):b.contains(o,u)||o.push(u)}return o},b.union=function(){return b.uniq($(arguments,!0,!0))},b.intersection=function(t){if(null==t)return[];for(var e=[],n=arguments.length,r=0,o=t.length;o>r;r++){var i=t[r];if(!b.contains(e,i)){for(var a=1;n>a&&b.contains(arguments[a],i);a++);a===n&&e.push(i)}}return e},b.difference=function(t){var e=$(arguments,!0,!0,1);return b.filter(t,function(t){return!b.contains(e,t)})},b.zip=function(){return b.unzip(arguments)},b.unzip=function(t){for(var e=t&&b.max(t,"length").length||0,n=Array(e),r=0;e>r;r++)n[r]=b.pluck(t,r);return n},b.object=function(t,e){for(var n={},r=0,o=t&&t.length;o>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},b.indexOf=function(t,e,n){var r=0,o=t&&t.length;if("number"==typeof n)r=0>n?Math.max(0,o+n):n;else if(n&&o)return r=b.sortedIndex(t,e),t[r]===e?r:-1;if(e!==e)return b.findIndex(m.call(t,r),b.isNaN);for(;o>r;r++)if(t[r]===e)return r;return-1},b.lastIndexOf=function(t,e,n){var r=t?t.length:0;if("number"==typeof n&&(r=0>n?r+n+1:Math.min(r,n+1)),e!==e)return b.findLastIndex(m.call(t,0,r),b.isNaN);for(;--r>=0;)if(t[r]===e)return r;return-1},b.findIndex=r(1),b.findLastIndex=r(-1),b.sortedIndex=function(t,e,n,r){n=w(n,r,1);for(var o=n(e),i=0,a=t.length;a>i;){var c=Math.floor((i+a)/2);n(t[c])<o?i=c+1:a=c}return i},b.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),o=Array(r),i=0;r>i;i++,t+=n)o[i]=t;return o};var D=function(t,e,n,r,o){if(!(r instanceof e))return t.apply(n,o);var i=k(t.prototype),a=t.apply(i,o);return b.isObject(a)?a:i};b.bind=function(t,e){if(g&&t.bind===g)return g.apply(t,m.call(arguments,1));if(!b.isFunction(t))throw new TypeError("Bind must be called on a function");var n=m.call(arguments,2),r=function o(){return D(t,o,e,this,n.concat(m.call(arguments)))};return r},b.partial=function(t){var e=m.call(arguments,1),n=function r(){for(var n=0,o=e.length,i=Array(o),a=0;o>a;a++)i[a]=e[a]===b?arguments[n++]:e[a];for(;n<arguments.length;)i.push(arguments[n++]);return D(t,r,this,this,i)};return n},b.bindAll=function(t){var e,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(e=1;r>e;e++)n=arguments[e],t[n]=b.bind(t[n],t);return t},b.memoize=function(t,e){var n=function r(n){var o=r.cache,i=""+(e?e.apply(this,arguments):n);return b.has(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return n.cache={},n},b.delay=function(t,e){var n=m.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},b.defer=b.partial(b.delay,b,1),b.throttle=function(t,e,n){var r,o,i,a=null,c=0;n||(n={});var u=function(){c=n.leading===!1?0:b.now(),a=null,i=t.apply(r,o),a||(r=o=null)};return function(){var s=b.now();c||n.leading!==!1||(c=s);var l=e-(s-c);return r=this,o=arguments,0>=l||l>e?(a&&(clearTimeout(a),a=null),c=s,i=t.apply(r,o),a||(r=o=null)):a||n.trailing===!1||(a=setTimeout(u,l)),i}},b.debounce=function(t,e,n){var r,o,i,a,c,u=function s(){var u=b.now()-a;e>u&&u>=0?r=setTimeout(s,e-u):(r=null,n||(c=t.apply(i,o),r||(i=o=null)))};return function(){i=this,o=arguments,a=b.now();var s=n&&!r;return r||(r=setTimeout(u,e)),s&&(c=t.apply(i,o),i=o=null),c}},b.wrap=function(t,e){return b.partial(e,t)},b.negate=function(t){return function(){return!t.apply(this,arguments)}},b.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},b.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},b.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),1>=t&&(e=null),n}},b.once=b.partial(b.before,2);var q=!{toString:null}.propertyIsEnumerable("toString"),T=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];b.keys=function(t){if(!b.isObject(t))return[];if(h)return h(t);var e=[];for(var n in t)b.has(t,n)&&e.push(n);return q&&o(t,e),e},b.allKeys=function(t){if(!b.isObject(t))return[];var e=[];for(var n in t)e.push(n);return q&&o(t,e),e},b.values=function(t){for(var e=b.keys(t),n=e.length,r=Array(n),o=0;n>o;o++)r[o]=t[e[o]];return r},b.mapObject=function(t,e,n){e=w(e,n);for(var r,o=b.keys(t),i=o.length,a={},c=0;i>c;c++)r=o[c],a[r]=e(t[r],r,t);return a},b.pairs=function(t){for(var e=b.keys(t),n=e.length,r=Array(n),o=0;n>o;o++)r[o]=[e[o],t[e[o]]];return r},b.invert=function(t){for(var e={},n=b.keys(t),r=0,o=n.length;o>r;r++)e[t[n[r]]]=n[r];return e},b.functions=b.methods=function(t){var e=[];for(var n in t)b.isFunction(t[n])&&e.push(n);return e.sort()},b.extend=x(b.allKeys),b.extendOwn=b.assign=x(b.keys),b.findKey=function(t,e,n){e=w(e,n);for(var r,o=b.keys(t),i=0,a=o.length;a>i;i++)if(r=o[i],e(t[r],r,t))return r},b.pick=function(t,e,n){var r,o,i={},a=t;if(null==a)return i;b.isFunction(e)?(o=b.allKeys(a),r=y(e,n)):(o=$(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var c=0,u=o.length;u>c;c++){var s=o[c],l=a[s];r(l,s,a)&&(i[s]=l)}return i},b.omit=function(t,e,n){if(b.isFunction(e))e=b.negate(e);else{var r=b.map($(arguments,!1,!1,1),String);e=function(t,e){return!b.contains(r,e)}}return b.pick(t,e,n)},b.defaults=x(b.allKeys,!0),b.create=function(t,e){var n=k(t);return e&&b.extendOwn(n,e),n},b.clone=function(t){return b.isObject(t)?b.isArray(t)?t.slice():b.extend({},t):t},b.tap=function(t,e){return e(t),t},b.isMatch=function(t,e){var n=b.keys(e),r=n.length;if(null==t)return!r;for(var o=Object(t),i=0;r>i;i++){var a=n[i];if(e[a]!==o[a]||!(a in o))return!1}return!0};var I=function P(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof b&&(t=t._wrapped),e instanceof b&&(e=e._wrapped);var o=f.call(t);if(o!==f.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var i="[object Array]"===o;if(!i){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,c=e.constructor;if(a!==c&&!(b.isFunction(a)&&a instanceof a&&b.isFunction(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),i){if(u=t.length,u!==e.length)return!1;for(;u--;)if(!P(t[u],e[u],n,r))return!1}else{var s,l=b.keys(t);if(u=l.length,b.keys(e).length!==u)return!1;for(;u--;)if(s=l[u],!b.has(e,s)||!P(t[s],e[s],n,r))return!1}return n.pop(),r.pop(),!0};b.isEqual=function(t,e){return I(t,e)},b.isEmpty=function(t){return null==t?!0:C(t)&&(b.isArray(t)||b.isString(t)||b.isArguments(t))?0===t.length:0===b.keys(t).length},b.isElement=function(t){return!(!t||1!==t.nodeType)},b.isArray=p||function(t){return"[object Array]"===f.call(t)},b.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},b.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){b["is"+t]=function(e){return f.call(e)==="[object "+t+"]"}}),b.isArguments(arguments)||(b.isArguments=function(t){return b.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(b.isFunction=function(t){return"function"==typeof t||!1}),b.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},b.isNaN=function(t){return b.isNumber(t)&&t!==+t},b.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===f.call(t)},b.isNull=function(t){return null===t},b.isUndefined=function(t){return void 0===t},b.has=function(t,e){return null!=t&&d.call(t,e)},b.noConflict=function(){return i._=a,this},b.identity=function(t){return t},b.constant=function(t){return function(){return t}},b.noop=function(){},b.property=function(t){return function(e){return null==e?void 0:e[t]}},b.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},b.matcher=b.matches=function(t){return t=b.extendOwn({},t),function(e){return b.isMatch(e,t)}},b.times=function(t,e,n){var r=Array(Math.max(0,t));e=y(e,n,1);for(var o=0;t>o;o++)r[o]=e(o);return r},b.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},b.now=Date.now||function(){return(new Date).getTime()};var S={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},U=b.invert(S),B=function(t){var e=function(e){return t[e]},n="(?:"+b.keys(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}};b.escape=B(S),b.unescape=B(U),b.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),b.isFunction(r)?r.call(t):r};var E=0;b.uniqueId=function(t){var e=++E+"";return t?t+e:e},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var R=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\u2028|\u2029/g,O=function(t){return"\\"+z[t]};b.template=function(t,e,n){!e&&n&&(e=n),e=b.defaults({},e,b.templateSettings);var r=RegExp([(e.escape||R).source,(e.interpolate||R).source,(e.evaluate||R).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,function(e,n,r,a,c){return i+=t.slice(o,c).replace(L,O),o=c+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),e}),i+="';\n",e.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(e.variable||"obj","_",i)}catch(c){throw c.source=i,c}var u=function(t){return a.call(this,t,b)},s=e.variable||"obj";return u.source="function("+s+"){\n"+i+"}",u},b.chain=function(t){var e=b(t);return e._chain=!0,e};var F=function(t,e){return t._chain?b(e).chain():e};b.mixin=function(t){b.each(b.functions(t),function(e){var n=b[e]=t[e];b.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),F(this,n.apply(b,t))}})},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=c[t];b.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],F(this,n)}}),b.each(["concat","join","slice"],function(t){var e=c[t];b.prototype[t]=function(){return F(this,e.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return b})}).call(this)}),define("src/modules/cookie/cookie",function(t,e){function n(t,e){var n={};if(r(t)&&t.length>0)for(var o,i,c,s=e?u:a,l=t.split(/;\s/g),m=0,f=l.length;f>m;m++){if(c=l[m].match(/([^=]+)=/i),c instanceof Array)try{o=u(c[1]),i=s(l[m].substring(c[1].length+1))}catch(d){}else o=u(l[m]),i="";o&&(n[o]=i)}return n}function r(t){return"string"==typeof t}function o(t){return r(t)&&""!==t}function i(t){if(!o(t))throw new TypeError("Cookie name must be a non-empty string")}function a(t){return t}var c=e,u=decodeURIComponent,s=encodeURIComponent;c.get=function(t,e){i(t),e="function"==typeof e?{converter:e}:e||{};var r=n(document.cookie,!e.raw);return(e.converter||a)(r[t])},c.set=function(t,e,n){i(t),n=n||{};var r=n.expires,a=n.domain,c=n.path;n.raw||(e=s(String(e)));var u=t+"="+e,l=r;return"number"==typeof l&&(l=new Date,l.setDate(l.getDate()+r)),l instanceof Date&&(u+="; expires="+l.toUTCString()),o(a)&&(u+="; domain="+a),o(c)&&(u+="; path="+c),n.secure&&(u+="; secure"),document.cookie=u,u},c.remove=function(t,e){return e=e||{},e.expires=new Date(0),this.set(t,"",e)}}),define("src/modules/util/util",function(require,exports,module){function _isEmptyStr(t){return String.prototype.trim?""===t.trim():""===t.replace(/^\s+/,"").replace(/\s+$/,"")}function _udb_decorateURL(t){if(_isEmptyStr(t)){t=top.location.href;var e=t.indexOf("#");return-1!=e&&(t=t.substring(0,e)),t}if(t.startsWith("http"))return t;var n="http://";return top.location.href.startsWith("https")&&(n="https://"),n+document.domain+t}function ensureUDBSDK(t){window.dwUDBProxy?t(window.dwUDBProxy):$.getScript("http://assets.dwstatic.com/common/js/dwudbproxy.js",function(){setTimeout(function(){t(window.dwUDBProxy)},500)})}function getParam(t){var e=function(t,e){var n=new RegExp("(^|!|&|\\?)"+t+"=([^&]*)(&|$)");if(r=e.match(n),null!=r)try{return decodeURIComponent(r[2])}catch(o){return console.log(o+"r[2]:"+r[2]),null}return null},n=document.location.hash.substr(2),o=e(t,n);return null==o&&(n=document.location.search.substr(1),o=e(t,n)),o}function secondToTime(t){var e=function(t){return 10>t?"0"+t:""+t},n=parseInt(t/60),r=parseInt(t-60*n);return e(n)+":"+e(r)}function browserVersion(){var BROWSER={},types={ie:"msie",firefox:"",chrome:"",opera:"",safari:"",mozilla:"",webkit:"",maxthon:"",qq:"qqbrowser"},USERAGENT=navigator.userAgent.toLowerCase(),other=1;for(i in types){var v=types[i]?types[i]:i;if(-1!=USERAGENT.indexOf(v)){var re=new RegExp(v+"(\\/|\\s)([\\d\\.]+)","ig"),matches=re.exec(USERAGENT),ver=null!=matches?matches[2]:0;other=0!==ver&&"mozilla"!=v?0:other}else var ver=0;eval("BROWSER."+i+"= ver")}BROWSER.other=other}var Cookie=require("src/modules/cookie/cookie"),loggedIn=!1,isLoggedIn=function(){return loggedIn||(loggedIn=Cookie.get("username")&&Cookie.get("password")&&Cookie.get("osinfo")),loggedIn},login=function(t){ensureUDBSDK(function(e){try{e.login(t||"")}catch(n){}})},logout=function(t){ensureUDBSDK(function(e){try{e.logout(t||"")}catch(n){}})},_isAdmin=null,REG_ADMIN=/^dw_[a-z]+/,_isAdmin=function(){return null==_isAdmin&&isLoggedIn()&&(_isAdmin=REG_ADMIN.test(Cookie.get("username")||"")),_isAdmin||!1},parseDate=function(t){return new Date(1e3*parseInt(t,10))},getFriendlyDateStr=function(t){var e=(new Date).getTime()-t.getTime(),n=6e4,r=60*n,o=24*r,i=30*o,a=12*i,c="";return n>e?c="刚刚":r>e?c=Math.floor(e/n)+"分钟前":o>e?c=Math.floor(e/r)+"小时前":i>e?c=Math.floor(e/o)+"天前":a>e?c=Math.floor(e/i)+"个月前":e>=a&&(c=Math.floor(e/a)+"年前"),c},getDateTomorrow=function(){var t=new Date;return t.setHours(0,0,0,0),new Date(t.getTime()+864e5)},getUserLink=function(t){return t&&"0"!=t?"http://bbs.duowan.com/space-uid-"+t+".html":"#"},jqWindow=$(window),scrollIntoView=function(t){var e=$(t);if(e.is(":visible")){var n,r=36,o=e.offset().top,i=jqWindow.scrollTop();i+r>o&&(n=o-r),null!=n&&jqWindow.scrollTop(n)}},isInView=function(t){var e=36,n=t.offsetParent(),r=n.scrollTop()||0;return t.offset().top<jqWindow.scrollTop()+jqWindow.innerHeight()+(r?r:r+e)},lazyLoad=function(t,e){function n(){r||isInView(t)&&(jqWindow.off("scroll resize",n),o.off("scroll",n),r=!0,e(t))}var r=!1,o=t.offsetParent();jqWindow.on("scroll resize",n),o.on("scroll",n),n()};module.exports.isLoggedIn=isLoggedIn,module.exports.login=login,module.exports.logout=logout,module.exports.isAdmin=_isAdmin,module.exports.parseDate=parseDate,module.exports.getFriendlyDateStr=getFriendlyDateStr,module.exports.getDateTomorrow=getDateTomorrow,module.exports.getUserLink=getUserLink,module.exports.scrollIntoView=scrollIntoView,module.exports.isInView=isInView,module.exports.lazyLoad=lazyLoad,module.exports.getParam=getParam,module.exports.secondToTime=secondToTime,module.exports.browserVersion=browserVersion}),define("src/modules/request/comment",function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=t("src/modules/underscore/underscore"),a=t("src/modules/cookie/cookie"),c=t("src/modules/util/util"),u="cmtagr",s="cmtdagr",l=function(){function t(e){r(this,t),this.domain=e.domain,this.url=e.url}return o(t,[{key:"getData",value:function(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r="http://comment3.duowan.com/index.php";window.location,e||(e={}),e.domain=n.domain||this.domain,e.url=n.url||this.url;var o=$.Deferred();return $.ajax({url:r+"?r="+t,data:e,dataType:"jsonp"}).done(function(){o.resolveWith(this,arguments)}).fail(function(){o.rejectWith(this,arguments)}),setTimeout(function(){o.notify("timeout")},1e4),o}},{key:"totaljson",value:function(t){return this.getData("comment/totaljson",t?{uniqid:t}:null)}},{key:"getLoginInfo",value:function(){return this.getData("default/login",null)}},{key:"setNickname",value:function(t){return this.getData("default/nickname",{nickname:t},{domain:!0})}},{key:"addComment",value:function(t,e,n,r){var o={uniqid:t};return o[e]=n,r&&(o.parent_id=r),o.title=document.title,this.getData("comment/add",o)}},{key:"preaudit",value:function(t){return this.getData("comment/peraudit",{uniqid:t},{domain:!0,url:!0})}},{key:"comments",value:function(t,e,n){var r={order:e||"time",noimg:!0};return t&&(r.uniqid=t),n&&(r.num=n),this.getData("comment/comment",r).then(function(t){return i.each(t,function(t){a.get(u+t.comment_id)&&(t.agreed=!0),a.get(s+t.comment_id)&&(t.disagreed=!0)}),t})}},{key:"moreReplies",value:function(t,e,n,r){return this.getData("comment/reply",{parent_id:e,uniqid:t,create:n,flag_id:r})}},{key:"agree",value:function(t,e){return this.getData("comment/support",{uniqid:t,cid:e}).then(function(t){return t.vote>0?a.set(u+e,1,{expires:c.getDateTomorrow()}):t.vote<0&&a.remove(u+e),t})}},{key:"disagree",value:function(t,e){return this.getData("comment/oppose",{uniqid:t,cid:e},{domain:!0,url:!0}).then(function(t){return t.vote>0?a.set(s+e,1,{expires:c.getDateTomorrow()}):t.vote<0&&a.remove(s+e),t})}},{key:"tuCao",value:function(t){return this.getData("comment/tucao",{uniqid:t})}},{key:"addTuCao",value:function(t,e,n){var r={uniqid:t};return r[e]=n,r.title=document.title,this.getData("comment/addtucao",r)}},{key:"tuCaoVote",value:function(t,e){return this.getData("comment/tucaovote",{uniqid:t,tucao_id:e},{domain:!0,url:!0})}},{key:"del",value:function(t,e){return this.getData("default/delComment",{id:t,uniqid:e},{domain:!0,url:!0})}}]),t}();n.exports=l}),define("src/modules/article/articleCommentFlex",function(require,exports,module){function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),RequestComment=require("src/modules/request/comment"),Util=require("src/modules/util/util"),_=require("src/modules/underscore/underscore"),articleCommentTpl=function(obj){var __p="";with(Array.prototype.join,obj||{})__p+='<!--发表评论{-->\r\n<div class="fixed-comment-area">\r\n <textarea class="comment-textarea" id="writeCommentArea" placeholder="请输入评论..."></textarea>\r\n <button class="emit-comment" data-cid="">发布</button>\r\n</div>\r\n<!--}发表评论-->\r\n<div class="fixed-shade"></div>';return __p},articleCommentNumTpl=function(obj){var __p="";with(Array.prototype.join,obj||{})__p+='<h3 class="sec-common-header">\r\n 评论\r\n <label class="comment-num"></label>\r\n ',hasCmtBtn||(__p+='\r\n <span class="towrite-comment">评论一下</span>\r\n '),__p+="\r\n</h3>";return __p},commentListTmp=function(obj){var __t,__p="";with(Array.prototype.join,obj||{}){if(__p+='<ul class="comment-list" id="commentList">\r\n ',_.each(cmtList,function(t){__p+='\r\n <li class="comment-list__item one-level-comment">\r\n <div class="self-comment comment-wrap">\r\n <section class="user-info__wrap">\r\n <a href="'+(null==(__t="0"==t.bbs_uid?"#":Util.getUserLink(t.bbs_uid))?"":__t)+'" class="user-info">\r\n <img src="'+(null==(__t=t.user_img_min||"http://att.bbs.duowan.com/avatar/noavatar_small.jpg")?"":__t)+'" onerror="this.onerror=null;this.src=\'http://att.bbs.duowan.com/avatar/noavatar_small.jpg\'" class="user-icon"/>\r\n <label class="user-name">'+(null==(__t=t.udb_name)?"":__t)+'</label>\r\n </a>\r\n <i class="comment-time">'+(null==(__t=Util.getFriendlyDateStr(Util.parseDate(1*t.created)))?"":__t)+'</i>\r\n </section>\r\n <section class="comment-content">\r\n '+(null==(__t=t.contents)?"":__t)+'\r\n </section>\r\n <section class="op-btn one-level">\r\n <button type="button" class="btn-agree '+(null==(__t=localStorage.getItem(t.comment_id)?"have-agree":"")?"":__t)+'" data-cid="'+(null==(__t=t.comment_id)?"":__t)+'">'+(null==(__t=t.count_vote||t.vote)?"":__t)+'</button>\r\n <button type="button" class="btn-reply" data-cid="'+(null==(__t=t.comment_id)?"":__t)+'">回复</button>\r\n </section>\r\n </div>\r\n <ul class="comment-list other-comment">\r\n ',t.reply&&_.each(t.reply,function(e){__p+='\r\n <li class="comment-list__item">\r\n <div class="comment-wrap">\r\n <section class="user-info__wrap">\r\n <a href="'+(null==(__t=" 0 "==e.bbs_uid?"#":Util.getUserLink(e.bbs_uid))?"":__t)+'" class="user-info">\r\n <img src="'+(null==(__t=e.user_img_min||"http://att.bbs.duowan.com/avatar/noavatar_small.jpg")?"":__t)+'" onerror="this.onerror=null;this.src=\'http://att.bbs.duowan.com/avatar/noavatar_small.jpg\'" class="user-icon"/>\r\n <label class="user-name">'+(null==(__t=e.udb_name)?"":__t)+'</label>\r\n </a>\r\n <i class="comment-time">'+(null==(__t=Util.getFriendlyDateStr(Util.parseDate(1*e.created)))?"":__t)+'</i>\r\n </section>\r\n <section class="comment-content">\r\n '+(null==(__t=e.contents)?"":__t)+'\r\n </section>\r\n <section class="op-btn two-level">\r\n <button type="button" class="btn-reply" data-cid="'+(null==(__t=t.comment_id)?"":__t)+'">回复</button>\r\n </section>\r\n </div>\r\n </li>\r\n '}),__p+="\r\n </ul>\r\n ",parseInt(t.comment_reply_total)>3&&(__p+='\r\n <a class="show-more-comments" data-morereply="'+(null==(__t=[t.comment_id,t.lastR.created,t.lastR.comment_id].join("|"))?"":__t)+'">还有'+(null==(__t=parseInt(t.comment_reply_total)-3)?"":__t)+"条回复,点击查看</a>\r\n "),__p+="\r\n </li>\r\n\r\n "}),__p+="\r\n</ul>\r\n","undefined"==typeof minLength)var minLength=10;cmtList.length==minLength?__p+='\r\n <a href="'+(null==(__t="undefined"==typeof morehref?"#":morehref)?"":__t)+'" class="common-look-more" data-num="10">\r\n '+(null==(__t="undefined"==typeof isCommentPge?"发表或查看更多评论":"展开更多评论")?"":__t)+" \r\n</a>\r\n":0==cmtList.length&&(__p+='\r\n <p class="no-comment">暂无评论,抢个沙发吧~</p>\r\n'),__p+=""}return __p},oneLevelCmtTmp=function(obj){var __t,__p="";with(Array.prototype.join,obj||{})__p+='<li class="comment-list__item one-level-comment">\r\n <div class="self-comment comment-wrap">\r\n <section class="user-info__wrap">\r\n <a href="'+(null==(__t="0"==cmt.bbs_uid?"#":Util.getUserLink(cmt.bbs_uid))?"":__t)+'" class="user-info">\r\n <img src="'+(null==(__t=userInfo.avatar||"http://att.bbs.duowan.com/avatar/noavatar_small.jpg")?"":__t)+'" class="user-icon" onerror="this.onerror=null;this.src=\'http://att.bbs.duowan.com/avatar/noavatar_small.jpg\'"/>\r\n <label class="user-name">'+(null==(__t=cmt.username)?"":__t)+'</label>\r\n </a>\r\n <i class="comment-time">'+(null==(__t="刚刚")?"":__t)+'</i>\r\n </section>\r\n <section class="comment-content">\r\n '+(null==(__t=cmt.content)?"":__t)+'\r\n </section>\r\n <section class="op-btn one-level">\r\n <button type="button" class="btn-agree '+(null==(__t=localStorage.getItem(cmt.cid)?"have-agree":"")?"":__t)+'" data-cid="'+(null==(__t=cmt.cid)?"":__t)+'">'+(null==(__t=0)?"":__t)+'</button>\r\n <button type="button" class="btn-reply" data-cid="'+(null==(__t=cmt.cid)?"":__t)+'">回复</button>\r\n </section>\r\n </div>\r\n <ul class="comment-list other-comment">\r\n </ul>\r\n</li>';
  2. return __p},twoLevelCmtTmp=function(obj){var __t,__p="";with(Array.prototype.join,obj||{})__p+='<li class="comment-list__item">\r\n <div class="comment-wrap">\r\n <section class="user-info__wrap">\r\n <a href="'+(null==(__t="0"==cmt.bbs_uid?"#":Util.getUserLink(cmt.bbs_uid))?"":__t)+'" class="user-info">\r\n <img src="'+(null==(__t=userInfo.avatar||"http://att.bbs.duowan.com/avatar/noavatar_small.jpg")?"":__t)+'" \r\n onerror="this.onerror=null;this.src=\'http://att.bbs.duowan.com/avatar/noavatar_small.jpg\'"\r\n class="user-icon" />\r\n <label class="user-name">'+(null==(__t=cmt.username)?"":__t)+'</label>\r\n </a>\r\n <i class="comment-time">'+(null==(__t="刚刚")?"":__t)+'</i>\r\n </section>\r\n <section class="comment-content">\r\n '+(null==(__t=cmt.content)?"":__t)+'\r\n </section>\r\n <section class="op-btn two-level">\r\n <button type="button" class="btn-reply" data-cid="'+(null==(__t=cmt.cid)?"":__t)+'">回复</button>\r\n </section>\r\n </div>\r\n</li>';return __p},loadMoreRepliesTmp=function(obj){var __t,__p="";with(Array.prototype.join,obj||{})__p+="",_.each(moreReplies,function(t,e){2>=e||(__p+='\r\n <li class="comment-list__item">\r\n <div class="comment-wrap">\r\n <section class="user-info__wrap">\r\n <a href="'+(null==(__t="0"==t.bbs_uid?"#":Util.getUserLink(t.bbs_uid))?"":__t)+'" class="user-info">\r\n <img src="'+(null==(__t=t.user_img_min||"http://att.bbs.duowan.com/avatar/noavatar_small.jpg")?"":__t)+'" \r\n onerror="this.onerror=null;this.src=\'http://att.bbs.duowan.com/avatar/noavatar_small.jpg\'"\r\n class="user-icon" />\r\n <label class="user-name">'+(null==(__t=t.username)?"":__t)+'</label>\r\n </a>\r\n <i class="comment-time">'+(null==(__t=Util.getFriendlyDateStr(Util.parseDate(1*t.created)))?"":__t)+'</i>\r\n </section>\r\n <section class="comment-content">\r\n '+(null==(__t=t.contents)?"":__t)+'\r\n </section>\r\n <section class="op-btn two-level">\r\n <button type="button" class="btn-reply" data-cid="'+(null==(__t=t.comment_id)?"":__t)+'">回复</button>\r\n </section>\r\n </div>\r\n </li>\r\n ')}),__p+="";return __p},_css_="@charset \"UTF-8\";@media only screen and (min-width:320px){html{font-size:42.66667px}}@media only screen and (min-width:346px){html{font-size:46.13333px}}@media only screen and (min-width:360px){html{font-size:48px}}@media only screen and (min-width:375px){html{font-size:50px}}@media only screen and (min-width:384px){html{font-size:51.2px}}@media only screen and (min-width:390px){html{font-size:52px}}@media only screen and (min-width:393px){html{font-size:52.4px}}@media only screen and (min-width:400px){html{font-size:53.33333px}}@media only screen and (min-width:412px){html{font-size:54.93333px}}@media only screen and (min-width:414px){html{font-size:55.2px}}@media only screen and (min-width:432px){html{font-size:57.6px}}.common-comment{margin-top:.42667rem}.common-comment .comment-type-nav{padding:0 .53333rem .64rem}.common-comment .comment-type-nav .comment-type{line-height:.93867rem;padding:0 .32rem;background-color:transparent}.common-comment .comment-type-nav .comment-type.active{color:#fff;background-color:#e94647}.common-comment .comment-list-wrap{display:none}.common-comment .comment-list-wrap.active{display:block}.common-comment .no-comment{text-align:center;line-height:1.70667rem}.common-comment .comment-num{display:block;margin-left:.64rem;color:#e94647;font-size:12px}.common-comment .comment-list__item{padding-bottom:.42667rem;border-bottom:1px solid #e9e9e9}.common-comment .comment-list__item:last-child{border-bottom:0}.common-comment .comment-list__item .comment-wrap{overflow:hidden}.common-comment .self-comment{padding:0 .53333rem}.common-comment .other-comment{padding:0 .53333rem;margin:.53333rem .53333rem 0 1.74933rem;background-color:#f7f7f7}.common-comment .show-more-comments{display:block;margin:0 .53333rem 0 1.74933rem;line-height:1.06667rem;border-top:1px solid #e9e9e9;background-color:#f7f7f7;text-align:center}.common-comment .user-info__wrap{display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-pack:justify;-webkit-box-align:center;padding:.42667rem 0;color:#666}.common-comment .user-info__wrap .user-info{display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:center}.common-comment .user-info__wrap .user-icon{display:block;width:1.152rem;height:1.152rem;border-radius:50%}.common-comment .user-info__wrap .user-name{margin-left:.55467rem}.common-comment .user-info__wrap .comment-time{display:block}.common-comment .comment-content{padding-left:1.70667rem;line-height:1.4}.common-comment .op-btn{display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-pack:end;-webkit-box-align:center}.common-comment .op-btn button{display:block;height:.93867rem;box-sizing:content-box;padding:0 .21333rem;border:1px solid #e9e9e9;border-radius:2px;background-color:transparent;outline:0;line-height:.93867rem;margin-left:.64rem;font-size:12px;color:#999}.common-comment .op-btn button:before{content:'';display:inline-block;vertical-align:top;height:100%}.common-comment .op-btn button.have-agree{background:#e94647;color:#fff}.common-comment .op-btn.one-level{margin:.42667rem 0 .53333rem}.common-comment .op-btn.one-level .btn-reply:before{width:.64rem;margin-right:.21333rem;background:url(http://pub.dwstatic.com/p/2017dwh5/1.1.0/img/reply_icon_9abf804.png) no-repeat center;background-size:100% auto}.common-comment .op-btn.two-level{margin:.42667rem 0 .21333rem}.common-comment .op-btn.two-level .btn-reply{border:0;color:#e94647}.common-comment .op-btn .btn-agree:before{width:.53333rem;margin-right:.32rem;background:url(http://pub.dwstatic.com/p/2017dwh5/1.1.0/img/agree_icon_77543b6.png) no-repeat center;background-size:100% auto}.sec-common-header{position:relative;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:center;height:1.92rem;padding:0 .512rem;border-bottom:1px solid #e9e9e9;color:#333;font-size:15px;line-height:1.92rem}.sec-common-header:before{content:'';display:block;width:2px;height:.59733rem;margin-right:.21333rem;background:#e94647}.sec-common-header a{position:absolute;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:center;-webkit-box-pack:end;left:.512rem;top:0;right:.512rem;color:#999}.sec-common-header a.remove-arrow::after{display:none}.sec-common-header a:after{content:'';display:block;margin-left:.21333rem;width:8px;height:8px;border:1px solid #999;border-width:1px 1px 0 0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.sec-common-header .towrite-comment{position:absolute;right:.512rem;top:0;padding-left:.85333rem;color:#737373;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAfBAMAAAB0eNK/AAAABGdBTUEAALGPC/xhBQAAABtQTFRFmZmZmZmZmZmZmZmZmZmZmZmZmZmZAAAAmZmZfxByfQAAAAh0Uk5TIQwNIOBycwC93LH0AAAAhElEQVQoz4XRwQmAMAyF4Y7hBo7gVXCILiDo2UPjACoZ26Ta5qUezKGQjx96SKA6W36DwTx4SDx5WPkYEBIzjwirwNEbaMAXFBrwYlCDAjV4wYIXLHgAggcgyIBBBgwUXKDgAgEfCPiAQhNQ6BQiwC77SQ3EBjDIEB2UiwHQD+gvOB+4AUoC651Y9KO4AAAAAElFTkSuQmCC) left center no-repeat;background-size:.68267rem}.common-look-more{display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:center;-webkit-box-pack:center;height:1.87733rem;border-top:1px solid #e9e9e9;line-height:1.87733rem;color:#999}.common-look-more.is-loading:after{border-width:1px;-webkit-animation:turn-around .8s linear infinite;animation:turn-around .8s linear infinite}.common-look-more:after{content:'';display:block;margin-left:.32rem;width:8px;height:8px;border:1px solid #999;border-width:1px 1px 0 0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.fixed-comment-area{position:fixed;left:0;top:0;width:100%;padding:.42667rem .42667rem 1.57867rem;border:1px solid #e9e9e9;background-color:#fff;font-size:14px;line-height:18px;z-index:1000;-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:-webkit-transform .3s ease;transition:transform .3s ease}.fixed-comment-area.show{-webkit-transform:translateY(0);transform:translateY(0)}.fixed-comment-area.bottom{bottom:0}.fixed-comment-area .comment-textarea{-webkit-appearance:none;-webkit-tap-highlight-color:transparent;display:block;width:100%;height:2.304rem;padding:0;box-sizing:content-box;resize:none;border:1px solid #e9e9e9;outline:0;font-size:14px;line-height:24px;color:#333;border-radius:3px;background-color:#f4f4f4}.fixed-comment-area .emit-comment{position:absolute;right:0;bottom:.32rem;height:.93867rem;padding:0 .64rem;margin-right:.42667rem;background-color:#e94647;color:#fff}.fixed-shade{position:fixed;left:0;right:0;top:0;height:5000px;background-color:rgba(0,0,0,.35);z-index:999;display:none}.fixed-shade.active{display:block}",prevent=function(t){t.preventDefault()},DwArticleComment=function(){function t(){var e=this;_classCallCheck(this,t),this.ReqComment=new RequestComment({domain:location.hostname.replace("cn","com"),url:location.pathname}),this.userInfo={},this.totalJson,this.$comment=$(".common-comment"),this.$currentCmtBtn,this.ts="#uniq_article_title",this.renderComment(function(){e.$fixedCommentArea=$(".fixed-comment-area"),e.$writeComment=e.$fixedCommentArea.children(".comment-textarea"),e.$emitComment=e.$fixedCommentArea.children(".emit-comment"),e.$fixedShade=$(".fixed-shade"),e.init()})}return _createClass(t,[{key:"init",value:function(){var t=this,e=this.ReqComment,n=this;this.setReplyBtn().setAgreeBtn().setInputFit().loadMoreReplies().getUserinfo(),$.when(e.totaljson(comment3Uniqid),e.comments(comment3Uniqid,"hot")).done(function(t,e){"success"==t[1]&&(n.totalJson=t[0].show),e instanceof Array&&(e.forEach(function(t){if(parseInt(t.comment_reply_total)>3){var e=t.reply.length;t.lastR=t.reply[e-1]}}),e=e.slice(0,3),n.render(n.totalJson,e))}),this.$fixedShade.on("click",function(){t.$fixedShade.removeClass("active"),t.$fixedShade[0].$curEle.removeClass("show"),t.$writeComment.val(""),$("body").off("touchmove",prevent)}),this.$fixedShade.on("touchmove",prevent)}},{key:"renderComment",value:function(t){var e=$("<style>");e.html(_css_).appendTo(this.$comment);var n=$(".towrite-comment").length;return this.$comment.append($(articleCommentNumTpl({hasCmtBtn:n}))).append($(articleCommentTpl())),setTimeout(function(){t&&t()},200),this}},{key:"getUserinfo",value:function(){var t=this;return Util.isLoggedIn()&&this.ReqComment.getLoginInfo().done(function(e){t.userInfo=e&&e.login_info}),this}},{key:"render",value:function(t,e){var n=this;$(".comment-num").text(t.total_num),this.$comment.append(commentListTmp({cmtList:e,morehref:"http://www.duowan.com/mComment/index.html?domain=www.duowan.com&url="+location.pathname+"&uniqid="+comment3Uniqid+"&title="+$(n.ts).eq(0).text(),minLength:3}))}},{key:"setAgreeBtn",value:function(){var t=this;return $("body").on("click",".btn-agree",function(){var e=this,n=$(this).data("cid");t.ReqComment.agree(comment3Uniqid,n).done(function(t){t.rs&&(1==t.vote?($(e).addClass("have-agree").text(1*$(e).text()+1),localStorage.setItem(n,1)):($(e).removeClass("have-agree").text(1*$(e).text()-1),localStorage.removeItem(n)))}).fail(function(){})}),this}},{key:"setReplyBtn",value:function(){var t=this;return $("body").on("click",".btn-reply,.towrite-comment",function(e){t.$fixedCommentArea.addClass("show"),t.$fixedShade.addClass("active"),t.$fixedShade[0].$curEle=t.$fixedCommentArea,t.$writeComment.focus(),t.$emitComment.attr("data-cid",$(this).data("cid")?$(this).data("cid"):""),t.$currentCmtBtn=$(this),$("#toTop").css("display","none"),t.$fixedShade.css({width:"100%",height:$(document).height()}),$("body").on("touchmove",prevent),e.preventDefault()}),this.$emitComment.click(function(){dwUDBBind.isBind().done(function(){t.addComment()})}),this}},{key:"addComment",value:function(){var t=this.totalJson.content_key,e=this.$writeComment.val(),n=this.$emitComment.data("cid")||0,r=this;if(""!=$.trim(e)){var o=this.$currentCmtBtn.data("cid")?2:1;if(2==o){var i=this.$currentCmtBtn.closest(".comment-list__item").children(".comment-wrap");e=e+"//"+i.find(".user-name").text()+":"+i.find(".comment-content").text()}this.ReqComment.addComment(comment3Uniqid,t,e,n).done(function(t){if(t.rs){var e=2==o?$(r.$currentCmtBtn).closest(".one-level-comment").find(".other-comment"):$("#commentList"),n=2==o?twoLevelCmtTmp:oneLevelCmtTmp,i=$(n({cmt:t,userInfo:r.userInfo}));e.prepend(i),$(".no-comment").remove(),$(".comment-num").each(function(t,e){$(e).text(1*$(e).text()+1)}),$("html,body").animate({scrollTop:i.offset().top-$(window).height()/2+"px"},1e3)}else lib.showTip(t.msg)})}this.$fixedShade.click()}},{key:"loadMoreReplies",value:function(){var t=this;return this.$comment.on("click",".show-more-comments",function(e){var n=$(this),r=n.data("morereply").split("|"),o=n.parent().children(".other-comment");n.hasClass("loaded")?"收起回复"==n.text()?($(o[0].$addEle).slideUp(),n.text("查看更多")):($(o[0].$addEle).slideDown(),n.text("收起回复")):t.ReqComment.moreReplies(comment3Uniqid,r[0],r[1],r[2]).done(function(t){var e=$(loadMoreRepliesTmp({moreReplies:t}));o[0].$addEle=e,o.append(e),n.addClass("loaded"),n.text("收起回复")}),e.preventDefault()}),this}},{key:"setInputFit",value:function(){var t=this.$writeComment.height(),e=5*parseInt(this.$writeComment.css("lineHeight").slice(0,-2));return this.$writeComment.on("input",function(){var n=this.scrollHeight;n>e?$(this).css("height",t).css("height",e+"px"):$(this).css("height",t).css("height",n+"px")}),this}}]),t}();$(function(){$.getScript("http://pub.dwstatic.com/common/dwUDBBind/dwUDBBind.js",function(){new DwArticleComment})})});