ack_rails_admin_jcrop 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/rails_admin/ra.jcrop.js +2 -2
- data/app/assets/stylesheets/rails_admin/ra.jcrop.sass +5 -3
- data/app/views/rails_admin/main/_form_jcrop.html.slim +9 -2
- data/lib/rails_admin_jcrop/asset_engine/paperclip.rb +1 -2
- data/lib/rails_admin_jcrop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f0c2fb571d80ca926baf496b823b681c8ddb2a
|
4
|
+
data.tar.gz: 60d44c3be2f7f01c5f00f7a868306ae31dde55b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c68157026b39feca78a3e1bdc75a60bf06e5bda3430bef960960a5a9bcfb677f58b25bd4c7bef22f9be4ff073a438c46c4a9e38702915f3d29c3fd70b4cc002b
|
7
|
+
data.tar.gz: 3203270f31dec56969c9401dfc7957a229ffe42ed7aec7a48558fca7ffe5d0997b625d94709edfb81b5c5c461a403901602715327938afa066c063df9e50075d
|
@@ -5,7 +5,7 @@
|
|
5
5
|
var widget = this;
|
6
6
|
var dom_widget = widget.element;
|
7
7
|
|
8
|
-
var thumbnailLink = dom_widget.find('
|
8
|
+
var thumbnailLink = dom_widget.find('.jcrop_data_value');
|
9
9
|
thumbnailLink.unbind().bind("click", function(e){
|
10
10
|
widget._bindModalOpening(e, dom_widget.find('a.jcrop_handle').data('link'));
|
11
11
|
return false;
|
@@ -77,7 +77,7 @@
|
|
77
77
|
var select = widget.element.find('select').filter(":hidden");
|
78
78
|
|
79
79
|
thumb = widget.element.find('a.jcrop_handle').data('thumb');
|
80
|
-
widget.element.find('
|
80
|
+
widget.element.find('.jcrop_data_value img').removeAttr('src').attr('src', json.urls[thumb] + '?' + new Date().valueOf());
|
81
81
|
|
82
82
|
widget._trigger("success");
|
83
83
|
dialog.modal("hide");
|
@@ -1,4 +1,11 @@
|
|
1
|
-
-
|
1
|
+
- if field.jcrop_options.is_a?(Hash)
|
2
|
+
- rails_admin_jcrop_options = field.jcrop_options.to_json
|
3
|
+
- else
|
4
|
+
- _method = field.jcrop_options.to_sym
|
5
|
+
- if form.object.respond_to?(_method)
|
6
|
+
- rails_admin_jcrop_options = form.object.send(field.jcrop_options.to_sym).to_json
|
7
|
+
- else
|
8
|
+
- rails_admin_jcrop_options = {}
|
2
9
|
|
3
10
|
= stylesheet_link_tag 'rails_admin/jquery.Jcrop'
|
4
11
|
= stylesheet_link_tag 'rails_admin/ra.jcrop'
|
@@ -9,7 +16,7 @@
|
|
9
16
|
|
10
17
|
.toggle{style=('display:none;' if file and field.delete_method and form.object.send(field.delete_method) == '1')}
|
11
18
|
- if value = field.pretty_value
|
12
|
-
= value
|
19
|
+
.jcrop_data_value= value
|
13
20
|
= form.file_field(field.name, field.html_attributes.reverse_merge({data: {fileupload: true, rails_admin_jcrop_options: rails_admin_jcrop_options } }))
|
14
21
|
|
15
22
|
- url = jcrop_path(model_name: form.object.class.to_param, modal: true, id: form.object.id, field: field.name, fit_image: field.fit_image)
|
@@ -6,7 +6,7 @@ module RailsAdminJcrop
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def crop!(obj, field)
|
9
|
-
obj.send(field).reprocess!
|
9
|
+
obj.send(field).reprocess! && obj.save
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -17,7 +17,6 @@ module Paperclip
|
|
17
17
|
module NewClassMethods
|
18
18
|
def has_attached_file(*args)
|
19
19
|
super
|
20
|
-
|
21
20
|
self.attachment_definitions.each do |name, options|
|
22
21
|
options[:processors] ||= []
|
23
22
|
options[:processors] << :rails_admin_jcropper
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ack_rails_admin_jcrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ack43
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|