jquery-bez-rails 0.1.0 → 0.2.0

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: 604263092ea7d1b8eb992747d251e8613141ced3
4
- data.tar.gz: 050396831fe3d243782fbf80b5fb652ffa00f012
3
+ metadata.gz: e3e0d6c9a1ffed2043af6b961557af7201e09f50
4
+ data.tar.gz: 443380d512ab21255fc0826178572011e86d7cb4
5
5
  SHA512:
6
- metadata.gz: 3998c483d92422700bd03b650c7c2c23e57bb9d8c2ddae1c947f12edb3e7cefe9f7efbf0f7ef676a4cd9e034aafa19515c74a16823adc89314d00e2974d7494e
7
- data.tar.gz: ab6b5b5a788872be9dbad656534f368d2f4a66735e24d55bae72cec567a09d4be554c027df5c738e108fc7e2443aabbdecb5053fbc175adc73a3e409b0e9d982
6
+ metadata.gz: fd35698cee10053e2fc7597f1c7c5974395b7770339e572cad692e02ba166b6a205d414f9fbf95f71e4d88ab50597f2bb4fb746c808853054e07bd6e8c293565
7
+ data.tar.gz: d3341c23db853a4c39ba39a619630700e3ef920b32e165aa08b3a6a5ce048fc5e89b5802b275a318b41dae7321c85f0f95b92bb2828f2b92be773f1fb5c9c378
Binary file
@@ -0,0 +1,8 @@
1
+ module Jquery
2
+ module Bez
3
+ module Rails
4
+ require 'jquery/bez/rails/engine'
5
+ require 'jquery/bez/rails/version'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ module Jquery
2
+ module Bez
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ initializer 'Precompile hook', :group => :all do |app|
6
+ app.config.assets.precompile += ['jquery.bez.js']
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Bez
3
3
  module Rails
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,56 @@
1
+ /*!
2
+ * Bez @VERSION
3
+ * http://github.com/rdallasgray/bez
4
+ *
5
+ * A plugin to convert CSS3 cubic-bezier co-ordinates to jQuery-compatible easing functions
6
+ *
7
+ * With thanks to Nikolay Nemshilov for clarification on the cubic-bezier maths
8
+ * See http://st-on-it.blogspot.com/2011/05/calculating-cubic-bezier-function.html
9
+ *
10
+ * Copyright @YEAR Robert Dallas Gray. All rights reserved.
11
+ * Provided under the FreeBSD license: https://github.com/rdallasgray/bez/blob/master/LICENSE.txt
12
+ */
13
+ (function(factory) {
14
+ if (typeof exports === "object") {
15
+ factory(require("jquery"));
16
+ } else if (typeof define === "function" && define.amd) {
17
+ define(["jquery"], factory);
18
+ } else {
19
+ factory(jQuery);
20
+ }
21
+ }(function($) {
22
+ $.extend({ bez: function(encodedFuncName, coOrdArray) {
23
+ if ($.isArray(encodedFuncName)) {
24
+ coOrdArray = encodedFuncName;
25
+ encodedFuncName = 'bez_' + coOrdArray.join('_').replace(/\./g, 'p');
26
+ }
27
+ if (typeof $.easing[encodedFuncName] !== "function") {
28
+ var polyBez = function(p1, p2) {
29
+ var A = [null, null], B = [null, null], C = [null, null],
30
+ bezCoOrd = function(t, ax) {
31
+ C[ax] = 3 * p1[ax], B[ax] = 3 * (p2[ax] - p1[ax]) - C[ax], A[ax] = 1 - C[ax] - B[ax];
32
+ return t * (C[ax] + t * (B[ax] + t * A[ax]));
33
+ },
34
+ xDeriv = function(t) {
35
+ return C[0] + t * (2 * B[0] + 3 * A[0] * t);
36
+ },
37
+ xForT = function(t) {
38
+ var x = t, i = 0, z;
39
+ while (++i < 14) {
40
+ z = bezCoOrd(x, 0) - t;
41
+ if (Math.abs(z) < 1e-3) break;
42
+ x -= z / xDeriv(x);
43
+ }
44
+ return x;
45
+ };
46
+ return function(t) {
47
+ return bezCoOrd(xForT(t), 1);
48
+ }
49
+ };
50
+ $.easing[encodedFuncName] = function(x, t, b, c, d) {
51
+ return c * polyBez([coOrdArray[0], coOrdArray[1]], [coOrdArray[2], coOrdArray[3]])(t/d) + b;
52
+ }
53
+ }
54
+ return encodedFuncName;
55
+ }});
56
+ }));
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-bez-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill
@@ -69,9 +69,12 @@ files:
69
69
  - Rakefile
70
70
  - bin/console
71
71
  - bin/setup
72
+ - jquery-bez-rails-0.1.0.gem
72
73
  - jquery-bez-rails.gemspec
73
74
  - lib/jquery/bez/rails.rb
75
+ - lib/jquery/bez/rails/engine.rb
74
76
  - lib/jquery/bez/rails/version.rb
77
+ - vendor/assets/javascripts/jquery.bez.js
75
78
  homepage: https://github.com/cderche/jquery-bez-rails
76
79
  licenses:
77
80
  - MIT