Data Tables Generator by Supsystic - Version 1.8.4

Version Description

/ 30.05.2018 = * Add of option to plugin settings: Disable WP Footer Fix * Implemented automatic updating of diagrams when changing data in a table * Added import/export Selectable Fields to/from Excel * Fixed the width of text rows in mobile mode * Added function of showing Lightbox for images in cells * Added search by table columns * Fix header in Elementor tab * Fix of conflict of dataTables script and http://downloads.mailchimp.com/js/signup-forms/popup/embed.js * Fixed problems with first activation * Fix of table sorting for empty cells * Add ability to use letters as a column indexes in table's special shortcodes. Fix of using common features for the Table Part Shortcode * Fix of displaying column of Auto Index in mode "Create new column" * Fix for displaying of caption for tables with fixed columns * Fix of using of Frontend Fields this Fixed Columns option. Fix of "Use for Logged In Users Only" option for Frontend Fields * Fix of Global Table Data Search * Fix of displaying column of Auto Index in mode "Create new column" * Add Pagination in Editor * Fix saving ReadOnly for cells * Fix for export table to PDF from admin area * Fix data params for cells which use formulas, which depended on cells with shortcodes inside * Fix of removing of table rows after remove the table * Fix issue with cyrillic symbols on export to PDF * Added ability to change the data range in the diagrams without re-creating * Fix for conditions bug

Download this release

Release Info

Developer supsystic.com
Plugin Icon 128x128 Data Tables Generator by Supsystic
Version 1.8.4
Comparing to
See all releases

Code changes from version 1.8.3 to 1.8.4

Files changed (32) hide show
  1. app/SupsysticTables.php +1 -1
  2. app/assets/css/supsystic-ui.css +3 -8
  3. index.php +1 -1
  4. readme.txt +28 -2
  5. src/SupsysticTables/Core/BaseModel.php +4 -2
  6. src/SupsysticTables/Core/BaseModule.php +32 -0
  7. src/SupsysticTables/Core/Module.php +48 -0
  8. src/SupsysticTables/Core/assets/js/core.js +200 -150
  9. src/SupsysticTables/Core/assets/js/create-table.js +4 -2
  10. src/SupsysticTables/Core/assets/js/lib/dataTables.customExtensions.js +69 -69
  11. src/SupsysticTables/Core/assets/js/lib/dataTables.fixedColumns.min.js +1 -1
  12. src/SupsysticTables/Core/assets/js/lib/dataTables.fixedHeader.min.js +1 -1
  13. src/SupsysticTables/Core/assets/js/lib/dataTables.responsive.min.js +1 -1
  14. src/SupsysticTables/Core/assets/js/lib/jquery.dataTables.min.js +1 -1
  15. src/SupsysticTables/Promo/views/promo.twig +71 -73
  16. src/SupsysticTables/Settings/views/index.twig +16 -1
  17. src/SupsysticTables/Tables/Model/Tables.php +49 -27
  18. src/SupsysticTables/Tables/Module.php +75 -30
  19. src/SupsysticTables/Tables/assets/css/tables.editor.css +16 -0
  20. src/SupsysticTables/Tables/assets/css/tables.shortcode.css +19 -11
  21. src/SupsysticTables/Tables/assets/css/tables.view.css +3 -0
  22. src/SupsysticTables/Tables/assets/js/editor/tables.editor.js +401 -23
  23. src/SupsysticTables/Tables/assets/js/editor/tables.editor.toolbar.js +28 -14
  24. src/SupsysticTables/Tables/assets/js/tables.model.js +90 -39
  25. src/SupsysticTables/Tables/assets/js/tables.shortcode.js +19 -1
  26. src/SupsysticTables/Tables/assets/js/tables.view.js +8 -1
  27. src/SupsysticTables/Tables/assets/libraries/featherlight/featherlight.min.css +8 -0
  28. src/SupsysticTables/Tables/assets/libraries/featherlight/featherlight.min.js +8 -0
  29. src/SupsysticTables/Tables/assets/libraries/ruleJS/ruleJS.js +10 -7
  30. src/SupsysticTables/Tables/views/shortcode.twig +24 -17
  31. src/SupsysticTables/Tables/views/view.twig +66 -27
  32. vendor/Rsc/Mvc/Module.php +1 -1
app/SupsysticTables.php CHANGED
@@ -18,7 +18,7 @@ class SupsysticTables
18
 
19
  $menuSlug = 'supsystic-tables';
20
  $pluginPath = dirname(dirname(__FILE__));
21
- $environment = new Rsc_Environment('st', '1.8.3', $pluginPath);
22
 
23
  /* Configure */
