mootools-plus 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.rbc
2
+ *.sassc
3
+ .sass-cache
4
+ capybara-*.html
5
+ .rspec
6
+ .rvmrc
7
+ .DS_Store
8
+ /.bundle
9
+ /vendor/bundle
10
+ /log/*
11
+ /tmp/*
12
+ /db/*.sqlite3
13
+ /public/system/*
14
+ /coverage/
15
+ /spec/tmp/*
16
+ **.orig
17
+ rerun.txt
18
+ pickle-email-*.html
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ## 0.0.3
2
+
3
+ * Add condition on Mootools presence.
4
+
5
+ ## 0.0.2
6
+
7
+ * Add documentation in Github wiki.
8
+
9
+ ## 0.0.1
10
+
11
+ * First version. See README to learn how to use it.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,97 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mootools-plus (0.0.1)
5
+ rails (~> 3.2.3)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ actionmailer (3.2.3)
11
+ actionpack (= 3.2.3)
12
+ mail (~> 2.4.4)
13
+ actionpack (3.2.3)
14
+ activemodel (= 3.2.3)
15
+ activesupport (= 3.2.3)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.1)
19
+ rack (~> 1.4.0)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.1.2)
23
+ activemodel (3.2.3)
24
+ activesupport (= 3.2.3)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.3)
27
+ activemodel (= 3.2.3)
28
+ activesupport (= 3.2.3)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.3)
32
+ activemodel (= 3.2.3)
33
+ activesupport (= 3.2.3)
34
+ activesupport (3.2.3)
35
+ i18n (~> 0.6)
36
+ multi_json (~> 1.0)
37
+ arel (3.0.2)
38
+ builder (3.0.0)
39
+ erubis (2.7.0)
40
+ hike (1.2.1)
41
+ i18n (0.6.0)
42
+ journey (1.0.3)
43
+ jquery-rails (2.0.2)
44
+ railties (>= 3.2.0, < 5.0)
45
+ thor (~> 0.14)
46
+ json (1.6.6)
47
+ mail (2.4.4)
48
+ i18n (>= 0.4.0)
49
+ mime-types (~> 1.16)
50
+ treetop (~> 1.4.8)
51
+ mime-types (1.18)
52
+ multi_json (1.2.0)
53
+ polyglot (0.3.3)
54
+ rack (1.4.1)
55
+ rack-cache (1.2)
56
+ rack (>= 0.4)
57
+ rack-ssl (1.3.2)
58
+ rack
59
+ rack-test (0.6.1)
60
+ rack (>= 1.0)
61
+ rails (3.2.3)
62
+ actionmailer (= 3.2.3)
63
+ actionpack (= 3.2.3)
64
+ activerecord (= 3.2.3)
65
+ activeresource (= 3.2.3)
66
+ activesupport (= 3.2.3)
67
+ bundler (~> 1.0)
68
+ railties (= 3.2.3)
69
+ railties (3.2.3)
70
+ actionpack (= 3.2.3)
71
+ activesupport (= 3.2.3)
72
+ rack-ssl (~> 1.3.2)
73
+ rake (>= 0.8.7)
74
+ rdoc (~> 3.4)
75
+ thor (~> 0.14.6)
76
+ rake (0.9.2.2)
77
+ rdoc (3.12)
78
+ json (~> 1.4)
79
+ sprockets (2.1.2)
80
+ hike (~> 1.2)
81
+ rack (~> 1.0)
82
+ tilt (~> 1.1, != 1.3.0)
83
+ sqlite3 (1.3.5)
84
+ thor (0.14.6)
85
+ tilt (1.3.3)
86
+ treetop (1.4.10)
87
+ polyglot
88
+ polyglot (>= 0.3.1)
89
+ tzinfo (0.3.33)
90
+
91
+ PLATFORMS
92
+ ruby
93
+
94
+ DEPENDENCIES
95
+ jquery-rails
96
+ mootools-plus!
97
+ sqlite3
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 caedes
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ ## mootools-plus
2
+
3
+ mootools-plus provides helpers and Ruby-like methods to Javascript MooTools core classes and plus.
4
+
5
+ ## Installation
6
+
7
+ Add the gem in your `Gemfile`:
8
+ ```ruby
9
+ group :assets do
10
+ gem 'mootools-plus'
11
+ end
12
+ ```
13
+
14
+ Then `bundle install` it.
15
+
16
+ Add mootools-plus to the asset pipeline:
17
+
18
+ ```javascript
19
+ //= require mootools-plus/array
20
+ //= require mootools-plus/element
21
+ ```
22
+
23
+ Enjoy!
24
+
25
+ ## Documentation
26
+
27
+ * [Native elements](https://github.com/caedes/mootools-plus/wiki/Native-elements)
28
+
29
+ ## License
30
+
31
+ This project uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,6 @@
1
+ module MootoolsPlus
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module MootoolsPlus
2
+ module Rails
3
+ VERSION = '0.0.3'
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Mootools
2
+ module Rails
3
+ require 'mootools-plus/rails/engine'
4
+ require 'mootools-plus/rails/version'
5
+ end
6
+ end
@@ -0,0 +1 @@
1
+ require 'mootools-plus/rails'
@@ -0,0 +1,15 @@
1
+ require File.expand_path('../lib/mootools-plus/rails/version', __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'mootools-plus'
5
+ s.version = MootoolsPlus::Rails::VERSION
6
+ s.authors = ['caedes']
7
+ s.homepage = 'https://github.com/caedes/mootools-plus'
8
+ s.summary = 'mootools-plus provides helpers and Ruby-like methods to Javascript MooTools core classes and plus'
9
+
10
+ s.files = `git ls-files`.split("\n")
11
+
12
+ s.add_dependency "railties", '>= 3.2.0', '< 5.0'
13
+
14
+ s.require_path = 'lib'
15
+ end
@@ -0,0 +1,28 @@
1
+ if (Array.implement) {
2
+ Array.implement({
3
+ first: function(n){
4
+ return (n || n === 0) ? this.slice(0, n) : this[0]
5
+ },
6
+ last: function(n){
7
+ if (n >= this.length) return this
8
+ return (n || n === 0) ? this.slice(this.length - n, this.length) : this[this.length - 1]
9
+ },
10
+ compact: function() {
11
+ for (var i = 0, length = this.length; i < length; i++) {
12
+ var el = this.shift()
13
+ if (el != undefined && el != null && el != '') this.push(el)
14
+ }
15
+ return this
16
+ },
17
+ deleteIf: function(fn){
18
+ for (var i = 0, length = this.length; i < length; i++) {
19
+ var el = this.shift()
20
+ if (!fn.call(el)) this.push(el)
21
+ }
22
+ return this
23
+ }
24
+ })
25
+ }
26
+ else {
27
+ if (console && console.error) console.error('Mootools is not yet installed.')
28
+ }
@@ -0,0 +1,28 @@
1
+ if (Element.implement) {
2
+ Element.implement({
3
+ hasElement: function(tag){
4
+ return (tag == undefined) ? (this.getChildren().length > 0) : (this.getElement(tag) != null)
5
+ },
6
+ hasElements: function(tag){
7
+ return (tag == undefined) ? (this.getChildren().length > 0) : (this.getElements(tag).length > 1)
8
+ },
9
+ hasEvent: function(eventType, fn){
10
+ var myEvents = this.retrieve('events')
11
+ return myEvents && myEvents[eventType] && (fn == undefined || myEvents[eventType].keys.contains(fn))
12
+ },
13
+ hasParent: function(tag){
14
+ return (tag == undefined) ? (this.getParent().length > 0) : (this.getParent(tag) != null)
15
+ },
16
+ disable: function(){
17
+ this.set('disabled', true)
18
+ return this
19
+ },
20
+ enable: function(){
21
+ this.set('disabled', false)
22
+ return this
23
+ }
24
+ })
25
+ }
26
+ else {
27
+ if (console && console.error) console.error('Mootools is not yet installed.')
28
+ }
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mootools-plus
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - caedes
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-08 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: railties
16
+ requirement: &2153459540 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.0
22
+ - - <
23
+ - !ruby/object:Gem::Version
24
+ version: '5.0'
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: *2153459540
28
+ description:
29
+ email:
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - .gitignore
35
+ - CHANGELOG.md
36
+ - Gemfile
37
+ - Gemfile.lock
38
+ - MIT-LICENSE
39
+ - README.md
40
+ - Rakefile
41
+ - lib/mootools-plus.rb
42
+ - lib/mootools-plus/rails.rb
43
+ - lib/mootools-plus/rails/engine.rb
44
+ - lib/mootools-plus/rails/version.rb
45
+ - mootools-plus.gemspec
46
+ - vendor/assets/javascripts/mootools-plus/array.js
47
+ - vendor/assets/javascripts/mootools-plus/element.js
48
+ homepage: https://github.com/caedes/mootools-plus
49
+ licenses: []
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project:
68
+ rubygems_version: 1.8.6
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: mootools-plus provides helpers and Ruby-like methods to Javascript MooTools
72
+ core classes and plus
73
+ test_files: []