translate_c.js
来自「一百多个例子很好的verilog 学习资料」· JavaScript 代码 · 共 74 行 · 第 1/3 页
JS
74 行
"border-left-width",tn_Va="border-top-width";function tn_K(a){return new tn_i(tn_Ea(a,tn_Ua),tn_Ea(a,tn_Va))}function tn_Ea(a,b){var c=tn_y(a,b);if(isNaN(parseInt(c,10))){return 0}return tn_P(a,b,c)}function tn_Da(a){return a.replace(/-(\w)/g,function(b,c){return(""+c).toUpperCase()})}function tn_g(a){return a.length}function tn_Ba(a){a.length=0}function tn_Db(a){var b=false;if(a&&typeof a=="object"){if(typeof Window=="function"){b=a instanceof Window}else{b=typeof a.navigator=="object"&&typeof a.history==
"object"&&typeof a.document=="object"}}return b}function tn_S(a){var b;if(tn_Db(a)){b=a}else{b=a&&a[tn_J]?a[tn_J]:window}return b}function tn_4(a,b){var c=tn_S(b);a[tn_J]=c;return c};tn_.ORIGIN=new tn_(0,0);tn_.prototype.toString=function(){return"("+this.x+", "+this.y+")"};tn_.prototype.equals=function(a){if(!a)return false;return a.x==this.x&&a.y==this.y};function tn_i(a,b){this.width=a;this.height=b}tn_i.ZERO=new tn_i(0,0);tn_i.prototype.toString=function(){return"("+this.width+", "+this.height+")"};tn_i.prototype.equals=function(a){if(!a)return false;return a.width==this.width&&a.height==this.height};function tn_C(a){this.minX=(this.minY=tn_ya);this.maxX=(this.maxY=-tn_ya);
var b=arguments;if(a&&tn_g(a)){for(var c=0;c<tn_g(a);c++){this.extend(a[c])}}else if(tn_g(b)>=4){this.minX=b[0];this.minY=b[1];this.maxX=b[2];this.maxY=b[3]}}tn_C.prototype.min=function(){return new tn_(this.minX,this.minY)};tn_C.prototype.max=function(){return new tn_(this.maxX,this.maxY)};tn_C.prototype.toString=function(){return"("+this.min()+", "+this.max()+")"};tn_C.prototype.sb=function(a){var b=this;return b.minX<a.minX&&b.maxX>a.maxX&&b.minY<a.minY&&b.maxY>a.maxY};tn_C.prototype.extend=function(a){var b=
this;b.minX=tn_z(b.minX,a.x);b.maxX=tn_f(b.maxX,a.x);b.minY=tn_z(b.minY,a.y);b.maxY=tn_f(b.maxY,a.y)};tn_C.intersection=function(a,b){return new tn_C([new tn_(tn_f(a.minX,b.minX),tn_f(a.minY,b.minY)),new tn_(tn_z(a.maxX,b.maxX),tn_z(a.maxY,b.maxY))])};function tn_mb(a,b,c){if(b){b.call(null,a)}for(var d=a.firstChild;d;d=d.nextSibling){if(d.nodeType==1){arguments.callee.call(this,d,b,c)}}if(c){c.call(null,a)}}function tn_Ga(a){return a.className?""+a.className:""}function tn_jb(a,b){var c=tn_Ga(a);if(c){var d=c.split(/\s+/),e=false;for(var g=0;g<tn_g(d);++g){if(d[g]==b){e=true;break}}if(!e){d.push(b)}a.className=d.join(" ")}else{a.className=b}}function tn_lb(a,b){var c=tn_Ga(a);if(!c||c.indexOf(b)==-1){return}var d=c.split(/\s+/);for(var e=0;e<
tn_g(d);++e){if(d[e]==b){d.splice(e--,1)}}a.className=d.join(" ")};tn_ka=function(a){};function tn_ea(){}tn_ea.monitor=function(a,b,c,d,e){};tn_ea.monitorAll=function(a,b,c){};tn_ea.dump=function(){};function tn_n(){var a=tn_j("div",document.body),b=a.style;b.position="absolute";b.left=tn_m(7);b.bottom=tn_m(4);b.zIndex=10000;var c=tn_ib(a,new tn_(2,2)),d=tn_j("div",a);b=d.style;b.position="relative";b.zIndex=1;b.fontFamily="Verdana,Arial,sans-serif";b.fontSize="small";b.border="1px solid black";var e=[["Clear",this.clear],["Close",this.close]],g=tn_j("div",d);b=g.style;b.position="relative";b.zIndex=2;b.backgroundColor="#979797";b.color="white";b.fontSize="85%";b.padding=tn_m(2);tn_t(g,"default");
tn_Fa(g);tn_E("Log",g);for(var h=0;h<tn_g(e);h++){var i=e[h];tn_E(" - ",g);var n=tn_j("span",g);n.style.textDecoration="underline";tn_E(i[0],n);tn_Q(n,this,i[1]);tn_t(n,"pointer")}tn_p(g,tn_N,this,this.Ca);var f=tn_j("div",d);b=f.style;b.backgroundColor="white";b.width=tn_Ha(80);b.height=tn_Ha(10);if(tn_d.d()){b.overflow="-moz-scrollbars-vertical"}else{b.overflow="auto"}tn_F(f,tn_N,tn_U);this.G=f;this.j=a;this.i=c}tn_n.instance=function(){var a=tn_n.g;if(!a){a=new tn_n;tn_n.g=a}return a};tn_n.prototype.write=
function(a,b){var c=this.R();if(b){c=tn_j("span",c);c.style.color=b}tn_E(a,c);this.W()};tn_n.prototype.Mb=function(a){var b=tn_j("a",this.R());tn_E(a,b);b.href=a;this.W()};tn_n.prototype.Lb=function(a){var b=tn_j("span",this.R());b.innerHTML=a;this.W()};tn_n.prototype.clear=function(){this.G.innerHTML=""};tn_n.prototype.close=function(){tn_H(this.j)};tn_n.prototype.Ca=function(a){if(!this.Ea){this.Ea=new tn_c(this.j);this.j.style.bottom=""}};tn_n.prototype.R=function(){var a=tn_j("div",this.G),b=
a.style;b.fontSize="85%";b.borderBottom="1px solid silver";b.paddingBottom=tn_m(2);var c=tn_j("div",a);c.style.color="gray";c.style.fontSize="75%";tn_E(this.pb(),c);return a};tn_n.prototype.W=function(){this.G.scrollTop=this.G.scrollHeight;this.lb()};tn_n.prototype.pb=function(){var a=new Date;return this.H(a.getHours(),2)+":"+this.H(a.getMinutes(),2)+":"+this.H(a.getSeconds(),2)+":"+this.H(a.getMilliseconds(),3)};tn_n.prototype.H=function(a,b){var c=a.toString();while(tn_g(c)<b){c="0"+c}return c};
tn_n.prototype.lb=function(){tn_3(this.i,new tn_i(this.j.offsetWidth,this.j.offsetHeight))};function tn_c(a,b){if(!tn_c.La){tn_c.Ja()}var c=tn_4(this,a);b=b||{};this.r=b.draggableCursor||tn_c.r;this.n=b.draggingCursor||tn_c.n;this.e=a;this.j=b.container;this.na=b.left;this.oa=b.top;this.k=false;this.m=new tn_(0,0);this.o=false;this.D=new tn_(0,0);this.Ta=tn_2(this,this.bb);this.Ua=tn_2(this,this.ka);this.Wa=tn_2(this,this.la);if(tn_d.d()){tn_p(c,tn_va,this,this.ma)}this.a=[];this.qa(a)}tn_c.Ja=function(){var a,b;if(tn_d.d()){a="-moz-grab";b="-moz-grabbing"}else{a="url("+tn_Z+"openhand.cur), default";
b="url("+tn_Z+"closedhand.cur), move"}this.r=this.r||a;this.n=this.n||b;this.La=true};tn_c.getDraggingCursor=function(){return tn_c.n};tn_c.sa=function(a){this.r=a};tn_c.ta=function(a){this.n=a};tn_c.prototype.sa=tn_c.sa;tn_c.prototype.ta=tn_c.ta;tn_c.prototype.qa=function(a){for(var b=0;b<tn_g(this.a);++b){tn_ha(this.a[b])}if(this.V){tn_t(this.e,this.V)}this.e=a;this.S=null;this.a=[];if(!a){return}tn_Hb(a);this.moveTo(tn_ja(this.na)?this.na:a.offsetLeft,tn_ja(this.oa)?this.oa:a.offsetTop);this.S=
a.setCapture?a:tn_S(a);this.a.push(tn_F(a,tn_N,this.Ta));this.a.push(tn_p(a,tn_X,this,this.$a));this.a.push(tn_p(a,tn_D,this,this.Za));this.a.push(tn_p(a,tn_M,this,this.ab));this.V=a.style.cursor;this.B()};tn_c.prototype.Gb=function(a){tn_4(this,a);tn_4(this.e,a);if(tn_d.d()){tn_p(a,tn_va,this,this.ma)}this.qa(this.e)};tn_c.prototype.moveTo=function(a,b){a=tn_k(a);b=tn_k(b);if(this.left!=a||this.top!=b){this.left=a;this.top=b;var c=this.e.style;c.left=tn_m(a);c.top=tn_m(b);tn_l(this,tn_ab)}};tn_c.prototype.ab=
function(a){tn_l(this,tn_M,a)};tn_c.prototype.Za=function(a){if(this.k&&!a.cancelDrag){tn_l(this,tn_D,a)}};tn_c.prototype.$a=function(a){if(this.k){tn_l(this,tn_X,a)}};tn_c.prototype.bb=function(a){tn_l(this,tn_N,a);if(a.cancelDrag){return}if(!this.Ma(a)){return}this.ib(a);this.za(a);tn_1(a)};tn_c.prototype.ka=function(a){if(!this.o){return}if(tn_d.os==0){if(a==null){return}if(this.dragDisabled){this.savedMove={};this.savedMove.clientX=a.clientX;this.savedMove.clientY=a.clientY;return}tn_Oa(this,
function(){this.dragDisabled=false;this.ka(this.savedMove)},30);this.dragDisabled=true;this.savedMove=null}var b=this.left+(a.clientX-this.m.x),c=this.top+(a.clientY-this.m.y),d=0,e=0,g=this.j;if(g){var h=this.e,i=tn_f(0,tn_z(b,g.offsetWidth-h.offsetWidth));d=i-b;b=i;var n=tn_f(0,tn_z(c,g.offsetHeight-h.offsetHeight));e=n-c;c=n}this.moveTo(b,c);this.m.x=a.clientX+d;this.m.y=a.clientY+e;tn_l(this,tn_3a,a)};tn_c.prototype.la=function(a){this.eb();this.Fa(a);var b=(new Date).getTime();if(b-this.Ba<=
500&&tn_Aa(this.D.x-a.clientX)<=2&&tn_Aa(this.D.y-a.clientY)<=2){tn_l(this,tn_D,a)}};tn_c.prototype.ma=function(a){if(!a.relatedTarget&&this.o){this.la(a)}};tn_c.prototype.disable=function(){this.k=true;this.B()};tn_c.prototype.enable=function(){this.k=false;this.B()};tn_c.prototype.enabled=function(){return!this.k};tn_c.prototype.dragging=function(){return this.o};tn_c.prototype.B=function(){var a;if(this.o){a=this.n}else if(this.k){a=this.V}else{a=this.r}tn_t(this.e,a)};tn_c.prototype.Ma=function(a){var b=
a.button==0||a.button==1;if(this.k||!b){tn_1(a);return false}return true};tn_c.prototype.ib=function(a){this.m.x=a.clientX;this.m.y=a.clientY;if(this.e.setCapture){this.e.setCapture()}this.Ba=(new Date).getTime();this.D.x=a.clientX;this.D.y=a.clientY};tn_c.prototype.eb=function(){if(document.releaseCapture){document.releaseCapture()}};tn_c.prototype.za=function(a){this.o=true;this.Va=tn_F(this.S,tn_8a,this.Ua);this.Xa=tn_F(this.S,tn_X,this.Wa);tn_l(this,tn_5a,a);this.B()};tn_c.prototype.Fa=function(a){this.o=
false;tn_ha(this.Va);tn_ha(this.Xa);tn_l(this,tn_X,a);tn_l(this,tn_4a,a);this.B()};var tn_aa="overflow",tn_W="position",tn_ca="visible",tn_ba="static",tn_Y="BODY";function tn_ga(a,b){var c=new tn_(0,0);while(a&&a!=b){if(a.nodeName==tn_Y){tn_kb(c,a)}var d=tn_K(a);c.x+=d.width;c.y+=d.height;if(a.nodeName!=tn_Y||!tn_d.d()){c.x+=a.offsetLeft;c.y+=a.offsetTop}if(tn_d.d()&&tn_d.revision>=1.8&&a.offsetParent&&a.offsetParent.nodeName!=tn_Y&&tn_y(a.offsetParent,tn_aa)!=tn_ca){var d=tn_K(a.offsetParent);c.x+=d.width;c.y+=d.height}if(a.offsetParent){c.x-=a.offsetParent.scrollLeft;c.y-=a.offsetParent.scrollTop}if(tn_d.type!=
1&&tn_Cb(a)){if(tn_d.d()){c.x-=self.pageXOffset;c.y-=self.pageYOffset;var e=tn_K(a.offsetParent.parentNode);c.x+=e.width;c.y+=e.height}break}if(tn_d.type==2&&a.offsetParent){var d=tn_K(a.offsetParent);c.x-=d.width;c.y-=d.height}a=a.offsetParent}if(tn_d.type==1&&!b&&document.documentElement){c.x+=document.documentElement.clientLeft;c.y+=document.documentElement.clientTop}if(b&&a==null){var g=tn_ga(b);return new tn_(c.x-g.x,c.y-g.y)}else{return c}}function tn_Cb(a){if(a.offsetParent&&a.offsetParent.nodeName==
tn_Y&&tn_y(a.offsetParent,tn_W)==tn_ba){if(tn_d.type==0&&tn_y(a,tn_W)!=tn_ba){return true}else if(tn_d.type!=0&&tn_y(a,tn_W)=="absolute"){return true}}return false}function tn_kb(a,b){var c=false;if(tn_d.d()){c=tn_y(b,tn_aa)!=tn_ca&&tn_y(b.parentNode,tn_aa)!=tn_ca;var d=tn_y(b,tn_W)!=tn_ba;if(d||c){a.x+=tn_P(b,"margin-left");a.y+=tn_P(b,"margin-top");var e=tn_K(b.parentNode);a.x+=e.width;a.y+=e.height}if(d){a.x+=tn_P(b,"left");a.y+=tn_P(b,"top")}}if((tn_d.d()||tn_d.type==1)&&document.compatMode!=
"BackCompat"||c){if(self.pageYOffset){a.x-=self.pageXOffset;a.y-=self.pageYOffset}else{a.x-=document.documentElement.scrollLeft;a.y-=document.documentElement.scrollTop}}}function tn_Pa(a,b){if(tn_La(a.offsetX)){var c=tn_vb(a),d=tn_ga(c,b),e=new tn_(a.offsetX,a.offsetY);if(tn_d.type==2){var g=tn_K(c);e.x-=g.width;e.y-=g.height}return new tn_(d.x+e.x,d.y+e.y)}else if(tn_La(a.clientX)){var h=tn_wb(a),i=tn_ga(b);return new tn_(h.x-i.x,h.y-i.y)}else{return tn_.ORIGIN}};function tn_O(a){this.ticks=a;this.tick=0}tn_O.prototype.reset=function(){this.tick=0};tn_O.prototype.next=function(){this.tick++;var a=Math.PI*(this.tick/this.ticks-0.5);return(Math.sin(a)+1)/2};tn_O.prototype.more=function(){return this.tick<this.ticks};tn_O.prototype.extend=function(){if(this.tick>this.ticks/3){this.tick=tn_k(this.ticks/3)}};var tn_u,tn_s=null,tn_I,tn_7,tn_6,tn_5=false,_intlStrings={_originalText:"Original Text:",_interfaceDirection:"ltr",_interfaceAlign:"left"};function _setupIW(){if(tn_5)return;tn_u=new tn_b;tn_I=document.createElement("div");tn_I.id="eefocus-infowindow";tn_7=document.createElement("span");tn_I.onmouseover=tn_Rb;tn_I.onmouseout=tn_Ra;document.body.appendChild(tn_7);document.body.appendChild(tn_I);tn_u.create(tn_I,tn_7);tn_I.firstChild.style.zIndex=9000;tn_7.firstChild.style.zIndex=8999;tn_u.jb(false);
tn_u.Oa(true);tn_u.Pa(true);tn_u.ya(true);tn_5=true}var tn_v=null;function tn_Rb(){tn_Sa(tn_s)}function tn_Sa(a){if(!a)return;if(tn_v!==null){window.clearTimeout(tn_v);tn_v=null}if(tn_s==a){tn_6=tn_s.style.backgroundColor;tn_s.style.backgroundColor="#E6ECF9";return}var b;for(var c=0;c<a.childNodes.length;++c){if(a.childNodes[c].className=="eefocus-src-text"){b=a.childNodes[c].cloneNode(true);b.className="eefocus-src-active-text";break}}if(!b){return}tn_6=a.style.backgroundColor;a.style.backgroundColor=
"#E6ECF9";var d=document.createElement("div"),e=document.createElement("div");d.appendChild(e);e.appendChild(document.createTextNode(_intlStrings._originalText));e.style.color="#A0A0A0";e.style.direction=_intlStrings._interfaceDirection;e.style.textAlign=_intlStrings._interfaceAlign;d.appendChild(b);d.style.zIndex=10000;tn_s=a;tn_Fb(d,function(g){tn_u.hide();tn_u.J(g,[new tn_eb(_intlStrings._originalText,d)]);tn_u.ua(tn_s);tn_u.show()},(document.width||document.body.scrollWidth)/2)}function tn_Pb(a){if(!tn_5)return;
if(tn_v!==null){window.clearTimeout(tn_v);tn_v=null}if(tn_s==a){tn_6=tn_s.style.backgroundColor;tn_s.style.backgroundColor="#E6ECF9";return}tn_v=window.setTimeout(function(){tn_Sa(a)},500)}function tn_Ra(){if(!tn_5)return;if(tn_s&&tn_s.style){tn_s.style.backgroundColor=tn_6}if(tn_v){window.clearTimeout(tn_v);tn_v=null}tn_v=window.setTimeout(tn_Qb,1000)}function tn_Qb(){tn_u.hide();tn_s=null}var _tipon=tn_Pb,_tipoff=tn_Ra;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?