24
  $environment->configure(
18
 
19
  $menuSlug = 'supsystic-tables';
20
  $pluginPath = dirname(dirname(__FILE__));
21
+ $environment = new Rsc_Environment('st', '1.8.4', $pluginPath);
22
 
23
  /* Configure */
24
  $environment->configure(
app/assets/css/supsystic-ui.css CHANGED
@@ -1,9 +1,3 @@
1
- @import "libraries/bootstrap/bootstrap.min.css";
2
- @import "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css";
3
- @import "chosen.min.css";
4
- @import "libraries/supsystic/inputs.css";
5
- @import "libraries/supsystic/buttons.css";
6
- @import "libraries/supsystic/forms.css";
7
  .wrapper h1,
8
  .wrapper h2 {
9
  font-size: 23px;
@@ -536,7 +530,8 @@ h3.nav-tab-wrapper {
536
  .supsystic-plugin .button-secondary[disabled],
537
  .supsystic-plugin .button-secondary:disabled,
538
  .supsystic-plugin .button-secondary.disabled,
539
- .supsystic-plugin .button-disabled {
 
540
  color: #a4aaac !important;
541
  border-color: #a4aaac !important;
542
  background-color: transparent !important;
@@ -926,4 +921,4 @@ h3.nav-tab-wrapper {
926
  }
927
  [dir="rtl"] .tables-view .subsubsub.tabs-wrapper h2 {
928
  padding: 9px 0 4px 15px;
929
- }
 
 
 
 
 
 
1
  .wrapper h1,
2
  .wrapper h2 {
3
  font-size: 23px;
530
  .supsystic-plugin .button-secondary[disabled],
531
  .supsystic-plugin .button-secondary:disabled,
532
  .supsystic-plugin .button-secondary.disabled,
533
+ .supsystic-plugin .button-disabled,
534
+ .ui-button:disabled {
535
  color: #a4aaac !important;
536
  border-color: #a4aaac !important;
537
  background-color: transparent !important;
921
  }
922
  [dir="rtl"] .tables-view .subsubsub.tabs-wrapper h2 {
923
  padding: 9px 0 4px 15px;
924
+ }
index.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Data Tables Generator by Supsystic
5
  * Plugin URI: http://supsystic.com
6
  * Description: Create and manage beautiful data tables with custom design. No HTML knowledge is required
7
- * Version: 1.8.3
8
  * Author: supsystic.com
9
  * Author URI: http://supsystic.com
10
  */
4
  * Plugin Name: Data Tables Generator by Supsystic
5
  * Plugin URI: http://supsystic.com
6
  * Description: Create and manage beautiful data tables with custom design. No HTML knowledge is required
7
+ * Version: 1.8.4
8
  * Author: supsystic.com
9
  * Author URI: http://supsystic.com
10
  */
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Data Tables Generator by Supsystic ===
2
  Contributors: supsystic.com
3
  Tags: csv, csv file, csv to table, excel, table, tablesorter, post, data table, table, database, html table, table generator, builder, generator, cells, area chart, bar chart, candlestick chart, canvas, chart, charting, charts, column chart, gauge chart, geo chart, google chart, google visualization api, graph, graphing, graphs, html5, line chart, pie chart, scatter chart, spreadsheet, visualisation, visualise data, visualization, visualize data
4
- Tested up to: 4.9.5
5
- Stable tag: 1.8.3
6
 
7
  Create data tables with charts and graphs. Custom design, navigation, searching and ordering functions. Export to PDF, CSV, Print. Excel spreadsheet
8
 
@@ -194,6 +194,32 @@ Important! Shortcode must be inserted in a text editor page, and not in the visu
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  = 1.8.3 / 07.05.2018 =
198
  * Add options: Disable Table Cache
199
  * Add of constant SUPSYSTIC_STB_FOOTER_FIX for enable / disable fix for themes without wp_footer()
1
  === Data Tables Generator by Supsystic ===
2
  Contributors: supsystic.com
3
  Tags: csv, csv file, csv to table, excel, table, tablesorter, post, data table, table, database, html table, table generator, builder, generator, cells, area chart, bar chart, candlestick chart, canvas, chart, charting, charts, column chart, gauge chart, geo chart, google chart, google visualization api, graph, graphing, graphs, html5, line chart, pie chart, scatter chart, spreadsheet, visualisation, visualise data, visualization, visualize data
4
+ Tested up to: 4.9.6
5
+ Stable tag: 1.8.4
6
 
7
  Create data tables with charts and graphs. Custom design, navigation, searching and ordering functions. Export to PDF, CSV, Print. Excel spreadsheet
8
 
194
 
195
  == Changelog ==
196
 
197
+ = 1.8.4 / 30.05.2018 =
198
+ * Add of option to plugin settings: Disable WP Footer Fix
199
+ * Implemented automatic updating of diagrams when changing data in a table
200
+ * Added import/export Selectable Fields to/from Excel
201
+ * Fixed the width of text rows in mobile mode
202
+ * Added function of showing Lightbox for images in cells
203
+ * Added search by table columns
204
+ * Fix header in Elementor tab
205
+ * Fix of conflict of dataTables script and http://downloads.mailchimp.com/js/signup-forms/popup/embed.js
206
+ * Fixed problems with first activation
207
+ * Fix of table sorting for empty cells
208
+ * Add ability to use letters as a column indexes in table's special shortcodes. Fix of using common features for the Table Part Shortcode
209
+ * Fix of displaying column of Auto Index in mode "Create new column"
210
+ * Fix for displaying of caption for tables with fixed columns
211
+ * Fix of using of Frontend Fields this Fixed Columns option. Fix of "Use for Logged In Users Only" option for Frontend Fields
212
+ * Fix of Global Table Data Search
213
+ * Fix of displaying column of Auto Index in mode "Create new column"
214
+ * Add Pagination in Editor
215
+ * Fix saving ReadOnly for cells
216
+ * Fix for export table to PDF from admin area
217
+ * Fix data params for cells which use formulas, which depended on cells with shortcodes inside
218
+ * Fix of removing of table rows after remove the table
219
+ * Fix issue with cyrillic symbols on export to PDF
220
+ * Added ability to change the data range in the diagrams without re-creating
221
+ * Fix for conditions bug
222
+
223
  = 1.8.3 / 07.05.2018 =
224
  * Add options: Disable Table Cache
225
  * Add of constant SUPSYSTIC_STB_FOOTER_FIX for enable / disable fix for themes without wp_footer()
src/SupsysticTables/Core/BaseModel.php CHANGED
@@ -262,7 +262,9 @@ abstract class SupsysticTables_Core_BaseModel extends Rsc_Mvc_Model implements R
262
  public function removeById($id, array $parameters = array())
263
  {
264
  try {
265
- $this->remove('id', (int)$id, $parameters);
 
 
266
  } catch (RuntimeException $e) {
267
  throw $e;
268
  }
@@ -277,7 +279,7 @@ abstract class SupsysticTables_Core_BaseModel extends Rsc_Mvc_Model implements R
277
  */
278
  protected function dispatchFilter($name, $result)
279
  {
280
- if (!$this->environment) {
281
  return $result;
282
  }
283
 
262
  public function removeById($id, array $parameters = array())
263
  {
264
  try {
265
+ $id = (int)$id;
266
+ $this->remove('id', $id, $parameters);
267
+ $this->dispatchFilter('remove', $id);
268
  } catch (RuntimeException $e) {
269
  throw $e;
270
  }
279
  */
280
  protected function dispatchFilter($name, $result)
281
  {
282
+ if (!$this->environment) {
283
  return $result;
284
  }
285
 
src/SupsysticTables/Core/BaseModule.php CHANGED
@@ -44,4 +44,36 @@ abstract class SupsysticTables_Core_BaseModule extends Rsc_Mvc_Module
44
  }
45
  return $this->getConfig()->get($name);
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
44
  }
45
  return $this->getConfig()->get($name);
46
  }
47
+
48
+ /**
49
+ * Convert the letters of cell column index to the numbers
50
+ * @param $data
51
+ * @return mixed
52
+ */
53
+ public function _lettersToNumbers($data) {
54
+ $letters = range('A', 'Z');
55
+ $lettersLength = count($letters);
56
+ $isArray = is_array($data);
57
+ $data = $isArray ? $data : array($data);
58
+
59
+ foreach($data as $k => $v) {
60
+ $index = 0;
61
+ $v = strtoupper($v);
62
+ $vArr = str_split($v);
63
+ $vLength = count($vArr);
64
+ foreach($vArr as $ik => $iv) {
65
+ if(!is_numeric($iv) && in_array($iv, $letters)) {
66
+ if($ik == ($vLength - 1)) {
67
+ $index += array_search($iv, $letters) + 1;
68
+ } else {
69
+ $index += $lettersLength;
70
+ }
71
+ }
72
+ }
73
+ if($index) {
74
+ $data[$k] = $index;
75
+ }
76
+ }
77
+ return $isArray ? $data : $data[0];
78
+ }
79
  }
src/SupsysticTables/Core/Module.php CHANGED
@@ -153,6 +153,14 @@ class SupsysticTables_Core_Module extends SupsysticTables_Core_BaseModule
153
  );
154
 
155
  /* Chosen */
 
 
 
 
 
 
 
 
156
  $ui->add(
157
  $ui->createScript('tables-chosen')
158
  ->setHookName($hookName)
@@ -173,6 +181,46 @@ class SupsysticTables_Core_Module extends SupsysticTables_Core_BaseModule
173
  );
174
 
175
  /* Supsystic UI */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  $ui->add(
177
  $ui->createStyle('tables-ui-styles')
178
  ->setHookName($hookName)
153
  );
154
 
155
  /* Chosen */
156
+ $ui->add(
157
+ $ui->createStyle('tables-chosen')
158
+ ->setHookName($hookName)
159
+ ->setLocalSource('css/chosen.min.css')
160
+ ->setCachingAllowed($cachingAllowed)
161
+ ->setVersion($pluginVersion)
162
+ );
163
+
164
  $ui->add(
165
  $ui->createScript('tables-chosen')
166
  ->setHookName($hookName)
181
  );
182
 
183
  /* Supsystic UI */
184
+ $ui->add(
185
+ $ui->createStyle('tables-bootstrap')
186
+ ->setHookName($hookName)
187
+ ->setLocalSource('css/libraries/bootstrap/bootstrap.min.css')
188
+ ->setCachingAllowed($cachingAllowed)
189
+ ->setVersion($pluginVersion)
190
+ );
191
+
192
+ $ui->add(
193
+ $ui->createStyle('tables-ui-inputs')
194
+ ->setHookName($hookName)
195
+ ->setLocalSource('css/libraries/supsystic/inputs.css')
196
+ ->setCachingAllowed($cachingAllowed)
197
+ ->setVersion($pluginVersion)
198
+ );
199
+
200
+ $ui->add(
201
+ $ui->createStyle('tables-ui-buttons')
202
+ ->setHookName($hookName)
203
+ ->setLocalSource('css/libraries/supsystic/buttons.css')
204
+ ->setCachingAllowed($cachingAllowed)
205
+ ->setVersion($pluginVersion)
206
+ );
207
+
208
+ $ui->add(
209
+ $ui->createStyle('tables-ui-forms')
210
+ ->setHookName($hookName)
211
+ ->setLocalSource('css/libraries/supsystic/forms.css')
212
+ ->setCachingAllowed($cachingAllowed)
213
+ ->setVersion($pluginVersion)
214
+ );
215
+
216
+ $ui->add(
217
+ $ui->createStyle('supsystic-font-awesome')
218
+ ->setHookName($hookName)
219
+ ->setExternalSource('//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css')
220
+ ->setCachingAllowed($cachingAllowed)
221
+ ->setVersion('4.7.0')
222
+ );
223
+
224
  $ui->add(
225
  $ui->createStyle('tables-ui-styles')
226
  ->setHookName($hookName)
src/SupsysticTables/Core/assets/js/core.js CHANGED
@@ -167,7 +167,7 @@ if(typeof(SDT_DATA) == 'undefined') {
167
  elem = typeof(elem) != 'undefined' ? elem : false;
168
 
169
  if(elem) {
170
- var icon = elem.find('.fa');
171
 
172
  if(icon) {
173
  icon.data('icon', icon.attr('class'));
@@ -179,7 +179,7 @@ if(typeof(SDT_DATA) == 'undefined') {
179
  });
180
 
181
  vendor[appName].deleteSpinner = (function(elem) {
182
- var icon = elem.find('.fa');
183
 
184
  if(icon) {
185
  icon.attr('class', icon.data('icon'));
@@ -348,6 +348,20 @@ if(typeof(SDT_DATA) == 'undefined') {
348
  }
349
  });
350
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  }
352
  if (toeInArray('ordering', features) != -1) {
353
  var sortingEnable = ['_all'],
@@ -375,9 +389,9 @@ if(typeof(SDT_DATA) == 'undefined') {
375
  }
376
  }
377
  config.aoColumnDefs = [
378
- { aType: 'natural-nohtml-ci', aTargets: '_all' },
379
- { "bSortable": false, "aTargets": sortingDisable },
380
- { "bSortable": true, "aTargets": sortingEnable }
381
  ];
382
  config.aaSorting = aaSorting;
383
  }
@@ -541,7 +555,7 @@ if(typeof(SDT_DATA) == 'undefined') {
541
  tableInstance.table_view_id = $table.data('view-id');
542
  tableInstance.fnFakeRowspan();
543
  self._checkOnClickPopups($table);
544
-
545
  if(addInstance) {
546
  this.setTableInstance(tableInstance);
547
  }
@@ -554,7 +568,7 @@ if(typeof(SDT_DATA) == 'undefined') {
554
  */
555
  vendor[appName].showTable = (function(settings, json) {
556
  var self = vendor[appName], // it is callback so "this" does not equal vendor[appName] object
557
- $table = this instanceof jQuery ? this : settings, // for compatibility with old pro versions
558
  $tableWrap = $table.closest('.supsystic-tables-wrap'),
559
  afterTableLoadedScriptString = $table.attr('data-after-table-loaded-script'),
560
  _ruleJS = self.setRuleJSInstance($table),
@@ -583,10 +597,13 @@ if(typeof(SDT_DATA) == 'undefined') {
583
  _ruleJS.init();
584
 
585
  // Set formats
586
- self.formatDataAtTable($table);
587
 
588
  $(document).on('click', '.paginate_button', function () {
589
- self.formatDataAtTable($table);
 
 
 
590
  });
591
 
592
  // Show comments on tap
@@ -625,7 +642,7 @@ if(typeof(SDT_DATA) == 'undefined') {
625
  ? useEdit[$tableId]
626
  : false;
627
 
628
- if(useEditableFields) {
629
  if (typeof(self.setFrontendFields) == 'function') {
630
  self.setFrontendFields($table);
631
  } else if (typeof(self.setAllFields) == 'function') {
@@ -633,22 +650,13 @@ if(typeof(SDT_DATA) == 'undefined') {
633
  } else {
634
  self.createEditableFields($table, $editableFields);
635
  }
636
- } else if(SDT_DATA.isAdmin && SDT_DATA.isPro) {
637
- if (typeof(self.setFrontendFields) == 'function') {
638
- self.setFrontendFields($table);
639
- } else if (typeof(self.setAllFields) == 'function') {
640
- self.createEditableFields($table, $editableFields);
641
- self.createSelectableFields($table, $selectableFields);
642
- } else {
643
- self.createEditableFields($table, $editableFields);
644
- }
645
  }
646
- $table.on('init.dt', function() {
647
- $table.on('responsive-resize.dt responsive-display.dt draw.dt', function() {
648
- $editableFields.off('click.sup'); // for compatibility with old pro versions
649
- self.updateAfterRedraw($table);
650
- });
651
- });
652
  }
653
 
654
  // apply page.dt event by change table pagination via select
@@ -672,11 +680,11 @@ if(typeof(SDT_DATA) == 'undefined') {
672
  $(window).on('resize', $table, function(event) {
673
  var tBody = $tableWrap.find('.dataTables_scrollBody'),
674
  tBodyTable = tBody.find('.supsystic-table');
 
675
  if(tBody.width() > tBodyTable.width() || $tableWrap.width() > tBodyTable.width()) {
676
- tBody.width(tBodyTable.width());
677
- //plus one px to avoid displaying scroll
678
- $tableWrap.find('.dataTables_scrollHead, .dataTables_scrollFoot, .dataTables_scrollBody').width(tBodyTable.width() + 1);
679
- }
680
  if( tBodyTable.isHorizontallyScrollable ){
681
  tBody.css({'border-bottom' : 'none'});
682
  }else{
@@ -693,12 +701,11 @@ if(typeof(SDT_DATA) == 'undefined') {
693
  $(window).trigger('resize');
694
  }, 200);
695
  }
696
-
697
  }
698
  // Correct width of fixed header / footer
699
  if(fixedHeader || fixedFooter) {
700
  $table.api().fixedHeader.adjust();
701
-
702
  var i = 1;
703
  setTimeout(function() {
704
  var flag = fixedHeader,
@@ -726,7 +733,7 @@ if(typeof(SDT_DATA) == 'undefined') {
726
  });
727
  }, 200);
728
  }
729
-
730
  // Correct width of fixed columns
731
  if(fixedColumns) {
732
  $table.api().fixedColumns().relayout();
@@ -734,11 +741,7 @@ if(typeof(SDT_DATA) == 'undefined') {
734
  var tableCaption = $('.dataTables_scrollHead caption');
735
 
736
  if(tableCaption.length) {
737
- // Fix for displaying of caption for tables with fixed columns
738
- var fixedColumnsWrapper = $('#supsystic-table-' + viewId + ' .DTFC_LeftWrapper, #supsystic-table-' + viewId + ' .DTFC_RightWrapper');
739
-
740
- fixedColumnsWrapper.find('caption').css({ display: 'none' });
741
- fixedColumnsWrapper.css({ top: tableCaption.height() + 'px' });
742
  }
743
  }
744
  /* Fix for Horizontal scroll responsive mode if table has different width for one column in header and body */
@@ -827,8 +830,11 @@ if(typeof(SDT_DATA) == 'undefined') {
827
  }
828
  });
829
 
830
- vendor[appName].formatDataAtTable = (function(table) {
831
- var numberFormat = table.data('number-format'),
 
 
 
832
  generalCurrencyFormat = table.data('currency-format'),
833
  generalPercentFormat = table.data('percent-format'),
834
  generalDateFormat = table.data('date-format'),
@@ -836,7 +842,7 @@ if(typeof(SDT_DATA) == 'undefined') {
836
  skipFirstCol = table.data('auto-index') != 'off',
837
  hasCollapsedCells = table.data('responsive-mode') == 1 && table.hasClass('collapsed');
838
 
839
- table.find('td').each(function(index, el) {
840
  var $this = $(this);
841
 
842
  if((skipFirstCol && $this.is(':first-child')) || (hasCollapsedCells && $this.hasClass('child'))) {
@@ -852,128 +858,153 @@ if(typeof(SDT_DATA) == 'undefined') {
852
  value = $.trim($this.html()),
853
  noFormat = false;
854
 
855
- if(value && formatType == 'date' && $this.data('cell-reformat')) {
856
- var newDate = moment(value, format);
857
- if (newDate.isValid()) {
858
- value = newDate.format(generalDateFormat);
859
 
860
- $this.data('cell-format', generalDateFormat);
861
- $this.attr('data-cell-format',generalDateFormat);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
862
 
863
- $this.data('original-value', value);
864
- $this.attr('data-original-value',value);
865
 
866
- $this.data('order', value);
867
- $this.attr('data-order',value);
868
 
869
- $this.data('cell-reformat', false);
870
- $this.attr('data-cell-reformat',value);
871
- }
872
- } else if(value && formatType == 'time_duration' && $this.data('cell-reformat')) {
873
- var newTime = moment(value, format),
874
- isValid = false;
875
- // console.log(newTime);
876
-
877
- if (newTime.isValid()) {
878
- value = newTime.format(generalTimeFormat);
879
- isValid = true;
880
- } else {
881
- newTime = moment.duration(value);
882
- if (newTime._milliseconds || value == 0) {
883
- value = newTime.format(generalTimeFormat);
884
- isValid = true;
885
- }
886
- }
887
- if(isValid) {
888
- $this.data('cell-format',generalTimeFormat);
889
- $this.attr('data-cell-format',generalTimeFormat);
890
 
891
- $this.data('original-value',value);
892
- $this.attr('data-original-value',value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
 
894
- $this.data('order',value);
895
- $this.attr('data-order',value);
896
 
897
- $this.data('cell-reformat',false);
898
- $this.attr('data-cell-reformat',value);
899
- }
900
- } else if(value && value.toString().match(/^-{0,1}\d+\.{0,1}\d*$/) && !isNaN(value)) {
901
- numberFormat = numberFormat ? numberFormat.toString() : '';
902
 
903
- switch(formatType) {
904
- case 'percent':
905
- format = format ? format : generalPercentFormat;
 
 
 
 
 
 
906
 
907
- if(format) {
908
- format = format.toString();
 
909
 
910
- var clearFormat = format.indexOf('%') > -1 ? format.replace('%', '') : format;
 
911
 
912
- value = value.indexOf('%') > -1 ? $this.data('original-value') : value;
913
- delimiters = (clearFormat.match(/[^\d]/g) || [',', '.']).reverse();
914
- languageData.delimiters = {
915
- decimal: delimiters[0], thousands: delimiters[1]
916
- };
917
 
918
- // We need to use dafault delimiters for format string
919
- preparedFormat = format.replace(clearFormat, clearFormat.replace(delimiters[0], '.').replace(delimiters[1], ','));
920
- } else {
921
- noFormat = true;
922
- }
923
- break;
924
- case 'currency':
925
- format = format ? format : generalCurrencyFormat;
926
-
927
- if(format) {
928
- format = format.toString();
929
-
930
- var formatWithoutCurrency = format.match(/\d.?\d*.?\d*/)[0],
931
- currencySymbol = format.replace(formatWithoutCurrency, '') || '$'; // We need to set currency symbol in any case for normal work of numeraljs
932
-
933
- delimiters = (formatWithoutCurrency.match(/[^\d]/g) || [',', '.']).reverse();
934
-
935
- languageData.delimiters = {
936
- decimal: delimiters[0],
937
- thousands: delimiters[1]
938
- };
939
- languageData.currency.symbol = currencySymbol;
940
- // We need to use dafault delimiters for format string
941
- preparedFormat = format
942
- .replace(formatWithoutCurrency, formatWithoutCurrency
943
- .replace(delimiters[0], '.')
944
- .replace(delimiters[1], ','))
945
- .replace(currencySymbol, '$');
946
- } else {
947
- noFormat = true;
948
- }
949
- break;
950
- case 'date':case 'time_duration':
951
- noFormat = true;
952
- break;
953
- default:
954
- if(numberFormat) {
955
- format = numberFormat;
956
- delimiters = (format.match(/[^\d]/g) || [',', '.']).reverse();
957
- languageData.delimiters = {
958
- decimal: delimiters[0],
959
- thousands: delimiters[1]
960
- };
961
-
962
- // We need to use dafault delimiters for format string
963
- preparedFormat = format.replace(format, format.replace(delimiters[0], '.').replace(delimiters[1], ','));
964
- break;
965
- } else {
966
- noFormat = true;
967
- }
968
- break;
969
- }
970
- if(noFormat) {
971
- noFormat = false;
972
- } else {
973
- numeral.language('en', languageData);
974
- value = numeral(value).format(preparedFormat);
975
- }
976
- }
 
 
 
 
 
 
 
977
  $this.html(value);
978
  });
979
  });
@@ -1135,6 +1166,25 @@ if(typeof(SDT_DATA) == 'undefined') {
1135
  return $style;
1136
  });
1137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1138
  vendor[appName]._getChunksArray = (function(arr, len) {
1139
  var chunks = [],
1140
  i = 0,
167
  elem = typeof(elem) != 'undefined' ? elem : false;
168
 
169
  if(elem) {
170
+ var icon = elem.attr('disabled', true).find('.fa');
171
 
172
  if(icon) {
173
  icon.data('icon', icon.attr('class'));
179
  });
180
 
181
  vendor[appName].deleteSpinner = (function(elem) {
182
+ var icon = elem.attr('disabled', false).find('.fa');
183
 
184
  if(icon) {
185
  icon.attr('class', icon.data('icon'));
348
  }
349
  });
350
  }
351
+ if (searchingSettings.columnSearch) {
352
+ var tds = $table.find('tbody tr:first').find('td'),
353
+ ths = '';
354
+
355
+ for (var i = 0; i < tds.length; i++) {
356
+ ths += '<th' + ($(tds[i]).hasClass('invisibleCell') ? ' class="invisibleCell"' : '') + '><input type="text" /></th>';
357
+ }
358
+ if (ths.length > 0) {
359
+ if($table.find('tfoot').length == 0) {
360
+ $table.append($('<tfoot>'));
361
+ }
362
+ $table.find('tfoot').append('<tr>' + ths + '</th>');
363
+ }
364
+ }
365
  }
366
  if (toeInArray('ordering', features) != -1) {
367
  var sortingEnable = ['_all'],
389
  }
390
  }
391
  config.aoColumnDefs = [
392
+ { type: 'natural-nohtml-ci', targets: '_all' },
393
+ { "sortable": false, "targets": sortingDisable },
394
+ { "sortable": true, "targets": sortingEnable }
395
  ];
396
  config.aaSorting = aaSorting;
397
  }
555
  tableInstance.table_view_id = $table.data('view-id');
556
  tableInstance.fnFakeRowspan();
557
  self._checkOnClickPopups($table);
558
+
559
  if(addInstance) {
560
  this.setTableInstance(tableInstance);
561
  }
568
  */
569
  vendor[appName].showTable = (function(settings, json) {
570
  var self = vendor[appName], // it is callback so "this" does not equal vendor[appName] object
571
+ $table = this instanceof $ ? this : settings, // for compatibility with old pro versions
572
  $tableWrap = $table.closest('.supsystic-tables-wrap'),
573
  afterTableLoadedScriptString = $table.attr('data-after-table-loaded-script'),
574
  _ruleJS = self.setRuleJSInstance($table),
597
  _ruleJS.init();
598
 
599
  // Set formats
600
+ self.formatDataAtTable($table, true);
601
 
602
  $(document).on('click', '.paginate_button', function () {
603
+ setTimeout(function() {
604
+ _ruleJS.init();
605
+ self.formatDataAtTable($table, true);
606
+ }, 50);
607
  });
608
 
609
  // Show comments on tap
642
  ? useEdit[$tableId]
643
  : false;
644
 
645
+ if(useEditableFields || (SDT_DATA.isAdmin && SDT_DATA.isPro)) {
646
  if (typeof(self.setFrontendFields) == 'function') {
647
  self.setFrontendFields($table);
648
  } else if (typeof(self.setAllFields) == 'function') {
650
  } else {
651
  self.createEditableFields($table, $editableFields);
652
  }
653
+ $table.on('init.dt', function() {
654
+ $table.on('responsive-resize.dt responsive-display.dt draw.dt', function() {
655
+ $editableFields.off('click.sup'); // for compatibility with old pro versions
656
+ self.updateAfterRedraw($table);
657
+ });
658
+ });
 
 
 
659
  }
 
 
 
 
 
 
660
  }
661
 
662
  // apply page.dt event by change table pagination via select
680
  $(window).on('resize', $table, function(event) {
681
  var tBody = $tableWrap.find('.dataTables_scrollBody'),
682
  tBodyTable = tBody.find('.supsystic-table');
683
+
684
  if(tBody.width() > tBodyTable.width() || $tableWrap.width() > tBodyTable.width()) {
685
+ tBody.width(tBodyTable.width());
686
+ $tableWrap.find('.dataTables_scrollHead, .dataTables_scrollFoot, .dataTables_scrollBody').width(tBodyTable.width() + 1);
687
+ }
 
688
  if( tBodyTable.isHorizontallyScrollable ){
689
  tBody.css({'border-bottom' : 'none'});
690
  }else{
701
  $(window).trigger('resize');
702
  }, 200);
703
  }
 
704
  }
705
  // Correct width of fixed header / footer
706
  if(fixedHeader || fixedFooter) {
707
  $table.api().fixedHeader.adjust();
708
+
709
  var i = 1;
710
  setTimeout(function() {
711
  var flag = fixedHeader,
733
  });
734
  }, 200);
735
  }
736
+
737
  // Correct width of fixed columns
738
  if(fixedColumns) {
739
  $table.api().fixedColumns().relayout();
741
  var tableCaption = $('.dataTables_scrollHead caption');
742
 
743
  if(tableCaption.length) {
744
+ self._fixTableCaption(tableCaption.height(), viewId, 10);
 
 
 
 
745
  }
746
  }
747
  /* Fix for Horizontal scroll responsive mode if table has different width for one column in header and body */
830
  }
831
  });
832
 
833
+ vendor[appName].formatDataAtTable = (function(table, correctSorting) {
834
+ correctSorting = correctSorting ? correctSorting : false;
835
+
836
+ var self = this,
837
+ numberFormat = table.data('number-format'),
838
  generalCurrencyFormat = table.data('currency-format'),
839
  generalPercentFormat = table.data('percent-format'),
840
  generalDateFormat = table.data('date-format'),
842
  skipFirstCol = table.data('auto-index') != 'off',
843
  hasCollapsedCells = table.data('responsive-mode') == 1 && table.hasClass('collapsed');
844
 
845
+ table.find('th, td').each(function(index, el) {
846
  var $this = $(this);
847
 
848
  if((skipFirstCol && $this.is(':first-child')) || (hasCollapsedCells && $this.hasClass('child'))) {
858
  value = $.trim($this.html()),
859
  noFormat = false;
860
 
861
+ // Fix data params for cells which use formulas, which depended on cells with shortcodes inside
862
+ if(correctSorting && toeInArray(formatType, ['date', 'time_duration']) == -1) {
863
+ var dataTableInstance = typeof table.api == 'function' ? table : self.getTableInstanceById(table.data('id'));
 
864
 
865
+ if($this.data('original-value') != value) {
866
+ $this.data('original-value',value);
867
+ $this.attr('data-original-value',value);
868
+ }
869
+ if($this.data('data-order') != value) {
870
+ $this.data('order');
871
+ $this.attr('data-order',value);
872
+ if(dataTableInstance) {
873
+ dataTableInstance.api().cell($this).invalidate();
874
+ }
875
+ }
876
+ }
877
+ if(value) {
878
+ if($this.data('cell-reformat')) {
879
+ switch(formatType) {
880
+ case 'date':
881
+ var newDate = moment(value,format);
882
+ if(newDate.isValid()) {
883
+ value = newDate.format(generalDateFormat);
884
 
885
+ $this.data('cell-format',generalDateFormat);
886
+ $this.attr('data-cell-format',generalDateFormat);
887
 
888
+ $this.data('original-value',value);
889
+ $this.attr('data-original-value',value);
890
 
891
+ $this.data('order',value);
892
+ $this.attr('data-order',value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
 
894
+ $this.data('cell-reformat',false);
895
+ $this.attr('data-cell-reformat',value);
896
+ }
897
+ break;
898
+ case 'time_duration':
899
+ var newTime = moment(value,format),
900
+ isValid = false;
901
+ // console.log(newTime);
902
+
903
+ if(newTime.isValid()) {
904
+ value = newTime.format(generalTimeFormat);
905
+ isValid = true;
906
+ } else {
907
+ newTime = moment.duration(value);
908
+ if(newTime._milliseconds || value == 0) {
909
+ value = newTime.format(generalTimeFormat);
910
+ isValid = true;
911
+ }
912
+ }
913
+ if(isValid) {
914
+ $this.data('cell-format',generalTimeFormat);
915
+ $this.attr('data-cell-format',generalTimeFormat);
916
 
917
+ $this.data('original-value',value);
918
+ $this.attr('data-original-value',value);
919
 
920
+ $this.data('order',value);
921
+ $this.attr('data-order',value);
 
 
 
922
 
923
+ $this.data('cell-reformat',false);
924
+ $this.attr('data-cell-reformat',value);
925
+ }
926
+ break;
927
+ default:
928
+ break;
929
+ }
930
+ } else if(self.isNumber(value) && !isNaN(value)) {
931
+ numberFormat = numberFormat ? numberFormat.toString() : '';
932
 
933
+ switch(formatType) {
934
+ case 'percent':
935
+ format = format ? format : generalPercentFormat;
936
 
937
+ if(format) {
938
+ format = format.toString();
939
 
940
+ var clearFormat = format.indexOf('%') > -1 ? format.replace('%','') : format;
 
 
 
 
941
 
942
+ value = value.indexOf('%') > -1 ? $this.data('original-value') : value;
943
+ delimiters = (clearFormat.match(/[^\d]/g) || [',','.']).reverse();
944
+ languageData.delimiters = {
945
+ decimal: delimiters[0],thousands: delimiters[1]
946
+ };
947
+
948
+ // We need to use dafault delimiters for format string
949
+ preparedFormat = format.replace(clearFormat,clearFormat.replace(delimiters[0],'.').replace(delimiters[1],','));
950
+ } else {
951
+ noFormat = true;
952
+ }
953
+ break;
954
+ case 'currency':
955
+ format = format ? format : generalCurrencyFormat;
956
+
957
+ if(format) {
958
+ format = format.toString();
959
+
960
+ var formatWithoutCurrency = format.match(/\d.?\d*.?\d*/)[0],
961
+ currencySymbol = format.replace(formatWithoutCurrency,'') || '$'; // We need to set currency symbol in any case for normal work of numeraljs
962
+
963
+ delimiters = (formatWithoutCurrency.match(/[^\d]/g) || [',','.']).reverse();
964
+
965
+ languageData.delimiters = {
966
+ decimal: delimiters[0],
967
+ thousands: delimiters[1]
968
+ };
969
+ languageData.currency.symbol = currencySymbol;
970
+ // We need to use dafault delimiters for format string
971
+ preparedFormat = format
972
+ .replace(formatWithoutCurrency, formatWithoutCurrency
973
+ .replace(delimiters[0],'.')
974
+ .replace(delimiters[1],','))
975
+ .replace(currencySymbol,'$');
976
+ } else {
977
+ noFormat = true;
978
+ }
979
+ break;
980
+ case 'date':case 'time_duration':
981
+ noFormat = true;
982
+ break;
983
+ default:
984
+ if(numberFormat) {
985
+ format = numberFormat;
986
+ delimiters = (format.match(/[^\d]/g) || [',','.']).reverse();
987
+ languageData.delimiters = {
988
+ decimal: delimiters[0],
989
+ thousands: delimiters[1]
990
+ };
991
+
992
+ // We need to use dafault delimiters for format string
993
+ preparedFormat = format.replace(format,format.replace(delimiters[0],'.').replace(delimiters[1],','));
994
+ break;
995
+ } else {
996
+ noFormat = true;
997
+ }
998
+ break;
999
+ }
1000
+ if(noFormat) {
1001
+ noFormat = false;
1002
+ } else {
1003
+ numeral.language('en',languageData);
1004
+ value = numeral(value).format(preparedFormat);
1005
+ }
1006
+ }
1007
+ }
1008
  $this.html(value);
1009
  });
1010
  });
1166
  return $style;
1167
  });
1168
 
1169
+ vendor[appName]._fixTableCaption = (function(captionHeight, viewId, counter) {
1170
+ if(counter < 0) return false;
1171
+
1172
+ // Fix for displaying of caption for tables with fixed columns
1173
+ var self = this,
1174
+ tableViewHtmlId = '#supsystic-table-' + viewId,
1175
+ fixedColumnsWrapper = $(tableViewHtmlId + ' .DTFC_LeftWrapper, ' + tableViewHtmlId + ' .DTFC_RightWrapper');
1176
+
1177
+ if(fixedColumnsWrapper.length) {
1178
+ fixedColumnsWrapper.find('caption').css({ display: 'none' });
1179
+ fixedColumnsWrapper.css({ top: captionHeight + 'px' });
1180
+ } else {
1181
+ counter--;
1182
+ setTimeout(function() {
1183
+ self._fixTableCaption(captionHeight, viewId, counter);
1184
+ }, 50);
1185
+ }
1186
+ });
1187
+
1188
  vendor[appName]._getChunksArray = (function(arr, len) {
1189
  var chunks = [],
1190
  i = 0,
src/SupsysticTables/Core/assets/js/create-table.js CHANGED
@@ -47,8 +47,9 @@
47
 
48
  return;
49
  }
50
-
51
  $button.html(app.createSpinner());
 
52
  $error.fadeOut();
53
 
54
  app.request({ module: 'tables', action: 'create'}, { title: $input.val(), rows: $rows.val(), cols: $cols.val() })
@@ -59,6 +60,7 @@
59
  $error.fadeIn();
60
  }).always(function () {
61
  $button.html(buttonInitHtml);
 
62
  });
63
  },
64
  Cancel: function () {
@@ -85,4 +87,4 @@
85
  }).trigger('hashchange');
86
  });
87
 
88
- })(jQuery, window.supsystic.Tables);
47
 
48
  return;
49
  }
50
+ $button.attr('disabled', true);
51
  $button.html(app.createSpinner());
52
+
53
  $error.fadeOut();
54
 
55
  app.request({ module: 'tables', action: 'create'}, { title: $input.val(), rows: $rows.val(), cols: $cols.val() })
60
  $error.fadeIn();
61
  }).always(function () {
62
  $button.html(buttonInitHtml);
63
+ $button.attr('disabled', false);
64
  });
65
  },
66
  Cancel: function () {
87
  }).trigger('hashchange');
88
  });
89
 
90
+ })(jQuery, window.supsystic.Tables);
src/SupsysticTables/Core/assets/js/lib/dataTables.customExtensions.js CHANGED
@@ -1,71 +1,4 @@
1
  (function ($, app) {
2
- $.fn.dataTableExt.oApi.fnFakeRowspan = function (oSettings) {
3
- if(oSettings) {
4
- var cells;
5
- $.each(oSettings.aoData, function(index, rowData) {
6
- setCellAttributes(rowData.anCells);
7
- });
8
- if (oSettings.aoHeader.length) {
9
- cells = [];
10
- $.each(oSettings.aoHeader, function(index, rowData) {
11
- $.each(rowData, function(index, cellData) {
12
- cells.push(cellData.cell);
13
- });
14
- });
15
- setCellAttributes(cells);
16
- }
17
- if (oSettings.aoFooter.length) {
18
- cells = [];
19
- $.each(oSettings.aoFooter, function(index, rowData) {
20
- $.each(rowData, function(index, cellData) {
21
- cells.push(cellData.cell);
22
- });
23
- });
24
- setCellAttributes(cells);
25
- }
26
- }
27
- return this;
28
- };
29
-
30
- $.extend( $.fn.dataTableExt.oSort, {
31
- "natural-asc": function ( a, b ) {
32
- return naturalSort(a,b,true);
33
- },
34
- "natural-desc": function ( a, b ) {
35
- return naturalSort(a,b,true) * -1;
36
- },
37
- "natural-nohtml-asc": function( a, b ) {
38
- return naturalSort(a,b,false);
39
- },
40
- "natural-nohtml-desc": function( a, b ) {
41
- return naturalSort(a,b,false) * -1;
42
- },
43
- "natural-ci-asc": function( a, b ) {
44
- a = a.toString().toLowerCase();
45
- b = b.toString().toLowerCase();
46
-
47
- return naturalSort(a,b,true);
48
- },
49
- "natural-ci-desc": function( a, b ) {
50
- a = a.toString().toLowerCase();
51
- b = b.toString().toLowerCase();
52
-
53
- return naturalSort(a,b,true) * -1;
54
- },
55
- "natural-nohtml-ci-asc": function( a, b ) {
56
- a = a.toString().toLowerCase();
57
- b = b.toString().toLowerCase();
58
-
59
- return naturalSort(a,b,false);
60
- },
61
- "natural-nohtml-ci-desc": function( a, b ) {
62
- a = a.toString().toLowerCase();
63
- b = b.toString().toLowerCase();
64
-
65
- return naturalSort(a,b,false) * -1;
66
- }
67
- } );
68
-
69
  function setCellAttributes(cells) {
70
  var colspan, rowspan;
71
  for (var i = 0; i < cells.length; i++) {
@@ -126,8 +59,8 @@
126
  /*supsystic*/
127
  //var oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc], 10) || xN[cLoc] || 0;
128
  //var oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc], 10) || yN[cLoc] || 0;
129
- var oFxNcL = parseFloat(xN[cLoc], 10) || xN[cLoc] || 0;
130
- var oFyNcL = parseFloat(yN[cLoc], 10) || yN[cLoc] || 0;
131
  /*****/
132
 
133
  // handle numeric vs string comparison - number < string - (Kyle Adams)
@@ -149,4 +82,71 @@
149
  return 0;
150
  }
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  }(window.jQuery, window.supsystic.Tables));
1
  (function ($, app) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  function setCellAttributes(cells) {
3
  var colspan, rowspan;
4
  for (var i = 0; i < cells.length; i++) {
59
  /*supsystic*/
60
  //var oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc], 10) || xN[cLoc] || 0;
61
  //var oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc], 10) || yN[cLoc] || 0;
62
+ var oFxNcL = parseFloat(xN[cLoc], 10) || xN[cLoc] || undefined;
63
+ var oFyNcL = parseFloat(yN[cLoc], 10) || yN[cLoc] || undefined;
64
  /*****/
65
 
66
  // handle numeric vs string comparison - number < string - (Kyle Adams)
82
  return 0;
83
  }
84
 
85
+ $.fn.dataTableExt.oApi.fnFakeRowspan = function (oSettings) {
86
+ if(oSettings) {
87
+ var cells;
88
+ $.each(oSettings.aoData, function(index, rowData) {
89
+ setCellAttributes(rowData.anCells);
90
+ });
91
+ if (oSettings.aoHeader.length) {
92
+ cells = [];
93
+ $.each(oSettings.aoHeader, function(index, rowData) {
94
+ $.each(rowData, function(index, cellData) {
95
+ cells.push(cellData.cell);
96
+ });
97
+ });
98
+ setCellAttributes(cells);
99
+ }
100
+ if (oSettings.aoFooter.length) {
101
+ cells = [];
102
+ $.each(oSettings.aoFooter, function(index, rowData) {
103
+ $.each(rowData, function(index, cellData) {
104
+ cells.push(cellData.cell);
105
+ });
106
+ });
107
+ setCellAttributes(cells);
108
+ }
109
+ }
110
+ return this;
111
+ };
112
+
113
+ $.extend( $.fn.dataTableExt.oSort, {
114
+ "natural-asc": function ( a, b ) {
115
+ return naturalSort(a,b,true);
116
+ },
117
+ "natural-desc": function ( a, b ) {
118
+ return naturalSort(a,b,true) * -1;
119
+ },
120
+ "natural-nohtml-asc": function( a, b ) {
121
+ return naturalSort(a,b,false);
122
+ },
123
+ "natural-nohtml-desc": function( a, b ) {
124
+ return naturalSort(a,b,false) * -1;
125
+ },
126
+ "natural-ci-asc": function( a, b ) {
127
+ a = a.toString().toLowerCase();
128
+ b = b.toString().toLowerCase();
129
+
130
+ return naturalSort(a,b,true);
131
+ },
132
+ "natural-ci-desc": function( a, b ) {
133
+ a = a.toString().toLowerCase();
134
+ b = b.toString().toLowerCase();
135
+
136
+ return naturalSort(a,b,true) * -1;
137
+ },
138
+ "natural-nohtml-ci-asc": function( a, b ) {
139
+ a = a.toString().toLowerCase();
140
+ b = b.toString().toLowerCase();
141
+
142
+ return naturalSort(a,b,false);
143
+ },
144
+ "natural-nohtml-ci-desc": function( a, b ) {
145
+ a = a.toString().toLowerCase();
146
+ b = b.toString().toLowerCase();
147
+
148
+ return naturalSort(a,b,false) * -1;
149
+ }
150
+ } );
151
+
152
  }(window.jQuery, window.supsystic.Tables));
src/SupsysticTables/Core/assets/js/lib/dataTables.fixedColumns.min.js CHANGED
@@ -2,7 +2,7 @@
2
  FixedColumns 3.2.2
3
  ©2010-2016 SpryMedia Ltd - datatables.net/license
4
  */
5
- (function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(q){return d(q,window,document)}):"object"===typeof exports?module.exports=function(q,r){q||(q=window);if(!r||!r.fn.dataTable)r=require("datatables.net")(q,r).$;return d(r,q,q.document)}:d(jQuery,window,document)})(function(d,q,r,t){var s=d.fn.dataTable,u,m=function(a,b){var c=this;if(this instanceof m){if(b===t||!0===b)b={};var e=d.fn.dataTable.camelToHungarian;e&&(e(m.defaults,m.defaults,!0),e(m.defaults,
6
  b));e=(new d.fn.dataTable.Api(a)).settings()[0];this.s={dt:e,iTableColumns:e.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[],rtl:"rtl"===d(e.nTable).css("direction")};this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}};if(e._oFixedColumns)throw"FixedColumns already initialised on this table";
7
  e._oFixedColumns=this;e._bInitComplete?this._fnConstruct(b):e.oApi._fnCallbackReg(e,"aoInitComplete",function(){c._fnConstruct(b)},"FixedColumns")}else alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.")};d.extend(m.prototype,{fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnColCalc();this._fnGridLayout();this.fnUpdate()},fnRecalculateHeight:function(a){delete a._DTTC_iHeight;a.style.height="auto"},fnSetRowHeight:function(a,b){a.style.height=
8
  b+"px"},fnGetPosition:function(a){var b=this.s.dt.oInstance;if(d(a).parents(".DTFC_Cloned").length){if("tr"===a.nodeName.toLowerCase())return a=d(a).index(),b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]);var c=d(a).index(),a=d(a.parentNode).index();return[b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]),c,b.oApi._fnVisibleToColumnIndex(this.s.dt,c)]}return b.fnGetPosition(a)},_fnConstruct:function(a){var b=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+
2
  FixedColumns 3.2.2
3
  ©2010-2016 SpryMedia Ltd - datatables.net/license
4
  */
5
+ (function(d){/*"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(q){return d(q,window,document)}):"object"===typeof exports?module.exports=function(q,r){q||(q=window);if(!r||!r.fn.dataTable)r=require("datatables.net")(q,r).$;return d(r,q,q.document)}:*/d(jQuery,window,document)})(function(d,q,r,t){var s=d.fn.dataTable,u,m=function(a,b){var c=this;if(this instanceof m){if(b===t||!0===b)b={};var e=d.fn.dataTable.camelToHungarian;e&&(e(m.defaults,m.defaults,!0),e(m.defaults,
6
  b));e=(new d.fn.dataTable.Api(a)).settings()[0];this.s={dt:e,iTableColumns:e.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[],rtl:"rtl"===d(e.nTable).css("direction")};this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}};if(e._oFixedColumns)throw"FixedColumns already initialised on this table";
7
  e._oFixedColumns=this;e._bInitComplete?this._fnConstruct(b):e.oApi._fnCallbackReg(e,"aoInitComplete",function(){c._fnConstruct(b)},"FixedColumns")}else alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.")};d.extend(m.prototype,{fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnColCalc();this._fnGridLayout();this.fnUpdate()},fnRecalculateHeight:function(a){delete a._DTTC_iHeight;a.style.height="auto"},fnSetRowHeight:function(a,b){a.style.height=
8
  b+"px"},fnGetPosition:function(a){var b=this.s.dt.oInstance;if(d(a).parents(".DTFC_Cloned").length){if("tr"===a.nodeName.toLowerCase())return a=d(a).index(),b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]);var c=d(a).index(),a=d(a.parentNode).index();return[b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]),c,b.oApi._fnVisibleToColumnIndex(this.s.dt,c)]}return b.fnGetPosition(a)},_fnConstruct:function(a){var b=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+
src/SupsysticTables/Core/assets/js/lib/dataTables.fixedHeader.min.js CHANGED
@@ -2,7 +2,7 @@
2
  FixedHeader 3.1.2
3
  ©2009-2016 SpryMedia Ltd - datatables.net/license
4
  */
5
- (function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(g){return d(g,window,document)}):"object"===typeof exports?module.exports=function(g,h){g||(g=window);if(!h||!h.fn.dataTable)h=require("datatables.net")(g,h).$;return d(h,g,g.document)}:d(jQuery,window,document)})(function(d,g,h,k){var j=d.fn.dataTable,l=0,i=function(b,a){if(!(this instanceof i))throw"FixedHeader must be initialised with the 'new' keyword.";!0===a&&(a={});b=new j.Api(b);this.c=d.extend(!0,
6
  {},i.defaults,a);this.s={dt:b,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:d(g).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:b.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+l++,scrollLeft:{header:-1,footer:-1},enable:!0};this.dom={floatingHeader:null,thead:d(b.table().header()),tbody:d(b.table().body()),tfoot:d(b.table().footer()),header:{host:null,floating:null,placeholder:null},footer:{host:null,floating:null,
7
  placeholder:null}};this.dom.header.host=this.dom.thead.parent();this.dom.footer.host=this.dom.tfoot.parent();var e=b.settings()[0];if(e._fixedHeader)throw"FixedHeader already initialised on table "+e.nTable.id;e._fixedHeader=this;this._constructor()};d.extend(i.prototype,{enable:function(b){this.s.enable=b;this.c.header&&this._modeChange("in-place","header",!0);this.c.footer&&this.dom.tfoot.length&&this._modeChange("in-place","footer",!0);this.update()},headerOffset:function(b){b!==k&&(this.c.headerOffset=
8
  b,this.update());return this.c.headerOffset},footerOffset:function(b){b!==k&&(this.c.footerOffset=b,this.update());return this.c.footerOffset},update:function(){this._positions();this._scroll(!0)},_constructor:function(){var b=this,a=this.s.dt;d(g).on("scroll"+this.s.namespace,function(){b._scroll()}).on("resize"+this.s.namespace,function(){b.s.position.windowHeight=d(g).height();b.update()});var e=d(".fh-fixedHeader");!this.c.headerOffset&&e.length&&(this.c.headerOffset=e.outerHeight());e=d(".fh-fixedFooter");
2
  FixedHeader 3.1.2
3
  ©2009-2016 SpryMedia Ltd - datatables.net/license
4
  */
5
+ (function(d){/*"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(g){return d(g,window,document)}):"object"===typeof exports?module.exports=function(g,h){g||(g=window);if(!h||!h.fn.dataTable)h=require("datatables.net")(g,h).$;return d(h,g,g.document)}:*/d(jQuery,window,document)})(function(d,g,h,k){var j=d.fn.dataTable,l=0,i=function(b,a){if(!(this instanceof i))throw"FixedHeader must be initialised with the 'new' keyword.";!0===a&&(a={});b=new j.Api(b);this.c=d.extend(!0,
6
  {},i.defaults,a);this.s={dt:b,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:d(g).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:b.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+l++,scrollLeft:{header:-1,footer:-1},enable:!0};this.dom={floatingHeader:null,thead:d(b.table().header()),tbody:d(b.table().body()),tfoot:d(b.table().footer()),header:{host:null,floating:null,placeholder:null},footer:{host:null,floating:null,
7
  placeholder:null}};this.dom.header.host=this.dom.thead.parent();this.dom.footer.host=this.dom.tfoot.parent();var e=b.settings()[0];if(e._fixedHeader)throw"FixedHeader already initialised on table "+e.nTable.id;e._fixedHeader=this;this._constructor()};d.extend(i.prototype,{enable:function(b){this.s.enable=b;this.c.header&&this._modeChange("in-place","header",!0);this.c.footer&&this.dom.tfoot.length&&this._modeChange("in-place","footer",!0);this.update()},headerOffset:function(b){b!==k&&(this.c.headerOffset=
8
  b,this.update());return this.c.headerOffset},footerOffset:function(b){b!==k&&(this.c.footerOffset=b,this.update());return this.c.footerOffset},update:function(){this._positions();this._scroll(!0)},_constructor:function(){var b=this,a=this.s.dt;d(g).on("scroll"+this.s.namespace,function(){b._scroll()}).on("resize"+this.s.namespace,function(){b.s.position.windowHeight=d(g).height();b.update()});var e=d(".fh-fixedHeader");!this.c.headerOffset&&e.length&&(this.c.headerOffset=e.outerHeight());e=d(".fh-fixedFooter");
src/SupsysticTables/Core/assets/js/lib/dataTables.responsive.min.js CHANGED
@@ -2,7 +2,7 @@
2
  Responsive 2.0.2
3
  2014-2016 SpryMedia Ltd - datatables.net/license
4
  */
5
- (function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(j){return c(j,window,document)}):"object"===typeof exports?module.exports=function(j,k){j||(j=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(j,k).$;return c(k,j,j.document)}:c(jQuery,window,document)})(function(c,j,k,p){var n=c.fn.dataTable,l=function(a,b){if(!n.versionCheck||!n.versionCheck("1.10.3"))throw"DataTables Responsive requires DataTables 1.10.3 or newer";this.s={dt:new n.Api(a),columns:[],
6
  current:[]};this.s.dt.settings()[0].responsive||(b&&"string"===typeof b.details?b.details={type:b.details}:b&&!1===b.details?b.details={type:!1}:b&&!0===b.details&&(b.details={type:"inline"}),this.c=c.extend(!0,{},l.defaults,n.defaults.responsive,b),a.responsive=this,this._constructor())};c.extend(l.prototype,{_constructor:function(){var a=this,b=this.s.dt,d=b.settings()[0],e=c(j).width();b.settings()[0]._responsive=this;c(j).on("resize.dtr orientationchange.dtr",n.util.throttle(function(){var b=
7
  c(j).width();b!==e&&(a._resize(),e=b)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(e){-1!==c.inArray(!1,a.s.current)&&c("td, th",e).each(function(e){e=b.column.index("toData",e);!1===a.s.current[e]&&c(this).css("display","none")})});b.on("destroy.dtr",function(){b.off(".dtr");c(b.table().body()).off(".dtr");c(j).off("resize.dtr orientationchange.dtr");c.each(a.s.current,function(b,e){!1===e&&a._setColumnVis(b,!0)})});this.c.breakpoints.sort(function(a,b){return a.width<b.width?1:a.width>
8
  b.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==d.type&&(a._detailsInit(),b.on("column-visibility.dtr",function(){a._classLogic();a._resizeAuto();a._resize()}),b.on("draw.dtr",function(){a._redrawChildren()}),c(b.table().node()).addClass("dtr-"+d.type));b.on("column-reorder.dtr",function(){a._classLogic();a._resizeAuto();a._resize()});b.on("column-sizing.dtr",function(){a._resize()});b.on("init.dtr",function(){a._resizeAuto();a._resize();c.inArray(false,a.s.current)&&b.columns.adjust()});
2
  Responsive 2.0.2
3
  2014-2016 SpryMedia Ltd - datatables.net/license
4
  */
5
+ (function(c){/*"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(j){return c(j,window,document)}):"object"===typeof exports?module.exports=function(j,k){j||(j=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(j,k).$;return c(k,j,j.document)}:*/c(jQuery,window,document)})(function(c,j,k,p){var n=c.fn.dataTable,l=function(a,b){if(!n.versionCheck||!n.versionCheck("1.10.3"))throw"DataTables Responsive requires DataTables 1.10.3 or newer";this.s={dt:new n.Api(a),columns:[],
6
  current:[]};this.s.dt.settings()[0].responsive||(b&&"string"===typeof b.details?b.details={type:b.details}:b&&!1===b.details?b.details={type:!1}:b&&!0===b.details&&(b.details={type:"inline"}),this.c=c.extend(!0,{},l.defaults,n.defaults.responsive,b),a.responsive=this,this._constructor())};c.extend(l.prototype,{_constructor:function(){var a=this,b=this.s.dt,d=b.settings()[0],e=c(j).width();b.settings()[0]._responsive=this;c(j).on("resize.dtr orientationchange.dtr",n.util.throttle(function(){var b=
7
  c(j).width();b!==e&&(a._resize(),e=b)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(e){-1!==c.inArray(!1,a.s.current)&&c("td, th",e).each(function(e){e=b.column.index("toData",e);!1===a.s.current[e]&&c(this).css("display","none")})});b.on("destroy.dtr",function(){b.off(".dtr");c(b.table().body()).off(".dtr");c(j).off("resize.dtr orientationchange.dtr");c.each(a.s.current,function(b,e){!1===e&&a._setColumnVis(b,!0)})});this.c.breakpoints.sort(function(a,b){return a.width<b.width?1:a.width>
8
  b.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==d.type&&(a._detailsInit(),b.on("column-visibility.dtr",function(){a._classLogic();a._resizeAuto();a._resize()}),b.on("draw.dtr",function(){a._redrawChildren()}),c(b.table().node()).addClass("dtr-"+d.type));b.on("column-reorder.dtr",function(){a._classLogic();a._resizeAuto();a._resize()});b.on("column-sizing.dtr",function(){a._resize()});b.on("init.dtr",function(){a._resizeAuto();a._resize();c.inArray(false,a.s.current)&&b.columns.adjust()});
src/SupsysticTables/Core/assets/js/lib/jquery.dataTables.min.js CHANGED
@@ -54,7 +54,7 @@ d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:f
54
  width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:x(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));
55
  var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),
56
  m=t.children("table"),o=h(a.nTHead),F=h(a.nTable),p=F[0],r=p.style,u=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s=G(a.aoColumns,"nTh"),P,v,w,y,z=[],A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};v=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==v&&a.scrollBarVis!==k)a.scrollBarVis=v,Y(a);else{a.scrollBarVis=v;F.children("thead, tfoot").remove();u&&(w=u.clone().prependTo(F),P=u.find("tr"),w=
57
- w.find("tr"));y=o.clone().prependTo(F);o=o.find("tr");v=y.find("tr");y.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,y),function(b,c){D=Z(a,b);if(a.aoColumns[D]) {c.style.width=a.aoColumns[D].sWidth;}});u&&J(function(a){a.style.width=""},w);f=F.outerWidth();if(""===c){r.width="100%";if(Ua&&(F.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(F.outerWidth()-b);f=F.outerWidth()}else""!==d&&(r.width=x(d),f=F.outerWidth());J(E,v);J(function(a){B.push(a.innerHTML);
58
  z.push(x(h(a).css("width")))},v);J(function(a,b){if(h.inArray(a,s)!==-1)a.style.width=z[b]},o);h(v).height(0);u&&(J(E,w),J(function(a){C.push(a.innerHTML);A.push(x(h(a).css("width")))},w),J(function(a,b){a.style.width=A[b]},P),h(w).height(0));J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+B[b]+"</div>";a.style.width=z[b]},v);u&&J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+C[b]+"</div>";a.style.width=
59
  A[b]},w);if(F.outerWidth()<f){P=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(P-b);(""===c||""!==d)&&L(a,1,"Possible column misalignment",6)}else P="100%";q.width=x(P);g.width=x(P);u&&(a.nScrollFoot.style.width=x(P));!e&&Ua&&(q.height=x(p.offsetHeight+b));c=F.outerWidth();n[0].style.width=x(c);i.width=x(c);d=F.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left":
60
  "Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=x(c),t[0].style.width=x(c),t[0].style[e]=d?b+"px":"0px");F.children("colgroup").insertBefore(F.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function J(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Fa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,
54
  width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:x(d)}).append(b));l&&i.append(h("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:x(d):"100%"}).append(h("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot")))));
55
  var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"),
56
  m=t.children("table"),o=h(a.nTHead),F=h(a.nTable),p=F[0],r=p.style,u=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s=G(a.aoColumns,"nTh"),P,v,w,y,z=[],A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};v=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==v&&a.scrollBarVis!==k)a.scrollBarVis=v,Y(a);else{a.scrollBarVis=v;F.children("thead, tfoot").remove();u&&(w=u.clone().prependTo(F),P=u.find("tr"),w=
57
+ w.find("tr"));y=o.clone().prependTo(F);o=o.find("tr");v=y.find("tr");y.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,y),function(b,c){D=Z(a,b);if(a.aoColumns[D]&&"object"==typeof c) {c.style.width=a.aoColumns[D].sWidth;}});u&&J(function(a){a.style.width=""},w);f=F.outerWidth();if(""===c){r.width="100%";if(Ua&&(F.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(F.outerWidth()-b);f=F.outerWidth()}else""!==d&&(r.width=x(d),f=F.outerWidth());J(E,v);J(function(a){B.push(a.innerHTML);
58
  z.push(x(h(a).css("width")))},v);J(function(a,b){if(h.inArray(a,s)!==-1)a.style.width=z[b]},o);h(v).height(0);u&&(J(E,w),J(function(a){C.push(a.innerHTML);A.push(x(h(a).css("width")))},w),J(function(a,b){a.style.width=A[b]},P),h(w).height(0));J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+B[b]+"</div>";a.style.width=z[b]},v);u&&J(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+C[b]+"</div>";a.style.width=
59
  A[b]},w);if(F.outerWidth()<f){P=j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(P-b);(""===c||""!==d)&&L(a,1,"Possible column misalignment",6)}else P="100%";q.width=x(P);g.width=x(P);u&&(a.nScrollFoot.style.width=x(P));!e&&Ua&&(q.height=x(p.offsetHeight+b));c=F.outerWidth();n[0].style.width=x(c);i.width=x(c);d=F.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left":
60
  "Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=x(c),t[0].style.width=x(c),t[0].style[e]=d?b+"px":"0px");F.children("colgroup").insertBefore(F.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function J(a,b,c){for(var d=0,e=0,f=b.length,g,j;e<f;){g=b[e].firstChild;for(j=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,j,d):a(g,d),d++),g=g.nextSibling,j=c?j.nextSibling:null;e++}}function Fa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,
src/SupsysticTables/Promo/views/promo.twig CHANGED
@@ -1,91 +1,89 @@
 
 
1
  {% block content %}
2
  <section>
3
  <div class="supsystic-item supsystic-panel supsystic-plugin supsystic-plugin-promo">
4
  <div id="containerWrapper">
5
- <div class="row">
6
- <div class="col-sm-12">
7
- <h2>
8
- {{ environment.translate('Welcome to our plugin') }} {{ plugin_name }} v. {{ plugin_version }} {{ environment.translate('by Supsystic!') }}
9
- </h2>
10
- <p class="col-sm-6" style="white-space: normal; width: 100%;">
11
- {{ environment.translate('We are trying to make your using of our plugin maximum comfortable and easy. So we find it like the best way to tell you about some options and features of this plugin.') }}
12
- </p>
13
- </div>
14
  </div>
15
- <div class="row">
16
- <div class="col-sm-8">
17
- <div class="row">
18
- <div class="col-sm-6">
19
- <h3>{{ environment.translate('A small guide for the first-time user') }}</h3>
20
- <p>
21
- {{ environment.translate('Actually, Data Table plugin is very simple and has a lot of different options at the same time. That’s why when you close this article I will show you the main of them, but the very detailed one you can find on our site. I hope that you will have no questions after even this small guide. For the first time we will help you to install and create your first table, but if you need help - contact us through the internal support') }}
22
- </p>
23
- </div>
24
- <div class="col-sm-6">
25
- <h3>{{ environment.translate('Support') }}</h3>
26
- <p>
27
- {{ environment.translate('We really like what we do and feel responsibility for our “child”. Constantly we are trying to change something or update the new features, but sometimes you may have a situation when you need help or have a problem. We can offer you two kinds of help: ')|raw }}
28
- </p>
29
- <ul style="font-size: 13px; list-style: disc; padding: inherit;">
30
- <li>{{ environment.translate('<a href="//supsystic.com/forum/datatable-plugin/" target="_blank"> Contact us </a> through the Forum on our site - if you have some question, offer or wish.')|raw }}</li>
31
- <li>{{ environment.translate('If, unfortunately, you have some problem - we are ready to help you in our <a href="//supsystic.com/contact-us/" target="_blank">internal support.</a>')|raw }}</li>
32
- </ul>
33
- <p>{{ environment.translate('Feel free to contact us and don’t worry, everything gonna be ok!')|raw }} </p>
34
- </div>
35
  </div>
36
- <div class="row">
37
- <div class="col-sm-12">
38
- <h3>{{ environment.translate('Video Tutorial') }}</h3>
39
- <iframe type="text/html"
40
- width="90%"
41
- height="330px"
42
- src="https://www.youtube.com/embed/Fa3EI7-oBfc"
43
- frameborder="0">
44
- </iframe>
45
- </div>
46
  </div>
47
  </div>
48
- <div class="col-sm-4">
49
- <h3>
50
- {{ environment.translate('Frequently Asked Questions') }}
51
- </h3>
 
52
 
53
- <section>
54
- <h4>{{ environment.translate('Make data table responsive') }}</h4>
55
- <p>Data Tables Generator by Supsystic automatically creates responsive tables. So you don’t need to activate for this any options, it will be responsive by default. <br>Besides on Settings tab you can find “Responsive mode” option with which you are able to choose different responsive modes for your table (Standard Responsive mode, Automatic column hiding, Horizontal scroll or simply disable it).</p>
56
- </section>
57
 
58
- <section>
59
- <h4>{{ environment.translate('I need to have line breaks/spaces between the paragraphs within the cells.') }}</h4>
60
- <p>On Settings tab you can find “Enable paragraph mode” option - activate it and this mode will allow you to separate the content into the paragraphs. Paragraphs will appear in the places where you put “Ctrl+Enter”. Don't forget to save the table.</p>
61
- </section>
62
 
63
- <section>
64
- <h4>{{ environment.translate('How to use formulas in the table?') }}</h4>
65
- <ol>
66
- <li>{{ environment.translate('Go to Editor of Data Table.') }}</li>
67
- <li>{{ environment.translate('Select a cell and start typing. In a cell, type an equal sign “=” to start the formula.') }}</li>
68
- <li>{{ environment.translate('Fill in the rest of the formula.') }}</li>
69
- <li>{{ environment.translate('Save the changes of table.') }}</li>
70
- <li>{{ environment.translate('Check the result of formula in the table on your site.') }}</li>
71
- </ol>
72
- <p>{{ environment.translate('Learn more about how to do this <a href="//supsystic.com/how-to-use-tables/" target="_blank">here</a>.')|raw }}</p>
73
- </section>
74
 
75
- <section>
76
- <h4>
77
- <a href="//supsystic.com/plugins/data-tables-generator-plugin/?utm_source=plugin&utm_medium=welcomepagefaq&utm_campaign=tables#faq" target="_blank">{{ environment.translate('Check all other FAQs') }}</a>
78
- </h4>
79
- </section>
80
 
81
- <div style="clear: both;"></div>
82
- <a href="{{ start_url }}" style="height: 46px!important; font-size: 20px !important; line-height: 44px !important; padding: 0 36px !important; min-width: 160px; text-align: center;" class="button button-primary button-hero">
83
- {{ environment.translate("Let's Start!") }}
84
- </a>
85
- </div>
86
  </div>
87
  <div style="clear: both;"></div>
88
  </div>
89
  </div>
90
  </section>
91
- {% endblock %}
1
+ {% extends 'layout.twig' %}
2
+
3
  {% block content %}
4
  <section>
5
  <div class="supsystic-item supsystic-panel supsystic-plugin supsystic-plugin-promo">
6
  <div id="containerWrapper">
7
+ <div class="col-sm-12">
8
+ <h2>
9
+ {{ environment.translate('Welcome to our plugin') }} {{ plugin_name }} v. {{ plugin_version }} {{ environment.translate('by Supsystic!') }}
10
+ </h2>
11
+ <p class="col-sm-6" style="white-space: normal; width: 100%;">
12
+ {{ environment.translate('We are trying to make your using of our plugin maximum comfortable and easy. So we find it like the best way to tell you about some options and features of this plugin.') }}
13
+ </p>
 
 
14
  </div>
15
+ <div class="col-sm-8">
16
+ <div class="row">
17
+ <div class="col-sm-6">
18
+ <h3>{{ environment.translate('A small guide for the first-time user') }}</h3>
19
+ <p>
20
+ {{ environment.translate('Actually, Data Table plugin is very simple and has a lot of different options at the same time. That’s why when you close this article I will show you the main of them, but the very detailed one you can find on our site. I hope that you will have no questions after even this small guide. For the first time we will help you to install and create your first table, but if you need help - contact us through the internal support') }}
21
+ </p>
22
+ </div>
23
+ <div class="col-sm-6">
24
+ <h3>{{ environment.translate('Support') }}</h3>
25
+ <p>
26
+ {{ environment.translate('We really like what we do and feel responsibility for our “child”. Constantly we are trying to change something or update the new features, but sometimes you may have a situation when you need help or have a problem. We can offer you two kinds of help: ')|raw }}
27
+ </p>
28
+ <ul style="font-size: 13px; list-style: disc; padding: inherit;">
29
+ <li>{{ environment.translate('<a href="//supsystic.com/forum/datatable-plugin/" target="_blank"> Contact us </a> through the Forum on our site - if you have some question, offer or wish.')|raw }}</li>
30
+ <li>{{ environment.translate('If, unfortunately, you have some problem - we are ready to help you in our <a href="//supsystic.com/contact-us/" target="_blank">internal support.</a>')|raw }}</li>
31
+ </ul>
32
+ <p>{{ environment.translate('Feel free to contact us and don’t worry, everything gonna be ok!')|raw }} </p>
 
 
33
  </div>
34
+ </div>
35
+ <div class="row">
36
+ <div class="col-sm-12">
37
+ <h3>{{ environment.translate('Video Tutorial') }}</h3>
38
+ <iframe type="text/html"
39
+ width="90%"
40
+ height="330px"
41
+ src="https://www.youtube.com/embed/Fa3EI7-oBfc"
42
+ frameborder="0">
43
+ </iframe>
44
  </div>
45
  </div>
46
+ </div>
47
+ <div class="col-sm-4">
48
+ <h3>
49
+ {{ environment.translate('Frequently Asked Questions') }}
50
+ </h3>
51
 
52
+ <section>
53
+ <h4>{{ environment.translate('Make data table responsive') }}</h4>
54
+ <p>Data Tables Generator by Supsystic automatically creates responsive tables. So you don’t need to activate for this any options, it will be responsive by default. <br>Besides on Settings tab you can find “Responsive mode” option with which you are able to choose different responsive modes for your table (Standard Responsive mode, Automatic column hiding, Horizontal scroll or simply disable it).</p>
55
+ </section>
56
 
57
+ <section>
58
+ <h4>{{ environment.translate('I need to have line breaks/spaces between the paragraphs within the cells.') }}</h4>
59
+ <p>On Settings tab you can find “Enable paragraph mode” option - activate it and this mode will allow you to separate the content into the paragraphs. Paragraphs will appear in the places where you put “Ctrl+Enter”. Don't forget to save the table.</p>
60
+ </section>
61
 
62
+ <section>
63
+ <h4>{{ environment.translate('How to use formulas in the table?') }}</h4>
64
+ <ol>
65
+ <li>{{ environment.translate('Go to Editor of Data Table.') }}</li>
66
+ <li>{{ environment.translate('Select a cell and start typing. In a cell, type an equal sign “=” to start the formula.') }}</li>
67
+ <li>{{ environment.translate('Fill in the rest of the formula.') }}</li>
68
+ <li>{{ environment.translate('Save the changes of table.') }}</li>
69
+ <li>{{ environment.translate('Check the result of formula in the table on your site.') }}</li>
70
+ </ol>
71
+ <p>{{ environment.translate('Learn more about how to do this <a href="//supsystic.com/how-to-use-tables/" target="_blank">here</a>.')|raw }}</p>
72
+ </section>
73
 
74
+ <section>
75
+ <h4>
76
+ <a href="//supsystic.com/plugins/data-tables-generator-plugin/?utm_source=plugin&utm_medium=welcomepagefaq&utm_campaign=tables#faq" target="_blank">{{ environment.translate('Check all other FAQs') }}</a>
77
+ </h4>
78
+ </section>
79
 
80
+ <div style="clear: both;"></div>
81
+ <a href="{{ start_url }}" style="height: 46px!important; font-size: 20px !important; line-height: 44px !important; padding: 0 36px !important; min-width: 160px; text-align: center;" class="button button-primary button-hero">
82
+ {{ environment.translate("Let's Start!") }}
83
+ </a>
 
84
  </div>
85
  <div style="clear: both;"></div>
86
  </div>
87
  </div>
88
  </section>
89
+ {% endblock %}
src/SupsysticTables/Settings/views/index.twig CHANGED
@@ -36,6 +36,21 @@
36
  <input type="checkbox" name="settings[disable_wp_footer_fix]" {% if settings.disable_wp_footer_fix == 'on' %} checked {% endif %}>
37
  </div>
38
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  <div class="table-step-option table-option">
40
  <div class="setting-description">
41
  <label>{{ environment.translate('Rows Count per Request') }}</label>
@@ -95,4 +110,4 @@
95
  </div>
96
  </div>
97
  <!-- /.supsystic-item -->
98
- {% endblock %}
36
  <input type="checkbox" name="settings[disable_wp_footer_fix]" {% if settings.disable_wp_footer_fix == 'on' %} checked {% endif %}>
37
  </div>
38
  </div>
39
+ <div class="table-pagination-option table-option">
40
+ <div class="setting-description">
41
+ <label>{{ environment.translate('Pagination in Editor') }}</label>
42
+ {{ tooltip.icon('Add pages to your table in Editor', 'top', true) }}
43
+ </label>
44
+ </div>
45
+ <div class="setting-control">
46
+ <input type="checkbox" name="settings[editor_pagination]" {% if settings.editor_pagination == 'on' %} checked {% endif %}>
47
+ <label>{{ environment.translate('rows per page') }}: </label>
48
+ <input type="text"
49
+ name="settings[editor_pagination_rows]"
50
+ style="width:60px"
51
+ value="{{ settings.editor_pagination_rows | default('500') }}" />
52
+ </div>
53
+ </div>
54
  <div class="table-step-option table-option">
55
  <div class="setting-description">
56
  <label>{{ environment.translate('Rows Count per Request') }}</label>
110
  </div>
111
  </div>
112
  <!-- /.supsystic-item -->
113
+ {% endblock %}
src/SupsysticTables/Tables/Model/Tables.php CHANGED
@@ -493,6 +493,23 @@ class SupsysticTables_Tables_Model_Tables extends SupsysticTables_Core_BaseModel
493
  return array_map(array($this, 'onTablesGet'), $tables);
494
  }
495
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  /**
497
  * {@inheritdoc}
498
  *
@@ -504,9 +521,9 @@ class SupsysticTables_Tables_Model_Tables extends SupsysticTables_Core_BaseModel
504
 
505
  $dispatcher = $this->environment->getDispatcher();
506
 
507
-
508
  $dispatcher->on('tables_get', array($this, 'onTablesGet'));
509
  $dispatcher->on('tables_get', array($this, 'onTablesGetPro'));
 
510
  // No reason to fetch all data from all tables when we need only tables list
511
  // $dispatcher->on('tables_get_all', array($this, 'onTablesGetAll'));
512
  }
@@ -556,16 +573,16 @@ class SupsysticTables_Tables_Model_Tables extends SupsysticTables_Core_BaseModel
556
  ->andWhere( 'post_content', 'LIKE', '%[supsystic-tables%' )
557
  ->orderBy('id')
558
  ->order('ASC');
559
-
560
  $postsWithTables = $this->db->get_results($query->build());
 
561
  if($postsWithTables) {
562
  foreach($postsWithTables as $parsingPost) {
563
  $content = $parsingPost->post_content;
 
564
  if(preg_match_all('|\[supsystic-tables\s+id=[\'"]?(\d+)[\'"]?\s*?\]|',$content,$matches)) {
565
  array_shift( $matches );
566
- foreach ( $matches[0] as $matchedTableId ) {
567
-
568
- if ( in_array( $matchedTableId, array_keys($tableIds)) ) {
569
  $postIds[ $parsingPost->ID ]['tables'][] = $matchedTableId;
570
  }
571
  }
@@ -583,18 +600,24 @@ class SupsysticTables_Tables_Model_Tables extends SupsysticTables_Core_BaseModel
583
  public function getTableIdsBySearchTokens($tokens)
584
  {
585
  $tableIds = array();
586
- $query = $this->getQueryBuilder()->select('id')
587
- ->from($this->db->prefix . 'supsystic_tbl_tables')
588
- ->orderBy('id')
589
- ->order('ASC');
590
-
591
- $allTable = $this->db->get_results($query->build());
592
 
593
- foreach($allTable as $table) {
594
- $tableRows = $this->getRowsLike($table->id, $tokens);
 
 
 
 
595
 
596
- foreach($tableRows as $row) {
597
- $tableIds[$row->table_id][] = $row->id;
 
 
598
  }
599
  }
600
  return $tableIds;
@@ -608,20 +631,19 @@ class SupsysticTables_Tables_Model_Tables extends SupsysticTables_Core_BaseModel
608
  public function getRowsLike($id, $tokens) {
609
  $firstToken = array_shift($tokens);
610
  $query = $this->getQueryBuilder()
611
- ->select( $this->getField( 'rows', '*' ) )
612
- ->from( $this->getTable( 'rows' ) )
613
- ->where( 'data', 'LIKE', "%{$firstToken}%" )
614
- ->orderBy( $this->getField( 'rows', 'id' ) );
615
- if($tokens){
616
- foreach ( $tokens as $token ) {
617
- $token = trim($token);
618
- $query->orWhere( 'data', 'LIKE', "%{$token}%" );
619
- }
620
  }
621
- $query->andWhere( 'table_id', '=', (int) $id );
622
-
623
  $rows = $this->db->get_results( $query->build() );
624
- if ( $this->db->last_error ) {
 
625
  throw new RuntimeException( $this->db->last_error );
626
  }
627
  return $rows;
493
  return array_map(array($this, 'onTablesGet'), $tables);
494
  }
495
 
496
+ /**
497
+ * Callback for SupsysticTables_Core_BaseModel::removeById()
498
+ * @see SupsysticTables_Core_BaseModel::removeById()
499
+ * @param int $id Table id
500
+ * @return object|null
501
+ */
502
+ public function onTablesRemove($id)
503
+ {
504
+ if (empty($id)) {
505
+ return null;
506
+ }
507
+
508
+ $this->removeRows($id);
509
+
510
+ return null;
511
+ }
512
+
513
  /**
514
  * {@inheritdoc}
515
  *
521
 
522
  $dispatcher = $this->environment->getDispatcher();
523
 
 
524
  $dispatcher->on('tables_get', array($this, 'onTablesGet'));
525
  $dispatcher->on('tables_get', array($this, 'onTablesGetPro'));
526
+ $dispatcher->on('tables_remove', array($this, 'onTablesRemove'));
527
  // No reason to fetch all data from all tables when we need only tables list
528
  // $dispatcher->on('tables_get_all', array($this, 'onTablesGetAll'));
529
  }
573
  ->andWhere( 'post_content', 'LIKE', '%[supsystic-tables%' )
574
  ->orderBy('id')
575
  ->order('ASC');
 
576
  $postsWithTables = $this->db->get_results($query->build());
577
+
578
  if($postsWithTables) {
579
  foreach($postsWithTables as $parsingPost) {
580
  $content = $parsingPost->post_content;
581
+
582
  if(preg_match_all('|\[supsystic-tables\s+id=[\'"]?(\d+)[\'"]?\s*?\]|',$content,$matches)) {
583
  array_shift( $matches );
584
+ foreach($matches[0] as $matchedTableId) {
585
+ if (in_array( $matchedTableId, array_keys($tableIds))) {
 
586
  $postIds[ $parsingPost->ID ]['tables'][] = $matchedTableId;
587
  }
588
  }
600
  public function getTableIdsBySearchTokens($tokens)
601
  {
602
  $tableIds = array();
603
+ $query = $this->getQueryBuilder()
604
+ ->select('id')
605
+ ->from($this->db->prefix . 'supsystic_tbl_tables')
606
+ ->orderBy('id')
607
+ ->order('ASC');
608
+ $allTables = $this->db->get_results($query->build());
609
 
610
+ if($this->db->last_error) {
611
+ throw new RuntimeException( $this->db->last_error );
612
+ }
613
+ if(!empty($allTables)){
614
+ foreach($allTables as $table) {
615
+ $tableRows = $this->getRowsLike($table->id, $tokens);
616
 
617
+ foreach($tableRows as $row) {
618
+ $tableIds[$row->table_id] = !empty($tableIds[$row->table_id]) ? $tableIds[$row->table_id] : array();
619
+ array_push($tableIds[$row->table_id], $row->id);
620
+ }
621
  }
622
  }
623
  return $tableIds;
631
  public function getRowsLike($id, $tokens) {
632
  $firstToken = array_shift($tokens);
633
  $query = $this->getQueryBuilder()
634
+ ->select($this->getField('rows', '*'))
635
+ ->from($this->getTable('rows'))
636
+ ->where('data', 'LIKE', "%{$firstToken}%")
637
+ ->orderBy($this->getField( 'rows', 'id' ));
638
+
639
+ foreach($tokens as $token) {
640
+ $token = trim($token);
641
+ $query->orWhere( 'data', 'LIKE', "%{$token}%" );
 
642
  }
643
+ $query->andWhere('table_id', '=', (int) $id);
 
644
  $rows = $this->db->get_results( $query->build() );
645
+
646
+ if($this->db->last_error) {
647
  throw new RuntimeException( $this->db->last_error );
648
  }
649
  return $rows;
src/SupsysticTables/Tables/Module.php CHANGED
@@ -146,31 +146,39 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
146
  * Add the capability to search in the tables
147
  */
148
  public function registerSearchFilter() {
149
- $settings = get_option('supsystic_tbl_settings');
150
- if (isset($settings['table_search']) AND ($settings['table_search'] == 'on')) {
151
- add_filter( 'posts_where' , array($this, 'tables_search_filter'));
 
 
 
152
  }
153
  }
154
 
155
- public function tables_search_filter($where) {
156
  global $wpdb;
157
 
158
- if(!is_search()) {
159
- return $where;
160
- }
161
- $environment = $this->getEnvironment();
162
- $core = $environment->getModule('core');
163
- $tables = $core->getModelsFactory()->get('tables');
164
 
165
- $tokens = explode(' ', get_search_query());
166
- $tableIds = $tables->getTableIdsBySearchTokens($tokens);
167
- if(!$tableIds) {
168
- return $where;
169
- }
170
- $postIds = $tables->getPostIdsByTableIds($tableIds);
171
- if($postIds) {
172
- $idsStr = implode(',',array_keys($postIds));
173
- $where .= " OR {$wpdb->prefix}posts.ID IN ({$idsStr}) ";
 
 
 
 
 
 
 
 
 
174
  }
175
  return $where;
176
  }
@@ -237,7 +245,8 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
237
  }
238
  }
239
  }
240
- if($this->isSingleCell || $this->isTablePart) {
 
241
  // Unset unneeded elements and features
242
  unset($table->settings['elements']['head']);
243
  unset($table->settings['elements']['foot']);
@@ -308,6 +317,13 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
308
  $table->rows[$key]['cells'][$index]['calculatedValue'] = $this->isFromHistory[$key]['cells'][$index]['calculatedValue'];
309
  }
310
  }
 
 
 
 
 
 
 
311
  $table->rows[$key]['cells'][$index]['data'] = do_shortcode($table->rows[$key]['cells'][$index]['data']);
312
  }
313
  }
@@ -426,7 +442,7 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
426
  return $environment->translate('There are not all shortcode\'s attributes specified. Usage example') . ':<br />'
427
  . sprintf('[%s id="{table id}" row="{row number}" col="{column number}"]', $shortcode);
428
  }
429
- return $this->renderCellValue((int)$attributes['id'], (int)$attributes['row'], (int)$attributes['col']);
430
  }
431
 
432
  private function registerCellShortcode() {
@@ -453,7 +469,7 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
453
  add_action('wp_footer', array($asset, 'load'));
454
  }
455
  }
456
- $this->isSingleCell = array('row' => (int)$attributes['row'], 'col' => (int)$attributes['col']);
457
 
458
  return $this->render((int) (int)$attributes['id']);
459
  }
@@ -483,7 +499,7 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
483
  }
484
  $this->isTablePart = array(
485
  'row' => array_key_exists('row', $attributes) ? array_filter(explode(',', $attributes['row'])) : array(),
486
- 'col' => array_key_exists('col', $attributes) ? array_filter(explode(',', $attributes['col'])) : array(),
487
  );
488
 
489
  return $this->render((int)$attributes['id']);
@@ -570,6 +586,8 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
570
 
571
  $this->loadDataTables($ui);
572
 
 
 
573
  $ui->add(
574
  $ui->createScript('supsystic-tables-datatables-numeral')
575
  ->setHookName($dynamicHookName)
@@ -785,6 +803,33 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
785
  );*/
786
  }
787
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
788
  private function loadRuleJS(SupsysticTables_Ui_Module $ui)
789
  {
790
  $hookName = 'admin_enqueue_scripts';
@@ -1009,7 +1054,7 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
1009
  }
1010
 
1011
  $menu->addSubmenuItem('tables', $item);
1012
-
1013
  // We change Settings submenu position
1014
  if($menu->getSubmenuItem('settings')) {
1015
  $settings = $menu->getSubmenuItem('settings');
@@ -1135,17 +1180,17 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
1135
  'part_shortcode' => array(
1136
  'name' => $config->get('shortcode_part_name'),
1137
  'label' => $environment->translate('Table Part Shortcode'),
1138
- 'attrs' => 'row=1,2 col=1,2',
1139
  ),
1140
  'cell_shortcode' => array(
1141
- 'name' => $config->get('shortcode_part_name'),
1142
  'label' => $environment->translate('Cell Shortcode'),
1143
- 'attrs' => 'row=1 col=1',
1144
  ),
1145
  'value_shortcode' => array(
1146
  'name' => $config->get('shortcode_value_name'),
1147
  'label' => $environment->translate('Value Shortcode'),
1148
- 'attrs' => 'row=1 col=1',
1149
  ),
1150
  'php_code' => array(
1151
  'name' => $config->get('shortcode_name'),
@@ -1162,9 +1207,9 @@ class SupsysticTables_Tables_Module extends SupsysticTables_Core_BaseModule
1162
  'attrs' => 'use_history=1',
1163
  );
1164
  }
1165
-
1166
  return $dispatcher->apply('table-shortcodes-list', array($shortcodes));
1167
  }
1168
  }
