cropimage_riffpad 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.gitignore +17 -0
  2. data/.gitignore.swp +0 -0
  3. data/Gemfile +13 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +1 -0
  7. data/app/assets/images/Jcrop.gif +0 -0
  8. data/app/assets/images/blank.gif +0 -0
  9. data/app/assets/images/fancy_close.png +0 -0
  10. data/app/assets/images/fancy_loading.png +0 -0
  11. data/app/assets/images/fancy_nav_left.png +0 -0
  12. data/app/assets/images/fancy_nav_right.png +0 -0
  13. data/app/assets/images/fancy_shadow_e.png +0 -0
  14. data/app/assets/images/fancy_shadow_n.png +0 -0
  15. data/app/assets/images/fancy_shadow_ne.png +0 -0
  16. data/app/assets/images/fancy_shadow_nw.png +0 -0
  17. data/app/assets/images/fancy_shadow_s.png +0 -0
  18. data/app/assets/images/fancy_shadow_se.png +0 -0
  19. data/app/assets/images/fancy_shadow_sw.png +0 -0
  20. data/app/assets/images/fancy_shadow_w.png +0 -0
  21. data/app/assets/images/fancy_title_left.png +0 -0
  22. data/app/assets/images/fancy_title_main.png +0 -0
  23. data/app/assets/images/fancy_title_over.png +0 -0
  24. data/app/assets/images/fancy_title_right.png +0 -0
  25. data/app/assets/images/fancybox-x.png +0 -0
  26. data/app/assets/images/fancybox-y.png +0 -0
  27. data/app/assets/images/fancybox.png +0 -0
  28. data/app/assets/javascripts/.DS_Store +0 -0
  29. data/app/assets/javascripts/awesome_gem.js +14 -0
  30. data/app/assets/javascripts/jquery.Jcrop.js +1695 -0
  31. data/app/assets/javascripts/jquery.color.js +123 -0
  32. data/app/assets/javascripts/jquery.easing-1.3.pack.js +72 -0
  33. data/app/assets/javascripts/jquery.fancybox-1.3.4.js +1156 -0
  34. data/app/assets/javascripts/jquery.mousewheel-3.0.4.pack.js +14 -0
  35. data/app/assets/stylesheets/.DS_Store +0 -0
  36. data/app/assets/stylesheets/awesome_gem.css.scss +6 -0
  37. data/app/assets/stylesheets/jquery.Jcrop.css +86 -0
  38. data/app/assets/stylesheets/jquery.Jcrop.min.css +28 -0
  39. data/app/assets/stylesheets/jquery.fancybox-1.3.4.css +359 -0
  40. data/app/assets/stylesheets/style.css +151 -0
  41. data/app/helpers/cropimage_riffpad/crop_image_helper.rb +65 -0
  42. data/cropimage_riffpad.gemspec +19 -0
  43. data/lib/cropimage_riffpad/.DS_Store +0 -0
  44. data/lib/cropimage_riffpad/crop_image_controller.rb +39 -0
  45. data/lib/cropimage_riffpad/crop_image_model.rb +28 -0
  46. data/lib/cropimage_riffpad/paperclip_processors/cropper.rb +27 -0
  47. data/lib/cropimage_riffpad/version.rb +3 -0
  48. data/lib/cropimage_riffpad.rb +14 -0
  49. data/lib/generators/cropimage_riffpad/install_generator.rb +37 -0
  50. metadata +94 -0
