cropper_rails 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,75 @@
1
+ /*!
2
+ * jQuery Cropper v1.0.0
3
+ * https://github.com/fengyuanchen/jquery-cropper
4
+ *
5
+ * Copyright (c) 2018 Chen Fengyuan
6
+ * Released under the MIT license
7
+ *
8
+ * Date: 2018-04-01T06:20:13.168Z
9
+ */
10
+
11
+ (function (global, factory) {
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery'), require('cropperjs')) :
13
+ typeof define === 'function' && define.amd ? define(['jquery', 'cropperjs'], factory) :
14
+ (factory(global.jQuery,global.Cropper));
15
+ }(this, (function ($,Cropper) { 'use strict';
16
+
17
+ $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
18
+ Cropper = Cropper && Cropper.hasOwnProperty('default') ? Cropper['default'] : Cropper;
19
+
20
+ if ($.fn) {
21
+ var AnotherCropper = $.fn.cropper;
22
+ var NAMESPACE = 'cropper';
23
+
24
+ $.fn.cropper = function jQueryCropper(option) {
25
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
26
+ args[_key - 1] = arguments[_key];
27
+ }
28
+
29
+ var result = void 0;
30
+
31
+ this.each(function (i, element) {
32
+ var $element = $(element);
33
+ var isDestroy = option === 'destroy';
34
+ var cropper = $element.data(NAMESPACE);
35
+
36
+ if (!cropper) {
37
+ if (isDestroy) {
38
+ return;
39
+ }
40
+
41
+ var options = $.extend({}, $element.data(), $.isPlainObject(option) && option);
42
+
43
+ cropper = new Cropper(element, options);
44
+ $element.data(NAMESPACE, cropper);
45
+ }
46
+
47
+ if (typeof option === 'string') {
48
+ var fn = cropper[option];
49
+
50
+ if ($.isFunction(fn)) {
51
+ result = fn.apply(cropper, args);
52
+
53
+ if (result === cropper) {
54
+ result = undefined;
55
+ }
56
+
57
+ if (isDestroy) {
58
+ $element.removeData(NAMESPACE);
59
+ }
60
+ }
61
+ }
62
+ });
63
+
64
+ return result !== undefined ? result : this;
65
+ };
66
+
67
+ $.fn.cropper.Constructor = Cropper;
68
+ $.fn.cropper.setDefaults = Cropper.setDefaults;
69
+ $.fn.cropper.noConflict = function noConflict() {
70
+ $.fn.cropper = AnotherCropper;
71
+ return this;
72
+ };
73
+ }
74
+
75
+ })));
@@ -0,0 +1,304 @@
1
+ /*!
2
+ * Cropper.js v1.4.1
3
+ * https://fengyuanchen.github.io/cropperjs
4
+ *
5
+ * Copyright 2015-present Chen Fengyuan
6
+ * Released under the MIT license
7
+ *
8
+ * Date: 2018-07-15T09:54:43.167Z
9
+ */
10
+
11
+ .cropper-container {
12
+ direction: ltr;
13
+ font-size: 0;
14
+ line-height: 0;
15
+ position: relative;
16
+ -ms-touch-action: none;
17
+ touch-action: none;
18
+ -webkit-user-select: none;
19
+ -moz-user-select: none;
20
+ -ms-user-select: none;
21
+ user-select: none;
22
+ }
23
+
24
+ .cropper-container img {
25
+ display: block;
26
+ height: 100%;
27
+ image-orientation: 0deg;
28
+ max-height: none !important;
29
+ max-width: none !important;
30
+ min-height: 0 !important;
31
+ min-width: 0 !important;
32
+ width: 100%;
33
+ }
34
+
35
+ .cropper-wrap-box,
36
+ .cropper-canvas,
37
+ .cropper-drag-box,
38
+ .cropper-crop-box,
39
+ .cropper-modal {
40
+ bottom: 0;
41
+ left: 0;
42
+ position: absolute;
43
+ right: 0;
44
+ top: 0;
45
+ }
46
+
47
+ .cropper-wrap-box,
48
+ .cropper-canvas {
49
+ overflow: hidden;
50
+ }
51
+
52
+ .cropper-drag-box {
53
+ background-color: #fff;
54
+ opacity: 0;
55
+ }
56
+
57
+ .cropper-modal {
58
+ background-color: #000;
59
+ opacity: .5;
60
+ }
61
+
62
+ .cropper-view-box {
63
+ display: block;
64
+ height: 100%;
65
+ outline-color: rgba(51, 153, 255, 0.75);
66
+ outline: 1px solid #39f;
67
+ overflow: hidden;
68
+ width: 100%;
69
+ }
70
+
71
+ .cropper-dashed {
72
+ border: 0 dashed #eee;
73
+ display: block;
74
+ opacity: .5;
75
+ position: absolute;
76
+ }
77
+
78
+ .cropper-dashed.dashed-h {
79
+ border-bottom-width: 1px;
80
+ border-top-width: 1px;
81
+ height: calc(100% / 3);
82
+ left: 0;
83
+ top: calc(100% / 3);
84
+ width: 100%;
85
+ }
86
+
87
+ .cropper-dashed.dashed-v {
88
+ border-left-width: 1px;
89
+ border-right-width: 1px;
90
+ height: 100%;
91
+ left: calc(100% / 3);
92
+ top: 0;
93
+ width: calc(100% / 3);
94
+ }
95
+
96
+ .cropper-center {
97
+ display: block;
98
+ height: 0;
99
+ left: 50%;
100
+ opacity: .75;
101
+ position: absolute;
102
+ top: 50%;
103
+ width: 0;
104
+ }
105
+
106
+ .cropper-center:before,
107
+ .cropper-center:after {
108
+ background-color: #eee;
109
+ content: ' ';
110
+ display: block;
111
+ position: absolute;
112
+ }
113
+
114
+ .cropper-center:before {
115
+ height: 1px;
116
+ left: -3px;
117
+ top: 0;
118
+ width: 7px;
119
+ }
120
+
121
+ .cropper-center:after {
122
+ height: 7px;
123
+ left: 0;
124
+ top: -3px;
125
+ width: 1px;
126
+ }
127
+
128
+ .cropper-face,
129
+ .cropper-line,
130
+ .cropper-point {
131
+ display: block;
132
+ height: 100%;
133
+ opacity: .1;
134
+ position: absolute;
135
+ width: 100%;
136
+ }
137
+
138
+ .cropper-face {
139
+ background-color: #fff;
140
+ left: 0;
141
+ top: 0;
142
+ }
143
+
144
+ .cropper-line {
145
+ background-color: #39f;
146
+ }
147
+
148
+ .cropper-line.line-e {
149
+ cursor: ew-resize;
150
+ right: -3px;
151
+ top: 0;
152
+ width: 5px;
153
+ }
154
+
155
+ .cropper-line.line-n {
156
+ cursor: ns-resize;
157
+ height: 5px;
158
+ left: 0;
159
+ top: -3px;
160
+ }
161
+
162
+ .cropper-line.line-w {
163
+ cursor: ew-resize;
164
+ left: -3px;
165
+ top: 0;
166
+ width: 5px;
167
+ }
168
+
169
+ .cropper-line.line-s {
170
+ bottom: -3px;
171
+ cursor: ns-resize;
172
+ height: 5px;
173
+ left: 0;
174
+ }
175
+
176
+ .cropper-point {
177
+ background-color: #39f;
178
+ height: 5px;
179
+ opacity: .75;
180
+ width: 5px;
181
+ }
182
+
183
+ .cropper-point.point-e {
184
+ cursor: ew-resize;
185
+ margin-top: -3px;
186
+ right: -3px;
187
+ top: 50%;
188
+ }
189
+
190
+ .cropper-point.point-n {
191
+ cursor: ns-resize;
192
+ left: 50%;
193
+ margin-left: -3px;
194
+ top: -3px;
195
+ }
196
+
197
+ .cropper-point.point-w {
198
+ cursor: ew-resize;
199
+ left: -3px;
200
+ margin-top: -3px;
201
+ top: 50%;
202
+ }
203
+
204
+ .cropper-point.point-s {
205
+ bottom: -3px;
206
+ cursor: s-resize;
207
+ left: 50%;
208
+ margin-left: -3px;
209
+ }
210
+
211
+ .cropper-point.point-ne {
212
+ cursor: nesw-resize;
213
+ right: -3px;
214
+ top: -3px;
215
+ }
216
+
217
+ .cropper-point.point-nw {
218
+ cursor: nwse-resize;
219
+ left: -3px;
220
+ top: -3px;
221
+ }
222
+
223
+ .cropper-point.point-sw {
224
+ bottom: -3px;
225
+ cursor: nesw-resize;
226
+ left: -3px;
227
+ }
228
+
229
+ .cropper-point.point-se {
230
+ bottom: -3px;
231
+ cursor: nwse-resize;
232
+ height: 20px;
233
+ opacity: 1;
234
+ right: -3px;
235
+ width: 20px;
236
+ }
237
+
238
+ @media (min-width: 768px) {
239
+ .cropper-point.point-se {
240
+ height: 15px;
241
+ width: 15px;
242
+ }
243
+ }
244
+
245
+ @media (min-width: 992px) {
246
+ .cropper-point.point-se {
247
+ height: 10px;
248
+ width: 10px;
249
+ }
250
+ }
251
+
252
+ @media (min-width: 1200px) {
253
+ .cropper-point.point-se {
254
+ height: 5px;
255
+ opacity: .75;
256
+ width: 5px;
257
+ }
258
+ }
259
+
260
+ .cropper-point.point-se:before {
261
+ background-color: #39f;
262
+ bottom: -50%;
263
+ content: ' ';
264
+ display: block;
265
+ height: 200%;
266
+ opacity: 0;
267
+ position: absolute;
268
+ right: -50%;
269
+ width: 200%;
270
+ }
271
+
272
+ .cropper-invisible {
273
+ opacity: 0;
274
+ }
275
+
276
+ .cropper-bg {
277
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
278
+ }
279
+
280
+ .cropper-hide {
281
+ display: block;
282
+ height: 0;
283
+ position: absolute;
284
+ width: 0;
285
+ }
286
+
287
+ .cropper-hidden {
288
+ display: none !important;
289
+ }
290
+
291
+ .cropper-move {
292
+ cursor: move;
293
+ }
294
+
295
+ .cropper-crop {
296
+ cursor: crosshair;
297
+ }
298
+
299
+ .cropper-disabled .cropper-drag-box,
300
+ .cropper-disabled .cropper-face,
301
+ .cropper-disabled .cropper-line,
302
+ .cropper-disabled .cropper-point {
303
+ cursor: not-allowed;
304
+ }
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cropper_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - D1ceWard
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-09-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: jquery-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.16'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ description: Cropper is a simple image cropping library. This gem integrates Cropper
42
+ with Rails asset pipeline for ease of use.
43
+ email:
44
+ - contact@d1ceward.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - ".rubocop.yml"
51
+ - CODE_OF_CONDUCT.md
52
+ - Gemfile
53
+ - README.md
54
+ - VERSIONS.md
55
+ - cropper_rails.gemspec
56
+ - lib/cropper_rails.rb
57
+ - lib/cropper_rails/engine.rb
58
+ - lib/cropper_rails/version.rb
59
+ - vendor/assets/javascripts/cropper.js
60
+ - vendor/assets/javascripts/jquery-cropper.js
61
+ - vendor/assets/stylesheets/cropper.css
62
+ homepage: https://github.com/D1ceWard/cropper_rails
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.7.7
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Integrate Cropper library with Rails asset pipeline
86
+ test_files: []