tableling-rails 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tableling-rails/version.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +7512 -54
- data/spec/dummy/log/test.log +1 -22
- data/spec/dummy/tmp/cache/assets/BF1/770/sprockets%2F8228a53c539c582499241527570aa216 +0 -0
- data/spec/dummy/tmp/cache/assets/C3F/0C0/sprockets%2F4643701467ac62c314510c8dd021916f +0 -0
- data/spec/dummy/tmp/cache/assets/C53/AD0/sprockets%2F712078516a81502575c831cb0a8e898e +0 -0
- data/spec/dummy/tmp/cache/assets/C59/0F0/sprockets%2F099f4e84a443568245ff0674030f6e05 +0 -0
- data/spec/dummy/tmp/cache/assets/C60/CF0/sprockets%2F32a45292ee67867d8715952f3072ad84 +0 -0
- data/spec/dummy/tmp/cache/assets/C6F/0E0/sprockets%2F82372776487d948ef7666d304d6fb345 +0 -0
- data/spec/dummy/tmp/cache/assets/C80/840/sprockets%2F562c2d168da585f80579347d10790a0a +0 -0
- data/spec/dummy/tmp/cache/assets/C82/F20/sprockets%2F117015d65237e3682f5b21c87d58ab95 +0 -0
- data/spec/dummy/tmp/cache/assets/C86/280/sprockets%2F1345c9947753f018f45371ec5083fa2d +0 -0
- data/spec/dummy/tmp/cache/assets/C91/350/sprockets%2F6864c49a10954375948d9f306db308fb +0 -0
- data/spec/dummy/tmp/cache/assets/C9A/900/sprockets%2Fc1b5b7611d7c10e124512724f29f241d +0 -0
- data/spec/dummy/tmp/cache/assets/CAF/540/sprockets%2F8f42e689b84f0b25c0180046467adf31 +0 -0
- data/spec/dummy/tmp/cache/assets/CB1/9A0/sprockets%2F57805dfa396248a9665cb4a0c85116d0 +0 -0
- data/spec/dummy/tmp/cache/assets/CC1/4E0/sprockets%2F6ef77414c793c84a437244d7d965ba90 +0 -0
- data/spec/dummy/tmp/cache/assets/CC3/B10/sprockets%2F0a2c59284c7a5d99581883a9763b5ad8 +0 -0
- data/spec/dummy/tmp/cache/assets/CC9/940/sprockets%2F8128c279185cf97dba7914278ce838b4 +0 -0
- data/spec/dummy/tmp/cache/assets/CCA/0C0/sprockets%2F6c3e053393afe303432ca73f1b41490b +0 -0
- data/spec/dummy/tmp/cache/assets/CD5/2C0/sprockets%2F166c056119ebdfb8b7104c97b424b423 +0 -0
- data/spec/dummy/tmp/cache/assets/CDB/610/sprockets%2F7adf20860b018477a95cdb8321b49d16 +0 -0
- data/spec/dummy/tmp/cache/assets/CDD/F50/sprockets%2F7353f31f80f1139aade47728a62af336 +0 -0
- data/spec/dummy/tmp/cache/assets/CE9/760/sprockets%2F5ae7fab601683996918936cad21fc244 +0 -0
- data/spec/dummy/tmp/cache/assets/CE9/B90/sprockets%2Fea2eb066933b1d8b5949972c3c79353a +0 -0
- data/spec/dummy/tmp/cache/assets/CF1/AF0/sprockets%2F14dc9633b61024231ebec0c1a4a0259f +0 -0
- data/spec/dummy/tmp/cache/assets/D02/340/sprockets%2Fae58ed66f72137a594b0912bab600e03 +0 -0
- data/spec/dummy/tmp/cache/assets/D0A/AC0/sprockets%2Fc154991d0a7564e15c0fb4a555c5c73d +0 -0
- data/spec/dummy/tmp/cache/assets/D0B/190/sprockets%2F68cb0d1054ca546fc473274c4ac8737c +0 -0
- data/spec/dummy/tmp/cache/assets/D11/530/sprockets%2F13bc8c66140adef2e97648630866aae3 +0 -0
- data/spec/dummy/tmp/cache/assets/D16/AA0/sprockets%2Ff181e659a47e2cf9c257f32d80452bd3 +0 -0
- data/spec/dummy/tmp/cache/assets/D18/840/sprockets%2F50c1885539f61359c48af74fcae1df31 +0 -0
- data/spec/dummy/tmp/cache/assets/D1B/940/sprockets%2F7c4819d1dd9b64a22941d8c7bd1e6954 +0 -0
- data/spec/dummy/tmp/cache/assets/D2B/1F0/sprockets%2F6a4c116e8316d082bb0ffae02e94b107 +0 -0
- data/spec/dummy/tmp/cache/assets/D3C/E20/sprockets%2Ffc6c44ec250bc532c55649e5292b5c1f +0 -0
- data/spec/dummy/tmp/cache/assets/D4B/C30/sprockets%2Fe8aa746e637d69ff0ac1e71e528c5292 +0 -0
- data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/E20/sprockets%2Febf23d670481ba70b341aa2eb6e37b08 +0 -0
- data/spec/dummy/tmp/cache/assets/D5C/1F0/sprockets%2F2d3f2cfd98bf787168fb59f84ab24784 +0 -0
- data/spec/dummy/tmp/cache/assets/D5D/C60/sprockets%2Ffa0336b42d01aa9173d9d4c12fc4e82d +0 -0
- data/spec/dummy/tmp/cache/assets/D65/DD0/sprockets%2Fed4503679ef66f0e597bfc738bc9e698 +0 -0
- data/spec/dummy/tmp/cache/assets/D68/930/sprockets%2F5a15e52e84502f9fceb7ea04020f65fc +0 -0
- data/spec/dummy/tmp/cache/assets/D8C/140/sprockets%2F2afdbb3902a1be5d2f045cfc837903a3 +0 -0
- data/spec/dummy/tmp/cache/assets/D8E/660/sprockets%2F3a3eed926bdf64000ccacb36022f78d4 +0 -0
- data/spec/dummy/tmp/cache/assets/D95/690/sprockets%2Fe4d19a04705ee5d72c7fa64dc2070ddb +0 -0
- data/spec/dummy/tmp/cache/assets/DA4/EC0/sprockets%2F8da2289e16c1d0cac94aa825ee18d99d +0 -0
- data/spec/dummy/tmp/cache/assets/DA6/120/sprockets%2Fc5880aca76ccbb51f9388362e8afc1e6 +0 -0
- data/spec/dummy/tmp/cache/assets/DA7/390/sprockets%2F25e744cd1b6f8f7ce1d52c1e86a8f19a +0 -0
- data/spec/dummy/tmp/cache/assets/DAB/3E0/sprockets%2F63d2fa621beec4fe878f9eb2884426ab +0 -0
- data/spec/dummy/tmp/cache/assets/DAB/660/sprockets%2F9a8c36769afcc7027b4b6ee0c3e77ce5 +0 -0
- data/spec/dummy/tmp/cache/assets/DBF/EB0/sprockets%2F2afcec323c8ba12a2b7c852f23aa589e +0 -0
- data/spec/dummy/tmp/cache/assets/DCE/9F0/sprockets%2F8fa8c08ea8da97c06cd6c32fe3e613b0 +0 -0
- data/spec/dummy/tmp/cache/assets/DCF/E50/sprockets%2Fc39ff2ed4e1fb4269c39d415acf0d90b +0 -0
- data/spec/dummy/tmp/cache/assets/DD8/0A0/sprockets%2Fb2c3097effcd6084ec75e1f745d1d7dd +0 -0
- data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/DF0/040/sprockets%2F04bbbe1ee5ca914173cd90cf6e8a4e0b +0 -0
- data/spec/dummy/tmp/cache/assets/DF7/C80/sprockets%2Ff503b3666caf04beb7cfe54cbdb0575e +0 -0
- data/spec/dummy/tmp/cache/assets/DFA/B70/sprockets%2F262fb95d3f7cfc16febb0f0128ac38ce +0 -0
- data/spec/dummy/tmp/cache/assets/E03/260/sprockets%2Fd1fcfea59ff53c32557ffcd93016cb2e +0 -0
- data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/E0A/510/sprockets%2F8efee416ba436e75bea85d4d367faea7 +0 -0
- data/spec/dummy/tmp/cache/assets/E43/810/sprockets%2F79b0ef75ceb26a9c8fca797db3efba96 +0 -0
- data/spec/dummy/tmp/cache/assets/E96/1B0/sprockets%2F6d5fe51f9c1a3d2f898becd0bcddef3e +0 -0
- data/spec/dummy/tmp/cache/assets/ED4/410/sprockets%2F082adbb8e2abd8a21c8b34aebbbfbfad +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/vendor/assets/javascripts/tableling.backbone.js +40 -6
- data/vendor/assets/javascripts/tableling.js +40 -6
- data/vendor/assets/javascripts/tableling.world.js +40 -6
- metadata +127 -3
data/spec/dummy/log/test.log
CHANGED
@@ -1,28 +1,7 @@
|
|
1
1
|
Connecting to database specified by database.yml
|
2
|
-
[1m[36m (
|
2
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
3
3
|
Migrating to CreateBooks (20121008115302)
|
4
4
|
[1m[35m (0.1ms)[0m begin transaction
|
5
|
-
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
6
|
-
[1m[35m (0.0ms)[0m begin transaction
|
7
5
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
8
|
-
Connecting to database specified by database.yml
|
9
|
-
[1m[36m (2.5ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
10
|
-
Migrating to CreateBooks (20121008115302)
|
11
|
-
[1m[35m (0.1ms)[0m begin transaction
|
12
|
-
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
13
6
|
[1m[35m (0.0ms)[0m begin transaction
|
14
7
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
15
|
-
Connecting to database specified by database.yml
|
16
|
-
[1m[36m (1.9ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
17
|
-
Migrating to CreateBooks (20121008115302)
|
18
|
-
[1m[35m (0.1ms)[0m begin transaction
|
19
|
-
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
20
|
-
[1m[35m (0.1ms)[0m begin transaction
|
21
|
-
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
22
|
-
Connecting to database specified by database.yml
|
23
|
-
[1m[36m (1.9ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
24
|
-
Migrating to CreateBooks (20121008115302)
|
25
|
-
[1m[35m (0.1ms)[0m begin transaction
|
26
|
-
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
27
|
-
[1m[35m (0.0ms)[0m begin transaction
|
28
|
-
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
3682
|
@@ -3555,7 +3555,7 @@ _.extend(Marionette.Module, {
|
|
3555
3555
|
return Marionette;
|
3556
3556
|
})(Backbone, _, $ || window.jQuery || window.Zepto || window.ender);
|
3557
3557
|
/*!
|
3558
|
-
* Tableling v0.0.
|
3558
|
+
* Tableling v0.0.17
|
3559
3559
|
* Copyright (c) 2012-2013 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
|
3560
3560
|
* Distributed under MIT license
|
3561
3561
|
* https://github.com/AlphaHydrae/tableling
|
@@ -3563,7 +3563,7 @@ _.extend(Marionette.Module, {
|
|
3563
3563
|
Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
3564
3564
|
|
3565
3565
|
var Tableling = {
|
3566
|
-
version : "0.0.
|
3566
|
+
version : "0.0.17"
|
3567
3567
|
};
|
3568
3568
|
|
3569
3569
|
// Tableling
|
@@ -3803,7 +3803,13 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
3803
3803
|
// event aggregator.
|
3804
3804
|
Tableling.Module = Backbone.Marionette.ItemView.extend({
|
3805
3805
|
|
3806
|
+
i18n : {},
|
3807
|
+
templateHelpers : function() {
|
3808
|
+
return this.i18n;
|
3809
|
+
},
|
3810
|
+
|
3806
3811
|
initialize : function(options) {
|
3812
|
+
|
3807
3813
|
this.vent = options.vent;
|
3808
3814
|
|
3809
3815
|
// The `setup` method of the view is called when the table
|
@@ -3813,6 +3819,8 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
3813
3819
|
// The `refresh` method of the view is called every time the table
|
3814
3820
|
// is refreshed.
|
3815
3821
|
this.vent.on('table:refreshed', this.refresh, this);
|
3822
|
+
|
3823
|
+
this.i18n = _.clone(options.i18n || this.i18n);
|
3816
3824
|
},
|
3817
3825
|
|
3818
3826
|
// Call `update` to trigger an update of the table.
|
@@ -4003,9 +4011,16 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
4003
4011
|
});
|
4004
4012
|
|
4005
4013
|
Tableling.Plain.PageSizeView = Tableling.Plain.Table.prototype.pageSizeView = Tableling.FieldModule.extend({
|
4014
|
+
|
4006
4015
|
// TODO: update current page intelligently
|
4007
4016
|
name : 'pageSize',
|
4008
|
-
template :
|
4017
|
+
template : function(data) {
|
4018
|
+
return _.template('<select name="pageSize" /> <%- entries %>', data);
|
4019
|
+
},
|
4020
|
+
|
4021
|
+
i18n : {
|
4022
|
+
entries : 'entries per page'
|
4023
|
+
},
|
4009
4024
|
sizes : [ 10, 15, 20, 25, 50 ],
|
4010
4025
|
|
4011
4026
|
ui : {
|
@@ -4036,7 +4051,13 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
4036
4051
|
Tableling.Plain.QuickSearchView = Tableling.Plain.Table.prototype.quickSearchView = Tableling.FieldModule.extend({
|
4037
4052
|
|
4038
4053
|
name : 'quickSearch',
|
4039
|
-
template :
|
4054
|
+
template : function(data) {
|
4055
|
+
return _.template('<input type="text" name="quickSearch" placeholder="<%- quickSearch %>" />', data);
|
4056
|
+
},
|
4057
|
+
|
4058
|
+
i18n : {
|
4059
|
+
quickSearch : 'Quick search...'
|
4060
|
+
},
|
4040
4061
|
|
4041
4062
|
config : function() {
|
4042
4063
|
var config = Tableling.FieldModule.prototype.config.call(this);
|
@@ -4047,7 +4068,17 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
4047
4068
|
|
4048
4069
|
Tableling.Plain.InfoView = Tableling.Plain.Table.prototype.infoView = Tableling.Module.extend({
|
4049
4070
|
|
4050
|
-
template :
|
4071
|
+
template : function(data) {
|
4072
|
+
return _.template(data.template, {
|
4073
|
+
first : '<span class="first">0</span>',
|
4074
|
+
last : '<span class="last">0</span>',
|
4075
|
+
total : '<span class="total">0</span>'
|
4076
|
+
});
|
4077
|
+
},
|
4078
|
+
|
4079
|
+
i18n : {
|
4080
|
+
template : 'Showing <%= first %> to <%= last %> of <%= total %> entries'
|
4081
|
+
},
|
4051
4082
|
|
4052
4083
|
ui : {
|
4053
4084
|
first: '.first',
|
@@ -4150,7 +4181,10 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
4150
4181
|
Tableling.Bootstrap.TableView = Tableling.Plain.TableView.extend({});
|
4151
4182
|
|
4152
4183
|
Tableling.Bootstrap.PageSizeView = Tableling.Bootstrap.Table.prototype.pageSizeView = Tableling.Plain.PageSizeView.extend({
|
4153
|
-
|
4184
|
+
|
4185
|
+
template : function(data) {
|
4186
|
+
return _.template('<select name="pageSize" class="input-mini"><option>5</option><option>10</option><option>15</option></select> <%- entries %>', data);
|
4187
|
+
}
|
4154
4188
|
});
|
4155
4189
|
|
4156
4190
|
Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Tableling v0.0.
|
2
|
+
* Tableling v0.0.17
|
3
3
|
* Copyright (c) 2012-2013 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
|
4
4
|
* Distributed under MIT license
|
5
5
|
* https://github.com/AlphaHydrae/tableling
|
@@ -7,7 +7,7 @@
|
|
7
7
|
Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
8
8
|
|
9
9
|
var Tableling = {
|
10
|
-
version : "0.0.
|
10
|
+
version : "0.0.17"
|
11
11
|
};
|
12
12
|
|
13
13
|
// Tableling
|
@@ -247,7 +247,13 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
247
247
|
// event aggregator.
|
248
248
|
Tableling.Module = Backbone.Marionette.ItemView.extend({
|
249
249
|
|
250
|
+
i18n : {},
|
251
|
+
templateHelpers : function() {
|
252
|
+
return this.i18n;
|
253
|
+
},
|
254
|
+
|
250
255
|
initialize : function(options) {
|
256
|
+
|
251
257
|
this.vent = options.vent;
|
252
258
|
|
253
259
|
// The `setup` method of the view is called when the table
|
@@ -257,6 +263,8 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
257
263
|
// The `refresh` method of the view is called every time the table
|
258
264
|
// is refreshed.
|
259
265
|
this.vent.on('table:refreshed', this.refresh, this);
|
266
|
+
|
267
|
+
this.i18n = _.clone(options.i18n || this.i18n);
|
260
268
|
},
|
261
269
|
|
262
270
|
// Call `update` to trigger an update of the table.
|
@@ -447,9 +455,16 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
447
455
|
});
|
448
456
|
|
449
457
|
Tableling.Plain.PageSizeView = Tableling.Plain.Table.prototype.pageSizeView = Tableling.FieldModule.extend({
|
458
|
+
|
450
459
|
// TODO: update current page intelligently
|
451
460
|
name : 'pageSize',
|
452
|
-
template :
|
461
|
+
template : function(data) {
|
462
|
+
return _.template('<select name="pageSize" /> <%- entries %>', data);
|
463
|
+
},
|
464
|
+
|
465
|
+
i18n : {
|
466
|
+
entries : 'entries per page'
|
467
|
+
},
|
453
468
|
sizes : [ 10, 15, 20, 25, 50 ],
|
454
469
|
|
455
470
|
ui : {
|
@@ -480,7 +495,13 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
480
495
|
Tableling.Plain.QuickSearchView = Tableling.Plain.Table.prototype.quickSearchView = Tableling.FieldModule.extend({
|
481
496
|
|
482
497
|
name : 'quickSearch',
|
483
|
-
template :
|
498
|
+
template : function(data) {
|
499
|
+
return _.template('<input type="text" name="quickSearch" placeholder="<%- quickSearch %>" />', data);
|
500
|
+
},
|
501
|
+
|
502
|
+
i18n : {
|
503
|
+
quickSearch : 'Quick search...'
|
504
|
+
},
|
484
505
|
|
485
506
|
config : function() {
|
486
507
|
var config = Tableling.FieldModule.prototype.config.call(this);
|
@@ -491,7 +512,17 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
491
512
|
|
492
513
|
Tableling.Plain.InfoView = Tableling.Plain.Table.prototype.infoView = Tableling.Module.extend({
|
493
514
|
|
494
|
-
template :
|
515
|
+
template : function(data) {
|
516
|
+
return _.template(data.template, {
|
517
|
+
first : '<span class="first">0</span>',
|
518
|
+
last : '<span class="last">0</span>',
|
519
|
+
total : '<span class="total">0</span>'
|
520
|
+
});
|
521
|
+
},
|
522
|
+
|
523
|
+
i18n : {
|
524
|
+
template : 'Showing <%= first %> to <%= last %> of <%= total %> entries'
|
525
|
+
},
|
495
526
|
|
496
527
|
ui : {
|
497
528
|
first: '.first',
|
@@ -594,7 +625,10 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
594
625
|
Tableling.Bootstrap.TableView = Tableling.Plain.TableView.extend({});
|
595
626
|
|
596
627
|
Tableling.Bootstrap.PageSizeView = Tableling.Bootstrap.Table.prototype.pageSizeView = Tableling.Plain.PageSizeView.extend({
|
597
|
-
|
628
|
+
|
629
|
+
template : function(data) {
|
630
|
+
return _.template('<select name="pageSize" class="input-mini"><option>5</option><option>10</option><option>15</option></select> <%- entries %>', data);
|
631
|
+
}
|
598
632
|
});
|
599
633
|
|
600
634
|
Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({});
|
@@ -14826,7 +14826,7 @@ _.extend(Marionette.Module, {
|
|
14826
14826
|
return Marionette;
|
14827
14827
|
})(Backbone, _, $ || window.jQuery || window.Zepto || window.ender);
|
14828
14828
|
/*!
|
14829
|
-
* Tableling v0.0.
|
14829
|
+
* Tableling v0.0.17
|
14830
14830
|
* Copyright (c) 2012-2013 Simon Oulevay (Alpha Hydrae) <hydrae.alpha@gmail.com>
|
14831
14831
|
* Distributed under MIT license
|
14832
14832
|
* https://github.com/AlphaHydrae/tableling
|
@@ -14834,7 +14834,7 @@ _.extend(Marionette.Module, {
|
|
14834
14834
|
Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
14835
14835
|
|
14836
14836
|
var Tableling = {
|
14837
|
-
version : "0.0.
|
14837
|
+
version : "0.0.17"
|
14838
14838
|
};
|
14839
14839
|
|
14840
14840
|
// Tableling
|
@@ -15074,7 +15074,13 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
15074
15074
|
// event aggregator.
|
15075
15075
|
Tableling.Module = Backbone.Marionette.ItemView.extend({
|
15076
15076
|
|
15077
|
+
i18n : {},
|
15078
|
+
templateHelpers : function() {
|
15079
|
+
return this.i18n;
|
15080
|
+
},
|
15081
|
+
|
15077
15082
|
initialize : function(options) {
|
15083
|
+
|
15078
15084
|
this.vent = options.vent;
|
15079
15085
|
|
15080
15086
|
// The `setup` method of the view is called when the table
|
@@ -15084,6 +15090,8 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
15084
15090
|
// The `refresh` method of the view is called every time the table
|
15085
15091
|
// is refreshed.
|
15086
15092
|
this.vent.on('table:refreshed', this.refresh, this);
|
15093
|
+
|
15094
|
+
this.i18n = _.clone(options.i18n || this.i18n);
|
15087
15095
|
},
|
15088
15096
|
|
15089
15097
|
// Call `update` to trigger an update of the table.
|
@@ -15274,9 +15282,16 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
15274
15282
|
});
|
15275
15283
|
|
15276
15284
|
Tableling.Plain.PageSizeView = Tableling.Plain.Table.prototype.pageSizeView = Tableling.FieldModule.extend({
|
15285
|
+
|
15277
15286
|
// TODO: update current page intelligently
|
15278
15287
|
name : 'pageSize',
|
15279
|
-
template :
|
15288
|
+
template : function(data) {
|
15289
|
+
return _.template('<select name="pageSize" /> <%- entries %>', data);
|
15290
|
+
},
|
15291
|
+
|
15292
|
+
i18n : {
|
15293
|
+
entries : 'entries per page'
|
15294
|
+
},
|
15280
15295
|
sizes : [ 10, 15, 20, 25, 50 ],
|
15281
15296
|
|
15282
15297
|
ui : {
|
@@ -15307,7 +15322,13 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
15307
15322
|
Tableling.Plain.QuickSearchView = Tableling.Plain.Table.prototype.quickSearchView = Tableling.FieldModule.extend({
|
15308
15323
|
|
15309
15324
|
name : 'quickSearch',
|
15310
|
-
template :
|
15325
|
+
template : function(data) {
|
15326
|
+
return _.template('<input type="text" name="quickSearch" placeholder="<%- quickSearch %>" />', data);
|
15327
|
+
},
|
15328
|
+
|
15329
|
+
i18n : {
|
15330
|
+
quickSearch : 'Quick search...'
|
15331
|
+
},
|
15311
15332
|
|
15312
15333
|
config : function() {
|
15313
15334
|
var config = Tableling.FieldModule.prototype.config.call(this);
|
@@ -15318,7 +15339,17 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
15318
15339
|
|
15319
15340
|
Tableling.Plain.InfoView = Tableling.Plain.Table.prototype.infoView = Tableling.Module.extend({
|
15320
15341
|
|
15321
|
-
template :
|
15342
|
+
template : function(data) {
|
15343
|
+
return _.template(data.template, {
|
15344
|
+
first : '<span class="first">0</span>',
|
15345
|
+
last : '<span class="last">0</span>',
|
15346
|
+
total : '<span class="total">0</span>'
|
15347
|
+
});
|
15348
|
+
},
|
15349
|
+
|
15350
|
+
i18n : {
|
15351
|
+
template : 'Showing <%= first %> to <%= last %> of <%= total %> entries'
|
15352
|
+
},
|
15322
15353
|
|
15323
15354
|
ui : {
|
15324
15355
|
first: '.first',
|
@@ -15421,7 +15452,10 @@ Backbone.Tableling = Tableling = (function(Backbone, _, $){
|
|
15421
15452
|
Tableling.Bootstrap.TableView = Tableling.Plain.TableView.extend({});
|
15422
15453
|
|
15423
15454
|
Tableling.Bootstrap.PageSizeView = Tableling.Bootstrap.Table.prototype.pageSizeView = Tableling.Plain.PageSizeView.extend({
|
15424
|
-
|
15455
|
+
|
15456
|
+
template : function(data) {
|
15457
|
+
return _.template('<select name="pageSize" class="input-mini"><option>5</option><option>10</option><option>15</option></select> <%- entries %>', data);
|
15458
|
+
}
|
15425
15459
|
});
|
15426
15460
|
|
15427
15461
|
Tableling.Bootstrap.QuickSearchView = Tableling.Bootstrap.Table.prototype.quickSearchView = Tableling.Plain.QuickSearchView.extend({});
|