tableling-rails 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWM5Yzc1OGI4NzQyOWQ2MTFkZDNiYTUyOTI2MjdiY2JmYjc4MDE2Ng==
4
+ YjRhZjkyZGZjNDlmM2FkY2Q0YTRiYzUyMGFiNmZmNDJjZTExZGFlZA==
5
5
  data.tar.gz: !binary |-
6
- OGMwZmJlZDZlMWM1ZDU4MGZjYTlmMmQwMjVmZGRkMjg4ZGI1M2QzYw==
6
+ ODhiOWY0MzEyOTU2ZDc2YTg2ZmE5NDhhZGQ1MmZmNjgyOGYzMzI3Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmZhYTVhZWZlOTA5Y2MxNTM3Y2JlYmE2NTM4ZTMzODc3MzBlZTY2NjZjNWJm
10
- MDEwNjNjNzU1NDNiODUxMTg0NjdlZjYyZDE2OGY1ODNiNDJiZmRkYzllZmYx
11
- MzI1MDE5YjU2NWNjM2E2ZDRlMDkxYThjNTEyNzUwZDU2ZDI4NDQ=
9
+ Yjk3NGE3NTMyNjlhMTVmNmM1NzQ3NjYzOTVhMDIyMjA4ZDgyYmVmZmE4YTA1
10
+ ODE3MzI5MGU3YjhkYTQyMjcwZWRkMzMxNGEwNjRkM2FkMWVhNDY1YWQzMDI1
11
+ OTYzNWRiNDgxOWY3NmZiZDJkYTk3MjRhNjkyOTdiZGMxMzFhNmE=
12
12
  data.tar.gz: !binary |-
13
- M2E3MzE1Mzk3OWI3NmM3ZmM5YTM2OWEzOGJlNzE5MGNjMGI1YjAwZWE5ODAw
14
- YWRjZDIzNmMyMGZmNWMzYmE1YzM4Y2JiNzFlMjUzYjE4NzdkODk0NGRlZDNm
15
- MmI4ZGI2NjMwNGUyNDJmZjBlYWY0MTA3OTJhNmQ4M2M5NjkwMGY=
13
+ NzM1ZjYzOWY3N2ViYWVmMjVmMzViYzE1ZWI2NmJmYmFjNGQzYzE3NmFhZjUy
14
+ NWM3MGZhOTY4MWRlMDZkODdhODA5OGRhNGYwYTk5NjY4OTQ0NGNjMThiMjIy
15
+ YTk0YWE1MzVhZDlmZGYzOGEyYjU0YmQwOTIxOWU5N2UwMmEwY2Q=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.22
1
+ 0.0.23
@@ -1,3 +1,3 @@
1
1
  module Tableling
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
@@ -50,9 +50,9 @@ module Tableling
50
50
 
51
51
  @fields.each{ |f| q = f.with_includes q }
52
52
 
53
- response_options = {
53
+ response_options = (options[:response] || {}).merge({
54
54
  total: total
55
- }
55
+ })
56
56
 
57
57
  page_size = options[:pageSize].to_i
58
58
  page_size = 10 if page_size <= 0
@@ -4048,15 +4048,15 @@ _.extend(Marionette.Module, {
4048
4048
  })(this, Backbone, _);
4049
4049
 
4050
4050
  /*!
4051
- * Tableling v0.0.22
4052
- * Copyright (c) 2012-2013 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
4051
+ * Tableling v0.0.23
4052
+ * Copyright (c) 2012-2014 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
4053
4053
  * Distributed under MIT license
4054
4054
  * https://github.com/AlphaHydrae/tableling
4055
4055
  */
