├── .gitattributes
├── .gitignore
├── GruntFile.js
├── LICENSE-GPLv3
├── README.md
├── compiled
├── footable.bootstrap.css
├── footable.bootstrap.min.css
├── footable.core.bootstrap.css
├── footable.core.bootstrap.min.css
├── footable.core.js
├── footable.core.min.js
├── footable.core.standalone.css
├── footable.core.standalone.min.css
├── footable.editing.css
├── footable.editing.js
├── footable.editing.min.css
├── footable.editing.min.js
├── footable.export.js
├── footable.export.min.js
├── footable.filtering.css
├── footable.filtering.js
├── footable.filtering.min.css
├── footable.filtering.min.js
├── footable.js
├── footable.min.js
├── footable.paging.css
├── footable.paging.js
├── footable.paging.min.css
├── footable.paging.min.js
├── footable.sorting.css
├── footable.sorting.js
├── footable.sorting.min.css
├── footable.sorting.min.js
├── footable.standalone.css
├── footable.standalone.min.css
├── footable.state.js
└── footable.state.min.js
├── docs
├── columns
│ ├── array.html
│ ├── date.html
│ ├── number.html
│ └── object.html
├── components
│ ├── editing.html
│ ├── filtering.html
│ ├── paging.html
│ ├── sorting.html
│ └── state.html
├── content
│ ├── columns.json
│ ├── rows-1.json
│ ├── rows-2.json
│ ├── rows-3.json
│ ├── rows-4.json
│ └── rows.json
├── css
│ ├── docs.css
│ ├── index.css
│ └── prism.css
├── examples
│ ├── advanced
│ │ ├── ajax.html
│ │ ├── change-pagesize.html
│ │ ├── custom-filter-ui.html
│ │ ├── filter-dropdown.html
│ │ └── loading-rows.html
│ ├── basic
│ │ ├── hiding-columns.html
│ │ ├── no-header.html
│ │ ├── row-toggle.html
│ │ └── single-header.html
│ ├── bootstrap
│ │ ├── accordion.html
│ │ ├── collapse.html
│ │ └── modal.html
│ └── component
│ │ ├── editing.html
│ │ ├── filtering.html
│ │ ├── paging.html
│ │ ├── showcase.html
│ │ └── sorting.html
├── getting-started.html
├── js
│ ├── demo-rows.js
│ ├── docs.js
│ ├── ie10-viewport-bug-workaround.js
│ ├── jquery.min.js
│ └── prism.js
└── jsdocs
│ ├── FooTable.ArrayColumn.html
│ ├── FooTable.Breakpoint.html
│ ├── FooTable.Breakpoints.html
│ ├── FooTable.Cell.html
│ ├── FooTable.Class.html
│ ├── FooTable.ClassFactory.html
│ ├── FooTable.Column.html
│ ├── FooTable.Columns.html
│ ├── FooTable.Component.html
│ ├── FooTable.DateColumn.html
│ ├── FooTable.Defaults.html
│ ├── FooTable.Editing.html
│ ├── FooTable.EditingColumn.html
│ ├── FooTable.Export.html
│ ├── FooTable.Filter.html
│ ├── FooTable.Filtering.html
│ ├── FooTable.HTMLColumn.html
│ ├── FooTable.NumberColumn.html
│ ├── FooTable.ObjectColumn.html
│ ├── FooTable.Pager.html
│ ├── FooTable.Paging.html
│ ├── FooTable.Query.html
│ ├── FooTable.Row.html
│ ├── FooTable.Rows.html
│ ├── FooTable.Sorter.html
│ ├── FooTable.Sorting.html
│ ├── FooTable.State.html
│ ├── FooTable.Table.html
│ ├── FooTable.arr.html
│ ├── FooTable.html
│ ├── FooTable.is.html
│ ├── FooTable.str.html
│ ├── classes.list.html
│ ├── favicon.ico
│ ├── img
│ ├── glyphicons-halflings-white.png
│ ├── glyphicons-halflings.png
│ └── old-wall.png
│ ├── index.html
│ ├── jQuery.fn.html
│ ├── jQuery.html
│ ├── namespaces.list.html
│ ├── scripts
│ ├── URI.js
│ ├── bootstrap-dropdown.js
│ ├── bootstrap-tab.js
│ ├── docstrap.lib.js
│ ├── prettify
│ │ ├── Apache-License-2.0.txt
│ │ ├── jquery.min.js
│ │ ├── lang-css.js
│ │ └── prettify.js
│ ├── sunlight.js
│ └── toc.js
│ └── styles
│ ├── darkstrap.css
│ ├── prettify-tomorrow.css
│ ├── site.oblivion.css
│ ├── sunlight.dark.css
│ └── sunlight.default.css
├── index.html
├── jsdoc.json
├── package.json
├── releases
├── footable-bootstrap.latest.zip
├── footable-bootstrap.v3.0.0.zip
├── footable-bootstrap.v3.0.1.zip
├── footable-bootstrap.v3.0.10.zip
├── footable-bootstrap.v3.0.11.zip
├── footable-bootstrap.v3.0.2.zip
├── footable-bootstrap.v3.0.3.zip
├── footable-bootstrap.v3.0.4.zip
├── footable-bootstrap.v3.0.5.zip
├── footable-bootstrap.v3.0.6.zip
├── footable-bootstrap.v3.0.7.zip
├── footable-bootstrap.v3.0.8.zip
├── footable-bootstrap.v3.0.9.zip
├── footable-bootstrap.v3.1.0.zip
├── footable-bootstrap.v3.1.1.zip
├── footable-bootstrap.v3.1.2.zip
├── footable-bootstrap.v3.1.3.zip
├── footable-bootstrap.v3.1.4.zip
├── footable-bootstrap.v3.1.5.zip
├── footable-bootstrap.v3.1.6.zip
├── footable-components.latest.zip
├── footable-components.v3.0.0.zip
├── footable-components.v3.0.1.zip
├── footable-components.v3.0.10.zip
├── footable-components.v3.0.11.zip
├── footable-components.v3.0.2.zip
├── footable-components.v3.0.3.zip
├── footable-components.v3.0.4.zip
├── footable-components.v3.0.5.zip
├── footable-components.v3.0.6.zip
├── footable-components.v3.0.7.zip
├── footable-components.v3.0.8.zip
├── footable-components.v3.0.9.zip
├── footable-components.v3.1.0.zip
├── footable-components.v3.1.1.zip
├── footable-components.v3.1.2.zip
├── footable-components.v3.1.3.zip
├── footable-components.v3.1.4.zip
├── footable-components.v3.1.5.zip
├── footable-components.v3.1.6.zip
├── footable-standalone.latest.zip
├── footable-standalone.v3.0.0.zip
├── footable-standalone.v3.0.1.zip
├── footable-standalone.v3.0.10.zip
├── footable-standalone.v3.0.11.zip
├── footable-standalone.v3.0.2.zip
├── footable-standalone.v3.0.3.zip
├── footable-standalone.v3.0.4.zip
├── footable-standalone.v3.0.5.zip
├── footable-standalone.v3.0.6.zip
├── footable-standalone.v3.0.7.zip
├── footable-standalone.v3.0.8.zip
├── footable-standalone.v3.0.9.zip
├── footable-standalone.v3.1.0.zip
├── footable-standalone.v3.1.1.zip
├── footable-standalone.v3.1.2.zip
├── footable-standalone.v3.1.3.zip
├── footable-standalone.v3.1.4.zip
├── footable-standalone.v3.1.5.zip
└── footable-standalone.v3.1.6.zip
└── src
├── css
├── FooTable.FontAwesome.css
├── FooTable.Glyphicons.css
├── FooTable.NoBootstrap.css
├── FooTable.css
└── components
│ ├── FooTable.Editing.css
│ ├── FooTable.Filtering.css
│ ├── FooTable.Paging.css
│ └── FooTable.Sorting.css
└── js
├── FooTable.js
├── classes
├── FooTable.Cell.js
├── FooTable.Column.js
├── FooTable.Component.js
├── FooTable.Defaults.js
├── FooTable.Row.js
├── FooTable.Table.js
└── columns
│ ├── FooTable.ArrayColumn.js
│ ├── FooTable.DateColumn.js
│ ├── FooTable.HTMLColumn.js
│ ├── FooTable.NumberColumn.js
│ └── FooTable.ObjectColumn.js
├── components
├── README.md
├── breakpoints
│ ├── FooTable.Breakpoint.js
│ ├── FooTable.Breakpoints.js
│ └── extends
│ │ ├── FooTable.Column.js
│ │ └── FooTable.Defaults.js
├── columns
│ ├── FooTable.Columns.js
│ └── extends
│ │ └── FooTable.Defaults.js
├── editing
│ ├── FooTable.Editing.js
│ ├── FooTable.EditingColumn.js
│ └── extends
│ │ ├── FooTable.Defaults.js
│ │ ├── FooTable.Paging.js
│ │ ├── FooTable.Row.js
│ │ └── FooTable.Rows.js
├── export
│ ├── FooTable.Export.js
│ └── extends
│ │ ├── FooTable.Column.js
│ │ └── FooTable.Table.js
├── filtering
│ ├── FooTable.Filter.js
│ ├── FooTable.Filtering.js
│ ├── FooTable.Query.js
│ └── extends
│ │ ├── FooTable.Cell.js
│ │ ├── FooTable.Column.js
│ │ ├── FooTable.Defaults.js
│ │ └── FooTable.Row.js
├── paging
│ ├── FooTable.Pager.js
│ ├── FooTable.Paging.js
│ └── extends
│ │ ├── FooTable.Defaults.js
│ │ └── FooTable.Table.js
├── rows
│ ├── FooTable.Rows.js
│ └── extends
│ │ ├── FooTable.Defaults.js
│ │ └── FooTable.Table.js
├── sorting
│ ├── FooTable.Sorter.js
│ ├── FooTable.Sorting.js
│ └── extends
│ │ ├── FooTable.Cell.js
│ │ ├── FooTable.Column.js
│ │ ├── FooTable.Defaults.js
│ │ ├── FooTable.HTMLColumn.js
│ │ ├── FooTable.NumberColumn.js
│ │ └── FooTable.Table.js
└── state
│ ├── FooTable.State.js
│ └── extends
│ ├── FooTable.Component.js
│ ├── FooTable.Defaults.js
│ ├── FooTable.Filtering.js
│ ├── FooTable.Paging.js
│ ├── FooTable.Sorting.js
│ └── FooTable.Table.js
└── utils
├── FooTable.Class.js
├── FooTable.js
└── core
├── FooTable.arr.js
├── FooTable.is.js
└── FooTable.str.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 | [Dd]ebug/
46 | [Rr]elease/
47 |
48 | # Visual Studio profiler
49 | *.psess
50 | *.vsp
51 |
52 | # ReSharper and DotCover are .NET coding add-in
53 | _ReSharper*
54 | *.dotCover
55 |
56 | # Others
57 | [Bb]in
58 | [Oo]bj
59 | sql
60 | TestResults
61 | *.Cache
62 | ClientBin
63 | stylecop.*
64 | ~$*
65 | *.dbmdl
66 | Generated_Code #added for RIA/Silverlight projects
67 |
68 | # Backup & report files from converting an old project file to a newer
69 | # Visual Studio version. Backup files are not needed, because we have git ;-)
70 | _UpgradeReport_Files/
71 | Backup*/
72 | UpgradeLog*.XML
73 |
74 |
75 |
76 | # Windows image file caches
77 | Thumbs.db
78 |
79 | # Windows folder config file
80 | Desktop.ini
81 |
82 | # Installer logs
83 | pip-log.txt
84 |
85 | # Unit test / coverage reports
86 | .coverage
87 | .tox
88 |
89 | #Translations
90 | *.mo
91 |
92 | #Mr Developer
93 | .mr.developer.cfg
94 |
95 | #Mac crap
96 | .DS_Store
97 |
98 | #Grunt related
99 | /node_modules/
100 |
101 | #WebStorm IDE
102 | /.idea
103 |
104 | #npm
105 | npm-debug.log
106 |
107 | #developer specific test folder for anything I want to test but not check in.
108 | /.test/
--------------------------------------------------------------------------------
/LICENSE-GPLv3:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 Steven Usher & Brad Vincent
2 |
3 | This program is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | This program is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with this program. If not, see .
--------------------------------------------------------------------------------
/compiled/footable.core.bootstrap.css:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | table.footable,
9 | table.footable-details {
10 | position: relative;
11 | width: 100%;
12 | border-spacing: 0;
13 | border-collapse: collapse;
14 | }
15 | table.footable-details {
16 | margin-bottom: 0;
17 | }
18 | table.footable-hide-fouc {
19 | display: none;
20 | }
21 | table > tbody > tr > td > span.footable-toggle {
22 | margin-right: 8px;
23 | opacity: 0.3;
24 | }
25 | table > tbody > tr > td > span.footable-toggle.last-column {
26 | margin-left: 8px;
27 | float: right;
28 | }
29 | table.table-condensed > tbody > tr > td > span.footable-toggle {
30 | margin-right: 5px;
31 | }
32 | table.footable-details > tbody > tr > th:nth-child(1) {
33 | min-width: 40px;
34 | width: 120px;
35 | }
36 | table.footable-details > tbody > tr > td:nth-child(2) {
37 | word-break: break-all;
38 | }
39 |
40 | table.footable-details > thead > tr:first-child > th,
41 | table.footable-details > thead > tr:first-child > td,
42 | table.footable-details > tbody > tr:first-child > th,
43 | table.footable-details > tbody > tr:first-child > td,
44 | table.footable-details > tfoot > tr:first-child > th,
45 | table.footable-details > tfoot > tr:first-child > td {
46 | border-top-width: 0;
47 | }
48 | table.footable-details.table-bordered > thead > tr:first-child > th,
49 | table.footable-details.table-bordered > thead > tr:first-child > td,
50 | table.footable-details.table-bordered > tbody > tr:first-child > th,
51 | table.footable-details.table-bordered > tbody > tr:first-child > td,
52 | table.footable-details.table-bordered > tfoot > tr:first-child > th,
53 | table.footable-details.table-bordered > tfoot > tr:first-child > td {
54 | border-top-width: 1px;
55 | }
56 |
57 | div.footable-loader {
58 | vertical-align: middle;
59 | text-align: center;
60 | height: 300px;
61 | position: relative;
62 | }
63 | div.footable-loader > span.fooicon {
64 | display: inline-block;
65 | opacity: 0.3;
66 | font-size: 30px;
67 | line-height: 32px;
68 | width: 32px;
69 | height: 32px;
70 | margin-top: -16px;
71 | margin-left: -16px;
72 | position: absolute;
73 | top: 50%;
74 | left: 50%;
75 | -webkit-animation: fooicon-spin-r 2s infinite linear;
76 | animation: fooicon-spin-r 2s infinite linear;
77 | }
78 | table.footable > tbody > tr.footable-empty > td {
79 | vertical-align: middle;
80 | text-align: center;
81 | font-size: 30px;
82 | }
83 | table.footable > tbody > tr > td,
84 | table.footable > tbody > tr > th {
85 | display: none;
86 | }
87 | table.footable > tbody > tr.footable-empty > td,
88 | table.footable > tbody > tr.footable-empty > th,
89 | table.footable > tbody > tr.footable-detail-row > td,
90 | table.footable > tbody > tr.footable-detail-row > th {
91 | display: table-cell;
92 | }
93 | @-webkit-keyframes fooicon-spin-r {
94 | 0% {
95 | -webkit-transform: rotate(0deg);
96 | transform: rotate(0deg);
97 | }
98 |
99 | 100% {
100 | -webkit-transform: rotate(359deg);
101 | transform: rotate(359deg);
102 | }
103 | }
104 |
105 | @keyframes fooicon-spin-r {
106 | 0% {
107 | -webkit-transform: rotate(0deg);
108 | transform: rotate(0deg);
109 | }
110 |
111 | 100% {
112 | -webkit-transform: rotate(359deg);
113 | transform: rotate(359deg);
114 | }
115 | }
116 |
117 | .fooicon {
118 | position: relative;
119 | top: 1px;
120 | display: inline-block;
121 | font-family: 'Glyphicons Halflings' !important;
122 | font-style: normal;
123 | font-weight: 400;
124 | line-height: 1;
125 | -webkit-font-smoothing: antialiased;
126 | -moz-osx-font-smoothing: grayscale;
127 | }
128 | .fooicon:before,
129 | .fooicon:after {
130 | -webkit-box-sizing: border-box;
131 | -moz-box-sizing: border-box;
132 | box-sizing: border-box;
133 | }
134 | .fooicon-loader:before {
135 | content: "\e030";
136 | }
137 | .fooicon-plus:before {
138 | content: "\2b";
139 | }
140 | .fooicon-minus:before {
141 | content: "\2212";
142 | }
143 | .fooicon-search:before {
144 | content: "\e003";
145 | }
146 | .fooicon-remove:before {
147 | content: "\e014";
148 | }
149 | .fooicon-sort:before {
150 | content: "\e150";
151 | }
152 | .fooicon-sort-asc:before {
153 | content: "\e155";
154 | }
155 | .fooicon-sort-desc:before {
156 | content: "\e156";
157 | }
158 | .fooicon-pencil:before {
159 | content: "\270f";
160 | }
161 | .fooicon-trash:before {
162 | content: "\e020";
163 | }
164 | .fooicon-eye-close:before {
165 | content: "\e106";
166 | }
167 | .fooicon-flash:before {
168 | content: "\e162";
169 | }
170 | .fooicon-cog:before {
171 | content: "\e019";
172 | }
173 | .fooicon-stats:before {
174 | content: "\e185";
175 | }
176 |
--------------------------------------------------------------------------------
/compiled/footable.core.bootstrap.min.css:
--------------------------------------------------------------------------------
1 | table.footable,table.footable-details{position:relative;width:100%;border-spacing:0;border-collapse:collapse}table.footable-details{margin-bottom:0}table.footable-hide-fouc{display:none}table>tbody>tr>td>span.footable-toggle{margin-right:8px;opacity:.3}table>tbody>tr>td>span.footable-toggle.last-column{margin-left:8px;float:right}table.table-condensed>tbody>tr>td>span.footable-toggle{margin-right:5px}table.footable-details>tbody>tr>th:nth-child(1){min-width:40px;width:120px}table.footable-details>tbody>tr>td:nth-child(2){word-break:break-all}table.footable-details>tbody>tr:first-child>td,table.footable-details>tbody>tr:first-child>th,table.footable-details>tfoot>tr:first-child>td,table.footable-details>tfoot>tr:first-child>th,table.footable-details>thead>tr:first-child>td,table.footable-details>thead>tr:first-child>th{border-top-width:0}table.footable-details.table-bordered>tbody>tr:first-child>td,table.footable-details.table-bordered>tbody>tr:first-child>th,table.footable-details.table-bordered>tfoot>tr:first-child>td,table.footable-details.table-bordered>tfoot>tr:first-child>th,table.footable-details.table-bordered>thead>tr:first-child>td,table.footable-details.table-bordered>thead>tr:first-child>th{border-top-width:1px}div.footable-loader{vertical-align:middle;text-align:center;height:300px;position:relative}div.footable-loader>span.fooicon{display:inline-block;opacity:.3;font-size:30px;line-height:32px;width:32px;height:32px;margin-top:-16px;margin-left:-16px;position:absolute;top:50%;left:50%;-webkit-animation:fooicon-spin-r 2s infinite linear;animation:fooicon-spin-r 2s infinite linear}table.footable>tbody>tr.footable-empty>td{vertical-align:middle;text-align:center;font-size:30px}table.footable>tbody>tr>td,table.footable>tbody>tr>th{display:none}table.footable>tbody>tr.footable-detail-row>td,table.footable>tbody>tr.footable-detail-row>th,table.footable>tbody>tr.footable-empty>td,table.footable>tbody>tr.footable-empty>th{display:table-cell}@-webkit-keyframes fooicon-spin-r{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fooicon-spin-r{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fooicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings'!important;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fooicon:after,.fooicon:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fooicon-loader:before{content:"\e030"}.fooicon-plus:before{content:"\2b"}.fooicon-minus:before{content:"\2212"}.fooicon-search:before{content:"\e003"}.fooicon-remove:before{content:"\e014"}.fooicon-sort:before{content:"\e150"}.fooicon-sort-asc:before{content:"\e155"}.fooicon-sort-desc:before{content:"\e156"}.fooicon-pencil:before{content:"\270f"}.fooicon-trash:before{content:"\e020"}.fooicon-eye-close:before{content:"\e106"}.fooicon-flash:before{content:"\e162"}.fooicon-cog:before{content:"\e019"}.fooicon-stats:before{content:"\e185"}
--------------------------------------------------------------------------------
/compiled/footable.editing.css:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | td.footable-editing {
9 | width: 90px;
10 | max-width: 90px;
11 | }
12 | table.footable-editing-no-edit td.footable-editing,
13 | table.footable-editing-no-delete td.footable-editing,
14 | table.footable-editing-no-view td.footable-editing {
15 | width: 70px;
16 | max-width: 70px;
17 | }
18 | table.footable-editing-no-edit.footable-editing-no-delete td.footable-editing,
19 | table.footable-editing-no-edit.footable-editing-no-view td.footable-editing,
20 | table.footable-editing-no-delete.footable-editing-no-view td.footable-editing {
21 | width: 50px;
22 | max-width: 50px;
23 | }
24 | table.footable-editing-no-edit.footable-editing-no-delete.footable-editing-no-view td.footable-editing,
25 | table.footable-editing-no-edit.footable-editing-no-delete.footable-editing-no-view th.footable-editing {
26 | width: 0;
27 | max-width: 0;
28 | display: none !important;
29 | }
30 | table.footable-editing-right td.footable-editing,
31 | table.footable-editing-right tr.footable-editing {
32 | text-align: right;
33 | }
34 | table.footable-editing-left td.footable-editing,
35 | table.footable-editing-left tr.footable-editing {
36 | text-align: left;
37 | }
38 | table.footable-editing button.footable-add,
39 | table.footable-editing button.footable-hide,
40 | table.footable-editing-show button.footable-show,
41 | table.footable-editing.footable-editing-always-show button.footable-show,
42 | table.footable-editing.footable-editing-always-show button.footable-hide,
43 | table.footable-editing.footable-editing-always-show.footable-editing-no-add tr.footable-editing {
44 | display: none;
45 | }
46 | table.footable-editing.footable-editing-show button.footable-add,
47 | table.footable-editing.footable-editing-show button.footable-hide,
48 | table.footable-editing.footable-editing-always-show button.footable-add {
49 | display: inline-block;
50 | }
51 |
--------------------------------------------------------------------------------
/compiled/footable.editing.min.css:
--------------------------------------------------------------------------------
1 | td.footable-editing{width:90px;max-width:90px}table.footable-editing-no-delete td.footable-editing,table.footable-editing-no-edit td.footable-editing,table.footable-editing-no-view td.footable-editing{width:70px;max-width:70px}table.footable-editing-no-delete.footable-editing-no-view td.footable-editing,table.footable-editing-no-edit.footable-editing-no-delete td.footable-editing,table.footable-editing-no-edit.footable-editing-no-view td.footable-editing{width:50px;max-width:50px}table.footable-editing-no-edit.footable-editing-no-delete.footable-editing-no-view td.footable-editing,table.footable-editing-no-edit.footable-editing-no-delete.footable-editing-no-view th.footable-editing{width:0;max-width:0;display:none!important}table.footable-editing-right td.footable-editing,table.footable-editing-right tr.footable-editing{text-align:right}table.footable-editing-left td.footable-editing,table.footable-editing-left tr.footable-editing{text-align:left}table.footable-editing button.footable-add,table.footable-editing button.footable-hide,table.footable-editing-show button.footable-show,table.footable-editing.footable-editing-always-show button.footable-hide,table.footable-editing.footable-editing-always-show button.footable-show,table.footable-editing.footable-editing-always-show.footable-editing-no-add tr.footable-editing{display:none}table.footable-editing.footable-editing-always-show button.footable-add,table.footable-editing.footable-editing-show button.footable-add,table.footable-editing.footable-editing-show button.footable-hide{display:inline-block}
--------------------------------------------------------------------------------
/compiled/footable.export.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | !function(a,b){b.Export=b.Component.extend({construct:function(a){this._super(a,!0),this.snapshot=[]},predraw:function(){this.snapshot=this.ft.rows.array.slice(0)},columns:function(){var a=[];return b.arr.each(this.ft.columns.array,function(b){b.internal||a.push({type:b.type,name:b.name,title:b.title,visible:b.visible,hidden:b.hidden,classes:b.classes,style:b.style})}),a},rows:function(a){a=b.is["boolean"](a)?a:!1;var c=a?this.ft.rows.all:this.snapshot,d=[];return b.arr.each(c,function(a){d.push(a.val())}),d},json:function(a){return JSON.parse(JSON.stringify({columns:this.columns(),rows:this.rows(a)}))},csv:function(a){var c,d,e="",f=this.columns();b.arr.each(f,function(a,b){d='"'+a.title.replace(/"/g,'""')+'"',e+=0===b?d:","+d}),e+="\n";var g=a?this.ft.rows.all:this.snapshot;return b.arr.each(g,function(a){b.arr.each(a.cells,function(a,b){a.column.internal||(c=a.column.stringify.call(a.column,a.value,a.ft.o,a.row.value),d='"'+c.replace(/"/g,'""')+'"',e+=0===b?d:","+d)}),e+="\n"}),e}}),b.components.register("export",b.Export,490)}(jQuery,FooTable),function(a){a.Column.prototype.__export_define__=function(b){this.stringify=a.checkFnValue(this,b.stringify,this.stringify)},a.Column.extend("define",function(a){this._super(a),this.__export_define__(a)}),a.Column.prototype.stringify=function(a,b,c){return a+""},a.is.defined(a.DateColumn)&&(a.DateColumn.prototype.stringify=function(b,c,d){return a.is.object(b)&&a.is["boolean"](b._isAMomentObject)&&b.isValid()?b.format(this.formatString):""}),a.ObjectColumn.prototype.stringify=function(b,c,d){return a.is.object(b)?JSON.stringify(b):""},a.ArrayColumn.prototype.stringify=function(b,c,d){return a.is.array(b)?JSON.stringify(b):""}}(FooTable),function(a){a.Table.prototype.toJSON=function(b){return this.use(a.Export).json(b)},a.Table.prototype.toCSV=function(b){return this.use(a.Export).csv(b)}}(FooTable);
--------------------------------------------------------------------------------
/compiled/footable.filtering.css:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | table.footable > thead > tr.footable-filtering > th {
9 | border-bottom-width: 1px;
10 | font-weight: normal;
11 | }
12 | .footable-filtering-external.footable-filtering-right,
13 | table.footable > thead > tr.footable-filtering > th,
14 | table.footable.footable-filtering-right > thead > tr.footable-filtering > th {
15 | text-align: right;
16 | }
17 | .footable-filtering-external.footable-filtering-left,
18 | table.footable.footable-filtering-left > thead > tr.footable-filtering > th {
19 | text-align: left;
20 | }
21 | .footable-filtering-external.footable-filtering-center,
22 | table.footable.footable-filtering-center > thead > tr.footable-filtering > th {
23 | text-align: center;
24 | }
25 | table.footable > thead > tr.footable-filtering > th div.form-group {
26 | margin-bottom: 0;
27 | }
28 | table.footable > thead > tr.footable-filtering > th div.form-group+div.form-group {
29 | margin-top: 5px;
30 | }
31 | table.footable > thead > tr.footable-filtering > th div.input-group {
32 | width: 100%;
33 | }
34 | .footable-filtering-external ul.dropdown-menu > li > a.checkbox,
35 | table.footable > thead > tr.footable-filtering > th ul.dropdown-menu > li > a.checkbox {
36 | margin: 0;
37 | display: block;
38 | position: relative;
39 | }
40 | .footable-filtering-external ul.dropdown-menu > li > a.checkbox > label,
41 | table.footable > thead > tr.footable-filtering > th ul.dropdown-menu > li > a.checkbox > label {
42 | display: block;
43 | padding-left: 20px;
44 | }
45 | .footable-filtering-external ul.dropdown-menu > li > a.checkbox input[type="checkbox"],
46 | table.footable > thead > tr.footable-filtering > th ul.dropdown-menu > li > a.checkbox input[type="checkbox"] {
47 | position: absolute;
48 | margin-left: -20px;
49 | }
50 | @media (min-width: 768px) {
51 | table.footable > thead > tr.footable-filtering > th div.input-group {
52 | width: auto;
53 | }
54 | table.footable > thead > tr.footable-filtering > th div.form-group {
55 | margin-left: 2px;
56 | margin-right: 2px;
57 | }
58 | table.footable > thead > tr.footable-filtering > th div.form-group+div.form-group {
59 | margin-top: 0;
60 | }
61 | }
--------------------------------------------------------------------------------
/compiled/footable.filtering.min.css:
--------------------------------------------------------------------------------
1 | table.footable>thead>tr.footable-filtering>th{border-bottom-width:1px;font-weight:400}.footable-filtering-external.footable-filtering-right,table.footable.footable-filtering-right>thead>tr.footable-filtering>th,table.footable>thead>tr.footable-filtering>th{text-align:right}.footable-filtering-external.footable-filtering-left,table.footable.footable-filtering-left>thead>tr.footable-filtering>th{text-align:left}.footable-filtering-external.footable-filtering-center,table.footable.footable-filtering-center>thead>tr.footable-filtering>th{text-align:center}table.footable>thead>tr.footable-filtering>th div.form-group{margin-bottom:0}table.footable>thead>tr.footable-filtering>th div.form-group+div.form-group{margin-top:5px}table.footable>thead>tr.footable-filtering>th div.input-group{width:100%}.footable-filtering-external ul.dropdown-menu>li>a.checkbox,table.footable>thead>tr.footable-filtering>th ul.dropdown-menu>li>a.checkbox{margin:0;display:block;position:relative}.footable-filtering-external ul.dropdown-menu>li>a.checkbox>label,table.footable>thead>tr.footable-filtering>th ul.dropdown-menu>li>a.checkbox>label{display:block;padding-left:20px}.footable-filtering-external ul.dropdown-menu>li>a.checkbox input[type=checkbox],table.footable>thead>tr.footable-filtering>th ul.dropdown-menu>li>a.checkbox input[type=checkbox]{position:absolute;margin-left:-20px}@media (min-width:768px){table.footable>thead>tr.footable-filtering>th div.input-group{width:auto}table.footable>thead>tr.footable-filtering>th div.form-group{margin-left:2px;margin-right:2px}table.footable>thead>tr.footable-filtering>th div.form-group+div.form-group{margin-top:0}}
--------------------------------------------------------------------------------
/compiled/footable.paging.css:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | .footable-paging-external ul.pagination,
9 | table.footable > tfoot > tr.footable-paging > td > ul.pagination {
10 | margin: 10px 0 0 0;
11 | }
12 | .footable-paging-external span.label,
13 | table.footable > tfoot > tr.footable-paging > td > span.label {
14 | display: inline-block;
15 | margin: 0 0 10px 0;
16 | padding: 4px 10px;
17 | }
18 | .footable-paging-external.footable-paging-center,
19 | table.footable > tfoot > tr.footable-paging > td,
20 | table.footable-paging-center > tfoot > tr.footable-paging > td {
21 | text-align: center;
22 | }
23 | .footable-paging-external.footable-paging-left,
24 | table.footable-paging-left > tfoot > tr.footable-paging > td {
25 | text-align: left;
26 | }
27 | .footable-paging-external.footable-paging-right,
28 | table.footable-paging-right > tfoot > tr.footable-paging > td {
29 | text-align: right;
30 | }
31 | ul.pagination > li.footable-page {
32 | display: none;
33 | }
34 | ul.pagination > li.footable-page.visible {
35 | display: inline;
36 | }
--------------------------------------------------------------------------------
/compiled/footable.paging.min.css:
--------------------------------------------------------------------------------
1 | .footable-paging-external ul.pagination,table.footable>tfoot>tr.footable-paging>td>ul.pagination{margin:10px 0 0}.footable-paging-external span.label,table.footable>tfoot>tr.footable-paging>td>span.label{display:inline-block;margin:0 0 10px;padding:4px 10px}.footable-paging-external.footable-paging-center,table.footable-paging-center>tfoot>tr.footable-paging>td,table.footable>tfoot>tr.footable-paging>td{text-align:center}.footable-paging-external.footable-paging-left,table.footable-paging-left>tfoot>tr.footable-paging>td{text-align:left}.footable-paging-external.footable-paging-right,table.footable-paging-right>tfoot>tr.footable-paging>td{text-align:right}ul.pagination>li.footable-page{display:none}ul.pagination>li.footable-page.visible{display:inline}
--------------------------------------------------------------------------------
/compiled/footable.sorting.css:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | table.footable > thead > tr > td.footable-sortable,
9 | table.footable > thead > tr > th.footable-sortable,
10 | table.footable > tbody > tr > td.footable-sortable,
11 | table.footable > tbody > tr > th.footable-sortable,
12 | table.footable > tfoot > tr > td.footable-sortable,
13 | table.footable > tfoot > tr > th.footable-sortable {
14 | position: relative;
15 | padding-right: 30px;
16 | cursor: pointer;
17 | }
18 | td.footable-sortable > span.fooicon,
19 | th.footable-sortable > span.fooicon {
20 | position: absolute;
21 | right: 6px;
22 | top: 50%;
23 | margin-top: -7px;
24 | opacity: 0;
25 | transition: opacity 0.3s ease-in;
26 | }
27 | td.footable-sortable:hover > span.fooicon,
28 | th.footable-sortable:hover > span.fooicon {
29 | opacity: 1;
30 | }
31 | td.footable-sortable.footable-asc > span.fooicon,
32 | th.footable-sortable.footable-asc > span.fooicon,
33 | td.footable-sortable.footable-desc > span.fooicon,
34 | th.footable-sortable.footable-desc > span.fooicon {
35 | opacity: 1;
36 | }
37 | /* hides the sort icons when sorting is not allowed */
38 | table.footable-sorting-disabled td.footable-sortable.footable-asc > span.fooicon,
39 | table.footable-sorting-disabled td.footable-sortable.footable-desc > span.fooicon,
40 | table.footable-sorting-disabled td.footable-sortable:hover > span.fooicon,
41 | table.footable-sorting-disabled th.footable-sortable.footable-asc > span.fooicon,
42 | table.footable-sorting-disabled th.footable-sortable.footable-desc > span.fooicon,
43 | table.footable-sorting-disabled th.footable-sortable:hover > span.fooicon {
44 | opacity: 0;
45 | visibility: hidden;
46 | }
--------------------------------------------------------------------------------
/compiled/footable.sorting.min.css:
--------------------------------------------------------------------------------
1 | table.footable>tbody>tr>td.footable-sortable,table.footable>tbody>tr>th.footable-sortable,table.footable>tfoot>tr>td.footable-sortable,table.footable>tfoot>tr>th.footable-sortable,table.footable>thead>tr>td.footable-sortable,table.footable>thead>tr>th.footable-sortable{position:relative;padding-right:30px;cursor:pointer}td.footable-sortable>span.fooicon,th.footable-sortable>span.fooicon{position:absolute;right:6px;top:50%;margin-top:-7px;opacity:0;transition:opacity .3s ease-in}td.footable-sortable.footable-asc>span.fooicon,td.footable-sortable.footable-desc>span.fooicon,td.footable-sortable:hover>span.fooicon,th.footable-sortable.footable-asc>span.fooicon,th.footable-sortable.footable-desc>span.fooicon,th.footable-sortable:hover>span.fooicon{opacity:1}table.footable-sorting-disabled td.footable-sortable.footable-asc>span.fooicon,table.footable-sorting-disabled td.footable-sortable.footable-desc>span.fooicon,table.footable-sorting-disabled td.footable-sortable:hover>span.fooicon,table.footable-sorting-disabled th.footable-sortable.footable-asc>span.fooicon,table.footable-sorting-disabled th.footable-sortable.footable-desc>span.fooicon,table.footable-sorting-disabled th.footable-sortable:hover>span.fooicon{opacity:0;visibility:hidden}
--------------------------------------------------------------------------------
/compiled/footable.sorting.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | !function(a,b){b.Sorter=b.Class.extend({construct:function(a,b){this.column=a,this.direction=b}})}(jQuery,FooTable),function(a,b){b.Sorting=b.Component.extend({construct:function(a){this._super(a,a.o.sorting.enabled),this.o=a.o.sorting,this.column=null,this.allowed=!0,this.initial=null},preinit:function(a){var c=this;this.ft.raise("preinit.ft.sorting",[a]).then(function(){c.ft.$el.hasClass("footable-sorting")&&(c.enabled=!0),c.enabled=b.is["boolean"](a.sorting)?a.sorting:c.enabled,c.enabled&&(c.column=b.arr.first(c.ft.columns.array,function(a){return a.sorted}))},function(){c.enabled=!1})},init:function(){var c=this;this.ft.raise("init.ft.sorting").then(function(){if(!c.initial){var d=!!c.column;c.initial={isset:d,rows:c.ft.rows.all.slice(0),column:d?c.column.name:null,direction:d?c.column.direction:null}}b.arr.each(c.ft.columns.array,function(b){b.sortable&&b.$el.addClass("footable-sortable").append(a(" ",{"class":"fooicon fooicon-sort"}))}),c.ft.$el.on("click.footable",".footable-sortable",{self:c},c._onSortClicked)},function(){c.enabled=!1})},destroy:function(){var a=this;this.ft.raise("destroy.ft.paging").then(function(){a.ft.$el.off("click.footable",".footable-sortable",a._onSortClicked),a.ft.$el.children("thead").children("tr.footable-header").children(".footable-sortable").removeClass("footable-sortable footable-asc footable-desc").find("span.fooicon").remove()})},predraw:function(){if(this.column){var a=this,b=a.column;a.ft.rows.array.sort(function(a,c){return"DESC"==b.direction?b.sorter(c.cells[b.index].sortValue,a.cells[b.index].sortValue):b.sorter(a.cells[b.index].sortValue,c.cells[b.index].sortValue)})}},draw:function(){if(this.column){var a=this,b=a.ft.$el.find("thead > tr > .footable-sortable"),c=a.column.$el;b.removeClass("footable-asc footable-desc").children(".fooicon").removeClass("fooicon-sort fooicon-sort-asc fooicon-sort-desc"),b.not(c).children(".fooicon").addClass("fooicon-sort"),c.addClass("DESC"==a.column.direction?"footable-desc":"footable-asc").children(".fooicon").addClass("DESC"==a.column.direction?"fooicon-sort-desc":"fooicon-sort-asc")}},sort:function(a,b){return this._sort(a,b)},toggleAllowed:function(a){a=b.is["boolean"](a)?a:!this.allowed,this.allowed=a,this.ft.$el.toggleClass("footable-sorting-disabled",!this.allowed)},hasChanged:function(){return!(!this.initial||!this.column||this.column.name===this.initial.column&&(this.column.direction===this.initial.direction||null===this.initial.direction&&"ASC"===this.column.direction))},reset:function(){this.initial&&(this.initial.isset?this.sort(this.initial.column,this.initial.direction):(this.column&&(this.column.$el.removeClass("footable-asc footable-desc"),this.column=null),this.ft.rows.all=this.initial.rows,this.ft.draw()))},_sort:function(c,d){if(!this.allowed)return a.Deferred().reject("sorting disabled");var e=this,f=new b.Sorter(e.ft.columns.get(c),b.Sorting.dir(d));return e.ft.raise("before.ft.sorting",[f]).then(function(){return b.arr.each(e.ft.columns.array,function(a){a!=e.column&&(a.direction=null)}),e.column=e.ft.columns.get(f.column),e.column&&(e.column.direction=b.Sorting.dir(f.direction)),e.ft.draw().then(function(){e.ft.raise("after.ft.sorting",[f])})})},_onSortClicked:function(b){var c=b.data.self,d=a(this).closest("th,td"),e=d.is(".footable-asc, .footable-desc")?d.hasClass("footable-desc")?"ASC":"DESC":"ASC";c._sort(d.index(),e)}}),b.Sorting.dir=function(a){return!b.is.string(a)||"ASC"!=a&&"DESC"!=a?"ASC":a},b.components.register("sorting",b.Sorting,600)}(jQuery,FooTable),function(a){a.Cell.prototype.sortValue=null,a.Cell.prototype.__sorting_define__=function(a){this.sortValue=this.column.sortValue.call(this.column,a)},a.Cell.prototype.__sorting_val__=function(b){a.is.defined(b)&&(this.sortValue=this.column.sortValue.call(this.column,b))},a.Cell.extend("define",function(a){this._super(a),this.__sorting_define__(a)}),a.Cell.extend("val",function(a,b,c){var d=this._super(a,b,c);return this.__sorting_val__(a),d})}(FooTable),function(a,b){b.Column.prototype.direction=null,b.Column.prototype.sortable=!0,b.Column.prototype.sorted=!1,b.Column.prototype.sorter=function(a,b){return"string"==typeof a&&(a=a.toLowerCase()),"string"==typeof b&&(b=b.toLowerCase()),a===b?0:b>a?-1:1},b.Column.prototype.sortValue=function(c){if(b.is.element(c)||b.is.jq(c)){var d=a(c).data("sortValue");return b.is.defined(d)?d:this.parser(c)}if(b.is.hash(c)&&b.is.hash(c.options)){if(b.is.string(c.options.sortValue))return c.options.sortValue;b.is.defined(c.value)&&(c=c.value)}return b.is.defined(c)&&null!=c?c:null},b.Column.prototype.__sorting_define__=function(a){this.sorter=b.checkFnValue(this,a.sorter,this.sorter),this.direction=b.is.type(a.direction,"string")?b.Sorting.dir(a.direction):null,this.sortable=b.is["boolean"](a.sortable)?a.sortable:!0,this.sorted=b.is["boolean"](a.sorted)?a.sorted:!1,this.sortValue=b.checkFnValue(this,a.sortValue,this.sortValue)},b.Column.extend("define",function(a){this._super(a),this.__sorting_define__(a)})}(jQuery,FooTable),function(a){a.Defaults.prototype.sorting={enabled:!1}}(FooTable),function(a,b){b.HTMLColumn.extend("__sorting_define__",function(c){this._super(c),this.sortUse=b.is.string(c.sortUse)&&-1!==a.inArray(c.sortUse,["html","text"])?c.sortUse:"html"}),b.HTMLColumn.prototype.sortValue=function(c){if(b.is.element(c)||b.is.jq(c)){var d=a(c).data("sortValue");return b.is.defined(d)?d:this.parser(c)}if(b.is.hash(c)&&b.is.hash(c.options)){if(b.is.string(c.options.sortValue))return c.options.sortValue;b.is.defined(c.value)&&(c=c.value)}return b.is.defined(c)&&null!=c?c:null}}(jQuery,FooTable),function(a,b){b.NumberColumn.prototype.sortValue=function(c){if(b.is.element(c)||b.is.jq(c)){var d=a(c).data("sortValue");return b.is.number(d)?d:this.parser(c)}if(b.is.hash(c)&&b.is.hash(c.options)){if(b.is.string(c.options.sortValue))return this.parser(c);if(b.is.number(c.options.sortValue))return c.options.sortValue;if(b.is.number(c.value))return c.value}return b.is.string(c)?this.parser(c):b.is.number(c)?c:null}}(jQuery,FooTable),function(a){a.Table.prototype.sort=function(b,c){return this.use(a.Sorting).sort(b,c)}}(FooTable);
--------------------------------------------------------------------------------
/compiled/footable.state.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * FooTable v3 - FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.
3 | * @version 3.1.6
4 | * @link http://fooplugins.com
5 | * @copyright Steven Usher & Brad Vincent 2015
6 | * @license Released under the GPLv3 license.
7 | */
8 | !function(a,b){var c=0,d=function(a){var b,c,d=2166136261;for(b=0,c=a.length;c>b;b++)d^=a.charCodeAt(b),d+=(d<<1)+(d<<4)+(d<<7)+(d<<8)+(d<<24);return d>>>0}(location.origin+location.pathname);b.State=b.Component.extend({construct:function(a){this._super(a,a.o.state.enabled),this._key="1",this.key=this._key+(b.is.string(a.o.state.key)?a.o.state.key:this._uid()),this.filtering=b.is["boolean"](a.o.state.filtering)?a.o.state.filtering:!0,this.paging=b.is["boolean"](a.o.state.paging)?a.o.state.paging:!0,this.sorting=b.is["boolean"](a.o.state.sorting)?a.o.state.sorting:!0},preinit:function(a){var c=this;this.ft.raise("preinit.ft.state",[a]).then(function(){c.enabled=b.is["boolean"](a.state)?a.state:c.enabled,c.enabled&&(c.key=c._key+(b.is.string(a.stateKey)?a.stateKey:c.key),c.filtering=b.is["boolean"](a.stateFiltering)?a.stateFiltering:c.filtering,c.paging=b.is["boolean"](a.statePaging)?a.statePaging:c.paging,c.sorting=b.is["boolean"](a.stateSorting)?a.stateSorting:c.sorting)},function(){c.enabled=!1})},get:function(a){return JSON.parse(localStorage.getItem(this.key+":"+a))},set:function(a,b){localStorage.setItem(this.key+":"+a,JSON.stringify(b))},remove:function(a){localStorage.removeItem(this.key+":"+a)},read:function(){this.ft.execute(!1,!0,"readState")},write:function(){this.ft.execute(!1,!0,"writeState")},clear:function(){this.ft.execute(!1,!0,"clearState")},_uid:function(){var a=this.ft.$el.attr("id");return d+"_"+(b.is.string(a)?a:++c)}}),b.components.register("state",b.State,700)}(jQuery,FooTable),function(a){a.Component.prototype.readState=function(){},a.Component.prototype.writeState=function(){},a.Component.prototype.clearState=function(){}}(FooTable),function(a){a.Defaults.prototype.state={enabled:!1,filtering:!0,paging:!0,sorting:!0,key:null}}(FooTable),function(a){a.Filtering&&(a.Filtering.prototype.readState=function(){if(this.ft.state.filtering){var b=this.ft.state.get("filtering");a.is.hash(b)&&!a.is.emptyArray(b.filters)&&(this.filters=this.ensure(b.filters))}},a.Filtering.prototype.writeState=function(){if(this.ft.state.filtering){var b=a.arr.map(this.filters,function(b){return{name:b.name,query:b.query instanceof a.Query?b.query.val():b.query,columns:a.arr.map(b.columns,function(a){return a.name}),hidden:b.hidden,space:b.space,connectors:b.connectors,ignoreCase:b.ignoreCase}});this.ft.state.set("filtering",{filters:b})}},a.Filtering.prototype.clearState=function(){this.ft.state.filtering&&this.ft.state.remove("filtering")})}(FooTable),function(a){a.Paging&&(a.Paging.prototype.readState=function(){if(this.ft.state.paging){var b=this.ft.state.get("paging");a.is.hash(b)&&(this.current=b.current,this.size=b.size)}},a.Paging.prototype.writeState=function(){this.ft.state.paging&&this.ft.state.set("paging",{current:this.current,size:this.size})},a.Paging.prototype.clearState=function(){this.ft.state.paging&&this.ft.state.remove("paging")})}(FooTable),function(a){a.Sorting&&(a.Sorting.prototype.readState=function(){if(this.ft.state.sorting){var b=this.ft.state.get("sorting");if(a.is.hash(b)){var c=this.ft.columns.get(b.column);c instanceof a.Column&&(this.column=c,this.column.direction=b.direction)}}},a.Sorting.prototype.writeState=function(){this.ft.state.sorting&&this.column instanceof a.Column&&this.ft.state.set("sorting",{column:this.column.name,direction:this.column.direction})},a.Sorting.prototype.clearState=function(){this.ft.state.sorting&&this.ft.state.remove("sorting")})}(FooTable),function(a){a.Table.extend("_construct",function(a){return this.state=this.use(FooTable.State),this._super(a)}),a.Table.extend("_preinit",function(){var a=this;return a._super().then(function(){a.state.enabled&&a.state.read()})}),a.Table.extend("draw",function(){var a=this;return a._super().then(function(){a.state.enabled&&a.state.write()})})}(FooTable);
--------------------------------------------------------------------------------
/docs/content/columns.json:
--------------------------------------------------------------------------------
1 | [
2 | {"name":"id","title":"ID","breakpoints":"xs sm","type":"number","style":{"width":80,"maxWidth":80}},
3 | {"name":"firstName","title":"First Name"},
4 | {"name":"lastName","title":"Last Name"},
5 | {"name":"something","title":"Never seen but always around","visible":false,"filterable":false},
6 | {"name":"jobTitle","title":"Job Title","breakpoints":"xs sm","style":{"maxWidth":200,"overflow":"hidden","textOverflow":"ellipsis","wordBreak":"keep-all","whiteSpace":"nowrap"}},
7 | {"name":"started","title":"Started On","type":"date","breakpoints":"xs sm md","formatString":"MMM YYYY"},
8 | {"name":"dob","title":"Date of Birth","type":"date","breakpoints":"xs sm md","formatString":"DD MMM YYYY"},
9 | {"name":"status","title":"Status"}
10 | ]
--------------------------------------------------------------------------------
/docs/css/docs.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 70px;
3 | padding-bottom: 300px;
4 | }
5 | .anchored {
6 | position: relative;
7 | }
8 |
9 | .anchored span.anchor {
10 | position: absolute;
11 | width: 1px;
12 | height: 1px;
13 | top: -70px;
14 | visibility: hidden;
15 | }
16 |
17 | .docs-section {}
18 |
19 | .docs .tab-content {
20 | padding: 15px;
21 | }
22 |
23 | .callout {
24 | padding: 20px;
25 | margin: 20px 0;
26 | border: 1px solid #eee;
27 | border-left-width: 5px;
28 | border-radius: 3px;
29 | }
30 | .callout-warning {
31 | border-left-color: #aa6708;
32 | }
33 | .callout-warning h4 {
34 | color: #aa6708;
35 | }
36 | .callout-info {
37 | border-left-color: #1b809e;
38 | }
39 | .callout-info h4 {
40 | color: #1b809e;
41 | }
42 |
43 | .docs pre {
44 | word-wrap: normal;
45 | }
46 | .docs code[class*="language-"],
47 | .docs pre[class*="language-"] {
48 | color: inherit;
49 | text-shadow: none;
50 | padding: 0;
51 | }
52 | .docs code[class*="language-"] {
53 | padding: 10px;
54 | }
55 | .docs :not(pre) > code[class*="language-"],
56 | .docs pre[class*="language-"] {
57 | background: #f5f5f5;
58 | }
59 | .docs .token.tab:not(:empty):before,
60 | .docs .token.cr:before,
61 | .docs .token.lf:before {
62 | color: #f5f5f5;
63 | }
64 |
65 | .breakpoint-table td {
66 | text-align: center;
67 | }
68 | .breakpoint-table th small {
69 | display: block;
70 | font-weight: 400;
71 | color: #999;
72 | }
73 | .breakpoint-table td.is-visible {
74 | color: #468847;
75 | background-color: #dff0d8!important;
76 | }
77 | .breakpoint-table td.is-hidden {
78 | color: #ccc;
79 | background-color: #f9f9f9!important;
80 | }
81 | .list li {
82 | margin-bottom: 10px;
83 | }
84 | .list li > a,
85 | .list li > h4 {
86 | display: block;
87 | font-size: 18px;
88 | text-decoration: none;
89 | margin: 0;
90 | }
91 | .list li > small {
92 | display: block;
93 | font-weight: 400;
94 | color: #999;
95 | text-decoration: none;
96 | margin-top: 5px;
97 | }
98 | .example {
99 | position: relative;
100 | padding: 45px 15px 15px;
101 | margin-right: 0;
102 | margin-left: 0;
103 | margin-bottom: 30px;
104 | background-color: #fff;
105 | border: solid 1px #ddd;
106 | border-radius: 4px 4px 0 0;
107 | -webkit-box-shadow: none;
108 | box-shadow: none;
109 | }
110 | .example:after {
111 | position: absolute;
112 | top: 15px;
113 | left: 15px;
114 | font-size: 12px;
115 | font-weight: 700;
116 | color: #959595;
117 | text-transform: uppercase;
118 | letter-spacing: 1px;
119 | }
120 |
121 | .example:after { content: "Example"; }
122 | .example.plural:after { content: "Examples"; }
123 | .example.default:after { content: "Default"; }
124 | .example.returns:after { content: "Returns"; }
125 | .example.params:after { content: "Parameters"; }
126 | .example.supports:after { content: "Supports"; }
127 | .example.static:after { content: "Static Example"; }
128 | .example.static.plural:after { content: "Static Examples"; }
129 | .example.javascript:after { content: "JavaScript Example"; }
130 | .example.javascript.plural:after { content: "JavaScript Examples"; }
131 |
132 | .example+table,
133 | .example+pre+table,
134 | .example+pre.between,
135 | .example+table.between,
136 | .example+pre,
137 | .example+pre+pre {
138 | margin-top: -31px;
139 | margin-right: 0;
140 | margin-left: 0;
141 | border-width: 1px;
142 | }
143 | .example+table,
144 | .example+pre+table,
145 | .example+pre,
146 | .example+pre+pre {
147 | border-top-right-radius: 0;
148 | border-top-left-radius: 0;
149 | margin-bottom: 30px;
150 | }
151 | .example+table.between,
152 | .example+pre.between {
153 | border-radius: 0;
154 | }
155 |
156 | .examples {
157 | margin-bottom: 30px;
158 | }
159 | .examples > .example,
160 | .examples > table,
161 | .examples > div.list-group,
162 | .examples > pre,
163 | .examples > p {
164 | border: solid 1px #ddd;
165 | border-radius: 0;
166 | margin: -1px 0 0 0 !important;
167 | }
168 | .examples > div.list-group,
169 | .examples > pre,
170 | .examples > p {
171 | padding: 15px;
172 | }
173 | .examples > .example:first-child,
174 | .examples > table:first-child,
175 | .examples > div.list-group:first-child,
176 | .examples > pre:first-child,
177 | .examples > p:first-child {
178 | border-top-right-radius: 4px;
179 | border-top-left-radius: 4px;
180 | }
181 | .examples > .example:last-child,
182 | .examples > table:last-child,
183 | .examples > div.list-group:last-child,
184 | .examples > pre:last-child,
185 | .examples > p:last-child {
186 | border-bottom-right-radius: 4px;
187 | border-bottom-left-radius: 4px;
188 | }
189 |
190 |
191 | .docs-option {
192 | margin-bottom: 30px;
193 | }
194 | .docs-option > .docs-section {
195 | margin-left: 30px;
196 | }
197 |
198 | .list-group-detailed.child {
199 | margin-left: 30px;
200 | }
201 | .list-group-detailed.grand-child {
202 | margin-left: 60px;
203 | }
204 | .list-group-header {
205 | border: solid 1px #ddd;
206 | border-bottom: none;
207 | border-top-left-radius: 4px;
208 | border-top-right-radius: 4px;
209 | margin: 0;
210 | padding: 10px 15px;
211 | font-size: 20px;
212 | text-shadow: 0 -1px 0 #286090;
213 | background-image: -webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);
214 | background-image: -o-linear-gradient(top,#337ab7 0,#2b669a 100%);
215 | background-image: -webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));
216 | background-image: linear-gradient(to bottom,#337ab7 0,#2b669a 100%);
217 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
218 | background-repeat: repeat-x;
219 | border-color: #2b669a;
220 | color: #fff;
221 | background-color: #337ab7;
222 | }
223 | .list-group-header small {
224 | display: block;
225 | color: #FFF;
226 | margin-top: 5px;
227 | }
228 | .list-group-detail {
229 | border: solid 1px #ddd;
230 | border-bottom: none;
231 | border-top: none;
232 | border-radius: 0;
233 | padding: 0;
234 | margin: 0;
235 | max-height: 0;
236 | overflow: hidden;
237 | }
238 | .list-group-detail:last-child {
239 | border-bottom: solid 1px #ddd;
240 | border-bottom-left-radius: 4px;
241 | border-bottom-right-radius: 4px;
242 | }
243 | .list-group-detail.transitions {
244 | transition: all 0.5s ease-in-out;
245 | -webkit-transition: all 0.5s ease-in-out;
246 | -moz-transition: all 0.5s ease-in-out;
247 | }
248 | .list-group-detail-inner {
249 | overflow:auto;
250 | padding: 20px;
251 | }
252 |
253 | .align-center {
254 | text-align: center;
255 | }
256 |
257 | @media screen and (min-width: 480px) {
258 | .container .jumbotron, .container-fluid .jumbotron {
259 | padding-right: 30px;
260 | padding-left: 30px;
261 | }
262 | }
--------------------------------------------------------------------------------
/docs/css/index.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | width: 100%;
3 | height: 100%;
4 | margin: 0;
5 | padding: 0;
6 | background-color: #d9d9d9;
7 | color: #222;
8 | font: 400 14px/22px "merriweather";
9 | }
10 | #links {
11 | width: 100%;
12 | height: 40px;
13 | background-color: #2C3E50;
14 | color: #ffffff;
15 | }
16 | #links > a {
17 | color: #AFAFAF;
18 | text-decoration: none;
19 | display: inline-block;
20 | margin: 10px 10px;
21 | transition: color 0.3s ease-in;
22 | }
23 | #links > a:hover {
24 | color: #ffffff;
25 | }
26 | #header {
27 | width: 100%;
28 | height: 565px;
29 | text-align: center;
30 | }
31 | #header.demo {
32 | width: 100%;
33 | height: 100px;
34 | text-align: center;
35 | }
36 | #header > img {
37 | margin-top: 40px;
38 | }
39 | #header > h1 {
40 | font: bold 100px/1 "oswald";
41 | margin: 40px 0 20px 0;
42 | }
43 | #header > h2 {
44 | font: bold 48px/1 "oswald";
45 | margin: 10px 0;
46 | }
47 | #header.demo > h2 {
48 | margin: 40px 0 20px 0;
49 | }
50 | #header > h3 {
51 | font: normal 14px/16px "pt mono";
52 | }
53 | #content {
54 | width: 80%;
55 | margin: 0 auto;
56 | }
57 | #content > h1 {
58 | font: 700 30px/34px "pt sans narrow";
59 | }
60 | #content > h2 {
61 | font: 700 22px/26px "pt sans";
62 | }
63 | #content > h3 {
64 | font: 700 18px/22px "pt sans";
65 | }
66 | #content > ul {
67 | list-style-type: disc;
68 | }
69 | #content a {
70 | text-decoration: none;
71 | color: #525986;
72 | }
73 | #content a:hover {
74 | text-decoration: underline;
75 | }
76 | #content pre {
77 | background-color: #ffffff;
78 | padding: 0;
79 | border-radius: 6px;
80 | }
81 | #content pre > code {
82 | padding: 10px;
83 | }
84 | #content pre > code > .token.tab:not(:empty):before,
85 | #content pre > code > .token.cr:before,
86 | #content pre > code > .token.lf:before {
87 | color: #ffffff;
88 | }
89 | #footer {
90 | width: 100%;
91 | height: 300px;
92 | background-color: #2C3E50;
93 | margin-top: 100px;
94 | color: #ffffff;
95 | }
96 | #share-buttons {
97 | text-align: center;
98 | }
99 |
100 | #share-buttons img {
101 | width: 35px;
102 | padding: 5px;
103 | border: 0;
104 | box-shadow: 0;
105 | display: inline;
106 | }
--------------------------------------------------------------------------------
/docs/css/prism.css:
--------------------------------------------------------------------------------
1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+css-extras+clike+javascript+java+php+php-extras+coffeescript+scss+bash+c+cpp+python+sql+groovy+http+ruby+gherkin+csharp+go+nsis+aspnet&plugins=line-highlight+line-numbers+show-invisibles+autolinker+wpd+file-highlight+show-language */
2 | /**
3 | * prism.js default theme for JavaScript, CSS and HTML
4 | * Based on dabblet (http://dabblet.com)
5 | * @author Lea Verou
6 | */
7 |
8 | code[class*="language-"],
9 | pre[class*="language-"] {
10 | color: black;
11 | text-shadow: 0 1px white;
12 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
13 | direction: ltr;
14 | text-align: left;
15 | white-space: pre;
16 | word-spacing: normal;
17 | word-break: normal;
18 |
19 |
20 | -moz-tab-size: 4;
21 | -o-tab-size: 4;
22 | tab-size: 4;
23 |
24 | -webkit-hyphens: none;
25 | -moz-hyphens: none;
26 | -ms-hyphens: none;
27 | hyphens: none;
28 | }
29 |
30 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
31 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
32 | text-shadow: none;
33 | background: #b3d4fc;
34 | }
35 |
36 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
37 | code[class*="language-"]::selection, code[class*="language-"] ::selection {
38 | text-shadow: none;
39 | background: #b3d4fc;
40 | }
41 |
42 | @media print {
43 | code[class*="language-"],
44 | pre[class*="language-"] {
45 | text-shadow: none;
46 | }
47 | }
48 |
49 | /* Code blocks */
50 | pre[class*="language-"] {
51 | padding: 1em;
52 | margin: .5em 0;
53 | overflow: auto;
54 | }
55 |
56 | :not(pre) > code[class*="language-"],
57 | pre[class*="language-"] {
58 | background: #f5f2f0;
59 | }
60 |
61 | /* Inline code */
62 | :not(pre) > code[class*="language-"] {
63 | padding: .1em;
64 | border-radius: .3em;
65 | }
66 |
67 | .token.comment,
68 | .token.prolog,
69 | .token.doctype,
70 | .token.cdata {
71 | color: slategray;
72 | }
73 |
74 | .token.punctuation {
75 | color: #999;
76 | }
77 |
78 | .namespace {
79 | opacity: .7;
80 | }
81 |
82 | .token.property,
83 | .token.tag,
84 | .token.boolean,
85 | .token.number,
86 | .token.constant,
87 | .token.symbol {
88 | color: #905;
89 | }
90 |
91 | .token.selector,
92 | .token.attr-name,
93 | .token.string,
94 | .token.builtin {
95 | color: #690;
96 | }
97 |
98 | .token.operator,
99 | .token.entity,
100 | .token.url,
101 | .language-css .token.string,
102 | .style .token.string,
103 | .token.variable {
104 | color: #a67f59;
105 | background: hsla(0,0%,100%,.5);
106 | }
107 |
108 | .token.atrule,
109 | .token.attr-value,
110 | .token.keyword {
111 | color: #07a;
112 | }
113 |
114 |
115 | .token.regex,
116 | .token.important {
117 | color: #e90;
118 | }
119 |
120 | .token.important {
121 | font-weight: bold;
122 | }
123 |
124 | .token.entity {
125 | cursor: help;
126 | }
127 |
128 | pre[data-line] {
129 | position: relative;
130 | padding: 1em 0 1em 3em;
131 | }
132 |
133 | .line-highlight {
134 | position: absolute;
135 | left: 0;
136 | right: 0;
137 | padding: inherit 0;
138 | margin-top: 1em; /* Same as .prism’s padding-top */
139 |
140 | background: hsla(24, 20%, 50%,.08);
141 | background: -moz-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
142 | background: -webkit-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
143 | background: -o-linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
144 | background: linear-gradient(left, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
145 |
146 | pointer-events: none;
147 |
148 | line-height: inherit;
149 | white-space: pre;
150 | }
151 |
152 | .line-highlight:before,
153 | .line-highlight[data-end]:after {
154 | content: attr(data-start);
155 | position: absolute;
156 | top: .4em;
157 | left: .6em;
158 | min-width: 1em;
159 | padding: 0 .5em;
160 | background-color: hsla(24, 20%, 50%,.4);
161 | color: hsl(24, 20%, 95%);
162 | font: bold 65%/1.5 sans-serif;
163 | text-align: center;
164 | vertical-align: .3em;
165 | border-radius: 999px;
166 | text-shadow: none;
167 | box-shadow: 0 1px white;
168 | }
169 |
170 | .line-highlight[data-end]:after {
171 | content: attr(data-end);
172 | top: auto;
173 | bottom: .4em;
174 | }
175 | pre.line-numbers {
176 | position: relative;
177 | padding-left: 3.8em;
178 | counter-reset: linenumber;
179 | }
180 |
181 | pre.line-numbers > code {
182 | position: relative;
183 | }
184 |
185 | .line-numbers .line-numbers-rows {
186 | position: absolute;
187 | pointer-events: none;
188 | top: 0;
189 | font-size: 100%;
190 | left: -3.8em;
191 | width: 3em; /* works for line-numbers below 1000 lines */
192 | letter-spacing: -1px;
193 | border-right: 1px solid #999;
194 |
195 | -webkit-user-select: none;
196 | -moz-user-select: none;
197 | -ms-user-select: none;
198 | user-select: none;
199 |
200 | }
201 |
202 | .line-numbers-rows > span {
203 | pointer-events: none;
204 | display: block;
205 | counter-increment: linenumber;
206 | }
207 |
208 | .line-numbers-rows > span:before {
209 | content: counter(linenumber);
210 | color: #999;
211 | display: block;
212 | padding-right: 0.8em;
213 | text-align: right;
214 | }
215 | .token.tab:not(:empty):before,
216 | .token.cr:before,
217 | .token.lf:before {
218 | color: hsl(24, 20%, 85%);
219 | }
220 |
221 | .token.tab:not(:empty):before {
222 | content: 'â–¸';
223 | }
224 |
225 | .token.cr:before {
226 | content: 'â';
227 | }
228 |
229 | .token.lf:before {
230 | content: 'âŠ';
231 | }
232 | .token a {
233 | color: inherit;
234 | }
235 | code[class*="language-"] a[href],
236 | pre[class*="language-"] a[href] {
237 | cursor: help;
238 | text-decoration: none;
239 | }
240 |
241 | code[class*="language-"] a[href]:hover,
242 | pre[class*="language-"] a[href]:hover {
243 | cursor: help;
244 | text-decoration: underline;
245 | }
246 | pre[class*='language-'] {
247 | position: relative;
248 | }
249 | pre[class*='language-'] > code[data-language] {
250 | overflow: auto;
251 | max-height: 28em;
252 | display: block;
253 | }
254 | pre[class*='language-'] > code[data-language]::before {
255 | content: attr(data-language);
256 | color: black;
257 | background-color: #CFCFCF;
258 | display: inline-block;
259 | position: absolute;
260 | top: 0;
261 | right: 0;
262 | font-size: 0.9em;
263 | border-radius: 0 0 0 5px;
264 | padding: 0 0.5em;
265 | text-shadow: none;
266 | }
--------------------------------------------------------------------------------
/docs/examples/bootstrap/collapse.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Collapse - FooTable
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
69 |
70 |
71 |
72 |
73 |
74 |
Collapse
75 | Shows using FooTable with Bootstraps' collapse component.
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
Notes
85 |
86 | This example makes use of Bootstraps' collapse component .
87 |
88 | The base table in the example below is a clone of the showcase example to demonstrate that various table operations
89 | such as filtering, sorting, paging still function correctly.
90 |
91 |
92 |
93 |
94 |
95 |
96 | Click to toggle
97 |
98 |
101 |
102 |
jQuery(function($){
103 | $('#collapse-example-1').footable({
104 | "columns": $.get('columns.json'),
105 | "rows": $.get('rows.json')
106 | });
107 | });
108 |
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
109 | Click to toggle
110 | </button>
111 | <div class="collapse" id="collapseExample">
112 | <table id="collapse-example-1" class="table" data-paging="true" data-filtering="true" data-sorting="true"></table>
113 | </div>
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
138 |
139 |
--------------------------------------------------------------------------------
/docs/examples/component/paging.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Paging rows - FooTable
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
69 |
70 |
71 |
72 |
73 |
74 |
Paging rows
75 | How to create a table that uses the paging component.
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
Notes
85 |
86 |
87 | We make use of two static files (columns.json and rows.json )
88 | to supply the below examples data.
89 |
90 |
91 | Using the paging component drastically improves the performance of the plugin on large numbers of rows.
92 |
93 |
94 |
95 |
96 |
97 | To enable paging on a table the only option that must be set is the enabled
option with a value of true
,
98 | all other options for the component will fall back to there defaults if not supplied.
99 | See the paging component documentation for a list of all available options.
100 |
101 |
102 |
105 |
jQuery(function($){
106 | $('.table').footable({
107 | "columns": $.get('columns.json'),
108 | "rows": $.get('rows.json')
109 | });
110 | });
111 |
<table class="table" data-paging="true"></table>
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
136 |
137 |
--------------------------------------------------------------------------------
/docs/js/docs.js:
--------------------------------------------------------------------------------
1 | (function($){
2 |
3 | $(function(){
4 |
5 | $('.list-group-detailed')
6 | .children('.list-group-detail').on('transitionEnd webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd', function(){
7 | var $this = $(this);
8 | if($this.hasClass('active')){
9 | $this.css('max-height', 9999);
10 | }
11 | }).end()
12 | .children('.list-group-item').on('click', function(e){
13 | e.preventDefault();
14 | var $item = $(this), $detail = $item.next();
15 | if ($detail.hasClass('list-group-detail')){
16 | $item.add($detail).toggleClass('active');
17 | $detail.contentHeight = $detail.outerHeight();
18 | if ($detail.hasClass('active')){
19 | $detail.contentHeight += $detail.children('.list-group-detail-inner').outerHeight();
20 | $detail.addClass('transitions').css({
21 | 'max-height': $detail.contentHeight
22 | });
23 | } else {
24 | $detail.removeClass('transitions').css('max-height', $detail.contentHeight);
25 | setTimeout(function(){
26 | $detail.addClass('transitions').css({
27 | 'max-height': 0
28 | });
29 | }, 10);
30 | }
31 | }
32 | });
33 |
34 | });
35 |
36 | })(jQuery);
--------------------------------------------------------------------------------
/docs/js/ie10-viewport-bug-workaround.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * IE10 viewport hack for Surface/desktop Windows 8 bug
3 | * Copyright 2014-2015 Twitter, Inc.
4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 | */
6 |
7 | // See the Getting Started docs for more information:
8 | // http://getbootstrap.com/getting-started/#support-ie10-width
9 |
10 | (function () {
11 | 'use strict';
12 |
13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
14 | var msViewportStyle = document.createElement('style');
15 | msViewportStyle.appendChild(
16 | document.createTextNode(
17 | '@-ms-viewport{width:auto!important}'
18 | )
19 | );
20 | document.querySelector('head').appendChild(msViewportStyle);
21 | }
22 |
23 | })();
--------------------------------------------------------------------------------
/docs/jsdocs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/docs/jsdocs/favicon.ico
--------------------------------------------------------------------------------
/docs/jsdocs/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/docs/jsdocs/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/docs/jsdocs/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/docs/jsdocs/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/docs/jsdocs/img/old-wall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/docs/jsdocs/img/old-wall.png
--------------------------------------------------------------------------------
/docs/jsdocs/scripts/bootstrap-dropdown.js:
--------------------------------------------------------------------------------
1 | /* ============================================================
2 | * bootstrap-dropdown.js v2.3.2
3 | * http://getbootstrap.com/2.3.2/javascript.html#dropdowns
4 | * ============================================================
5 | * Copyright 2013 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ============================================================ */
19 |
20 |
21 | !function ($) {
22 |
23 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* DROPDOWN CLASS DEFINITION
27 | * ========================= */
28 |
29 | var toggle = '[data-toggle=dropdown]'
30 | , Dropdown = function (element) {
31 | var $el = $(element).on('click.dropdown.data-api', this.toggle)
32 | $('html').on('click.dropdown.data-api', function () {
33 | $el.parent().removeClass('open')
34 | })
35 | }
36 |
37 | Dropdown.prototype = {
38 |
39 | constructor: Dropdown
40 |
41 | , toggle: function (e) {
42 | var $this = $(this)
43 | , $parent
44 | , isActive
45 |
46 | if ($this.is('.disabled, :disabled')) return
47 |
48 | $parent = getParent($this)
49 |
50 | isActive = $parent.hasClass('open')
51 |
52 | clearMenus()
53 |
54 | if (!isActive) {
55 | if ('ontouchstart' in document.documentElement) {
56 | // if mobile we we use a backdrop because click events don't delegate
57 | $('
').insertBefore($(this)).on('click', clearMenus)
58 | }
59 | $parent.toggleClass('open')
60 | }
61 |
62 | $this.focus()
63 |
64 | return false
65 | }
66 |
67 | , keydown: function (e) {
68 | var $this
69 | , $items
70 | , $active
71 | , $parent
72 | , isActive
73 | , index
74 |
75 | if (!/(38|40|27)/.test(e.keyCode)) return
76 |
77 | $this = $(this)
78 |
79 | e.preventDefault()
80 | e.stopPropagation()
81 |
82 | if ($this.is('.disabled, :disabled')) return
83 |
84 | $parent = getParent($this)
85 |
86 | isActive = $parent.hasClass('open')
87 |
88 | if (!isActive || (isActive && e.keyCode == 27)) {
89 | if (e.which == 27) $parent.find(toggle).focus()
90 | return $this.click()
91 | }
92 |
93 | $items = $('[role=menu] li:not(.divider):visible a', $parent)
94 |
95 | if (!$items.length) return
96 |
97 | index = $items.index($items.filter(':focus'))
98 |
99 | if (e.keyCode == 38 && index > 0) index-- // up
100 | if (e.keyCode == 40 && index < $items.length - 1) index++ // down
101 | if (!~index) index = 0
102 |
103 | $items
104 | .eq(index)
105 | .focus()
106 | }
107 |
108 | }
109 |
110 | function clearMenus() {
111 | $('.dropdown-backdrop').remove()
112 | $(toggle).each(function () {
113 | getParent($(this)).removeClass('open')
114 | })
115 | }
116 |
117 | function getParent($this) {
118 | var selector = $this.attr('data-target')
119 | , $parent
120 |
121 | if (!selector) {
122 | selector = $this.attr('href')
123 | selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
124 | }
125 |
126 | $parent = selector && $(selector)
127 |
128 | if (!$parent || !$parent.length) $parent = $this.parent()
129 |
130 | return $parent
131 | }
132 |
133 |
134 | /* DROPDOWN PLUGIN DEFINITION
135 | * ========================== */
136 |
137 | var old = $.fn.dropdown
138 |
139 | $.fn.dropdown = function (option) {
140 | return this.each(function () {
141 | var $this = $(this)
142 | , data = $this.data('dropdown')
143 | if (!data) $this.data('dropdown', (data = new Dropdown(this)))
144 | if (typeof option == 'string') data[option].call($this)
145 | })
146 | }
147 |
148 | $.fn.dropdown.Constructor = Dropdown
149 |
150 |
151 | /* DROPDOWN NO CONFLICT
152 | * ==================== */
153 |
154 | $.fn.dropdown.noConflict = function () {
155 | $.fn.dropdown = old
156 | return this
157 | }
158 |
159 |
160 | /* APPLY TO STANDARD DROPDOWN ELEMENTS
161 | * =================================== */
162 |
163 | $(document)
164 | .on('click.dropdown.data-api', clearMenus)
165 | .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
166 | .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
167 | .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
168 |
169 | }(window.jQuery);
170 |
--------------------------------------------------------------------------------
/docs/jsdocs/scripts/bootstrap-tab.js:
--------------------------------------------------------------------------------
1 | /* ========================================================
2 | * bootstrap-tab.js v2.3.0
3 | * http://twitter.github.com/bootstrap/javascript.html#tabs
4 | * ========================================================
5 | * Copyright 2012 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ======================================================== */
19 |
20 |
21 | !function ($) {
22 |
23 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* TAB CLASS DEFINITION
27 | * ==================== */
28 |
29 | var Tab = function (element) {
30 | this.element = $(element)
31 | }
32 |
33 | Tab.prototype = {
34 |
35 | constructor: Tab
36 |
37 | , show: function () {
38 | var $this = this.element
39 | , $ul = $this.closest('ul:not(.dropdown-menu)')
40 | , selector = $this.attr('data-target')
41 | , previous
42 | , $target
43 | , e
44 |
45 | if (!selector) {
46 | selector = $this.attr('href')
47 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
48 | }
49 |
50 | if ( $this.parent('li').hasClass('active') ) return
51 |
52 | previous = $ul.find('.active:last a')[0]
53 |
54 | e = $.Event('show', {
55 | relatedTarget: previous
56 | })
57 |
58 | $this.trigger(e)
59 |
60 | if (e.isDefaultPrevented()) return
61 |
62 | $target = $(selector)
63 |
64 | this.activate($this.parent('li'), $ul)
65 | this.activate($target, $target.parent(), function () {
66 | $this.trigger({
67 | type: 'shown'
68 | , relatedTarget: previous
69 | })
70 | })
71 | }
72 |
73 | , activate: function ( element, container, callback) {
74 | var $active = container.find('> .active')
75 | , transition = callback
76 | && $.support.transition
77 | && $active.hasClass('fade')
78 |
79 | function next() {
80 | $active
81 | .removeClass('active')
82 | .find('> .dropdown-menu > .active')
83 | .removeClass('active')
84 |
85 | element.addClass('active')
86 |
87 | if (transition) {
88 | element[0].offsetWidth // reflow for transition
89 | element.addClass('in')
90 | } else {
91 | element.removeClass('fade')
92 | }
93 |
94 | if ( element.parent('.dropdown-menu') ) {
95 | element.closest('li.dropdown').addClass('active')
96 | }
97 |
98 | callback && callback()
99 | }
100 |
101 | transition ?
102 | $active.one($.support.transition.end, next) :
103 | next()
104 |
105 | $active.removeClass('in')
106 | }
107 | }
108 |
109 |
110 | /* TAB PLUGIN DEFINITION
111 | * ===================== */
112 |
113 | var old = $.fn.tab
114 |
115 | $.fn.tab = function ( option ) {
116 | return this.each(function () {
117 | var $this = $(this)
118 | , data = $this.data('tab')
119 | if (!data) $this.data('tab', (data = new Tab(this)))
120 | if (typeof option == 'string') data[option]()
121 | })
122 | }
123 |
124 | $.fn.tab.Constructor = Tab
125 |
126 |
127 | /* TAB NO CONFLICT
128 | * =============== */
129 |
130 | $.fn.tab.noConflict = function () {
131 | $.fn.tab = old
132 | return this
133 | }
134 |
135 |
136 | /* TAB DATA-API
137 | * ============ */
138 |
139 | $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
140 | e.preventDefault()
141 | $(this).tab('show')
142 | })
143 |
144 | }(window.jQuery);
--------------------------------------------------------------------------------
/docs/jsdocs/scripts/prettify/lang-css.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([
2 | ["pln", /^[\t\n\f\r ]+/, null, " \t\r\n"]
3 | ], [
4 | ["str", /^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/, null],
5 | ["str", /^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/, null],
6 | ["lang-css-str", /^url\(([^"')]*)\)/i],
7 | ["kwd", /^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i, null],
8 | ["lang-css-kw", /^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],
9 | ["com", /^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],
10 | ["com", /^(?:<\!--|--\>)/],
11 | ["lit", /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
12 | ["lit", /^#[\da-f]{3,6}/i],
13 | ["pln", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],
14 | ["pun", /^[^\s\w"']+/]
15 | ]), ["css"]);
16 | PR.registerLangHandler(PR.createSimpleLexer([], [
17 | ["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]
18 | ]), ["css-kw"]);
19 | PR.registerLangHandler(PR.createSimpleLexer([], [
20 | ["str", /^[^"')]+/]
21 | ]), ["css-str"]);
--------------------------------------------------------------------------------
/docs/jsdocs/scripts/toc.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | $.fn.toc = function(options) {
3 | var self = this;
4 | var opts = $.extend({}, jQuery.fn.toc.defaults, options);
5 |
6 | var container = $(opts.container);
7 | var headings = $(opts.selectors, container);
8 | var headingOffsets = [];
9 | var activeClassName = opts.prefix+'-active';
10 |
11 | var scrollTo = function(e) {
12 | if (opts.smoothScrolling) {
13 | e.preventDefault();
14 | var elScrollTo = $(e.target).attr('href');
15 | var $el = $(elScrollTo);
16 |
17 | $('body,html').animate({ scrollTop: $el.offset().top }, 400, 'swing', function() {
18 | location.hash = elScrollTo;
19 | });
20 | }
21 | $('li', self).removeClass(activeClassName);
22 | $(e.target).parent().addClass(activeClassName);
23 | };
24 |
25 | //highlight on scroll
26 | var timeout;
27 | var highlightOnScroll = function(e) {
28 | if (timeout) {
29 | clearTimeout(timeout);
30 | }
31 | timeout = setTimeout(function() {
32 | var top = $(window).scrollTop(),
33 | highlighted;
34 | for (var i = 0, c = headingOffsets.length; i < c; i++) {
35 | if (headingOffsets[i] >= top) {
36 | $('li', self).removeClass(activeClassName);
37 | highlighted = $('li:eq('+(i-1)+')', self).addClass(activeClassName);
38 | opts.onHighlight(highlighted);
39 | break;
40 | }
41 | }
42 | }, 50);
43 | };
44 | if (opts.highlightOnScroll) {
45 | $(window).bind('scroll', highlightOnScroll);
46 | highlightOnScroll();
47 | }
48 |
49 | return this.each(function() {
50 | //build TOC
51 | var el = $(this);
52 | var ul = $('');
53 | headings.each(function(i, heading) {
54 | var $h = $(heading);
55 | headingOffsets.push($h.offset().top - opts.highlightOffset);
56 |
57 | //add anchor
58 | var anchor = $(' ').attr('id', opts.anchorName(i, heading, opts.prefix)).insertBefore($h);
59 |
60 | //build TOC item
61 | var a = $(' ')
62 | .text(opts.headerText(i, heading, $h))
63 | .attr('href', '#' + opts.anchorName(i, heading, opts.prefix))
64 | .bind('click', function(e) {
65 | scrollTo(e);
66 | el.trigger('selected', $(this).attr('href'));
67 | });
68 |
69 | var li = $(' ')
70 | .addClass(opts.itemClass(i, heading, $h, opts.prefix))
71 | .append(a);
72 |
73 | ul.append(li);
74 | });
75 | el.html(ul);
76 | });
77 | };
78 |
79 |
80 | jQuery.fn.toc.defaults = {
81 | container: 'body',
82 | selectors: 'h1,h2,h3',
83 | smoothScrolling: true,
84 | prefix: 'toc',
85 | onHighlight: function() {},
86 | highlightOnScroll: true,
87 | highlightOffset: 100,
88 | anchorName: function(i, heading, prefix) {
89 | return prefix+i;
90 | },
91 | headerText: function(i, heading, $heading) {
92 | return $heading.text();
93 | },
94 | itemClass: function(i, heading, $heading, prefix) {
95 | return prefix + '-' + $heading[0].tagName.toLowerCase();
96 | }
97 |
98 | };
99 |
100 | })(jQuery);
101 |
--------------------------------------------------------------------------------
/docs/jsdocs/styles/prettify-tomorrow.css:
--------------------------------------------------------------------------------
1 | /* Tomorrow Theme */
2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */
3 | /* Pretty printing styles. Used with prettify.js. */
4 | /* SPAN elements with the classes below are added by prettyprint. */
5 | /* plain text */
6 | .pln {
7 | color: #4d4d4c; }
8 |
9 | @media screen {
10 | /* string content */
11 | .str {
12 | color: #718c00; }
13 |
14 | /* a keyword */
15 | .kwd {
16 | color: #8959a8; }
17 |
18 | /* a comment */
19 | .com {
20 | color: #8e908c; }
21 |
22 | /* a type name */
23 | .typ {
24 | color: #4271ae; }
25 |
26 | /* a literal value */
27 | .lit {
28 | color: #f5871f; }
29 |
30 | /* punctuation */
31 | .pun {
32 | color: #4d4d4c; }
33 |
34 | /* lisp open bracket */
35 | .opn {
36 | color: #4d4d4c; }
37 |
38 | /* lisp close bracket */
39 | .clo {
40 | color: #4d4d4c; }
41 |
42 | /* a markup tag name */
43 | .tag {
44 | color: #c82829; }
45 |
46 | /* a markup attribute name */
47 | .atn {
48 | color: #f5871f; }
49 |
50 | /* a markup attribute value */
51 | .atv {
52 | color: #3e999f; }
53 |
54 | /* a declaration */
55 | .dec {
56 | color: #f5871f; }
57 |
58 | /* a variable name */
59 | .var {
60 | color: #c82829; }
61 |
62 | /* a function name */
63 | .fun {
64 | color: #4271ae; } }
65 | /* Use higher contrast and text-weight for printable form. */
66 | @media print, projection {
67 | .str {
68 | color: #060; }
69 |
70 | .kwd {
71 | color: #006;
72 | font-weight: bold; }
73 |
74 | .com {
75 | color: #600;
76 | font-style: italic; }
77 |
78 | .typ {
79 | color: #404;
80 | font-weight: bold; }
81 |
82 | .lit {
83 | color: #044; }
84 |
85 | .pun, .opn, .clo {
86 | color: #440; }
87 |
88 | .tag {
89 | color: #006;
90 | font-weight: bold; }
91 |
92 | .atn {
93 | color: #404; }
94 |
95 | .atv {
96 | color: #060; } }
97 | /* Style */
98 | /*
99 | pre.prettyprint {
100 | background: white;
101 | font-family: Menlo, Monaco, Consolas, monospace;
102 | font-size: 12px;
103 | line-height: 1.5;
104 | border: 1px solid #ccc;
105 | padding: 10px; }
106 | */
107 |
108 | /* Specify class=linenums on a pre to get line numbering */
109 | ol.linenums {
110 | margin-top: 0;
111 | margin-bottom: 0; }
112 |
113 | /* IE indents via margin-left */
114 | li.L0,
115 | li.L1,
116 | li.L2,
117 | li.L3,
118 | li.L4,
119 | li.L5,
120 | li.L6,
121 | li.L7,
122 | li.L8,
123 | li.L9 {
124 | /* */ }
125 |
126 | /* Alternate shading for lines */
127 | li.L1,
128 | li.L3,
129 | li.L5,
130 | li.L7,
131 | li.L9 {
132 | /* */ }
133 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | FooTable - A jQuery Responsive Table
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
FooTable
73 |
A responsive table plugin built on jQuery and made for Bootstrap.
74 |
Fear not, it also works without Bootstrap!
75 |
76 | Download FooTable
77 |
78 |
79 |
80 |
81 |
82 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
116 |
117 |
--------------------------------------------------------------------------------
/jsdoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "tags": {
3 | "allowUnknownTags": true
4 | },
5 | "source": {
6 | "includePattern": ".+\\.js(doc)?$",
7 | "excludePattern": "(^|\\/|\\\\)_"
8 | },
9 | "plugins": [],
10 | "templates": {
11 | "cleverLinks": false,
12 | "monospaceLinks": false,
13 | "default": {
14 | "outputSourceFiles": true
15 | },
16 | "systemName" : "FooTable V3",
17 | "footer" : "",
18 | "copyright" : "Copyright © 2016",
19 | "navType" : "vertical",
20 | "theme" : "oblivion",
21 | "linenums" : true,
22 | "collapseSymbols" : false,
23 | "inverseNav" : true
24 | }
25 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "footable",
3 | "title": "FooTable v3",
4 | "description": "FooTable is a jQuery plugin that aims to make HTML tables on smaller devices look awesome.",
5 | "version": "3.1.6",
6 | "homepage": "http://fooplugins.com",
7 | "author": {
8 | "name": "FooPlugins",
9 | "url": "http://fooplugins.com"
10 | },
11 | "contributors": [
12 | {
13 | "name": "Steven Usher",
14 | "email": "steveush@gmail.com",
15 | "url": "https://github.com/steveush"
16 | },
17 | {
18 | "name": "Brad Vincent",
19 | "email": "bradvin@gmail.com",
20 | "url": "http://themergency.com"
21 | }
22 | ],
23 | "repository": {
24 | "type": "git",
25 | "url": "https://github.com/fooplugins/footable.git"
26 | },
27 | "scripts": {
28 | "test": "grunt test"
29 | },
30 | "keywords": [
31 | "jquery",
32 | "table",
33 | "responsive"
34 | ],
35 | "dependencies": {
36 | "grunt": "^0.4.1",
37 | "grunt-contrib-clean": "^0.4.1",
38 | "grunt-contrib-compress": "^0.13.0",
39 | "grunt-contrib-concat": "^0.3.0",
40 | "grunt-contrib-copy": "^0.8.2",
41 | "grunt-contrib-cssmin": "^0.14.0",
42 | "grunt-contrib-uglify": "^0.11.0",
43 | "jsdoc": "^3.4.1",
44 | "grunt-jsdoc": "^1.1.0",
45 | "jsdoc-oblivion": "0.0.4"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/releases/footable-bootstrap.latest.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.latest.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.0.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.1.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.10.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.10.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.11.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.11.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.2.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.3.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.4.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.5.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.6.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.7.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.7.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.8.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.0.9.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.0.9.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.0.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.1.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.2.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.3.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.4.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.5.zip
--------------------------------------------------------------------------------
/releases/footable-bootstrap.v3.1.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-bootstrap.v3.1.6.zip
--------------------------------------------------------------------------------
/releases/footable-components.latest.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.latest.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.0.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.1.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.10.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.10.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.11.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.11.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.2.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.3.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.4.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.5.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.6.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.7.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.7.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.8.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.0.9.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.0.9.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.0.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.1.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.2.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.3.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.4.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.5.zip
--------------------------------------------------------------------------------
/releases/footable-components.v3.1.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-components.v3.1.6.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.latest.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.latest.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.0.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.1.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.10.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.10.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.11.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.11.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.2.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.3.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.4.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.5.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.6.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.7.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.7.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.8.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.8.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.0.9.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.0.9.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.0.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.1.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.2.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.3.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.3.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.4.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.5.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.5.zip
--------------------------------------------------------------------------------
/releases/footable-standalone.v3.1.6.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fooplugins/FooTable/fba11d1d8ad4eb61913c7538b26283eab2d9d777/releases/footable-standalone.v3.1.6.zip
--------------------------------------------------------------------------------
/src/css/FooTable.FontAwesome.css:
--------------------------------------------------------------------------------
1 | /* FontAwesome Icons - We're not actually using FontAwesome classes but instead provide a simple mapping from FontAwesome to FooTable class names. */
2 | .fooicon {
3 | display: inline-block;
4 | font-size: inherit;
5 | font-family: FontAwesome !important;
6 | font-style: normal;
7 | font-weight: 400;
8 | line-height: 1;
9 | text-rendering: auto;
10 | -webkit-font-smoothing: antialiased;
11 | -moz-osx-font-smoothing: grayscale;
12 | transform: translate(0, 0);
13 | }
14 | .fooicon:before,
15 | .fooicon:after {
16 | -webkit-box-sizing: border-box;
17 | -moz-box-sizing: border-box;
18 | box-sizing: border-box;
19 | }
20 | .fooicon-loader:before {
21 | content: "\f01e";
22 | }
23 | .fooicon-plus:before {
24 | content: "\f067";
25 | }
26 | .fooicon-minus:before {
27 | content: "\f068";
28 | }
29 | .fooicon-search:before {
30 | content: "\f002";
31 | }
32 | .fooicon-remove:before {
33 | content: "\f00d";
34 | }
35 | .fooicon-sort:before {
36 | content: "\f0dc";
37 | }
38 | .fooicon-sort-asc:before {
39 | content: "\f160";
40 | }
41 | .fooicon-sort-desc:before {
42 | content: "\f161";
43 | }
44 | .fooicon-pencil:before {
45 | content: "\f040";
46 | }
47 | .fooicon-trash:before {
48 | content: "\f1f8";
49 | }
50 | .fooicon-eye-close:before {
51 | content: "\f070";
52 | }
53 | .fooicon-flash:before {
54 | content: "\f0e7";
55 | }
56 | .fooicon-cog:before {
57 | content: "\f013";
58 | }
59 | .fooicon-stats:before {
60 | content: "\f080";
61 | }
62 |
--------------------------------------------------------------------------------
/src/css/FooTable.Glyphicons.css:
--------------------------------------------------------------------------------
1 | /* Glyphicons Icons - We're not actually using Glyphicons classes but instead provide a simple mapping from Glyphicons to FooTable class names. */
2 | .fooicon {
3 | position: relative;
4 | top: 1px;
5 | display: inline-block;
6 | font-family: 'Glyphicons Halflings' !important;
7 | font-style: normal;
8 | font-weight: 400;
9 | line-height: 1;
10 | -webkit-font-smoothing: antialiased;
11 | -moz-osx-font-smoothing: grayscale;
12 | }
13 | .fooicon:before,
14 | .fooicon:after {
15 | -webkit-box-sizing: border-box;
16 | -moz-box-sizing: border-box;
17 | box-sizing: border-box;
18 | }
19 | .fooicon-loader:before {
20 | content: "\e030";
21 | }
22 | .fooicon-plus:before {
23 | content: "\2b";
24 | }
25 | .fooicon-minus:before {
26 | content: "\2212";
27 | }
28 | .fooicon-search:before {
29 | content: "\e003";
30 | }
31 | .fooicon-remove:before {
32 | content: "\e014";
33 | }
34 | .fooicon-sort:before {
35 | content: "\e150";
36 | }
37 | .fooicon-sort-asc:before {
38 | content: "\e155";
39 | }
40 | .fooicon-sort-desc:before {
41 | content: "\e156";
42 | }
43 | .fooicon-pencil:before {
44 | content: "\270f";
45 | }
46 | .fooicon-trash:before {
47 | content: "\e020";
48 | }
49 | .fooicon-eye-close:before {
50 | content: "\e106";
51 | }
52 | .fooicon-flash:before {
53 | content: "\e162";
54 | }
55 | .fooicon-cog:before {
56 | content: "\e019";
57 | }
58 | .fooicon-stats:before {
59 | content: "\e185";
60 | }
61 |
--------------------------------------------------------------------------------
/src/css/FooTable.css:
--------------------------------------------------------------------------------
1 | table.footable,
2 | table.footable-details {
3 | position: relative;
4 | width: 100%;
5 | border-spacing: 0;
6 | border-collapse: collapse;
7 | }
8 | table.footable-details {
9 | margin-bottom: 0;
10 | }
11 | table.footable-hide-fouc {
12 | display: none;
13 | }
14 | table > tbody > tr > td > span.footable-toggle {
15 | margin-right: 8px;
16 | opacity: 0.3;
17 | }
18 | table > tbody > tr > td > span.footable-toggle.last-column {
19 | margin-left: 8px;
20 | float: right;
21 | }
22 | table.table-condensed > tbody > tr > td > span.footable-toggle {
23 | margin-right: 5px;
24 | }
25 | table.footable-details > tbody > tr > th:nth-child(1) {
26 | min-width: 40px;
27 | width: 120px;
28 | }
29 | table.footable-details > tbody > tr > td:nth-child(2) {
30 | word-break: break-all;
31 | }
32 |
33 | table.footable-details > thead > tr:first-child > th,
34 | table.footable-details > thead > tr:first-child > td,
35 | table.footable-details > tbody > tr:first-child > th,
36 | table.footable-details > tbody > tr:first-child > td,
37 | table.footable-details > tfoot > tr:first-child > th,
38 | table.footable-details > tfoot > tr:first-child > td {
39 | border-top-width: 0;
40 | }
41 | table.footable-details.table-bordered > thead > tr:first-child > th,
42 | table.footable-details.table-bordered > thead > tr:first-child > td,
43 | table.footable-details.table-bordered > tbody > tr:first-child > th,
44 | table.footable-details.table-bordered > tbody > tr:first-child > td,
45 | table.footable-details.table-bordered > tfoot > tr:first-child > th,
46 | table.footable-details.table-bordered > tfoot > tr:first-child > td {
47 | border-top-width: 1px;
48 | }
49 |
50 | div.footable-loader {
51 | vertical-align: middle;
52 | text-align: center;
53 | height: 300px;
54 | position: relative;
55 | }
56 | div.footable-loader > span.fooicon {
57 | display: inline-block;
58 | opacity: 0.3;
59 | font-size: 30px;
60 | line-height: 32px;
61 | width: 32px;
62 | height: 32px;
63 | margin-top: -16px;
64 | margin-left: -16px;
65 | position: absolute;
66 | top: 50%;
67 | left: 50%;
68 | -webkit-animation: fooicon-spin-r 2s infinite linear;
69 | animation: fooicon-spin-r 2s infinite linear;
70 | }
71 | table.footable > tbody > tr.footable-empty > td {
72 | vertical-align: middle;
73 | text-align: center;
74 | font-size: 30px;
75 | }
76 | table.footable > tbody > tr > td,
77 | table.footable > tbody > tr > th {
78 | display: none;
79 | }
80 | table.footable > tbody > tr.footable-empty > td,
81 | table.footable > tbody > tr.footable-empty > th,
82 | table.footable > tbody > tr.footable-detail-row > td,
83 | table.footable > tbody > tr.footable-detail-row > th {
84 | display: table-cell;
85 | }
86 | @-webkit-keyframes fooicon-spin-r {
87 | 0% {
88 | -webkit-transform: rotate(0deg);
89 | transform: rotate(0deg);
90 | }
91 |
92 | 100% {
93 | -webkit-transform: rotate(359deg);
94 | transform: rotate(359deg);
95 | }
96 | }
97 |
98 | @keyframes fooicon-spin-r {
99 | 0% {
100 | -webkit-transform: rotate(0deg);
101 | transform: rotate(0deg);
102 | }
103 |
104 | 100% {
105 | -webkit-transform: rotate(359deg);
106 | transform: rotate(359deg);
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/src/css/components/FooTable.Editing.css:
--------------------------------------------------------------------------------
1 | td.footable-editing {
2 | width: 90px;
3 | max-width: 90px;
4 | }
5 | table.footable-editing-no-edit td.footable-editing,
6 | table.footable-editing-no-delete td.footable-editing,
7 | table.footable-editing-no-view td.footable-editing {
8 | width: 70px;
9 | max-width: 70px;
10 | }
11 | table.footable-editing-no-edit.footable-editing-no-delete td.footable-editing,
12 | table.footable-editing-no-edit.footable-editing-no-view td.footable-editing,
13 | table.footable-editing-no-delete.footable-editing-no-view td.footable-editing {
14 | width: 50px;
15 | max-width: 50px;
16 | }
17 | table.footable-editing-no-edit.footable-editing-no-delete.footable-editing-no-view td.footable-editing,
18 | table.footable-editing-no-edit.footable-editing-no-delete.footable-editing-no-view th.footable-editing {
19 | width: 0;
20 | max-width: 0;
21 | display: none !important;
22 | }
23 | table.footable-editing-right td.footable-editing,
24 | table.footable-editing-right tr.footable-editing {
25 | text-align: right;
26 | }
27 | table.footable-editing-left td.footable-editing,
28 | table.footable-editing-left tr.footable-editing {
29 | text-align: left;
30 | }
31 | table.footable-editing button.footable-add,
32 | table.footable-editing button.footable-hide,
33 | table.footable-editing-show button.footable-show,
34 | table.footable-editing.footable-editing-always-show button.footable-show,
35 | table.footable-editing.footable-editing-always-show button.footable-hide,
36 | table.footable-editing.footable-editing-always-show.footable-editing-no-add tr.footable-editing {
37 | display: none;
38 | }
39 | table.footable-editing.footable-editing-show button.footable-add,
40 | table.footable-editing.footable-editing-show button.footable-hide,
41 | table.footable-editing.footable-editing-always-show button.footable-add {
42 | display: inline-block;
43 | }
44 |
--------------------------------------------------------------------------------
/src/css/components/FooTable.Filtering.css:
--------------------------------------------------------------------------------
1 | table.footable > thead > tr.footable-filtering > th {
2 | border-bottom-width: 1px;
3 | font-weight: normal;
4 | }
5 | .footable-filtering-external.footable-filtering-right,
6 | table.footable > thead > tr.footable-filtering > th,
7 | table.footable.footable-filtering-right > thead > tr.footable-filtering > th {
8 | text-align: right;
9 | }
10 | .footable-filtering-external.footable-filtering-left,
11 | table.footable.footable-filtering-left > thead > tr.footable-filtering > th {
12 | text-align: left;
13 | }
14 | .footable-filtering-external.footable-filtering-center,
15 | table.footable.footable-filtering-center > thead > tr.footable-filtering > th {
16 | text-align: center;
17 | }
18 | table.footable > thead > tr.footable-filtering > th div.form-group {
19 | margin-bottom: 0;
20 | }
21 | table.footable > thead > tr.footable-filtering > th div.form-group+div.form-group {
22 | margin-top: 5px;
23 | }
24 | table.footable > thead > tr.footable-filtering > th div.input-group {
25 | width: 100%;
26 | }
27 | .footable-filtering-external ul.dropdown-menu > li > a.checkbox,
28 | table.footable > thead > tr.footable-filtering > th ul.dropdown-menu > li > a.checkbox {
29 | margin: 0;
30 | display: block;
31 | position: relative;
32 | }
33 | .footable-filtering-external ul.dropdown-menu > li > a.checkbox > label,
34 | table.footable > thead > tr.footable-filtering > th ul.dropdown-menu > li > a.checkbox > label {
35 | display: block;
36 | padding-left: 20px;
37 | }
38 | .footable-filtering-external ul.dropdown-menu > li > a.checkbox input[type="checkbox"],
39 | table.footable > thead > tr.footable-filtering > th ul.dropdown-menu > li > a.checkbox input[type="checkbox"] {
40 | position: absolute;
41 | margin-left: -20px;
42 | }
43 | @media (min-width: 768px) {
44 | table.footable > thead > tr.footable-filtering > th div.input-group {
45 | width: auto;
46 | }
47 | table.footable > thead > tr.footable-filtering > th div.form-group {
48 | margin-left: 2px;
49 | margin-right: 2px;
50 | }
51 | table.footable > thead > tr.footable-filtering > th div.form-group+div.form-group {
52 | margin-top: 0;
53 | }
54 | }
--------------------------------------------------------------------------------
/src/css/components/FooTable.Paging.css:
--------------------------------------------------------------------------------
1 | .footable-paging-external ul.pagination,
2 | table.footable > tfoot > tr.footable-paging > td > ul.pagination {
3 | margin: 10px 0 0 0;
4 | }
5 | .footable-paging-external span.label,
6 | table.footable > tfoot > tr.footable-paging > td > span.label {
7 | display: inline-block;
8 | margin: 0 0 10px 0;
9 | padding: 4px 10px;
10 | }
11 | .footable-paging-external.footable-paging-center,
12 | table.footable > tfoot > tr.footable-paging > td,
13 | table.footable-paging-center > tfoot > tr.footable-paging > td {
14 | text-align: center;
15 | }
16 | .footable-paging-external.footable-paging-left,
17 | table.footable-paging-left > tfoot > tr.footable-paging > td {
18 | text-align: left;
19 | }
20 | .footable-paging-external.footable-paging-right,
21 | table.footable-paging-right > tfoot > tr.footable-paging > td {
22 | text-align: right;
23 | }
24 | ul.pagination > li.footable-page {
25 | display: none;
26 | }
27 | ul.pagination > li.footable-page.visible {
28 | display: inline;
29 | }
--------------------------------------------------------------------------------
/src/css/components/FooTable.Sorting.css:
--------------------------------------------------------------------------------
1 | table.footable > thead > tr > td.footable-sortable,
2 | table.footable > thead > tr > th.footable-sortable,
3 | table.footable > tbody > tr > td.footable-sortable,
4 | table.footable > tbody > tr > th.footable-sortable,
5 | table.footable > tfoot > tr > td.footable-sortable,
6 | table.footable > tfoot > tr > th.footable-sortable {
7 | position: relative;
8 | padding-right: 30px;
9 | cursor: pointer;
10 | }
11 | td.footable-sortable > span.fooicon,
12 | th.footable-sortable > span.fooicon {
13 | position: absolute;
14 | right: 6px;
15 | top: 50%;
16 | margin-top: -7px;
17 | opacity: 0;
18 | transition: opacity 0.3s ease-in;
19 | }
20 | td.footable-sortable:hover > span.fooicon,
21 | th.footable-sortable:hover > span.fooicon {
22 | opacity: 1;
23 | }
24 | td.footable-sortable.footable-asc > span.fooicon,
25 | th.footable-sortable.footable-asc > span.fooicon,
26 | td.footable-sortable.footable-desc > span.fooicon,
27 | th.footable-sortable.footable-desc > span.fooicon {
28 | opacity: 1;
29 | }
30 | /* hides the sort icons when sorting is not allowed */
31 | table.footable-sorting-disabled td.footable-sortable.footable-asc > span.fooicon,
32 | table.footable-sorting-disabled td.footable-sortable.footable-desc > span.fooicon,
33 | table.footable-sorting-disabled td.footable-sortable:hover > span.fooicon,
34 | table.footable-sorting-disabled th.footable-sortable.footable-asc > span.fooicon,
35 | table.footable-sorting-disabled th.footable-sortable.footable-desc > span.fooicon,
36 | table.footable-sorting-disabled th.footable-sortable:hover > span.fooicon {
37 | opacity: 0;
38 | visibility: hidden;
39 | }
--------------------------------------------------------------------------------
/src/js/FooTable.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 | // add in console we use in case it's missing
3 | window.console = window.console || { log:function(){}, error:function(){} };
4 |
5 | /**
6 | * The jQuery plugin initializer.
7 | * @function jQuery.fn.footable
8 | * @param {(object|FooTable.Defaults)} [options] - The options to initialize the plugin with.
9 | * @param {function} [ready] - A callback function to execute for each initialized plugin.
10 | * @returns {jQuery}
11 | */
12 | $.fn.footable = function (options, ready) {
13 | options = options || {};
14 | // make sure we only work with tables
15 | return this.filter('table').each(function (i, tbl) {
16 | F.init(tbl, options, ready);
17 | });
18 | };
19 |
20 | var debug_defaults = {
21 | events: []
22 | };
23 | F.__debug__ = JSON.parse(localStorage.getItem('footable_debug')) || false;
24 | F.__debug_options__ = JSON.parse(localStorage.getItem('footable_debug_options')) || debug_defaults;
25 |
26 | /**
27 | * Gets or sets the internal debug variable which enables some additional logging to the console.
28 | * When enabled this value is stored in the localStorage so it can persist across page reloads.
29 | * @param {boolean} value - Whether or not to enable additional logging.
30 | * @param {object} [options] - Any debug specific options.
31 | * @returns {(boolean|undefined)}
32 | */
33 | F.debug = function(value, options){
34 | if (!F.is.boolean(value)) return F.__debug__;
35 | F.__debug__ = value;
36 | if (F.__debug__){
37 | localStorage.setItem('footable_debug', JSON.stringify(F.__debug__));
38 | F.__debug_options__ = $.extend(true, {}, debug_defaults, options || {});
39 | if (F.is.hash(options)){
40 | localStorage.setItem('footable_debug_options', JSON.stringify(F.__debug_options__));
41 | }
42 | } else {
43 | localStorage.removeItem('footable_debug');
44 | localStorage.removeItem('footable_debug_options');
45 | }
46 | };
47 |
48 | /**
49 | * Gets the FooTable instance of the supplied table if one exists.
50 | * @param {(jQuery|jQuery.selector|HTMLTableElement)} table - The jQuery table object, selector or the HTMLTableElement to retrieve FooTable from.
51 | * @returns {(FooTable.Table|undefined)}
52 | */
53 | F.get = function(table){
54 | return $(table).first().data('__FooTable__');
55 | };
56 |
57 | /**
58 | * Initializes a new instance of FooTable on the supplied table.
59 | * @param {(jQuery|jQuery.selector|HTMLTableElement)} table - The jQuery table object, selector or the HTMLTableElement to initialize FooTable on.
60 | * @param {object} options - The options to initialize FooTable with.
61 | * @param {function} [ready] - A callback function to execute once the plugin is initialized.
62 | * @returns {FooTable.Table}
63 | */
64 | F.init = function(table, options, ready){
65 | var ft = F.get(table);
66 | if (ft instanceof F.Table) ft.destroy();
67 | return new F.Table(table, options, ready);
68 | };
69 |
70 | /**
71 | * Gets the FooTable.Row instance for the supplied element.
72 | * @param {(jQuery|jQuery.selector|HTMLTableElement)} element - A jQuery object, selector or the HTMLElement of an element to retrieve the FooTable.Row for.
73 | * @returns {FooTable.Row}
74 | */
75 | F.getRow = function(element){
76 | // to get the FooTable.Row object simply walk up the DOM, find the TR and grab the __FooTableRow__ data value
77 | var $row = $(element).closest('tr');
78 | // if this is a detail row get the previous row in the table to get the main TR element
79 | if ($row.hasClass('footable-detail-row')){
80 | $row = $row.prev();
81 | }
82 | // grab the row object
83 | return $row.data('__FooTableRow__');
84 | };
85 |
86 | // The below are external type definitions mainly used as pointers to jQuery docs for important information
87 | /**
88 | * jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API
89 | * that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
90 | * @name jQuery
91 | * @constructor
92 | * @returns {jQuery}
93 | * @see {@link http://api.jquery.com/}
94 | */
95 |
96 | /**
97 | * This object provides a subset of the methods of the Deferred object (then, done, fail, always, pipe, and state) to prevent users from changing the state of the Deferred.
98 | * @typedef {object} jQuery.Promise
99 | * @see {@link http://api.jquery.com/Types/#Promise}
100 | */
101 |
102 | /**
103 | * As of jQuery 1.5, the Deferred object provides a way to register multiple callbacks into self-managed callback queues, invoke callback queues as appropriate,
104 | * and relay the success or failure state of any synchronous or asynchronous function.
105 | * @typedef {object} jQuery.Deferred
106 | * @see {@link http://api.jquery.com/Types/#Deferred}
107 | */
108 |
109 | /**
110 | * jQuery's event system normalizes the event object according to W3C standards. The event object is guaranteed to be passed to the event handler. Most properties from
111 | * the original event are copied over and normalized to the new event object.
112 | * @typedef {object} jQuery.Event
113 | * @see {@link http://api.jquery.com/category/events/event-object/}
114 | */
115 |
116 | /**
117 | * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
118 | * @memberof jQuery
119 | * @function when
120 | * @param {...jQuery.Deferred} deferreds - Any number of deferred objects to wait for.
121 | * @returns {jQuery.Promise}
122 | * @see {@link http://api.jquery.com/jQuery.when/}
123 | */
124 |
125 | /**
126 | * The jQuery.fn namespace used to register plugins with jQuery.
127 | * @memberof jQuery
128 | * @namespace fn
129 | * @see {@link http://learn.jquery.com/plugins/basic-plugin-creation/}
130 | */
131 | })(
132 | jQuery,
133 | /**
134 | * The core FooTable namespace containing all the plugin code.
135 | * @namespace
136 | */
137 | FooTable = window.FooTable || {}
138 | );
--------------------------------------------------------------------------------
/src/js/classes/FooTable.Component.js:
--------------------------------------------------------------------------------
1 | (function ($, F) {
2 |
3 | F.Component = F.Class.extend(/** @lends FooTable.Component */{
4 | /**
5 | * The base class for all FooTable components.
6 | * @constructs
7 | * @extends FooTable.Class
8 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} object for the component.
9 | * @param {boolean} enabled - Whether or not the component is enabled.
10 | * @throws {TypeError} The instance parameter must be an instance of {@link FooTable.Table}.
11 | * @returns {FooTable.Component}
12 | */
13 | construct: function (instance, enabled) {
14 | if (!(instance instanceof F.Table))
15 | throw new TypeError('The instance parameter must be an instance of FooTable.Table.');
16 |
17 | /**
18 | * The parent {@link FooTable.Table} for the component.
19 | * @type {FooTable.Table}
20 | */
21 | this.ft = instance;
22 | /**
23 | * Whether or not this component is enabled. Disabled components only have there preinit method called allowing for this value to be overridden.
24 | * @type {boolean}
25 | */
26 | this.enabled = F.is.boolean(enabled) ? enabled : false;
27 | },
28 | /**
29 | * The preinit method is called during the parent {@link FooTable.Table} constructor call.
30 | * @param {object} data - The jQuery.data() object of the root table.
31 | * @instance
32 | * @protected
33 | * @function
34 | */
35 | preinit: function(data){},
36 | /**
37 | * The init method is called during the parent {@link FooTable.Table} constructor call.
38 | * @instance
39 | * @protected
40 | * @function
41 | */
42 | init: function(){},
43 | /**
44 | * This method is called from the {@link FooTable.Table#destroy} method.
45 | * @instance
46 | * @protected
47 | * @function
48 | */
49 | destroy: function(){},
50 | /**
51 | * This method is called from the {@link FooTable.Table#draw} method.
52 | * @instance
53 | * @protected
54 | * @function
55 | */
56 | predraw: function(){},
57 | /**
58 | * This method is called from the {@link FooTable.Table#draw} method.
59 | * @instance
60 | * @protected
61 | * @function
62 | */
63 | draw: function(){},
64 | /**
65 | * This method is called from the {@link FooTable.Table#draw} method.
66 | * @instance
67 | * @protected
68 | * @function
69 | */
70 | postdraw: function(){}
71 | });
72 |
73 | F.components = new F.ClassFactory();
74 |
75 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/classes/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function ($, F) {
2 | /**
3 | * Contains all the available options for the FooTable plugin.
4 | * @name FooTable.Defaults
5 | * @function
6 | * @constructor
7 | * @returns {FooTable.Defaults}
8 | */
9 | F.Defaults = function () {
10 | /**
11 | * Whether or not events raised using the {@link FooTable.Table#raise} method are propagated up the DOM. By default this is set to false and all events bubble up the DOM as per usual
12 | * however the reason for this option is if we have nested tables. If false the parent table would receive all the events raised by it's children and any handlers bound to both the
13 | * parent and child would be triggered which is not the desired behavior.
14 | * @type {boolean}
15 | * @default false
16 | */
17 | this.stopPropagation = false;
18 | /**
19 | * An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
20 | * @type {object.}
21 | * @default NULL
22 | * @example This example shows how to pass an object containing the events and handlers.
23 | * "on": {
24 | * "click": function(e){
25 | * // bind a custom click event to do something whenever the table is clicked
26 | * },
27 | * "init.ft.table": function(e, ft){
28 | * // bind to the FooTable initialize event to do something
29 | * }
30 | * }
31 | */
32 | this.on = null;
33 | };
34 |
35 | /**
36 | * Contains all the default options for the plugin.
37 | * @type {FooTable.Defaults}
38 | */
39 | F.defaults = new F.Defaults();
40 |
41 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/classes/columns/FooTable.ArrayColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.ArrayColumn = F.Column.extend(/** @lends FooTable.ArrayColumn */{
4 | /**
5 | * @summary A column to handle Array values.
6 | * @constructs
7 | * @extends FooTable.Column
8 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to.
9 | * @param {object} definition - An object containing all the properties to set for the column.
10 | */
11 | construct: function(instance, definition) {
12 | this._super(instance, definition, 'array');
13 | },
14 | /**
15 | * @summary Parses the supplied value or element to retrieve a column value.
16 | * @description This is supplied either the cell value or jQuery object to parse. This method will return either the Array containing the values or null.
17 | * @instance
18 | * @protected
19 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
20 | * @returns {(array|null)}
21 | */
22 | parser: function(valueOrElement){
23 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){ // use jQuery to get the value
24 | var $el = $(valueOrElement), data = $el.data('value'); // .data() will automatically convert a JSON string to an array
25 | if (F.is.array(data)) return data;
26 | data = $el.html();
27 | try {
28 | data = JSON.parse(data);
29 | } catch(err) {
30 | data = null;
31 | }
32 | return F.is.array(data) ? data : null; // if we have an array return it
33 | }
34 | if (F.is.array(valueOrElement)) return valueOrElement; // if we have an array return it
35 | return null; // otherwise we have no value so return null
36 | },
37 | /**
38 | * @summary Formats the column value and creates the HTML seen within a cell.
39 | * @description This is supplied the value retrieved from the {@link FooTable.ArrayColumn#parser} function and must return a string, HTMLElement or jQuery object.
40 | * The return value from this function is what is displayed in the cell in the table.
41 | * @instance
42 | * @protected
43 | * @param {?Array} value - The value to format.
44 | * @param {object} options - The current plugin options.
45 | * @param {object} rowData - An object containing the current row data.
46 | * @returns {(string|HTMLElement|jQuery)}
47 | */
48 | formatter: function(value, options, rowData){
49 | return F.is.array(value) ? JSON.stringify(value) : '';
50 | }
51 | });
52 |
53 | F.columns.register('array', F.ArrayColumn);
54 |
55 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/classes/columns/FooTable.DateColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | if (F.is.undef(window.moment)){
4 | // The DateColumn requires moment.js to parse and format date values. Goto http://momentjs.com/ to get it.
5 | return;
6 | }
7 |
8 | F.DateColumn = F.Column.extend(/** @lends FooTable.DateColumn */{
9 | /**
10 | * The date column class is used to handle date values. This column is dependent on [moment.js]{@link http://momentjs.com/} to provide date parsing and formatting functionality.
11 | * @constructs
12 | * @extends FooTable.Column
13 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to.
14 | * @param {object} definition - An object containing all the properties to set for the column.
15 | * @returns {FooTable.DateColumn}
16 | */
17 | construct: function(instance, definition){
18 | this._super(instance, definition, 'date');
19 | /**
20 | * The format string to use when parsing and formatting dates.
21 | * @instance
22 | * @type {string}
23 | */
24 | this.formatString = F.is.string(definition.formatString) ? definition.formatString : 'MM-DD-YYYY';
25 | },
26 | /**
27 | * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.DateColumn#format} function
28 | * to generate the cell contents.
29 | * @instance
30 | * @protected
31 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
32 | * @returns {(moment|null)}
33 | * @this FooTable.DateColumn
34 | */
35 | parser: function(valueOrElement){
36 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){
37 | var data = $(valueOrElement).data('value');
38 | valueOrElement = F.is.defined(data) ? data : $(valueOrElement).text();
39 | if (F.is.string(valueOrElement)) valueOrElement = isNaN(valueOrElement) ? valueOrElement : +valueOrElement;
40 | }
41 | if (F.is.date(valueOrElement)) return moment(valueOrElement);
42 | if (F.is.object(valueOrElement) && F.is.boolean(valueOrElement._isAMomentObject)) return valueOrElement;
43 | if (F.is.string(valueOrElement)){
44 | // if it looks like a number convert it and do nothing else otherwise create a new moment using the string value and formatString
45 | if (isNaN(valueOrElement)){
46 | return moment(valueOrElement, this.formatString);
47 | } else {
48 | valueOrElement = +valueOrElement;
49 | }
50 | }
51 | if (F.is.number(valueOrElement)){
52 | return moment(valueOrElement);
53 | }
54 | return null;
55 | },
56 | /**
57 | * This is supplied the value retrieved from the {@link FooTable.DateColumn#parser} function and must return a string, HTMLElement or jQuery object.
58 | * The return value from this function is what is displayed in the cell in the table.
59 | * @instance
60 | * @protected
61 | * @param {*} value - The value to format.
62 | * @param {object} options - The current plugin options.
63 | * @param {object} rowData - An object containing the current row data.
64 | * @returns {(string|HTMLElement|jQuery)}
65 | * @this FooTable.DateColumn
66 | */
67 | formatter: function(value, options, rowData){
68 | return F.is.object(value) && F.is.boolean(value._isAMomentObject) && value.isValid() ? value.format(this.formatString) : '';
69 | },
70 | /**
71 | * This is supplied either the cell value or jQuery object to parse. A string value must be returned from this method and will be used during filtering operations.
72 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
73 | * @returns {string}
74 | * @this FooTable.DateColumn
75 | */
76 | filterValue: function(valueOrElement){
77 | // if we have an element or a jQuery object use jQuery to get the value
78 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)) valueOrElement = $(valueOrElement).data('filterValue') || $(valueOrElement).text();
79 | // if options are supplied with the value
80 | if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){
81 | if (F.is.string(valueOrElement.options.filterValue)) valueOrElement = valueOrElement.options.filterValue;
82 | if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value;
83 | }
84 | // if the value is a moment object just return the formatted value
85 | if (F.is.object(valueOrElement) && F.is.boolean(valueOrElement._isAMomentObject)) return valueOrElement.format(this.formatString);
86 | // if its a string
87 | if (F.is.string(valueOrElement)){
88 | // if its not a number return it
89 | if (isNaN(valueOrElement)){
90 | return valueOrElement;
91 | } else { // otherwise convert it and carry on
92 | valueOrElement = +valueOrElement;
93 | }
94 | }
95 | // if the value is a number or date convert to a moment object and return the formatted result.
96 | if (F.is.number(valueOrElement) || F.is.date(valueOrElement)){
97 | return moment(valueOrElement).format(this.formatString);
98 | }
99 | // try use the native toString of the value if its not undefined or null
100 | if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement+'';
101 | return ''; // otherwise we have no value so return an empty string
102 | }
103 | });
104 |
105 | F.columns.register('date', F.DateColumn);
106 |
107 | })(jQuery, FooTable);
108 |
--------------------------------------------------------------------------------
/src/js/classes/columns/FooTable.HTMLColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.HTMLColumn = F.Column.extend(/** @lends FooTable.HTMLColumn */{
4 | /**
5 | * The HTML column class is used to handle any raw HTML columns.
6 | * @constructs
7 | * @extends FooTable.Column
8 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to.
9 | * @param {object} definition - An object containing all the properties to set for the column.
10 | * @returns {FooTable.HTMLColumn}
11 | */
12 | construct: function(instance, definition){
13 | this._super(instance, definition, 'html');
14 | },
15 | /**
16 | * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.HTMLColumn#format} function
17 | * to generate the cell contents.
18 | * @instance
19 | * @protected
20 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
21 | * @returns {(jQuery|null)}
22 | * @this FooTable.HTMLColumn
23 | */
24 | parser: function(valueOrElement){
25 | if (F.is.string(valueOrElement)) valueOrElement = $($.trim(valueOrElement));
26 | if (F.is.element(valueOrElement)) valueOrElement = $(valueOrElement);
27 | if (F.is.jq(valueOrElement)){
28 | var tagName = valueOrElement.prop('tagName').toLowerCase();
29 | if (tagName == 'td' || tagName == 'th'){
30 | var data = valueOrElement.data('value');
31 | return F.is.defined(data) ? data : valueOrElement.contents();
32 | }
33 | return valueOrElement;
34 | }
35 | return null;
36 | }
37 | });
38 |
39 | F.columns.register('html', F.HTMLColumn);
40 |
41 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/classes/columns/FooTable.NumberColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.NumberColumn = F.Column.extend(/** @lends FooTable.NumberColumn */{
4 | /**
5 | * The number column class is used to handle simple number columns.
6 | * @constructs
7 | * @extends FooTable.Column
8 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to.
9 | * @param {object} definition - An object containing all the properties to set for the column.
10 | * @returns {FooTable.NumberColumn}
11 | */
12 | construct: function(instance, definition){
13 | this._super(instance, definition, 'number');
14 | this.decimalSeparator = F.is.string(definition.decimalSeparator) ? definition.decimalSeparator : '.';
15 | this.thousandSeparator = F.is.string(definition.thousandSeparator) ? definition.thousandSeparator : ',';
16 | this.decimalSeparatorRegex = new RegExp(F.str.escapeRegExp(this.decimalSeparator), 'g');
17 | this.thousandSeparatorRegex = new RegExp(F.str.escapeRegExp(this.thousandSeparator), 'g');
18 | this.cleanRegex = new RegExp('[^\-0-9' + F.str.escapeRegExp(this.decimalSeparator) + ']', 'g');
19 | },
20 | /**
21 | * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and will be provided to the {@link FooTable.Column#formatter} function
22 | * to generate the cell contents.
23 | * @instance
24 | * @protected
25 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
26 | * @returns {(number|null)}
27 | * @this FooTable.NumberColumn
28 | */
29 | parser: function(valueOrElement){
30 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){
31 | var data = $(valueOrElement).data('value');
32 | valueOrElement = F.is.defined(data) ? data : $(valueOrElement).text().replace(this.cleanRegex, '');
33 | }
34 | if (F.is.string(valueOrElement)){
35 | valueOrElement = valueOrElement.replace(this.thousandSeparatorRegex, '').replace(this.decimalSeparatorRegex, '.');
36 | valueOrElement = parseFloat(valueOrElement);
37 | }
38 | if (F.is.number(valueOrElement)) return valueOrElement;
39 | return null;
40 | },
41 | /**
42 | * This is supplied the value retrieved from the {@link FooTable.NumberColumn#parse} function and must return a string, HTMLElement or jQuery object.
43 | * The return value from this function is what is displayed in the cell in the table.
44 | * @instance
45 | * @protected
46 | * @param {number} value - The value to format.
47 | * @param {object} options - The current plugin options.
48 | * @param {object} rowData - An object containing the current row data.
49 | * @returns {(string|HTMLElement|jQuery)}
50 | * @this FooTable.NumberColumn
51 | */
52 | formatter: function(value, options, rowData){
53 | if (value == null) return '';
54 | var s = (value + '').split('.');
55 | if (s.length == 2 && s[0].length > 3) {
56 | s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, this.thousandSeparator);
57 | }
58 | return s.join(this.decimalSeparator);
59 | }
60 | });
61 |
62 | F.columns.register('number', F.NumberColumn);
63 |
64 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/classes/columns/FooTable.ObjectColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.ObjectColumn = F.Column.extend(/** @lends FooTable.ObjectColumn */{
4 | /**
5 | * @summary A column to handle Object values.
6 | * @constructs
7 | * @extends FooTable.Column
8 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to.
9 | * @param {object} definition - An object containing all the properties to set for the column.
10 | */
11 | construct: function(instance, definition) {
12 | this._super(instance, definition, 'object');
13 | },
14 | /**
15 | * @summary Parses the supplied value or element to retrieve a column value.
16 | * @description This is supplied either the cell value or jQuery object to parse. This method will return either the Object containing the values or null.
17 | * @instance
18 | * @protected
19 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
20 | * @returns {(object|null)}
21 | */
22 | parser: function(valueOrElement){
23 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){ // use jQuery to get the value
24 | var $el = $(valueOrElement), data = $el.data('value'); // .data() will automatically convert a JSON string to an object
25 | if (F.is.object(data)) return data;
26 | data = $el.html();
27 | try {
28 | data = JSON.parse(data);
29 | } catch(err) {
30 | data = null;
31 | }
32 | return F.is.object(data) ? data : null; // if we have an object return it
33 | }
34 | if (F.is.object(valueOrElement)) return valueOrElement; // if we have an object return it
35 | return null; // otherwise we have no value so return null
36 | },
37 | /**
38 | * @summary Formats the column value and creates the HTML seen within a cell.
39 | * @description This is supplied the value retrieved from the {@link FooTable.ObjectColumn#parser} function and must return a string, HTMLElement or jQuery object.
40 | * The return value from this function is what is displayed in the cell in the table.
41 | * @instance
42 | * @protected
43 | * @param {*} value - The value to format.
44 | * @param {object} options - The current plugin options.
45 | * @param {object} rowData - An object containing the current row data.
46 | * @returns {(string|HTMLElement|jQuery)}
47 | */
48 | formatter: function(value, options, rowData){
49 | return F.is.object(value) ? JSON.stringify(value) : '';
50 | }
51 | });
52 |
53 | F.columns.register('object', F.ObjectColumn);
54 |
55 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/README.md:
--------------------------------------------------------------------------------
1 | The following lists all default components and the properties they're registered with. The higher the priority the earlier the component
2 | is loaded by the plugin. When base component methods such as preinit or init are executed the priority also determines the order in
3 | which they are executed.
4 |
5 | | Class Name | Registered Name | Priority | Required |
6 | |----------------------|-----------------|----------|----------|
7 | | FooTable.Breakpoints | breakpoints | 1000 | true |
8 | | FooTable.Columns | columns | 900 | true |
9 | | FooTable.Editing | editing | 850 | false |
10 | | FooTable.Rows | rows | 800 | true |
11 | | FooTable.State | state | 700 | false |
12 | | FooTable.Sorting | sorting | 600 | false |
13 | | FooTable.Filtering | filtering | 500 | false |
14 | | FooTable.Export | export | 490 | false |
15 | | FooTable.Paging | paging | 400 | false |
16 |
--------------------------------------------------------------------------------
/src/js/components/breakpoints/FooTable.Breakpoint.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.Breakpoint = F.Class.extend(/** @lends FooTable.Breakpoint */{
4 | /**
5 | * The breakpoint class containing the name and maximum width for the breakpoint.
6 | * @constructs
7 | * @extends FooTable.Class
8 | * @param {string} name - The name of the breakpoint. Must contain no spaces or special characters.
9 | * @param {number} width - The width of the breakpoint in pixels.
10 | * @returns {FooTable.Breakpoint}
11 | */
12 | construct: function(name, width){
13 | /**
14 | * The name of the breakpoint.
15 | * @type {string}
16 | */
17 | this.name = name;
18 | /**
19 | * The maximum width of the breakpoint in pixels.
20 | * @type {number}
21 | */
22 | this.width = width;
23 | }
24 | });
25 |
26 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/breakpoints/extends/FooTable.Column.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * A space delimited string of breakpoint names that specify when the column will be hidden. You can also specify "all" to make a column permanently display in an expandable detail row.
4 | * @type {string}
5 | * @default null
6 | * @example The below shows how this value would be set
7 | * breakpoints: "md"
8 | */
9 | F.Column.prototype.breakpoints = null;
10 |
11 | F.Column.prototype.__breakpoints_define__ = function(definition){
12 | this.breakpoints = F.is.emptyString(definition.breakpoints) ? null : definition.breakpoints;
13 | };
14 |
15 | F.Column.extend('define', function(definition){
16 | this._super(definition);
17 | this.__breakpoints_define__(definition);
18 | });
19 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/breakpoints/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * An object containing the breakpoints for the plugin.
4 | * @type {object.}
5 | * @default { "xs": 480, "sm": 768, "md": 992, "lg": 1200 }
6 | */
7 | F.Defaults.prototype.breakpoints = null;
8 |
9 | /**
10 | * Whether or not breakpoints cascade. When set to true all breakpoints larger than the current will also be hidden along with it.
11 | * @type {boolean}
12 | * @default false
13 | */
14 | F.Defaults.prototype.cascade = false;
15 |
16 | /**
17 | * Whether or not to calculate breakpoints on the width of the parent element rather than the viewport.
18 | * @type {boolean}
19 | * @default false
20 | */
21 | F.Defaults.prototype.useParentWidth = false;
22 |
23 | /**
24 | * A function used to override the default getWidth function with a custom one.
25 | * @type {function}
26 | * @default null
27 | * @example The below shows what the default getWidth function would look like.
28 | * getWidth: function(instance){
29 | * if (instance.o.useParentWidth == true) return instance.$el.parent().width();
30 | * return instance.breakpoints.getViewportWidth();
31 | * }
32 | */
33 | F.Defaults.prototype.getWidth = null;
34 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/columns/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * An array containing the column options or a jQuery promise that resolves returning the columns. The index of the definitions must match the index of each column as it should appear in the table. For more information on the options available see the {@link FooTable.Column} object.
4 | * @type {(Array.|jQuery.Promise)}
5 | * @default []
6 | * @example The below shows column definitions for a row defined as { id: Number, name: String, age: Number }
. The ID column has a fixed width, the table is initially sorted on the Name column and the Age column will be hidden on phones.
7 | * columns: [
8 | * { name: 'id', title: 'ID', type: 'number' },
9 | * { name: 'name', title: 'Name', sorted: true, direction: 'ASC' }
10 | * { name: 'age', title: 'Age', type: 'number', breakpoints: 'xs' }
11 | * ]
12 | */
13 | F.Defaults.prototype.columns = [];
14 |
15 | /**
16 | * Specifies whether or not the column headers should be displayed.
17 | * @type {boolean}
18 | * @default true
19 | */
20 | F.Defaults.prototype.showHeader = true;
21 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/editing/FooTable.EditingColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.EditingColumn = F.Column.extend(/** @lends FooTable.EditingColumn */{
4 | /**
5 | * The Editing column class is used to create the column containing the editing buttons.
6 | * @constructs
7 | * @extends FooTable.Column
8 | * @param {FooTable.Table} instance - The parent {@link FooTable.Table} this column belongs to.
9 | * @param {FooTable.Editing} editing - The parent {@link FooTable.Editing} component this column is used with.
10 | * @param {object} definition - An object containing all the properties to set for the column.
11 | * @returns {FooTable.EditingColumn}
12 | */
13 | construct: function(instance, editing, definition){
14 | this._super(instance, definition, 'editing');
15 | this.editing = editing;
16 | this.internal = true;
17 | },
18 | /**
19 | * After the column has been defined this ensures that the $el property is a jQuery object by either creating or updating the current value.
20 | * @instance
21 | * @protected
22 | * @this FooTable.Column
23 | */
24 | $create: function(){
25 | (this.$el = !this.virtual && F.is.jq(this.$el) ? this.$el : $(' ', {'class': 'footable-editing'})).html(this.title);
26 | },
27 | /**
28 | * This is supplied either the cell value or jQuery object to parse. Any value can be returned from this method and
29 | * will be provided to the {@link FooTable.EditingColumn#format} function
30 | * to generate the cell contents.
31 | * @instance
32 | * @protected
33 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
34 | * @returns {(jQuery)}
35 | */
36 | parser: function(valueOrElement){
37 | if (F.is.string(valueOrElement)) valueOrElement = $($.trim(valueOrElement));
38 | if (F.is.element(valueOrElement)) valueOrElement = $(valueOrElement);
39 | if (F.is.jq(valueOrElement)){
40 | var tagName = valueOrElement.prop('tagName').toLowerCase();
41 | if (tagName == 'td' || tagName == 'th') return valueOrElement.data('value') || valueOrElement.contents();
42 | return valueOrElement;
43 | }
44 | return null;
45 | },
46 | /**
47 | * Creates a cell to be used in the supplied row for this column.
48 | * @param {FooTable.Row} row - The row to create the cell for.
49 | * @returns {FooTable.Cell}
50 | */
51 | createCell: function(row){
52 | var $buttons = this.editing.$rowButtons(), $cell = $(' ').append($buttons);
53 | if (F.is.jq(row.$el)){
54 | if (this.index === 0){
55 | $cell.prependTo(row.$el);
56 | } else {
57 | $cell.insertAfter(row.$el.children().eq(this.index-1));
58 | }
59 | }
60 | return new F.Cell(this.ft, row, this, $cell || $cell.html());
61 | }
62 | });
63 |
64 | F.columns.register('editing', F.EditingColumn);
65 |
66 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/editing/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function($, F) {
2 |
3 | /**
4 | * An object containing the editing options for the plugin. Added by the {@link FooTable.Editing} component.
5 | * @type {object}
6 | * @prop {boolean} enabled=false - Whether or not to allow editing on the table.
7 | * @prop {boolean} pageToNew=true - Whether or not to automatically page to a new row when it is added to the table.
8 | * @prop {string} position="right" - The position of the editing column in the table as well as the alignment of the buttons.
9 | * @prop {boolean} alwaysShow=false - Whether or not the editing column and add row button are always visible.
10 | * @prop {function} addRow - The callback function to execute when the add row button is clicked.
11 | * @prop {function} editRow - The callback function to execute when the edit row button is clicked.
12 | * @prop {function} deleteRow - The callback function to execute when the delete row button is clicked.
13 | * @prop {function} viewRow - The callback function to execute when the view row button is clicked.
14 | * @prop {string} showText - The text that appears in the show button. This can contain HTML.
15 | * @prop {string} hideText - The text that appears in the hide button. This can contain HTML.
16 | * @prop {string} addText - The text that appears in the add button. This can contain HTML.
17 | * @prop {string} editText - The text that appears in the edit button. This can contain HTML.
18 | * @prop {string} deleteText - The text that appears in the delete button. This can contain HTML.
19 | * @prop {string} viewText - The text that appears in the view button. This can contain HTML.
20 | * @prop {boolean} allowAdd - Whether or not to show the Add Row button.
21 | * @prop {boolean} allowEdit - Whether or not to show the Edit Row button.
22 | * @prop {boolean} allowDelete - Whether or not to show the Delete Row button.
23 | * @prop {boolean} allowView - Whether or not to show the View Row button.
24 | * @prop {object} column - The options for the editing column. @see {@link FooTable.EditingColumn} for more info.
25 | * @prop {string} column.classes="footable-editing" - A space separated string of class names to apply to all cells in the column.
26 | * @prop {string} column.name="editing" - The name of the column.
27 | * @prop {string} column.title="" - The title displayed in the header row of the table for the column.
28 | * @prop {boolean} column.filterable=false - Whether or not the column should be filterable when using the filtering component.
29 | * @prop {boolean} column.sortable=false - Whether or not the column should be sortable when using the sorting component.
30 | */
31 | F.Defaults.prototype.editing = {
32 | enabled: false,
33 | pageToNew: true,
34 | position: 'right',
35 | alwaysShow: false,
36 | addRow: function(){},
37 | editRow: function(row){},
38 | deleteRow: function(row){},
39 | viewRow: function(row){},
40 | showText: ' Edit rows',
41 | hideText: 'Cancel',
42 | addText: 'New row',
43 | editText: ' ',
44 | deleteText: ' ',
45 | viewText: ' ',
46 | allowAdd: true,
47 | allowEdit: true,
48 | allowDelete: true,
49 | allowView: false,
50 | column: {
51 | classes: 'footable-editing',
52 | name: 'editing',
53 | title: '',
54 | filterable: false,
55 | sortable: false
56 | }
57 | };
58 |
59 | })(jQuery, FooTable);
60 |
--------------------------------------------------------------------------------
/src/js/components/editing/extends/FooTable.Paging.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | if (F.is.defined(F.Paging)){
4 | /**
5 | * Holds a shallow clone of the un-paged {@link FooTable.Rows#array} value before paging occurs and superfluous rows are removed. Added by the {@link FooTable.Editing} component.
6 | * @instance
7 | * @public
8 | * @type {Array}
9 | */
10 | F.Paging.prototype.unpaged = [];
11 |
12 | // override the default predraw method with one that sets the unpaged property.
13 | F.Paging.extend('predraw', function(){
14 | this.unpaged = this.ft.rows.array.slice(0); // create a shallow clone for later use
15 | this._super(); // call the original method
16 | });
17 | }
18 |
19 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/editing/extends/FooTable.Row.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | /**
4 | * Adds the row to the table.
5 | * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this
6 | * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method.
7 | * @returns {jQuery.Deferred}
8 | */
9 | F.Row.prototype.add = function(redraw){
10 | redraw = F.is.boolean(redraw) ? redraw : true;
11 | var self = this;
12 | return $.Deferred(function(d){
13 | var index = self.ft.rows.all.push(self) - 1;
14 | if (redraw){
15 | return self.ft.draw().then(function(){
16 | d.resolve(index);
17 | });
18 | } else {
19 | d.resolve(index);
20 | }
21 | });
22 | };
23 |
24 | /**
25 | * Removes the row from the table.
26 | * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this
27 | * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method.
28 | * @returns {jQuery.Deferred}
29 | */
30 | F.Row.prototype.delete = function(redraw){
31 | redraw = F.is.boolean(redraw) ? redraw : true;
32 | var self = this;
33 | return $.Deferred(function(d){
34 | var index = self.ft.rows.all.indexOf(self);
35 | if (F.is.number(index) && index >= 0 && index < self.ft.rows.all.length){
36 | self.ft.rows.all.splice(index, 1);
37 | if (redraw){
38 | return self.ft.draw().then(function(){
39 | d.resolve(self);
40 | });
41 | }
42 | }
43 | d.resolve(self);
44 | });
45 | };
46 |
47 | if (F.is.defined(F.Paging)){
48 | // override the default add method with one that supports paging
49 | F.Row.extend('add', function(redraw){
50 | redraw = F.is.boolean(redraw) ? redraw : true;
51 | var self = this,
52 | added = this._super(redraw),
53 | editing = self.ft.use(F.Editing),
54 | paging;
55 | if (editing && editing.pageToNew && (paging = self.ft.use(F.Paging)) && redraw){
56 | return added.then(function(){
57 | var index = paging.unpaged.indexOf(self); // find this row in the unpaged array (this array will be sorted and filtered)
58 | var page = Math.ceil((index + 1) / paging.size); // calculate the page the new row is on
59 | if (paging.current !== page){ // goto the page if we need to
60 | return paging.goto(page);
61 | }
62 | });
63 | }
64 | return added;
65 | });
66 | }
67 |
68 | if (F.is.defined(F.Sorting)){
69 | // override the default val method with one that supports sorting and paging
70 | F.Row.extend('val', function(data, redraw){
71 | redraw = F.is.boolean(redraw) ? redraw : true;
72 | var result = this._super(data);
73 | if (!F.is.hash(data)){
74 | return result;
75 | }
76 | var self = this;
77 | if (redraw){
78 | self.ft.draw().then(function(){
79 | var editing = self.ft.use(F.Editing), paging;
80 | if (F.is.defined(F.Paging) && editing && editing.pageToNew && (paging = self.ft.use(F.Paging))){
81 | var index = paging.unpaged.indexOf(self); // find this row in the unpaged array (this array will be sorted and filtered)
82 | var page = Math.ceil((index + 1) / paging.size); // calculate the page the new row is on
83 | if (paging.current !== page){ // goto the page if we need to
84 | return paging.goto(page);
85 | }
86 | }
87 | });
88 | }
89 | return result;
90 | });
91 | }
92 |
93 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/editing/extends/FooTable.Rows.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | /**
4 | * Adds a row to the underlying {@link FooTable.Rows#all} array.
5 | * @param {(object|FooTable.Row)} dataOrRow - A hash containing the row values or an actual {@link FooTable.Row} object.
6 | * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this
7 | * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method.
8 | */
9 | F.Rows.prototype.add = function(dataOrRow, redraw){
10 | var row = dataOrRow;
11 | if (F.is.hash(dataOrRow)){
12 | row = new FooTable.Row(this.ft, this.ft.columns.array, dataOrRow);
13 | }
14 | if (row instanceof FooTable.Row){
15 | row.add(redraw);
16 | }
17 | };
18 |
19 | /**
20 | * Updates a row in the underlying {@link FooTable.Rows#all} array.
21 | * @param {(number|FooTable.Row)} indexOrRow - The index to update or the actual {@link FooTable.Row} object.
22 | * @param {object} data - A hash containing the new row values.
23 | * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this
24 | * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method.
25 | */
26 | F.Rows.prototype.update = function(indexOrRow, data, redraw){
27 | var len = this.ft.rows.all.length,
28 | row = indexOrRow;
29 | if (F.is.number(indexOrRow) && indexOrRow >= 0 && indexOrRow < len){
30 | row = this.ft.rows.all[indexOrRow];
31 | }
32 | if (row instanceof FooTable.Row && F.is.hash(data)){
33 | row.val(data, redraw);
34 | }
35 | };
36 |
37 | /**
38 | * Deletes a row from the underlying {@link FooTable.Rows#all} array.
39 | * @param {(number|FooTable.Row)} indexOrRow - The index to delete or the actual {@link FooTable.Row} object.
40 | * @param {boolean} [redraw=true] - Whether or not to redraw the table, defaults to true but for bulk operations this
41 | * can be set to false and then followed by a call to the {@link FooTable.Table#draw} method.
42 | */
43 | F.Rows.prototype.delete = function(indexOrRow, redraw){
44 | var len = this.ft.rows.all.length,
45 | row = indexOrRow;
46 | if (F.is.number(indexOrRow) && indexOrRow >= 0 && indexOrRow < len){
47 | row = this.ft.rows.all[indexOrRow];
48 | }
49 | if (row instanceof FooTable.Row){
50 | row.delete(redraw);
51 | }
52 | };
53 |
54 | })(FooTable);
55 |
--------------------------------------------------------------------------------
/src/js/components/export/FooTable.Export.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.Export = F.Component.extend(/** @lends FooTable.Export */{
4 | /**
5 | * @summary This component provides some basic export functionality.
6 | * @memberof FooTable
7 | * @constructs Export
8 | * @param {FooTable.Table} table - The current instance of the plugin.
9 | */
10 | construct: function(table){
11 | // call the constructor of the base class
12 | this._super(table, true);
13 | /**
14 | * @summary A snapshot of the working set of rows prior to being trimmed by the paging component.
15 | * @memberof FooTable.Export#
16 | * @name snapshot
17 | * @type {FooTable.Row[]}
18 | */
19 | this.snapshot = [];
20 | },
21 | /**
22 | * @summary Hooks into the predraw pipeline after sorting and filtering have taken place but prior to paging.
23 | * @memberof FooTable.Export#
24 | * @function predraw
25 | * @description This method allows us to take a snapshot of the working set of rows before they are trimmed by the paging component and is called by the plugin instance.
26 | */
27 | predraw: function(){
28 | this.snapshot = this.ft.rows.array.slice(0);
29 | },
30 | /**
31 | * @summary Return the columns as simple JavaScript objects in an array.
32 | * @memberof FooTable.Export#
33 | * @function columns
34 | * @returns {Object[]}
35 | */
36 | columns: function(){
37 | var result = [];
38 | F.arr.each(this.ft.columns.array, function(column){
39 | if (!column.internal){
40 | result.push({
41 | type: column.type,
42 | name: column.name,
43 | title: column.title,
44 | visible: column.visible,
45 | hidden: column.hidden,
46 | classes: column.classes,
47 | style: column.style
48 | });
49 | }
50 | });
51 | return result;
52 | },
53 | /**
54 | * @summary Return the rows as simple JavaScript objects in an array.
55 | * @memberof FooTable.Export#
56 | * @function rows
57 | * @param {boolean} [filtered=false] - Whether or not to exclude filtered rows from the result.
58 | * @returns {Object[]}
59 | */
60 | rows: function(filtered){
61 | filtered = F.is.boolean(filtered) ? filtered : false;
62 | var rows = filtered ? this.ft.rows.all : this.snapshot, result = [];
63 | F.arr.each(rows, function(row){
64 | result.push(row.val());
65 | });
66 | return result;
67 | },
68 | /**
69 | * @summary Return the columns and rows as a properly formatted JSON object.
70 | * @memberof FooTable.Export#
71 | * @function json
72 | * @param {boolean} [filtered=false] - Whether or not to exclude filtered rows from the result.
73 | * @returns {Object}
74 | */
75 | json: function(filtered){
76 | return JSON.parse(JSON.stringify({columns: this.columns(),rows: this.rows(filtered)}));
77 | },
78 | /**
79 | * @summary Return the columns and rows as a properly formatted CSV value.
80 | * @memberof FooTable.Export#
81 | * @function csv
82 | * @param {boolean} [filtered=false] - Whether or not to exclude filtered rows from the result.
83 | * @returns {string}
84 | */
85 | csv: function(filtered){
86 | var csv = "", columns = this.columns(), value, escaped;
87 | F.arr.each(columns, function(column, i){
88 | escaped = '"' + column.title.replace(/"/g, '""') + '"';
89 | csv += (i === 0 ? escaped : "," + escaped);
90 | });
91 | csv += "\n";
92 |
93 | var rows = filtered ? this.ft.rows.all : this.snapshot;
94 | F.arr.each(rows, function(row){
95 | F.arr.each(row.cells, function(cell, i){
96 | if (!cell.column.internal){
97 | value = cell.column.stringify.call(cell.column, cell.value, cell.ft.o, cell.row.value);
98 | escaped = '"' + value.replace(/"/g, '""') + '"';
99 | csv += (i === 0 ? escaped : "," + escaped);
100 | }
101 | });
102 | csv += "\n";
103 | });
104 | return csv;
105 | }
106 | });
107 |
108 | // register the component using a priority of 490 which falls just after filtering (500) and before paging (400).
109 | F.components.register("export", F.Export, 490);
110 |
111 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/export/extends/FooTable.Column.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | // this is used to define the filtering specific properties on column creation
3 | F.Column.prototype.__export_define__ = function(definition){
4 | this.stringify = F.checkFnValue(this, definition.stringify, this.stringify);
5 | };
6 |
7 | // overrides the public define method and replaces it with our own
8 | F.Column.extend('define', function(definition){
9 | this._super(definition); // call the base so we don't have to redefine any previously set properties
10 | this.__export_define__(definition); // then call our own
11 | });
12 |
13 | /**
14 | * @summary Return the supplied value as a string.
15 | * @memberof FooTable.Column#
16 | * @function stringify
17 | * @returns {string}
18 | */
19 | F.Column.prototype.stringify = function(value, options, rowData){
20 | return value + "";
21 | };
22 |
23 | if (F.is.defined(F.DateColumn)){
24 | // override the base method for DateColumns
25 | F.DateColumn.prototype.stringify = function(value, options, rowData){
26 | return F.is.object(value) && F.is.boolean(value._isAMomentObject) && value.isValid() ? value.format(this.formatString) : '';
27 | };
28 | }
29 |
30 | // override the base method for ObjectColumns
31 | F.ObjectColumn.prototype.stringify = function(value, options, rowData){
32 | return F.is.object(value) ? JSON.stringify(value) : "";
33 | };
34 |
35 | // override the base method for ArrayColumns
36 | F.ArrayColumn.prototype.stringify = function(value, options, rowData){
37 | return F.is.array(value) ? JSON.stringify(value) : "";
38 | };
39 |
40 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/export/extends/FooTable.Table.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * @summary Return the columns and rows as a properly formatted JSON object.
4 | * @memberof FooTable.Table#
5 | * @function toJSON
6 | * @param {boolean} [filtered=false] - Whether or not to exclude filtered rows from the result.
7 | * @returns {Object}
8 | */
9 | F.Table.prototype.toJSON = function(filtered){
10 | return this.use(F.Export).json(filtered);
11 | };
12 |
13 | /**
14 | * @summary Return the columns and rows as a properly formatted CSV value.
15 | * @memberof FooTable.Table#
16 | * @function toCSV
17 | * @param {boolean} [filtered=false] - Whether or not to exclude filtered rows from the result.
18 | * @returns {string}
19 | */
20 | F.Table.prototype.toCSV = function(filtered){
21 | return this.use(F.Export).csv(filtered);
22 | };
23 |
24 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/filtering/FooTable.Filter.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | F.Filter = F.Class.extend(/** @lends FooTable.Filter */{
3 | /**
4 | * The filter object contains the query to filter by and the columns to apply it to.
5 | * @constructs
6 | * @extends FooTable.Class
7 | * @param {string} name - The name for the filter.
8 | * @param {(string|FooTable.Query)} query - The query for the filter.
9 | * @param {Array.} columns - The columns to apply the query to.
10 | * @param {string} [space="AND"] - How the query treats space chars.
11 | * @param {boolean} [connectors=true] - Whether or not to replace phrase connectors (+.-_) with spaces.
12 | * @param {boolean} [ignoreCase=true] - Whether or not ignore case when matching.
13 | * @param {boolean} [hidden=true] - Whether or not this is a hidden filter.
14 | * @returns {FooTable.Filter}
15 | */
16 | construct: function(name, query, columns, space, connectors, ignoreCase, hidden){
17 | /**
18 | * The name of the filter.
19 | * @instance
20 | * @type {string}
21 | */
22 | this.name = name;
23 | /**
24 | * A string specifying how the filter treats space characters. Can be either "OR" or "AND".
25 | * @instance
26 | * @type {string}
27 | */
28 | this.space = F.is.string(space) && (space == 'OR' || space == 'AND') ? space : 'AND';
29 | /**
30 | * Whether or not to replace phrase connectors (+.-_) with spaces before executing the query.
31 | * @instance
32 | * @type {boolean}
33 | */
34 | this.connectors = F.is.boolean(connectors) ? connectors : true;
35 | /**
36 | * Whether or not ignore case when matching.
37 | * @instance
38 | * @type {boolean}
39 | */
40 | this.ignoreCase = F.is.boolean(ignoreCase) ? ignoreCase : true;
41 | /**
42 | * Whether or not this is a hidden filter.
43 | * @instance
44 | * @type {boolean}
45 | */
46 | this.hidden = F.is.boolean(hidden) ? hidden : false;
47 | /**
48 | * The query for the filter.
49 | * @instance
50 | * @type {(string|FooTable.Query)}
51 | */
52 | this.query = query instanceof F.Query ? query : new F.Query(query, this.space, this.connectors, this.ignoreCase);
53 | /**
54 | * The columns to apply the query to.
55 | * @instance
56 | * @type {Array.}
57 | */
58 | this.columns = columns;
59 | },
60 | /**
61 | * Checks if the current filter matches the supplied string.
62 | * If the current query property is a string it will be auto converted to a {@link FooTable.Query} object to perform the match.
63 | * @instance
64 | * @param {string} str - The string to check.
65 | * @returns {boolean}
66 | */
67 | match: function(str){
68 | if (!F.is.string(str)) return false;
69 | if (F.is.string(this.query)){
70 | this.query = new F.Query(this.query, this.space, this.connectors, this.ignoreCase);
71 | }
72 | return this.query instanceof F.Query ? this.query.match(str) : false;
73 | },
74 | /**
75 | * Checks if the current filter matches the supplied {@link FooTable.Row}.
76 | * @instance
77 | * @param {FooTable.Row} row - The row to check.
78 | * @returns {boolean}
79 | */
80 | matchRow: function(row){
81 | var self = this, text = F.arr.map(row.cells, function(cell){
82 | return F.arr.contains(self.columns, cell.column) ? cell.filterValue : null;
83 | }).join(' ');
84 | return self.match(text);
85 | }
86 | });
87 |
88 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/filtering/extends/FooTable.Cell.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | /**
4 | * The value used by the filtering component during filter operations. Must be a string and can be set using the data-filter-value attribute on the cell itself.
5 | * If this is not supplied it is set to the result of the toString method called on the value for the cell. Added by the {@link FooTable.Filtering} component.
6 | * @type {string}
7 | * @default null
8 | */
9 | F.Cell.prototype.filterValue = null;
10 |
11 | // this is used to define the filtering specific properties on cell creation
12 | F.Cell.prototype.__filtering_define__ = function(valueOrElement){
13 | this.filterValue = this.column.filterValue.call(this.column, valueOrElement);
14 | };
15 |
16 | // this is used to update the filterValue property whenever the cell value is changed
17 | F.Cell.prototype.__filtering_val__ = function(value){
18 | if (F.is.defined(value)){
19 | // set only
20 | this.filterValue = this.column.filterValue.call(this.column, value);
21 | }
22 | };
23 |
24 | // overrides the public define method and replaces it with our own
25 | F.Cell.extend('define', function(valueOrElement){
26 | this._super(valueOrElement);
27 | this.__filtering_define__(valueOrElement);
28 | });
29 | // overrides the public val method and replaces it with our own
30 | F.Cell.extend('val', function(value, redraw, redrawSelf){
31 | var val = this._super(value, redraw, redrawSelf);
32 | this.__filtering_val__(value);
33 | return val;
34 | });
35 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/filtering/extends/FooTable.Column.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 | /**
3 | * Whether or not the column can be used during filtering. Added by the {@link FooTable.Filtering} component.
4 | * @type {boolean}
5 | * @default true
6 | */
7 | F.Column.prototype.filterable = true;
8 |
9 | /**
10 | * This is supplied either the cell value or jQuery object to parse. A string value must be returned from this method and will be used during filtering operations.
11 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
12 | * @returns {string}
13 | * @this FooTable.Column
14 | */
15 | F.Column.prototype.filterValue = function(valueOrElement){
16 | // if we have an element or a jQuery object use jQuery to get the value
17 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){
18 | var data = $(valueOrElement).data('filterValue');
19 | return F.is.defined(data) ? ''+data : $(valueOrElement).text();
20 | }
21 | // if options are supplied with the value
22 | if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){
23 | if (F.is.string(valueOrElement.options.filterValue)) return valueOrElement.options.filterValue;
24 | if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value;
25 | }
26 | if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement+''; // use the native toString of the value
27 | return ''; // otherwise we have no value so return an empty string
28 | };
29 |
30 | // this is used to define the filtering specific properties on column creation
31 | F.Column.prototype.__filtering_define__ = function(definition){
32 | this.filterable = F.is.boolean(definition.filterable) ? definition.filterable : this.filterable;
33 | this.filterValue = F.checkFnValue(this, definition.filterValue, this.filterValue);
34 | };
35 |
36 | // overrides the public define method and replaces it with our own
37 | F.Column.extend('define', function(definition){
38 | this._super(definition); // call the base so we don't have to redefine any previously set properties
39 | this.__filtering_define__(definition); // then call our own
40 | });
41 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/filtering/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * An object containing the filtering options for the plugin. Added by the {@link FooTable.Filtering} component.
4 | * @type {object}
5 | * @prop {boolean} enabled=false - Whether or not to allow filtering on the table.
6 | * @prop {({name: string, query: (string|FooTable.Query), columns: (Array.|Array.|Array.)}|Array.)} filters - The filters to apply to the current {@link FooTable.Rows#array}.
7 | * @prop {number} delay=1200 - The delay in milliseconds before the query is auto applied after a change (any value equal to or less than zero will disable this).
8 | * @prop {number} min=1 - The minimum number of characters allowed in the search input before it is auto applied.
9 | * @prop {string} space="AND" - Specifies how whitespace in a filter query is handled.
10 | * @prop {string} placeholder="Search" - The string used as the placeholder for the search input.
11 | * @prop {string} dropdownTitle=null - The title to display at the top of the search input column select.
12 | * @prop {string} position="right" - The string used to specify the alignment of the search input.
13 | * @prop {string} connectors=true - Whether or not to replace phrase connectors (+.-_) with space before executing the query.
14 | * @prop {boolean} ignoreCase=true - Whether or not ignore case when matching.
15 | * @prop {boolean} exactMatch=false - Whether or not search queries are treated as phrases when matching.
16 | * @prop {boolean} focus=true - Whether or not to focus the search input after the search/clear button is clicked or after auto applying the search input query.
17 | * @prop {string} container=null - A selector specifying where to place the filtering components form, if null the form is displayed within a row in the head of the table.
18 | */
19 | F.Defaults.prototype.filtering = {
20 | enabled: false,
21 | filters: [],
22 | delay: 1200,
23 | min: 1,
24 | space: 'AND',
25 | placeholder: 'Search',
26 | dropdownTitle: null,
27 | position: 'right',
28 | connectors: true,
29 | ignoreCase: true,
30 | exactMatch: false,
31 | focus: true,
32 | container: null
33 | };
34 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/filtering/extends/FooTable.Row.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * Checks if the row is filtered using the supplied filters.
4 | * @this FooTable.Row
5 | * @param {Array.} filters - The filters to apply.
6 | * @returns {boolean}
7 | */
8 | F.Row.prototype.filtered = function(filters){
9 | var result = true, self = this;
10 | F.arr.each(filters, function(f){
11 | if ((result = f.matchRow(self)) == false) return false;
12 | });
13 | return result;
14 | };
15 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/paging/FooTable.Pager.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.Pager = F.Class.extend(/** @lends FooTable.Pager */{
4 | /**
5 | * The pager object contains the page number and direction to page to.
6 | * @constructs
7 | * @extends FooTable.Class
8 | * @param {number} total - The total number of pages available.
9 | * @param {number} current - The current page number.
10 | * @param {number} size - The number of rows per page.
11 | * @param {number} page - The page number to goto.
12 | * @param {boolean} forward - A boolean indicating the direction of paging, TRUE = forward, FALSE = back.
13 | * @returns {FooTable.Pager}
14 | */
15 | construct: function(total, current, size, page, forward){
16 | /**
17 | * The total number of pages available.
18 | * @type {number}
19 | */
20 | this.total = total;
21 | /**
22 | * The current page number.
23 | * @type {number}
24 | */
25 | this.current = current;
26 | /**
27 | * The number of rows per page.
28 | * @type {number}
29 | */
30 | this.size = size;
31 | /**
32 | * The page number to goto.
33 | * @type {number}
34 | */
35 | this.page = page;
36 | /**
37 | * A boolean indicating the direction of paging, TRUE = forward, FALSE = back.
38 | * @type {boolean}
39 | */
40 | this.forward = forward;
41 | }
42 | });
43 |
44 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/paging/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * An object containing the paging options for the plugin. Added by the {@link FooTable.Paging} component.
4 | * @type {object}
5 | * @prop {boolean} enabled=false - Whether or not to allow paging on the table.
6 | * @prop {string} countFormat="{CP} of {TP}" - A string format used to generate the page count text.
7 | * @prop {number} current=1 - The page number to display.
8 | * @prop {number} limit=5 - The maximum number of page links to display at once.
9 | * @prop {string} position="center" - The string used to specify the alignment of the pagination control.
10 | * @prop {number} size=10 - The number of rows displayed per page.
11 | * @prop {string} container=null - A selector specifying where to place the paging components UI, if null the UI is displayed within a row in the foot of the table.
12 | * @prop {object} strings - An object containing the strings used by the paging buttons.
13 | * @prop {string} strings.first="«" - The string used for the 'first' button.
14 | * @prop {string} strings.prev="‹" - The string used for the 'previous' button.
15 | * @prop {string} strings.next="›" - The string used for the 'next' button.
16 | * @prop {string} strings.last="»" - The string used for the 'last' button.
17 | * @prop {string} strings.prevPages="..." - The string used for the 'previous X pages' button.
18 | * @prop {string} strings.nextPages="..." - The string used for the 'next X pages' button.
19 | */
20 | F.Defaults.prototype.paging = {
21 | enabled: false,
22 | countFormat: '{CP} of {TP}',
23 | current: 1,
24 | limit: 5,
25 | position: 'center',
26 | size: 10,
27 | container: null,
28 | strings: {
29 | first: '«',
30 | prev: '‹',
31 | next: '›',
32 | last: '»',
33 | prevPages: '...',
34 | nextPages: '...'
35 | }
36 | };
37 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/paging/extends/FooTable.Table.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * Navigates to the specified page number. Added by the {@link FooTable.Paging} component.
4 | * @instance
5 | * @param {number} num - The page number to go to.
6 | * @returns {jQuery.Promise}
7 | * @fires FooTable.Paging#paging_changing
8 | * @fires FooTable.Paging#paging_changed
9 | * @see FooTable.Paging#goto
10 | */
11 | F.Table.prototype.gotoPage = function(num){
12 | return this.use(F.Paging).goto(num);
13 | };
14 |
15 | /**
16 | * Navigates to the next page. Added by the {@link FooTable.Paging} component.
17 | * @instance
18 | * @returns {jQuery.Promise}
19 | * @fires FooTable.Paging#paging_changing
20 | * @fires FooTable.Paging#paging_changed
21 | * @see FooTable.Paging#next
22 | */
23 | F.Table.prototype.nextPage = function(){
24 | return this.use(F.Paging).next();
25 | };
26 |
27 | /**
28 | * Navigates to the previous page. Added by the {@link FooTable.Paging} component.
29 | * @instance
30 | * @returns {jQuery.Promise}
31 | * @fires FooTable.Paging#paging_changing
32 | * @fires FooTable.Paging#paging_changed
33 | * @see FooTable.Paging#prev
34 | */
35 | F.Table.prototype.prevPage = function(){
36 | return this.use(F.Paging).prev();
37 | };
38 |
39 | /**
40 | * Navigates to the first page. Added by the {@link FooTable.Paging} component.
41 | * @instance
42 | * @returns {jQuery.Promise}
43 | * @fires FooTable.Paging#paging_changing
44 | * @fires FooTable.Paging#paging_changed
45 | * @see FooTable.Paging#first
46 | */
47 | F.Table.prototype.firstPage = function(){
48 | return this.use(F.Paging).first();
49 | };
50 |
51 | /**
52 | * Navigates to the last page. Added by the {@link FooTable.Paging} component.
53 | * @instance
54 | * @returns {jQuery.Promise}
55 | * @fires FooTable.Paging#paging_changing
56 | * @fires FooTable.Paging#paging_changed
57 | * @see FooTable.Paging#last
58 | */
59 | F.Table.prototype.lastPage = function(){
60 | return this.use(F.Paging).last();
61 | };
62 |
63 | /**
64 | * Shows the next X number of pages in the pagination control where X is the value set by the {@link FooTable.Defaults#paging} - limit.size option value. Added by the {@link FooTable.Paging} component.
65 | * @instance
66 | * @see FooTable.Paging#nextPages
67 | */
68 | F.Table.prototype.nextPages = function(){
69 | return this.use(F.Paging).nextPages();
70 | };
71 |
72 | /**
73 | * Shows the previous X number of pages in the pagination control where X is the value set by the {@link FooTable.Defaults#paging} - limit.size option value. Added by the {@link FooTable.Paging} component.
74 | * @instance
75 | * @see FooTable.Paging#prevPages
76 | */
77 | F.Table.prototype.prevPages = function(){
78 | return this.use(F.Paging).prevPages();
79 | };
80 |
81 | /**
82 | * Gets or sets the current page size
83 | * @instance
84 | * @param {number} [value] - The new page size to use.
85 | * @returns {(number|undefined)}
86 | * @see FooTable.Paging#pageSize
87 | */
88 | F.Table.prototype.pageSize = function(value){
89 | return this.use(F.Paging).pageSize(value);
90 | };
91 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/rows/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * An array of JSON objects containing the row data or a jQuery promise that resolves returning the row data.
4 | * @type {(Array.|jQuery.Promise)}
5 | * @default []
6 | */
7 | F.Defaults.prototype.rows = [];
8 |
9 | /**
10 | * A string to display when there are no rows in the table.
11 | * @type {string}
12 | * @default "No results"
13 | */
14 | F.Defaults.prototype.empty = 'No results';
15 |
16 | /**
17 | * Whether or not the toggle is appended to each row.
18 | * @type {boolean}
19 | * @default true
20 | */
21 | F.Defaults.prototype.showToggle = true;
22 |
23 | /**
24 | * The CSS selector used to filter row click events. If the event.target property matches the selector the row will be toggled.
25 | * @type {string}
26 | * @default "tr,td,.footable-toggle"
27 | */
28 | F.Defaults.prototype.toggleSelector = 'tr,td,.footable-toggle';
29 |
30 | /**
31 | * Specifies which column to display the row toggle in. The only supported values are "first" or "last".
32 | * @type {string}
33 | * @default "first"
34 | */
35 | F.Defaults.prototype.toggleColumn = 'first';
36 |
37 | /**
38 | * Whether or not the first rows details are expanded by default when displayed on a device that hides any columns.
39 | * @type {boolean}
40 | */
41 | F.Defaults.prototype.expandFirst = false;
42 |
43 | /**
44 | * Whether or not all row details are expanded by default when displayed on a device that hides any columns.
45 | * @type {boolean}
46 | */
47 | F.Defaults.prototype.expandAll = false;
48 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/rows/extends/FooTable.Table.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * Loads a JSON array of row objects into the table
4 | * @param {Array.} data - An array of row objects to load.
5 | * @param {boolean} [append=false] - Whether or not to append the new rows to the current rows array or to replace them entirely.
6 | */
7 | F.Table.prototype.loadRows = function(data, append){
8 | this.rows.load(data, append);
9 | };
10 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/FooTable.Sorter.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.Sorter = F.Class.extend(/** @lends FooTable.Sorter */{
4 | /**
5 | * The sorter object contains the column and direction to sort by.
6 | * @constructs
7 | * @extends FooTable.Class
8 | * @param {FooTable.Column} column - The column to sort.
9 | * @param {string} direction - The direction to sort by.
10 | * @returns {FooTable.Sorter}
11 | */
12 | construct: function(column, direction){
13 | /**
14 | * The column to sort.
15 | * @type {FooTable.Column}
16 | */
17 | this.column = column;
18 | /**
19 | * The direction to sort by.
20 | * @type {string}
21 | */
22 | this.direction = direction;
23 | }
24 | });
25 |
26 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/extends/FooTable.Cell.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | /**
4 | * The value used by the sorting component during sort operations. Can be set using the data-sort-value attribute on the cell itself.
5 | * If this is not supplied it is set to the result of the toString method called on the value for the cell. Added by the {@link FooTable.Sorting} component.
6 | * @type {string}
7 | * @default null
8 | */
9 | F.Cell.prototype.sortValue = null;
10 |
11 | // this is used to define the sorting specific properties on cell creation
12 | F.Cell.prototype.__sorting_define__ = function(valueOrElement){
13 | this.sortValue = this.column.sortValue.call(this.column, valueOrElement);
14 | };
15 |
16 | // this is used to update the sortValue property whenever the cell value is changed
17 | F.Cell.prototype.__sorting_val__ = function(value){
18 | if (F.is.defined(value)){
19 | // set only
20 | this.sortValue = this.column.sortValue.call(this.column, value);
21 | }
22 | };
23 |
24 | // overrides the public define method and replaces it with our own
25 | F.Cell.extend('define', function(valueOrElement){
26 | this._super(valueOrElement);
27 | this.__sorting_define__(valueOrElement);
28 | });
29 | // overrides the public val method and replaces it with our own
30 | F.Cell.extend('val', function(value, redraw, redrawSelf){
31 | var val = this._super(value, redraw, redrawSelf);
32 | this.__sorting_val__(value);
33 | return val;
34 | });
35 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/extends/FooTable.Column.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 | /**
3 | * The direction to sort if the {@link FooTable.Column#sorted} property is set to true. Can be "ASC", "DESC" or NULL. Added by the {@link FooTable.Sorting} component.
4 | * @type {string}
5 | * @default null
6 | */
7 | F.Column.prototype.direction = null;
8 | /**
9 | * Whether or not the column can be sorted. Added by the {@link FooTable.Sorting} component.
10 | * @type {boolean}
11 | * @default true
12 | */
13 | F.Column.prototype.sortable = true;
14 | /**
15 | * Whether or not the column is sorted. Added by the {@link FooTable.Sorting} component.
16 | * @type {boolean}
17 | * @default false
18 | */
19 | F.Column.prototype.sorted = false;
20 |
21 | /**
22 | * This is supplied two values from the column for a comparison to be made and the result returned. Added by the {@link FooTable.Sorting} component.
23 | * @param {*} a - The first value to be compared.
24 | * @param {*} b - The second value to compare to the first.
25 | * @returns {number}
26 | * @example This example shows using pseudo code what a sort function would look like.
27 | * "sorter": function(a, b){
28 | * if (a is less than b by some ordering criterion) {
29 | * return -1;
30 | * }
31 | * if (a is greater than b by the ordering criterion) {
32 | * return 1;
33 | * }
34 | * // a must be equal to b
35 | * return 0;
36 | * }
37 | */
38 | F.Column.prototype.sorter = function(a, b){
39 | if (typeof a === 'string') a = a.toLowerCase();
40 | if (typeof b === 'string') b = b.toLowerCase();
41 | if (a === b) return 0;
42 | if (a < b) return -1;
43 | return 1;
44 | };
45 |
46 | /**
47 | * This is supplied either the cell value or jQuery object to parse. A value must be returned from this method and will be used during sorting operations.
48 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
49 | * @returns {*}
50 | * @this FooTable.Column
51 | */
52 | F.Column.prototype.sortValue = function(valueOrElement){
53 | // if we have an element or a jQuery object use jQuery to get the value
54 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){
55 | var data = $(valueOrElement).data('sortValue');
56 | return F.is.defined(data) ? data : this.parser(valueOrElement);
57 | }
58 | // if options are supplied with the value
59 | if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){
60 | if (F.is.string(valueOrElement.options.sortValue)) return valueOrElement.options.sortValue;
61 | if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value;
62 | }
63 | if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement;
64 | return null;
65 | };
66 |
67 | // this is used to define the sorting specific properties on column creation
68 | F.Column.prototype.__sorting_define__ = function(definition){
69 | this.sorter = F.checkFnValue(this, definition.sorter, this.sorter);
70 | this.direction = F.is.type(definition.direction, 'string') ? F.Sorting.dir(definition.direction) : null;
71 | this.sortable = F.is.boolean(definition.sortable) ? definition.sortable : true;
72 | this.sorted = F.is.boolean(definition.sorted) ? definition.sorted : false;
73 | this.sortValue = F.checkFnValue(this, definition.sortValue, this.sortValue);
74 | };
75 |
76 | // overrides the public define method and replaces it with our own
77 | F.Column.extend('define', function(definition){
78 | this._super(definition);
79 | this.__sorting_define__(definition);
80 | });
81 |
82 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * An object containing the sorting options for the plugin. Added by the {@link FooTable.Sorting} component.
4 | * @type {object}
5 | * @prop {boolean} enabled=false - Whether or not to allow sorting on the table.
6 | */
7 | F.Defaults.prototype.sorting = {
8 | enabled: false
9 | };
10 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/extends/FooTable.HTMLColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | F.HTMLColumn.extend('__sorting_define__', function(definition){
4 | this._super(definition);
5 | this.sortUse = F.is.string(definition.sortUse) && $.inArray(definition.sortUse, ['html','text']) !== -1 ? definition.sortUse : 'html';
6 | });
7 |
8 | /**
9 | * This is supplied either the cell value or jQuery object to parse. A value must be returned from this method and will be used during sorting operations.
10 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
11 | * @returns {*}
12 | * @this FooTable.HTMLColumn
13 | */
14 | F.HTMLColumn.prototype.sortValue = function(valueOrElement){
15 | // if we have an element or a jQuery object use jQuery to get the data value or pass it off to the parser
16 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){
17 | var data = $(valueOrElement).data('sortValue');
18 | return F.is.defined(data) ? data : this.parser(valueOrElement);
19 | }
20 | // if options are supplied with the value
21 | if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){
22 | if (F.is.string(valueOrElement.options.sortValue)) return valueOrElement.options.sortValue;
23 | if (F.is.defined(valueOrElement.value)) valueOrElement = valueOrElement.value;
24 | }
25 | if (F.is.defined(valueOrElement) && valueOrElement != null) return valueOrElement;
26 | return null;
27 | };
28 |
29 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/extends/FooTable.NumberColumn.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | /**
4 | * This is supplied either the cell value or jQuery object to parse. A value must be returned from this method and will be used during sorting operations.
5 | * @param {(*|jQuery)} valueOrElement - The value or jQuery cell object.
6 | * @returns {*}
7 | */
8 | F.NumberColumn.prototype.sortValue = function(valueOrElement){
9 | // if we have an element or a jQuery object use jQuery to get the data value or pass it off to the parser
10 | if (F.is.element(valueOrElement) || F.is.jq(valueOrElement)){
11 | var data = $(valueOrElement).data('sortValue');
12 | return F.is.number(data) ? data : this.parser(valueOrElement);
13 | }
14 | // if options are supplied with the value
15 | if (F.is.hash(valueOrElement) && F.is.hash(valueOrElement.options)){
16 | if (F.is.string(valueOrElement.options.sortValue)) return this.parser(valueOrElement);
17 | if (F.is.number(valueOrElement.options.sortValue)) return valueOrElement.options.sortValue;
18 | if (F.is.number(valueOrElement.value)) return valueOrElement.value;
19 | }
20 | if (F.is.string(valueOrElement)) return this.parser(valueOrElement);
21 | if (F.is.number(valueOrElement)) return valueOrElement;
22 | return null;
23 | };
24 |
25 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/sorting/extends/FooTable.Table.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 | /**
3 | * Sort the table using the specified column and direction. Added by the {@link FooTable.Sorting} component.
4 | * @instance
5 | * @param {(string|number|FooTable.Column)} column - The column name, index or the actual {@link FooTable.Column} object to sort by.
6 | * @param {string} [direction="ASC"] - The direction to sort by, either ASC or DESC.
7 | * @returns {jQuery.Promise}
8 | * @fires FooTable.Sorting#"change.ft.sorting"
9 | * @fires FooTable.Sorting#"changed.ft.sorting"
10 | * @see FooTable.Sorting#sort
11 | */
12 | F.Table.prototype.sort = function(column, direction){
13 | return this.use(F.Sorting).sort(column, direction);
14 | };
15 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/FooTable.State.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | // global int to use if the table has no ID
4 | var _uid = 0,
5 | // a hash value for the current url
6 | _url_hash = (function(str){
7 | var i, l, hval = 0x811c9dc5;
8 | for (i = 0, l = str.length; i < l; i++) {
9 | hval ^= str.charCodeAt(i);
10 | hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
11 | }
12 | return hval >>> 0;
13 | })(location.origin + location.pathname);
14 |
15 | F.State = F.Component.extend(/** @lends FooTable.State */{
16 | /**
17 | * The state component adds the ability for the table to remember its basic state for filtering, paging and sorting.
18 | * @constructs
19 | * @extends FooTable.Component
20 | * @param {FooTable.Table} table - The parent {@link FooTable.Table} object for the component.
21 | * @returns {FooTable.State}
22 | */
23 | construct: function(table){
24 | // call the constructor of the base class
25 | this._super(table, table.o.state.enabled);
26 | // Change this value if an update to this component requires any stored data to be reset
27 | this._key = '1';
28 | /**
29 | * The key to use to store the state for this table.
30 | * @type {(null|string)}
31 | */
32 | this.key = this._key + (F.is.string(table.o.state.key) ? table.o.state.key : this._uid());
33 | /**
34 | * Whether or not to allow the filtering component to store it's state.
35 | * @type {boolean}
36 | */
37 | this.filtering = F.is.boolean(table.o.state.filtering) ? table.o.state.filtering : true;
38 | /**
39 | * Whether or not to allow the paging component to store it's state.
40 | * @type {boolean}
41 | */
42 | this.paging = F.is.boolean(table.o.state.paging) ? table.o.state.paging : true;
43 | /**
44 | * Whether or not to allow the sorting component to store it's state.
45 | * @type {boolean}
46 | */
47 | this.sorting = F.is.boolean(table.o.state.sorting) ? table.o.state.sorting : true;
48 | },
49 | /* PROTECTED */
50 | /**
51 | * Checks the supplied data and options for the state component.
52 | * @instance
53 | * @protected
54 | * @param {object} data - The jQuery data object from the parent table.
55 | * @fires FooTable.State#"preinit.ft.state"
56 | * @this FooTable.State
57 | */
58 | preinit: function(data){
59 | var self = this;
60 | /**
61 | * The preinit.ft.state event is raised before the UI is created and provides the tables jQuery data object for additional options parsing.
62 | * Calling preventDefault on this event will disable the component.
63 | * @event FooTable.State#"preinit.ft.state"
64 | * @param {jQuery.Event} e - The jQuery.Event object for the event.
65 | * @param {FooTable.Table} ft - The instance of the plugin raising the event.
66 | * @param {object} data - The jQuery data object of the table raising the event.
67 | */
68 | this.ft.raise('preinit.ft.state', [data]).then(function(){
69 |
70 | self.enabled = F.is.boolean(data.state)
71 | ? data.state
72 | : self.enabled;
73 |
74 | if (!self.enabled) return;
75 |
76 | self.key = self._key + (F.is.string(data.stateKey) ? data.stateKey : self.key);
77 |
78 | self.filtering = F.is.boolean(data.stateFiltering) ? data.stateFiltering : self.filtering;
79 |
80 | self.paging = F.is.boolean(data.statePaging) ? data.statePaging : self.paging;
81 |
82 | self.sorting = F.is.boolean(data.stateSorting) ? data.stateSorting : self.sorting;
83 |
84 | }, function(){
85 | self.enabled = false;
86 | });
87 | },
88 | /**
89 | * Gets the state value for the specified key for this table.
90 | * @instance
91 | * @param {string} key - The key to get the value for.
92 | * @returns {(*|null)}
93 | */
94 | get: function(key){
95 | return JSON.parse(localStorage.getItem(this.key + ':' + key));
96 | },
97 | /**
98 | * Sets the state value for the specified key for this table.
99 | * @instance
100 | * @param {string} key - The key to set the value for.
101 | * @param {*} data - The value to store for the key. This value must be JSON.stringify friendly.
102 | */
103 | set: function(key, data){
104 | localStorage.setItem(this.key + ':' + key, JSON.stringify(data));
105 | },
106 | /**
107 | * Clears the state value for the specified key for this table.
108 | * @instance
109 | * @param {string} key - The key to clear the value for.
110 | */
111 | remove: function(key){
112 | localStorage.removeItem(this.key + ':' + key);
113 | },
114 | /**
115 | * Executes the {@link FooTable.Component#readState} function on all components.
116 | * @instance
117 | */
118 | read: function(){
119 | this.ft.execute(false, true, 'readState');
120 | },
121 | /**
122 | * Executes the {@link FooTable.Component#writeState} function on all components.
123 | * @instance
124 | */
125 | write: function(){
126 | this.ft.execute(false, true, 'writeState');
127 | },
128 | /**
129 | * Executes the {@link FooTable.Component#clearState} function on all components.
130 | * @instance
131 | */
132 | clear: function(){
133 | this.ft.execute(false, true, 'clearState');
134 | },
135 | /**
136 | * Generates a unique identifier for the current {@link FooTable.Table} if one is not supplied through the options.
137 | * This value is a combination of the url hash and either the element ID or an incremented global int value.
138 | * @instance
139 | * @returns {*}
140 | * @private
141 | */
142 | _uid: function(){
143 | var id = this.ft.$el.attr('id');
144 | return _url_hash + '_' + (F.is.string(id) ? id : ++_uid);
145 | }
146 | });
147 |
148 | F.components.register('state', F.State, 700);
149 |
150 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/extends/FooTable.Component.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | /**
4 | * This method is called from the {@link FooTable.State#read} method and allows a component to retrieve its' stored state.
5 | * @instance
6 | * @protected
7 | * @function
8 | */
9 | F.Component.prototype.readState = function(){};
10 |
11 | /**
12 | * This method is called from the {@link FooTable.State#write} method and allows a component to write its' current state to the store.
13 | * @instance
14 | * @protected
15 | * @function
16 | */
17 | F.Component.prototype.writeState = function(){};
18 |
19 | /**
20 | * This method is called from the {@link FooTable.State#clear} method and allows a component to clear any stored state.
21 | * @instance
22 | * @protected
23 | * @function
24 | */
25 | F.Component.prototype.clearState = function(){};
26 |
27 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/extends/FooTable.Defaults.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | /**
4 | * An object containing the state options for the plugin. Added by the {@link FooTable.State} component.
5 | * @type {object}
6 | * @prop {boolean} enabled=false - Whether or not to allow state to be stored for the table. This overrides the individual component enable options.
7 | * @prop {boolean} filtering=true - Whether or not to allow the filtering state to be stored.
8 | * @prop {boolean} paging=true - Whether or not to allow the filtering state to be stored.
9 | * @prop {boolean} sorting=true - Whether or not to allow the filtering state to be stored.
10 | * @prop {string} key=null - The unique key to use to store the table's data.
11 | */
12 | F.Defaults.prototype.state = {
13 | enabled: false,
14 | filtering: true,
15 | paging: true,
16 | sorting: true,
17 | key: null
18 | };
19 |
20 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/extends/FooTable.Filtering.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | if (!F.Filtering) return;
4 |
5 | /**
6 | * Allows the filtering component to retrieve its' stored state.
7 | */
8 | F.Filtering.prototype.readState = function(){
9 | if (this.ft.state.filtering){
10 | var state = this.ft.state.get('filtering');
11 | if (F.is.hash(state) && !F.is.emptyArray(state.filters)){
12 | this.filters = this.ensure(state.filters);
13 | }
14 | }
15 | };
16 |
17 | /**
18 | * Allows the filtering component to write its' current state to the store.
19 | */
20 | F.Filtering.prototype.writeState = function(){
21 | if (this.ft.state.filtering) {
22 | var filters = F.arr.map(this.filters, function (f) {
23 | return {
24 | name: f.name,
25 | query: f.query instanceof F.Query ? f.query.val() : f.query,
26 | columns: F.arr.map(f.columns, function (c) {
27 | return c.name;
28 | }),
29 | hidden: f.hidden,
30 | space: f.space,
31 | connectors: f.connectors,
32 | ignoreCase: f.ignoreCase
33 | };
34 | });
35 | this.ft.state.set('filtering', {filters: filters});
36 | }
37 | };
38 |
39 | /**
40 | * Allows the filtering component to clear any stored state.
41 | */
42 | F.Filtering.prototype.clearState = function(){
43 | if (this.ft.state.filtering) {
44 | this.ft.state.remove('filtering');
45 | }
46 | };
47 |
48 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/extends/FooTable.Paging.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | if (!F.Paging) return;
4 |
5 | /**
6 | * Allows the paging component to retrieve its' stored state.
7 | */
8 | F.Paging.prototype.readState = function(){
9 | if (this.ft.state.paging) {
10 | var state = this.ft.state.get('paging');
11 | if (F.is.hash(state)) {
12 | this.current = state.current;
13 | this.size = state.size;
14 | }
15 | }
16 | };
17 |
18 | /**
19 | * Allows the paging component to write its' current state to the store.
20 | */
21 | F.Paging.prototype.writeState = function(){
22 | if (this.ft.state.paging) {
23 | this.ft.state.set('paging', {
24 | current: this.current,
25 | size: this.size
26 | });
27 | }
28 | };
29 |
30 | /**
31 | * Allows the paging component to clear any stored state.
32 | */
33 | F.Paging.prototype.clearState = function(){
34 | if (this.ft.state.paging) {
35 | this.ft.state.remove('paging');
36 | }
37 | };
38 |
39 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/extends/FooTable.Sorting.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | if (!F.Sorting) return;
4 |
5 | /**
6 | * Allows the sorting component to retrieve its' stored state.
7 | */
8 | F.Sorting.prototype.readState = function(){
9 | if (this.ft.state.sorting) {
10 | var state = this.ft.state.get('sorting');
11 | if (F.is.hash(state)) {
12 | var column = this.ft.columns.get(state.column);
13 | if (column instanceof F.Column) {
14 | this.column = column;
15 | this.column.direction = state.direction;
16 | }
17 | }
18 | }
19 | };
20 |
21 | /**
22 | * Allows the sorting component to write its' current state to the store.
23 | */
24 | F.Sorting.prototype.writeState = function(){
25 | if (this.ft.state.sorting && this.column instanceof F.Column){
26 | this.ft.state.set('sorting', {
27 | column: this.column.name,
28 | direction: this.column.direction
29 | });
30 | }
31 | };
32 |
33 | /**
34 | * Allows the sorting component to clear any stored state.
35 | */
36 | F.Sorting.prototype.clearState = function(){
37 | if (this.ft.state.sorting) {
38 | this.ft.state.remove('sorting');
39 | }
40 | };
41 |
42 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/components/state/extends/FooTable.Table.js:
--------------------------------------------------------------------------------
1 | (function(F){
2 |
3 | // hook into the _construct method so we can add the state property to the table.
4 | F.Table.extend('_construct', function(ready){
5 | this.state = this.use(FooTable.State);
6 | return this._super(ready);
7 | });
8 |
9 | // hook into the _preinit method so we can trigger a plugin wide read state operation.
10 | F.Table.extend('_preinit', function(){
11 | var self = this;
12 | return self._super().then(function(){
13 | if (self.state.enabled){
14 | self.state.read();
15 | }
16 | });
17 | });
18 |
19 | // hook into the draw method so we can trigger a plugin wide write state operation.
20 | F.Table.extend('draw', function(){
21 | var self = this;
22 | return self._super().then(function(){
23 | if (self.state.enabled){
24 | self.state.write();
25 | }
26 | });
27 | });
28 |
29 | })(FooTable);
--------------------------------------------------------------------------------
/src/js/utils/FooTable.js:
--------------------------------------------------------------------------------
1 | (function($, F){
2 |
3 | /**
4 | * Converts the supplied cssText string into JSON object.
5 | * @param {string} cssText - The cssText to convert to a JSON object.
6 | * @returns {object}
7 | */
8 | F.css2json = function(cssText){
9 | if (F.is.emptyString(cssText)) return {};
10 | var json = {}, props = cssText.split(';'), pair, key, value;
11 | for (var i = 0, i_len = props.length; i < i_len; i++){
12 | if (F.is.emptyString(props[i])) continue;
13 | pair = props[i].split(':');
14 | if (F.is.emptyString(pair[0]) || F.is.emptyString(pair[1])) continue;
15 | key = F.str.toCamelCase($.trim(pair[0]));
16 | value = $.trim(pair[1]);
17 | json[key] = value;
18 | }
19 | return json;
20 | };
21 |
22 | /**
23 | * Attempts to retrieve a function pointer using the given name.
24 | * @param {string} functionName - The name of the function to fetch a pointer to.
25 | * @returns {(function|object|null)}
26 | */
27 | F.getFnPointer = function(functionName){
28 | if (F.is.emptyString(functionName)) return null;
29 | var pointer = window,
30 | parts = functionName.split('.');
31 | F.arr.each(parts, function(part){
32 | if (pointer[part]) pointer = pointer[part];
33 | });
34 | return F.is.fn(pointer) ? pointer : null;
35 | };
36 |
37 | /**
38 | * Checks the value for function properties such as the {@link FooTable.Column#formatter} option which could also be specified using just the name
39 | * and attempts to return the correct function pointer or null if none was found matching the value.
40 | * @param {FooTable.Class} self - The class to use as the 'this' keyword within the context of the function.
41 | * @param {(function|string)} value - The actual function or the name of the function for the property.
42 | * @param {function} [def] - A default function to return if none is found.
43 | * @returns {(function|null)}
44 | */
45 | F.checkFnValue = function(self, value, def){
46 | def = F.is.fn(def) ? def : null;
47 | function wrap(t, fn, d){
48 | if (!F.is.fn(fn)) return d;
49 | return function(){
50 | return fn.apply(t, arguments);
51 | };
52 | }
53 | return F.is.fn(value) ? wrap(self, value, def) : (F.is.type(value, 'string') ? wrap(self, F.getFnPointer(value), def) : def);
54 | };
55 |
56 | })(jQuery, FooTable);
--------------------------------------------------------------------------------
/src/js/utils/core/FooTable.str.js:
--------------------------------------------------------------------------------
1 | (function (F) {
2 | /**
3 | * This namespace contains commonly used string utility methods.
4 | * @namespace FooTable.str
5 | */
6 | F.str = {};
7 |
8 | /**
9 | * Checks if the supplied string contains the given substring.
10 | * @memberof FooTable.str
11 | * @function contains
12 | * @param {string} str - The string to check.
13 | * @param {string} contains - The string to check for.
14 | * @param {boolean} [ignoreCase=false] - Whether or not to ignore casing when performing the check.
15 | * @returns {boolean}
16 | */
17 | F.str.contains = function (str, contains, ignoreCase) {
18 | if (F.is.emptyString(str) || F.is.emptyString(contains)) return false;
19 | return contains.length <= str.length
20 | && (ignoreCase ? str.toUpperCase().indexOf(contains.toUpperCase()) : str.indexOf(contains)) !== -1;
21 | };
22 |
23 | /**
24 | * Checks if the supplied string contains the exact given substring.
25 | * @memberof FooTable.str
26 | * @function contains
27 | * @param {string} str - The string to check.
28 | * @param {string} contains - The string to check for.
29 | * @param {boolean} [ignoreCase=false] - Whether or not to ignore casing when performing the check.
30 | * @returns {boolean}
31 | */
32 | F.str.containsExact = function (str, contains, ignoreCase) {
33 | if (F.is.emptyString(str) || F.is.emptyString(contains) || contains.length > str.length) return false;
34 | return new RegExp('\\b'+ F.str.escapeRegExp(contains)+'\\b', ignoreCase ? 'i' : '').test(str);
35 | };
36 |
37 | /**
38 | * Checks if the supplied string contains the given word.
39 | * @memberof FooTable.str
40 | * @function containsWord
41 | * @param {string} str - The string to check.
42 | * @param {string} word - The word to check for.
43 | * @param {boolean} [ignoreCase=false] - Whether or not to ignore casing when performing the check.
44 | * @returns {boolean}
45 | */
46 | F.str.containsWord = function(str, word, ignoreCase){
47 | if (F.is.emptyString(str) || F.is.emptyString(word) || str.length < word.length)
48 | return false;
49 | var parts = str.split(/\W/);
50 | for (var i = 0, len = parts.length; i < len; i++){
51 | if (ignoreCase ? parts[i].toUpperCase() == word.toUpperCase() : parts[i] == word) return true;
52 | }
53 | return false;
54 | };
55 |
56 | /**
57 | * Returns the remainder of a string split on the first index of the given substring.
58 | * @memberof FooTable.str
59 | * @function from
60 | * @param {string} str - The string to split.
61 | * @param {string} from - The substring to split on.
62 | * @returns {string}
63 | */
64 | F.str.from = function (str, from) {
65 | if (F.is.emptyString(str)) return str;
66 | return F.str.contains(str, from) ? str.substring(str.indexOf(from) + 1) : str;
67 | };
68 |
69 | /**
70 | * Checks if a string starts with the supplied prefix.
71 | * @memberof FooTable.str
72 | * @function startsWith
73 | * @param {string} str - The string to check.
74 | * @param {string} prefix - The prefix to check for.
75 | * @returns {boolean}
76 | */
77 | F.str.startsWith = function (str, prefix) {
78 | if (F.is.emptyString(str)) return str == prefix;
79 | return str.slice(0, prefix.length) == prefix;
80 | };
81 |
82 | /**
83 | * Takes the supplied string and converts it to camel case.
84 | * @memberof FooTable.str
85 | * @function toCamelCase
86 | * @param {string} str - The string to camel case.
87 | * @returns {string}
88 | */
89 | F.str.toCamelCase = function (str) {
90 | if (F.is.emptyString(str)) return str;
91 | if (str.toUpperCase() === str) return str.toLowerCase();
92 | return str.replace(/^([A-Z])|[-\s_](\w)/g, function (match, p1, p2) {
93 | if (F.is.string(p2)) return p2.toUpperCase();
94 | return p1.toLowerCase();
95 | });
96 | };
97 |
98 | /**
99 | * Generates a random string 9 characters long using the optional prefix if supplied.
100 | * @memberof FooTable.str
101 | * @function random
102 | * @param {string} [prefix] - The prefix to append to the 9 random characters.
103 | * @returns {string}
104 | */
105 | F.str.random = function(prefix){
106 | prefix = F.is.emptyString(prefix) ? '' : prefix;
107 | return prefix + Math.random().toString(36).substr(2, 9);
108 | };
109 |
110 | /**
111 | * Escapes a string for use in a regular expression.
112 | * @memberof FooTable.str
113 | * @function escapeRegExp
114 | * @param {string} str - The string to escape.
115 | * @returns {string}
116 | */
117 | F.str.escapeRegExp = function(str){
118 | if (F.is.emptyString(str)) return str;
119 | return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
120 | };
121 |
122 | })(FooTable);
--------------------------------------------------------------------------------