/** * Duoshuo UA Plugin - 精简版 * 此版本不集成ua-parser,需要自行设置getUAString * @version v1.0.5 * @license MIT * @author Gerald */ !function(){function t(t){return""}function e(t,e){u||(u=duoshuoQuery.myIds||[],u.slice||(u=[u]),u.reverse());var n=e[0];1==e.length&&(n=n.post),t.agent=n.agent,t.webmaster=0;for(var r=n.author_id,i=u.length;i--;)if(u[i]==r){t.webmaster=r;break}}function n(e,n){var r=e.result,i=r.indexOf('
'),s=r.indexOf("
",i),u=duoshuoQuery.getUAString||a.getUAString||t;e.result=r.slice(0,s)+u.call(a,e)+r.slice(s)}function r(){var t=DUOSHUO.templates.post;DUOSHUO.templates.post=function(){var r={},i=arguments;return e.call(this,r,i),r.result=t.apply(this,i),n.call(this,r,i),r.result}}function i(t,e,n){function r(){var t=n;t&&(n=null,t())}var i;t[e]?r():Object.defineProperty(t,e,{get:function(){return i},set:function(t){i=t,r()},configurable:!0})}function s(t,e,n){function r(){i(t,s,function(){t=t[s],(s=e.shift())?r():n()})}var s=e.shift();r()}var u,a=this;s(window,["DUOSHUO","templates","post"],r)}.call({});