1169
 
1170
- require_once('Model/widget.php');
146
  * Add the capability to search in the tables
147
  */
148
  public function registerSearchFilter() {
149
+ if (!is_admin()) {
150
+ $settings = get_option('supsystic_tbl_settings');
151
+
152
+ if (!empty($settings['table_search'])) {
153
+ add_filter('posts_where' , array($this, 'globalTablesSearchFilter'));
154
+ }
155
  }
156
  }
157
 
158
+ public function globalTablesSearchFilter($where) {
159
  global $wpdb;
160
 
161
+ if(is_main_query() && is_search()) {
162
+ $search_query = trim(get_search_query());
 
 
 
 
163
 
164
+ if(!empty($search_query)) {
165
+ $core = $this->getEnvironment()->getModule('core');
166
+ $tables = $core->getModelsFactory()->get('tables');
167
+ $tokens = array_filter(explode(' ', $search_query));
168
+
169
+ if(!empty($tokens)) {
170
+ $tableIds = $tables->getTableIdsBySearchTokens($tokens);
171
+
172
+ if(!empty($tableIds)) {
173
+ $postIds = $tables->getPostIdsByTableIds($tableIds);
174
+
175
+ if(!empty($postIds)) {
176
+ $idsStr = implode(',',array_keys($postIds));
177
+ $where .= " OR {$wpdb->prefix}posts.ID IN ({$idsStr}) ";
178
+ }
179
+ }
180
+ }
181
+ }
182
  }
183
  return $where;
184
  }
245
  }
246
  }
247
  }
248
+ $lightbox = ($environment->isPro() && isset($table->settings['styling']['lightboxImg']) && $table->settings['styling']['lightboxImg'] == 'on');
249
+ if($this->isSingleCell) {
250
  // Unset unneeded elements and features
251
  unset($table->settings['elements']['head']);
252
  unset($table->settings['elements']['foot']);
317
  $table->rows[$key]['cells'][$index]['calculatedValue'] = $this->isFromHistory[$key]['cells'][$index]['calculatedValue'];
318
  }
319
  }
320
+ // add href for Lightbox
321
+ if($lightbox && substr($cell['data'], 0, 10) == '<img src="'){
322
+ $endHref = strpos($cell['data'], '"', 15);
323
+ if($endHref > 0) {
324
+ $table->rows[$key]['cells'][$index]['imgHref'] = substr($cell['data'], 10, $endHref - 10);
325
+ }
326
+ }
327
  $table->rows[$key]['cells'][$index]['data'] = do_shortcode($table->rows[$key]['cells'][$index]['data']);
328
  }
329
  }
442
  return $environment->translate('There are not all shortcode\'s attributes specified. Usage example') . ':<br />'
443
  . sprintf('[%s id="{table id}" row="{row number}" col="{column number}"]', $shortcode);
444
  }
445
+ return $this->renderCellValue((int)$attributes['id'], (int)$attributes['row'], (int)$this->_lettersToNumbers($attributes['col']));
446
  }
447
 
448
  private function registerCellShortcode() {
469
  add_action('wp_footer', array($asset, 'load'));
470
  }
471
  }
472
+ $this->isSingleCell = array('row' => (int)$attributes['row'], 'col' => (int)$this->_lettersToNumbers($attributes['col']));
473
 
474
  return $this->render((int) (int)$attributes['id']);
475
  }
499
  }
500
  $this->isTablePart = array(
501
  'row' => array_key_exists('row', $attributes) ? array_filter(explode(',', $attributes['row'])) : array(),
502
+ 'col' => array_key_exists('col', $attributes) ? $this->_lettersToNumbers(array_filter(explode(',', $attributes['col']))) : array(),
503
  );
504
 
505
  return $this->render((int)$attributes['id']);
586
 
587
  $this->loadDataTables($ui);
588
 
589
+ if ($environment->isPro()) $this->loadFeatherLight($ui);
590
+
591
  $ui->add(
592
  $ui->createScript('supsystic-tables-datatables-numeral')
593
  ->setHookName($dynamicHookName)
803
  );*/
804
  }
805
 
806
+ private function loadFeatherLight(SupsysticTables_Ui_Module $ui)
807
+ {
808
+ $hookName = 'admin_enqueue_scripts';
809
+ $dynamicHookName = is_admin() ? $hookName : 'wp_enqueue_scripts';
810
+
811
+ if (is_admin() && !$this->getEnvironment()->isModule('tables', 'view')) {
812
+ return;
813
+ }
814
+
815
+ $ui->add(
816
+ $ui->createScript('supsystic-tables-featherlight-js')
817
+ ->setHookName($dynamicHookName)
818
+ ->setModuleSource($this, 'libraries/featherlight/featherlight.min.js')
819
+ ->setCachingAllowed(true)
820
+ ->addDependency('jquery')
821
+ ->setVersion('1.7.13')
822
+ );
823
+
824
+ $ui->add(
825
+ $ui->createStyle('supsystic-tables-tables-featherlight-css')
826
+ ->setHookName($dynamicHookName)
827
+ ->setModuleSource($this, 'libraries/featherlight/featherlight.min.css')
828
+ ->setCachingAllowed(true)
829
+ ->setVersion('1.7.13')
830
+ );
831
+ }
832
+
833
  private function loadRuleJS(SupsysticTables_Ui_Module $ui)
834
  {
835
  $hookName = 'admin_enqueue_scripts';
1054
  }
1055
 
1056
  $menu->addSubmenuItem('tables', $item);
1057
+
1058
  // We change Settings submenu position
1059
  if($menu->getSubmenuItem('settings')) {
1060
  $settings = $menu->getSubmenuItem('settings');
1180
  'part_shortcode' => array(
1181
  'name' => $config->get('shortcode_part_name'),
1182
  'label' => $environment->translate('Table Part Shortcode'),
1183
+ 'attrs' => 'row=1,2 col=A,B',
1184
  ),
1185
  'cell_shortcode' => array(
1186
+ 'name' => $config->get('shortcode_cell_name'),
1187
  'label' => $environment->translate('Cell Shortcode'),
1188
+ 'attrs' => 'row=1 col=A',
1189
  ),
1190
  'value_shortcode' => array(
1191
  'name' => $config->get('shortcode_value_name'),
1192
  'label' => $environment->translate('Value Shortcode'),
1193
+ 'attrs' => 'row=1 col=A',
1194
  ),
1195
  'php_code' => array(
1196
  'name' => $config->get('shortcode_name'),
1207
  'attrs' => 'use_history=1',
1208
  );
1209
  }
1210
+
1211
  return $dispatcher->apply('table-shortcodes-list', array($shortcodes));
1212
  }
1213
  }
1214
 
1215
+ require_once('Model/widget.php');
src/SupsysticTables/Tables/assets/css/tables.editor.css CHANGED
@@ -379,3 +379,19 @@ i.toolbar-word-wrap.word-wrap-visible {
379
  width: 85%;
380
  }
381
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  width: 85%;
380
  }
381
  }
382
+ #pagination {
383
+ padding-top: 7px;
384
+ }
385
+ #pagination a {
386
+ text-decoration: none;
387
+ line-height: 2;
388
+ padding: 2px 5px 2px 7px;
389
+ margin: 2px;
390
+ font-size: 14px;
391
+ border: 1px solid #ccc;
392
+ color: #ccc;
393
+ }
394
+ .pageCur {
395
+ border: 1px solid #000 !important;
396
+ color: #000 !important;
397
+ }
src/SupsysticTables/Tables/assets/css/tables.shortcode.css CHANGED
@@ -153,8 +153,8 @@ table.oneColumn thead,
153
  table.oneColumn tbody,
154
  table.oneColumn th,
155
  table.oneColumn td,
156
- table.oneColumn tr {
157
- display: block;
158
  }
159
 
160
  table.oneColumn thead tr, table.oneColumn tfoot tr {
@@ -168,12 +168,11 @@ table.oneColumn tr {
168
  height: auto!important;
169
  }
170
 
171
- table.oneColumn td {
172
  border: none;
173
- border-bottom: 1px solid #eee;
174
  position: relative;
175
  text-align: left;
176
- width: 100%!important;
177
  box-sizing: border-box;
178
  }
179
 
@@ -182,17 +181,17 @@ table.oneColumnWithLabels td {
182
  border-top: none !important;
183
  }
184
 
185
- table.oneColumnWithLabels td:before {
186
  position: absolute;
187
  text-align: left;
188
  top: 6px;
189
  left: 6px;
190
- width: 45%;
191
- padding-right: 10px;
192
  white-space: nowrap;
193
  }
194
 
195
- table.oneColumnWithLabels td:after {
196
  content: '';
197
  display: inline-block;
198
  }
@@ -227,5 +226,14 @@ table.oneColumnWithLabels td:after {
227
 
228
  /* Fix for using autowidth for tables with Fixed Header or Horizontal scroll responsive mode */
229
  .supsystic-tables-wrap .dataTables_scrollHeadInner, .supsystic-tables-wrap .dataTables_scrollFootInner {
230
- margin: 0 auto !important;
231
- }
 
 
 
 
 
 
 
 
 
153
  table.oneColumn tbody,
154
  table.oneColumn th,
155
  table.oneColumn td,
156
+ table.oneColumn tr {
157
+ display: block;
158
  }
159
 
160
  table.oneColumn thead tr, table.oneColumn tfoot tr {
168
  height: auto!important;
169
  }
170
 
171
+ table.oneColumn td {
172
  border: none;
173
+ border-bottom: 1px solid #eee;
174
  position: relative;
175
  text-align: left;
 
176
  box-sizing: border-box;
177
  }
178
 
181
  border-top: none !important;
182
  }
183
 
184
+ table.oneColumnWithLabels td:before {
185
  position: absolute;
186
  text-align: left;
187
  top: 6px;
188
  left: 6px;
189
+ width: 45%;
190
+ padding-right: 10px;
191
  white-space: nowrap;
192
  }
193
 
194
+ table.oneColumnWithLabels td:after {
195
  content: '';
196
  display: inline-block;
197
  }
226
 
227
  /* Fix for using autowidth for tables with Fixed Header or Horizontal scroll responsive mode */
228
  .supsystic-tables-wrap .dataTables_scrollHeadInner, .supsystic-tables-wrap .dataTables_scrollFootInner {
229
+ margin: 0 !important;
230
+ }
231
+ .supsystic-tables-wrap table {
232
+ margin-left: 0 !important;
233
+ }
234
+
235
+ table.dataTable tfoot input {
236
+ width: 100%;
237
+ padding: 3px;
238
+ box-sizing: border-box;
239
+ }
src/SupsysticTables/Tables/assets/css/tables.view.css CHANGED
@@ -236,6 +236,9 @@
236
  height: 33px;
237
  line-height: 33px;
238
  }
 
 
 
239
  .setting-item select {
240
  height: 33px;
241
  }
236
  height: 33px;
237
  line-height: 33px;
238
  }
239
+ .setting-options label {
240
+ padding-left: 15px;
241
+ }
242
  .setting-item select {
243
  height: 33px;
244
  }
src/SupsysticTables/Tables/assets/js/editor/tables.editor.js CHANGED
@@ -7,7 +7,7 @@ g_stbWindowHeight = 0;
7
  tablesModel = app.Models.Tables,
8
  editor = new Handsontable(document.getElementById('tableEditor'), {
9
  height: g_stbWindowHeight,
10
- renderAllRows: false, // To prevent losing of rows for huge tables (need to check in future is it all right now?)
11
  colWidths: 100,
12
  rowHeaders: true,
13
  colHeaders: true,
@@ -146,6 +146,9 @@ g_stbWindowHeight = 0;
146
  // Handsontable PRO event, add just in case (UndoRedo plugin listens this event)
147
  updateUndoRedoBtns();
148
  });
 
 
 
149
  editor.addHook('beforeChange', function (changes, source) {
150
  $.each(changes, function (index, changeSet) {
151
  var row = changeSet[0],
@@ -184,51 +187,184 @@ g_stbWindowHeight = 0;
184
  generateHeightData();
185
  });
186
  editor.addHook('afterCreateRow', function(insertRowIndex, amount, source) {
187
- var data = editor.getData(),
188
- i = insertRowIndex > amount ? insertRowIndex - 1 : insertRowIndex + 1;
 
 
 
 
 
 
 
 
 
 
189
 
190
  setTimeout(function() {
191
  for(var j = 0; j < data[insertRowIndex].length; j++) {
192
- editor.setCellMetaObject(insertRowIndex, j, editor.getCellMeta(i, j));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  }
194
- editor.render();
195
  }, 10);
196
  generateHeightData();
197
- editor.allHeights.splice(insertRowIndex, 0, editor.allHeights[i]);
 
 
198
  updateUndoRedoBtns();
199
  });
200
  editor.addHook('afterCreateCol', function(insertColumnIndex, amount, source) {
201
  insertColumnIndex = typeof(insertColumnIndex) != 'undefined' ? insertColumnIndex : 0;
202
 
203
- var selectedCell = editor.getSelected()
204
- , selectedColumnIndex = 0
205
- , data = editor.getData()
206
- , j = insertColumnIndex <= amount ? insertColumnIndex + 1 : insertColumnIndex - 1;
207
- if(selectedCell && selectedCell[1] && selectedCell[1] > 0) {
208
- selectedColumnIndex = selectedCell[1];
 
 
 
 
209
  }
 
210
  setTimeout(function() {
211
- for(var i = 0; i < data.length; i++) {
212
- editor.setCellMetaObject(i, insertColumnIndex, editor.getCellMeta(i, j))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  }
 
214
  editor.render();
215
  }, 10);
216
  generateWidthData();
217
- editor.allWidths.splice(selectedColumnIndex, 0, editor.allWidths[j]);
 
 
218
  updateUndoRedoBtns();
219
  });
220
  editor.addHook('afterRemoveRow', function (from, amount) {
221
  generateHeightData();
222
  editor.allHeights.splice(from, amount);
223
- var countRows = editor.countRows(),
224
- plugin = editor.getPlugin('ManualRowResize');
225
-
226
- for (var i = 0; i < countRows; i++) {
227
- var colHeight = editor.getRowHeight(i);
228
 
229
- if (colHeight !== editor.allHeights[i]) {
230
- plugin.setManualSize(i, editor.allHeights[i]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
233
  updateUndoRedoBtns();
234
  });
@@ -245,6 +381,58 @@ g_stbWindowHeight = 0;
245
  plugin.setManualSize(i, editor.allWidths[i]);
246
  }
247
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  updateUndoRedoBtns();
249
  });
250
  editor.addHook('afterRowResize', function(row, height) {
@@ -376,5 +564,195 @@ g_stbWindowHeight = 0;
376
  }
377
  }
378
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  });
380
- }(window.jQuery, window.supsystic.Tables));
7
  tablesModel = app.Models.Tables,
8
  editor = new Handsontable(document.getElementById('tableEditor'), {
9
  height: g_stbWindowHeight,
10
+ renderAllRows: g_stbPagination, // To prevent losing of rows for huge tables (need to check in future is it all right now?)
11
  colWidths: 100,
12
  rowHeaders: true,
13
  colHeaders: true,
146
  // Handsontable PRO event, add just in case (UndoRedo plugin listens this event)
147
  updateUndoRedoBtns();
148
  });
149
+ editor.addHook('afterRender', function (isForced) {
150
+ if(isForced) $(editor.table).find('a').attr('target', "_blank");
151
+ });
152
  editor.addHook('beforeChange', function (changes, source) {
153
  $.each(changes, function (index, changeSet) {
154
  var row = changeSet[0],
187
  generateHeightData();
188
  });
189
  editor.addHook('afterCreateRow', function(insertRowIndex, amount, source) {
190
+ var selectedCell = editor.getSelected(),
191
+ selectedRowIndex = 0;
192
+ if (selectedCell && selectedCell[0] && selectedCell[2]) {
193
+ var isMin = (selectedCell[0] <= selectedCell[2] ? 0 : 2);
194
+ if (insertRowIndex == selectedCell[isMin]) {
195
+ selectedRowIndex = selectedCell[isMin];
196
+ } else {
197
+ selectedRowIndex = selectedCell[(isMin == 0 ? 2 : 0)];
198
+ }
199
+ }
200
+ var i = (insertRowIndex <= selectedRowIndex ? insertRowIndex + amount : selectedRowIndex),
201
+ data = editor.getData();
202
 
203
  setTimeout(function() {
204
  for(var j = 0; j < data[insertRowIndex].length; j++) {
205
+ for(var n = 0; n < amount; n++) {
206
+ editor.setCellMetaObject(insertRowIndex + n, j, editor.getCellMeta(i, j));
207
+ }
208
+ }
209
+ if (amount > 1) {
210
+ var merge = editor.mergeCells.mergedCellInfoCollection;
211
+ for (var c = 0; c < merge.length; c++) {
212
+ if (merge[c].row >= insertRowIndex) {
213
+ merge[c].row += amount - 1;
214
+ }
215
+ }
216
+ }
217
+ if (g_stbPagination) {
218
+ var rowForBuffer = editor.pageStart + insertRowIndex,
219
+ countCols = editor.bufferCols,
220
+ meta = editor.bufferMeta,
221
+ merge = editor.bufferMerge;
222
+
223
+ updateFormulas(editor.pageStop + 1, 0, 'down', amount);
224
+
225
+ for(var n = 0; n < amount; n++) {
226
+ editor.bufferData.splice(rowForBuffer + n, 0, data[i]);
227
+ editor.bufferHeights.splice(rowForBuffer + n, 0, editor.allHeights[i]);
228
+ for (var j = 0; j < countCols; j++) {
229
+ meta.splice(rowForBuffer * countCols + j, 0, {});
230
+ }
231
+ }
232
+ for (var c = 0; c < merge.length; c++) {
233
+ if (merge[c].row >= rowForBuffer) {
234
+ merge[c].row += amount;
235
+ }
236
+ }
237
+ editor.generatePagingLinks();
238
+ editor.setPageData();
239
+ } else {
240
+ toolbar.renderTooltips(insertRowIndex, 0);
241
+ editor.render();
242
  }
 
243
  }, 10);
244
  generateHeightData();
245
+ for(var n = 0; n < amount; n++) {
246
+ editor.allHeights.splice(insertRowIndex + n, 0, editor.allHeights[selectedRowIndex]);
247
+ }
248
  updateUndoRedoBtns();
249
  });
250
  editor.addHook('afterCreateCol', function(insertColumnIndex, amount, source) {
251
  insertColumnIndex = typeof(insertColumnIndex) != 'undefined' ? insertColumnIndex : 0;
252
 
253
+ var selectedCell = editor.getSelected(),
254
+ selectedColumnIndex = 0;
255
+
256
+ if (selectedCell && selectedCell[1] && selectedCell[3]) {
257
+ var isMin = (selectedCell[1] <= selectedCell[3] ? 1 : 3);
258
+ if (insertColumnIndex == selectedCell[isMin]) {
259
+ selectedColumnIndex = selectedCell[isMin];
260
+ } else {
261
+ selectedColumnIndex = selectedCell[(isMin == 1 ? 3 : 1)];
262
+ }
263
  }
264
+ var j = (insertColumnIndex <= selectedColumnIndex ? insertColumnIndex + amount : selectedColumnIndex);
265
  setTimeout(function() {
266
+ var countRows = editor.getData().length;
267
+ for(var i = 0; i < countRows; i++) {
268
+ for(var n = 0; n < amount; n++) {
269
+ editor.setCellMetaObject(i, insertColumnIndex + n, editor.getCellMeta(i, j));
270
+ }
271
+ }
272
+ if (amount > 1) {
273
+ var merge = editor.mergeCells.mergedCellInfoCollection;
274
+ for (var i = 0; i < merge.length; i++) {
275
+ if (merge[i].col >= insertColumnIndex) {
276
+ merge[i].col += amount - 1;
277
+ }
278
+ }
279
+ }
280
+
281
+ if (g_stbPagination) {
282
+ var countCols = editor.bufferCols,
283
+ data = editor.bufferData,
284
+ meta = editor.bufferMeta,
285
+ merge = editor.bufferMerge;
286
+
287
+ updateFormulas(0, insertColumnIndex, 'right', amount);
288
+
289
+ for (var i = data.length - 1; i >= 0; i--) {
290
+ for (var n = 0; n < amount; n++) {
291
+ data[i].splice(insertColumnIndex + n, 0, '');
292
+ meta.splice(i * countCols + insertColumnIndex + n, 0, $.extend(true, {}, meta[i * countCols + selectedColumnIndex]));
293
+ }
294
+ }
295
+ for (var i = 0; i < merge.length; i++) {
296
+ if (merge[i].col >= insertColumnIndex) {
297
+ merge[i].col += amount;
298
+ }
299
+ }
300
+ editor.bufferCols += amount;
301
  }
302
+ toolbar.renderTooltips(0, insertColumnIndex);
303
  editor.render();
304
  }, 10);
305
  generateWidthData();
306
+ for(var n = 0; n < amount; n++) {
307
+ editor.allWidths.splice(insertColumnIndex + n, 0, editor.allWidths[selectedColumnIndex]);
308
+ }
309
  updateUndoRedoBtns();
310
  });
311
  editor.addHook('afterRemoveRow', function (from, amount) {
312
  generateHeightData();
313
  editor.allHeights.splice(from, amount);
 
 
 
 
 
314
 
315
+ if (g_stbPagination) {
316
+ var rowForBuffer = editor.pageStart + from,
317
+ rowForBufferAfter = rowForBuffer + amount,
318
+ countCols = editor.bufferCols,
319
+ merge = editor.bufferMerge,
320
+ mergeNew = [];
321
+
322
+ updateFormulas(editor.pageStop + 1, 0, 'up', amount);
323
+
324
+ editor.bufferData.splice(rowForBuffer, amount);
325
+ editor.bufferHeights.splice(rowForBuffer, amount);
326
+ editor.bufferMeta.splice(rowForBuffer * countCols, amount * countCols);
327
+
328
+ for (var i = 0; i < merge.length; i++) {
329
+ var row = merge[i].row;
330
+ if (row < rowForBuffer) {
331
+ mergeNew.push(merge[i]);
332
+ } else if (row >= rowForBufferAfter) {
333
+ mergeNew.push({
334
+ col: merge[i].col,
335
+ colspan: merge[i].colspan,
336
+ row: row - amount,
337
+ rowspan: merge[i].rowspan
338
+ });
339
+ }
340
  }
341
+ editor.bufferMerge = mergeNew;
342
+ setTimeout(function() {
343
+ if (amount > 1) {
344
+ var merge = editor.mergeCells.mergedCellInfoCollection;
345
+ for (var i = 0; i < merge.length; i++) {
346
+ if (merge[i].row >= from) {
347
+ merge[i].row -= (amount - 1);
348
+ }
349
+ }
350
+ }
351
+ editor.generatePagingLinks();
352
+ editor.setPageData();
353
+ }, 10);
354
+ } else {
355
+ var countRows = editor.countRows(),
356
+ plugin = editor.getPlugin('ManualRowResize');
357
+
358
+ for (var i = 0; i < countRows; i++) {
359
+ var colHeight = editor.getRowHeight(i);
360
+
361
+ if (colHeight !== editor.allHeights[i]) {
362
+ plugin.setManualSize(i, editor.allHeights[i]);
363
+ }
364
+ }
365
+ setTimeout(function() {
366
+ toolbar.renderTooltips(from, 0);
367
+ }, 10);
368
  }
369
  updateUndoRedoBtns();
370
  });
381
  plugin.setManualSize(i, editor.allWidths[i]);
382
  }
383
  }
384
+
385
+ if (g_stbPagination) {
386
+ var colAfter = from + amount,
387
+ countCols = editor.bufferCols,
388
+ data = editor.bufferData,
389
+ meta = editor.bufferMeta,
390
+ merge = editor.bufferMerge,
391
+ mergeNew = [],
392
+ mergeCur = [];
393
+
394
+ updateFormulas(0, colAfter, 'left', amount);
395
+
396
+ for (var i = data.length - 1; i >= 0; i--) {
397
+ data[i].splice(from, amount);
398
+ meta.splice(i * countCols + from, amount);
399
+ }
400
+
401
+ countCols -= amount;
402
+ for (var i = 0; i < merge.length; i++) {
403
+ var col = merge[i].col;
404
+ if (col < from || col >= colAfter) {
405
+ var lastCol = col + merge[i].colspan - 1,
406
+ colspan = (lastCol >= countCols ? countCols - 1 : lastCol) - col + 1;
407
+
408
+ if (colspan > 1 || (colspan == 1 && merge[i].rowspan > 1)) {
409
+ var mergeObj = {
410
+ col: (col < from ? col : col - amount),
411
+ colspan: colspan,
412
+ row: merge[i].row,
413
+ rowspan: merge[i].rowspan
414
+ }
415
+ mergeNew.push(mergeObj);
416
+ if (merge[i].row >= editor.pageStart && merge[i].row <= editor.pageStop) {
417
+ mergeCur.push(mergeObj);
418
+ }
419
+ }
420
+ }
421
+ }
422
+ editor.bufferMerge = mergeNew;
423
+ editor.bufferCols -= amount;
424
+ editor.updateSettings({
425
+ mergeCells: mergeCur
426
+ });
427
+
428
+ setTimeout(function() {
429
+ editor.setPageData();
430
+ }, 10);
431
+ } else {
432
+ setTimeout(function() {
433
+ toolbar.renderTooltips(0, from);
434
+ }, 10);
435
+ }
436
  updateUndoRedoBtns();
437
  });
438
  editor.addHook('afterRowResize', function(row, height) {
564
  }
565
  }
566
  }
567
+
568
+ function updateFormulas(row, col, direction, amount) {
569
+ var data = editor.bufferData,
570
+ countCols = editor.bufferCols;
571
+
572
+ for (var i = row; i < data.length; i++) {
573
+ for (var j = col; j < countCols; j++) {
574
+ if (data[i][j] && data[i][j][0] === '='){
575
+ data[i][j] = editor.plugin.utils.updateFormula(data[i][j], direction, amount);
576
+ }
577
+ }
578
+ }
579
+ }
580
+
581
+ editor.generatePagingLinks = (function () {
582
+ return function () {
583
+ var links = Math.ceil(this.bufferData.length/g_stbRowsPerPage),
584
+ pagination = $('#pagination');
585
+
586
+ if (pagination.length == 1) $(pagination).children('a').remove();
587
+ else pagination = $('<div id="pagination" class="pagination"></div>').insertAfter('#tableEditor');
588
+ for (var i = 1; i <= links; i++) {
589
+ $('<a>').attr('href', '#' + i).text(i + ' ').appendTo('#pagination');
590
+ }
591
+ }
592
+ })();
593
+
594
+ editor.setPageData = (function () {
595
+ return function (inBuffer = true) {
596
+ if (inBuffer) {
597
+ this.copyInBuffer();
598
+ }
599
+
600
+ var page = parseInt(window.location.hash.replace('#', ''), 10) || 1,
601
+ limit = g_stbRowsPerPage,
602
+ countRows = this.bufferData.length,
603
+ countCols = this.bufferCols,
604
+ start = (page - 1) * limit;
605
+
606
+ if (start >= countRows) {
607
+ page = 1;
608
+ start = 0;
609
+ }
610
+
611
+ var stop = page * limit - 1,
612
+ heights = [];
613
+ partData = [],
614
+ mergeCells = [],
615
+ rowHeaders = [],
616
+ links = $('#pagination a');
617
+
618
+
619
+ for (var i = 0; i < links.length; i++) {
620
+ if (i == page - 1) {
621
+ $(links[i]).addClass('pageCur');
622
+ } else {
623
+ $(links[i]).removeClass();
624
+ }
625
+ }
626
+
627
+ if (stop >= countRows) {
628
+ stop = countRows - 1;
629
+ }
630
+ for (var row = start; row <= stop; row++) {
631
+ partData.push(this.bufferData[row].slice());
632
+ heights.push(this.bufferHeights[row]);
633
+ rowHeaders.push(row + 1);
634
+ }
635
+ for (var m = 0; m < this.bufferMerge.length; m++) {
636
+ var merge = this.bufferMerge[m];
637
+ if (merge.row >= start && merge.row <= stop) {
638
+ mergeCells.push({
639
+ col: merge.col,
640
+ colspan: merge.colspan,
641
+ row: merge.row % limit,
642
+ rowspan: merge.rowspan
643
+ });
644
+ }
645
+ }
646
+ this.updateSettings({
647
+ rowHeights: heights,
648
+ mergeCells: mergeCells,
649
+ manualRowResize: false,
650
+ rowHeaders: rowHeaders
651
+ });
652
+ this.pageStart = start;
653
+ this.pageStop = stop;
654
+ this.loadData(partData);
655
+ this.allHeights = heights;
656
+
657
+ var r = 0;
658
+ for (row = start; row <= stop; row++) {
659
+ for (var col = 0; col < countCols; col++) {
660
+ this.setCellMetaObject(r, col, this.bufferMeta[row * countCols + col]);
661
+ toolbar.setTooltip(r, col);
662
+ }
663
+ r++;
664
+ }
665
+ this.render();
666
+ this.updateSettings({
667
+ manualRowResize: true
668
+ });
669
+ }
670
+ })();
671
+
672
+ editor.copyInBuffer = (function () {
673
+ return function () {
674
+ if (typeof this.pageStop == 'undefined') {
675
+ return;
676
+ }
677
+
678
+ var countRows = this.countRows(),
679
+ countCols = this.countCols(),
680
+ start = this.pageStart,
681
+ stop = this.pageStop,
682
+ data = this.getData(),
683
+ merge = this.mergeCells.mergedCellInfoCollection;
684
+ real = 0;
685
+
686
+ for (var row = 0; row < countRows; row++) {
687
+ real = start + row;
688
+ this.bufferData[real] = data[row].slice();
689
+ this.bufferHeights[real] = this.getRowHeight(row);
690
+ for (var col = 0; col < countCols; col++) {
691
+ this.bufferMeta[real * countCols + col] = editor.getCellMeta(row, col);
692
+ }
693
+ }
694
+
695
+ var mergeNew = [];
696
+ for (var i = 0; i < merge.length; i++) {
697
+ mergeNew.push({
698
+ col: merge[i].col,
699
+ colspan: merge[i].colspan,
700
+ row: start + merge[i].row,
701
+ rowspan: merge[i].rowspan
702
+ });
703
+ }
704
+ for (var i = 0; i < this.bufferMerge.length; i++) {
705
+ row = this.bufferMerge[i].row;
706
+ if (row < start || row > stop) {
707
+ mergeNew.push(this.bufferMerge[i]);
708
+ }
709
+ }
710
+ this.bufferMerge = mergeNew;
711
+ }
712
+ })();
713
+
714
+ editor.mergeGetInfo = (function () {
715
+ return function (x, y) {
716
+ var merge = this.bufferMerge;
717
+
718
+ for (var n = 0, o = this.bufferMerge.length; n < o; n++) {
719
+ if (merge[n].row <= x && merge[n].row + merge[n].rowspan - 1 >= x && merge[n].col <= y && merge[n].col + merge[n].colspan - 1 >= y) {
720
+ return merge[n];
721
+ }
722
+ }
723
+ }
724
+ })();
725
+
726
+ editor.getSourceDataPagination = (function () {
727
+ return function (fromX, fromY, toX, toY) {
728
+ this.copyInBuffer();
729
+ var data = this.bufferData,
730
+ rangeData = [],
731
+ buffer;
732
+
733
+ if (fromX > toX) {
734
+ buffer = fromX;
735
+ fromX = toX;
736
+ toX = buffer;
737
+ }
738
+ if (fromY > toY) {
739
+ buffer = fromY;
740
+ fromY = toY;
741
+ toY = buffer;
742
+ }
743
+ for (var x = fromX; x <= toX; x++) {
744
+ var cells = [];
745
+ for (var y = fromY; y <= toY; y++) {
746
+ cells.push(data[x][y]);
747
+ }
748
+ rangeData.push(cells);
749
+ }
750
+ return rangeData;
751
+ }
752
+ })();
753
+
754
+ Handsontable.dom.addEvent(window, 'hashchange', function (event) {
755
+ editor.setPageData();
756
+ });
757
  });
758
+ }(window.jQuery, window.supsystic.Tables));
src/SupsysticTables/Tables/assets/js/editor/tables.editor.toolbar.js CHANGED
@@ -117,22 +117,24 @@ var g_stbCellBgColorTimeoutSet = false,
117
  this.getEditor().render();
118
  },
119
  row: function () {
120
- var selection = this.getEditor().getSelectedRange();
 
121
 
122
  if (selection === undefined) {
123
- return;
 
 
124
  }
125
- var amount = selection.to.row - selection.from.row + 1;
126
- this.getEditor().alter('insert_row', selection.from.row, amount);
127
  },
128
  column: function () {
129
- var selection = this.getEditor().getSelectedRange();
 
130
 
131
  if (selection === undefined) {
132
- return;
 
 
133
  }
134
- var amount = selection.to.col - selection.from.col + 1;
135
- this.getEditor().alter('insert_col', selection.from.col, amount);
136
  },
137
  remove_row: function () {
138
  var selection = this.getEditor().getSelectedRange();
@@ -415,9 +417,20 @@ var g_stbCellBgColorTimeoutSet = false,
415
  }
416
  }
417
  };
 
 
 
 
 
 
 
 
 
 
418
  Toolbar.prototype.setTooltip = function(row, col) {
419
- var cell = $(".htCore tbody tr").eq(row).find('td').eq(col),
420
- meta = this.getEditor().getCellMeta(row, col),
 
421
  dataFormats = ('data-formats' in meta ? meta['data-formats'] : '');
422
 
423
  if(dataFormats.length > 0)
@@ -443,7 +456,9 @@ var g_stbCellBgColorTimeoutSet = false,
443
  });
444
  $(cell).attr('title', title).tooltip('fixTitle').tooltip('setContent');
445
  } else {
446
- $(cell).tooltip('destroy');
 
 
447
  }
448
  };
449
  Toolbar.prototype.replaceClass = function (className, replace, highlight) {
@@ -496,9 +511,8 @@ var g_stbCellBgColorTimeoutSet = false,
496
  }
497
  this.setTooltip(row, col);
498
  }
499
-
500
- if (newClass.length > 0) {
501
- editor.setCellMeta(row, col, 'className', cellClasses + ' ' + newClass);
502
  }
503
  }
504
  }
117
  this.getEditor().render();
118
  },
119
  row: function () {
120
+ var editor = this.getEditor(),
121
+ selection = editor.getSelectedRange();
122
 
123
  if (selection === undefined) {
124
+ editor.alter('insert_row', editor.countRows(), 1);
125
+ } else {
126
+ editor.alter('insert_row', selection.from.row, selection.to.row - selection.from.row + 1);
127
  }
 
 
128
  },
129
  column: function () {
130
+ var editor = this.getEditor(),
131
+ selection = editor.getSelectedRange();
132
 
133
  if (selection === undefined) {
134
+ editor.alter('insert_col', editor.countCols(), 1);
135
+ } else {
136
+ editor.alter('insert_col', selection.from.col, selection.to.col - selection.from.col + 1);
137
  }
 
 
138
  },
139
  remove_row: function () {
140
  var selection = this.getEditor().getSelectedRange();
417
  }
418
  }
419
  };
420
+ Toolbar.prototype.renderTooltips = function(row, col) {
421
+ var countRows = this.getEditor().countRows(),
422
+ countCols = this.getEditor().countCols();
423
+
424
+ for (var i = row; i < countRows; i++) {
425
+ for (var j = col; j < countCols; j++) {
426
+ this.setTooltip(i, j);
427
+ }
428
+ }
429
+ };
430
  Toolbar.prototype.setTooltip = function(row, col) {
431
+ var editor = this.getEditor(),
432
+ cell = $(editor.table).find('tbody tr').eq(row).find('td').eq(col),
433
+ meta = editor.getCellMeta(row, col),
434
  dataFormats = ('data-formats' in meta ? meta['data-formats'] : '');
435
 
436
  if(dataFormats.length > 0)
456
  });
457
  $(cell).attr('title', title).tooltip('fixTitle').tooltip('setContent');
458
  } else {
459
+ if($(cell).attr('data-original-title') != undefined) {
460
+ $(cell).tooltip('destroy');
461
+ }
462
  }
463
  };
464
  Toolbar.prototype.replaceClass = function (className, replace, highlight) {
511
  }
512
  this.setTooltip(row, col);
513
  }
514
+ if (newClass.length > 0 || !isFormat) {
515
+ editor.setCellMeta(row, col, 'className', cellClasses + (newClass.length > 0 ? ' ' + newClass : ''));
 
516
  }
517
  }
518
  }
src/SupsysticTables/Tables/assets/js/tables.model.js CHANGED
@@ -1,6 +1,8 @@
1
  var g_stbDoSaving = false;
2
  var g_stbDoPreview = false;
3
  var g_stbPreviewTimeoutSet = false;
 
 
4
  (function ($, app) {
5
 
6
  var TablesModel = (function () {
@@ -169,14 +171,8 @@ var g_stbPreviewTimeoutSet = false;
169
  comments = [],
170
  toolbar = app.Editor.Tb,
171
  svlFormatsClass = toolbar.getSvlFormatClass(),
172
- formatClasses = toolbar.getFormatClasses();
173
-
174
- // Set merged cells
175
- if (typeof meta === 'object' && 'mergedCells' in meta && meta.mergedCells.length) {
176
- editor.updateSettings({
177
- mergeCells: meta.mergedCells
178
- });
179
- }
180
 
181
  // Set rows data
182
  if (rows.length > 0) {
@@ -258,6 +254,10 @@ var g_stbPreviewTimeoutSet = false;
258
  });
259
  }
260
  }
 
 
 
 
261
  // selectable cell data source
262
  if(cell.source && cell.source.length) {
263
  metaData.type = cell.type;
@@ -333,27 +333,53 @@ var g_stbPreviewTimeoutSet = false;
333
  data.push(cells);
334
  });
335
 
336
- // Height & width
337
- editor.updateSettings({
338
- rowHeights: heights,
339
- colWidths: widths
340
- });
341
-
342
  // Load extracted data
343
- editor.loadData(data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
 
345
- // Comments. Note: comments need to be loaded after editor.loadData() call.
346
- if (comments.length) {
347
  editor.updateSettings({
348
- cell: comments
 
349
  });
350
- }
351
 
352
- // Load extracted metadata
353
- $.each(cellsMeta, function (i, meta) {
354
- editor.setCellMetaObject(meta.row, meta.col, meta);
355
- toolbar.setTooltip(meta.row, meta.col);
356
- });
 
 
 
 
 
 
 
 
 
 
357
  }
358
  };
359
 
@@ -368,7 +394,21 @@ var g_stbPreviewTimeoutSet = false;
368
  id = app.getParameterByName('id'),
369
  toolbar = app.Editor.Tb,
370
  svlFormatsClass = toolbar.getSvlFormatClass(),
371
- formatClasses = toolbar.getFormatClasses();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
 
373
  if(!g_stbDoSaving) {
374
  g_stbDoSaving = true;
@@ -394,14 +434,14 @@ var g_stbPreviewTimeoutSet = false;
394
  $(preview).empty();
395
  }
396
  }
397
- $.each(editor.getData(), function (x, row) {
398
  var currentRow = { cells: [] };
399
 
400
  $.each(row, function (y, cell) {
401
- var meta = editor.getCellMeta(x, y),
402
  metaClasses = meta.className;
403
 
404
- if (metaClasses.indexOf(svlFormatsClass) !== -1) {
405
  metaClasses = metaClasses.replace(svlFormatsClass, '').trim();
406
  var dataFormats = ('data-formats' in meta ? meta['data-formats'] : '');
407
  if (dataFormats.length > 0) {
@@ -412,7 +452,7 @@ var g_stbPreviewTimeoutSet = false;
412
  }
413
  }
414
  }
415
- var cellHtml = $(editor.getCell(x, y)),
416
  classes = [],
417
  cellData = {
418
  data: cell,
@@ -421,17 +461,23 @@ var g_stbPreviewTimeoutSet = false;
421
  hiddenCell: metaClasses && metaClasses.match('hiddenCell') !== null,
422
  invisibleCell: metaClasses && metaClasses.match('invisibleCell') !== null
423
  },
424
- mergeCell = editor.mergeCells.mergedCellInfoCollection.getInfo(x, y);
425
 
426
  // set merged params
427
  if(mergeCell !== undefined) {
428
  cellData.hidden = true;
429
  }
430
- // set formatted value
431
- cellHtml = cellHtml.clone();
432
- cellHtml.find('.htAutocompleteArrow').remove();
433
- cellData.formattedValue = cellHtml.text();
 
 
 
434
 
 
 
 
435
  // selectable cell data source
436
  if(meta.source && meta.source.length) {
437
  meta.type = 'dropdown';
@@ -511,13 +557,17 @@ var g_stbPreviewTimeoutSet = false;
511
  });
512
 
513
  // Row height
514
- currentRow.height = editor.getRowHeight(x);
515
 
516
  rowsData.push(currentRow);
517
  });
518
- if(editor.mergeCells.mergedCellInfoCollection.length) {
519
- for(var i = 0; i < editor.mergeCells.mergedCellInfoCollection.length; i++) {
520
- mergeData.push(editor.mergeCells.mergedCellInfoCollection[i]);
 
 
 
 
521
  }
522
  }
523
  metaData = {
@@ -574,7 +624,6 @@ var g_stbPreviewTimeoutSet = false;
574
  table;
575
 
576
  if(container.length) {
577
- container.html(app.createSpinner());
578
 
579
  return this.render(app.getParameterByName('id')).done(function(response) {
580
  container.empty().append($(response.table));
@@ -900,6 +949,8 @@ var g_stbPreviewTimeoutSet = false;
900
  $.when( app.Models.Tables.getTablesSettings() ).then(function( data, textStatus, jqXHR ) {
901
  if(data.success) {
902
  app.Models.Tables.step = data.settings.table_step;
 
 
903
  }
904
  });
905
  }(window.jQuery, window.supsystic.Tables));
1
  var g_stbDoSaving = false;
2
  var g_stbDoPreview = false;
3
  var g_stbPreviewTimeoutSet = false;
4
+ var g_stbPagination = false;
5
+ var g_stbRowsPerPage = 1;
6
  (function ($, app) {
7
 
8
  var TablesModel = (function () {
171
  comments = [],
172
  toolbar = app.Editor.Tb,
173
  svlFormatsClass = toolbar.getSvlFormatClass(),
174
+ formatClasses = toolbar.getFormatClasses(),
175
+ mergeCells = (typeof meta === 'object' && 'mergedCells' in meta && meta.mergedCells.length ? meta.mergedCells : []);
 
 
 
 
 
 
176
 
177
  // Set rows data
178
  if (rows.length > 0) {
254
  });
255
  }
256
  }
257
+
258
+ if(typeof(cell.readOnly) != 'undefined' && cell.readOnly == true) {
259
+ metaData.readOnly = true;
260
+ }
261
  // selectable cell data source
262
  if(cell.source && cell.source.length) {
263
  metaData.type = cell.type;
333
  data.push(cells);
334
  });
335
 
 
 
 
 
 
 
336
  // Load extracted data
337
+ if (g_stbPagination) {
338
+ if(typeof editor.bufferData == 'undefined') {
339
+ var cols = (data.length > 0 ? data[0].length : 0);
340
+ for (var c in comments) {
341
+ cellsMeta[comments[c].row * cols + comments[c].col].comment = comments[c].comment;
342
+ }
343
+ editor.bufferCols = cols;
344
+ editor.bufferData = data;
345
+ editor.bufferMeta = cellsMeta;
346
+ editor.bufferMerge = mergeCells;
347
+ editor.bufferHeights = heights;
348
+ editor.updateSettings({
349
+ colWidths: widths
350
+ });
351
+ editor.generatePagingLinks();
352
+ }
353
+ editor.setPageData(false);
354
+ } else {
355
+ // Set merged cells
356
+ if (mergeCells.length > 0) {
357
+ editor.updateSettings({
358
+ mergeCells: mergeCells
359
+ });
360
+ }
361
 
362
+ // Height & width
 
363
  editor.updateSettings({
364
+ rowHeights: heights,
365
+ colWidths: widths
366
  });
 
367
 
368
+ editor.loadData(data);
369
+
370
+ // Comments. Note: comments need to be loaded after editor.loadData() call.
371
+ if (comments.length) {
372
+ editor.updateSettings({
373
+ cell: comments
374
+ });
375
+ }
376
+
377
+ // Load extracted metadata
378
+ $.each(cellsMeta, function (i, meta) {
379
+ editor.setCellMetaObject(meta.row, meta.col, meta);
380
+ toolbar.setTooltip(meta.row, meta.col);
381
+ });
382
+ }
383
  }
384
  };
385
 
394
  id = app.getParameterByName('id'),
395
  toolbar = app.Editor.Tb,
396
  svlFormatsClass = toolbar.getSvlFormatClass(),
397
+ formatClasses = toolbar.getFormatClasses(),
398
+ pagination = g_stbPagination;
399
+
400
+ if (pagination) {
401
+ editor.copyInBuffer();
402
+ var bufferData = editor.bufferData,
403
+ bufferMeta = editor.bufferMeta,
404
+ bufferMerge = editor.bufferMerge,
405
+ bufferHeights = editor.bufferHeights,
406
+ countCols = editor.bufferCols;
407
+ }
408
+
409
+ if (preview !== false) {
410
+ $(preview).html($('<i/>', { class: 'fa fa-spinner fa-spin' }).attr('style','font-size: 2em !important')).prepend('<label> Table generate in process.... </label>');
411
+ }
412
 
