mootools-plus 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ * Add Logger class
4
+
1
5
  ## 0.1.0
2
6
 
3
7
  * It can now be used in 3.1 version of rails
data/README.md CHANGED
@@ -7,7 +7,7 @@ mootools-plus provides helpers and Ruby-like methods to Javascript MooTools core
7
7
  Add the gem in your `Gemfile`:
8
8
  ```ruby
9
9
  group :assets do
10
- gem 'mootools-plus'
10
+ gem 'mootools-plus', '0.1.1'
11
11
  end
12
12
  ```
13
13
 
@@ -16,6 +16,7 @@ Then `bundle install` it.
16
16
  Add mootools-plus to the asset pipeline:
17
17
 
18
18
  ```javascript
19
+ //= require mootools-plus/logger
19
20
  //= require mootools-plus/array
20
21
  //= require mootools-plus/element
21
22
  ```
@@ -25,6 +26,7 @@ Enjoy!
25
26
  ## Documentation
26
27
 
27
28
  * [Native elements](https://github.com/caedes/mootools-plus/wiki/Native-elements)
29
+ * [Logger](https://github.com/caedes/mootools-plus/wiki/Logger)
28
30
 
29
31
  ## License
30
32
 
@@ -1,5 +1,5 @@
1
1
  module MootoolsPlus
2
2
  module Rails
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -0,0 +1,38 @@
1
+ var Logger = new Class()
2
+
3
+ Logger.log = function(param){
4
+ Logger.trace(param, 'log')
5
+ }
6
+
7
+ Logger.info = function(param){
8
+ Logger.trace(param, 'info')
9
+ }
10
+
11
+ Logger.error = function(param){
12
+ Logger.trace(param, 'error')
13
+ }
14
+
15
+ Logger.warn = function(param){
16
+ Logger.trace(param, 'warn')
17
+ }
18
+
19
+ Logger.warning = Logger.warn
20
+
21
+ Logger.trace = function(param, level){
22
+ if (console != undefined) {
23
+ switch (level) {
24
+ case 'log':
25
+ if (console.log != undefined) console.log(param)
26
+ break
27
+ case 'warn':
28
+ if (console.warn != undefined) console.warn(param)
29
+ break
30
+ case 'info':
31
+ if (console.info != undefined) console.info(param)
32
+ break
33
+ case 'error':
34
+ if (console.error != undefined) console.error(param)
35
+ break
36
+ }
37
+ }
38
+ }
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.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-09 00:00:00.000000000 Z
12
+ date: 2012-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -53,6 +53,7 @@ files:
53
53
  - mootools-plus.gemspec
54
54
  - vendor/assets/javascripts/mootools-plus/array.js
55
55
  - vendor/assets/javascripts/mootools-plus/element.js
56
+ - vendor/assets/javascripts/mootools-plus/logger.js
56
57
  homepage: https://github.com/caedes/mootools-plus
57
58
  licenses: []
58
59
  post_install_message: