...
 
......@@ -172,7 +172,6 @@ function responsive_tables_filter_preprocess_page(&$variables) {
// (1) The field must have a text format value
// (2) The field format must have tablesaw filter enabled
// (3) The field value must contain '<table'.
if (isset($node->{$f}[$lang][0]['format']) && in_array($node->{$f}[$lang][0]['format'], $formats_with_tablesaw) && strpos($node->{$f}[$lang][0]['value'], '<table') !== FALSE) {
_responsive_tables_filter_add_js_css(FALSE);
// Quit searching once a field matching the criteria is found.
......@@ -314,10 +313,19 @@ function _responsive_tables_filter_add_js_css() {
// Check if the user has supplied custom CSS. If not, use default.
$custom = variable_get(RESPONSIVE_TABLES_FILTER_CUSTOM_CSS, '');
$css = (!empty($custom)) ? $custom : $module_path . '/tablesaw/css/tablesaw.stackonly.css';
drupal_add_css($css, array('every_page' => $every_page));
drupal_add_js($module_path . '/tablesaw/js/tablesaw.stackonly.js', array(
if (!empty($custom)) {
drupal_add_css($custom, array('every_page' => $every_page));
}
else {
drupal_add_css($module_path . '/tablesaw/css/tablesaw.stackonly-responsive.css', [
'every_page' => $every_page,
'media' => 'screen',
]);
drupal_add_css($module_path . '/tablesaw/css/tablesaw.stackonly-base.css', [
'every_page' => $every_page,
]);
}
drupal_add_js($module_path . '/tablesaw/js/tablesaw.stackonly.jquery.js', array(
'every_page' => $every_page,
'scope' => 'footer',
'weight' => 30,
......
/*! Tablesaw - v3.1.1 - 2019-03-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2019 Filament Group; Licensed MIT */
.tablesaw {
width: 100%;
max-width: 100%;
empty-cells: show;
border-collapse: collapse;
border: 0;
padding: 0;
}
.tablesaw * {
box-sizing: border-box;
}
.tablesaw-stack td .tablesaw-cell-label,
.tablesaw-stack th .tablesaw-cell-label {
display: none;
}
/* Media query to show as a standard table at 560px (35em x 16px) or wider */
@media (min-width: 40em) {
.tablesaw-stack tr {
display: table-row;
}
/* Show the table header rows */
.tablesaw-stack td,
.tablesaw-stack th,
.tablesaw-stack thead td,
.tablesaw-stack thead th {
display: table-cell;
margin: 0;
}
/* Hide the labels in each cell */
.tablesaw-stack td .tablesaw-cell-label,
.tablesaw-stack th .tablesaw-cell-label {
display: none !important;
}
}
/*! Tablesaw - v3.1.1 - 2019-03-15
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2019 Filament Group; Licensed MIT */
@media only all {
/* Show the table cells as a block level element */
.tablesaw-stack {
clear: both;
}
.tablesaw-stack td,
.tablesaw-stack th {
text-align: left;
display: block;
}
.tablesaw-stack tr {
clear: both;
display: table-row;
}
/* Make the label elements a percentage width */
.tablesaw-stack td .tablesaw-cell-label,
.tablesaw-stack th .tablesaw-cell-label {
display: inline-block;
padding: 0 .6em 0 0;
width: 30%;
}
/* For grouped headers, have a different style to visually separate the levels by classing the first label in each col group */
.tablesaw-stack th .tablesaw-cell-label-top,
.tablesaw-stack td .tablesaw-cell-label-top {
display: block;
padding: .4em 0;
margin: .4em 0;
}
.tablesaw-cell-label {
display: block;
}
/* Avoid double strokes when stacked */
.tablesaw-stack tbody th.group {
margin-top: -1px;
}
/* Avoid double strokes when stacked */
.tablesaw-stack th.group b.tablesaw-cell-label {
display: none !important;
}
}
@media (max-width: 39.9375em) {
/* Table rows have a gray bottom stroke by default */
.tablesaw-stack tbody tr {
display: block;
width: 100%;
border-bottom: 1px solid #dfdfdf;
}
.tablesaw-stack thead td,
.tablesaw-stack thead th {
display: none;
}
.tablesaw-stack tbody td,
.tablesaw-stack tbody th {
display: block;
float: left;
clear: left;
width: 100%;
}
.tablesaw-cell-label {
vertical-align: top;
}
.tablesaw-cell-content {
display: inline-block;
max-width: 67%;
}
.tablesaw-stack .tablesaw-stack-block .tablesaw-cell-label,
.tablesaw-stack .tablesaw-stack-block .tablesaw-cell-content {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
}
.tablesaw-stack td:empty,
.tablesaw-stack th:empty {
display: none;
}
}
......@@ -145,4 +145,4 @@ table.tablesaw {
.tablesaw-stack th .tablesaw-cell-label {
display: none !important;
}
}
\ No newline at end of file
}
/*! Tablesaw - v3.0.0-beta.1 - 2016-09-19
/*! Tablesaw - v3.1.2 - 2019-03-19
* https://github.com/filamentgroup/tablesaw
* Copyright (c) 2016 Filament Group; Licensed MIT */
;(function( $ ) {
* Copyright (c) 2019 Filament Group; Licensed MIT */
(function (win) {
"use strict";
// DOM-ready auto-init of plugins.
// Many plugins bind to an "enhance" event to init themselves on dom ready, or when new markup is inserted into the DOM
$( function(){
$( document ).trigger( "enhance.tablesaw" );
});
// DOM-ready auto-init of plugins.
// Many plugins bind to an "enhance" event to init themselves on dom ready, or when new markup is inserted into the DOM
// Use raw DOMContentLoaded instead of shoestring (may have issues in Android 2.3, exhibited by stack table)
if (!("Tablesaw" in win)) {
throw new Error("Tablesaw library not found.");
}
if (!("init" in Tablesaw)) {
throw new Error("Your tablesaw-init.js is newer than the core Tablesaw version.");
}
})( shoestring || jQuery );
\ No newline at end of file
Tablesaw.init();
})(typeof window !== "undefined" ? window : this);
This diff is collapsed.
This diff is collapsed.