From: Dan Vanderkam Date: Mon, 30 Nov 2009 21:13:59 +0000 (-0500) Subject: remove a few more MochiKit uses X-Git-Tag: v1.0.0~838 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=21d3323ff4fe22085d85c40082057b37e3b8ebba;p=dygraphs.git remove a few more MochiKit uses --- diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 452be0a..e56de72 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -256,7 +256,7 @@ DygraphCanvasRenderer.prototype.clear = function() { DygraphCanvasRenderer.isSupported = function(canvasName) { var canvas = null; try { - if (MochiKit.Base.isUndefinedOrNull(canvasName)) + if (typeof(canvasName) == 'undefined' || canvasName == null) canvas = document.createElement("canvas"); else canvas = canvasName; @@ -445,11 +445,12 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() { var context = this.element.getContext("2d"); var colorCount = this.options.colorScheme.length; var colorScheme = this.options.colorScheme; - var setNames = MochiKit.Base.keys(this.layout.datasets); var errorBars = this.layout.options.errorBars; - var setCount = setNames.length; var bind = MochiKit.Base.bind; - var partial = MochiKit.Base.partial; + + var setNames = []; + for (var name in this.layout.datasets) setNames.push(name); + var setCount = setNames.length; //Update Points for (var i = 0; i < this.layout.points.length; i++) { diff --git a/dygraph-combined.js b/dygraph-combined.js index 2f18ca4..49b7df7 100644 --- a/dygraph-combined.js +++ b/dygraph-combined.js @@ -1,3 +1,1008 @@ +/*** + + MochiKit.MochiKit 1.4 : PACKED VERSION + + THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please + diff against the source tree, not this file. + + See for documentation, downloads, license, etc. + + (c) 2005 Bob Ippolito. All rights Reserved. + +***/ + +if(typeof (dojo)!="undefined"){ +dojo.provide("MochiKit.Base"); +} +if(typeof (MochiKit)=="undefined"){ +MochiKit={}; +} +if(typeof (MochiKit.Base)=="undefined"){ +MochiKit.Base={}; +} +if(typeof (MochiKit.__export__)=="undefined"){ +MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")); +} +MochiKit.Base.VERSION="1.4"; +MochiKit.Base.NAME="MochiKit.Base"; +MochiKit.Base.update=function(_1,_2){ +if(_1===null){ +_1={}; +} +for(var i=1;i=0;i--){ +_15.unshift(o[i]); +} +}else{ +res.push(o); +} +} +return res; +},extend:function(_18,obj,_1a){ +if(!_1a){ +_1a=0; +} +if(obj){ +var l=obj.length; +if(typeof (l)!="number"){ +if(typeof (MochiKit.Iter)!="undefined"){ +obj=MochiKit.Iter.list(obj); +l=obj.length; +}else{ +throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); +} +} +if(!_18){ +_18=[]; +} +for(var i=_1a;i>b; +},zrshift:function(a,b){ +return a>>>b; +},eq:function(a,b){ +return a==b; +},ne:function(a,b){ +return a!=b; +},gt:function(a,b){ +return a>b; +},ge:function(a,b){ +return a>=b; +},lt:function(a,b){ +return al){ +_90=l; +} +} +_8e=[]; +for(i=0;i<_90;i++){ +var _92=[]; +for(var j=1;j=0;i--){ +_af=[_ab[i].apply(this,_af)]; +} +return _af[0]; +}; +},bind:function(_b1,_b2){ +if(typeof (_b1)=="string"){ +_b1=_b2[_b1]; +} +var _b3=_b1.im_func; +var _b4=_b1.im_preargs; +var _b5=_b1.im_self; +var m=MochiKit.Base; +if(typeof (_b1)=="function"&&typeof (_b1.apply)=="undefined"){ +_b1=m._wrapDumbFunction(_b1); +} +if(typeof (_b3)!="function"){ +_b3=_b1; +} +if(typeof (_b2)!="undefined"){ +_b5=_b2; +} +if(typeof (_b4)=="undefined"){ +_b4=[]; +}else{ +_b4=_b4.slice(); +} +m.extend(_b4,arguments,2); +var _b7=function(){ +var _b8=arguments; +var me=arguments.callee; +if(me.im_preargs.length>0){ +_b8=m.concat(me.im_preargs,_b8); +} +var _ba=me.im_self; +if(!_ba){ +_ba=this; +} +return me.im_func.apply(_ba,_b8); +}; +_b7.im_self=_b5; +_b7.im_func=_b3; +_b7.im_preargs=_b4; +return _b7; +},bindMethods:function(_bb){ +var _bc=MochiKit.Base.bind; +for(var k in _bb){ +var _be=_bb[k]; +if(typeof (_be)=="function"){ +_bb[k]=_bc(_be,_bb); +} +} +},registerComparator:function(_bf,_c0,_c1,_c2){ +MochiKit.Base.comparatorRegistry.register(_bf,_c0,_c1,_c2); +},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){ +if(a==b){ +return 0; +} +var _c5=(typeof (a)=="undefined"||a===null); +var _c6=(typeof (b)=="undefined"||b===null); +if(_c5&&_c6){ +return 0; +}else{ +if(_c5){ +return -1; +}else{ +if(_c6){ +return 1; +} +} +} +var m=MochiKit.Base; +var _c8=m._primitives; +if(!(typeof (a) in _c8&&typeof (b) in _c8)){ +try{ +return m.comparatorRegistry.match(a,b); +} +catch(e){ +if(e!=m.NotFound){ +throw e; +} +} +} +if(ab){ +return 1; +} +} +var _c9=m.repr; +throw new TypeError(_c9(a)+" and "+_c9(b)+" can not be compared"); +},compareDateLike:function(a,b){ +return MochiKit.Base.compare(a.getTime(),b.getTime()); +},compareArrayLike:function(a,b){ +var _ce=MochiKit.Base.compare; +var _cf=a.length; +var _d0=0; +if(_cf>b.length){ +_d0=1; +_cf=b.length; +}else{ +if(_cf=0;i--){ +sum+=o[i]; +} +}else{ +sum+=o; +} +} +if(_113<=0){ +throw new TypeError("mean() requires at least one argument"); +} +return sum/_113; +},median:function(){ +var data=MochiKit.Base.flattenArguments(arguments); +if(data.length===0){ +throw new TypeError("median() requires at least one argument"); +} +data.sort(compare); +if(data.length%2==0){ +var _117=data.length/2; +return (data[_117]+data[_117-1])/2; +}else{ +return data[(data.length-1)/2]; +} +},findValue:function(lst,_119,_11a,end){ +if(typeof (end)=="undefined"||end===null){ +end=lst.length; +} +if(typeof (_11a)=="undefined"||_11a===null){ +_11a=0; +} +var cmp=MochiKit.Base.compare; +for(var i=_11a;i0))){ +var kv=MochiKit.DOM.formContents(_127); +_127=kv[0]; +_128=kv[1]; +}else{ +if(arguments.length==1){ +if(typeof (_127.length)=="number"&&_127.length==2){ +return arguments.callee(_127[0],_127[1]); +} +var o=_127; +_127=[]; +_128=[]; +for(var k in o){ +var v=o[k]; +if(typeof (v)=="function"){ +continue; +}else{ +if(typeof (v)!="string"&&typeof (v.length)=="number"){ +for(var i=0;i1;r/=10){x=pad.toString()+x}return x.toString()};Date.prototype.locale="en-GB";if(document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){Date.prototype.locale=document.getElementsByTagName("html")[0].lang}Date.ext.locales={};Date.ext.locales.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%T"};Date.ext.locales["en-US"]=Date.ext.locales.en;Date.ext.locales["en-US"].c="%a %d %b %Y %r %Z";Date.ext.locales["en-US"].x="%D";Date.ext.locales["en-US"].X="%r";Date.ext.locales["en-GB"]=Date.ext.locales.en;Date.ext.locales["en-AU"]=Date.ext.locales["en-GB"];Date.ext.formats={a:function(d){return Date.ext.locales[d.locale].a[d.getDay()]},A:function(d){return Date.ext.locales[d.locale].A[d.getDay()]},b:function(d){return Date.ext.locales[d.locale].b[d.getMonth()]},B:function(d){return Date.ext.locales[d.locale].B[d.getMonth()]},c:"toLocaleString",C:function(d){return Date.ext.util.xPad(parseInt(d.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(d){return Date.ext.util.xPad(parseInt(Date.ext.util.G(d)/100,10),0)},G:function(d){var y=d.getFullYear();var V=parseInt(Date.ext.formats.V(d),10);var W=parseInt(Date.ext.formats.W(d),10);if(W>V){y++}else{if(W===0&&V>=52){y--}}return y},H:["getHours","0"],I:function(d){var I=d.getHours()%12;return Date.ext.util.xPad(I===0?12:I,0)},j:function(d){var ms=d-new Date(""+d.getFullYear()+"/1/1 GMT");ms+=d.getTimezoneOffset()*60000;var doy=parseInt(ms/60000/60/24,10)+1;return Date.ext.util.xPad(doy,0,100)},m:function(d){return Date.ext.util.xPad(d.getMonth()+1,0)},M:["getMinutes","0"],p:function(d){return Date.ext.locales[d.locale].p[d.getHours()>=12?1:0]},P:function(d){return Date.ext.locales[d.locale].P[d.getHours()>=12?1:0]},S:["getSeconds","0"],u:function(d){var dow=d.getDay();return dow===0?7:dow},U:function(d){var doy=parseInt(Date.ext.formats.j(d),10);var rdow=6-d.getDay();var woy=parseInt((doy+rdow)/7,10);return Date.ext.util.xPad(woy,0)},V:function(d){var woy=parseInt(Date.ext.formats.W(d),10);var dow1_1=(new Date(""+d.getFullYear()+"/1/1")).getDay();var idow=woy+(dow1_1>4||dow1_1<=1?0:1);if(idow==53&&(new Date(""+d.getFullYear()+"/12/31")).getDay()<4){idow=1}else{if(idow===0){idow=Date.ext.formats.V(new Date(""+(d.getFullYear()-1)+"/12/31"))}}return Date.ext.util.xPad(idow,0)},w:"getDay",W:function(d){var doy=parseInt(Date.ext.formats.j(d),10);var rdow=7-Date.ext.formats.u(d);var woy=parseInt((doy+rdow)/7,10);return Date.ext.util.xPad(woy,0,10)},y:function(d){return Date.ext.util.xPad(d.getFullYear()%100,0)},Y:"getFullYear",z:function(d){var o=d.getTimezoneOffset();var H=Date.ext.util.xPad(parseInt(Math.abs(o/60),10),0);var M=Date.ext.util.xPad(o%60,0);return(o>0?"-":"+")+H+M},Z:function(d){return d.toString().replace(/^.*\(([^)]+)\)$/,"$1")},"%":function(d){return"%"}};Date.ext.aggregates={c:"locale",D:"%m/%d/%y",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"};Date.ext.aggregates.z=Date.ext.formats.z(new Date());Date.ext.aggregates.Z=Date.ext.formats.Z(new Date());Date.ext.unsupported={};Date.prototype.strftime=function(fmt){if(!(this.locale in Date.ext.locales)){if(this.locale.replace(/-[a-zA-Z]+$/,"") in Date.ext.locales){this.locale=this.locale.replace(/-[a-zA-Z]+$/,"")}else{this.locale="en-GB"}}var d=this;while(fmt.match(/%[cDhnrRtTxXzZ]/)){fmt=fmt.replace(/%([cDhnrRtTxXzZ])/g,function(m0,m1){var f=Date.ext.aggregates[m1];return(f=="locale"?Date.ext.locales[d.locale][m1]:f)})}var str=fmt.replace(/%([aAbBCdegGHIjmMpPSuUVwWyY%])/g,function(m0,m1){var f=Date.ext.formats[m1];if(typeof (f)=="string"){return d[f]()}else{if(typeof (f)=="function"){return f.call(d,d)}else{if(typeof (f)=="object"&&typeof (f[0])=="string"){return Date.ext.util.xPad(d[f[0]](),f[1])}else{return m1}}}});d=null;return str}; DygraphLayout=function(_1,_2){ this.dygraph_=_1; @@ -161,7 +1166,7 @@ this.ylabels=new Array(); DygraphCanvasRenderer.isSupported=function(_31){ var _32=null; try{ -if(MochiKit.Base.isUndefinedOrNull(_31)){ +if(typeof (_31)=="undefined"||_31==null){ _32=document.createElement("canvas"); }else{ _32=_31; @@ -317,11 +1322,13 @@ DygraphCanvasRenderer.prototype._renderLineChart=function(){ var _53=this.element.getContext("2d"); var _54=this.options.colorScheme.length; var _55=this.options.colorScheme; -var _56=MochiKit.Base.keys(this.layout.datasets); -var _57=this.layout.options.errorBars; -var _58=_56.length; -var _59=MochiKit.Base.bind; -var _60=MochiKit.Base.partial; +var _56=this.layout.options.errorBars; +var _57=MochiKit.Base.bind; +var _58=[]; +for(var _59 in this.layout.datasets){ +_58.push(_59); +} +var _60=_58.length; for(var i=0;i