resizeend-rails 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d5cc259530e67ae051e5522f0f07b228f5ff7c5b
4
+ data.tar.gz: cfa8a8674d3e20d322e3afa00a26ffdc18d75b11
5
+ SHA512:
6
+ metadata.gz: b634817989fd924dd00aa7f1d23dba2aa27abdcb819626d6705b90784ff2837e1906b99d71ae5c145f7d5f6f769520469fdd360c7705c5851af0fd8d99aa09d4
7
+ data.tar.gz: 31b2ff39d4e6e2beb6b205375def69fd52235f9fdff1cebc6d92e82ba5b9740ceae15b4f52622c7d5aadc8831e5bf1ec5c878dda999ee5bddaa4f7bb1c53bcdd
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .DS_Store
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # resizeend-rails
2
+
3
+ [resizeend](https://github.com/porada/resizeend) packaged for Rails assets pipeline.
4
+
5
+ ## License
6
+
7
+ Distributed under [MIT license](http://porada.mit-license.org/).
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,5 @@
1
+ module ResizeEnd
2
+ module Rails
3
+ VERSION = '1.1.1'
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'resizeend-rails/version'
2
+
3
+ module ResizeEnd
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ # Make Rails check the vendor directory
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'resizeend-rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'resizeend-rails'
8
+ spec.version = ResizeEnd::Rails::VERSION
9
+ spec.authors = ['Dominik Porada']
10
+ spec.email = ['dominik@porada.co']
11
+ spec.summary = 'resizeend packaged for Rails assets pipeline'
12
+ spec.homepage = 'https://github.com/rails-assets/resizeend-rails'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.3'
21
+ spec.add_development_dependency 'rake'
22
+ end
@@ -0,0 +1,37 @@
1
+ #
2
+ # resizeend.coffee © 2012–2013 Dominik Porada · http://porada.mit-license.org
3
+ # ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
4
+
5
+ do (window, document) ->
6
+ return unless window.addEventListener and document.createEvent
7
+
8
+ event = null
9
+
10
+ dispatchResizeEndEvent = ->
11
+ unless event
12
+ event = document.createEvent 'Event'
13
+ event.initEvent 'resizeend', false, false
14
+ window.dispatchEvent event
15
+
16
+ # Assuming `window.orientation` is all about degrees (or nothing),
17
+ # the function expression returns either 0 or 90
18
+ getCurrentOrientation = ->
19
+ Math.abs(+window.orientation or 0) % 180
20
+
21
+ initialOrientation = getCurrentOrientation()
22
+ currentOrientation = null
23
+ resizeDebounceTimeout = null
24
+
25
+ debounce = ->
26
+ currentOrientation = getCurrentOrientation()
27
+
28
+ # If `window` is resized due to an orientation change,
29
+ # dispatch `resizeend` immediately; otherwise, slightly delay it
30
+ unless currentOrientation is initialOrientation
31
+ dispatchResizeEndEvent()
32
+ initialOrientation = currentOrientation
33
+ else
34
+ clearTimeout resizeDebounceTimeout
35
+ resizeDebounceTimeout = setTimeout dispatchResizeEndEvent, 100
36
+
37
+ window.addEventListener 'resize', debounce, false
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resizeend-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Dominik Porada
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email:
43
+ - dominik@porada.co
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - README.md
51
+ - Rakefile
52
+ - lib/resizeend-rails.rb
53
+ - lib/resizeend-rails/version.rb
54
+ - resizeend-rails.gemspec
55
+ - vendor/assets/javascripts/resizeend.coffee
56
+ homepage: https://github.com/rails-assets/resizeend-rails
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project:
76
+ rubygems_version: 2.0.3
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: resizeend packaged for Rails assets pipeline
80
+ test_files: []