/slippy-chart.shrink.js
JavaScript | 2155 lines | 2154 code | 1 blank | 0 comment | 166 complexity | db91e90cd13dfddce35d96110aa6c145 MD5 | raw file
- (function($){
- var _1=this,_2=_1.document,_3,_4=_1.SlippyChart,_5=_1.$c,$c=_1.$c=SlippyChart=_1.SlippyChart={};
- var _6=function(el,_7,fn){
- if(_1.attachEvent){
- _6=function(el,_8,fn){
- el.attachEvent("on"+_8,fn);
- };
- }else{
- _6=function(el,_9,fn){
- if(_9=="mousewheel"){
- _9="DOMMouseScroll";
- }
- el.addEventListener(_9,fn,false);
- };
- }
- _6(el,_7,fn);
- };
- var _a=function(el,_b,fn){
- if(_1.detachEvent){
- _a=function(el,_c,fn){
- el.detachEvent("on"+_c,fn);
- };
- }else{
- _a=function(el,_d,fn){
- el.removeEventListener(_d,fn,false);
- };
- }
- _a(el,_b,fn);
- };
- var _e=function(e){
- e=e?e:_1.event;
- if(e.stopPropagation){
- e.stopPropagation();
- }
- if(e.preventDefault){
- e.preventDefault();
- }
- e["cancelBubble"]=true;
- e["cancel"]=true;
- e["returnValue"]=false;
- return false;
- };
- var _f=function(_10,_11){
- var len=_11.length||0;
- var res=[];
- res.length=len;
- for(var i=len-1;i>=0;i--){
- res[i]=_10(_11[i]);
- }
- return res;
- };
- var _12=function(_13,_14,_15){
- var len=_14.length||0;
- if(len===0){
- return _15;
- }
- var i=0;
- if(typeof _15==="undefined"){
- _15=_14[i++];
- }
- for(;i<len;i++){
- _15=_13(_15,_14[i]);
- }
- return _15;
- };
- var _16=function(_17,_18){
- var len=_18.length||0;
- var res=[];
- for(var i=len-1;i>=0;i--){
- if(_17(_18[i])){
- res.push(_18[i]);
- }
- }
- return res.reverse();
- };
- var _19=function(){
- var _1a=arguments.length||0;
- if(_1a===0){
- return [];
- }
- var len=arguments[0].length||0;
- var res=[];
- res.length=len;
- for(var i=len-1;i>=0;i--){
- res[i]=_f(function(x){
- return x[i];
- },arguments);
- }
- return res;
- };
- var _1b=function(_1c,_1d){
- var low=0;
- var _1e=_1c.length-1;
- while(low<=_1e){
- var mid=Math.floor((low+_1e)/2);
- var _1f=_1c[mid];
- if(_1f<_1d){
- low=mid+1;
- }else{
- if(_1f>_1d){
- _1e=mid-1;
- }else{
- return mid;
- }
- }
- }
- return -(low+1);
- };
- var _20=function(_21,_22){
- var low=0;
- var _23=_21.length-1;
- while(low<=_23){
- var mid=Math.floor((low+_23)/2);
- var _24=_21[mid];
- if(_24<_22){
- low=mid+1;
- }else{
- if(_24>_22){
- _23=mid-1;
- }else{
- return _21.slice(mid);
- }
- }
- }
- return _21.slice(low);
- };
- var _25=function(_26,_27){
- var low=0;
- var _28=_26.length-1;
- while(low<=_28){
- var mid=Math.floor((low+_28)/2);
- var _29=_26[mid];
- if(_29<_27){
- low=mid+1;
- }else{
- if(_29>_27){
- _28=mid-1;
- }else{
- return _26.slice(0,mid+1);
- }
- }
- }
- return _26.slice(0,_28+1);
- };
- var _2a=function(_2b,_2c,_2d){
- var low,_2e,mid,_2f,_30,_31;
- low=0;
- _2e=_2b.length-1;
- while(low<=_2e){
- mid=Math.floor((low+_2e)/2);
- _2f=_2b[mid];
- if(_2f<_2c){
- low=mid+1;
- }else{
- if(_2f>_2c){
- _2e=mid-1;
- }else{
- low=mid;
- break;
- }
- }
- }
- _30=low;
- _2e=_2b.length-1;
- while(low<=_2e){
- mid=Math.floor((low+_2e)/2);
- _2f=_2b[mid];
- if(_2f<_2d){
- low=mid+1;
- }else{
- if(_2f>_2d){
- _2e=mid-1;
- }else{
- _2e=mid;
- break;
- }
- }
- }
- _31=_2e+1;
- return _2b.slice(_30,_31);
- };
- var _32=function(){
- this.first=null;
- this.last=null;
- this.length=0;
- };
- var _33=function(_34){
- this.prev=null;
- this.next=null;
- this.data=_34;
- };
- _32.prototype.prepend=function(_35){
- if(this.first===null){
- this.first=_35;
- this.last=_35;
- }else{
- _35.prev=null;
- _35.next=this.first;
- this.first.prev=_35;
- this.first=_35;
- }
- this.length++;
- };
- _32.prototype.append=function(_36){
- if(this.first===null){
- this.first=_36;
- this.last=_36;
- }else{
- _36.prev=this.last;
- _36.next=null;
- this.last.next=_36;
- this.last=_36;
- }
- this.length++;
- };
- _32.prototype.remove=function(_37){
- if(this.first==this.last){
- this.first=null;
- this.last=null;
- }else{
- if(_37.prev){
- _37.prev.next=_37.next;
- }
- if(_37.next){
- _37.next.prev=_37.prev;
- }
- if(_37==this.first){
- this.first=_37.next;
- }
- if(_37==this.last){
- this.last=_37.prev;
- }
- }
- this.length--;
- _37.prev=null;
- _37.next=null;
- };
- var _38=function(){
- this.map={};
- this.list=new _32();
- };
- _38.prototype.add=function(key,val){
- if(typeof this.map[key]!=="undefined"){
- return;
- }
- var _39=new _33(val);
- this.map[key]=_39;
- this.list.append(_39);
- };
- _38.prototype.remove=function(key){
- if(typeof this.map[key]==="undefined"){
- return;
- }
- this.list.remove(this.map[key]);
- delete (this.map[key]);
- };
- var _3a=function(){
- this.channels={};
- };
- _3a.prototype={uid_counter:0};
- _3a.prototype.publish=function(_3b){
- setTimeout((function(_3c){
- var _3d=arguments;
- var _3e=this.channels;
- return function(){
- var _3f=Array.prototype.slice.call(_3d,1);
- var _40=_3e[_3c]&&_3e[_3c].list.first;
- while(_40){
- var _41=_40.data;
- setTimeout((function(_42,_43){
- return function(){
- _42.apply(this,_43);
- };
- }).call(this,_41,_3f),0);
- _40=_40.next;
- }
- };
- }).apply(this,arguments),0);
- };
- _3a.prototype.subscribe=function(_44,_45,_46){
- if(typeof this.channels[_44]==="undefined"){
- this.channels[_44]=new _38();
- }
- var _47=Array.prototype.slice.call(arguments,3);
- if(typeof _45._psb_uid=="undefined"){
- _45._psb_uid=++this.uid_counter;
- }
- var key=_45._psb_uid+":"+_46+":"+_47;
- this.channels[_44].add(key,function(){
- var _48=Array.prototype.slice.call(arguments,0);
- _45[_46].apply((_45||_1),_47.concat(_48));
- });
- };
- _3a.prototype.unsubscribe=function(_49,_4a,_4b){
- if(typeof this.channels[_49]==="undefined"){
- return;
- }
- var _4c=Array.prototype.slice.call(arguments,3);
- var key=_4a._psb_uid+":"+_4b+":"+_4c;
- this.channels[_49].remove(key);
- };
- function _4d(_4e){
- _4e._calc=function(_4f){
- return _4e.lineWidth%2?Math.floor(_4f)+0.5:Math.floor(_4f);
- };
- _4e._moveTo=function(x_,y_){
- _4e.moveTo(_4e._calc(x_),_4e._calc(y_));
- };
- _4e._lineTo=function(x_,y_){
- _4e.lineTo(_4e._calc(x_),_4e._calc(y_));
- };
- };
- var _50=[[60,1,15],[60*5,3,12],[60*30,2,12],[60*60*3,2,16],[60*60*12,4,16]];
- var _51=[[60,1,20],[60*5,4,18],[60*30,3,18],[60*60*3,3,20],[60*60*12,5,31]];
- var _52=[[60,1,30],[60*5,6,30],[60*30,5,30],[60*60*3,5,32],[60*60*12,8,31]];
- var _53=[[60,1,40],[60*5,8,42],[60*30,7,42],[60*60*3,7,40],[60*60*12,10,31]];
- var _54=[[60,1,60],[60*5,12,60],[60*30,10,60],[60*60*3,10,60],[60*60*12,15,31]];
- var _55=[[60,1,120],[60*5,24,120],[60*30,20,120],[60*60*3,20,120],[60*60*12,30,31]];
- var _56=function(_57){
- var _58=_57,_59=0,_5a=0,_5b=0,_5c=0,_5d=0,_5e=0,_5f=[],_60=[];
- this.model=function(){
- return _58;
- };
- this.min_time=function(){
- return _59;
- };
- this.max_time=function(){
- return _5a;
- };
- this.cache=function(){
- return _5f;
- };
- function _61(_62,_63){
- _59=_62;
- _5a=_63;
- _5b=_56.prototype.bucket_size;
- _5c=_56.prototype.min_buckets;
- _5d=_56.prototype.max_buckets;
- _5e=_56.prototype.bucket_ttl;
- _60.length=_5b;
- for(var i=0;i<_58.zoom_schema().length;i++){
- _5f[i]={};
- }
- for(var i=0;i<4;i++){
- var _64=[];
- _64.length=_5b;
- var _65=70-i*10;
- for(var j=0;j<_5b;j++){
- if(i==2){
- _64[j]=50;
- }else{
- _64[j]=_65+Math.random()*30;
- }
- }
- _5f[0][i]=_64;
- }
- var _66=_58.zoom_schema();
- if(_66.length>=2){
- __sum=function(x,y){
- return (x||0)+(y||0);
- };
- _sum=function(_67){
- return _12(__sum,_67,0);
- };
- _5f[1][0]=[];
- _5f[1][0].length=_5b;
- var k=0;
- for(i=0;i<4;i++){
- for(j=0;j<_5b;j+=5){
- _5f[1][0][k++]=_sum(_5f[0][i].slice(j,j+5))/5;
- }
- }
- var len=k;
- }
- if(_66.length>=3){
- _5f[2][0]=[];
- _5f[2][0].length=_5b;
- k=0;
- for(i=0;i<len;i+=6){
- _5f[2][0][k++]=_sum(_5f[1][0].slice(i,i+6))/6;
- }
- len=k;
- }
- if(_66.length>=4){
- _5f[3][0]=[];
- _5f[3][0].length=_5b;
- k=0;
- for(i=0;i<len;i+=6){
- _5f[3][0][k++]=_sum(_5f[2][0].slice(i,i+6))/6;
- }
- len=k;
- }
- if(_66.length>=5){
- _5f[4][0]=[];
- _5f[4][0].length=_5b;
- k=0;
- for(i=0;i<len;i+=4){
- _5f[4][0][k++]=_sum(_5f[3][0].slice(i,i+4))/4;
- }
- }
- var _68=_58.broker();
- _68.subscribe("/cache/flush",this,"_flush");
- };
- this.init=_61;
- function _69(_6a,_6b,_6c){
- var _6d=_5f[_6a];
- var _6e=Math.floor(_6b/_5b);
- var _6f=Math.floor(_6c/_5b);
- _6b-=_6e*_5b;
- _6c-=_6f*_5b;
- _6c+=1;
- if(_6e===_6f){
- var _70=_6d[_6e];
- if(!_70){
- _70=_60;
- }
- return _70.slice(_6b,_6c);
- }
- var _71=_6d[_6e];
- if(!_71){
- _71=_60;
- }
- var _72=_6d[_6f];
- if(!_72){
- _72=_60;
- }
- var _73=_71.slice(_6b,_5b);
- var _74=_72.slice(0,_6c);
- return _73.concat(_74);
- };
- this.fetch=_69;
- function _75(){
- };
- this._flush=_75;
- };
- _56.prototype={bucket_size:60*24,min_buckets:10,max_buckets:100,bucket_ttl:60*1000};
- var _76=function(_77,_78){
- var _79=_77,_7a=_78,_7b=_79.broker(),_7c=0,_7d=0,_7e=0,_7f=[],_80=_76.prototype.upkeep_interval;
- this.parent=function(){
- return _79;
- };
- this.zoom_schema=function(){
- return _7a;
- };
- this.zoom_level=function(){
- return _7a[_79.zoom_scale()];
- };
- this.zoom_delta=function(){
- return _7a[_79.zoom_scale()][0];
- };
- this.broker=function(){
- return _7b;
- };
- this.min_time=function(){
- return _7c;
- };
- this.max_time=function(){
- return _7d;
- };
- this._time_range=function(){
- return _7e;
- };
- this.data=function(){
- return _7f;
- };
- function _81(_82,_83,_84,_85){
- _7c=_82;
- _7d=_83;
- _7e=_7d-_7c;
- var _86=_84/_85;
- for(var i=0;i<_7a.length;i++){
- var _87=_7a[i];
- if(_7e<(_87[0]*_84)){
- _7a.length=i+1;
- _max_points=Math.floor(_7e/_87[0]);
- _7a[i][2]=Math.ceil(_max_points/_86);
- break;
- }
- }
- var _88=new _56(this);
- _88.init(_7c,_7d);
- _7f[0]=_88;
- setTimeout(_89,_80);
- };
- this.init=_81;
- function _8a(_8b,_8c,_8d){
- var _8e=_8c+_8d;
- var _8f=[];
- for(var i=_7f.length-1;i>=0;i--){
- _8f.push(_7f[i].fetch(_8b,_8c,_8e));
- }
- _8f.reverse();
- return _8f;
- };
- this.fetch=_8a;
- function _89(){
- _7b.publish("/cache/flush");
- setTimeout(_89,_80);
- };
- };
- _76.prototype={upkeep_interval:60*1000};
- var _90=1.25;
- if($.browser.msie){
- _90=1.6;
- }
- var _91=16;
- var _92=0;
- var _93="rgb(194,218,241)";
- if($.browser.msie){
- _92=-1;
- }
- var _94=5;
- var _95=function(_96,_97){
- var _98=_96,_99=_98.model(),_9a=0,_9b=0,_9c=_97,_9d=Math.floor(_9c/2),_9e=0,_9f=0,_a0=null,_a1=null,_a2=null,c=null,_a3=null,_a4=[],_a5=0,_a6=0;
- this.parent=function(){
- return _98;
- };
- this.time_offset=function(){
- return _9a;
- };
- this._data_offset=function(){
- return _9b;
- };
- this.container=function(){
- return _a0;
- };
- this.canvas=function(){
- return _a2;
- };
- this.offset=function(){
- return parseInt(_a1.left,10);
- };
- this.c=function(){
- return c;
- };
- this.tape=function(){
- return _a3;
- };
- this._data=function(){
- return _a4;
- };
- this._min_y=function(){
- return _a5;
- };
- this._max_y=function(){
- return _a6;
- };
- function _a7(){
- _9e=_98.draw_height();
- _9f=_98.chart_height();
- _a0=$(["<div","style=\"","position:\tabsolute;","left:\t\t0px;","top:\t\t0px;","z-index:\t0;","width:\t\t"+_9c+"px;","height:\t"+_9e+"px;","\"></div>"].join(" ")).appendTo(_98.container());
- _a1=_a0[0].style;
- _a2=_2.createElement("canvas");
- _a2.width=_9c;
- _a2.height=_9f;
- var _a8=$(_a2);
- _a8.css("position","absolute");
- _a8.css("left","0px");
- _a8.css("top","0px");
- _a8.css("z-index","0");
- _a8.css("width",_9c+"px");
- _a8.css("height",_9f+"px");
- _a8.appendTo(_a0);
- if($.browser.msie){
- _a2=_1.G_vmlCanvasManager.initElement(_a2);
- }
- c=_a2.getContext("2d");
- _4d(c);
- if($.browser.msie&&c.setTransform){
- c.setTransform(1,0,0,-1,0,_9f);
- }
- _a3=$(["<div","style=\"","position:\t\tabsolute;","left:\t\t\t0px;","top:\t\t\t"+_9f+"px;","z-index:\t\t0;","width:\t\t\t"+_9c+"px;","height:\t\t"+(_9e-_9f)+"px;","text-align:\tleft;","\"></div>"].join(" ")).appendTo(_a0);
- var _a9=_98.broker();
- _a9.subscribe("/pane/translate",this,"translate");
- _a9.subscribe("/pane/redraw",this,"_draw");
- };
- this.init=_a7;
- function _aa(_ab){
- _a1.left=(parseInt(_a1.left,10)+_ab)+"px";
- };
- this.translate=_aa;
- function _ac(_ad){
- if($.browser.msie&&c.setTransform){
- _ac=function(_ae){
- c.lineWidth=1;
- c.beginPath();
- c.strokeStyle="rgb(200,200,200)";
- c._moveTo(_ae,0);
- c._lineTo(_ae,_9f);
- c.stroke();
- c.beginPath();
- c.strokeStyle="rgb(100,100,100)";
- c._moveTo(_ae,0);
- c._lineTo(_ae,_94);
- c.stroke();
- };
- }else{
- _ac=function(_af){
- c.lineWidth=1;
- c.beginPath();
- c.strokeStyle="rgb(200,200,200)";
- c._moveTo(_af,0);
- c._lineTo(_af,_9f);
- c.stroke();
- c.beginPath();
- c.strokeStyle="rgb(100,100,100)";
- c._moveTo(_af,_9f);
- var _b0=_9f-_94;
- c._lineTo(_af,_b0);
- c.stroke();
- };
- }
- return _ac(_ad);
- };
- this.__grid_x=_ac;
- function _b1(_b2){
- if($.browser.msie&&c.setTransform){
- _b1=function(_b3){
- c.lineWidth=1;
- c.strokeStyle="rgb(200,200,200)";
- for(var i=_b3.length-1;i>=0;i--){
- c.beginPath();
- var y=_b3[i];
- c._moveTo(0,y);
- c._lineTo(_9c,y);
- c.stroke();
- }
- };
- }else{
- _b1=function(_b4){
- c.lineWidth=1;
- c.strokeStyle="rgb(200,200,200)";
- for(var i=_b4.length-1;i>=0;i--){
- c.beginPath();
- var _b5=_9f-_b4[i];
- c._moveTo(0,_b5);
- c._lineTo(_9c,_b5);
- c.stroke();
- }
- };
- }
- return _b1(_b2);
- };
- this.__grid_y=_b1;
- function _b6(_b7,_b8,_b9){
- if($.browser.msie&&c.setTransform){
- _b6=function(_ba,_bb,_bc){
- c.lineWidth=_90;
- c.strokeStyle="rgb(25,106,227)";
- c.lineJoin="miter";
- c.beginPath();
- c._moveTo(-1*_ba,(_bc[-1]||0)*_bb);
- c._lineTo(0,(_bc[0]||0)*_bb);
- var i=1;
- var _bd=_bc.length-2;
- var n=_bd%8;
- while(n--){
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- }
- n=parseInt(_bd/8,10);
- while(n--){
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- c._lineTo(i*_ba,(_bc[i]||0)*_bb);
- i++;
- }
- c._lineTo(_9c,(_bc[_bc.length-1]||0)*_bb);
- c._lineTo(_9c+1,(_bc[_bc.length-1]||0)*_bb);
- c.stroke();
- c._lineTo(_9c+1,0);
- c._lineTo(-1*_ba,0);
- c.fillStyle="rgba(183,220,255, 0.4)";
- c.fill();
- };
- }else{
- _b6=function(_be,_bf,_c0){
- c.lineWidth=_90;
- c.strokeStyle="rgb(25,106,227)";
- c.lineJoin="miter";
- c.beginPath();
- c._moveTo(-1*_be,_9f-(_c0[-1]||0)*_bf);
- c._lineTo(0,_9f-(_c0[0]||0)*_bf);
- var i=1;
- var _c1=_c0.length-2;
- var n=_c1%8;
- while(n--){
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- }
- n=parseInt(_c1/8,10);
- while(n--){
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- c._lineTo(i*_be,_9f-(_c0[i]||0)*_bf);
- i++;
- }
- c._lineTo(_9c,_9f-(_c0[_c0.length-1]||0)*_bf);
- c._lineTo(_9c+1,_9f-(_c0[_c0.length-1]||0)*_bf);
- c.stroke();
- c.fillStyle="rgba(183,220,255, 0.4)";
- c._lineTo(_9c+1,_9f);
- c._lineTo(-1*_be,_9f);
- c.fill();
- };
- }
- return _b6(_b7,_b8,_b9);
- };
- this.__plot=_b6;
- function _c2(_c3,_c4){
- _a3.append(["<div","class=\"tape-tick\"","style=\"","position:\tabsolute;","left:\t\t"+_c3+"px;","top:\t\t0px;","z-index:\t0;","width:\t\t"+_9c+"px;","\">"+_c4+"</div>"].join(" "));
- };
- this.__tape_marker=_c2;
- function _c5(){
- _a4=_99.fetch(_98.zoom_scale(),_9b-1,_98._pane_period()+1);
- if(_a4.length===0){
- _a5=0;
- _a6=0;
- return;
- }
- var i,j,_c6;
- for(i=_a4.length-1;i>=0;i--){
- _c6=_a4[i];
- _c6[-1]=_c6.shift();
- }
- _a5=_a6=_a4[0][0]||0;
- for(i=_a4.length-1;i>=0;i--){
- _c6=_a4[i];
- for(j=_c6.length-1;j>=0;j--){
- var _c7=_c6[j]||0;
- _a5=Math.min(_a5,_c7);
- _a6=Math.max(_a6,_c7);
- }
- }
- };
- function _c8(){
- c.clearRect(0,0,_9c,_9e);
- _a3.empty();
- var _c9=_98._x_scale();
- var _ca=_98._y_scale();
- var _cb=_98._x_tick()(_9a);
- var _cc=(_cb[0]/_99.zoom_delta())*_c9;
- if(_cc<_9c){
- _ac(_cc);
- _c2(_cc,_cb[1]);
- }
- _b1(_98._y_intervals());
- for(var i=_a4.length-1;i>=0;i--){
- _b6(_c9,_ca,_a4[i]);
- }
- };
- this._draw=_c8;
- function _cd(_ce,_cf){
- _9b=_ce;
- _a1.left=_cf+"px";
- _9a=_99.min_time()+_9b*_99.zoom_delta();
- _c5();
- };
- this._reset=_cd;
- function _d0(_d1,_d2){
- _cd(_d1,_d2);
- _c8();
- };
- this.reset=_d0;
- function _d3(_d4,_d5){
- if(_a4.length===0){
- return [0,0];
- }
- var min,max;
- min=max=_a4[0][_d4]||0;
- for(var i=_a4.length-1;i>=0;i--){
- var _d6=_a4[i].slice(_d4,_d5);
- for(var j=_d6.length-1;j>=0;j--){
- var _d7=_d6[j]||0;
- min=Math.min(min,_d7);
- max=Math.max(max,_d7);
- }
- }
- return [min,max];
- };
- this.range_min_max_y=_d3;
- };
- NAV_HEIGHT=75;
- NAV_BUTTON_HEIGHT=13;
- NAV_BUTTON_WIDTH=16;
- NAV_SCROLL_RATE=1000*0.1;
- NAV_SCROLL_SPEED=50;
- NAV_SCROLL_MIN_WIDTH=20;
- NAV_SCROLL_MID_THRESHOLD=60;
- NAV_OVERVIEW_TOP_OFFSET=5;
- NAV_OVERVIEW_SCALE_FACTOR=1.1;
- NAV_RANGE_OFFSET=-9;
- NAV_RANGE_WIDTH=13;
- NAV_RANGE_CENTER_THRESHOLD=13;
- NAV_RANGE_CENTER_OFFSET=-8;
- var _d8=function(_d9){
- var _da=_d9,_db=_da.model(),_dc=_da.broker(),_dd=0,_de=0,_df=null,_e0=null,_e1=null,_e2=null,_e3=null,_e4=0,_e5=null,oc=null,_e6=null,_e7=null,pc=null,_e8=[],_e9=0,_ea=0,_eb=null,_ec=null,_ed=0,_ee=null,_ef=null,_f0=null,_f1=1,_f2=null,_f3=null,_f4=null,_f5=null,_f6=false,_f7=false;
- this.parent=function(){
- return _da;
- };
- this.model=function(){
- return _db;
- };
- this.width=function(){
- return _dd;
- };
- this.height=function(){
- return _de;
- };
- this.container=function(){
- return _df;
- };
- this.zoom_level=function(){
- return _e3;
- };
- this.overview_left=function(){
- return _e4;
- };
- this.overview=function(){
- return _e5;
- };
- this.oc=function(){
- return oc;
- };
- this.preview=function(){
- return _e6;
- };
- this._preview=function(){
- return _e7;
- };
- this.pc=function(){
- return pc;
- };
- this._data=function(){
- return _e8;
- };
- this._x_scale=function(){
- return _e9;
- };
- this._y_scale=function(){
- return _ea;
- };
- this.viewer=function(){
- return _eb;
- };
- this._viewer=function(){
- return _ec;
- };
- this.viewer_width=function(){
- return _ed;
- };
- this.slider=function(){
- return _ee;
- };
- this._slider=function(){
- return _ef;
- };
- this.slider_middle=function(){
- return _f0;
- };
- this.drag_modifier=function(){
- return _f1;
- };
- this.range_min=function(){
- return _f2;
- };
- this._range_min=function(){
- return _f3;
- };
- this.range_max=function(){
- return _f4;
- };
- this._range_max=function(){
- return _f5;
- };
- function _f8(_f9,_fa,_fb,_fc){
- _f9.clearRect(0,0,_e5.width,_e5.height);
- _f9.lineWidth=1;
- _f9.strokeStyle=_fa;
- _f9.lineJoin="round";
- _f9.beginPath();
- _f9._moveTo(_e5.width,_e5.height-(_e8[_e8.length-2]||0)*_ea);
- for(var i=_e8.length-3;i>0;i--){
- _f9._lineTo(i*_e9,_e5.height-(_e8[i]||0)*_ea);
- }
- _f9._lineTo(0,_e5.height-(_e8[0]||0)*_ea);
- _f9.stroke();
- _f9.fillStyle=_fb;
- _f9._lineTo(0,_e5.height);
- _f9._lineTo(_e5.width,_e5.height);
- _f9.fill();
- _f9.lineWidth=1;
- _f9.strokeStyle=_fc;
- _f9.lineJoin="round";
- _f9.beginPath();
- _f9.moveTo(0,_e5.height);
- _f9.lineTo(0,0);
- _f9.lineTo(_e5.width,0);
- _f9.lineTo(_e5.width,_e5.height);
- _f9.stroke();
- };
- function _fd(_fe,_ff,_100,top_,_101){
- _dd=_ff;
- _de=_100;
- _df=$(["<div","style=\"","position:\t\tabsolute;","left:\t\t\t"+_101+"px;","top:\t\t\t"+top_+"px;","width:\t\t\t"+_dd+"px;","height:\t\t"+_de+"px;","\"></div>"].join(" ")).appendTo(_fe);
- _e0=$(["<div","class=\"nav-left-unsel\"","style=\"","position:\tabsolute;","overflow:\thidden;","left:\t\t"+(-_146)+"px;","top:\t\t"+(NAV_HEIGHT-NAV_BUTTON_HEIGHT)+"px;","width:\t \t"+NAV_BUTTON_WIDTH+"px;","height:\t"+NAV_BUTTON_HEIGHT+"px;","\"></div>"].join(" ")).appendTo(_df);
- _e1=$(["<div","class=\"nav-unsel nav-right-unsel\"","style=\"","position:\tabsolute;","overflow:\thidden;","left:\t\t"+(-_146+NAV_BUTTON_WIDTH)+"px;","top:\t\t"+(NAV_HEIGHT-NAV_BUTTON_HEIGHT)+"px;","width:\t\t"+NAV_BUTTON_WIDTH+"px;","height:\t"+NAV_BUTTON_HEIGHT+"px;","\"></div>"].join(" ")).appendTo(_df);
- _e2=$(["<div","style=\"","position:\t\tabsolute;","left:\t\t\t"+(_146+2*NAV_BUTTON_WIDTH)+"px;","top:\t\t\t"+(NAV_HEIGHT-NAV_BUTTON_HEIGHT)+"px;","width:\t\t\t"+(_dd-_146-2*NAV_BUTTON_WIDTH)+"px;","height:\t\t"+(NAV_BUTTON_HEIGHT)+"px;","font-size:\t\t0px;","border-top:\t1px solid #aaa;","border-right:\t1px solid #aaa;","border-bottom:\t1px solid #aaa;","\"></div>"].join(" ")).appendTo(_df);
- _e5=_2.createElement("canvas");
- _e5.width=_dd-2*NAV_BUTTON_WIDTH;
- _e5.height=NAV_HEIGHT-NAV_BUTTON_HEIGHT-NAV_OVERVIEW_TOP_OFFSET;
- _e4=_146+2*NAV_BUTTON_WIDTH;
- var _102=$(_e5);
- _102.css("position","absolute");
- _102.css("left",_e4+"px");
- _102.css("top",NAV_OVERVIEW_TOP_OFFSET+"px");
- _102.css("z-index","0");
- _102.css("width",_e5.width+"px");
- _102.css("height",_e5.height+"px");
- _102.appendTo(_df);
- if($.browser.msie){
- _e5=_1.G_vmlCanvasManager.initElement(_e5);
- }
- oc=_e5.getContext("2d");
- _4d(oc);
- var _103=_db.zoom_schema().length-1;
- _e3=_db.zoom_schema()[_103];
- _e8=_db.fetch(_103,0,Math.ceil(_db._time_range()/_e3[0]));
- _e8=_e8[0]||[];
- _e9=_e5.width/(_e8.length-1);
- var _104,_105,_106;
- _104=_105=_e8[_e8.length-1]||0;
- for(var i=_e8.length-2;i>=0;i--){
- _106=_e8[i]||0;
- _104=_106<_104?_106:_104;
- _105=_106>_105?_106:_105;
- }
- _105=(_105-_104)*NAV_OVERVIEW_SCALE_FACTOR+_104;
- _ea=(_e5.height-1)/(_105-_104);
- _f8(oc,"rgb(225,225,225)","rgba(200,200,200,0.2)","rgb(200,200,200)");
- _ee=$(["<div","class=\"nav-slider\"","style=\"","display:\t\tnone;","position:\t\tabsolute;","overflow:\t\thidden;","left:\t\t\t"+_e4+"px;","top:\t\t\t"+(NAV_HEIGHT-NAV_BUTTON_HEIGHT)+"px;","width:\t \t\t10px;","height:\t\t"+NAV_BUTTON_HEIGHT+"px;","text-align:\tcenter;","\"></div>"].join(" ")).appendTo(_df);
- _ef=_ee[0];
- _ee.append(["<img","src=\"/assets/slider.left.gif\"","style=\"","position:\tabsolute;","top:\t\t0px;","left:\t\t0px;","\"/>"].join(" "));
- _ee.append(["<img","src=\"/assets/slider.right.gif\"","style=\"","position:\tabsolute;","top:\t\t0px;","right:\t\t0px;","\"/>"].join(" "));
- _f0=$(["<img","src=\"/assets/slider.middle.gif\"","style=\"","display:\tnone;","\"/>"].join(" ")).appendTo(_ee);
- _eb=$(["<div","class=\"nav-viewer\"","style=\"","position:\t\t\tabsolute;","left:\t\t\t\t"+_e4+"px;","top:\t\t\t\t0px;","width:\t\t\t\t1px;","height:\t\t\t"+(NAV_HEIGHT-NAV_BUTTON_HEIGHT)+"px;","\"></div>"].join(" ")).appendTo(_df);
- _ec=_eb[0];
- var _107=$(["<div","style=\"","position:\tabsolute;","overflow:\thidden;","left:\t\t0px;","top:\t\t0px;","width:\t\t100%;","height:\t100%;","\"><div>"].join(" ")).appendTo(_eb);
- _e6=_2.createElement("canvas");
- _e6.width=_e5.width;
- _e6.height=_e5.height;
- _e7=$(_e6);
- _e7.css("position","absolute");
- _e7.css("left",(-_146)+"px");
- _e7.css("top",NAV_OVERVIEW_TOP_OFFSET+"px");
- _e7.css("width",_e6.width+"px");
- _e7.css("height",_e6.height+"px");
- _e7.css("z-index","0");
- _e7.css("border-bottom","1px solid #aaa");
- _e7.appendTo(_107);
- if($.browser.msie){
- _e6=_1.G_vmlCanvasManager.initElement(_e6);
- }
- pc=_e6.getContext("2d");
- _4d(pc);
- _f8(pc,"rgb(25,106,227)","rgba(25,106,227,0.1)","rgb(200,200,200)");
- _eb.css("display","none");
- _f2=$(["<img","src=\"/assets/range.gif\"","style=\"","position:\tabsolute;","top:\t\t"+Math.floor(_e6.height/2)+"px;","left:\t\t"+NAV_RANGE_OFFSET+"px;","cursor:\tcol-resize;","\"/>"].join(" ")).appendTo(_eb);
- _f3=_f2[0];
- _f4=$(["<img","src=\"/assets/range.gif\"","style=\"","position:\tabsolute;","top:\t\t"+Math.floor(_e6.height/2)+"px;","right:\t\t"+NAV_RANGE_OFFSET+"px;","cursor:\tcol-resize;","\"/>"].join(" ")).appendTo(_eb);
- _f5=_f4[0];
- _f6=true;
- _6(_e0[0],"mousedown",_108);
- _6(_e1[0],"mousedown",_109);
- _6(_ef,"mousedown",_10a);
- _ef.onmousedown=function(e){
- return _e(e);
- };
- _6(_ec,"mousedown",_10a);
- _ec.onmousedown=function(e){
- return _e(e);
- };
- _df.hover(_120,_121);
- _6(_f3,"mousedown",_122);
- _f3.onmousedown=function(e){
- return _e(e);
- };
- _6(_f5,"mousedown",_124);
- _f5.onmousedown=function(e){
- return _e(e);
- };
- _dc.subscribe("/nav/center",this,"center");
- _dc.subscribe("/nav/translate",this,"translate");
- _dc.subscribe("/nav/range/update",this,"update_range");
- _dc.subscribe("/nav/center",this,"post_init");
- };
- this.init=_fd;
- function _10b(){
- _dc.unsubscribe("/nav/center",this,"post_init");
- _eb.css("display","inline");
- _ee.css("display","inline");
- };
- this.post_init=_10b;
- function _10c(){
- var _10d=_e5.width-2;
- _10c=function(){
- var _10e=_da._chart_period()*_db.zoom_delta()/_e3[0];
- _ed=Math.max(1,Math.min(_10d,Math.floor(_10e*_e9)));
- _ec.style.width=_ed+"px";
- _ef.style.width=Math.max(NAV_SCROLL_MIN_WIDTH,_ed)+"px";
- if(_ed>NAV_SCROLL_MID_THRESHOLD){
- _f0.css("display","inline");
- }else{
- _f0.css("display","none");
- }
- _10f();
- _f1=(_e3[0]/_db.zoom_delta())*_da._x_scale()/_e9;
- var _110=_eb.width();
- if(_110>NAV_RANGE_CENTER_THRESHOLD){
- _f3.style.left=NAV_RANGE_OFFSET+"px";
- if(_f6){
- _f4.css("display","inline");
- }
- }else{
- _f3.style.left=Math.floor(_110/2+NAV_RANGE_CENTER_OFFSET)+"px";
- _f4.css("display","none");
- }
- };
- return _10c();
- };
- this.center=_10c;
- function _10f(){
- var _111=_da.width()/2;
- var _112=_e5.width-2;
- var _113=_112+_e4;
- _10f=function(){
- var _114=_da.min_pixel();
- var _115=_da.max_pixel();
- var _116=_da.center_pixel();
- var _117=_114-_111;
- var _118=_115+_111;
- var _119;
- if(_116<_115){
- _119=_e4;
- if(_116>_114){
- var _11a=_118-_117;
- _119+=(_116-_117)/_11a*_112;
- _119-=(_ed/2);
- _119=Math.round(_119);
- }
- }else{
- _119=_113-_ed;
- }
- _119=Math.min((_113-_ed),_119);
- _119=Math.max(_e4,_119);
- _e6.style.left=(_e4-_119)+"px";
- _ec.style.left=_119+"px";
- if(_ed<NAV_SCROLL_MIN_WIDTH){
- _119-=NAV_SCROLL_MIN_WIDTH-_ed;
- }
- _ef.style.left=Math.max(_e4,_119)+"px";
- };
- return _10f();
- };
- this.translate=_10f;
- function _108(e){
- _e1[0].className="nav-right-unsel nav-sel";
- _e0[0].className="nav-left-sel";
- _6(_2,"mouseup",_11b);
- _dc.publish("/chart/draw/start");
- _dc.publish("/chart/scroll/start",1);
- };
- function _11b(e){
- _e1[0].className="nav-right-unsel nav-unsel";
- _e0[0].className="nav-left-unsel";
- _a(_2,"mouseup",_11b);
- _dc.publish("/chart/draw/stop");
- _dc.publish("/chart/scroll/stop");
- };
- function _109(e){
- _e1[0].className="nav-right-sel nav-sel";
- _6(_2,"mouseup",_11c);
- _dc.publish("/chart/draw/start");
- _dc.publish("/chart/scroll/start",-1);
- };
- function _11c(e){
- _e1[0].className="nav-right-unsel nav-unsel";
- _a(_2,"mouseup",_11c);
- _dc.publish("/chart/draw/stop");
- _dc.publish("/chart/scroll/stop");
- };
- function _10a(e){
- e=e?e:_1.event;
- _6(_2,"mousemove",_11d);
- _eb._drag_x=e.clientX;
- _6(_2,"mouseup",_11e);
- _dc.publish("/chart/draw/start");
- };
- function _11d(e){
- e=e?e:_1.event;
- var _11f=e.clientX-_eb._drag_x;
- if(Math.abs(_11f)<=1){
- return _e(e);
- }
- _eb._drag_x=e.clientX;
- _11f=-1*Math.floor(_f1*_11f);
- _dc.publish("/chart/translate",_11f);
- return _e(e);
- };
- function _11e(e){
- _a(_2,"mousemove",_11d);
- _a(_2,"mouseup",_11e);
- _dc.publish("/chart/draw/stop");
- };
- function _120(e){
- _f6=true;
- _f2.css("display","inline");
- if(_eb.width()>NAV_RANGE_CENTER_THRESHOLD){
- _f4.css("display","inline");
- }
- };
- function _121(e){
- _f6=false;
- _f2.css("display","none");
- _f4.css("display","none");
- };
- function _122(e){
- _f7=true;
- _123(e);
- };
- function _124(e){
- _f7=false;
- _123(e);
- };
- function _123(e){
- e=e?e:_1.event;
- _6(_2,"mousemove",_125);
- _eb._range_x=e.clientX;
- _6(_2,"mouseup",_126);
- _dc.publish("/chart/draw/start");
- };
- function _127(_128,_129){
- var _12a=_e5.width-2;
- var _12b=_db.zoom_schema();
- var _12c=_da.width()/_da._pane_width();
- var _12d=Math.floor(_da.width()/2);
- _127=function(_12e,_12f){
- var _130=Math.min(_12e,_12f);
- var _131=Math.max(_12e,_12f);
- var _132=_130===_12f?true:false;
- var _133=Math.max(0,_130-_e4);
- var _134=Math.min(_12a,_131-_e4);
- var _135=(_134-_133)/_12a;
- var _136=Math.floor(_db._time_range()*_135);
- var _137,_138;
- for(var i=0;i<_12b.length;i++){
- _138=i;
- _137=_12b[_138];
- if((_137[0]*_137[2]*_12c)>=_136){
- break;
- }
- }
- var _139,_13a;
- for(i=_137[1];i<=_137[2];i++){
- _139=i;
- _13a=_137[0]*i*_12c;
- if(_13a>=_136){
- break;
- }
- }
- var _13b=_13a/2;
- var _13c;
- if(_132){
- _13c=_db.min_time();
- _13c+=_db._time_range()*(_133/_12a);
- _13c+=_13b;
- }else{
- _13c=_db.min_time();
- _13c+=_db._time_range()*(_134/_12a);
- _13c-=_13b;
- }
- _13c=Math.floor(_13c);
- _da._update_zoom(_138,_139);
- _da.center(_13c,_12d);
- };
- return _127(_128,_129);
- };
- this.update_range=_127;
- function _125(e){
- e=e?e:_1.event;
- if(Math.abs(e.clientX-_eb._range_x)<=1){
- return _e(e);
- }
- _eb._range_x=e.clientX;
- var _13d=parseInt(_ec.style.left,10);
- var _13e;
- if(_f7){
- _13e=_eb.offset().left-e.clientX;
- var _13f=_13d-_13e;
- var _140=_13d+_eb.width();
- if(_13f>_140){
- _f7=false;
- return _e(e);
- }
- _dc.publish("/nav/range/update",_13f,_140);
- }else{
- var _141=_eb.width();
- _13e=(_eb.offset().left+_141)-e.clientX;
- var _142=_13d+_141-_13e;
- if(_142<_13d){
- _f7=true;
- return _e(e);
- }
- _dc.publish("/nav/range/update",_142,_13d);
- }
- return _e(e);
- };
- function _126(e){
- _a(_2,"mousemove",_125);
- _a(_2,"mouseup",_126);
- _dc.publish("/chart/draw/stop");
- };
- };
- var _143=720;
- var _144=6;
- var _145=3;
- var _146=1;
- var _147=1;
- var _148=25;
- var _149="rgb(175,175,175)";
- var _14a=0.5;
- var _14b=1000/25;
- var _14c=1000*0.5;
- if($.browser.msie){
- _14b=4*1000;
- _14c=1000;
- }
- var _14d=1.1;
- var _14e=100;
- var _14f=4;
- var _150=-12;
- var _151="W";
- var _152=0.5;
- var _153=2;
- if($.browser.msie){
- _152=0.75;
- }
- var _154=[60,60*5,60*10,60*15,60*30,60*60,60*60*3,60*60*6,60*60*12,60*60*24,60*60*24*7,60*60*24*14,60*60*24*31];
- var _155=new Date();
- var _156=function(_157){
- if(_157.getSeconds()!==0){
- return _158(_157,"h:mm:ss a");
- }
- if(_157.getMinutes()!==0){
- return _158(_157,"h:mm a");
- }
- if(_157.getHours()!==0){
- return _158(_157,"h a");
- }
- if(_157.getDay()!==1){
- return _158(_157,"MMM d");
- }
- if(_157.getMonth()!==0){
- return _158(_157,"MMM");
- }
- return _158(_157,"yyyy");
- };
- var _159=function(_15a){
- _155.setTime(_15a*1000);
- if(_155.getSeconds()!==0){
- _155.setSeconds(60);
- }
- return [(_155.getTime()/1000)-_15a,_156(_155)];
- };
- var _15b=function(_15c){
- _155.setTime(_15c*1000);
- var _15d=_155.getMinutes();
- var _15e=_15d%10;
- if(_155.getSeconds()!==0||_15e!==0){
- _155.setSeconds(0);
- _155.setMinutes(_15d+(10-_15e));
- }
- return [(_155.getTime()/1000)-_15c,_156(_155)];
- };
- var _15f=function(_160){
- _155.setTime(_160*1000);
- var _161=_155.getMinutes();
- var _162=_161%5;
- if(_155.getSeconds()!==0||_162!==0){
- _155.setSeconds(0);
- _155.setMinutes(_161+(5-_162));
- }
- return [(_155.getTime()/1000)-_160,_156(_155)];
- };
- var _163=function(_164){
- _155.setTime(_164*1000);
- var _165=_155.getMinutes();
- var _166=_165%15;
- if(_155.getSeconds()!==0||_166!==0){
- _155.setSeconds(0);
- _155.setMinutes(_165+(15-_166));
- }
- return [(_155.getTime()/1000)-_164,_156(_155)];
- };
- var _167=function(_168){
- _155.setTime(_168*1000);
- var _169=_155.getMinutes();
- var _16a=_169%30;
- if(_155.getSeconds()!==0||_16a!==0){
- _155.setSeconds(0);
- _155.setMinutes(_169+(30-_16a));
- }
- return [(_155.getTime()/1000)-_168,_156(_155)];
- };
- var _16b=function(_16c){
- _155.setTime(_16c*1000);
- if(_155.getSeconds()!==0||_155.getMinutes()!==0){
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(_155.getHours()+1);
- }
- return [(_155.getTime()/1000)-_16c,_156(_155)];
- };
- var _16d=function(_16e){
- _155.setTime(_16e*1000);
- var _16f=_155.getHours();
- var _170=_16f%3;
- if(_155.getSeconds()!==0||_155.getMinutes()!==0||_170!==0){
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(_16f+(3-_170));
- }
- return [(_155.getTime()/1000)-_16e,_156(_155)];
- };
- var _171=function(_172){
- _155.setTime(_172*1000);
- var _173=_155.getHours();
- var _174=_173%6;
- if(_155.getSeconds()!==0||_155.getMinutes()!==0||_174!==0){
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(_173+(6-_174));
- }
- return [(_155.getTime()/1000)-_172,_156(_155)];
- };
- var _175=function(_176){
- _155.setTime(_176*1000);
- var _177=_155.getHours();
- var _178=_177%12;
- if(_155.getSeconds()!==0||_155.getMinutes()!==0||_178!==0){
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(_177+(12-_178));
- }
- return [(_155.getTime()/1000)-_176,_156(_155)];
- };
- var _179=function(_17a){
- _155.setTime(_17a*1000);
- if(_155.getSeconds()!==0||_155.getMinutes()!==0||_155.getHours()!==0){
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(24);
- }
- return [(_155.getTime()/1000)-_17a,_156(_155)];
- };
- var _17b=60*60*24*7;
- var _17c=function(_17d){
- _155.setTime(_17d*1000);
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(0);
- _155.setMonth(0,1);
- var _17e=_155.getTime()/1000;
- var _17f=_17d-_17e;
- return [_17b-(_17f%_17b),_156(_155)];
- };
- var _180=2*_17b;
- var _181=function(_182){
- _155.setTime(_182*1000);
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(0);
- _155.setMonth(0,1);
- var _183=_155.getTime()/1000;
- var _184=_182-_183;
- return [_180-(_184%_180),_156(_155)];
- };
- var _185=function(_186){
- _155.setTime(_186*1000);
- if(_155.getSeconds()!==0||_155.getMinutes()!==0||_155.getHours()!==0||_155.getDay()!==1||_155.getMonth()!==0){
- _155.setSeconds(0);
- _155.setMinutes(0);
- _155.setHours(0);
- _155.setMonth(_155.getMonth()+1,1);
- }
- return [(_155.getTime()/1000)-_186,_156(_155)];
- };
- var _187=function(_188){
- _155.setTime(_188*1000);
- return [0,_156(_155)];
- };
- var _189={};
- _189[60]=_159;
- _189[60*5]=_15f;
- _189[60*10]=_15b;
- _189[60*15]=_163;
- _189[60*30]=_167;
- _189[60*60]=_16b;
- _189[60*60*3]=_16d;
- _189[60*60*6]=_171;
- _189[60*60*12]=_175;
- _189[60*60*24]=_179;
- _189[60*60*24*7]=_17c;
- _189[60*60*24*14]=_181;
- _189[60*60*24*31]=_185;
- var _18a=function(_18b,_18c){
- var lo=0;
- var hi=_18b.length;
- while(lo<hi){
- var mid=Math.floor((lo+hi)/2);
- if(_18b[mid]<_18c){
- lo=mid+1;
- }else{
- hi=mid;
- }
- }
- return lo;
- };
- var _18d=[[60*5,"5m"],[60*30,"30m"],[60*60,"1h"],[60*60*6,"6h"],[60*60*12,"12h"],[60*60*24,"1d"],[60*60*24*7,"1w"],[60*60*24*7*2,"2w"],[60*60*24*31,"1M"],[60*60*24*31*3,"3M"]];
- var _18e=function(_18f){
- var _190=$(_18f),_191=null,_192=null,_193=null,_194=0,_195=0,_196=0,_197=0,_198=null,_199=null,_19a=null,_19b=null,_19c=null,_19d=null,_19e=null,_19f=false,_1a0=0,_1a1=1,_1a2=0,_1a3=0,_1a4=0,_1a5=0,_1a6=_187,_1a7=0,_1a8=[],_1a9=[],bg=null,_1aa=0,_1ab=0,_1ac=0,_1ad=new _3a(),_1ae=false,_1af=0,_1b0=_3,_1b1=0,_1b2=0,_1b3=0,_1b4=0,nav=null,_1b5=0,_1b6=false,_1b7=0;
- this.target=function(){
- return _190;
- };
- this.model=function(){
- return _191;
- };
- this.container=function(){
- return _192;
- };
- this.y_labels=function(){
- return _193;
- };
- this.width=function(){
- return _194;
- };
- this.max_left=function(){
- return _195;
- };
- this.max_right=function(){
- return _196;
- };
- this.height=function(){
- return _197;
- };
- this.top_pane=function(){
- return _198;
- };
- this.zoom_scale=function(){
- return _1a0;
- };
- this._pane_period=function(){
- return _1a1;
- };
- this._pane_width=function(){
- return _1a2;
- };
- this.max_y=function(){
- return _1a3;
- };
- this.min_y=function(){
- return _1a4;
- };
- this._x_scale=function(){
- return _1a5;
- };
- this._x_tick=function(){
- return _1a6;
- };
- this._y_scale=function(){
- return _1a7;
- };
- this._y_intervals=function(){
- return _1a8;
- };
- this.panes=function(){
- return _1a9;
- };
- this.bg=function(){
- return bg;
- };
- this.draw_width=function(){
- return _1aa;
- };
- this.draw_height=function(){
- return _1ab;
- };
- this.chart_height=function(){
- return _1ac;
- };
- this.broker=function(){
- return _1ad;
- };
- this.updating=function(){
- return _1ae;
- };
- this.update_delta=function(){
- return _1af;
- };
- this.update_id=function(){
- return _1b0;
- };
- this.update_time=function(){
- return _1b1;
- };
- this.center_pixel=function(){
- return _1b2;
- };
- this.min_pixel=function(){
- return _1b3;
- };
- this.max_pixel=function(){
- return _1b4;
- };
- this.nav=function(){
- return nav;
- };
- this.scroll_id=function(){
- return _1b7;
- };
- function _1b8(){
- var _1b9=_194/_1a2;
- var map={};
- for(var i=_1a2;i>0;i--){
- map[i]=_1b9*i;
- }
- _1b8=function(){
- return map[_1a1];
- };
- return _1b8();
- };
- this._chart_period=_1b8;
- function _1ba(){
- _1a5=_1a2/_1a1;
- var _1bb=_18a(_154,_191.zoom_delta()*_1a1);
- var _1bc=_189[_154[_1bb]];
- if(_1bc){
- _1a6=_1bc;
- }else{
- _1a6=_187;
- }
- };
- this._calc_x_scale=_1ba;
- function _1bd(){
- var min,max,_1be,_1bf,_1c0;
- var _1c1=_1a9.length-1;
- while(_1c1>=0){
- _1bf=_1a9[_1c1--];
- _1c0=_1bf.offset();
- if(_1c0<=_194){
- _1be=_1bf.range_min_max_y(0,Math.ceil(((_194-_1c0)/_1a2)*_1a1));
- min=_1be[0];
- max=_1be[1];
- break;
- }
- }
- for(var i=_1c1;i>=0;i--){
- _1bf=_1a9[i];
- _1c0=_1bf.offset();
- if(_1c0<_194){
- if(_1c0>0){
- min=Math.min(min,_1bf._min_y());
- max=Math.max(max,_1bf._max_y());
- }else{
- if(_1c0>-_1a2){
- _1be=_1bf.range_min_max_y(Math.floor((-_1c0/_1a2)*_1a1),_1a1);
- min=Math.min(min,_1be[0]);
- max=Math.max(max,_1be[1]);
- }
- }
- }
- }
- return [min,max];
- };
- this._min_max_y=_1bd;
- var _1c2=Math.log(10);
- function _1c3(){
- _193.empty();
- var _1c4=Math.pow(10,Math.floor(Math.log(_1a3)/_1c2));
- var _1c5,_1c6;
- if(_1a3<(2*_1c4)){
- _1c5=0.5*_1c4;
- _1c6=4;
- }else{
- if(_1a3<(3*_1c4)){
- _1c5=_1c4;
- _1c6=3;
- }else{
- if(_1a3<(4*_1c4)){
- _1c5=_1c4;
- _1c6=4;
- }else{
- if(_1a3<(5*_1c4)){
- _1c5=_1c4;
- _1c6=5;
- }else{
- if(_1a3<(6*_1c4)){
- _1c5=2*_1c4;
- _1c6=3;
- }else{
- if(_1a3<(8*_1c4)){
- _1c5=2*_1c4;
- _1c6=4;
- }else{
- _1c5=2*_1c4;
- _1c6=5;
- }
- }
- }
- }
- }
- }
- var _1c7=_1c6*_1c5*_14d;
- _1a7=_1ac/_1c7;
- _1a8=[];
- for(var i=_1c6;i>0;i--){
- var _1c8=i*_1c5;
- var _1c9=_1c8*_1a7;
- _1a8.push(_1c9);
- _193.append(["<div","class=\"y-tick\"","style=\"","position:\tabsolute;","left:\t\t0px;","top:\t\t"+(_1ac-_1c9+_150)+"px;","z-index:\t0;","width:\t\t"+_14e+"px;","\">"+_1c8+" "+_151+"</div>"].join(" "));
- }
- };
- this._calc_y_scale=_1c3;
- function _1ca(){
- _1c3();
- _1ad.publish("/pane/redraw");
- };
- this._rescale_y_axis=_1ca;
- function init(){
- _194=_190.width();
- _197=_190.height()-NAV_HEIGHT;
- var _1cb=_52;
- if(_194>_143){
- _1a2=Math.floor(_194/_144);
- if($.browser.msie){
- _1cb=_51;
- }
- }else{
- _1a2=Math.floor(_194/_145);
- _1cb=_50;
- }
- _191=new _76(this,_1cb);
- _191.init(1243411200,1243411200+4*_56.prototype.bucket_size*60-60,_194,_1a2);
- var _1cc=1243411200+3*_56.prototype.bucket_size*60;
- _1a0=0;
- _1a1=20;
- _1a9=[];
- _190.html("");
- _190.css("position","relative");
- bg=$(["<div","style=\"","overflow:\thidden;","position:\tabsolute;","left:\t\t0px;","top:\t\t0px;","z-index:\t-1;","width:\t\t"+_194+"px;","height:\t"+_197+"px;","border:\t1px solid rgb(0,0,0);","\"></div>"].join(" ")).appendTo(_190);
- _198=$(["<div","class=\"top-pane\"","style=\"","position:\t\tabsolute;","left:\t\t\t"+_146+"px;","top:\t\t\t0px;","width:\t\t\t"+_194+"px;","height:\t\t"+_148+"px;","border-bottom:\t1px solid "+_149+";","\"></div>"].join(" ")).appendTo(_190);
- var _1cd=$(["<div","class=\"top-zoom\"","></div>"].join(" ")).appendTo(_198);
- _1cd.append("<strong>Zoom:</strong>");
- var _1ce=_191.zoom_schema().length-1;
- var _1cf=_191.zoom_schema()[_1ce];
- var _1d0=_1cf[0]*_1cf[2];
- var _1d1=_18d.length-1;
- for(;_1d1>=0;_1d1--){
- if(_18d[_1d1][0]<_1d0){
- break;
- }
- }
- _1d1+=1;
- var _1d2=_194/_1a2;
- var _1d3=[];
- var _1d4=0;
- for(i=0;i<=_1ce;i++){
- var _1d5=_191.zoom_schema()[i];
- for(var j=_1d5[1];j<=_1d5[2];j++){
- if((_1d5[0]*j*_1d2)>=_18d[_1d4][0]){
- _1d3[_1d4]=[i,j];
- _1d4+=1;
- if(_1d4>_1d1){
- break;
- }
- }
- }
- }
- for(i=0;i<=_1d1;i++){
- var _1d6=_18d[i];
- var _1d7=$(["<a","class=\"zoom-link\"","href=\"#"+_1d6[1]+"\"",">"+_1d6[1]+"</a>"].join(" ")).appendTo(_1cd)[0];
- (function(obj,_1d8,_1d9){
- _6(obj,"click",function(){
- _213(_1d8,_1d9);
- });
- })(_1d7,_1d3[i][0],_1d3[i][1]);
- }
- var _1da=$(["<a","class=\"zoom-link\"","href=\"#max\"",">max</a>"].join(" ")).appendTo(_1cd)[0];
- _6(_1da,"click",function(){
- _213(_1ce,_1cf[2]);
- });
- _199=$(["<div","class=\"top-right\"","></div>"].join(" ")).appendTo(_198);
- _19a=$("<span></span>").appendTo(_199);
- _19b=$(["<div","class=\"top-right\"","style=\"","display:\tnone;","\"></div>"].join(" ")).appendTo(_198);
- _19c=$("<span class=\"top-point-time\"></span>").appendTo(_19b);
- _19d=$("<span class=\"top-point-value\"></span>").appendTo(_19b);
- bg.append(["<div","style=\"","position:\t\t\tabsolute;","left:\t\t\t\t0px;","top:\t\t\t\t"+(_197-_91+_92)+"px;","width:\t\t\t\t"+_194+"px;","height:\t\t\t"+_91+"px;","background-color: \t"+_93+";","border:\t\t\t0px;","\"></div>"].join(" "));
- _1aa=_194;
- _1ab=_197-_148-_147;
- _1ac=_1ab-_91;
- _192=$(["<div","style=\"","position:\tabsolute;","overflow:\thidden;","left:\t\t"+_146+"px;","top:\t\t"+(_148+2*_147)+"px;","width:\t\t"+_1aa+"px;","height:\t"+_1ab+"px;","cursor:\tmove;","\"></div>"].join(" ")).appendTo(_190);
- var _1db=Math.ceil(_194/_1a2)+2;
- var _1dc=(-_1db*_1a2/2)-(-_194/2);
- _195=_1dc-(_1a2/2);
- _196=_1dc+((_1db-0.5)*_1a2);
- for(i=0;i<_1db;i++){
- var pane=new _95(this,_1a2);
- pane.init();
- _1a9.push(pane);
- }
- _193=$(["<div","style=\"","overflow:\thidden;","position:\tabsolute;","right:\t\t"+_14f+"px;","top:\t\t0px;","width:\t\t"+_14e+"px;","height:\t"+_1ac+"px;","\"></div>"].join(" ")).appendTo(_192);
- nav=new _d8(this);
- nav.init(_190,_194,NAV_HEIGHT,(_197+_147),_146);
- _19e=$(["<div","style=\"","display:\t\t\tnone;","position:\t\t\tabsolute;","top:\t\t\t\t"+(_148+_147)+"px;","width:\t\t\t\t1px;","height:\t\t\t"+(_1ac+_147)+"px;","background-color:\t#666;","\"></div>"].join(" ")).appendTo(_190);
- _1ad.subscribe("/chart/center",this,"center");
- _1ad.subscribe("/chart/translate",this,"translate");
- _1ad.subscribe("/chart/recycle",this,"recycle");
- _1ad.subscribe("/chart/replace",this,"replace");
- _1ad.subscribe("/chart/draw/start",this,"draw_start");
- _1ad.subscribe("/chart/draw/stop",this,"draw_stop");
- _1ad.subscribe("/chart/draw/rescale",this,"_rescale_y_axis");
- _1ad.subscribe("/chart/scroll/start",this,"scroll_start");
- _1ad.subscribe("/chart/scroll/stop",this,"scroll_stop");
- _1ad.subscribe("/info/range/update",this,"_update_top_range");
- _1ad.subscribe("/info/point/update",this,"_update_top_point");
- _6(_192[0],"mousedown",_1e1);
- _192[0].onmousedown=function(e){
- return _e(e);
- };
- _6(_192[0],"dblclick",_1dd);
- _6(_192[0],"mousewheel",_1de);
- _192.hover(_1df,_1e0);
- _1ad.publish("/chart/center",_1cc,_194/2);
- };
- this.init=init;
- function _1e1(e){
- e=e?e:_1.event;
- _6(_2,"mousemove",_1e2);
- _192._drag_x=e.clientX;
- _6(_2,"mouseup",_1e3);
- _1ad.publish("/chart/draw/start");
- _a(_192[0],"mousemove",_1e4);
- };
- function _1e2(e){
- e=e?e:_1.event;
- var _1e5=e.clientX-_192._drag_x;
- if(Math.abs(_1e5)<=1){
- return _e(e);
- }
- _192._drag_x=e.clientX;
- _1ad.publish("/chart/translate",_1e5);
- return _e(e);
- };
- function _1e3(e){
- _a(_2,"mousemove",_1e2);
- _a(_2,"mouseup",_1e3);
- _1ad.publish("/chart/draw/stop");
- if(_19f){
- _6(_192[0],"mousemove",_1e4);
- _192._cursor_x=e.clientX;
- }
- };
- function _1e6(e,_1e7){
- var _1e8=_192.offset();
- var _1e9=e.clientX-_1e8.left;
- var _1ea=e.clientY-_1e8.top;
- var _1eb=_1a9[0];
- var _1ec=_1eb.time_offset()+(_1e9-_1eb.offset())/_1a5*_191.zoom_delta();
- if(_1e7>0){
- _1a1=Math.max(_191.zoom_level()[1],_1a1-_1e7);
- _1a1-=_1e7;
- if(_1a1<_191.zoom_level()[1]){
- if(_1a0>0){
- _1a0-=1;
- _1a1=_191.zoom_level()[2];
- }else{
- _1a1=_191.zoom_level()[1];
- }
- }
- }else{
- _1a1-=_1e7;
- if(_1a1>_191.zoom_level()[2]){
- if(_1a0<(_191.zoom_schema().length-1)){
- _1a0+=1;
- _1a1=_191.zoom_level()[1];
- }else{
- _1a1=_191.zoom_level()[2];
- }
- }
- }
- _1ad.publish("/chart/center",_1ec,_1e9);
- };
- function _1dd(e){
- e=e?e:_1.event;
- _1e6(e,Math.max(1,Math.floor(_1a1*0.25)));
- };
- function _1de(e){
- e=e?e:_1.event;
- var _1ed=e.detail?-e.detail:e.wheelDelta/40;
- if(Math.abs(_1ed)>0){
- _1ed=Math.min(Math.round(_1ed*_152),_153);
- _1e6(e,_1ed);
- }
- return _e(e);
- };
- function _1df(e){
- _19f=true;
- e=e?e:_1.event;
- _6(_192[0],"mousemove",_1e4);
- _192._cursor_x=e.clientX;
- };
- function _1e0(e){
- _19f=false;
- _a(_192[0],"mousemove",_1e4);
- };
- function _1e4(e){
- e=e?e:_1.event;
- if(Math.abs(e.clientX-_192._cursor_x)<=1){
- return e;
- }
- _192._cursor_x=e.clientX;
- _1ee(e.clientX-(_192.offset().left+_194/2));
- return e;
- };
- function _1ef(_1f0,_1f1){
- _1ba();
- var _1f2=_191.zoom_delta();
- var _1f3=_194/2;
- _1f1=Math.floor(_1f1);
- var _1f4=Math.floor((_1f0-_191.min_time())/_1f2);
- var _1f5=Math.floor(_191._time_range()/_1f2);
- if(_1f5<=_1b8()){
- _1f4=Math.floor(_1f5/2);
- _1f1=Math.floor(_1f3);
- _1b3=_1b4=_1b2=Math.round((_1f4*_1a5)+_1f3-_1f1);
- }else{
- var _1f6=(((_191.max_time()-_1f0)/_1f2)-1)*_1a5;
- if((_194-_1f1)>_1f6){
- _1f1=Math.floor(_194-_1f6);
- }else{
- if(_1f1>(_1f4*_1a5)){
- _1f1=Math.floor(_1f4*_1a5);
- }
- }
- _1b3=Math.ceil(_1f3);
- var _1f7=(_191._time_range()/_1f2)-1;
- _1b4=Math.floor((_1f7*_1a5)-_1f3);
- _1b2=Math.round((_1f4*_1a5)+_1f3-_1f1);
- }
- var len=_1a9.length;
- var _1f8=_194+(_1f1%_1a2);
- var _1f9=_1f4+(len-Math.floor(_1f1/_1a2)-2)*_1a1;
- var i=len;
- while(i--){
- var pane=_1a9[i];
- pane._reset(_1f9,_1f8);
- _1f9-=_1a1;
- _1f8-=_1a2;
- }
- var _1fa=_1bd();
- _1a4=_1fa[0];
- _1a3=_1fa[1];
- _1ad.publish("/chart/draw/rescale");
- _1ad.publish("/nav/center");
- _1ad.publish("/info/range/update");
- };
- this.center=_1ef;
- function _1fb(_1fc){
- var _1fd,_1fe;
- if(_1fc>0){
- while(_1a9[_1a9.length-1].offset()>_196){
- _1fe=_1a9.pop();
- _1fd=_1a9[0];
- _1fe.reset(_1fd._data_offset()-_1a1,_1fd.offset()-_1a2);
- _1a9.unshift(_1fe);
- }
- }else{
- if(_1fc<0){
- while(_1a9[0].offset()<_195){
- _1fd=_1a9.shift();
- _1fe=_1a9[_1a9.length-1];
- _1fd.reset(_1fe._data_offset()+_1a1,_1fe.offset()+_1a2);
- _1a9.push(_1fd);
- }
- }
- }
- };
- this.recycle=_1fb;
- function _1ff(_200){
- _1b2-=_200;
- if(_1b2<_1b4){
- if(_1b2<_1b3){
- _200-=_1b3-_1b2;
- _1b2=_1b3;
- if(!_200){
- return;
- }
- }
- }else{
- _200+=_1b2-_1b4;
- _1b2=_1b4;
- if(!_200){
- return;
- }
- }
- if(Math.abs(_200)<_194){
- _1ad.publish("/pane/translate",_200);
- _1ad.publish("/chart/recycle",_200);
- }else{
- _1ad.publish("/chart/replace",_1b2);
- }
- _1ad.publish("/nav/translate",_200);
- _1ad.publish("/info/range/update");
- };
- this.translate=_1ff;
- function _201(_202){
- var _203=Math.floor(_202/_1a2);
- var _204=_202%_1a2;
- var _205=Math.floor(_1a9.length/2);
- var _206=(_203+_205)*_1a1;
- var _207=Math.floor(_194/2)+_205*_1a2-_204;
- var i=_1a9.length;
- while(i--){
- var pane=_1a9[i];
- pane.reset(_206,_207);
- _206-=_1a1;
- _207-=_1a2;
- }
- var _208=_1bd();
- _1a4=_208[0];
- _1a3=_208[1];
- _1ad.publish("/chart/draw/rescale");
- _1ad.publish("/nav/center");
- };
- this.replace=_201;
- function _209(){
- var _20a=_1bd();
- if(_20a[0]!=_1a4||_20a[1]!=_1a3){
- _1a4=_20a[0];
- _1a3=_20a[1];
- _1ad.publish("/chart/draw/rescale");
- }
- if(!_1ae){
- return;
- }
- var now=(new Date()).getTime();
- _1af=Math.max(_14a*(now-_1b1),_14b);
- _1b1=now;
- _1b0=setTimeout(_209,_1af);
- };
- function _20b(){
- clearTimeout(_1b0);
- _1ae=true;
- _1b1=(new Date()).getTime();
- _1b0=setTimeout(_209,_1af);
- };
- this.draw_start=_20b;
- function _20c(){
- clearTimeout(_1b0);
- _1ae=false;
- _1b0=setTimeout(_209,_14c);
- };
- this.draw_stop=_20c;
- function _20d(){
- if(!_1b6){
- return;
- }
- _1ad.publish("/chart/translate",_1b5);
- _1b7=setTimeout(_20d,NAV_SCROLL_RATE);
- };
- function _20e(sign){
- clearTimeout(_1b7);
- _1b5=sign*NAV_SCROLL_SPEED;
- _1b6=true;
- _20d();
- };
- this.scroll_start=_20e;
- function _20f(){
- _1b6=false;
- };
- this.scroll_stop=_20f;
- function _210(_211,_212){
- _1a0=_211;
- _1a1=_212;
- };
- this._update_zoom=_210;
- function _213(_214,_215){
- var _216=_1b2/_1a2;
- var _217=_191.min_time();
- _217+=_216*_1a1*_191.zoom_delta();
- _217=Math.floor(_217);
- _210(_214,_215);
- _1ef(_217,Math.floor(_194/2));
- };
- this.set_zoom=_213;
- function _218(){
- var _219=_194/2;
- var _21a=60*60*24;
- _218=function(){
- _19e.css("display","none");
- _19b.css("display","none");
- var _21b=_1b2-_219;
- var _21c=_1b2+_219;
- var _21d=_191.min_time()+(_21b/_1a5*_191.zoom_delta());
- var _21e=_191.min_time()+(_21c/_1a5*_191.zoom_delta());
- var _21f=new Date(_21d*1000);
- var _220=new Date(_21e*1000);
- if((_21e-_21d)<_21a&&_21f.getDay()===_220.getDay()){
- _19a.text(_158(_21f,"MMM d, yyyy"));
- }else{
- _19a.text(_158(_21f,"NNN d, yyyy")+" - "+_158(_220,"NNN d, yyyy"));
- }
- _199.css("display","inline");
- };
- return _218();
- };
- this._update_top_range=_218;
- function _1ee(_221){
- var _222=_194/2;
- _1ee=function(_223){
- _199.css("display","none");
- var _224=Math.round((_1b2+_223)/_1a2*_1a1);
- var _225=_224*_1a5;
- var _226=new Date((_191.min_time()+(_224*_191.zoom_delta()))*1000);
- var _227=_191.fetch(_1a0,_224,0)[0][0]||0;
- _19c.text(_158(_226,"MMM d, yyyy"));
- _19d.text(Math.round(_227*1000)/1000);
- var _228=_1b2-_222;
- _19e.css("left",Math.floor(_225-_228)+1);
- _19b.css("display","inline");
- _19e.css("display","inline");
- };
- return _1ee(_221);
- };
- this._update_top_point=_1ee;
- };
- _18e.prototype={version:"0.1"};
- $c.chart=function(_229){
- var _22a=new _18e(_229);
- _22a.init();
- return _22a;
- };
- var _22b=["January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
- var _22c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
- function LZ(x){
- return (x<0||x>9?"":"0")+x;
- };
- function _158(date,_22d){
- _22d=_22d+"";
- var _22e="";
- var _22f=0;
- var c="";
- var _230="";
- var y=date.getYear()+"";
- var M=date.getMonth()+1;
- var d=date.getDate();
- var E=date.getDay();
- var H=date.getHours();
- var m=date.getMinutes();
- var s=date.getSeconds();
- var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,KK,K,kk,k;
- var _231={};
- if(y.length<4){
- y=""+(y-0+1900);
- }
- _231.y=""+y;
- _231.yyyy=y;
- _231.yy=y.substring(2,4);
- _231.M=M;
- _231.MM=LZ(M);
- _231.MMM=_22b[M-1];
- _231.NNN=_22b[M+11];
- _231.d=d;
- _231.dd=LZ(d);
- _231.E=_22c[E+7];
- _231.EE=_22c[E];
- _231.H=H;
- _231.HH=LZ(H);
- if(H==0){
- _231.h=12;
- }else{
- if(H>12){
- _231.h=H-12;
- }else{
- _231.h=H;
- }
- }
- _231.hh=LZ(_231.h);
- if(H>11){
- _231.K=H-12;
- }else{
- _231.K=H;
- }
- _231.k=H+1;
- _231.KK=LZ(_231.K);
- _231.kk=LZ(_231.k);
- if(H>11){
- _231.a="PM";
- }else{
- _231.a="AM";
- }
- _231.m=m;
- _231.mm=LZ(m);
- _231.s=s;
- _231.ss=LZ(s);
- while(_22f<_22d.length){
- c=_22d.charAt(_22f);
- _230="";
- while((_22d.charAt(_22f)==c)&&(_22f<_22d.length)){
- _230+=_22d.charAt(_22f++);
- }
- if(_231[_230]){
- _22e=_22e+_231[_230];
- }else{
- _22e=_22e+_230;
- }
- }
- return _22e;
- };
- })(jQuery);