1 |
- !function(){function r(r,e){var i={};return e.forEach(function(e,n){var t=r[n+1];Array.isArray(e)?i[e[0]]="function"==typeof e[1]?e[1](t,e[2]):e[1]:i[e]=t}),i}function e(e){var i,n,t={};for(i in f)n=f[i],n.some(function(n){var o=n[0],s=n[1],a=null;return Array.isArray(o)?o.some(function(r){return a=e.match(r)}):a=e.match(o),a&&(t[i]=r(a,s)),a});return t}function i(r){var e=r.agent,i=function(r){var e=r.name;return r.version&&(e+=" "+r.version),e};return'<div class="ds-os">'+i(e.os)+'</div><div class="ds-br">'+i(e.browser)+"</div>"+(r.webmaster?"<div class=ds-webmaster>站长</div>":"")}function n(r,i){var n,t=i[0],o=duoshuoQuery.myIds||[];1==i.length&&(t=t.post),r.agent=e(t.agent),n=t.author_id,o.indexOf||(o=[o]),r.webmaster=o.indexOf(n)<0?0:n}function t(r){var e=r.result,n=e.indexOf('<div class="ds-comment-header">'),t=e.indexOf("</div>",n),o=duoshuoQuery.getUAString||i;r.result=e.slice(0,t)+o(r)+e.slice(t)}function o(){var r=DUOSHUO.templates.post;DUOSHUO.templates.post=function(){var e={},i=arguments;return n.call(this,e,i),e.result=r.apply(this,i),t.call(this,e,i),e.result},DUOSHUO.jQuery(".ds-thread-ua").removeClass("ds-thread-ua").addClass("ds-thread")}var s={reg:function(r,e){return r.replace(e[0],e[1])},str:function(r,e){return r in e?e[r]:e[""]},ieVer:function(r){return parseInt(r)+4}},a={winVer:{"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10",ARM:"RT","":"山寨版"}},u="name",d="version",c="cls",l=[c,"windows"],f={os:[[/(Windows Phone)(?: OS)? ?([^; )]*)/i,[u,d,l]],[/(Windows) ([^;)]*)/i,[u,[d,s.str,a.winVer],l]],[/\b(Windows)\b/i,[u,[d,"超级山寨版"],l]],[/(iPhone|iPod|iPad|Mac OS X)/i,[u,[c,"mac"]]],[/(Android) ?([^; )]*)/i,[u,d,[c,"android"]]],[/(Linux)/i,[u,[c,"linux"]]],[/()/i,[[u,"山寨操作系统"],[c,"other"]]]],browser:[[/(Opera Mini)\/(\d+)/i,[u,d]],[[/(OPR)\/(\S+)/i,/(Presto)\/.*?Version\/(\S+)/i],[[u,"Opera"],d]],[[/(Maxthon)\/(\S+)/i,/(Vivaldi)\/(\S+)/i,/(Chrome)\/(\S+)/i],[u,d]],[/(UC|QQ)Browser\/(\S+)/i,[[u,s.reg,[/$/,"浏览器"]],d]],[/Version\/(\S+) .*?(Safari)\//i,[d,u]],[/(Firefox)\/(\S+)/i,[u,d]],[/MS(IE) (\d+)\.0/i,[[u,"Internet Explorer"],d]],[/(Trident)\/(\d+)\.0/i,[[u,"Internet Explorer"],[d,s.ieVer]]],[/()/i,[[u,"山寨浏览器"]]]]},v=duoshuoQuery.ondomready;duoshuoQuery.ondomready=function(){v&&v(),o()}}();
|