alain_toolbox 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,19 @@
1
+ jQuery(function($) {
2
+ $(document).on('click', '.toggler', function(){
3
+ targets = $(this).data('toggle-target').split(',');
4
+ _.each(targets, function(target) {
5
+ $(target).toggle();
6
+ })
7
+ })
8
+ $(document).on('click', '.self_delete', function(event) {
9
+ link = $(this);
10
+ event.preventDefault();
11
+ $.ajax({ type: 'DELETE',
12
+ dataType: 'script',
13
+ url: link.attr('href'),
14
+ success: function(data){
15
+ link.closest(link.data('parent-selector')).remove();
16
+ }
17
+ });
18
+ });
19
+ })
File without changes
@@ -1,3 +1,3 @@
1
1
  module AlainToolbox
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
data/read.me ADDED
@@ -0,0 +1,5 @@
1
+ **Toggler**
2
+ A DOM element with the class *toggler* and the data attribute 'toggle-target' will toggle the visibility of the target(s) on click. Toggle target can be one or more CSS selector separated by a comma.
3
+
4
+ **Self Delete**
5
+ A DOM element with the class *self_delete* will delete the DOM element identified by the 'parent-selector' data attribute on successful completion of the AJAX DELETE request.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alain_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
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-12-21 00:00:00.000000000 Z
12
+ date: 2012-12-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: List of little scripts I keep using from one projec to another
15
15
  email:
@@ -22,8 +22,11 @@ files:
22
22
  - Gemfile
23
23
  - Rakefile
24
24
  - alain_toolbox.gemspec
25
+ - app/assets/javascripts/alain_toolbox/index.js
26
+ - app/assets/stylesheets/alain_toolbox/index.css
25
27
  - lib/alain_toolbox.rb
26
28
  - lib/alain_toolbox/version.rb
29
+ - read.me
27
30
  homepage: ''
28
31
  licenses: []
29
32
  post_install_message: