| fixed the generators, added missing JS assets - reportable - Fork of reportable… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 74966b44254dcd1b078399152844a053bf27908f | |
| parent 3364df83ff2472ae541292aa68b34ce4271003a1 | |
| Author: Marco Otte-Witte <[email protected]> | |
| Date: Mon, 17 May 2010 15:42:04 +0200 | |
| fixed the generators, added missing JS assets | |
| Diffstat: | |
| M generators/reportable_jquery_flot_… | 2 +- | |
| M generators/reportable_raphael_asse… | 10 ++++++++++ | |
| M generators/reportable_raphael_asse… | 3 +-- | |
| A generators/reportable_raphael_asse… | 8 ++++++++ | |
| A generators/reportable_raphael_asse… | 114 +++++++++++++++++++++++++++… | |
| 5 files changed, 134 insertions(+), 3 deletions(-) | |
| --- | |
| diff --git a/generators/reportable_jquery_flot_assets/templates/NOTES b/generat… | |
| @@ -1,4 +1,4 @@ | |
| ** Beware that flot depends on jQuery! | |
| - ** Don't forget to include excanvas and flot as well as jQuery in your layou… | |
| + ** Don't forget to include excanvas.min.js, jquery.flot.min.js as well as jQ… | |
| diff --git a/generators/reportable_raphael_assets/reportable_raphael_assets_gen… | |
| @@ -10,6 +10,14 @@ if Saulabs::Reportable::IS_RAILS3 | |
| File.join(File.dirname(__FILE__), 'templates', 'raphael.min.js'), | |
| 'public/javascripts/raphael.min.js' | |
| ) | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'g.raphael.min.js'), | |
| + 'public/javascripts/g.raphael.min.js' | |
| + ) | |
| + copy_file( | |
| + File.join(File.dirname(__FILE__), 'templates', 'g.line.min.js'), | |
| + 'public/javascripts/g.line.min.js' | |
| + ) | |
| readme(File.join(File.dirname(__FILE__), 'templates', 'NOTES')) | |
| end | |
| @@ -23,6 +31,8 @@ else | |
| record do |m| | |
| m.directory('public/javascripts') | |
| m.file('raphael.min.js', 'public/javascripts/raphael.min.js') | |
| + m.file('g.raphael.min.js', 'public/javascripts/g.raphael.min.js') | |
| + m.file('g.line.min.js', 'public/javascripts/g.line.min.js') | |
| m.readme('NOTES') | |
| end | |
| end | |
| diff --git a/generators/reportable_raphael_assets/templates/NOTES b/generators/… | |
| @@ -1,4 +1,3 @@ | |
| - ** Beware that Raphael depends on Prototype.js! | |
| - ** Also don't forget to include Raphael as well as Prototype.js in your layo… | |
| + ** Don't forget to include raphael.min.js as well as g.raphael.min.js and g.… | |
| diff --git a/generators/reportable_raphael_assets/templates/g.line.min.js b/gen… | |
| @@ -0,0 +1,7 @@ | |
| +/* | |
| + * g.Raphael 0.4 - Charting library, based on Raphaël | |
| + * | |
| + * Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com) | |
| + * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)… | |
| + */ | |
| +Raphael.fn.g.linechart=function(J,I,a,c,s,r,C){function B(y,Y){var x=y.length/… | |
| +\ No newline at end of file | |
| diff --git a/generators/reportable_raphael_assets/templates/g.raphael.min.js b/… | |
| @@ -0,0 +1,113 @@ | |
| +/* | |
| + * Raphael 1.4.3 - JavaScript Vector Library | |
| + * | |
| + * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com) | |
| + * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)… | |
| + */ | |
| +Raphael=function(){function m(){if(m.is(arguments[0],U)){for(var a=arguments[0… | |
| +"",P=" ",H="split",Ma="click dblclick mousedown mousemove mouseout mouseover m… | |
| +F=w.round,W="setAttribute",A=parseFloat,da=parseInt,Da=" progid:DXImageTransfo… | |
| +"stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","tex… | |
| +"1.1")?"SVG":"VML";if(m.type=="VML"){var ha=C.createElement("div");ha.innerHTM… | |
| +s);try{var e=new X.ActiveXObject("htmlfile");e.write("<body>");e.close();f=e.b… | |
| +function qb(){return"hsb("+[this.h,this.s,this.b]+")"}function rb(){return thi… | |
| +"0");d=d[I](ga,"0");c.hex="#"+a+b+d;return c},m);m.rgb2hsb=T(function(a,b,c){i… | |
| +"$1")};function T(a,b,c){function d(){var f=Array[p].slice.call(arguments,0),e… | |
| +16);c=da(a[2].substring(3,5),16);b=da(a[2].substring(1,3),16)}if(a[3]){d=da((e… | |
| +c=(~~c)[N](16);d=(~~d)[N](16);b=b[I](ga,"0");c=c[I](ga,"0");d=d[I](ga,"0");a.h… | |
| +vb=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig;m.parsePathString=T(function(a){if(… | |
| +D(j,3)*a+D(j,2)*3*i*c+j*3*i*i*f+D(i,3)*g;j=D(j,3)*b+D(j,2)*3*i*d+j*3*i*i*e+D(i… | |
| +a[g];if(e[0]=="M"){b=e[1];c=e[2];d[E](b);f[E](c)}else{b=wb(b,c,e[1],e[2],e[3],… | |
| +var b=[],c=0,d=0,f=0,e=0,g=0;if(a[0][0]=="M"){c=a[0][1];d=a[0][2];f=c;e=d;g++;… | |
| +j[o];i<l;i++)b[g][i]=j[i]}j=b[g][o];switch(b[g][0]){case "z":c=f;d=e;break;cas… | |
| +j[2];i[3]=j[3];i[4]=j[4];i[5]=j[5];i[6]=+(j[6]+c);i[7]=+(j[7]+d);break;case "V… | |
| +a+h*c,g*b+h*d,g*f+h*c,g*e+h*d,f,e]}function Qa(a,b,c,d,f,e,g,h,i,j){var l=w.PI… | |
| +B*-d*k/c+(b+i)/2,x=w.asin(((b-B)/d).toFixed(7));k=w.asin(((i-B)/d).toFixed(7))… | |
| +j=[];h=0;for(i=q[o];h<i;h++)j[h]=h%2?t(q[h-1],q[h],r).y:t(q[h],q[h+1],r).x;ret… | |
| +0&&i<1){n=la(a,b,c,d,f,e,g,h,i);q[E](n.x);r[E](n.y)}i=e-2*d+b-(h-2*e+d);j=2*(d… | |
| +bx:0,by:0,X:0,Y:0,qx:null,qy:null};function f(q,k){var t;if(!q)return["C",k.x,… | |
| +q[2],q[3],q[4]));break;case "L":q=["C"][M](wa(k.x,k.y,q[1],q[2]));break;case "… | |
| +d[o]||0)}}for(var h=0,i=Y(c[o],d&&d[o]||0);h<i;h++){c[h]=f(c[h],a);e(c,h);d&&(… | |
| +e[2]&&(f.offset=e[2]+"%");b[E](f)}c=1;for(d=b[o]-1;c<d;c++)if(!b[c].offset){a=… | |
| +x:a,y:b,width:c,height:d}}function Fa(a,b){var c=this;for(var d in b)if(b[z](d… | |
| +a}}function Ua(a,b){if(b.bottom!==a){ia(a,b);a.next=b.bottom;a.prev=null;b.bot… | |
| +"http://www.w3.org/2000/svg";G[p].xlink="http://www.w3.org/1999/xlink";F=funct… | |
| +ma=function(a,b,c){var d="linear",f=0.5,e=0.5,g=a.style;b=(b+s)[I](Ya,function… | |
| +i=a.getAttribute(aa);(i=i.match(/^url\(#(.*)\)$/))&&c.defs.removeChild(C.getEl… | |
| +b.x,b.y)})},ba=function(a,b){var c={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[… | |
| +(e+s)[H](V);if(h.length-1){h[1]=+h[1];h[2]=+h[2]}else h=null;A(e)&&a.rotate(0,… | |
| +var r=v("clipPath");n=v("rect");r.id="r"+(m._id++)[N](36);v(n,{x:l[0],y:l[1],w… | |
| +"rx"&&a.type=="rect")break;case "cx":h&&(i=="x"||i=="cx")&&(h[1]+=j-f[i]);d[W]… | |
| +j;d[W](i,j);f["stroke-dasharray"]&&g(a,f["stroke-dasharray"]);break;case "stro… | |
| +q.setAttributeNS(a.paper.xlink,"href",l[1]);r[y](q);j=C.createElement("img");j… | |
| +(j+s).charAt()!="r")&&ma(d,j,a.paper)){f.gradient=j;f.fill="none";break}}else{… | |
| +(j+s).charAt()!="r")&&ma(d,j,a.paper);break;case "opacity":case "fill-opacity"… | |
| +b[z]("x")||b[z]("y")))){var c=a.attrs,d=a.node,f=d.firstChild?da(C.defaultView… | |
| +isFinite(a)&&v(d,{y:c.y+a})}},u=function(a,b){this[0]=a;this.id=m._oid++;this.… | |
| +1){b=A(a[1]);c=A(a[2])}a=A(a[0]);if(b!=null)this._.rt.deg=a;else this._.rt.deg… | |
| +function(){!this.removed&&(this.node.style.display="none");return this};u[p].s… | |
| +b||{}}if(this.type=="text"){b={x:b.x,y:Infinity,width:0,height:0};for(var d=0,… | |
| +1)&&(a.scale=this.scale());a.gradient&&a.fill=="none"&&(a.fill=a.gradient)&&de… | |
| +ba(this,a);return this};u[p].toFront=function(){if(this.removed)return this;th… | |
| +b.parentNode[y](this.node);Va(this,a,this.paper);return this};u[p].insertBefor… | |
| +delete b._blur;delete b.attrs.blur}b.node.removeAttribute("filter")}};var ab=f… | |
| +var e=v("ellipse");a.canvas&&a.canvas[y](e);a=new u(e,a);a.attrs={cx:b,cy:c,rx… | |
| +a);a.attrs={x:b,y:c,"text-anchor":"middle",text:d,font:qa.font,stroke:"none",f… | |
| +version:1.1,width:f,height:a});if(b==1){e.style.cssText="position:absolute;lef… | |
| +this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Xa(a… | |
| +var d;a=[];for(var f=0,e=b[o];f<e;f++){c=b[f];d=ca.call(b[f][0]);d=="z"&&(d="x… | |
| +b.width+"px";f.height=b.height+"px";d.coordsize=na;d.coordorigin=b.coordorigin… | |
| +a.H=d.height}b.href&&(c.href=b.href);b.title&&(c.title=b.title);b.target&&(c.t… | |
| +(b["clip-rect"]+s)[H](V);if(e[o]==4){e[2]=+e[2]+ +e[0];e[3]=+e[3]+ +e[1];h=c.c… | |
| +b.opacity*100+")";f.filter=(c.filterMatrix||s)+(c.filterOpacity||s)}b.font&&(f… | |
| +b["stroke-miterlimit"]!=null||b["stroke-linejoin"]!=null||b["stroke-linecap"]!… | |
| +s;f.type="solid";if(m.getRGB(b.fill).error&&(g.type in{circle:1,ellipse:1}||(b… | |
| +0)&&(f.on=false);a=m.getRGB(b.stroke);f.on&&b.stroke&&(f.color=a.hex);a=((+d["… | |
| +"square"?"square":"round");if(b["stroke-dasharray"]){a={"-":"shortdash",".":"s… | |
| +d["font-style"]&&(f.fontStyle=d["font-style"]);g.node.string&&(g.paper.span.in… | |
| +{};var c="linear",d=".5 .5";a.attrs.gradient=b;b=(b+s)[I](Ya,function(i,j,l){c… | |
| +h=e[o];g<h;g++)e[g].offset&&a[E](e[g].offset+P+e[g].color);b.colors&&(b.colors… | |
| +null};u[p].rotate=function(a,b,c){if(this.removed)return this;if(a==null){if(t… | |
| +this.node.style;a=a||{};for(var e in a)if(a[z](e))this.attrs[e]=a[e];b=b||this… | |
| +va(this.attrs.path);a=g.x;e=g.y;h=g.width;g=g.height}else{e=a=0;h=this.paper.w… | |
| +"text"){f.left!=(i=-b+"px")&&(f.left=i);f.top!=(i=-c+"px")&&(f.top=i)}else{d.w… | |
| +if(oa[z](this.type))return va(this.attrs.path);return{x:this.X+(this.bbx||0),y… | |
| +this._.rt.deg&&(a.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(a.sca… | |
| +return d}if(b!=null){d={};d[a]=b}b==null&&m.is(a,"object")&&(d=a);if(d){if(d.t… | |
| +this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNod… | |
| +u[p].blur=function(a){var b=this.node.style,c=b.filter;c=c.replace(Cb,"");if(+… | |
| +fill:"none"});e.attrs.cx=b;e.attrs.cy=c;e.attrs.r=d;e.setBox({x:b-d,y:c-d,widt… | |
| +g;a.type="rect";return a};cb=function(a,b,c,d,f){var e=R("group"),g=R("oval");… | |
| +a.width+"px;height:"+a.height+"px";g.coordsize=na;g.coordorigin=a.coordorigin;… | |
| +F(b*10),F(c*10),F(b*10)+1);h.textpathok=true;g.width=a.width;g.height=a.height… | |
| +"behavior:url(#default#VML)");try{!C.namespaces.rvml&&C.namespaces.add("rvml",… | |
| +c=c||342;d==+d&&(d+="px");c==+c&&(c+="px");e.width=1000;e.height=1000;e.coords… | |
| +b.firstChild):b[y](g);Fa.call(e,e,m.fn);return e};G[p].clear=function(){this.c… | |
| +1)||X.navigator.platform.slice(0,2)=="iP")?function(){var a=this.rect(-99,-99,… | |
| +i;h++)if(g.targetTouches[h].target==a){i=g;g=g.targetTouches[h];g.originalEven… | |
| +Ma[o];ha--;)(function(a){m[a]=u[p][a]=function(b){if(m.is(b,"function")){this.… | |
| +u[p].drag=function(a,b,c){this._drag={};var d=this.mousedown(function(g){(g.or… | |
| +a&&a.call(d,h-d._drag.x,i-d._drag.y,h,i)}function e(){d._drag={};Raphael.unmou… | |
| +d||0,f||0)};G[p].text=function(a,b,c){return eb(this,a||0,b||0,c||s)};G[p].set… | |
| +(b=a);var f,e,g=this.attrs;if(a!=0){var h=this.getBBox(),i=h.x+h.width/2,j=h.y… | |
| +break;case "path":i=Oa(g.path);for(var t=true,L=0,B=i[o];L<B;L++){var x=i[L],J… | |
| +"scale("[M](h,",",l,")");this.node[W]("transform",this.transformations[Q](P));… | |
| +s;n.filter=(this.node.filterMatrix||s)+(this.node.filterOpacity||s)}g.scale=[a… | |
| +for(var e,g,h,i,j="",l={},n=0,r=0,q=c.length;r<q;r++){h=c[r];if(h[0]=="M"){e=+… | |
| +b?l:m.findDotsAtSegment(e,g,h[1],h[2],h[3],h[4],h[5],h[6],1);e.alpha&&(e={x:e.… | |
| +a)};u[p].getSubpath=function(a,b){if(this.type=="path"){if(w.abs(this.getTotal… | |
| +0||a==1)return a;var b=0.3,c=b/4;return D(2,-10*a)*w.sin((a-c)*2*w.PI/b)+1},bo… | |
| +{},k;if(d<f){r=m.easing_formulas[e]?m.easing_formulas[e](d/f):d/f;for(var t in… | |
| +for(var B=1,x=g[t][e][o];B<x;B++)k[e][B]=+g[t][e][B]+r*f*h[t][e][B];k[e]=k[e][… | |
| +za(i.along,i.len*!i.back);n.translate(h.sx-(h.x||0)+e.x-h.sx,h.sy-(h.y||0)+e.y… | |
| +this.attrs.cx,cy:+b+this.attrs.cy});break;case "rect":case "image":case "text"… | |
| +b&&(e.along=b);return this.animate(e,c,f)}}u[p].onAnimation=function(a){this._… | |
| +b;break;case "colour":f[h]=m.getRGB(f[h]);i=m.getRGB(e[h]);g[h]={r:(i.r-f[h].r… | |
| +j;f[h]=(f[h]+s)[H](V);g[h]=[(j[0]-f[h][0])/b,(j[1]-f[h][1])/b,0,0];break;case … | |
| +m.ae=S;function Z(a){this.items=[];this[o]=0;this.type="set";if(a)for(var b=0,… | |
| +0,c=this.items[o];b<c;b++)this.items[b][a][K](this.items[b],arguments);return … | |
| +a,b,c,i);return this};Z[p].insertAfter=function(a){for(var b=this.items[o];b--… | |
| +this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-famil… | |
| +G[p].getFont=function(a,b,c,d){d=d||"normal";c=c||"normal";b=+b||{normal:400,b… | |
| +var g=this.set(),h=(c+s)[H](s),i=0;m.is(d,c)&&(d=this.getFont(d));if(d){c=(f||… | |
| +U)?[0][M](b):arguments;a&&m.is(a,ea)&&c[o]-1&&(a=a[I](Jb,function(d,f){return … | |
| +\ No newline at end of file |