carrierwave-crop-on-fly 0.0.2 → 0.0.3

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: b18f7a8ce84ab23f13a56a0cbbe34ab0385e5771
4
- data.tar.gz: 15d5e06ed28560e3f449f910648c09f7ce3372a0
3
+ metadata.gz: 9cffee5c482ce6e6def457c4e9902ec0241b3345
4
+ data.tar.gz: bea44c74f578ab4342e59e7141b54f409b9993fb
5
5
  SHA512:
6
- metadata.gz: 87112fe039c7c98727b5170dc6cdf2d9ed5187a77d05c42c05ed3ca7a0763564c3db281a1be3bfb7a6a19e91ec1a1ffe88a2b693622340ecdd8a5f36c745bdbc
7
- data.tar.gz: 63a23441326c915312e96547cfcc9d9700d42f49f223a8d7cf8387552b000a47fa7fbca7c288d1aeb4737860bcdecb3f570b504254f5e7fd9003aa6741774e17
6
+ metadata.gz: 53101d90297b31747da89f2aae820c2a8d712ece725a5f004a9c9f21534e904e7505534049a58a463915cdaa70e848e532e6bb034deb455651a9826a7973230a
7
+ data.tar.gz: 340de4fcbbd26e0a82b68d1dd26213fd531d5a641904671e0c336ce86ac891e4ec3e35280975b558b4fc37635acec4a6ec9bcfb940a6742d6dab1244666c59e8
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # CarrierWave-Fly-Crop
1
+ # CarrierWave-Crop-On-Fly
2
2
 
3
3
  CarrierWave extension for on fly specifying crop area with preview and cropping images before they saved.
4
4
 
@@ -8,11 +8,11 @@ this gem based on [carrierwave-crop](https://github.com/kirtithorat/carrierwave-
8
8
 
9
9
  Install the latest stable release:
10
10
 
11
- $[sudo] gem install carrierwave-fly-crop
11
+ $[sudo] gem install carrierwave-crop-on-fly
12
12
 
13
13
  In Rails, add it to your Gemfile:
14
14
 
15
- gem 'carrierwave-fly-crop'
15
+ gem 'carrierwave-crop-on-fly'
16
16
 
17
17
  Also you must add mini_magick gem
18
18
 
@@ -31,7 +31,12 @@ Add the required files in assets
31
31
  In .js file
32
32
 
33
33
  //= require jquery
34
- //= require jcrop_init
34
+ //= require jcrop.js
35
+ //= require_self
36
+
37
+ $(document).ready(function() {
38
+ document.jcrop.init({ file_input_id: 'user_avatar' });
39
+ });
35
40
 
36
41
  In .css file
37
42
 
@@ -64,4 +69,4 @@ In the view:
64
69
 
65
70
  ### Credits and resources
66
71
  * [CarrierWave](https://github.com/carrierwaveuploader/carrierwave)
67
- * [Deep Liquid's JCrop](http://deepliquid.com/content/Jcrop.html)
72
+ * [Deep Liquid's JCrop](http://deepliquid.com/content/Jcrop.html)
@@ -12,10 +12,10 @@ module CarrierWave
12
12
  private
13
13
 
14
14
  def remember_crop_data(file)
15
- self.crop_x = file.file.crop_x
16
- self.crop_y = file.file.crop_y
17
- self.crop_w = file.file.crop_w
18
- self.crop_h = file.file.crop_h
15
+ self.crop_x = file.file.crop_x if file.file.respond_to?(:crop_x)
16
+ self.crop_y = file.file.crop_y if file.file.respond_to?(:crop_y)
17
+ self.crop_w = file.file.crop_w if file.file.respond_to?(:crop_w)
18
+ self.crop_h = file.file.crop_h if file.file.respond_to?(:crop_h)
19
19
  end
20
20
 
21
21
  end
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Crop
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-crop-on-fly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - evg2108
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2015-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails