/* sohutv 2020-10-20 15:42:46 */ "undefined"!=typeof dojo?dojo.provide("org.cometd"):(this.org=this.org||{},org.cometd={}),org.cometd.JSON={},org.cometd.JSON.toJSON=org.cometd.JSON.fromJSON=function(e){throw"Abstract"},org.cometd.Utils={},org.cometd.Utils.isString=function(e){return void 0!==e&&null!==e&&("string"==typeof e||e instanceof String)},org.cometd.Utils.isArray=function(e){return void 0!==e&&null!==e&&e instanceof Array},org.cometd.Utils.inArray=function(e,t){for(var n=0;n0;){var t=d[0],n=t[0],i=t[1];{if(n.url!==e.url||n.sync!==e.sync)break;d.shift(),e.messages=e.messages.concat(n.messages),this._debug("Coalesced",n.messages.length,"messages from request",i.id)}}}function t(e,t){if(this.transportSend(e,t),t.expired=!1,!e.sync){var n=this.getConfiguration().maxNetworkDelay,i=n;!0===t.metaConnect&&(i+=this.getAdvice().timeout),this._debug("Transport",this.getType(),"waiting at most",i,"ms for the response, maxNetworkDelay",n);var s=this;t.timeout=this.setTimeout(function(){t.expired=!0,t.xhr&&t.xhr.abort();var n="Request "+t.id+" of transport "+s.getType()+" exceeded "+i+" ms max network delay";s._debug(n),s.complete(t,!1,t.metaConnect),e.onFailure(t.xhr,e.messages,"timeout",n)},i)}}function n(e){var n=++c,i={id:n,metaConnect:!1};u.length=0&&u.splice(s,1),d.length>0){var o=d.shift(),a=o[0],r=o[1];if(this._debug("Transport dequeued request",r.id),i)this.getConfiguration().autoBatch&&e.call(this,a),n.call(this,a),this._debug("Transport completed request",t.id,a);else{var c=this;this.setTimeout(function(){c.complete(r,!1,r.metaConnect),a.onFailure(r.xhr,a.messages,"error","Previous request failed")},0)}}}function o(e){if(null!==l)throw"Concurrent metaConnect requests not allowed, request id="+l.id+" not yet completed";var n=++c;this._debug("Transport",this.getType(),"metaConnect send, request",n,"envelope",e);var i={id:n,metaConnect:!0};t.call(this,e,i),l=i}var a=new org.cometd.Transport,r=org.cometd.Transport.derive(a),c=0,l=null,u=[],d=[];return r.complete=function(e,t,n){n?i.call(this,e):s.call(this,e,t)},r.transportSend=function(e,t){throw"Abstract"},r.transportSuccess=function(e,t,n){t.expired||(this.clearTimeout(t.timeout),this.complete(t,!0,t.metaConnect),n&&n.length>0?e.onSuccess(n):e.onFailure(t.xhr,e.messages,"Empty HTTP response"))},r.transportFailure=function(e,t,n,i){t.expired||(this.clearTimeout(t.timeout),this.complete(t,!1,t.metaConnect),e.onFailure(t.xhr,e.messages,n,i))},r.send=function(e,t){t?o.call(this,e):n.call(this,e)},r.abort=function(){a.abort();for(var e=0;e0;){var a=org.cometd.JSON.toJSON(e.messages.slice(i,i+s)),r=e.url.length+encodeURI(a).length;if(r>2e3){if(1===s){var c="Bayeux message too big ("+r+" bytes, max is 2000) for transport "+this.getType();return void this.setTimeout(function(){n.transportFailure(e,t,"error",c)},0)}--s}else o.push(s),i+=s,s=e.messages.length-i}var l=e;if(o.length>1){var u=0,d=o[0];this._debug("Transport",this.getType(),"split",e.messages.length,"messages into",o.join(" + ")),l=this._mixin(!1,{},e),l.messages=e.messages.slice(u,d),l.onSuccess=e.onSuccess,l.onFailure=e.onFailure;for(var h=1;h=0){c=!0,v.splice(m,1);var b=l[g][0],y=l[g][1];delete l[g],v.length>0&&(l[v.join(",")]=[b,y]);break}}}c&&this._debug("Transport",this.getType(),"removed envelope, envelopes",l),s.call(this,n),t&&d.close(1e3,"Disconnect")},a.onClose=function(e,t){this._debug("Transport",this.getType(),"closed",e,t,d),r=c;for(var n in u)this.clearTimeout(u[n]);u={};for(var i in l){var s=l[i][0];l[i][1]&&(p=!1),s.onFailure(d,s.messages,"closed "+e+"/"+t)}l={},null!==d&&h&&d.close(1e3,"Close"),h=!1,d=null},a.registered=function(e,t){o.registered(e,t),i=t},a.accept=function(e,t,n){return r&&!!org.cometd.WebSocket&&!0===i.websocketEnabled},a.send=function(e,t){this._debug("Transport",this.getType(),"sending",e,"metaConnect =",t);for(var i=[],s=0;s0)ee._info("Appending message type to URI "+s+o+" is not supported, disabling 'appendMessageTypeToURL' configuration"),me.appendMessageTypeToURL=!1;else{var a=s.split("/"),r=a.length-1;s.match(/\/$/)&&(r-=1),a[r].indexOf(".")>=0&&(ee._info("Appending message type to URI "+s+" is not supported, disabling 'appendMessageTypeToURL' configuration"),me.appendMessageTypeToURL=!1)}}function o(){for(var e in ue)for(var t=ue[e],n=0;n",e),se=e)}function r(){return"disconnecting"===se||"disconnected"===se}function c(){return++oe}function l(e,t,i,s,o){try{return t.call(e,s)}catch(e){ee._debug("Exception during execution of extension",i,e);var a=ee.onExtensionException;if(n(a)){ee._debug("Invoking extension exception callback",i,e);try{a.call(ee,e,i,o,s)}catch(e){ee._info("Exception during execution of exception callback in extension",i,e)}}return s}}function u(e){for(var t=0;t0)for(var s=0;s0;--s){var o=n.slice(0,s).join("/")+"/*";s===i&&h(o,t),o+="*",h(o,t)}}function f(){null!==he&&org.cometd.Utils.clearTimeout(he),he=null}function g(e){f();var t=fe.interval+de;ee._debug("Function scheduled in",t,"ms, interval =",fe.interval,"backoff =",de,e),he=org.cometd.Utils.setTimeout(ee,e,t)}function v(e,t,n,i){for(var s=0;s0||!0===le?ce.push(e):v(!1,[e],!1)}function b(){de=0}function y(){de0&&v(!1,e,!1)}function w(){if(--re<0)throw"Calls to startBatch() and endBatch() are not paired";0===re&&!r()&&!le&&x()}function T(){if(!r()){var e={channel:"/meta/connect",connectionType:Z.getType()};ve||(e.advice={timeout:0}),a("connecting"),ee._debug("Connect sent",e),v(!1,[e],!0,"connect"),a("connected")}}function _(){a("connecting"),g(function(){T()})}function C(e){e&&(fe=ee._mixin(!1,{},me.advice,e),ee._debug("New advice",fe))}function S(e){f(),e&&Z.abort(),ae=null,a("disconnected"),re=0,b(),ce.length>0&&(ye.call(ee,void 0,ce,"error","Disconnected"),ce=[])}function U(e){ae=null,o(),r()?(ie.reset(),C(me.advice)):C(ee._mixin(!1,fe,{reconnect:"retry"})),re=0,le=!0,X=e;var t="1.0",n=ie.findTransportTypes(t,ne,me.url),i={version:t,minimumVersion:"0.9",channel:"/meta/handshake",supportedConnectionTypes:n,advice:{timeout:fe.timeout,interval:fe.interval}},s=ee._mixin(!1,{},X,i);Z=ie.negotiateTransport(n,t,ne,me.url),ee._debug("Initial transport is",Z.getType()),a("handshaking"),ee._debug("Handshake sent",s),v(!1,[s],!1,"handshake")}function D(){a("handshaking"),le=!0,g(function(){U(X)})}function N(e){p("/meta/handshake",e),p("/meta/unsuccessful",e),r()||"none"===fe.reconnect?S(!1):(y(),D())}function L(e){if(e.successful){ae=e.clientId;var t=ie.negotiateTransport(e.supportedConnectionTypes,e.version,ne,me.url);if(null===t)throw"Could not negotiate transport with server; client "+ie.findTransportTypes(e.version,ne,me.url)+", server "+e.supportedConnectionTypes;Z!==t&&(ee._debug("Transport",Z,"->",t),Z=t),le=!1,x(),e.reestablish=ge,ge=!0,p("/meta/handshake",e);var n=r()?"none":fe.reconnect;switch(n){case"retry":b(),_();break;case"none":S(!1);break;default:throw"Unrecognized advice action "+n}}else N(e)}function R(e,t){N({successful:!1,failure:!0,channel:"/meta/handshake",request:t,xhr:e,advice:{reconnect:"retry",interval:de}})}function O(e){p("/meta/connect",e),p("/meta/unsuccessful",e);var t=r()?"none":fe.reconnect;switch(t){case"retry":_(),y();break;case"handshake":ie.reset(),b(),D();break;case"none":S(!1);break;default:throw"Unrecognized advice action"+t}}function B(e){if(ve=e.successful){p("/meta/connect",e);var t=r()?"none":fe.reconnect;switch(t){case"retry":b(),_();break;case"none":S(!1);break;default:throw"Unrecognized advice action "+t}}else O(e)}function H(e,t){ve=!1,O({successful:!1,failure:!0,channel:"/meta/connect",request:t,xhr:e,advice:{reconnect:"retry",interval:de}})}function M(e){S(!0),p("/meta/disconnect",e),p("/meta/unsuccessful",e)}function j(e){e.successful?(S(!1),p("/meta/disconnect",e)):M(e)}function I(e,t){M({successful:!1,failure:!0,channel:"/meta/disconnect",request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function P(e){p("/meta/subscribe",e),p("/meta/unsuccessful",e)}function $(e){e.successful?p("/meta/subscribe",e):P(e)}function E(e,t){P({successful:!1,failure:!0,channel:"/meta/subscribe",request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function A(e){p("/meta/unsubscribe",e),p("/meta/unsuccessful",e)}function W(e){e.successful?p("/meta/unsubscribe",e):A(e)}function J(e,t){A({successful:!1,failure:!0,channel:"/meta/unsubscribe",request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function F(e){p("/meta/publish",e),p("/meta/unsuccessful",e)}function q(e){void 0===e.successful?e.data?p(e.channel,e):ee._debug("Unknown message",e):e.successful?p("/meta/publish",e):F(e)}function K(e,t){F({successful:!1,failure:!0,channel:t.channel,request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function V(e){if(void 0!==(e=u(e))&&null!==e){C(e.advice);switch(e.channel){case"/meta/handshake":L(e);break;case"/meta/connect":B(e);break;case"/meta/disconnect":j(e);break;case"/meta/subscribe":$(e);break;case"/meta/unsubscribe":W(e);break;default:q(e)}}}function z(e){var t=ue[e];if(t)for(var n=0;n"):sohuHD.placeholder=$('
'),t.topbarBox.before(sohuHD.placeholder)}catch(e){_e(e)}var n=function(e,t,n){n=n||{cache:!0},messagebus.subscribe(e,t,null,null,n)},i="",s="",o="";n("com.sohu.login",function(){i="http://click.hd.sohu.com.cn/s.gif?type=pg_draw_menu&_="+t.random(),s="http://click.hd.sohu.com.cn/s.gif?type=pg_draw_order&_="+t.random(),o="http://click.hd.sohu.com.cn/s.gif?type=pg_draw_history_m&_="+t.random()}),n("com.sohu.logout",function(){i="",s="",o="http://click.hd.sohu.com.cn/s.gif?type=pg_draw_history_s&_="+t.random()});var a=function(){},r=function(){},c=function(){},l=function(){},u=function(){},d=function(){},h={opened:!1},p={opened:!1};$("body").delegate("#hd-fBox3>div.hd-fBtn","click",function(e){h.opened?l():f(),t.pingback(o),e.preventDefault()}),$("body").delegate("#hd-fBox2>div.hd-fBtn","click",function(e){p.opened?d():g(),s&&t.pingback(s),e.preventDefault()}),$("body").click(function(e){var n=e.target,i=!!$(n).parents("#hd-fBox3").length,s=!!$(n).parents("#hd-fBox2").length;h.opened&&!i&&l(),p.opened&&!s&&d(),"navLoginBt"!=n.id&&"hd-loginBtn"!=n.className||(t.showLoginWinbox(),e.preventDefault())});var f=function(){h=t.navhistory,h.init({container:$("#hd-fBox3")}),c=function(){$("#hd-fBox3").addClass("hd-fBoxVis"),h.open(),d(),r()},l=function(){$("#hd-fBox3").removeClass("hd-fBoxVis"),h.close()},c()},g=function(){p=t.navrss,p.init({container:$("#hd-fBox2")}),u=function(){$("#hd-fBox2").addClass("hd-fBoxVis"),p.open(),l(),r()},d=function(){$("#hd-fBox2").removeClass("hd-fBoxVis"),p.close()},u()};n("core.loaded_nav",function(){_e("load");var s=$("#gPassportCard");s.length||(s=$('
')),$("
").insertBefore($("body")),$("#hideForLoginBox").append(s),sohuHD.loginBox=s,s=s[0],s.unloginTmpl=['
','

\u767b\u5f55\u540e\u4eab\u53d7\u66f4\u591a\u670d\u52a1\uff1a','\u7a7a\u95f4','\u3001\u4e91\u8ff9','\u3001\u72d0\u6709\u793c','\u3001\u8ba2\u9605

','
','
','
',"

\u7528\u6237\u540d\uff1a",'','\u65b0\u7528\u6237\u6ce8\u518c',"

","

\u5bc6    \u7801\uff1a",'','\u5fd8\u8bb0\u5bc6\u7801',"

","

",'','','',"

","
",'
\u5408\u4f5c\u8d26\u53f7\u767b\u5f55\uff1a',sohuHD.returnThirdLoginTmpl(),"
"].join(""),s.loginTmpl=['
'].join("");var o=$("#gNewSearch");o.focus(function(){$(this).parent().addClass("text_click")}).blur(function(){$(this).parent().removeClass("text_click")}),sohuHD.focusClear($("#gNewSearch")),e.hidResult=sohuHD._searchInit(o,null,{type:$("#gNewSearch").width()>200?"normal":"mini"});var c=$("#navLocker");n("com.sohu.logout",function(){_e("logout"),t.user.passport="",c.html(['\u767b\u5f55','\u6ce8\u518c','','\u4e0a\u4f20'].join("")),t.navhistory&&t.navhistory.initialed&&(t.navhistory.initialed=!1)}),n("com.sohu.login",function(){_e("login"),t.user.passport=sohuHD.passport.getPassport();var e=sohuHD.user.passport.split("@")[0];c.html(['",'','','\u4e0a\u4f20'].join(""));var n=$("#newNavUserList"),s=$("#hd-fBox1");n.find("li").hover(function(){$(this).addClass("on")},function(){$(this).removeClass("on")}),a=function(){s.addClass("hd-fBoxVis"),n.show(),l(),d()},r=function(){s.removeClass("hd-fBoxVis"),n.hide()},$("#hd-fBox1>div.hd-fBtn").click(function(e){n.is(":visible")?r():a(),i&&t.pingback(i),e.preventDefault()}),$("body").click(function(e){var t=!!$(e.target).parents("#hd-fBox1").length;n.is(":visible")&&!t&&r()}),t.navhistory&&t.navhistory.initialed&&(t.navhistory.initialed=!1),t.navrss&&t.navrss.initialed&&(t.navrss.initialed=!1),sohuHD.getScript("http://my.tv.sohu.com/user/a/profile/currinfo.do?end=0&appid="+sohuHD.passport.getAppid()+"&varname=gUserParams",function(){"undefined"!=typeof gUserParams&&"1"==gUserParams.status&&(data=gUserParams.data,data.nickName=unescape(data.nickName),sohuHD.user.originalData=data,messagebus.publish("com.sohu.login.userinfo",data))})}),n("com.sohu.login",function(){$.cookie("rsstt")||function(){$("#hd-fBox2").append('

\u770b\u8fc7\u7684\u89c6\u9891\u6709\u66f4\u65b0\u63d0\u9192\u529f\u80fd\u4e86

\u77e5\u9053\u4e86

'),$("#hd-fBox2 .tip2 .tip-btn").click("click",function(){return $("#hd-fBox2 .tip2").hide(),$.cookie("rsstt",1,{path:"/",expires:30}),!1})}()}),n("com.sohu.login.userinfo",function(e,n){_e("userinfo");var i=$("#newNavUserName span:first"),s=t.strSub(n.nickName,4,!0),o=10;2!=s&&4!=s&&$("#newNavUserName").parent().addClass("hd-fix"),$.cookie("fee_status")&&($("#newNavVIP").attr("src",n.vipicon).show(),$("#newNavUserName").parent().addClass("hd-fix"),o=8),s=t.strSub(n.nickName,o,!0),i.html(s).attr("title",n.nickName)})});var v=$("#2ndFloatNavBt"),m=$("#2ndFloatNav"),b=function(){m.timer&&clearTimeout(m.timer),m.timer=setTimeout(k,200)},y=function(){m.timer&&clearTimeout(m.timer),m.timer=setTimeout(x,500)},k=function(){v.addClass("btn_all_hover"),m.show()},x=function(){v.removeClass("btn_all_hover"),m.hide()};if(m.hover(b,y),v.hover(b,y),$("#sFormA").length>0&&!$("#sFormA")[0].loaded){$("#sFormA")[0].loaded=!0;var w=$("#sKeyA").val();$("#sFormA").submit(function(){return t.redirect("http:/mts?wd="+escape($.trim($("#sKeyA").val())),"_blank"),!1}),$("#sKeyA").focus(function(){$("#sKeyA").val()==w&&$("#sKeyA").val("")}).blur(function(){""==$("#sKeyA").val()&&$("#sKeyA").val(w)})}},null,null,{cache:!0})}(window,sohuHD),sohuHD.history=function(){var e=function(){},t={delUrl:"//his.tv.sohu.com/his/del.do",cleanUrl:"//his.tv.sohu.com/his/delAll.do?plat=12",getUrl:"//his.tv.sohu.com/his/get.do?&c=1&callback=?",importUrl:"//his.tv.sohu.com/his/pingbatch.do",encode:document.charset||document.characterSet||"gbk",pagesize:20,page:1,getPassport:function(){return sohuHD.passport.getPassport()},islogin:function(){return!!this.getPassport()},getLocalHistory:function(){var e=$.cookie("savehistory");if(!e)return[];e=e.split("%2C");for(var t,n=[],i=0,s=e.length;i
',document.body.appendChild(i),n=document.getElementById("hiddenPostForm")}n.submit()}},clear:function(){t.clearLocal(),t.clearRemote()},imports:function(n,i,s,o,a){a||(a=t.getPassport()),i=i||e,s=s||e,o=o||window,"[object Object]"==Object.prototype.toString.call(n)&&(n=[n]);for(var r=[],c=0,l=n.length;c