easy_pie_chart 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b09e31c313fa7636b8854333780320a5dc705b43
4
- data.tar.gz: faae06003607c0ce3e9cdc68dc69c78e84d0a390
3
+ metadata.gz: e85403fe202b0ab3ef67532e73a4d3ec86613b89
4
+ data.tar.gz: 98d460cafdf89a836af78be26bb89ccdc2786d11
5
5
  SHA512:
6
- metadata.gz: 270dd57d02a20fa246072fd1e0ee81de3bc2eb1d7fd2b4f30863db837eaddfa973d81cd7d89d4592b32ac6ff9fb5d200d8c72aa86d6a84a08d2d8f8639a7f9c6
7
- data.tar.gz: 17207f6669f843d5dc0a34625c3ef4d3c0c40e1a40588bf851fcaeb6d0802829cc004fc84cb123eb58d882415e83058046976031d8e2cf4d58413d483f2cf892
6
+ metadata.gz: 90f8784513ff051d0916dcbda2b02b37fed16bb58cfece91acb49e364c8dbc280f2b98ebe48850009cf5653fa3ab8a11844b51e87ab5349f1a97e1db801d71db
7
+ data.tar.gz: 844abae362b7d6e8963cd8df1b4135820c84e2f3046b7672a60551b35580d71cab99363994d4140a76c5921c81c9cb3f2c3c2652e512cabb6ca424e5e904bfb7
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "easy_pie_chart"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nahrae Jin"]
@@ -9,15 +9,15 @@
9
9
 
10
10
  (function(root, factory) {
11
11
  if(typeof exports === 'object') {
12
- module.exports = factory();
12
+ module.exports = factory(require('jquery'));
13
13
  }
14
14
  else if(typeof define === 'function' && define.amd) {
15
- define([], factory);
15
+ define(['jquery'], factory);
16
16
  }
17
17
  else {
18
- root['EasyPieChart'] = factory();
18
+ factory(root.jQuery);
19
19
  }
20
- }(this, function() {
20
+ }(this, function($) {
21
21
 
22
22
  /**
23
23
  * Renderer to render the chart on a canvas object
@@ -345,7 +345,16 @@ var EasyPieChart = function(el, opts) {
345
345
  init();
346
346
  };
347
347
 
348
+ $.fn.easyPieChart = function(options) {
349
+ return this.each(function() {
350
+ var instanceOptions;
351
+
352
+ if (!$.data(this, 'easyPieChart')) {
353
+ instanceOptions = $.extend({}, options, $(this).data());
354
+ $.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions));
355
+ }
356
+ });
357
+ };
348
358
 
349
- return EasyPieChart;
350
359
 
351
- }));
360
+ }));
@@ -9,13 +9,13 @@ Lightweight plugin to render simple, animated and retina optimized pie charts
9
9
  ###
10
10
  ((root, factory) ->
11
11
  if typeof exports is "object"
12
- module.exports = factory()
12
+ module.exports = factory(require("jquery"))
13
13
  else if typeof define is "function" and define.amd
14
- define [], factory
14
+ define ["jquery"], factory
15
15
  else
16
- root["EasyPieChart"] = factory()
16
+ factory root.jQuery
17
17
  return
18
- ) this, ->
18
+ ) this, ($) ->
19
19
 
20
20
  ###*
21
21
  Renderer to render the chart on a canvas object
@@ -313,4 +313,13 @@ Lightweight plugin to render simple, animated and retina optimized pie charts
313
313
  init()
314
314
  return
315
315
 
316
- EasyPieChart
316
+ $.fn.easyPieChart = (options) ->
317
+ @each ->
318
+ instanceOptions = undefined
319
+ unless $.data(this, "easyPieChart")
320
+ instanceOptions = $.extend({}, options, $(this).data())
321
+ $.data this, "easyPieChart", new EasyPieChart(this, instanceOptions)
322
+ return
323
+
324
+
325
+ return
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_pie_chart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nahrae Jin