@@ -0,0 +1,123 @@
1
+ /*
2
+ * jQuery Color Animations
3
+ * Copyright 2007 John Resig
4
+ * Released under the MIT and GPL licenses.
5
+ */
6
+
7
+ (function(jQuery){
8
+
9
+ // We override the animation for all of these color styles
10
+ jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
11
+ jQuery.fx.step[attr] = function(fx){
12
+ if ( fx.state == 0 ) {
13
+ fx.start = getColor( fx.elem, attr );
14
+ fx.end = getRGB( fx.end );
15
+ }
16
+
17
+ fx.elem.style[attr] = "rgb(" + [
18
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
19
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
20
+ Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
21
+ ].join(",") + ")";
22
+ }
23
+ });
24
+
25
+ // Color Conversion functions from highlightFade
26
+ // By Blair Mitchelmore
27
+ // http://jquery.offput.ca/highlightFade/
28
+
29
+ // Parse strings looking for color tuples [255,255,255]
30
+ function getRGB(color) {
31
+ var result;
32
+
33
+ // Check if we're already dealing with an array of colors
34
+ if ( color && color.constructor == Array && color.length == 3 )
35
+ return color;
36
+
37
+ // Look for rgb(num,num,num)
38
+ if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
39
+ return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
40
+
41
+ // Look for rgb(num%,num%,num%)
42
+ if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
43
+ return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
44
+
45
+ // Look for #a0b1c2
46
+ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
47
+ return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
48
+
49
+ // Look for #fff
50
+ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
51
+ return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
52
+
53
+ // Otherwise, we're most likely dealing with a named color
54
+ return colors[jQuery.trim(color).toLowerCase()];
55
+ }
56
+
57
+ function getColor(elem, attr) {
58
+ var color;
59
+
60
+ do {
61
+ color = jQuery.curCSS(elem, attr);
62
+
63
+ // Keep going until we find an element that has color, or we hit the body
64
+ if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
65
+ break;
66
+
67
+ attr = "backgroundColor";
68
+ } while ( elem = elem.parentNode );
69
+
70
+ return getRGB(color);
71
+ };
72
+
73
+ // Some named colors to work with
74
+ // From Interface by Stefan Petre
75
+ // http://interface.eyecon.ro/
76
+
77
+ var colors = {
78
+ aqua:[0,255,255],
79
+ azure:[240,255,255],
80
+ beige:[245,245,220],
81
+ black:[0,0,0],
82
+ blue:[0,0,255],
83
+ brown:[165,42,42],
84
+ cyan:[0,255,255],
85
+ darkblue:[0,0,139],
86
+ darkcyan:[0,139,139],
87
+ darkgrey:[169,169,169],
88
+ darkgreen:[0,100,0],
89
+ darkkhaki:[189,183,107],
90
+ darkmagenta:[139,0,139],
91
+ darkolivegreen:[85,107,47],
92
+ darkorange:[255,140,0],
93
+ darkorchid:[153,50,204],
94
+ darkred:[139,0,0],
95
+ darksalmon:[233,150,122],
96
+ darkviolet:[148,0,211],
97
+ fuchsia:[255,0,255],
98
+ gold:[255,215,0],
99
+ green:[0,128,0],
100
+ indigo:[75,0,130],
101
+ khaki:[240,230,140],
102
+ lightblue:[173,216,230],
103
+ lightcyan:[224,255,255],
104
+ lightgreen:[144,238,144],
105
+ lightgrey:[211,211,211],
106
+ lightpink:[255,182,193],
107
+ lightyellow:[255,255,224],
108
+ lime:[0,255,0],
109
+ magenta:[255,0,255],
110
+ maroon:[128,0,0],
111
+ navy:[0,0,128],
112
+ olive:[128,128,0],
113
+ orange:[255,165,0],
114
+ pink:[255,192,203],
115
+ purple:[128,0,128],
116
+ violet:[128,0,128],
117
+ red:[255,0,0],
118
+ silver:[192,192,192],
119
+ white:[255,255,255],
120
+ yellow:[255,255,0]
121
+ };
122
+
123
+ })(jQuery);
@@ -0,0 +1,72 @@
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,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math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
40
+
41
+ /*
42
+ *
43
+ * TERMS OF USE - EASING EQUATIONS
44
+ *
45
+ * Open source under the BSD License.
46
+ *
47
+ * Copyright © 2001 Robert Penner
48
+ * All rights reserved.
49
+ *
50
+ * Redistribution and use in source and binary forms, with or without modification,
51
+ * are permitted provided that the following conditions are met:
52
+ *
53
+ * Redistributions of source code must retain the above copyright notice, this list of
54
+ * conditions and the following disclaimer.
55
+ * Redistributions in binary form must reproduce the above copyright notice, this list
56
+ * of conditions and the following disclaimer in the documentation and/or other materials
57
+ * provided with the distribution.
58
+ *
59
+ * Neither the name of the author nor the names of contributors may be used to endorse
60
+ * or promote products derived from this software without specific prior written permission.
61
+ *
62
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
63
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
64
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
65
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
66
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
67
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
68
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
69
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
71
+ *
72
+ */