jquery_cheats 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ //*==============SPECIAL THANKS TO:===========
2
+ // IX3 for his response from Stackoverflow
3
+
1
4
  $(document).ready(function(){
2
5
  //the following are for AJAX requests of form objects
3
6
  $("select[data-onchange]").live("change",function()
@@ -26,32 +29,66 @@ $(document).ready(function(){
26
29
  $("div.piechart").each(function(){
27
30
  pieChart($(this).attr("id"),$(this).attr("data-xmlurl"));
28
31
  });
29
- $("div.barchart").each(function(){
32
+ /*$("div.barchart").each(function(){
30
33
  barChart($(this).attr("id"),$(this).attr("data-xmlurl"));
31
- });
34
+ });*/
35
+ //IX3 CONTRIUBTUITION
36
+ updateCharts();
37
+ //next function commented out because it causes issues with browser...will work on it....
38
+ $("body").on("DOMSubtreeModified", function(e) {
39
+ //console.log(e);
40
+ updateCharts();
41
+ });
42
+ //CONTRIBUTION END
32
43
  //The following provide click-to-link capabilities in charts
33
- $("div.piechart").bind('jqplotDataClick',function(ev,seriesIndex,pointIndex,data){
34
- if(data[2] != "") window.location = data[2];
44
+ $("div.piechart").live('jqplotDataClick',function(ev,seriesIndex,pointIndex,data){
45
+ if(data[2] != "")
46
+ {
47
+
48
+ window.location = data[2];
49
+ }
35
50
  });
36
- $("div.barchart").bind('jqplotDataClick',function(ev,seriesIndex,pointIndex,data){
37
- if(data[2] != "") window.location = data[2];
51
+ $("div.barchart").live('jqplotDataClick',function(ev,seriesIndex,pointIndex,data){
52
+ if(data[2] != "")
53
+ {
54
+ window.location = data[2];
55
+ }
38
56
  });
39
57
  });
40
58
  //functions specific to barchart
59
+ function updateCharts()
60
+ {
61
+ $("div.barchart:empty").each(function(){
62
+ barChart($(this).attr("id"),$(this).attr("data-xmlurl"));
63
+ })
64
+ }
41
65
  function barChart(name,xmlurl)
42
66
  {
43
- $.get(xmlurl,function(xml){
67
+ $.ajax({url: xmlurl,
68
+ type: "get",
69
+ success: function(xml){
44
70
  loadBGImage(name,xml);
45
71
  establishSize(name,xml);
46
- $.jqplot(name,[getBars(xml)],{
72
+ bars = getBars(xml);
73
+ pointLabels = [];
74
+ for(i = 0; i < bars.length; i++)
75
+ {
76
+ pointLabels.push(bars[i][1]);
77
+ }
78
+ $.jqplot(name,[bars],{
47
79
  seriesDefaults:
48
80
  {
49
81
  renderer: $.jqplot.BarRenderer,
50
82
  renderOptions:
51
83
  {
52
84
  fillToZero:true, barWidth: getBarWidth(xml)
53
- }
85
+ },
86
+ pointLabels: {show: true}
54
87
  },
88
+ series:[{pointLabels:{
89
+ labels: pointLabels,
90
+ }
91
+ }],
55
92
  title:
56
93
  {
57
94
  text: getTitle(xml)
@@ -62,17 +99,31 @@ function barChart(name,xmlurl)
62
99
  gridLine: getGridLineColor(xml),
63
100
  borderColor: getGridBorderColor(xml)
64
101
  },
102
+ axesDefaults:
103
+ {
104
+ tickRenderer: $.jqplot.CanvasAxisTickRenderer
105
+ },
65
106
  axes:
66
107
  {
67
108
  xaxis:
68
109
  {
69
110
  renderer: $.jqplot.CategoryAxisRenderer,
111
+ tickOptions:{
112
+ angle: 30
113
+ },
70
114
  ticks: getTicks(xml),
71
115
  autoscale: true
72
116
  }
73
117
  }
74
118
  });
75
- });
119
+ return true;
120
+ },
121
+ error: function(xhr, status, error) {
122
+ var err = eval("(" + xhr.responseText + ")");
123
+ alert(err.Message);
124
+ },
125
+ async: false,
126
+ timeout: 3000});
76
127
  }
77
128
  function getBars(xml)
78
129
  {
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "jquery_cheats"
5
- s.version = "4.0.0"
5
+ s.version = "4.0.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Travis Pessettto"]
9
- s.date = "2012-06-20"
9
+ s.date = "2012-06-25"
10
10
  s.description = "JQuery, JQPlot graphing, and other useful items for jquery."
11
11
  s.email = "travis@pessetto.com"
12
12
  s.extra_rdoc_files = ["README.md", "lib/jquery_cheats.rb"]
@@ -0,0 +1,2 @@
1
+ //fgnass.github.com/spin.js#v1.2.5
2
+ (function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b<c;b++)a.appendChild(arguments[b]);return a}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";return e[g]||(i.insertRule("@"+l+"keyframes "+g+"{"+"0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}"+"100%{opacity:"+j+"}"+"}",0),e[g]=1),g}function k(a,b){var e=a.style,f,g;if(e[b]!==c)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c)return f}}function l(a,b){for(var c in b)a.style[k(a,c)||c]=b[c];return a}function m(a){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var e in d)a[e]===c&&(a[e]=d[e])}return a}function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent)b.x+=a.offsetLeft,b.y+=a.offsetTop;return b}var d=["webkit","Moz","ms","O"],e={},f,i=function(){var a=g("style");return h(b.getElementsByTagName("head")[0],a),a.sheet||a.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},p=function q(a){if(!this.spin)return new q(a);this.opts=m(a||{},q.defaults,o)};p.defaults={},m(p.prototype,{spin:function(a){this.stop();var b=this,c=b.opts,d=b.el=l(g(0,{className:c.className}),{position:"relative",zIndex:c.zIndex}),e=c.radius+c.length+c.width,h,i;a&&(a.insertBefore(d,a.firstChild||null),i=n(a),h=n(d),l(d,{left:(c.left=="auto"?i.x-h.x+(a.offsetWidth>>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)}b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++)d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:b.hwaccel?"translate3d(0,0,0)":"",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")));return a},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),!function(){function a(a,b){return g("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',b)}var b=l(g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}):f=k(b,"animation")}(),a.Spinner=p})(window,document);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery_cheats
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-20 00:00:00.000000000 Z
12
+ date: 2012-06-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: JQuery, JQPlot graphing, and other useful items for jquery.
15
15
  email: travis@pessetto.com
@@ -84,6 +84,7 @@ files:
84
84
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.pyramidRenderer.min.js
85
85
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.trendline.js
86
86
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.trendline.min.js
87
+ - vendor/assets/javascripts/jquery_cheats/spinjs/spin.min.js
87
88
  - vendor/assets/stylesheets/jquery_cheats/jquery.jqplot.css
88
89
  - README.md
89
90
  - Rakefile