simple_form_fileinput 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: 2a73252b4191909b159fc1f08fef1e0e02de9d83
4
- data.tar.gz: 1bb0462bc38fffbeeb765b338498721b6d6390b8
3
+ metadata.gz: d3ecb1963ec1856c09aac1d36963f27654eeab5b
4
+ data.tar.gz: 5b152a87c0fa0ec6775446a4867e8c5e2cb9e3f3
5
5
  SHA512:
6
- metadata.gz: 57420be71252add9c3e17af1578b644020ed06d6dded2155f35151180cbf44a5240fb10298be222bad5feaa5f5263ad62f33087ed5e2db54779fb262eb41721e
7
- data.tar.gz: 2e249f50fe395313cc14c89123b680bef7de2e49ea2f8c51e8eaa955bdf41a5da6fe245105ff4f909c14e15e31b6c167f86573319bc7ce55ebd6237cca86205c
6
+ metadata.gz: 9fc95738fa40fcdd5686516a16497c52d181b3bddd43badec5b6f3502c6fe4ff81c87a90584f91d85701776f8609d6ace4f6c2cc53e856744aff3e09ea8bca06
7
+ data.tar.gz: 28b651196be3a0931f5223dd84e211e60fe04404539e94aa23adfe75dc017dedaf0c8c9f71b8381cea4e9f9ef93d094623c634f9796ceaf0788e0cf30602f5d8
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
@@ -14,6 +14,9 @@ module SimpleFormFileinput
14
14
  inject_into_file 'app/assets/javascripts/application.js', :before => '//= require_tree .' do
15
15
  "//= require simple_form_fileinput/init\n"
16
16
  end
17
+ inject_into_file 'app/assets/stylesheets/application.css', :before => ' *= require_self' do
18
+ " *= require simple_form_fileinput/enhancements\n"
19
+ end
17
20
  end
18
21
 
19
22
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormFileinput
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
File without changes
File without changes
@@ -1,14 +1,24 @@
1
1
  $ ->
2
+ # The plugin code
3
+ $.fn.draghover = (options)->
4
+ @each ->
5
+ collection = $()
6
+ self = $(@)
7
+ self.on "dragenter", (e)->
8
+ self.trigger "draghoverstart" if collection.length is 0
9
+ collection = collection.add(e.target)
10
+ self.on "dragleave drop", (e)->
11
+ collection = collection.not(e.target)
12
+ self.trigger "draghoverend" if collection.length is 0
13
+
2
14
  $(document).ready ->
3
- $('body').on 'dragenter', (e)->
4
- console.log e
5
- $('.file-input-wrapper input[type=file]').addClass('file-in-window')
6
- $('body').on 'dragleave', (e)->
7
- console.log e
8
- $('.file-input-wrapper input[type=file]').removeClass('file-in-window')
9
- $('body').on 'dragenter', '.file-input-wrapper input[type=file]', (e)->
10
- console.log e
11
- $(@).addClass('file-hovering')
12
- $('body').on 'dragleave', '.file-input-wrapper input[type=file]', (e)->
13
- console.log e
14
- $(@).removeClass('file-hovering')
15
+ $(window).draghover().on
16
+ draghoverstart: ->
17
+ $('.file-input-wrapper').addClass('file-in-window')
18
+ draghoverend: ->
19
+ $('.file-input-wrapper').removeClass('file-in-window')
20
+ $('.file-input-wrapper input[type=file]').draghover().on
21
+ draghoverstart: ->
22
+ $(@).parent().addClass('file-hovering')
23
+ draghoverend: ->
24
+ $(@).parent().removeClass('file-hovering')
@@ -0,0 +1,10 @@
1
+ .file-in-window {
2
+ padding: 30px 30px 50px !important;
3
+ border: 5px dashed #CFCFCF !important;
4
+ input[type=file] {
5
+ padding: 30px 30px 50px !important;
6
+ }
7
+ }
8
+ .file-hovering {
9
+ box-shadow: inset 0px 0px 10px black !important;
10
+ }
@@ -0,0 +1,12 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_tree ./simple_form_fileinput/enhancements
12
+ *= require_self
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_fileinput
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
  - smit1625
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: railties
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simple_form
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Beautifies the default file input for SimpleForm
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - Gemfile
78
78
  - LICENSE.txt
79
79
  - README.md
@@ -86,6 +86,8 @@ files:
86
86
  - vendor/assets/javascripts/simple_form_fileinput/bootstrap.file-input.js
87
87
  - vendor/assets/javascripts/simple_form_fileinput/enhancements.js.coffee
88
88
  - vendor/assets/javascripts/simple_form_fileinput/init.js
89
+ - vendor/assets/stylesheets/simple_form_fileinput/enhancements.css.scss
90
+ - vendor/assets/stylesheets/simple_form_fileinput/init.css
89
91
  homepage: ''
90
92
  licenses:
91
93
  - MIT
@@ -96,12 +98,12 @@ require_paths:
96
98
  - lib
97
99
  required_ruby_version: !ruby/object:Gem::Requirement
98
100
  requirements:
99
- - - '>='
101
+ - - ">="
100
102
  - !ruby/object:Gem::Version
101
103
  version: '0'
102
104
  required_rubygems_version: !ruby/object:Gem::Requirement
103
105
  requirements:
104
- - - '>='
106
+ - - ">="
105
107
  - !ruby/object:Gem::Version
106
108
  version: '0'
107
109
  requirements: []