snaptable 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/app/assets/javascripts/snaptable/table.js +44 -0
- data/app/assets/javascripts/snaptable.js +14 -44
- data/app/assets/stylesheets/{snaptable.css.scss → snaptable/table.css.scss} +0 -0
- data/app/assets/stylesheets/snaptable.css +13 -0
- data/lib/snaptable/rails/version.rb +1 -1
- data/lib/snaptable/version.rb +1 -1
- data/snaptable.gemspec +2 -0
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d90948e9e4ed20529bb677f38a20a20870f4e7e
|
4
|
+
data.tar.gz: 64b84059140e0aa2bb8f016dc254de78972f024b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cc953f194fd841a1c2d5cbb16f735ef32d1e356b7bfdcac37869cb2036b28fc4ec2c1098e7fbc9037f55662f3dedf223268f5d64eca07503f3521ec7f620bd4
|
7
|
+
data.tar.gz: 5926bb8d3b316bb45408b58267966fd505a0832775ab6f72466bee2121f9803d0ed2b7642cf2da3b7652c1097a2b6fa9e41bd5712559742de80435362e875a1b
|
data/README.md
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
/* Admin table */
|
2
|
+
|
3
|
+
function snapifyTable() {
|
4
|
+
|
5
|
+
var snaptable = $('#snaptable')
|
6
|
+
|
7
|
+
var tableButtons = snaptable.find('.table_buttons'),
|
8
|
+
editButton = tableButtons.find('a[class="edit"]'),
|
9
|
+
deleteButton = tableButtons.find('a[class="delete"]'),
|
10
|
+
path = window.location.pathname + '/';
|
11
|
+
|
12
|
+
// add ajax to the pagination
|
13
|
+
snaptable.on("click", ".pagination a", function() {
|
14
|
+
$.getScript(this.href);
|
15
|
+
return false;
|
16
|
+
});
|
17
|
+
|
18
|
+
// line clickable
|
19
|
+
snaptable.on("click", "tbody tr", function(e) {
|
20
|
+
var id = $(this).data('url') ;
|
21
|
+
if ( typeof id !== 'undefined' && !$(this).hasClass('selected') ) {
|
22
|
+
$('tr.selected').removeClass('selected');
|
23
|
+
$(this).addClass('selected');
|
24
|
+
deleteButton.add(editButton).addClass("on");
|
25
|
+
editButton.attr('href', path + id + '/edit');
|
26
|
+
deleteButton.attr('href', path + id);
|
27
|
+
}
|
28
|
+
});
|
29
|
+
|
30
|
+
// Double click
|
31
|
+
snaptable.on("dblclick", "tbody tr", function() {
|
32
|
+
var id = $(this).data('url');
|
33
|
+
if ( typeof id !== 'undefined' ) {
|
34
|
+
window.location = path + id + '/edit';
|
35
|
+
}
|
36
|
+
});
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
$(document).on("ready page:load", function() {
|
41
|
+
|
42
|
+
snapifyTable();
|
43
|
+
|
44
|
+
});
|
@@ -1,44 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
return false;
|
16
|
-
});
|
17
|
-
|
18
|
-
// line clickable
|
19
|
-
snaptable.on("click", "tbody tr", function(e) {
|
20
|
-
var id = $(this).data('url') ;
|
21
|
-
if ( typeof id !== 'undefined' && !$(this).hasClass('selected') ) {
|
22
|
-
$('tr.selected').removeClass('selected');
|
23
|
-
$(this).addClass('selected');
|
24
|
-
deleteButton.add(editButton).addClass("on");
|
25
|
-
editButton.attr('href', path + id + '/edit');
|
26
|
-
deleteButton.attr('href', path + id);
|
27
|
-
}
|
28
|
-
});
|
29
|
-
|
30
|
-
// Double click
|
31
|
-
snaptable.on("dblclick", "tbody tr", function() {
|
32
|
-
var id = $(this).data('url');
|
33
|
-
if ( typeof id !== 'undefined' ) {
|
34
|
-
window.location = path + id + '/edit';
|
35
|
-
}
|
36
|
-
});
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
$(document).on("ready page:load", function() {
|
41
|
-
|
42
|
-
snapifyTable();
|
43
|
-
|
44
|
-
});
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require_tree ./snaptable
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require_tree ./snaptable
|
13
|
+
*/
|
data/lib/snaptable/version.rb
CHANGED
data/snaptable.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- khcr
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sass-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 4.0.3
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 4.0.3
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: jquery-rails
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
description: A gem that generate HTML tables from your models in order to display
|
84
112
|
them in your admin views.
|
85
113
|
email:
|
@@ -95,7 +123,9 @@ files:
|
|
95
123
|
- README.md
|
96
124
|
- Rakefile
|
97
125
|
- app/assets/javascripts/snaptable.js
|
98
|
-
- app/assets/
|
126
|
+
- app/assets/javascripts/snaptable/table.js
|
127
|
+
- app/assets/stylesheets/snaptable.css
|
128
|
+
- app/assets/stylesheets/snaptable/table.css.scss
|
99
129
|
- app/views/application/_buttons.html.erb
|
100
130
|
- app/views/application/_search_field.html.erb
|
101
131
|
- app/views/base.html.erb
|