4056
4056
  Backbone.Tableling = Tableling = (function(Backbone, _, $){
4057
4057
 
4058
4058
  var Tableling = {
4059
- version : "0.0.22"
4059
+ version : "0.0.23"
4060
4060
  };
4061
4061
 
4062
4062
  // Tableling
@@ -4153,6 +4153,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
4153
4153
  var options = _.clone(this.fetchOptions);
4154
4154
  options.data = this.requestData();
4155
4155
  options.success = _.bind(this.processResponse, this);
4156
+ options.reset = true;
4156
4157
 
4157
4158
  // `table:refreshing` is triggered every time new data is being fetched.
4158
4159
  // The first argument is the request data.
@@ -4379,6 +4380,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
4379
4380
  if (!this.events) {
4380
4381
  this.events = {};
4381
4382
  }
4383
+ this.events.submit = 'onSubmit';
4382
4384
  this.events['change [name="' + this.name + '"]'] = 'update';
4383
4385
  },
4384
4386
 
@@ -4396,6 +4398,11 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
4396
4398
  var config = {};
4397
4399
  config[this.name] = this.ui.field.val();
4398
4400
  return config;
4401
+ },
4402
+
4403
+ onSubmit : function(e) {
4404
+ e.preventDefault();
4405
+ return false;
4399
4406
  }
4400
4407
  });
4401
4408
 
@@ -4628,7 +4635,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
4628
4635
 