413
  if(!g_stbDoSaving) {
414
  g_stbDoSaving = true;
434
  $(preview).empty();
435
  }
436
  }
437
+ $.each((pagination ? bufferData : editor.getData()), function (x, row) {
438
  var currentRow = { cells: [] };
439
 
440
  $.each(row, function (y, cell) {
441
+ var meta = (pagination ? bufferMeta[x * countCols + y] : editor.getCellMeta(x, y)),
442
  metaClasses = meta.className;
443
 
444
+ if (typeof(metaClasses) != 'undefined' && metaClasses.indexOf(svlFormatsClass) !== -1) {
445
  metaClasses = metaClasses.replace(svlFormatsClass, '').trim();
446
  var dataFormats = ('data-formats' in meta ? meta['data-formats'] : '');
447
  if (dataFormats.length > 0) {
452
  }
453
  }
454
  }
455
+ var cellHtml = (pagination ? bufferData[x][y] : $(editor.getCell(x, y))),
456
  classes = [],
457
  cellData = {
458
  data: cell,
461
  hiddenCell: metaClasses && metaClasses.match('hiddenCell') !== null,
462
  invisibleCell: metaClasses && metaClasses.match('invisibleCell') !== null
463
  },
464
+ mergeCell = (pagination ? editor.mergeGetInfo(x, y) : editor.mergeCells.mergedCellInfoCollection.getInfo(x, y));
465
 
466
  // set merged params
467
  if(mergeCell !== undefined) {
468
  cellData.hidden = true;
469
  }
470
+ if(!pagination)
471
+ {
472
+ // set formatted value
473
+ cellHtml = cellHtml.clone();
474
+ cellHtml.find('.htAutocompleteArrow').remove();
475
+ cellData.formattedValue = cellHtml.text();
476
+ }
477
 
478
+ if(meta.readOnly) {
479
+ cellData.readOnly = true;
480
+ }
481
  // selectable cell data source
482
  if(meta.source && meta.source.length) {
483
  meta.type = 'dropdown';
557
  });
558
 
559
  // Row height
560
+ currentRow.height = (pagination ? bufferHeights[x] : editor.getRowHeight(x));
561
 
562
  rowsData.push(currentRow);
563
  });
564
+ if(pagination) {
565
+ mergeData = bufferMerge;
566
+ } else {
567
+ if(editor.mergeCells.mergedCellInfoCollection.length) {
568
+ for(var i = 0; i < editor.mergeCells.mergedCellInfoCollection.length; i++) {
569
+ mergeData.push(editor.mergeCells.mergedCellInfoCollection[i]);
570
+ }
571
  }
572
  }
573
  metaData = {
624
  table;
625
 
626
  if(container.length) {
 
627
 
628
  return this.render(app.getParameterByName('id')).done(function(response) {
629
  container.empty().append($(response.table));
949
  $.when( app.Models.Tables.getTablesSettings() ).then(function( data, textStatus, jqXHR ) {
950
  if(data.success) {
951
  app.Models.Tables.step = data.settings.table_step;
952
+ g_stbPagination = (typeof(data.settings.editor_pagination) != 'undefined' && data.settings.editor_pagination == 'on');
953
+ g_stbRowsPerPage = (g_stbPagination && data.settings.editor_pagination_rows > 0 ? data.settings.editor_pagination_rows : 1);
954
  }
955
  });
956
  }(window.jQuery, window.supsystic.Tables));
src/SupsysticTables/Tables/assets/js/tables.shortcode.js CHANGED
@@ -54,10 +54,28 @@
54
  app.getTableInstanceById(table.data('id')).fnAdjustColumnSizing();
55
  }, 350);
56
  }
 
57
  });
58
  });
59
  });
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  function getOriginalImageSizes(img) {
62
  var tempImage = new Image(),
63
  width,
@@ -91,4 +109,4 @@
91
 
92
  }
93
  }
94
- }(window.jQuery, window.supsystic.Tables));
54
  app.getTableInstanceById(table.data('id')).fnAdjustColumnSizing();
55
  }, 350);
56
  }
57
+ if(table.data('searching-settings').columnSearch == 'on') setColumnSearch(table);
58
  });
59
  });
60
  });
61
 
62
+ function setColumnSearch(table) {
63
+ var dtable = $('#supsystic-table-' + table.data('id') + '[data-view-id="' + table.data('view-id') + '"]'),
64
+ tfoot = $('#supsystic-table-' + table.data('view-id')).find('div .dataTables_scrollFootInner table '),
65
+ inputs = (tfoot.length == 0 ? dtable.find('tfoot tr:last input') : tfoot.eq(0).find('tfoot tr:last input'));
66
+
67
+ dtable.DataTable().columns().every( function (colIdx) {
68
+ var that = this;
69
+ inputs.eq(colIdx).on('keyup change', function () {
70
+ if ( that.search() !== this.value ) {
71
+ that
72
+ .search (this.value.replace(/;/g, "|"), true, false)
73
+ .draw ();
74
+ }
75
+ });
76
+ });
77
+ }
78
+
79
  function getOriginalImageSizes(img) {
80
  var tempImage = new Image(),
81
  width,
109
 
110
  }
111
  }
112
+ }(window.jQuery, window.supsystic.Tables));
src/SupsysticTables/Tables/assets/js/tables.view.js CHANGED
@@ -337,6 +337,13 @@ var g_stbCopyPasteColsCount = [];
337
  return;
338
  }
339
  editor.clear();
 
 
 
 
 
 
 
340
  });
341
 
342
  // Settings Form Options
@@ -539,4 +546,4 @@ var g_stbCopyPasteColsCount = [];
539
  dialog.find('[data-tab="' + $(this).attr('href') + '"]').addClass('active');
540
  });
541
  });
542
- }(window.jQuery, window.supsystic.Tables));
337
  return;
338
  }
339
  editor.clear();
340
+ if (g_stbPagination) {
341
+ for (var i = 0; i <= editor.bufferData.length; i++) {
342
+ for (var j = 0; j < editor.bufferCols; j++) {
343
+ editor.bufferData[i][j] = '';
344
+ }
345
+ }
346
+ }
347
  });
348
 
349
  // Settings Form Options
546
  dialog.find('[data-tab="' + $(this).attr('href') + '"]').addClass('active');
547
  });
548
  });
