jcropper 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ pkg
@@ -6,9 +6,15 @@ jcropper wraps jcrop 0.98, http://deepliquid.com/content/Jcrop.html, an in-brows
6
6
 
7
7
  = Installation
8
8
 
9
- Install as a plugin (gem to come soon)
9
+ Install plugin or gem
10
10
 
11
11
  script/plugin install git://github.com/syfo/jcropper.git
12
+
13
+ or
14
+
15
+ gem install jcropper
16
+ in environment.rb: config.gem 'jcropper'
17
+ in config/preinitializer.rb or #{RAILS_ROOT}/Rakefile: require 'jcropper/tasks'
12
18
 
13
19
  Include the jcropper processor in the paperclip style.
14
20
 
@@ -43,9 +49,18 @@ Add the helpers to your view:
43
49
  Helper Options:
44
50
  :css_prefix => 'jcrop'
45
51
  :width => 100, :height => 100
46
- :js_object => 'MyGlobalJsObject',
52
+ :js_object => 'croppedImage',
47
53
  :aspect_ratio => 2
48
54
  :aspect_ratio => false
49
-
55
+
56
+ = Notes
57
+
58
+ - jcropper currently only supports ONE cropped style per attachment, one cropped attachment per model
59
+ - croppedImage.jcrop gets you the jcrop api object (see jcrop docs)
60
+ - in helpers, :aspect_ratio defaults to the aspect ratio of the original image
61
+ - in helpers, width and height default to the target geometry for the style
62
+ - you'll have to read the jcropper.js source for function docs there
63
+ - tried only on rails 2.3.5 and ruby 1.8.7
64
+ - test/code ratio is 0
50
65
 
51
66
  Copyright (c) 2010 Symbolforce, LLC., released under the MIT license
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -0,0 +1 @@
1
+ load File.join(File.dirname(__FILE__), '..', '..', 'tasks', 'jcropper.rake') if Rake
@@ -1,10 +1,20 @@
1
1
  namespace :jcropper do
2
- desc "install files"
2
+ desc "Install .CSS and .js files required for view helpers to function. Will not overwrite"
3
3
  task :install => :environment do
4
4
  root = File.join(File.dirname(__FILE__), '..')
5
- FileUtils.cp(File.join(root, 'public/images/Jcrop.gif'), File.join(Rails.root, 'public/images/Jcrop.gif'))
6
- FileUtils.cp(File.join(root, 'public/javascripts/jquery.Jcrop.min.js'), File.join(Rails.root, 'public/javascripts/jquery.Jcrop.min.js'))
7
- FileUtils.cp(File.join(root, 'public/javascripts/jcropper.js'), File.join(Rails.root, 'public/javascripts/jcropper.js'))
8
- FileUtils.cp(File.join(root, 'public/stylesheets/jquery.Jcrop.css'), File.join(Rails.root, 'public/stylesheets/jquery.Jcrop.css'))
5
+ install_file(File.join(root, 'public/images/Jcrop.gif'), File.join(Rails.root, 'public/images/Jcrop.gif'))
6
+ install_file(File.join(root, 'public/javascripts/jquery.Jcrop.min.js'), File.join(Rails.root, 'public/javascripts/jquery.Jcrop.min.js'))
7
+ install_file(File.join(root, 'public/javascripts/jcropper.js'), File.join(Rails.root, 'public/javascripts/jcropper.js'))
8
+ install_file(File.join(root, 'public/stylesheets/jquery.Jcrop.css'), File.join(Rails.root, 'public/stylesheets/jquery.Jcrop.css'))
9
+ end
10
+
11
+ private
12
+ def install_file(from, to)
13
+ if File.exists? to
14
+ puts "#{to} exists, will not overwrite. Remove first."
15
+ else
16
+ puts "Installing file to #{to}"
17
+ FileUtils.cp(from, to)
18
+ end
9
19
  end
10
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jcropper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Ziegler
@@ -29,6 +29,7 @@ extra_rdoc_files:
29
29
  - README.rdoc
30
30
  - TODO
31
31
  files:
32
+ - .gitignore
32
33
  - MIT-LICENSE
33
34
  - README.rdoc
34
35
  - Rakefile
@@ -42,6 +43,7 @@ files:
42
43
  - lib/jcropper/cropped_image.rb
43
44
  - lib/jcropper/helpers.rb
44
45
  - lib/jcropper/jcropper.rb
46
+ - lib/jcropper/tasks.rb
45
47
  - lib/paperclip_processors/jcropper.rb
46
48
  - public/images/Jcrop.gif
47
49
  - public/javascripts/jcropper.js