datatable 0.2pre1 → 0.2pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- datatable (0.1.1alpha4)
4
+ datatable (0.2pre2)
5
5
  rails (>= 3.0)
6
6
 
7
7
  GEM
@@ -1,6 +1,6 @@
1
1
  Datatable::Base.config do |config|
2
- config.jquery_ui = true
3
- config.sql_like = 'LIKE'
4
- config.table_tools = false
2
+ config.style = true
3
+ config.sql_like = 'ILIKE'
4
+ config.table_tools = true
5
5
  end
6
6
 
@@ -0,0 +1,38 @@
1
+ jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
2
+ /*
3
+ * Inputs: object:oSettings - dataTables settings object - automatically given
4
+ * integer:iDelay - delay in milliseconds
5
+ * Usage: $('#example').dataTable().fnSetFilteringDelay(250);
6
+ * Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine
7
+ * License: GPL v2 or BSD 3 point style
8
+ * Contact: zygimantas.berziunas /AT\ hotmail.com
9
+ */
10
+ var
11
+ _that = this,
12
+ iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
13
+
14
+ this.each( function ( i ) {
15
+ $.fn.dataTableExt.iApiIndex = i;
16
+ var
17
+ $this = this,
18
+ oTimerId = null,
19
+ sPreviousSearch = null,
20
+ anControl = $( 'input', _that.fnSettings().aanFeatures.f );
21
+
22
+ anControl.unbind( 'keyup' ).bind( 'keyup', function() {
23
+ var $$this = $this;
24
+
25
+ if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
26
+ window.clearTimeout(oTimerId);
27
+ sPreviousSearch = anControl.val();
28
+ oTimerId = window.setTimeout(function() {
29
+ $.fn.dataTableExt.iApiIndex = i;
30
+ _that.fnFilter( anControl.val() );
31
+ }, iDelay);
32
+ }
33
+ });
34
+
35
+ return this;
36
+ } );
37
+ return this;
38
+ }
@@ -29,6 +29,7 @@ module Datatable
29
29
  $(function(){
30
30
 
31
31
  var oTable = $('#datatable').dataTable(#{javascript_options.to_json.gsub(/\"aocolumns_place_holder\"/, aocolumns_text)})
32
+ oTable.fnSetFilteringDelay(375);
32
33
 
33
34
 
34
35
  $('tfoot input').keyup( function () {
@@ -49,6 +50,7 @@ module Datatable
49
50
  end
50
51
 
51
52
  javascripts << (javascript_include_tag '/datatable/js/jquery.dataTables.min.js')
53
+ javascripts << (javascript_include_tag '/datatable/js/jquery.dataTablesExt.fnSetFilteringDelay.js')
52
54
 
53
55
  if Datatable::Base.config.table_tools == true
54
56
  javascripts << (javascript_include_tag '/datatable/js/TableTools.min.js')
@@ -1,4 +1,4 @@
1
1
  module Datatable
2
2
  # http://semver.org
3
- VERSION = "0.2pre1"
3
+ VERSION = "0.2pre2"
4
4
  end
@@ -0,0 +1,38 @@
1
+ jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
2
+ /*
3
+ * Inputs: object:oSettings - dataTables settings object - automatically given
4
+ * integer:iDelay - delay in milliseconds
5
+ * Usage: $('#example').dataTable().fnSetFilteringDelay(250);
6
+ * Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine
7
+ * License: GPL v2 or BSD 3 point style
8
+ * Contact: zygimantas.berziunas /AT\ hotmail.com
9
+ */
10
+ var
11
+ _that = this,
12
+ iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
13
+
14
+ this.each( function ( i ) {
15
+ $.fn.dataTableExt.iApiIndex = i;
16
+ var
17
+ $this = this,
18
+ oTimerId = null,
19
+ sPreviousSearch = null,
20
+ anControl = $( 'input', _that.fnSettings().aanFeatures.f );
21
+
22
+ anControl.unbind( 'keyup' ).bind( 'keyup', function() {
23
+ var $$this = $this;
24
+
25
+ if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
26
+ window.clearTimeout(oTimerId);
27
+ sPreviousSearch = anControl.val();
28
+ oTimerId = window.setTimeout(function() {
29
+ $.fn.dataTableExt.iApiIndex = i;
30
+ _that.fnFilter( anControl.val() );
31
+ }, iDelay);
32
+ }
33
+ });
34
+
35
+ return this;
36
+ } );
37
+ return this;
38
+ }
metadata CHANGED
@@ -1,35 +1,49 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: datatable
3
- version: !ruby/object:Gem::Version
4
- version: 0.2pre1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 1923831885
5
5
  prerelease: 3
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - pre
10
+ - 2
11
+ version: 0.2pre2
6
12
  platform: ruby
7
- authors:
13
+ authors:
8
14
  - Michael Greenly
9
15
  - Mischa Fierer
10
16
  autorequire:
11
17
  bindir: bin
12
18
  cert_chain: []
13
- date: 2011-08-07 00:00:00.000000000Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
19
+
20
+ date: 2011-08-07 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
16
23
  name: rails
17
- requirement: &12836780 !ruby/object:Gem::Requirement
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
18
25
  none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: '3.0'
23
- type: :runtime
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 3
32
+ - 0
33
+ version: "3.0"
24
34
  prerelease: false
25
- version_requirements: *12836780
35
+ type: :runtime
36
+ requirement: *id001
26
37
  description: A Rails plugin for the jquery.datatables library
27
- email:
38
+ email:
28
39
  - michaelgreenly@logic-refinery.com
29
40
  executables: []
41
+
30
42
  extensions: []
43
+
31
44
  extra_rdoc_files: []
32
- files:
45
+
46
+ files:
33
47
  - .bundle/config
34
48
  - .gitignore
35
49
  - .rspec
@@ -119,6 +133,7 @@ files:
119
133
  - example_app/public/datatable/js/jquery-ui-1.8.14.custom.min.js
120
134
  - example_app/public/datatable/js/jquery.dataTables.js
121
135
  - example_app/public/datatable/js/jquery.dataTables.min.js
136
+ - example_app/public/datatable/js/jquery.dataTablesExt.fnSetFilteringDelay.js
122
137
  - example_app/public/favicon.ico
123
138
  - example_app/public/flash/copy_cvs_xls.swf
124
139
  - example_app/public/flash/copy_cvs_xls_pdf.swf
@@ -219,28 +234,41 @@ files:
219
234
  - vendor/datatable/media/js/jquery-ui-1.8.14.custom.min.js
220
235
  - vendor/datatable/media/js/jquery.dataTables.js
221
236
  - vendor/datatable/media/js/jquery.dataTables.min.js
237
+ - vendor/datatable/media/js/jquery.dataTablesExt.fnSetFilteringDelay.js
222
238
  homepage: https://github.com/logic-refinery/datatable
223
239
  licenses: []
240
+
224
241
  post_install_message:
225
242
  rdoc_options: []
226
- require_paths:
243
+
244
+ require_paths:
227
245
  - lib
228
- required_ruby_version: !ruby/object:Gem::Requirement
246
+ required_ruby_version: !ruby/object:Gem::Requirement
229
247
  none: false
230
- requirements:
231
- - - ! '>='
232
- - !ruby/object:Gem::Version
233
- version: '0'
234
- required_rubygems_version: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ hash: 3
252
+ segments:
253
+ - 0
254
+ version: "0"
255
+ required_rubygems_version: !ruby/object:Gem::Requirement
235
256
  none: false
236
- requirements:
237
- - - ! '>'
238
- - !ruby/object:Gem::Version
257
+ requirements:
258
+ - - ">"
259
+ - !ruby/object:Gem::Version
260
+ hash: 25
261
+ segments:
262
+ - 1
263
+ - 3
264
+ - 1
239
265
  version: 1.3.1
240
266
  requirements: []
267
+
241
268
  rubyforge_project:
242
269
  rubygems_version: 1.8.5
243
270
  signing_key:
244
271
  specification_version: 3
245
272
  summary: A Rails plugin for the jquery.datatables library
246
273
  test_files: []
274
+