4629
4636
  Tableling.Plain.PageView = Tableling.Plain.Table.prototype.pageView = Tableling.Module.extend({
4630
4637
 
4631
- template : _.template('<div class="pagination"><ul><li class="first"><a href="#">&lt;&lt;</a></li><li class="previous"><a href="#">&lt;</a></li><li class="next"><a href="#">&gt;</a></li><li class="last"><a href="#">&gt;&gt;</a></li></ul></div>'),
4638
+ template : _.template('<ul class="pagination"><li class="first"><a href="#">&lt;&lt;</a></li><li class="previous"><a href="#">&lt;</a></li><li class="next"><a href="#">&gt;</a></li><li class="last"><a href="#">&gt;&gt;</a></li></ul>'),
4632
4639
  pageTemplate : _.template('<li class="page"><a href="#"><%- number %></a></li>'),
4633
4640
 
4634
4641
  ui : {
@@ -4738,19 +4745,34 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
4738
4745
  Tableling.Bootstrap = {};
4739
4746
 
4740
4747
  Tableling.Bootstrap.Table = Tableling.Plain.Table.extend({
4741
- template : _.template('<div class="header"><div class="pageSize pull-left" /><div class="quickSearch pull-right" /></div><div class="table" /><div class="footer"><div class="info pull-left" /><div class="page pull-right" /></div>')
4748
+ template : _.template('<div class="header clearfix"><div class="pageSize pull-left" /><div class="quickSearch pull-right" /></div><div class="table" /><div class="footer clearfix"><div class="info pull-left" /><div class="page pull-right" /></div>')
4742
4749
  });
4743
4750
 
4744
4751
  Tableling.Bootstrap.TableView = Tableling.Plain.TableView.extend({});
4745
4752
 
4746
4753
  Tableling.Bootstrap.PageSizeView = Tableling.Bootstrap.Table.prototype.pageSizeView = Tableling.Plain.PageSizeView.extend({
4747
4754
 
4755
+ tagName : 'form',
4756
+ className : 'form-inline',
4757
+ attributes : {
4758
+ role : 'form'
4759
+ },
4748
4760
  template : function(data) {
4749
- return _.template('<select name="pageSize" class="input-mini"><option>5</option><option>10</option><option>15</option></select> <%- entries %>', data);
4761
+ return _.template('<div class="formGroup"><select name="pageSize" class="form-control"><option>5</option><option>10</option><option>15</option></select> <%- entries %></div>', data);
4750
4762
  }
4751
4763
  });
4752
4764
 
4753
- Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({});
4765
+ Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({
4766
+
4767
+ tagName : 'form',
4768
+ className : 'form-inline',
4769
+ attributes : {
4770
+ role : 'form'
4771
+ },
4772
+ template : function(data) {
4773
+ return _.template('<div class="formGroup"><input type="text" name="quickSearch" class="form-control" placeholder="<%- quickSearch %>" /></div>', data);
4774
+ }
4775
+ });
4754
4776
 
4755
4777
  Tableling.Bootstrap.InfoView = Tableling.Bootstrap.Table.prototype.infoView = Tableling.Plain.InfoView.extend({});
4756
4778
 
@@ -1,13 +1,13 @@
1
1
  /*!
2
- * Tableling v0.0.22
3
- * Copyright (c) 2012-2013 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
2
+ * Tableling v0.0.23
3
+ * Copyright (c) 2012-2014 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
4
4
  * Distributed under MIT license
5
5
  * https://github.com/AlphaHydrae/tableling
6
6
  */
7
7
  Backbone.Tableling = Tableling = (function(Backbone, _, $){
8
8
 
9
9
  var Tableling = {
10
- version : "0.0.22"
10
+ version : "0.0.23"
11
11
  };
12
12
 
13
13
  // Tableling
@@ -104,6 +104,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
104
104
  var options = _.clone(this.fetchOptions);
105
105
  options.data = this.requestData();
106
106
  options.success = _.bind(this.processResponse, this);
107
+ options.reset = true;
107
108
 
108
109
  // `table:refreshing` is triggered every time new data is being fetched.
109
110
  // The first argument is the request data.
@@ -330,6 +331,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
330
331
  if (!this.events) {
331
332
  this.events = {};
332
333
  }
334
+ this.events.submit = 'onSubmit';
333
335
  this.events['change [name="' + this.name + '"]'] = 'update';
334
336
  },
335
337
 
@@ -347,6 +349,11 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
347
349
  var config = {};
348
350
  config[this.name] = this.ui.field.val();
349
351
  return config;
352
+ },
353
+
354
+ onSubmit : function(e) {
355
+ e.preventDefault();
356
+ return false;
350
357
  }
351
358
  });
352
359
 
@@ -579,7 +586,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
579
586
 
580
587
  Tableling.Plain.PageView = Tableling.Plain.Table.prototype.pageView = Tableling.Module.extend({
581
588
 
582
- template : _.template('<div class="pagination"><ul><li class="first"><a href="#">&lt;&lt;</a></li><li class="previous"><a href="#">&lt;</a></li><li class="next"><a href="#">&gt;</a></li><li class="last"><a href="#">&gt;&gt;</a></li></ul></div>'),
589
+ template : _.template('<ul class="pagination"><li class="first"><a href="#">&lt;&lt;</a></li><li class="previous"><a href="#">&lt;</a></li><li class="next"><a href="#">&gt;</a></li><li class="last"><a href="#">&gt;&gt;</a></li></ul>'),
583
590
  pageTemplate : _.template('<li class="page"><a href="#"><%- number %></a></li>'),
584
591
 
585
592
  ui : {
@@ -689,19 +696,34 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
689
696
  Tableling.Bootstrap = {};
690
697
 
691
698
  Tableling.Bootstrap.Table = Tableling.Plain.Table.extend({
692
- template : _.template('<div class="header"><div class="pageSize pull-left" /><div class="quickSearch pull-right" /></div><div class="table" /><div class="footer"><div class="info pull-left" /><div class="page pull-right" /></div>')
699
+ template : _.template('<div class="header clearfix"><div class="pageSize pull-left" /><div class="quickSearch pull-right" /></div><div class="table" /><div class="footer clearfix"><div class="info pull-left" /><div class="page pull-right" /></div>')
693
700
  });
694
701
 
695
702
  Tableling.Bootstrap.TableView = Tableling.Plain.TableView.extend({});
696
703
 
697
704
  Tableling.Bootstrap.PageSizeView = Tableling.Bootstrap.Table.prototype.pageSizeView = Tableling.Plain.PageSizeView.extend({
698
705
 
706
+ tagName : 'form',
707
+ className : 'form-inline',
708
+ attributes : {
709
+ role : 'form'
710
+ },
699
711
  template : function(data) {
700
- return _.template('<select name="pageSize" class="input-mini"><option>5</option><option>10</option><option>15</option></select> <%- entries %>', data);
712
+ return _.template('<div class="formGroup"><select name="pageSize" class="form-control"><option>5</option><option>10</option><option>15</option></select> <%- entries %></div>', data);
701
713
  }
702
714
  });
703
715
 
704
- Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({});
716
+ Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({
717
+
718
+ tagName : 'form',
719
+ className : 'form-inline',
720
+ attributes : {
721
+ role : 'form'
722
+ },
723
+ template : function(data) {
724
+ return _.template('<div class="formGroup"><input type="text" name="quickSearch" class="form-control" placeholder="<%- quickSearch %>" /></div>', data);
725
+ }
726
+ });
705
727
 
706
728
  Tableling.Bootstrap.InfoView = Tableling.Bootstrap.Table.prototype.infoView = Tableling.Plain.InfoView.extend({});
707
729
 
@@ -14642,15 +14642,15 @@ _.extend(Marionette.Module, {
14642
14642
  })(this, Backbone, _);
14643
14643
 
14644
14644
  /*!
14645
- * Tableling v0.0.22
14646
- * Copyright (c) 2012-2013 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
14645
+ * Tableling v0.0.23
14646
+ * Copyright (c) 2012-2014 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
14647
14647
  * Distributed under MIT license
14648
14648
  * https://github.com/AlphaHydrae/tableling
14649
14649
  */
14650
14650
  Backbone.Tableling = Tableling = (function(Backbone, _, $){
14651
14651
 
14652
14652
  var Tableling = {
14653
- version : "0.0.22"
14653
+ version : "0.0.23"
14654
14654
  };
14655
14655
 
14656
14656
  // Tableling
@@ -14747,6 +14747,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
14747
14747
  var options = _.clone(this.fetchOptions);
14748
14748
  options.data = this.requestData();
14749
14749
  options.success = _.bind(this.processResponse, this);
14750
+ options.reset = true;
14750
14751
 
14751
14752
  // `table:refreshing` is triggered every time new data is being fetched.
14752
14753
  // The first argument is the request data.
@@ -14973,6 +14974,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
14973
14974
  if (!this.events) {
14974
14975
  this.events = {};
14975
14976
  }
14977
+ this.events.submit = 'onSubmit';
14976
14978
  this.events['change [name="' + this.name + '"]'] = 'update';
14977
14979
  },
14978
14980
 
@@ -14990,6 +14992,11 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
14990
14992
  var config = {};
14991
14993
  config[this.name] = this.ui.field.val();
14992
14994
  return config;
14995
+ },
14996
+
14997
+ onSubmit : function(e) {
14998
+ e.preventDefault();
14999
+ return false;
14993
15000
  }
14994
15001
  });
14995
15002
 
@@ -15222,7 +15229,7 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
15222
15229
 
15223
15230
  Tableling.Plain.PageView = Tableling.Plain.Table.prototype.pageView = Tableling.Module.extend({
15224
15231
 
15225
- template : _.template('<div class="pagination"><ul><li class="first"><a href="#">&lt;&lt;</a></li><li class="previous"><a href="#">&lt;</a></li><li class="next"><a href="#">&gt;</a></li><li class="last"><a href="#">&gt;&gt;</a></li></ul></div>'),
15232
+ template : _.template('<ul class="pagination"><li class="first"><a href="#">&lt;&lt;</a></li><li class="previous"><a href="#">&lt;</a></li><li class="next"><a href="#">&gt;</a></li><li class="last"><a href="#">&gt;&gt;</a></li></ul>'),
15226
15233
  pageTemplate : _.template('<li class="page"><a href="#"><%- number %></a></li>'),
15227
15234
 
15228
15235
  ui : {
@@ -15332,19 +15339,34 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
15332
15339
  Tableling.Bootstrap = {};
15333
15340
 
15334
15341
  Tableling.Bootstrap.Table = Tableling.Plain.Table.extend({
15335
- template : _.template('<div class="header"><div class="pageSize pull-left" /><div class="quickSearch pull-right" /></div><div class="table" /><div class="footer"><div class="info pull-left" /><div class="page pull-right" /></div>')
15342
+ template : _.template('<div class="header clearfix"><div class="pageSize pull-left" /><div class="quickSearch pull-right" /></div><div class="table" /><div class="footer clearfix"><div class="info pull-left" /><div class="page pull-right" /></div>')
15336
15343
  });
15337
15344
 
15338
15345
  Tableling.Bootstrap.TableView = Tableling.Plain.TableView.extend({});
15339
15346
 
15340
15347
  Tableling.Bootstrap.PageSizeView = Tableling.Bootstrap.Table.prototype.pageSizeView = Tableling.Plain.PageSizeView.extend({
15341
15348
 
15349
+ tagName : 'form',
15350
+ className : 'form-inline',
15351
+ attributes : {
15352
+ role : 'form'
15353
+ },
15342
15354
  template : function(data) {
15343
- return _.template('<select name="pageSize" class="input-mini"><option>5</option><option>10</option><option>15</option></select> <%- entries %>', data);
15355
+ return _.template('<div class="formGroup"><select name="pageSize" class="form-control"><option>5</option><option>10</option><option>15</option></select> <%- entries %></div>', data);
15344
15356
  }
15345
15357
  });
15346
15358
 
15347
- Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({});
15359
+ Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({
15360
+
15361
+ tagName : 'form',
15362
+ className : 'form-inline',
15363
+ attributes : {
15364
+ role : 'form'
15365
+ },
15366
+ template : function(data) {
15367
+ return _.template('<div class="formGroup"><input type="text" name="quickSearch" class="form-control" placeholder="<%- quickSearch %>" /></div>', data);
15368
+ }
15369
+ });
15348
15370
 
15349
15371
  Tableling.Bootstrap.InfoView = Tableling.Bootstrap.Table.prototype.infoView = Tableling.Plain.InfoView.extend({});
15350
15372
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tableling-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Oulevay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-30 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -32,6 +32,10 @@ executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
+ - LICENSE.txt
36
+ - README.md
37
+ - VERSION
38
+ - lib/tableling-rails.rb
35
39
  - lib/tableling-rails/config.rb
36
40
  - lib/tableling-rails/engine.rb
37
41
  - lib/tableling-rails/errors.rb
@@ -42,13 +46,8 @@ files:
42
46
  - lib/tableling-rails/type_serializer.rb
43
47
  - lib/tableling-rails/version.rb
44
48
  - lib/tableling-rails/view.rb
45
- - lib/tableling-rails.rb
46
- - vendor/assets/javascripts/tableling.backbone.js
47
- - vendor/assets/javascripts/tableling.js
48
- - vendor/assets/javascripts/tableling.world.js
49
- - LICENSE.txt
50
- - README.md
51
- - VERSION
49
+ - spec/dummy/README.rdoc
50
+ - spec/dummy/Rakefile
52
51
  - spec/dummy/app/assets/javascripts/application.js
53
52
  - spec/dummy/app/assets/javascripts/books.js
54
53
  - spec/dummy/app/assets/javascripts/bootstrap.js
@@ -75,6 +74,7 @@ files:
75
74
  - spec/dummy/app/models/book.rb
76
75
  - spec/dummy/app/views/books/index.html.haml
77
76
  - spec/dummy/app/views/layouts/application.html.haml
77
+ - spec/dummy/config.ru
78
78
  - spec/dummy/config/application.rb
79
79
  - spec/dummy/config/boot.rb
80
80
  - spec/dummy/config/database.yml
@@ -90,7 +90,6 @@ files:
90
90
  - spec/dummy/config/initializers/wrap_parameters.rb
91
91
  - spec/dummy/config/locales/en.yml
92
92
  - spec/dummy/config/routes.rb
93
- - spec/dummy/config.ru
94
93
  - spec/dummy/db/development.sqlite3
95
94
  - spec/dummy/db/migrate/20121008115302_create_books.rb
96
95
  - spec/dummy/db/schema.rb
@@ -102,12 +101,13 @@ files:
102
101
  - spec/dummy/public/422.html
103
102
  - spec/dummy/public/500.html
104
103
  - spec/dummy/public/favicon.ico
105
- - spec/dummy/Rakefile
106
- - spec/dummy/README.rdoc
107
104
  - spec/dummy/script/rails
108
105
  - spec/models/book_spec.rb
109
106
  - spec/spec_helper.rb
110
107
  - spec/version_spec.rb
108
+ - vendor/assets/javascripts/tableling.backbone.js
109
+ - vendor/assets/javascripts/tableling.js
110
+ - vendor/assets/javascripts/tableling.world.js
111
111
  homepage: https://github.com/AlphaHydrae/tableling-rails
112
112
  licenses:
113
113
  - MIT
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.1.10
131
+ rubygems_version: 2.2.0
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Tableling gem for Ruby on Rails.