📄 translate_c.js
字号:
/* Copyright 2006 eefocus */
function tn_o(){}tn_o.raise=function(a){if(typeof Error!="undefined"){throw new Error(a||"Assertion Failed");}else{throw a;}};tn_o.fail=function(a){if(a===undefined)a="Assertion failed";if(!(tn_ra===undefined))tn_ra(a+"\n");tn_o.raise(a)};tn_o.isTrue=function(a,b){if(!a){if(b===undefined)b="Assertion failed";tn_o.fail(b)}};tn_o.equals=function(a,b,c){if(a!=b){if(c===undefined){c="AS_Assert.equals failed: <"+a+"> != <"+b+">"}tn_o.fail(c)}};tn_o.typeOf=function(a,b,c){if(typeof a==b)return;if(a||a==
""){try{if(b==tn_o.TYPE_MAP[typeof a]||a instanceof b){return}}catch(d){}}if(c===undefined){if(typeof b=="function"){var e=b.toString().match(/^\s*function\s+([^\s\{]+)/);if(e)b=e[1]}c="AS_Assert.typeOf failed: <"+a+"> not typeof "+b}tn_o.fail(c)};tn_o.TYPE_MAP={string:String,number:Number,"boolean":Boolean};tn_o.numArgs=function(a,b){var c=tn_o.numArgs.caller;if(c&&c.arguments.length!=a){if(b===undefined){b=c.name+" expected "+a+" arguments but received "+c.arguments.length}tn_o.fail(b)}};var tn_qa=false;function tn_ra(a){try{throw a;}catch(b){tn_sa(b)}}function tn_sa(a,b){var c="Javascript exception: "+(b?b:"")+" "+a;if(tn_9()){c+=" "+a.name+": "+a.message+" ("+a.number+")"}var d="";if(typeof a=="string"){d=a+"\n"}else{for(var e in a){try{d+=e+": "+a[e]+"\n"}catch(g){}}}d+=tn_oa(tn_sa.caller);tn_Ya(c+"\n"+d,1)}var tn_ub=/function (\w+)/;function tn_Wa(a){var b=tn_ub.exec(String(a));if(b){return b[1]}return""}function tn_oa(a){try{if(!tn_9()&&!(tn_V("safari")||tn_V("konqueror"))&&
tn_V("mozilla")){return Error().stack}if(!a)return"";var b="- "+tn_Wa(a)+"(";for(var c=0;c<a.arguments.length;c++){if(c>0)b+=", ";var d=String(a.arguments[c]);if(d.length>40){d=d.substr(0,40)+"..."}b+=d}b+=")\n";b+=tn_oa(a.caller);return b}catch(e){return"[Cannot get stack trace]: "+e+"\n"}}var tn_Za;var tn_B=null,tn_da=false;function tn_Xa(){if((tn_B==null||tn_B.closed)&&!tn_da){try{tn_da=true;tn_B=window.open("","debug","width=700,height=500,toolbar=no,resizable=yes,scrollbars=yes,left=16,top=16,screenx=16,screeny=16");
tn_B.blur();tn_B.document.open();tn_da=false;var a="<font color=#ff0000><b>To turn off this debugging window,hit 'D' inside the main caribou window, then close this window.</b></font><br>";tn_pa(a)}catch(b){}}}function tn_Ya(a,b){if(!tn_qa){if(typeof tn_ka!="undefined"){tn_ka(tn_xa(a))}return}try{var c=(new Date).getTime()-tn_Za,d="["+c+"] "+tn_xa(a).replace(/\n/g,"<br>")+"<br>";if(b==1){d="<font color=#ff0000><b>Error: "+d+"</b></font>";tn_B.focus()}tn_pa(d)}catch(e){}}function tn_pa(a){if(!tn_qa){return}try{tn_Xa();
tn_B.document.write(a);tn_B.scrollTo(0,1000000)}catch(b){}};function tn_V(a){if(a in tn_8){return tn_8[a]}return tn_8[a]=navigator.userAgent.toLowerCase().indexOf(a)!=-1}var tn_8={};function tn_9(){return tn_V("msie")&&!window.opera};var tn_yb={ga:function(a){return a.document.body.scrollTop},ha:function(a){return a.document.documentElement.scrollTop},Z:function(a){return a.pageYOffset}};var tn_xb={ga:function(a){return a.document.body.scrollLeft},ha:function(a){return a.document.documentElement.scrollLeft},Z:function(a){return a.pageXOffset}};function tn_wa(a,
b){try{if(!window.opera&&"compatMode"in a.document&&a.document.compatMode=="CSS1Compat"){return b.ha(a)}else if(tn_9()){return b.ga(a)}}catch(c){}return b.Z(a)}var tn_fb=/&/g,tn_Eb=/</g,tn_zb=/>/g;function tn_xa(a){if(!a)return"";return a.replace(tn_fb,"&").replace(tn_Eb,"<").replace(tn_zb,">").replace(tn_Ib,""")}var tn_Ib=/\"/g;function tn_sb(a){return document.getElementById(a)}function tn_tb(a){return document.all[a]}var tn_rb=document.getElementById?tn_sb:tn_tb;function tn_ka(a){try{if(window.parent!=
window&&window.parent.log){window.parent.log(window.name+"::"+a);return}}catch(b){}var c=tn_rb("log");if(c){var d="<p class=logentry><span class=logdate>"+new Date+"</span><span class=logmsg>"+a+"</span></p>";c.innerHTML=d+c.innerHTML}else{window.status=a}};function tn_(a,b,c){this.x=a;this.y=b;this.coordinateFrame=c||null}tn_.prototype.toString=function(){return"[P "+this.x+","+this.y+"]"};tn_.prototype.clone=function(){return new tn_(this.x,this.y,this.coordinateFrame)};function tn__a(a,b){this.dx=a;this.dy=b}tn__a.prototype.toString=function(){return"[D "+this.dx+","+this.dy+"]"};function tn_x(a,b,c,d,e){this.x=a;this.y=b;this.w=c;this.h=d;this.coordinateFrame=e||null}tn_x.prototype.contains=function(a){return this.x<=a.x&&a.x<this.x+this.w&&this.y<=
a.y&&a.y<this.y+this.h};tn_x.prototype.intersects=function(a){var b=function(c,d){return new tn_(c,d,null)};return this.contains(b(a.x,a.y))||this.contains(b(a.x+a.w,a.y))||this.contains(b(a.x+a.w,a.y+a.h))||this.contains(b(a.x,a.y+a.h))||a.contains(b(this.x,this.y))||a.contains(b(this.x+this.w,this.y))||a.contains(b(this.x+this.w,this.y+this.h))||a.contains(b(this.x,this.y+this.h))};tn_x.prototype.toString=function(){return"[R "+this.w+"x"+this.h+"+"+this.x+"+"+this.y+"]"};tn_x.prototype.clone=function(){return new tn_x(this.x,
this.y,this.w,this.h,this.coordinateFrame)};function tn_Ma(a){function b(f){for(var j=a.offsetParent;j&&j.offsetParent;j=j.offsetParent){if(j.scrollLeft){f.x-=j.scrollLeft}if(j.scrollTop){f.y-=j.scrollTop}}}var c;if(a.ownerDocument&&a.ownerDocument.parentWindow){c=a.ownerDocument.parentWindow}else{c=window}if(a.ownerDocument&&a.ownerDocument.getBoxObjectFor){var d=a.ownerDocument.getBoxObjectFor(a),e=new tn_x(d.x,d.y,d.width,d.height,c);b(e);return e}if(a.getBoundingClientRect){var g=a.getBoundingClientRect();return new tn_x(g.left+tn_wa(c,
tn_xb),g.top+tn_wa(c,tn_yb),g.right-g.left,g.bottom-g.top,c)}var h=0,i=0;for(var n=a;n.offsetParent;n=n.offsetParent){h+=n.offsetLeft;i+=n.offsetTop}var e=new tn_x(h,i,a.offsetWidth,a.offsetHeight,c);b(e);return e};function tn_eb(a,b,c){this.name=a;if(typeof b=="string"){var d=tn_j("div",null);tn_Lb(d,b);b=d}this.contentElem=b;b.style.zIndex=9500;this.onclick=c}function tn_b(){this.I=new tn_x(0,0,0,0);this.u=tn_i.ZERO;this.N=[];this.f=[];this.A=[];this.z=0;this.l=this.Q(tn_i.ZERO);this.b={};this.T=false;this.P=false;this.C=false;this.X=new tn_(8,8)}tn_b.prototype.create=function(a,b){var c=this.b,d=tn_Ca(c,a,[["iw_nw",6,6,0,0],["iw_ne",6,6,0,0],["iw_xtap",32,21,0,0],["iw_xtap_l",32,21,0,0],["iw_xtap_u",32,21,
0,0],["iw_xtap_ul",32,21,0,0],["iw_xtap_rd",21,32,0,0],["iw_xtap_ld",21,32,0,0],["iw_n",628,6,0,0,"iw_n1"],["iw_n",628,6,0,0,"iw_n2"],["iw_w",6,598,0,0],["iw_e",6,598,0,0],["iw_s0",628,6,0,0,"iw_s1"],["iw_s0",628,6,0,0,"iw_s2"],["iw_c",628,598,0,0],["iw_sw0",6,6,0,0,"iw_sw"],["iw_se0",6,6,0,0,"iw_se"]]);tn_Qa(d);this.c=d;var e=tn_Ca(c,b,[["iws_nw",8,8,0,0],["iws_ne",8,8,0,0],["iws_sw",8,8,0,0],["iws_se",8,8,0,0],["iws_tap",37,16,0,0],["iws_tap_l",32,16,0,0],["iws_tap_u",37,26,0,0],["iws_tap_ul",32,
26,0,0],["iws_tap_rd",16,37,0,0],["iws_tap_ld",26,37,0,0],["iws_n",628,8,0,0,"iws_n1"],["iws_n",628,8,0,0,"iws_n2"],["iws_w",8,598,0,0],["iws_e",8,598,0,0],["iws_s",628,8,0,0,"iws_s1"],["iws_s",628,8,0,0,"iws_s2"],["iws_c",628,598,0,0]]);tn_Qa(e);this.i=e;var g=new tn_i(14,13),h=tn_T(tn_G("close",true),d,tn_.ORIGIN,g);h.style.zIndex=10000;this.b.close=h;tn_t(h,"pointer");tn_Q(h,this,this.Ya);var i=tn_T(tn_G("maximize",true),d,tn_.ORIGIN,g);i.style.zIndex=10000;tn_L(i);tn_t(i,"pointer");tn_Q(i,this,
this.maximize);this.b.maximize=i;var n=tn_T(tn_G("restore",true),d,tn_.ORIGIN,g);n.style.zIndex=10001;tn_L(n);tn_t(n,"pointer");tn_Q(n,this,this.restore);this.b.restore=n;tn_p(d,tn_N,this,this.$);tn_p(d,tn_M,this,this.Ga);tn_p(d,tn_D,this,this.$);tn_p(d,tn_2a,this,tn_U);tn_p(d,tn_9a,this,tn_U);tn_p(d,tn_$a,this,tn_U);this.kb();this.hide()};tn_b.prototype.remove=function(){tn_H(this.i);tn_H(this.c)};tn_b.prototype.tb=function(){return this.c};tn_b.prototype.jb=function(a){this.b.close.style.visibility=
a?"visible":"hidden"};tn_b.prototype.Oa=function(a){this.T=a};tn_b.prototype.Pa=function(a){this.p=a};tn_b.prototype.ya=function(a){this.P=a};tn_b.prototype.rb=function(a){this.C=a};tn_b.prototype.Jb=function(a,b){return this.L(new tn_x(a.x,a.y,0,0),b)};tn_b.prototype.ua=function(a,b){if(!a.getClientRects){return this.L(tn_Ma(a))}var c=this.t(),d=this.b,e=c.width,g=c.height,h=window.innerWidth||document.body.scrollWidth,i=document.documentElement.scrollLeft||window.scrollX||document.body.scrollLeft,
n=document.documentElement.scrollTop||window.scrollY||document.body.scrollTop;tn_e(d.iw_xtap);tn_e(d.iw_xtap_l);tn_e(d.iw_xtap_u);tn_e(d.iw_xtap_ul);tn_e(d.iw_xtap_ld);tn_e(d.iw_xtap_rd);tn_e(d.iws_tap);tn_e(d.iws_tap_l);tn_e(d.iws_tap_u);tn_e(d.iws_tap_ul);tn_e(d.iws_tap_ld);tn_e(d.iws_tap_rd);var f,j,l=0,t=0,x=0,p,q,r,s,y,A,B,m=a.getClientRects(),u=tn_Ma(a),C=m[0].top-u.y;for(var k=0;k<m.length;++k){if(k>0&&m[k].bottom==m[k-1].bottom){if(m[k].left==m[k-1].right){m[k].left=m[k-1].left;m[k].top=tn_z(m[k].top,
m[k-1].top)}else if(m[k].right==m[k-1].left){m[k].right=m[k-1].right;m[k].top=tn_z(m[k].top,m[k-1].top)}}if(!s||m[k].left<=s.left){s=m[k]}if(!y||m[k].right>=y.right){y=m[k]}if(!A||m[k].top<=A.top){A=m[k]}if(!B||m[k].bottom>=B.bottom){B=m[k]}}var w=s.left-u.x,o,v,D,E=0;if(this.C&&21+e+6+12+y.right<h){q=true;f=d.iw_xtap_ld;j=d.iws_tap_ld;o=y;this.v=0}else if(this.C&&18+e+21<s.left){r=true;f=d.iw_xtap_rd;j=d.iws_tap_rd;x=5;o=s;this.v=6+e+21}else{if(this.P&&21+g+6+12>u.y-(this.p?n:0)){f=d.iw_xtap_u;j=
d.iws_tap_u;p=true;t=32;l=0;o=B}else{f=d.iw_xtap;j=d.iws_tap;t=32;l=0;o=A}if(tn_k((o.left+o.right)/2)+32+6+12>h){if(f==d.iw_xtap_u){f=d.iw_xtap_ul;j=d.iws_tap_ul}else{f=d.iw_xtap_l;j=d.iws_tap_l}x=5;l=32;t=0}v=tn_k((e-32)/2);if(this.T||this.p){if(v+6+12+l>tn_k((o.left+o.right)/2)){var z=tn_k((o.left+o.right)/2)-(this.p?0:i)-6-12-l;if(z<0){E=tn_z(-z,tn_k((o.left+o.right)/2));z=0}v=z}else if(tn_k((o.left+o.right)/2)-l+e-v+6+12>h){if(p){f=d.iw_xtap_ul;j=d.iws_tap_ul}else{f=d.iw_xtap_l;j=d.iws_tap_l}x=
5;l=32;t=0;var z=tn_k((o.left+o.right)/2)-(this.p?0:i)-l+e+6+12-h;if(z>e-32){E=tn_f(e-32-z,-tn_k((o.left+o.right)/2)+(this.p?0:i));z=e-32}v=z}}D=e-32-v;this.v=6+v+l}tn_A(f);tn_A(j);var F=this.u=b||tn_i.ZERO,H=this.v-E,I=q||r?6:(p?0:this.aa().height);H-=F.width;I-=F.height;var G=new tn_((q?o.right:(r?o.left:tn_k((o.left+o.right)/2)))-H-w,(q||r?tn_k((o.top+o.bottom)/2):(p?o.bottom:o.top))-I-C);this.xa=G;tn_a(this.c,G);tn_a(this.i,G);this.I=undefined;this.U=a;return this.pa(q,r,p,v,D,f,j,x)};tn_b.prototype.L=
function(a,b){var c=this.t(),d=this.b,e=c.width,g=c.height,h=document.body.scrollWidth,i=document.documentElement.scrollLeft||window.scrollX||document.body.scrollLeft,n=document.documentElement.scrollTop||window.scrollY||document.body.scrollTop;tn_e(d.iw_xtap);tn_e(d.iw_xtap_l);tn_e(d.iw_xtap_u);tn_e(d.iw_xtap_ul);tn_e(d.iw_xtap_ld);tn_e(d.iw_xtap_rd);tn_e(d.iws_tap);tn_e(d.iws_tap_l);tn_e(d.iws_tap_u);tn_e(d.iws_tap_ul);tn_e(d.iws_tap_ld);tn_e(d.iws_tap_rd);var f,j,l=0,t=0,x=0,p,q,r,s,y,A=0,B=this.C;
if(B&&21+e+6+12+a.x+a.w<i+h){q=true;f=d.iw_xtap_ld;j=d.iws_tap_ld}else if(B&&18+e+21+i<a.x){r=true;f=d.iw_xtap_rd;j=d.iws_tap_rd;x=5}else{if(this.P&&21+g+6+12+(this.p?n:0)>a.y){f=d.iw_xtap_u;j=d.iws_tap_u;t=32;l=0;p=true}else{f=d.iw_xtap;j=d.iws_tap;t=32;l=0}if(a.x+a.w/2+32+6+12>i+h){if(f==d.iw_xtap_u){f=d.iw_xtap_ul;j=d.iws_tap_ul}else{f=d.iw_xtap_l;j=d.iws_tap_l}x=5;l=32;t=0}s=tn_k((e-32)/2);if(this.T){if(s+6+12+l+i>a.x+tn_k(a.w/2)){var m=a.x+tn_k(a.w/2)-6-12-l-i;if(m<0){A=tn_z(-m,tn_k(a.w/2));
m=0}s=m}else if(a.x+tn_k(a.w/2)-l+e-s+6+12>i+h){if(p){f=d.iw_xtap_ul;j=d.iws_tap_ul}else{f=d.iw_xtap_l;j=d.iws_tap_l}x=5;l=32;t=0;var m=a.x+tn_k(a.w/2)-l+e+6+12-h-i;if(m>e-32){A=tn_f(e-32-m,-tn_k(a.w/2));m=e-32}s=m}}y=e-32-s}tn_A(f);tn_A(j);this.v=q?0:(r?6+e+21:6+s+l);var u=this.u=b||tn_i.ZERO,C=this.v-A,k=q||r?6:(p?0:this.aa().height);C-=u.width;k-=u.height;var w=new tn_(a.x+(q?a.w:(r?0:a.w/2))-C,a.y+(q||r?a.h/2:(p?a.h:0))-k);this.xa=w;tn_a(this.c,w);tn_a(this.i,w);this.I=a;this.U=undefined;return this.pa(q,
r,p,s,y,f,j,x)};tn_b.prototype.pa=function(a,b,c,d,e,g,h,i){this.O=g;this.M=h;var n=this.t(),f=this.b,j=n.width,l=n.height;if(a||b){tn_h(f.iw_n1,j);tn_h(f.iw_n2,0);tn_h(f.iw_s1,j);tn_h(f.iw_s2,0);tn_h(f.iws_n1,j);tn_h(f.iws_n2,0);tn_h(f.iws_s1,j);tn_h(f.iws_s2,0)}else if(c){tn_h(f.iw_n1,tn_f(d,0));tn_h(f.iw_n2,tn_f(e,0));tn_h(f.iw_s1,j);tn_h(f.iw_s2,0);tn_h(f.iws_n1,tn_f(d,0));tn_h(f.iws_n2,tn_f(e,0));tn_h(f.iws_s1,j);tn_h(f.iws_s2,0)}else{tn_h(f.iw_n1,j);tn_h(f.iw_n2,0);tn_h(f.iw_s1,tn_f(d,0));tn_h(f.iw_s2,
tn_f(e,0));tn_h(f.iws_n1,j);tn_h(f.iws_n2,0);tn_h(f.iws_s1,tn_f(d,0));tn_h(f.iws_s2,tn_f(e,0))}tn_3(f.iw_c,n);if(a){tn_q(f.iw_w,tn_f(l-32,0));tn_q(f.iw_e,tn_f(l,32));tn_q(f.iws_w,tn_f(l-32,0));tn_q(f.iws_e,tn_f(l,32))}else if(b){tn_q(f.iw_e,tn_f(l-32,0));tn_q(f.iw_w,tn_f(l,32));tn_q(f.iws_e,tn_f(l-32,0));tn_q(f.iws_w,tn_f(l,32))}else{tn_q(f.iw_w,l);tn_q(f.iw_e,l);tn_q(f.iws_w,l);tn_q(f.iws_e,l)}var t=a?15:0,x=t+5-2,p=t+6,q=p+5,r=p+j,s=r+5,y=a?0:(b?r:p+d),A=y+i,B=y+32,m=B+5,u=c?21:6,C=u+5,k=u+(a||
b?tn_f(l,32):l),w=k+5,o=c?15:0,v=o+5-2;tn_a(f.iw_nw,new tn_(t,o));tn_a(f.iws_nw,new tn_(x,v));tn_a(f.iw_n1,new tn_(p,o));tn_a(f.iws_n1,new tn_(q,v));tn_a(f.iw_ne,new tn_(r,o));tn_a(f.iws_ne,new tn_(s,v));tn_a(f.iw_w,new tn_(t,u+(a?32:0)));tn_a(f.iws_w,new tn_(x,C+(a?32:0)));tn_a(f.iw_c,new tn_(p,u));tn_a(f.iws_c,new tn_(q,C));tn_h(f.iw_c,r-p);tn_q(f.iw_c,k-u);tn_h(f.iws_c,s-q);tn_q(f.iws_c,w-C);tn_a(f.iw_e,new tn_(r,u+(b?32:0)));tn_a(f.iws_e,new tn_(s,C+(b?32:0)));tn_a(f.iw_sw,new tn_(t,k));tn_a(f.iws_sw,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -