mootools-plus 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +15 -3
- data/README.md +1 -1
- data/lib/mootools-plus/rails/version.rb +1 -1
- data/mootools-plus.gemspec +2 -0
- data/vendor/assets/javascripts/mootools-plus/array.js +10 -10
- data/vendor/assets/javascripts/mootools-plus/element.js +6 -1
- data/vendor/assets/javascripts/mootools-plus/logger.js +34 -29
- metadata +9 -15
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## 0.1.3
|
2
|
+
|
3
|
+
* Add email and description in gemspec file
|
4
|
+
|
5
|
+
## 0.1.2
|
6
|
+
|
7
|
+
* Update Logger#warning
|
8
|
+
* Update Array#compact as Array#clean alias
|
9
|
+
* Add Array#select as Array#filter alias
|
10
|
+
* Update Array#first|last as Array#getFirst|getLast alias
|
11
|
+
* Update MooTools checking method
|
12
|
+
|
1
13
|
## 0.1.1
|
2
14
|
|
3
15
|
* Add Logger class
|
@@ -8,12 +20,12 @@
|
|
8
20
|
|
9
21
|
## 0.0.3
|
10
22
|
|
11
|
-
* Add condition on Mootools presence
|
23
|
+
* Add condition on Mootools presence
|
12
24
|
|
13
25
|
## 0.0.2
|
14
26
|
|
15
|
-
* Add documentation in Github wiki
|
27
|
+
* Add documentation in Github wiki
|
16
28
|
|
17
29
|
## 0.0.1
|
18
30
|
|
19
|
-
* First version
|
31
|
+
* First version
|
data/README.md
CHANGED
data/mootools-plus.gemspec
CHANGED
@@ -4,8 +4,10 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'mootools-plus'
|
5
5
|
s.version = MootoolsPlus::Rails::VERSION
|
6
6
|
s.authors = ['caedes']
|
7
|
+
s.email = ['laurentromain@gmail.com']
|
7
8
|
s.homepage = 'https://github.com/caedes/mootools-plus'
|
8
9
|
s.summary = 'mootools-plus provides helpers and Ruby-like methods to Javascript MooTools core classes and plus'
|
10
|
+
s.description = s.summary
|
9
11
|
|
10
12
|
s.files = `git ls-files`.split("\n")
|
11
13
|
|
@@ -1,19 +1,14 @@
|
|
1
|
-
if (
|
1
|
+
if (window.MooTools) {
|
2
2
|
Array.implement({
|
3
|
-
|
3
|
+
getFirst: function(n){
|
4
4
|
return (n || n === 0) ? this.slice(0, n) : this[0]
|
5
5
|
},
|
6
|
-
|
6
|
+
|
7
|
+
getLast: function(n){
|
7
8
|
if (n >= this.length) return this
|
8
9
|
return (n || n === 0) ? this.slice(this.length - n, this.length) : this[this.length - 1]
|
9
10
|
},
|
10
|
-
|
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
|
-
},
|
11
|
+
|
17
12
|
deleteIf: function(fn){
|
18
13
|
for (var i = 0, length = this.length; i < length; i++) {
|
19
14
|
var el = this.shift()
|
@@ -22,6 +17,11 @@ if (Array.implement) {
|
|
22
17
|
return this
|
23
18
|
}
|
24
19
|
})
|
20
|
+
|
21
|
+
Array.alias('first', 'getFirst')
|
22
|
+
Array.alias('last', 'getFirst')
|
23
|
+
Array.alias('select', 'filter')
|
24
|
+
Array.alias('compact', 'clean')
|
25
25
|
}
|
26
26
|
else {
|
27
27
|
if (console && console.error) console.error('Mootools is not yet installed.')
|
@@ -1,22 +1,27 @@
|
|
1
|
-
if (
|
1
|
+
if (window.MooTools) {
|
2
2
|
Element.implement({
|
3
3
|
hasElement: function(tag){
|
4
4
|
return (tag == undefined) ? (this.getChildren().length > 0) : (this.getElement(tag) != null)
|
5
5
|
},
|
6
|
+
|
6
7
|
hasElements: function(tag){
|
7
8
|
return (tag == undefined) ? (this.getChildren().length > 0) : (this.getElements(tag).length > 1)
|
8
9
|
},
|
10
|
+
|
9
11
|
hasEvent: function(eventType, fn){
|
10
12
|
var myEvents = this.retrieve('events')
|
11
13
|
return myEvents && myEvents[eventType] && (fn == undefined || myEvents[eventType].keys.contains(fn))
|
12
14
|
},
|
15
|
+
|
13
16
|
hasParent: function(tag){
|
14
17
|
return (tag == undefined) ? (this.getParent().length > 0) : (this.getParent(tag) != null)
|
15
18
|
},
|
19
|
+
|
16
20
|
disable: function(){
|
17
21
|
this.set('disabled', true)
|
18
22
|
return this
|
19
23
|
},
|
24
|
+
|
20
25
|
enable: function(){
|
21
26
|
this.set('disabled', false)
|
22
27
|
return this
|
@@ -1,38 +1,43 @@
|
|
1
|
-
|
1
|
+
if (window.MooTools) {
|
2
|
+
var Logger = new Class()
|
2
3
|
|
3
|
-
Logger.log = function(param){
|
4
|
-
|
5
|
-
}
|
4
|
+
Logger.log = function(param){
|
5
|
+
Logger.trace(param, 'log')
|
6
|
+
}
|
6
7
|
|
7
|
-
Logger.info = function(param){
|
8
|
-
|
9
|
-
}
|
8
|
+
Logger.info = function(param){
|
9
|
+
Logger.trace(param, 'info')
|
10
|
+
}
|
10
11
|
|
11
|
-
Logger.error = function(param){
|
12
|
-
|
13
|
-
}
|
12
|
+
Logger.error = function(param){
|
13
|
+
Logger.trace(param, 'error')
|
14
|
+
}
|
14
15
|
|
15
|
-
Logger.
|
16
|
-
|
17
|
-
}
|
16
|
+
Logger.warning = function(param){
|
17
|
+
Logger.trace(param, 'warning')
|
18
|
+
}
|
18
19
|
|
19
|
-
Logger.
|
20
|
+
Logger.warn = Logger.warning
|
20
21
|
|
21
|
-
Logger.trace = function(param, level){
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
Logger.trace = function(param, level){
|
23
|
+
if (console != undefined) {
|
24
|
+
switch (level) {
|
25
|
+
case 'log':
|
26
|
+
if (console.log != undefined) console.log(param)
|
27
|
+
break
|
28
|
+
case 'warning':
|
29
|
+
if (console.warn != undefined) console.warn(param)
|
30
|
+
break
|
31
|
+
case 'info':
|
32
|
+
if (console.info != undefined) console.info(param)
|
33
|
+
break
|
34
|
+
case 'error':
|
35
|
+
if (console.error != undefined) console.error(param)
|
36
|
+
break
|
37
|
+
}
|
36
38
|
}
|
37
39
|
}
|
38
40
|
}
|
41
|
+
else {
|
42
|
+
if (console && console.error) console.error('Mootools is not yet installed.')
|
43
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mootools-plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2157359320 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,17 +24,11 @@ dependencies:
|
|
24
24
|
version: '5.0'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
version: 3.1.0
|
33
|
-
- - <
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '5.0'
|
36
|
-
description:
|
37
|
-
email:
|
27
|
+
version_requirements: *2157359320
|
28
|
+
description: mootools-plus provides helpers and Ruby-like methods to Javascript MooTools
|
29
|
+
core classes and plus
|
30
|
+
email:
|
31
|
+
- laurentromain@gmail.com
|
38
32
|
executables: []
|
39
33
|
extensions: []
|
40
34
|
extra_rdoc_files: []
|
@@ -74,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
68
|
version: '0'
|
75
69
|
requirements: []
|
76
70
|
rubyforge_project:
|
77
|
-
rubygems_version: 1.8.
|
71
|
+
rubygems_version: 1.8.6
|
78
72
|
signing_key:
|
79
73
|
specification_version: 3
|
80
74
|
summary: mootools-plus provides helpers and Ruby-like methods to Javascript MooTools
|