Skip to content

Commit b3d28c2

Browse files
committed
Added a new option for change the style for all tables, called "tableStyle" (default: striped,condensed,responsive)
1 parent dd33e56 commit b3d28c2

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

conf/default.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@
4444
$conf['showLandingPage'] = 0;
4545
$conf['landingPages'] = '(intro)';
4646
$conf['showPageTools'] = 'always';
47-
$conf['useLocalBootswatch'] = 0;
47+
$conf['useLocalBootswatch'] = 1;
48+
$conf['tableStyle'] = 'striped,condensed,responsive';

conf/metadata.php

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
$meta['fluidContainerBtn'] = array('onoff');
4242
$meta['pageOnPanel'] = array('onoff');
4343
$meta['tableFullWidth'] = array('onoff');
44+
$meta['tableStyle'] = array('multicheckbox', '_choices' => array('striped', 'condensed', 'responsive'));
4445
$meta['browserTitle'] = array('string');
4546
$meta['showLandingPage'] = array('onoff');
4647
$meta['landingPages'] = array('regex');

js/template.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,18 @@ jQuery(document).on('bootstrap3:init', function(e) {
3131

3232
// Tables (no for Rack, Diagram and Edittable Plugins)
3333
if (! jQuery('#edittable__editor').length) {
34-
$dw_content.find('table').not('.rack, .diagram').parent().addClass('table-responsive');
35-
$dw_content.find('table').not('.rack, .diagram').addClass('table table-striped table-condensed');
34+
35+
if (TPL_CONFIG.tableStyle.indexOf('responsive') !== -1) {
36+
$dw_content.find('table').not('.rack, .diagram').parent().addClass('table-responsive');
37+
}
38+
39+
var table_class = ['table'];
40+
41+
if (TPL_CONFIG.tableStyle.indexOf('striped') !== -1) table_class.push('table-striped');
42+
if (TPL_CONFIG.tableStyle.indexOf('condensed') !== -1) table_class.push('table-condensed');
43+
44+
$dw_content.find('table').not('.rack, .diagram').addClass(table_class.join(' '));
45+
3646
}
3747

3848
if (! TPL_CONFIG.tableFullWidth) {

lang/en/settings.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@
5757
$lang['showPageTools_o_never'] = 'Never';
5858
$lang['showPageTools_o_logged'] = 'When logged in';
5959
$lang['showPageTools_o_always'] = 'Always';
60-
$lang['useLocalBootswatch'] = 'Use the local Bootswatch directory. This option is useful in "intranet" DokuWiki installation';
60+
$lang['useLocalBootswatch'] = 'Use the local Bootswatch directory. This option is useful in "intranet" DokuWiki installation';
61+
$lang['tableStyle'] = 'Table style';

tpl_global.php

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
$bootstrapStyles = array();
5656
$tplConfigJSON = array(
5757
'tableFullWidth' => (int) bootstrap3_conf('tableFullWidth'),
58+
'tableStyle' => bootstrap3_conf('tableStyle'),
5859
);
5960

6061
if($fluidContainerBtn) {

0 commit comments

Comments
 (0)