549
+ }(window.jQuery, window.supsystic.Tables));
src/SupsysticTables/Tables/assets/libraries/featherlight/featherlight.min.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.13 - http://noelboss.github.io/featherlight/
4
+ *
5
+ * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com)
6
+ * MIT Licensed.
7
+ **/
8
+ html.with-featherlight{overflow:hidden}.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight link.featherlight-inner,.featherlight script.featherlight-inner,.featherlight style.featherlight-inner{display:none}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font-family:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000;border:0;padding:0}.featherlight .featherlight-close-icon::-moz-focus-inner{border:0;padding:0}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0;-webkit-overflow-scrolling:touch}.featherlight iframe{border:0}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:0;margin-right:0;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}@media print{html.with-featherlight>*>:not(.featherlight){display:none}}
src/SupsysticTables/Tables/assets/libraries/featherlight/featherlight.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Featherlight - ultra slim jQuery lightbox
3
+ * Version 1.7.13 - http://noelboss.github.io/featherlight/
4
+ *
5
+ * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com)
6
+ * MIT Licensed.
7
+ **/
8
+ !function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}function c(a,b){var c={};for(var d in a)d in b&&(c[d]=a[d],delete a[d]);return c}function d(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));if(a.fn.jquery.match(/-ajax/))return void("console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version."));var e=[],f=function(b){return e=a.grep(e,function(a){return a!==b&&a.$instance.closest("body").length>0})},g={allow:1,allowfullscreen:1,frameborder:1,height:1,longdesc:1,marginheight:1,marginwidth:1,mozallowfullscreen:1,name:1,referrerpolicy:1,sandbox:1,scrolling:1,src:1,srcdoc:1,style:1,webkitallowfullscreen:1,width:1},h={keyup:"onKeyUp",resize:"onResize"},i=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[h[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},j=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(h,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,i)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",persist:!1,otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<button class="'+e+"-close-icon "+d.namespace+'-close" aria-label="Close">',d.closeIcon,"</button>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){if(!b.isDefaultPrevented()){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(d.close(b),b.preventDefault())}}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",b.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(b).slice(1).remove().end().replaceWith(a.contains(this.$instance[0],b[0])?"":b),this.$content=b.addClass(this.namespace+"-inner"),this},open:function(b){var c=this;if(c.$instance.hide().appendTo(c.root),!(b&&b.isDefaultPrevented()||c.beforeOpen(b)===!1)){b&&b.preventDefault();var d=c.getContent();if(d)return e.push(c),j(!0),c.$instance.fadeIn(c.openSpeed),c.beforeContent(b),a.when(d).always(function(a){c.setContent(a),c.afterContent(b)}).then(c.$instance.promise()).done(function(){c.afterOpen(b)})}return c.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,d=a.Deferred();return c.beforeClose(b)===!1?d.reject():(0===f(c).length&&j(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),d.resolve()})),d.promise()},resize:function(a,b){if(a&&b){this.$content.css("width","").css("height","");var c=Math.max(a/(this.$content.parent().width()-1),b/(this.$content.parent().height()-1));c>1&&(c=b/Math.floor(b/c),this.$content.css("width",""+a/c+"px").css("height",""+b/c+"px"))}},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return this.persist!==!1?a(b):a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var e=new a.Deferred,f=a("<iframe/>"),h=d(this,"iframe"),i=c(h,g);return f.hide().attr("src",b).attr(i).css(h).on("load",function(){e.resolve(f.show())}).appendTo(this.$instance.find("."+this.namespace+"-content")),e.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=JSON.parse(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f,g=d.namespace||e.defaults.namespace,h=a.extend({},e.defaults,e.readElementConfig(b[0],g),d),i=function(g){var i=a(g.currentTarget),j=a.extend({$source:b,$currentTarget:i},e.readElementConfig(b[0],h.namespace),e.readElementConfig(g.currentTarget,h.namespace),d),k=f||i.data("featherlight-persisted")||new e(c,j);"shared"===k.persist?f=k:k.persist!==!1&&i.data("featherlight-persisted",k),j.$currentTarget.blur&&j.$currentTarget.blur(),k.open(g)};return b.on(h.openTrigger+"."+h.namespace,h.filter,i),{filter:h.filter,handler:i}},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return f(),a.grep(e,function(a){return a instanceof b})},close:function(a){var b=this.current();return b?b.close(a):void 0},_onReady:function(){var b=this;if(b.autoBind){var c=a(b.autoBind);c.each(function(){b.attach(a(this))}),a(document).on("click",b.autoBind,function(d){if(!d.isDefaultPrevented()){var e=a(d.currentTarget),f=c.length;if(c=c.add(e),f!==c.length){var g=b.attach(e);(!g.filter||a(d.target).parentsUntil(e,g.filter).length>0)&&g.handler(d)}}})}},_callbackChain:{onKeyUp:function(b,c){return 27===c.keyCode?(this.closeOnEsc&&a.featherlight.close(c),!1):b(c)},beforeOpen:function(b,c){return a(document.documentElement).addClass("with-featherlight"),this._previouslyActive=document.activeElement,this._$previouslyTabbable=a("a, input, select, textarea, iframe, button, iframe, [contentEditable=true]").not("[tabindex]").not(this.$instance.find("button")),this._$previouslyWithTabIndex=a("[tabindex]").not('[tabindex="-1"]'),this._previousWithTabIndices=this._$previouslyWithTabIndex.map(function(b,c){return a(c).attr("tabindex")}),this._$previouslyWithTabIndex.add(this._$previouslyTabbable).attr("tabindex",-1),document.activeElement.blur&&document.activeElement.blur(),b(c)},afterClose:function(c,d){var e=c(d),f=this;return this._$previouslyTabbable.removeAttr("tabindex"),this._$previouslyWithTabIndex.each(function(b,c){a(c).attr("tabindex",f._previousWithTabIndices[b])}),this._previouslyActive.focus(),0===b.opened().length&&a(document.documentElement).removeClass("with-featherlight"),e},onResize:function(a,b){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),a(b)},afterContent:function(a,b){var c=a(b);return this.$instance.find("[autofocus]:not([disabled])").focus(),this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c),this},a(document).ready(function(){b._onReady()})}(jQuery);
src/SupsysticTables/Tables/assets/libraries/ruleJS/ruleJS.js CHANGED
@@ -1170,7 +1170,7 @@ var ruleJS = (function (root) {
1170
  if (number1[0] === '=' || number2[0] === '=') {
1171
  throw Error('NEED_UPDATE');
1172
  }
1173
-
1174
  if (isNaN(number1)) {
1175
  moment1 = moment(number1, window.supsystic.Tables._dateFormat);
1176
  if(moment1 && moment1._pf && moment1._pf.empty) {
@@ -1288,18 +1288,20 @@ var ruleJS = (function (root) {
1288
  * @returns {*}
1289
  */
1290
  cellValue: function (cell) {
1291
- var value,
 
1292
  fnCellValue = instance.custom.cellValue,
1293
  element = this,
1294
- item = instance.matrix.getItem(cell);
 
 
1295
  // check if custom cellValue fn exists
1296
  if (instance.utils.isFunction(fnCellValue)) {
1297
 
1298
- var cellCoords = instance.utils.cellCoords(cell),
1299
- cellId = instance.utils.translateCellCoords({row: element.row, col: element.col});
1300
 
1301
  // get value
1302
- value = item ? item.value : fnCellValue(cellCoords.row, cellCoords.col);
1303
 
1304
  if (instance.utils.isNull(value)) {
1305
  value = 0;
@@ -1493,6 +1495,7 @@ var ruleJS = (function (root) {
1493
 
1494
  } catch (ex) {
1495
  // Formulas errors!!!
 
1496
  var message = Exception.get(ex.message);
1497
 
1498
  if (message) {
@@ -1701,4 +1704,4 @@ function supsysticVlookupSort(a, b) {
1701
  return 0;
1702
  }
1703
  return (aLower < bLower) ? -1 : 1;
1704
- }
1170
  if (number1[0] === '=' || number2[0] === '=') {
1171
  throw Error('NEED_UPDATE');
1172
  }
1173
+
1174
  if (isNaN(number1)) {
1175
  moment1 = moment(number1, window.supsystic.Tables._dateFormat);
1176
  if(moment1 && moment1._pf && moment1._pf.empty) {
1288
  * @returns {*}
1289
  */
1290
  cellValue: function (cell) {
1291
+ var isEditorPagination = typeof g_stbPagination != 'undefined' && g_stbPagination && !(this instanceof HTMLElement),
1292
+ value,
1293
  fnCellValue = instance.custom.cellValue,
1294
  element = this,
1295
+ cellCoords = instance.utils.cellCoords(cell),
1296
+ item = instance.matrix.getItem(isEditorPagination ? instance.utils.translateCellCoords({row: cellCoords.row - window.editor.pageStart, col: cellCoords.col}) : cell);
1297
+
1298
  // check if custom cellValue fn exists
1299
  if (instance.utils.isFunction(fnCellValue)) {
1300
 
1301
+ var cellId = instance.utils.translateCellCoords({row: element.row, col: element.col});
 
1302
 
1303
  // get value
1304
+ value = item ? item.value : (isEditorPagination ? window.editor.bufferData[cellCoords.row][cellCoords.col] : fnCellValue(cellCoords.row, cellCoords.col));
1305
 
1306
  if (instance.utils.isNull(value)) {
1307
  value = 0;
1495
 
1496
  } catch (ex) {
1497
  // Formulas errors!!!
1498
+ //console.log(ex);
1499
  var message = Exception.get(ex.message);
1500
 
1501
  if (message) {
1704
  return 0;
1705
  }
1706
  return (aLower < bLower) ? -1 : 1;
1707
+ }
src/SupsysticTables/Tables/views/shortcode.twig CHANGED
@@ -63,11 +63,13 @@
63
  and context.table.meta.columnsFixedWidth[cellIndex] is not empty
64
  %}
65
  style="min-width: {{ context.table.meta.columnsFixedWidth[cellIndex] }}; width: {{ context.table.meta.columnsFixedWidth[cellIndex] }};"
66
- {% elseif context.table.meta.columnsWidth is defined %}
67
- {{ context.table.meta.columnsWidth[cellIndex] }}
 
 
68
  style="min-width: {{ context.table.meta.columnsWidth[cellIndex] }}%; width: {{ context.table.meta.columnsWidth[cellIndex] }}%;"
69
  {% else %}
70
- width="{{ cell.width }}"
71
  {% endif %}
72
  {% endif %}
73
 
@@ -90,7 +92,14 @@
90
  data-rowspan="{{ rowspan }}"
91
  {% endif %}
92
  {% endif %}
93
- >{{ data | raw }}</{{tag}}>
 
 
 
 
 
 
 
94
  {% endif %}
95
  {% endmacro %}
96
 
@@ -111,7 +120,7 @@
111
  {% if is_feed == false and table.settings.tableLoader.disable is not defined %}
112
  {% set loaderClass = 'supsystic-table-loader' %}
113
  {% if table.settings.tableLoader.iconName | default('default') == 'default' %}
114
- <div class="{{ loaderClass }} spinner" style="background-color: {{ table.settings.tableLoader.color }}"></div>
115
  {% else %}
116
  <div class="{{ loaderClass }} la-{{ table.settings.tableLoader.iconName }} la-2x" style="color: {{ table.settings.tableLoader.color }}">
117
  {% for i in 1..table.settings.tableLoader.iconItems %}
@@ -283,12 +292,11 @@
283
 
284
  {% if existHeaderRow == true %}
285
  <tr>
286
- {% if table.settings.autoIndex == 'new' and addHeaderAutoIndex == true %}
287
- <th width="0" rowspan="{{ headRowsCount }}"></th>
288
- {% set addHeaderAutoIndex = false %}
289
- {% endif %}
290
-
291
  {% for cellIndex, cell in row.cells %}
 
 
 
 
292
  {% if head %}
293
  {{ m.cell(cell, headRowNumber, cellIndex, 'th', _context) }}
294
  {% if cols[cellIndex] == 'Z' %}
@@ -333,7 +341,7 @@
333
  {% endif %}
334
  >
335
  {% if table.settings.autoIndex == 'new' %}
336
- <td></td>
337
  {% endif %}
338
 
339
  {% for cellIndex, cell in row.cells %}
@@ -376,12 +384,11 @@
376
 
377
  {% if existFooterRow == true %}
378
  <tr>
379
- {% if table.settings.autoIndex == 'new' and addFooterAutoIndex == true %}
380
- <th width="0" rowspan="{{ footRowsCount }}"></th>
381
- {% set addFooterAutoIndex = false %}
382
- {% endif %}
383
-
384
  {% for cellIndex, cell in row.cells %}
 
 
 
 
385
  {{ m.cell(cell, footRowNumber, cellIndex, 'th', _context) }}
386
  {% if cols[cellIndex] == 'Z' %}
387
  {% set countIter = countIter + 1 %}
@@ -413,4 +420,4 @@
413
  <!-- Tables Generator by Supsystic -->
414
  <!-- Version: {{ environment.getConfig().get('plugin_version') }} -->
415
  <!-- http://supsystic.com/ -->
416
- {% endspaceless %}
63
  and context.table.meta.columnsFixedWidth[cellIndex] is not empty
64
  %}
65
  style="min-width: {{ context.table.meta.columnsFixedWidth[cellIndex] }}; width: {{ context.table.meta.columnsFixedWidth[cellIndex] }};"
66
+ {% elseif context.table.meta.columnsWidth is defined
67
+ and context.table.meta.columnsWidth[cellIndex] is defined
68
+ and context.table.meta.columnsWidth[cellIndex] is not empty
69
+ %}
70
  style="min-width: {{ context.table.meta.columnsWidth[cellIndex] }}%; width: {{ context.table.meta.columnsWidth[cellIndex] }}%;"
71
  {% else %}
72
+ style="width: {{ cell.width }}px"
73
  {% endif %}
74
  {% endif %}
75
 
92
  data-rowspan="{{ rowspan }}"
93
  {% endif %}
94
  {% endif %}
95
+ >
96
+ {# set lightbox for image #}
97
+ {% if cell.imgHref is defined %}
98
+ <a href="{{ cell.imgHref }}" data-featherlight="image">{{ data | raw }}</a>
99
+ {% else %}
100
+ {{ data | raw }}
101
+ {% endif %}
102
+ </{{tag}}>
103
  {% endif %}
104
  {% endmacro %}
105
 
120
  {% if is_feed == false and table.settings.tableLoader.disable is not defined %}
121
  {% set loaderClass = 'supsystic-table-loader' %}
122
  {% if table.settings.tableLoader.iconName | default('default') == 'default' %}
123
+ <div class="{{ loaderClass }} spinner" {% if table.settings.tableLoader.color is defined %}style="background-color: {{ table.settings.tableLoader.color }}"{% endif %}></div>
124
  {% else %}
125
  <div class="{{ loaderClass }} la-{{ table.settings.tableLoader.iconName }} la-2x" style="color: {{ table.settings.tableLoader.color }}">
126
  {% for i in 1..table.settings.tableLoader.iconItems %}
292
 
293
  {% if existHeaderRow == true %}
294
  <tr>
 
 
 
 
 
295
  {% for cellIndex, cell in row.cells %}
296
+ {% if table.settings.autoIndex == 'new' and addHeaderAutoIndex == true %}
297
+ <th rowspan="{{ headRowsCount }}" class="{{ cell.meta | join(' ') | trim }}" style="width: 1%; padding: 0 !important;"></th>
298
+ {% set addHeaderAutoIndex = false %}
299
+ {% endif %}
300
  {% if head %}
301
  {{ m.cell(cell, headRowNumber, cellIndex, 'th', _context) }}
302
  {% if cols[cellIndex] == 'Z' %}
341
  {% endif %}
342
  >
343
  {% if table.settings.autoIndex == 'new' %}
344
+ <td style="width: 1px;"></td>
345
  {% endif %}
346
 
347
  {% for cellIndex, cell in row.cells %}
384
 
385
  {% if existFooterRow == true %}
386
  <tr>
 
 
 
 
 
387
  {% for cellIndex, cell in row.cells %}
388
+ {% if table.settings.autoIndex == 'new' and addFooterAutoIndex == true %}
389
+ <th rowspan="{{ footRowsCount }}" class="{{ cell.meta | join(' ') | trim }}" style="width: 1%; padding: 0 !important;"></th>
390
+ {% set addFooterAutoIndex = false %}
391
+ {% endif %}
392
  {{ m.cell(cell, footRowNumber, cellIndex, 'th', _context) }}
393
  {% if cols[cellIndex] == 'Z' %}
394
  {% set countIter = countIter + 1 %}
420
  <!-- Tables Generator by Supsystic -->
421
  <!-- Version: {{ environment.getConfig().get('plugin_version') }} -->
422
  <!-- http://supsystic.com/ -->
423
+ {% endspaceless %}
src/SupsysticTables/Tables/views/view.twig CHANGED
@@ -34,6 +34,7 @@
34
  <div class="col-md-1 col-sm-1 col-xs-2 stbTooltipInfo">
35
  {{ tooltip.icon('
36
  <b>Table Shortcode:</b> lets display the table in the site content.<br /><br />
 
37
  <b>Value Shortcode:</b> lets display a value of single table cell in the site content.<br /><br />
38
  <b>Cell Shortcode:</b> lets display a table with single cell in the site content.<br /><br />
39
  <b>History Shortcode:</b> lets display an individual table data for each autorized user. Users can change the table data through editable fields on frontend. All user tables can be shown on Table History tab.<br /><br />
@@ -222,7 +223,7 @@
222
  style="display:none"
223
  {% endif %}
224
  >
225
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
226
  <label for="descriptionText">
227
  {{ environment.translate('Description Text') }}
228
  </label>
@@ -253,7 +254,7 @@
253
  style="display:none"
254
  {% endif %}
255
  >
256
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
257
  <label for="signatureText">
258
  {{ environment.translate('Signature Text') }}
259
  </label>
@@ -284,7 +285,7 @@
284
  style="display:none"
285
  {% endif %}
286
  >
287
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
288
  <label for="headerRowsCount">
289
  {{ environment.translate('Count of Header Rows') }}
290
  {{ tooltip.icon(environment.translate('Count of table rows, which will be moved to header.')) }}
@@ -314,7 +315,7 @@
314
  style="display:none"
315
  {% endif %}
316
  >
317
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
318
  <label for="customFooter">
319
  {{ environment.translate('Custom Footer') }}
320
  {{ tooltip.icon(environment.translate('If checked - footer will be created from the last table rows. Otherwise - footer will be created from header rows.')) }}
@@ -332,7 +333,7 @@
332
  style="display:none"
333
  {% endif %}
334
  >
335
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
336
  <label for="footerRowsCount">
337
  {{ environment.translate('Count of Footer Rows') }}
338
  {{ tooltip.icon(environment.translate('Count of table rows, which will be moved to footer.')) }}
@@ -377,7 +378,7 @@
377
  style="display:none"
378
  {% endif %}
379
  >
380
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
381
  <label for="fixedHeight">
382
  {{ environment.translate('Fixed Table Height') }}
383
  {{ tooltip.icon(environment.translate('Fixed table height in px. This value must be less than the original table height to create a vertical scroll, otherwise you will not see that the fixed header / footer exists.')) }}
@@ -407,7 +408,7 @@
407
  style="display:none"
408
  {% endif %}
409
  >
410
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
411
  <label for="fixedLeftColumnsCount">
412
  {{ environment.translate('Left Columns Count') }}
413
  {{ tooltip.icon(environment.translate('Number of column to fix by left side of the table.')) }}
@@ -422,7 +423,7 @@
422
  style="display:none"
423
  {% endif %}
424
  >
425
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
426
  <label for="fixedRightColumnsCount">
427
  {{ environment.translate('Right Columns Count') }}
428
  {{ tooltip.icon(environment.translate('Number of column to fix by right side of the table.')) }}
@@ -461,7 +462,7 @@
461
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
462
  <label for="disable-table-cache">
463
  {{ environment.translate('Disable Table Cache') }}
464
- {{ tooltip.icon(environment.translate('Disable the internal plugin cache for table. Internal cache can affect to work of shortcodes inside the table content, for example, if shortcodes is depending on loading some scripts, etc.')) }}
465
  </label>
466
  </div>
467
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
@@ -502,7 +503,7 @@
502
  style="display:none"
503
  {% endif %}
504
  >
505
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
506
  <label for="editor-set-number-format">
507
  {{ environment.translate('Number') }}
508
  {{ tooltip.icon(environment.translate('Set output format for numbers e.g. 1,000.00, 1.00')) }}
@@ -638,7 +639,7 @@
638
  style="display:none"
639
  {% endif %}
640
  >
641
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
642
  <label for="features-sorting-order">
643
  {{ environment.translate('Sorting Order') }}
644
  {{ tooltip.icon(environment.translate('Set sort order by default')) }}
@@ -660,7 +661,7 @@
660
  style="display:none"
661
  {% endif %}
662
  >
663
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
664
  <label for="sorting-order-column">
665
  {{ environment.translate('Sorting Column') }}
666
  {{ tooltip.icon(environment.translate('Number of column to apply sort order. Set no value to disable table sorting by default.')) }}
@@ -690,7 +691,7 @@
690
  style="display:none"
691
  {% endif %}
692
  >
693
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
694
  <label for="pagination-length">
695
  {{ environment.translate('Pagination List Content') }}
696
  {{ tooltip.icon('Here you can set the number of rows to display on one Pagination page. Establish several numbers separated by comma to let users choose it personally. First number will be displayed by default. Since that the number of Pagination Pages will be recounted also.', 'top', true) }}
@@ -708,7 +709,7 @@
708
  style="display:none"
709
  {% endif %}
710
  >
711
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
712
  <label for="pagination-size">
713
  {{ environment.translate('Pagination Size') }}
714
  </label>
@@ -750,7 +751,24 @@
750
  style="display:none"
751
  {% endif %}
752
  >
 
 
 
 
 
 
753
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
 
 
 
 
 
 
 
 
 
 
 
754
  <label for="features-search-by-hidden-fields">
755
  {{ environment.translate('Search by Hidden Fields') }}
756
  {{ tooltip.icon(environment.translate('Lets make search by fields, marked as hidden (see appropriate button on editor toolbar)')) }}
@@ -767,7 +785,7 @@
767
  style="display:none"
768
  {% endif %}
769
  >
770
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
771
  <label for="features-searching-result-only">
772
  {{ environment.translate('Show Only Search Results') }}
773
  {{ tooltip.icon(environment.translate('Hide table by default and show only if search has a result.')) }}
@@ -786,7 +804,7 @@
786
  style="display:none"
787
  {% endif %}
788
  >
789
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
790
 
791
  <label for="features-searching-show-table">
792
  {{ environment.translate('Show Empty Table') }}
@@ -804,7 +822,7 @@
804
  style="display:none"
805
  {% endif %}
806
  >
807
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
808
  <label for="features-searching-strict-matching">
809
  {{ environment.translate('Strict Matching') }}
810
  {{ tooltip.icon(environment.translate('Display only entries with matching characters in the beginning of words')) }}
@@ -821,7 +839,7 @@
821
  style="display:none"
822
  {% endif %}
823
  >
824
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
825
  <label for="features-searching-strict-min-chars">
826
  {{ environment.translate('Minimum Count of Characters') }}
827
  {{ tooltip.icon(environment.translate('Set minimum count of characters to start search in Search field. Set 0 to make search in any case.')) }}
@@ -863,7 +881,7 @@
863
  style="display:none"
864
  {% endif %}
865
  >
866
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
867
  <label for="after-table-loaded-script-text">
868
  {{ environment.translate('JS Script Text') }}
869
  </label>
@@ -1017,7 +1035,7 @@
1017
  (toolbar on Editor tab) or calculated depending on the columns width in the table editor.<br /><br />
1018
  If you do not want to apply columns width at all - you should uncheck "Auto Table Width" option, set "Fixed Table Width"
1019
  option to "auto" and check "Compact Table" option.')) }}
1020
- </label>
1021
  </div>
1022
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1023
  <input type="checkbox" name="features[auto_width]"
@@ -1032,7 +1050,7 @@
1032
  style="display:none"
1033
  {% endif %}
1034
  >
1035
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1036
  <label for="fixed-table-width">
1037
  {{ environment.translate('Fixed Table Width') }}
1038
  {{ tooltip.icon(environment.translate('Set fixed table width in px or %. Choose &quot;disable&quot; to make table width adjust by table content.')) }}
@@ -1078,7 +1096,7 @@
1078
  style="display:none"
1079
  {% endif %}
1080
  >
1081
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1082
  <label for="table-alignment-on-page">
1083
  {{ environment.translate('Align by First Table') }}
1084
  {{ tooltip.icon(environment.translate('If checked - this table will be resized by first supsystic table on page. Important! This option makes sense only if table is not on responsive mode or responsive mode is disabled. Also if the first table has different count of columns or different settings, their sizes may not be equal.')) }}
@@ -1118,6 +1136,27 @@
1118
  {{ checkbox.checked(attribute(table.settings.styling, 'paragraphMode')) }}
1119
  id="paragraphMode"/>
1120
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1121
  </div>
1122
  </div>
1123
  <div class="col-md-6 col-sm-6 col-xs-12">
@@ -1208,7 +1247,7 @@
1208
  style="display:none"
1209
  {% endif %}
1210
  >
1211
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1212
  <label for="table-loaedr-icon">
1213
  {{ environment.translate('Table Loader Icon') }}
1214
  {{ tooltip.icon(environment.translate('Choose icon for loader')) }}
@@ -1240,7 +1279,7 @@
1240
  style="display:none"
1241
  {% endif %}
1242
  >
1243
- <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1244
  <label for="tableLoaderColorContainer">
1245
  {{ environment.translate('Table Loader Color') }}
1246
  {{ tooltip.icon(environment.translate('Choose color for loader')) }}
@@ -1367,7 +1406,7 @@
1367
  </li>
1368
  <li>
1369
  <button {{ tooltip.attr(environment.translate('Add row above')) }} data-toolbar="#toolbar-rows">
1370
- <i class="fa fa-fw fa-th-list"></i>
1371
  </button>
1372
  <div id="toolbar-rows" class="toolbar-content">
1373
  <a href="#" data-method="row">
@@ -1380,7 +1419,7 @@
1380
  </li>
1381
  <li>
1382
  <button {{ tooltip.attr(environment.translate('Add column on the left')) }} data-toolbar="#toolbar-cols">
1383
- <i class="fa fa-fw fa-th-large"></i>
1384
  </button>
1385
  <div id="toolbar-cols" class="toolbar-content">
1386
  <a href="#" data-method="column">
@@ -1680,7 +1719,7 @@ for example:
1680
  </div>
1681
 
1682
  <div id="setColumnWidthDialog" style="display: none;" title="Fixed Column Width">
1683
- <p style="margin-top: 0;">{{ environment.translate('Set column width for selected columns in pixels or percents. Press "Clear Fixed Width" to clear fixed columns width for all table columns. All changes will be applied after table saving.') }}</p>
1684
  <div class="input-group">
1685
  <input type="text" name="columnWidth" class="sub-input" style="width: 130px !important;" />
1686
  <label for="fixed-column-width-type-percent">
34
  <div class="col-md-1 col-sm-1 col-xs-2 stbTooltipInfo">
35
  {{ tooltip.icon('
36
  <b>Table Shortcode:</b> lets display the table in the site content.<br /><br />
37
+ <b>Table Part Shortcode:</b> lets display just a part of table in the site content.<br /><br />
38
  <b>Value Shortcode:</b> lets display a value of single table cell in the site content.<br /><br />
39
  <b>Cell Shortcode:</b> lets display a table with single cell in the site content.<br /><br />
40
  <b>History Shortcode:</b> lets display an individual table data for each autorized user. Users can change the table data through editable fields on frontend. All user tables can be shown on Table History tab.<br /><br />
223
  style="display:none"
224
  {% endif %}
225
  >
226
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
227
  <label for="descriptionText">
228
  {{ environment.translate('Description Text') }}
229
  </label>
254
  style="display:none"
255
  {% endif %}
256
  >
257
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
258
  <label for="signatureText">
259
  {{ environment.translate('Signature Text') }}
260
  </label>
285
  style="display:none"
286
  {% endif %}
287
  >
288
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
289
  <label for="headerRowsCount">
290
  {{ environment.translate('Count of Header Rows') }}
291
  {{ tooltip.icon(environment.translate('Count of table rows, which will be moved to header.')) }}
315
  style="display:none"
316
  {% endif %}
317
  >
318
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
319
  <label for="customFooter">
320
  {{ environment.translate('Custom Footer') }}
321
  {{ tooltip.icon(environment.translate('If checked - footer will be created from the last table rows. Otherwise - footer will be created from header rows.')) }}
333
  style="display:none"
334
  {% endif %}
335
  >
336
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
337
  <label for="footerRowsCount">
338
  {{ environment.translate('Count of Footer Rows') }}
339
  {{ tooltip.icon(environment.translate('Count of table rows, which will be moved to footer.')) }}
378
  style="display:none"
379
  {% endif %}
380
  >
381
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
382
  <label for="fixedHeight">
383
  {{ environment.translate('Fixed Table Height') }}
384
  {{ tooltip.icon(environment.translate('Fixed table height in px. This value must be less than the original table height to create a vertical scroll, otherwise you will not see that the fixed header / footer exists.')) }}
408
  style="display:none"
409
  {% endif %}
410
  >
411
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
412
  <label for="fixedLeftColumnsCount">
413
  {{ environment.translate('Left Columns Count') }}
414
  {{ tooltip.icon(environment.translate('Number of column to fix by left side of the table.')) }}
423
  style="display:none"
424
  {% endif %}
425
  >
426
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
427
  <label for="fixedRightColumnsCount">
428
  {{ environment.translate('Right Columns Count') }}
429
  {{ tooltip.icon(environment.translate('Number of column to fix by right side of the table.')) }}
462
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
463
  <label for="disable-table-cache">
464
  {{ environment.translate('Disable Table Cache') }}
465
+ {{ tooltip.icon(environment.translate("This feature is necessary for those cases, when table contains the shortcodes. By checking the box, you can make sure that they will be rendered correctly and won't be influenced by cache.")) }}
466
  </label>
467
  </div>
468
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
503
  style="display:none"
504
  {% endif %}
505
  >
506
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
507
  <label for="editor-set-number-format">
508
  {{ environment.translate('Number') }}
509
  {{ tooltip.icon(environment.translate('Set output format for numbers e.g. 1,000.00, 1.00')) }}
639
  style="display:none"
640
  {% endif %}
641
  >
642
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
643
  <label for="features-sorting-order">
644
  {{ environment.translate('Sorting Order') }}
645
  {{ tooltip.icon(environment.translate('Set sort order by default')) }}
661
  style="display:none"
662
  {% endif %}
663
  >
664
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
665
  <label for="sorting-order-column">
666
  {{ environment.translate('Sorting Column') }}
667
  {{ tooltip.icon(environment.translate('Number of column to apply sort order. Set no value to disable table sorting by default.')) }}
691
  style="display:none"
692
  {% endif %}
693
  >
694
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
695
  <label for="pagination-length">
696
  {{ environment.translate('Pagination List Content') }}
697
  {{ tooltip.icon('Here you can set the number of rows to display on one Pagination page. Establish several numbers separated by comma to let users choose it personally. First number will be displayed by default. Since that the number of Pagination Pages will be recounted also.', 'top', true) }}
709
  style="display:none"
710
  {% endif %}
711
  >
712
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
713
  <label for="pagination-size">
714
  {{ environment.translate('Pagination Size') }}
715
  </label>
751
  style="display:none"
752
  {% endif %}
753
  >
754
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
755
+ <label for="features-search-by-column">
756
+ {{ environment.translate('Search by columns') }}
757
+ {{ tooltip.icon(environment.translate('Add search by table columns. Use a semicolon as separator for select any of the values.')) }}
758
+ </label>
759
+ </div>
760
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
761
+ <input type="checkbox" name="searching[columnSearch]" id="features-search-by-column"
762
+ {{ checkbox.checked(table.settings.searching.columnSearch) }}
763
+ >
764
+ </div>
765
+ </div>
766
+ <div class="setting-wrapper row searching-options"
767
+ {% if table.settings.features.searching is not defined %}
768
+ style="display:none"
769
+ {% endif %}
770
+ >
771
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
772
  <label for="features-search-by-hidden-fields">
773
  {{ environment.translate('Search by Hidden Fields') }}
774
  {{ tooltip.icon(environment.translate('Lets make search by fields, marked as hidden (see appropriate button on editor toolbar)')) }}
785
  style="display:none"
786
  {% endif %}
787
  >
788
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
789
  <label for="features-searching-result-only">
790
  {{ environment.translate('Show Only Search Results') }}
791
  {{ tooltip.icon(environment.translate('Hide table by default and show only if search has a result.')) }}
804
  style="display:none"
805
  {% endif %}
806
  >
807
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
808
 
809
  <label for="features-searching-show-table">
810
  {{ environment.translate('Show Empty Table') }}
822
  style="display:none"
823
  {% endif %}
824
  >
825
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
826
  <label for="features-searching-strict-matching">
827
  {{ environment.translate('Strict Matching') }}
828
  {{ tooltip.icon(environment.translate('Display only entries with matching characters in the beginning of words')) }}
839
  style="display:none"
840
  {% endif %}
841
  >
842
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
843
  <label for="features-searching-strict-min-chars">
844
  {{ environment.translate('Minimum Count of Characters') }}
845
  {{ tooltip.icon(environment.translate('Set minimum count of characters to start search in Search field. Set 0 to make search in any case.')) }}
881
  style="display:none"
882
  {% endif %}
883
  >
884
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
885
  <label for="after-table-loaded-script-text">
886
  {{ environment.translate('JS Script Text') }}
887
  </label>
1035
  (toolbar on Editor tab) or calculated depending on the columns width in the table editor.<br /><br />
1036
  If you do not want to apply columns width at all - you should uncheck "Auto Table Width" option, set "Fixed Table Width"
1037
  option to "auto" and check "Compact Table" option.')) }}
1038
+ </label>
1039
  </div>
1040
  <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1041
  <input type="checkbox" name="features[auto_width]"
1050
  style="display:none"
1051
  {% endif %}
1052
  >
1053
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
1054
  <label for="fixed-table-width">
1055
  {{ environment.translate('Fixed Table Width') }}
1056
  {{ tooltip.icon(environment.translate('Set fixed table width in px or %. Choose &quot;disable&quot; to make table width adjust by table content.')) }}
1096
  style="display:none"
1097
  {% endif %}
1098
  >
1099
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
1100
  <label for="table-alignment-on-page">
1101
  {{ environment.translate('Align by First Table') }}
1102
  {{ tooltip.icon(environment.translate('If checked - this table will be resized by first supsystic table on page. Important! This option makes sense only if table is not on responsive mode or responsive mode is disabled. Also if the first table has different count of columns or different settings, their sizes may not be equal.')) }}
1136
  {{ checkbox.checked(attribute(table.settings.styling, 'paragraphMode')) }}
1137
  id="paragraphMode"/>
1138
  </div>
1139
+ </div>
1140
+ <div class="setting-wrapper row">
1141
+ <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1142
+ <label for="lightboxImg">
1143
+ {{ environment.translate('Lightbox') }}
1144
+ {{ tooltip.icon(environment.translate('Add Lightbox fo images')) }}
1145
+ {% if environment.isPro() == false %}
1146
+ <a target="_blank" class="supsystic-pro-feature" href="{{ build_pro_url({ 'utm_medium': 'editable_fields_feature' }) }}">{{ environment.translate('PRO option') }}</a>
1147
+ {% endif %}
1148
+ </label>
1149
+ </div>
1150
+ <div class="setting-item col-md-6 col-sm-6 col-xs-12">
1151
+ {% if environment.isPro() == false %}
1152
+ <input type="checkbox" disabled="disabled" id="save-editable-fields-unavailable"/>
1153
+ {% else %}
1154
+ <input type="checkbox"
1155
+ name="styling[lightboxImg]"
1156
+ {{ checkbox.checked(attribute(table.settings.styling, 'lightboxImg')) }}
1157
+ id="lightboxImg"/>
1158
+ {% endif %}
1159
+ </div>
1160
  </div>
1161
  </div>
1162
  <div class="col-md-6 col-sm-6 col-xs-12">
1247
  style="display:none"
1248
  {% endif %}
1249
  >
1250
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
1251
  <label for="table-loaedr-icon">
1252
  {{ environment.translate('Table Loader Icon') }}
1253
  {{ tooltip.icon(environment.translate('Choose icon for loader')) }}
1279
  style="display:none"
1280
  {% endif %}
1281
  >
1282
+ <div class="setting-item setting-options col-md-6 col-sm-6 col-xs-12">
1283
  <label for="tableLoaderColorContainer">
1284
  {{ environment.translate('Table Loader Color') }}
1285
  {{ tooltip.icon(environment.translate('Choose color for loader')) }}
1406
  </li>
1407
  <li>
1408
  <button {{ tooltip.attr(environment.translate('Add row above')) }} data-toolbar="#toolbar-rows">
1409
+ <i class="fa fa-fw fa-th-list"></i><span> Add Row</span>
1410
  </button>
1411
  <div id="toolbar-rows" class="toolbar-content">
1412
  <a href="#" data-method="row">
1419
  </li>
1420
  <li>
1421
  <button {{ tooltip.attr(environment.translate('Add column on the left')) }} data-toolbar="#toolbar-cols">
1422
+ <i class="fa fa-fw fa-th-large"></i><span> Add Column</span>
1423
  </button>
1424
  <div id="toolbar-cols" class="toolbar-content">
1425
  <a href="#" data-method="column">
1719
  </div>
1720
 
1721
  <div id="setColumnWidthDialog" style="display: none;" title="Fixed Column Width">
1722
+ <p style="margin-top: 0;">{{ environment.translate('Set column width for selected columns in pixels or percents. Press "Clear Fixed Width" to clear fixed columns width for all table columns. All changes will be applied after table saving. It’s better to use values in px, if you want width to be exactly the same as you’ve established – because the percentages can be re-calculated by browser in a specific way.') }}</p>
1723
  <div class="input-group">
1724
  <input type="text" name="columnWidth" class="sub-input" style="width: 130px !important;" />
1725
  <label for="fixed-column-width-type-percent">
vendor/Rsc/Mvc/Module.php CHANGED
@@ -153,7 +153,7 @@ class Rsc_Mvc_Module
153
  $welcomePageShowed = $this->environment->getConfig()->get('welcome_page_was_showed');
154
  $promoController = $this->environment->getConfig()->get('promo_controller');
155
 
156
- if ($promoController && class_exists($promoController) && !$welcomePageShowed) {
157
  $promoController = new $promoController($this->environment, $this->request);
158
  if (method_exists($promoController, 'indexAction')) {
159
  return call_user_func_array(
153
  $welcomePageShowed = $this->environment->getConfig()->get('welcome_page_was_showed');
154
  $promoController = $this->environment->getConfig()->get('promo_controller');
155
 
156
+ if ($promoController && class_exists($promoController) && !$welcomePageShowed && $this->getModuleName() != 'license') {
157
  $promoController = new $promoController($this->environment, $this->request);
158
  if (method_exists($promoController, 'indexAction')) {
159
  return call_user_func_array(