datatables.net 2.3.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/dataTables.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! DataTables 2.3.1
1
+ /*! DataTables 2.3.3
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -112,7 +112,7 @@
112
112
  _fnCamelToHungarian( defaults.column, defaults.column, true );
113
113
 
114
114
  /* Setting up the initialisation object */
115
- _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ), true );
115
+ _fnCamelToHungarian( defaults, $.extend( oInit, _fnEscapeObject($this.data()) ), true );
116
116
 
117
117
 
118
118
 
@@ -542,6 +542,11 @@
542
542
  */
543
543
  errMode: "alert",
544
544
 
545
+ /** HTML entity escaping */
546
+ escape: {
547
+ /** When reading data-* attributes for initialisation options */
548
+ attributes: false
549
+ },
545
550
 
546
551
  /**
547
552
  * Legacy so v1 plug-ins don't throw js errors on load
@@ -726,7 +731,7 @@
726
731
  *
727
732
  * The extension options for ordering of data available here is complimentary
728
733
  * to the default type based ordering that DataTables typically uses. It
729
- * allows much greater control over the the data that is being used to
734
+ * allows much greater control over the data that is being used to
730
735
  * order a column, but is necessarily therefore more complex.
731
736
  *
732
737
  * This type of ordering is useful if you want to do ordering based on data
@@ -885,7 +890,7 @@
885
890
  * `{type}-asc` and `{type}-desc` together. It is generally recommended
886
891
  * that only `{type}-pre` is used, as this provides the optimal
887
892
  * implementation in terms of speed, although the others are provided
888
- * for compatibility with existing Javascript sort functions.
893
+ * for compatibility with existing JavaScript sort functions.
889
894
  *
890
895
  * `{type}-pre`: Functions defined take a single parameter:
891
896
  *
@@ -895,7 +900,7 @@
895
900
  *
896
901
  * * `{*}` Data to be sorted upon
897
902
  *
898
- * `{type}-asc` and `{type}-desc`: Functions are typical Javascript sort
903
+ * `{type}-asc` and `{type}-desc`: Functions are typical JavaScript sort
899
904
  * functions, taking two parameters:
900
905
  *
901
906
  * 1. `{*}` Data to compare to the second parameter
@@ -1119,7 +1124,7 @@
1119
1124
  };
1120
1125
 
1121
1126
  // Convert from a formatted number with characters other than `.` as the
1122
- // decimal place, to a Javascript number
1127
+ // decimal place, to a JavaScript number
1123
1128
  var _numToDecimal = function ( num, decimalPoint ) {
1124
1129
  // Cache created regular expressions for speed as this function is called often
1125
1130
  if ( ! _re_dic[ decimalPoint ] ) {
@@ -1185,19 +1190,19 @@
1185
1190
 
1186
1191
  var _pluck = function ( a, prop, prop2 ) {
1187
1192
  var out = [];
1188
- var i=0, ien=a.length;
1193
+ var i=0, iLen=a.length;
1189
1194
 
1190
1195
  // Could have the test in the loop for slightly smaller code, but speed
1191
1196
  // is essential here
1192
1197
  if ( prop2 !== undefined ) {
1193
- for ( ; i<ien ; i++ ) {
1198
+ for ( ; i<iLen ; i++ ) {
1194
1199
  if ( a[i] && a[i][ prop ] ) {
1195
1200
  out.push( a[i][ prop ][ prop2 ] );
1196
1201
  }
1197
1202
  }
1198
1203
  }
1199
1204
  else {
1200
- for ( ; i<ien ; i++ ) {
1205
+ for ( ; i<iLen ; i++ ) {
1201
1206
  if ( a[i] ) {
1202
1207
  out.push( a[i][ prop ] );
1203
1208
  }
@@ -1213,19 +1218,19 @@
1213
1218
  var _pluck_order = function ( a, order, prop, prop2 )
1214
1219
  {
1215
1220
  var out = [];
1216
- var i=0, ien=order.length;
1221
+ var i=0, iLen=order.length;
1217
1222
 
1218
1223
  // Could have the test in the loop for slightly smaller code, but speed
1219
1224
  // is essential here
1220
1225
  if ( prop2 !== undefined ) {
1221
- for ( ; i<ien ; i++ ) {
1226
+ for ( ; i<iLen ; i++ ) {
1222
1227
  if ( a[ order[i] ] && a[ order[i] ][ prop ] ) {
1223
1228
  out.push( a[ order[i] ][ prop ][ prop2 ] );
1224
1229
  }
1225
1230
  }
1226
1231
  }
1227
1232
  else {
1228
- for ( ; i<ien ; i++ ) {
1233
+ for ( ; i<iLen ; i++ ) {
1229
1234
  if ( a[ order[i] ] ) {
1230
1235
  out.push( a[ order[i] ][ prop ] );
1231
1236
  }
@@ -1262,7 +1267,7 @@
1262
1267
  {
1263
1268
  var out = [];
1264
1269
 
1265
- for ( var i=0, ien=a.length ; i<ien ; i++ ) {
1270
+ for ( var i=0, iLen=a.length ; i<iLen ; i++ ) {
1266
1271
  if ( a[i] ) { // careful - will remove all falsy values!
1267
1272
  out.push( a[i] );
1268
1273
  }
@@ -1348,7 +1353,7 @@
1348
1353
  var sorted = src.slice().sort();
1349
1354
  var last = sorted[0];
1350
1355
 
1351
- for ( var i=1, ien=sorted.length ; i<ien ; i++ ) {
1356
+ for ( var i=1, iLen=sorted.length ; i<iLen ; i++ ) {
1352
1357
  if ( sorted[i] === last ) {
1353
1358
  return false;
1354
1359
  }
@@ -1384,10 +1389,10 @@
1384
1389
  var
1385
1390
  out = [],
1386
1391
  val,
1387
- i, ien=src.length,
1392
+ i, iLen=src.length,
1388
1393
  j, k=0;
1389
1394
 
1390
- again: for ( i=0 ; i<ien ; i++ ) {
1395
+ again: for ( i=0 ; i<iLen ; i++ ) {
1391
1396
  val = src[i];
1392
1397
 
1393
1398
  for ( j=0 ; j<k ; j++ ) {
@@ -1921,7 +1926,7 @@
1921
1926
  var searchCols = init.aoSearchCols;
1922
1927
 
1923
1928
  if ( searchCols ) {
1924
- for ( var i=0, ien=searchCols.length ; i<ien ; i++ ) {
1929
+ for ( var i=0, iLen=searchCols.length ; i<iLen ; i++ ) {
1925
1930
  if ( searchCols[i] ) {
1926
1931
  _fnCamelToHungarian( DataTable.models.oSearch, searchCols[i] );
1927
1932
  }
@@ -2074,7 +2079,7 @@
2074
2079
  oCol._sManualType = oOptions.sType;
2075
2080
  }
2076
2081
 
2077
- // `class` is a reserved word in Javascript, so we need to provide
2082
+ // `class` is a reserved word in JavaScript, so we need to provide
2078
2083
  // the ability to use a valid name for the camel case input
2079
2084
  if ( oOptions.className && ! oOptions.sClass )
2080
2085
  {
@@ -2231,14 +2236,14 @@
2231
2236
  * @returns {int} i the number of visible columns
2232
2237
  * @memberof DataTable#oApi
2233
2238
  */
2234
- function _fnVisbleColumns( settings )
2239
+ function _fnVisibleColumns( settings )
2235
2240
  {
2236
2241
  var layout = settings.aoHeader;
2237
2242
  var columns = settings.aoColumns;
2238
2243
  var vis = 0;
2239
2244
 
2240
2245
  if ( layout.length ) {
2241
- for ( var i=0, ien=layout[0].length ; i<ien ; i++ ) {
2246
+ for ( var i=0, iLen=layout[0].length ; i<iLen ; i++ ) {
2242
2247
  if ( columns[i].bVisible && $(layout[0][i].cell).css('display') !== 'none' ) {
2243
2248
  vis++;
2244
2249
  }
@@ -2273,7 +2278,7 @@
2273
2278
  /**
2274
2279
  * Allow the result from a type detection function to be `true` while
2275
2280
  * translating that into a string. Old type detection functions will
2276
- * return the type name if it passes. An obect store would be better,
2281
+ * return the type name if it passes. An object store would be better,
2277
2282
  * but not backwards compatible.
2278
2283
  *
2279
2284
  * @param {*} typeDetect Object or function for type detection
@@ -2296,11 +2301,11 @@
2296
2301
  var columns = settings.aoColumns;
2297
2302
  var data = settings.aoData;
2298
2303
  var types = DataTable.ext.type.detect;
2299
- var i, ien, j, jen, k, ken;
2304
+ var i, iLen, j, jen, k, ken;
2300
2305
  var col, detectedType, cache;
2301
2306
 
2302
2307
  // For each column, spin over the data type detection functions, seeing if one matches
2303
- for ( i=0, ien=columns.length ; i<ien ; i++ ) {
2308
+ for ( i=0, iLen=columns.length ; i<iLen ; i++ ) {
2304
2309
  col = columns[i];
2305
2310
  cache = [];
2306
2311
 
@@ -2570,7 +2575,7 @@
2570
2575
  var unit;
2571
2576
  var columns = settings.aoColumns;
2572
2577
 
2573
- for ( var i=0, ien=targets.length ; i<ien ; i++ ) {
2578
+ for ( var i=0, iLen=targets.length ; i<iLen ; i++ ) {
2574
2579
  var column = columns[ targets[i] ];
2575
2580
  var definedWidth = original ?
2576
2581
  column.sWidthOrig :
@@ -2616,7 +2621,7 @@
2616
2621
  }
2617
2622
  /**
2618
2623
  * Add a data array to the table, creating DOM node etc. This is the parallel to
2619
- * _fnGatherData, but for adding rows from a Javascript source, rather than a
2624
+ * _fnGatherData, but for adding rows from a JavaScript source, rather than a
2620
2625
  * DOM source.
2621
2626
  * @param {object} settings dataTables settings object
2622
2627
  * @param {array} data data array to be added
@@ -2756,10 +2761,10 @@
2756
2761
  }
2757
2762
 
2758
2763
  if ( type === 'filter' ) {
2759
- var fomatters = DataTable.ext.type.search;
2764
+ var formatters = DataTable.ext.type.search;
2760
2765
 
2761
- if ( fomatters[ col.sType ] ) {
2762
- cellData = fomatters[ col.sType ]( cellData );
2766
+ if ( formatters[ col.sType ] ) {
2767
+ cellData = formatters[ col.sType ]( cellData );
2763
2768
  }
2764
2769
  }
2765
2770
 
@@ -2889,7 +2894,7 @@
2889
2894
  function _fnInvalidate( settings, rowIdx, src, colIdx )
2890
2895
  {
2891
2896
  var row = settings.aoData[ rowIdx ];
2892
- var i, ien;
2897
+ var i, iLen;
2893
2898
 
2894
2899
  // Remove the cached data for the row
2895
2900
  row._aSortData = null;
@@ -2914,7 +2919,7 @@
2914
2919
  _fnWriteCell(cells[colIdx], display[colIdx]);
2915
2920
  }
2916
2921
  else {
2917
- for ( i=0, ien=cells.length ; i<ien ; i++ ) {
2922
+ for ( i=0, iLen=cells.length ; i<iLen ; i++ ) {
2918
2923
  _fnWriteCell(cells[i], display[i]);
2919
2924
  }
2920
2925
  }
@@ -2932,7 +2937,7 @@
2932
2937
  cols[ colIdx ].maxLenString = null;
2933
2938
  }
2934
2939
  else {
2935
- for ( i=0, ien=cols.length ; i<ien ; i++ ) {
2940
+ for ( i=0, iLen=cols.length ; i<iLen ; i++ ) {
2936
2941
  cols[i].sType = null;
2937
2942
  cols[i].maxLenString = null;
2938
2943
  }
@@ -3231,7 +3236,7 @@
3231
3236
  {
3232
3237
  var classes = settings.oClasses;
3233
3238
  var columns = settings.aoColumns;
3234
- var i, ien, row;
3239
+ var i, iLen, row;
3235
3240
  var target = side === 'header'
3236
3241
  ? settings.nTHead
3237
3242
  : settings.nTFoot;
@@ -3259,7 +3264,7 @@
3259
3264
  cellCount += this.colSpan;
3260
3265
  });
3261
3266
 
3262
- for ( i=cellCount, ien=columns.length ; i<ien ; i++ ) {
3267
+ for ( i=cellCount, iLen=columns.length ; i<iLen ; i++ ) {
3263
3268
  $('<th/>')
3264
3269
  .html( columns[i][titleProp] || '' )
3265
3270
  .appendTo( row );
@@ -3603,7 +3608,7 @@
3603
3608
 
3604
3609
  return $( '<tr/>' )
3605
3610
  .append( $('<td />', {
3606
- 'colSpan': _fnVisbleColumns( settings ),
3611
+ 'colSpan': _fnVisibleColumns( settings ),
3607
3612
  'class': settings.oClasses.empty.row
3608
3613
  } ).html( zero ) )[0];
3609
3614
  }
@@ -3787,7 +3792,7 @@
3787
3792
 
3788
3793
  var line = row[ item ].contents;
3789
3794
 
3790
- for ( var i=0, ien=line.length ; i<ien ; i++ ) {
3795
+ for ( var i=0, iLen=line.length ; i<iLen ; i++ ) {
3791
3796
  if ( ! line[i] ) {
3792
3797
  continue;
3793
3798
  }
@@ -3951,7 +3956,7 @@
3951
3956
  /**
3952
3957
  * Use the DOM source to create up an array of header cells. The idea here is to
3953
3958
  * create a layout grid (array) of rows x columns, which contains a reference
3954
- * to the cell that that point in the grid (regardless of col/rowspan), such that
3959
+ * to the cell at that point in the grid (regardless of col/rowspan), such that
3955
3960
  * any column / row could be removed and the new grid constructed
3956
3961
  * @param {node} thead The header/footer element for the table
3957
3962
  * @returns {array} Calculated layout array
@@ -4013,7 +4018,7 @@
4013
4018
  if ( write ) {
4014
4019
  if (unique) {
4015
4020
  // Allow column options to be set from HTML attributes
4016
- _fnColumnOptions( settings, shifted, jqCell.data() );
4021
+ _fnColumnOptions( settings, shifted, _fnEscapeObject(jqCell.data()) );
4017
4022
 
4018
4023
  // Get the width for the column. This can be defined from the
4019
4024
  // width attribute, style attribute or `columns.width` option
@@ -4196,7 +4201,7 @@
4196
4201
 
4197
4202
  var newData = typeof ajaxData === 'function' ?
4198
4203
  ajaxData( data, oSettings ) : // fn can manipulate data or return
4199
- ajaxData; // an object object or array to merge
4204
+ ajaxData; // an object or array to merge
4200
4205
 
4201
4206
  // If the function returned something, use that alone
4202
4207
  data = typeof ajaxData === 'function' && newData ?
@@ -4259,7 +4264,7 @@
4259
4264
  // to the object for the callback.
4260
4265
  var empty = {};
4261
4266
 
4262
- DataTable.util.set(ajax.dataSrc)(empty, []);
4267
+ _fnAjaxDataSrc(oSettings, empty, []);
4263
4268
  callback(empty);
4264
4269
  }
4265
4270
  else {
@@ -4395,7 +4400,7 @@
4395
4400
  settings._iRecordsTotal = parseInt(recordsTotal, 10);
4396
4401
  settings._iRecordsDisplay = parseInt(recordsFiltered, 10);
4397
4402
 
4398
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
4403
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
4399
4404
  _fnAddData( settings, data[i] );
4400
4405
  }
4401
4406
  settings.aiDisplay = settings.aiDisplayMaster.slice();
@@ -4554,7 +4559,7 @@
4554
4559
  var displayRows = settings.aiDisplay;
4555
4560
  var row, rowIdx;
4556
4561
 
4557
- for ( var i=0, ien=filters.length ; i<ien ; i++ ) {
4562
+ for ( var i=0, iLen=filters.length ; i<iLen ; i++ ) {
4558
4563
  var rows = [];
4559
4564
 
4560
4565
  // Loop over each row and see if it should be included
@@ -4622,7 +4627,7 @@
4622
4627
  * @param {string} sSearch string to search for
4623
4628
  * @param {bool} bRegex treat as a regular expression or not
4624
4629
  * @param {bool} bSmart perform smart filtering or not
4625
- * @param {bool} bCaseInsensitive Do case insensitive matching or not
4630
+ * @param {bool} bCaseInsensitive Do case-insensitive matching or not
4626
4631
  * @returns {RegExp} constructed object
4627
4632
  * @memberof DataTable#oApi
4628
4633
  */
@@ -5365,7 +5370,7 @@
5365
5370
  }
5366
5371
 
5367
5372
  // 4. Clean up
5368
- // Figure out if there are scrollbar present - if so then we need a the header and footer to
5373
+ // Figure out if there are scrollbar present - if so then we need the header and footer to
5369
5374
  // provide a bit more space to allow "overflow" scrolling (i.e. past the scrollbar)
5370
5375
  var isScrolling = Math.floor(table.height()) > divBodyEl.clientHeight || divBody.css('overflow-y') == "scroll";
5371
5376
  var paddingSide = 'padding' + (browser.bScrollbarLeft ? 'Left' : 'Right' );
@@ -5463,7 +5468,7 @@
5463
5468
  .removeAttr( 'id' );
5464
5469
 
5465
5470
  // Clean up the table body
5466
- tmpTable.append('<tbody>')
5471
+ tmpTable.append('<tbody/>')
5467
5472
  var tr = $('<tr/>').appendTo( tmpTable.find('tbody') );
5468
5473
 
5469
5474
  // Clone the table header and footer - we can't use the header / footer
@@ -5672,7 +5677,7 @@
5672
5677
  if (! column.maxLenString) {
5673
5678
  var s, max='', maxLen = -1;
5674
5679
 
5675
- for ( var i=0, ien=settings.aiDisplayMaster.length ; i<ien ; i++ ) {
5680
+ for ( var i=0, iLen=settings.aiDisplayMaster.length ; i<iLen ; i++ ) {
5676
5681
  var rowIdx = settings.aiDisplayMaster[i];
5677
5682
  var data = _fnGetRowDisplay(settings, rowIdx)[colIdx];
5678
5683
 
@@ -5787,12 +5792,14 @@
5787
5792
  var run = false;
5788
5793
  var columns = column === undefined
5789
5794
  ? _fnColumnsFromHeader( e.target )
5790
- : Array.isArray(column)
5791
- ? column
5792
- : [column];
5795
+ : typeof column === 'function'
5796
+ ? column()
5797
+ : Array.isArray(column)
5798
+ ? column
5799
+ : [column];
5793
5800
 
5794
5801
  if ( columns.length ) {
5795
- for ( var i=0, ien=columns.length ; i<ien ; i++ ) {
5802
+ for ( var i=0, iLen=columns.length ; i<iLen ; i++ ) {
5796
5803
  var ret = _fnSortAdd( settings, columns[i], i, e.shiftKey );
5797
5804
 
5798
5805
  if (ret !== false) {
@@ -5841,7 +5848,7 @@
5841
5848
  masterMap[master[i]] = i;
5842
5849
  }
5843
5850
 
5844
- // And then cache what would be the indexOf fom the display
5851
+ // And then cache what would be the indexOf from the display
5845
5852
  for (i=0 ; i<display.length ; i++) {
5846
5853
  map[display[i]] = masterMap[display[i]];
5847
5854
  }
@@ -5967,7 +5974,7 @@
5967
5974
  function _fnSort ( oSettings, col, dir )
5968
5975
  {
5969
5976
  var
5970
- i, ien, iLen,
5977
+ i, iLen,
5971
5978
  aiOrig = [],
5972
5979
  extSort = DataTable.ext.type.order,
5973
5980
  aoData = oSettings.aoData,
@@ -5998,7 +6005,7 @@
5998
6005
  aSort = _fnSortFlatten( oSettings );
5999
6006
  }
6000
6007
 
6001
- for ( i=0, ien=aSort.length ; i<ien ; i++ ) {
6008
+ for ( i=0, iLen=aSort.length ; i<iLen ; i++ ) {
6002
6009
  sortCol = aSort[i];
6003
6010
 
6004
6011
  // Load the data needed for the sort, for each cell
@@ -6021,7 +6028,7 @@
6021
6028
 
6022
6029
  /* Do the sort - here we want multi-column sorting based on a given data source (column)
6023
6030
  * and sorting function (from oSort) in a certain direction. It's reasonably complex to
6024
- * follow on it's own, but this is what we want (example two column sorting):
6031
+ * follow on its own, but this is what we want (example two column sorting):
6025
6032
  * fnLocalSorting = function(a,b){
6026
6033
  * var test;
6027
6034
  * test = oSort['string-asc']('data11', 'data12');
@@ -6145,7 +6152,7 @@
6145
6152
  nextSortIdx = 0; // can't remove sorting completely
6146
6153
  }
6147
6154
 
6148
- if ( nextSortIdx === null ) {
6155
+ if ( nextSortIdx === null || asSorting[ nextSortIdx ] === '' ) {
6149
6156
  sorting.splice( sortIdx, 1 );
6150
6157
  }
6151
6158
  else {
@@ -6195,11 +6202,11 @@
6195
6202
  var sortClass = settings.oClasses.order.position;
6196
6203
  var sort = _fnSortFlatten( settings );
6197
6204
  var features = settings.oFeatures;
6198
- var i, ien, colIdx;
6205
+ var i, iLen, colIdx;
6199
6206
 
6200
6207
  if ( features.bSort && features.bSortClasses ) {
6201
6208
  // Remove old sorting classes
6202
- for ( i=0, ien=oldSort.length ; i<ien ; i++ ) {
6209
+ for ( i=0, iLen=oldSort.length ; i<iLen ; i++ ) {
6203
6210
  colIdx = oldSort[i].src;
6204
6211
 
6205
6212
  // Remove column sorting
@@ -6208,7 +6215,7 @@
6208
6215
  }
6209
6216
 
6210
6217
  // Add new column sorting
6211
- for ( i=0, ien=sort.length ; i<ien ; i++ ) {
6218
+ for ( i=0, iLen=sort.length ; i<iLen ; i++ ) {
6212
6219
  colIdx = sort[i].src;
6213
6220
 
6214
6221
  $( _pluck( settings.aoData, 'anCells', colIdx ) )
@@ -6342,7 +6349,7 @@
6342
6349
  }
6343
6350
 
6344
6351
  function _fnImplementState ( settings, s, callback) {
6345
- var i, ien;
6352
+ var i, iLen;
6346
6353
  var columns = settings.aoColumns;
6347
6354
  var currentNames = _pluck(settings.aoColumns, 'sName');
6348
6355
 
@@ -6471,7 +6478,7 @@
6471
6478
 
6472
6479
  // If the number of columns to restore is different from current, then all bets are off.
6473
6480
  if (set.length === columns.length) {
6474
- for ( i=0, ien=set.length ; i<ien ; i++ ) {
6481
+ for ( i=0, iLen=set.length ; i<iLen ; i++ ) {
6475
6482
  var col = set[i];
6476
6483
 
6477
6484
  // Visibility
@@ -6625,7 +6632,7 @@
6625
6632
 
6626
6633
 
6627
6634
  /**
6628
- * Bind an event handers to allow a click or return key to activate the callback.
6635
+ * Bind an event handler to allow a click or return key to activate the callback.
6629
6636
  * This is good for accessibility since a return on the keyboard will have the
6630
6637
  * same effect as a click, if the element has focus.
6631
6638
  * @param {element} n Element to bind the action to
@@ -6814,7 +6821,7 @@
6814
6821
  }
6815
6822
 
6816
6823
  /**
6817
- * Add elements to an array as quickly as possible, but stack stafe.
6824
+ * Add elements to an array as quickly as possible, but stack safe.
6818
6825
  *
6819
6826
  * @param {*} arr Array to add the data to
6820
6827
  * @param {*} data Data array that is to be added
@@ -6854,6 +6861,19 @@
6854
6861
  }
6855
6862
  }
6856
6863
 
6864
+ /**
6865
+ * Escape HTML entities in strings, in an object
6866
+ */
6867
+ function _fnEscapeObject(obj) {
6868
+ if (DataTable.ext.escape.attributes) {
6869
+ $.each(obj, function (key, val) {
6870
+ obj[key] = _escapeHtml(val);
6871
+ })
6872
+ }
6873
+
6874
+ return obj;
6875
+ }
6876
+
6857
6877
 
6858
6878
 
6859
6879
  /**
@@ -7077,7 +7097,7 @@
7077
7097
 
7078
7098
  each: function ( fn )
7079
7099
  {
7080
- for ( var i=0, ien=this.length ; i<ien; i++ ) {
7100
+ for ( var i=0, iLen=this.length ; i<iLen; i++ ) {
7081
7101
  fn.call( this, this[i], i, this );
7082
7102
  }
7083
7103
 
@@ -7123,7 +7143,7 @@
7123
7143
  iterator: function ( flatten, type, fn, alwaysNew ) {
7124
7144
  var
7125
7145
  a = [], ret,
7126
- i, ien, j, jen,
7146
+ i, iLen, j, jen,
7127
7147
  context = this.context,
7128
7148
  rows, items, item,
7129
7149
  selector = this.selector;
@@ -7136,7 +7156,7 @@
7136
7156
  flatten = false;
7137
7157
  }
7138
7158
 
7139
- for ( i=0, ien=context.length ; i<ien ; i++ ) {
7159
+ for ( i=0, iLen=context.length ; i<iLen ; i++ ) {
7140
7160
  var apiInst = new _Api( context[i] );
7141
7161
 
7142
7162
  if ( type === 'table' ) {
@@ -7258,18 +7278,18 @@
7258
7278
  } );
7259
7279
 
7260
7280
 
7261
- function _api_scope( scope, fn, struc ) {
7281
+ function _api_scope( scope, fn, struct ) {
7262
7282
  return function () {
7263
7283
  var ret = fn.apply( scope || this, arguments );
7264
7284
 
7265
7285
  // Method extension
7266
- _Api.extend( ret, ret, struc.methodExt );
7286
+ _Api.extend( ret, ret, struct.methodExt );
7267
7287
  return ret;
7268
7288
  };
7269
7289
  }
7270
7290
 
7271
7291
  function _api_find( src, name ) {
7272
- for ( var i=0, ien=src.length ; i<ien ; i++ ) {
7292
+ for ( var i=0, iLen=src.length ; i<iLen ; i++ ) {
7273
7293
  if ( src[i].name === name ) {
7274
7294
  return src[i];
7275
7295
  }
@@ -7287,10 +7307,10 @@
7287
7307
  }
7288
7308
 
7289
7309
  var
7290
- i, ien,
7310
+ i, iLen,
7291
7311
  struct;
7292
7312
 
7293
- for ( i=0, ien=ext.length ; i<ien ; i++ ) {
7313
+ for ( i=0, iLen=ext.length ; i<iLen ; i++ ) {
7294
7314
  struct = ext[i];
7295
7315
 
7296
7316
  if (struct.name === '__proto__') {
@@ -7345,12 +7365,12 @@
7345
7365
  }
7346
7366
 
7347
7367
  var
7348
- i, ien,
7368
+ i, iLen,
7349
7369
  heir = name.split('.'),
7350
7370
  struct = __apiStruct,
7351
7371
  key, method;
7352
7372
 
7353
- for ( i=0, ien=heir.length ; i<ien ; i++ ) {
7373
+ for ( i=0, iLen=heir.length ; i<iLen ; i++ ) {
7354
7374
  method = heir[i].indexOf('()') !== -1;
7355
7375
  key = method ?
7356
7376
  heir[i].replace('()', '') :
@@ -7368,7 +7388,7 @@
7368
7388
  struct.push( src );
7369
7389
  }
7370
7390
 
7371
- if ( i === ien-1 ) {
7391
+ if ( i === iLen-1 ) {
7372
7392
  src.val = val;
7373
7393
  src.type = typeof val === 'function' ?
7374
7394
  'function' :
@@ -7710,7 +7730,7 @@
7710
7730
  */
7711
7731
  _api_register( 'page.len()', function ( len ) {
7712
7732
  // Note that we can't call this function 'length()' because `length`
7713
- // is a Javascript property of functions which defines how many arguments
7733
+ // is a JavaScript property of functions which defines how many arguments
7714
7734
  // the function expects.
7715
7735
  if ( len === undefined ) {
7716
7736
  return this.context.length !== 0 ?
@@ -7753,7 +7773,7 @@
7753
7773
  _fnClearTable( settings );
7754
7774
 
7755
7775
  var data = _fnAjaxDataSrc( settings, json );
7756
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
7776
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
7757
7777
  _fnAddData( settings, data[i] );
7758
7778
  }
7759
7779
 
@@ -7876,7 +7896,7 @@
7876
7896
  {
7877
7897
  var
7878
7898
  out = [], res,
7879
- i, ien,
7899
+ i, iLen,
7880
7900
  selectorType = typeof selector;
7881
7901
 
7882
7902
  // Can't just check for isArray here, as an API or jQuery instance might be
@@ -7885,7 +7905,7 @@
7885
7905
  selector = [ selector ];
7886
7906
  }
7887
7907
 
7888
- for ( i=0, ien=selector.length ; i<ien ; i++ ) {
7908
+ for ( i=0, iLen=selector.length ; i<iLen ; i++ ) {
7889
7909
  res = selectFn( typeof selector[i] === 'string' ? selector[i].trim() : selector[i] );
7890
7910
 
7891
7911
  // Remove empty items
@@ -7901,7 +7921,7 @@
7901
7921
  // selector extensions
7902
7922
  var ext = _ext.selector[ type ];
7903
7923
  if ( ext.length ) {
7904
- for ( i=0, ien=ext.length ; i<ien ; i++ ) {
7924
+ for ( i=0, iLen=ext.length ; i<iLen ; i++ ) {
7905
7925
  out = ext[i]( settings, opts, out );
7906
7926
  }
7907
7927
  }
@@ -7956,7 +7976,7 @@
7956
7976
  var _selector_row_indexes = function ( settings, opts )
7957
7977
  {
7958
7978
  var
7959
- i, ien, tmp, a=[],
7979
+ i, iLen, tmp, a=[],
7960
7980
  displayFiltered = settings.aiDisplay,
7961
7981
  displayMaster = settings.aiDisplayMaster;
7962
7982
 
@@ -7979,7 +7999,7 @@
7979
7999
  // Current page implies that order=current and filter=applied, since it is
7980
8000
  // fairly senseless otherwise, regardless of what order and search actually
7981
8001
  // are
7982
- for ( i=settings._iDisplayStart, ien=settings.fnDisplayEnd() ; i<ien ; i++ ) {
8002
+ for ( i=settings._iDisplayStart, iLen=settings.fnDisplayEnd() ; i<iLen ; i++ ) {
7983
8003
  a.push( displayFiltered[i] );
7984
8004
  }
7985
8005
  }
@@ -7994,7 +8014,7 @@
7994
8014
  // O(n+m) solution by creating a hash map
7995
8015
  var displayFilteredMap = {};
7996
8016
 
7997
- for ( i=0, ien=displayFiltered.length ; i<ien ; i++ ) {
8017
+ for ( i=0, iLen=displayFiltered.length ; i<iLen ; i++ ) {
7998
8018
  displayFilteredMap[displayFiltered[i]] = null;
7999
8019
  }
8000
8020
 
@@ -8006,7 +8026,7 @@
8006
8026
  }
8007
8027
  }
8008
8028
  else if ( order == 'index' || order == 'original' ) {
8009
- for ( i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
8029
+ for ( i=0, iLen=settings.aoData.length ; i<iLen ; i++ ) {
8010
8030
  if (! settings.aoData[i]) {
8011
8031
  continue;
8012
8032
  }
@@ -8223,7 +8243,7 @@
8223
8243
  var context = this.context;
8224
8244
 
8225
8245
  // `iterator` will drop undefined values, but in this case we want them
8226
- for ( var i=0, ien=context.length ; i<ien ; i++ ) {
8246
+ for ( var i=0, iLen=context.length ; i<iLen ; i++ ) {
8227
8247
  for ( var j=0, jen=this[i].length ; j<jen ; j++ ) {
8228
8248
  var id = context[i].rowIdFn( context[i].aoData[ this[i][j] ]._aData );
8229
8249
  a.push( (hash === true ? '#' : '' )+ id );
@@ -8267,10 +8287,10 @@
8267
8287
 
8268
8288
  _api_register( 'rows.add()', function ( rows ) {
8269
8289
  var newRows = this.iterator( 'table', function ( settings ) {
8270
- var row, i, ien;
8290
+ var row, i, iLen;
8271
8291
  var out = [];
8272
8292
 
8273
- for ( i=0, ien=rows.length ; i<ien ; i++ ) {
8293
+ for ( i=0, iLen=rows.length ; i<iLen ; i++ ) {
8274
8294
  row = rows[i];
8275
8295
 
8276
8296
  if ( row.nodeName && row.nodeName.toUpperCase() === 'TR' ) {
@@ -8417,7 +8437,7 @@
8417
8437
  var addRow = function ( r, k ) {
8418
8438
  // Recursion to allow for arrays of jQuery objects
8419
8439
  if ( Array.isArray( r ) || r instanceof $ ) {
8420
- for ( var i=0, ien=r.length ; i<ien ; i++ ) {
8440
+ for ( var i=0, iLen=r.length ; i<iLen ; i++ ) {
8421
8441
  addRow( r[i], k );
8422
8442
  }
8423
8443
  return;
@@ -8437,7 +8457,7 @@
8437
8457
 
8438
8458
  $('td', created)
8439
8459
  .addClass( k )
8440
- .html( r )[0].colSpan = _fnVisbleColumns( ctx );
8460
+ .html( r )[0].colSpan = _fnVisibleColumns( ctx );
8441
8461
 
8442
8462
  rows.push( created[0] );
8443
8463
  }
@@ -8475,7 +8495,7 @@
8475
8495
  var row = ctx[0].aoData[ idx !== undefined ? idx : api[0] ];
8476
8496
 
8477
8497
  if ( row && row._details ) {
8478
- row._details.remove();
8498
+ row._details.detach();
8479
8499
 
8480
8500
  row._detailsShow = undefined;
8481
8501
  row._details = undefined;
@@ -8549,9 +8569,9 @@
8549
8569
 
8550
8570
  // Update the colspan for the details rows (note, only if it already has
8551
8571
  // a colspan)
8552
- var row, visible = _fnVisbleColumns( ctx );
8572
+ var row, visible = _fnVisibleColumns( ctx );
8553
8573
 
8554
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
8574
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
8555
8575
  row = data[i];
8556
8576
 
8557
8577
  if ( row && row._details ) {
@@ -8572,7 +8592,7 @@
8572
8592
  return;
8573
8593
  }
8574
8594
 
8575
- for ( var i=0, ien=data.length ; i<ien ; i++ ) {
8595
+ for ( var i=0, iLen=data.length ; i<iLen ; i++ ) {
8576
8596
  if ( data[i] && data[i]._details ) {
8577
8597
  __details_remove( api, i );
8578
8598
  }
@@ -8676,7 +8696,7 @@
8676
8696
  // iterator callback in columns().data()
8677
8697
  var __columnData = function ( settings, column, r1, r2, rows, type ) {
8678
8698
  var a = [];
8679
- for ( var row=0, ien=rows.length ; row<ien ; row++ ) {
8699
+ for ( var row=0, iLen=rows.length ; row<iLen ; row++ ) {
8680
8700
  a.push( _fnGetCellData( settings, rows[row], column, type ) );
8681
8701
  }
8682
8702
  return a;
@@ -8876,7 +8896,7 @@
8876
8896
  cols = settings.aoColumns,
8877
8897
  col = cols[ column ],
8878
8898
  data = settings.aoData,
8879
- cells, i, ien, tr;
8899
+ cells, i, iLen, tr;
8880
8900
 
8881
8901
  // Get
8882
8902
  if ( vis === undefined ) {
@@ -8894,7 +8914,7 @@
8894
8914
  // Need to decide if we should use appendChild or insertBefore
8895
8915
  var insertBefore = _pluck(cols, 'bVisible').indexOf(true, column+1);
8896
8916
 
8897
- for ( i=0, ien=data.length ; i<ien ; i++ ) {
8917
+ for ( i=0, iLen=data.length ; i<iLen ; i++ ) {
8898
8918
  if (data[i]) {
8899
8919
  tr = data[i].nTr;
8900
8920
  cells = data[i].anCells;
@@ -9060,7 +9080,7 @@
9060
9080
  // Update colspan for no records display. Child rows and extensions will use their own
9061
9081
  // listeners to do this - only need to update the empty table item here
9062
9082
  if ( ! settings.aiDisplay.length ) {
9063
- $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisbleColumns(settings));
9083
+ $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisibleColumns(settings));
9064
9084
  }
9065
9085
 
9066
9086
  _fnSaveState( settings );
@@ -9146,7 +9166,7 @@
9146
9166
  var allCells = $(_flatten( [], cells ));
9147
9167
  var row;
9148
9168
  var columns = settings.aoColumns.length;
9149
- var a, i, ien, j, o, host;
9169
+ var a, i, iLen, j, o, host;
9150
9170
 
9151
9171
  var run = function ( s ) {
9152
9172
  var fnSelector = typeof s === 'function';
@@ -9155,7 +9175,7 @@
9155
9175
  // All cells and function selectors
9156
9176
  a = [];
9157
9177
 
9158
- for ( i=0, ien=rows.length ; i<ien ; i++ ) {
9178
+ for ( i=0, iLen=rows.length ; i<iLen ; i++ ) {
9159
9179
  row = rows[i];
9160
9180
 
9161
9181
  for ( j=0 ; j<columns ; j++ ) {
@@ -9260,12 +9280,12 @@
9260
9280
  // Row + column selector
9261
9281
  var columns = this.columns( columnSelector, internalOpts );
9262
9282
  var rows = this.rows( rowSelector, internalOpts );
9263
- var i, ien, j, jen;
9283
+ var i, iLen, j, jen;
9264
9284
 
9265
9285
  var cellsNoOpts = this.iterator( 'table', function ( settings, idx ) {
9266
9286
  var a = [];
9267
9287
 
9268
- for ( i=0, ien=rows[idx].length ; i<ien ; i++ ) {
9288
+ for ( i=0, iLen=rows[idx].length ; i<iLen ; i++ ) {
9269
9289
  for ( j=0, jen=columns[idx].length ; j<jen ; j++ ) {
9270
9290
  a.push( {
9271
9291
  row: rows[idx][i],
@@ -9477,7 +9497,7 @@
9477
9497
  return this.iterator( 'column', function ( settings, idx ) {
9478
9498
  var sort = _fnSortFlatten( settings );
9479
9499
 
9480
- for ( var i=0, ien=sort.length ; i<ien ; i++ ) {
9500
+ for ( var i=0, iLen=sort.length ; i<iLen ; i++ ) {
9481
9501
  if ( sort[i].col === idx ) {
9482
9502
  return sort[i].dir;
9483
9503
  }
@@ -10168,9 +10188,11 @@
10168
10188
  }
10169
10189
 
10170
10190
  if ( $.isPlainObject( resolved ) ) {
10171
- resolved = plural !== undefined && resolved[ plural ] !== undefined ?
10172
- resolved[ plural ] :
10173
- resolved._;
10191
+ resolved = plural !== undefined && resolved[ plural ] !== undefined
10192
+ ? resolved[ plural ]
10193
+ : plural === false
10194
+ ? resolved
10195
+ : resolved._;
10174
10196
  }
10175
10197
 
10176
10198
  return typeof resolved === 'string'
@@ -10199,7 +10221,7 @@
10199
10221
  * @type string
10200
10222
  * @default Version number
10201
10223
  */
10202
- DataTable.version = "2.3.1";
10224
+ DataTable.version = "2.3.3";
10203
10225
 
10204
10226
  /**
10205
10227
  * Private data store, containing all of the settings objects that are
@@ -10232,7 +10254,7 @@
10232
10254
  */
10233
10255
  DataTable.models.oSearch = {
10234
10256
  /**
10235
- * Flag to indicate if the filtering should be case insensitive or not
10257
+ * Flag to whether or not the filtering should be case-insensitive
10236
10258
  */
10237
10259
  "caseInsensitive": true,
10238
10260
 
@@ -10517,7 +10539,7 @@
10517
10539
  * from v1.10 onwards the primary interface is camel case. In order to avoid
10518
10540
  * breaking backwards compatibility utterly with this change, the Hungarian
10519
10541
  * version is still, internally the primary interface, but is is not documented
10520
- * - hence the @name tags in each doc comment. This allows a Javascript function
10542
+ * - hence the @name tags in each doc comment. This allows a JavaScript function
10521
10543
  * to create a map from Hungarian notation to camel case (going the other direction
10522
10544
  * would require each property to be listed, which would add around 3K to the size
10523
10545
  * of DataTables, while this method is about a 0.5K hit).
@@ -10536,7 +10558,7 @@
10536
10558
  /**
10537
10559
  * An array of data to use for the table, passed in at initialisation which
10538
10560
  * will be used in preference to any data which is already in the DOM. This is
10539
- * particularly useful for constructing tables purely in Javascript, for
10561
+ * particularly useful for constructing tables purely in JavaScript, for
10540
10562
  * example with a custom Ajax call.
10541
10563
  */
10542
10564
  "aaData": null,
@@ -10603,7 +10625,7 @@
10603
10625
  * * `dataSrc` - By default DataTables will look for the property `data` (or
10604
10626
  * `aaData` for compatibility with DataTables 1.9-) when obtaining data
10605
10627
  * from an Ajax source or for server-side processing - this parameter
10606
- * allows that property to be changed. You can use Javascript dotted
10628
+ * allows that property to be changed. You can use JavaScript dotted
10607
10629
  * object notation to get a data source for multiple levels of nesting, or
10608
10630
  * it my be used as a function. As a function it takes a single parameter,
10609
10631
  * the JSON returned from the server, which can be manipulated as
@@ -10727,13 +10749,13 @@
10727
10749
  "bFilter": true,
10728
10750
 
10729
10751
  /**
10730
- * Used only for compatiblity with DT1
10752
+ * Used only for compatibility with DT1
10731
10753
  * @deprecated
10732
10754
  */
10733
10755
  "bInfo": true,
10734
10756
 
10735
10757
  /**
10736
- * Used only for compatiblity with DT1
10758
+ * Used only for compatibility with DT1
10737
10759
  * @deprecated
10738
10760
  */
10739
10761
  "bLengthChange": true,
@@ -10824,7 +10846,7 @@
10824
10846
  * Enable or disable state saving. When enabled HTML5 `localStorage` will be
10825
10847
  * used to save table display information such as pagination information,
10826
10848
  * display length, filtering and sorting. As such when the end user reloads
10827
- * the page the display display will match what thy had previously set up.
10849
+ * the page the display will match what thy had previously set up.
10828
10850
  */
10829
10851
  "bStateSave": false,
10830
10852
 
@@ -11181,7 +11203,7 @@
11181
11203
  /**
11182
11204
  * When using Ajax sourced data and during the first draw when DataTables is
11183
11205
  * gathering the data, this message is shown in an empty row in the table to
11184
- * indicate to the end user the the data is being loaded. Note that this
11206
+ * indicate to the end user the data is being loaded. Note that this
11185
11207
  * parameter is not used when loading data by server-side processing, just
11186
11208
  * Ajax sourced data with client-side processing.
11187
11209
  */
@@ -11442,8 +11464,8 @@
11442
11464
  * * `string` - read an object property from the data source. There are
11443
11465
  * three 'special' options that can be used in the string to alter how
11444
11466
  * DataTables reads the data from the source object:
11445
- * * `.` - Dotted Javascript notation. Just as you use a `.` in
11446
- * Javascript to read from nested objects, so to can the options
11467
+ * * `.` - Dotted JavaScript notation. Just as you use a `.` in
11468
+ * JavaScript to read from nested objects, so to can the options
11447
11469
  * specified in `data`. For example: `browser.version` or
11448
11470
  * `browser.name`. If your object parameter name contains a period, use
11449
11471
  * `\\` to escape it - i.e. `first\\.name`.
@@ -11501,7 +11523,7 @@
11501
11523
  * This property is the rendering partner to `data` and it is suggested that
11502
11524
  * when you want to manipulate data for display (including filtering,
11503
11525
  * sorting etc) without altering the underlying data for the table, use this
11504
- * property. `render` can be considered to be the the read only companion to
11526
+ * property. `render` can be considered to be the read only companion to
11505
11527
  * `data` which is read / write (then as such more complex). Like `data`
11506
11528
  * this option can be given in a number of different ways to effect its
11507
11529
  * behaviour:
@@ -11511,8 +11533,8 @@
11511
11533
  * * `string` - read an object property from the data source. There are
11512
11534
  * three 'special' options that can be used in the string to alter how
11513
11535
  * DataTables reads the data from the source object:
11514
- * * `.` - Dotted Javascript notation. Just as you use a `.` in
11515
- * Javascript to read from nested objects, so to can the options
11536
+ * * `.` - Dotted JavaScript notation. Just as you use a `.` in
11537
+ * JavaScript to read from nested objects, so to can the options
11516
11538
  * specified in `data`. For example: `browser.version` or
11517
11539
  * `browser.name`. If your object parameter name contains a period, use
11518
11540
  * `\\` to escape it - i.e. `first\\.name`.
@@ -11615,7 +11637,7 @@
11615
11637
  * The type allows you to specify how the data for this column will be
11616
11638
  * ordered. Four types (string, numeric, date and html (which will strip
11617
11639
  * HTML tags before ordering)) are currently available. Note that only date
11618
- * formats understood by Javascript's Date() object will be accepted as type
11640
+ * formats understood by JavaScript's Date() object will be accepted as type
11619
11641
  * date. For example: "Mar 26, 2008 5:03 PM". May take the values: 'string',
11620
11642
  * 'numeric', 'date' or 'html' (by default). Further types can be adding
11621
11643
  * through plug-ins.
@@ -11667,7 +11689,7 @@
11667
11689
  /**
11668
11690
  * Delay the creation of TR and TD elements until they are actually
11669
11691
  * needed by a driven page draw. This can give a significant speed
11670
- * increase for Ajax source and Javascript source data, but makes no
11692
+ * increase for Ajax source and JavaScript source data, but makes no
11671
11693
  * difference at all for DOM and server-side processing tables.
11672
11694
  * Note that this parameter will be set by the initialisation routine. To
11673
11695
  * set a default use {@link DataTable.defaults}.
@@ -11684,13 +11706,13 @@
11684
11706
  "bFilter": null,
11685
11707
 
11686
11708
  /**
11687
- * Used only for compatiblity with DT1
11709
+ * Used only for compatibility with DT1
11688
11710
  * @deprecated
11689
11711
  */
11690
11712
  "bInfo": true,
11691
11713
 
11692
11714
  /**
11693
- * Used only for compatiblity with DT1
11715
+ * Used only for compatibility with DT1
11694
11716
  * @deprecated
11695
11717
  */
11696
11718
  "bLengthChange": true,
@@ -12561,7 +12583,7 @@
12561
12583
  },
12562
12584
  order: {
12563
12585
  pre: function (d) {
12564
- // The renderer gives us Moment, Luxon or Date obects for the sorting, all of which have a
12586
+ // The renderer gives us Moment, Luxon or Date objects for the sorting, all of which have a
12565
12587
  // `valueOf` which gives milliseconds epoch
12566
12588
  return d.valueOf();
12567
12589
  }
@@ -13127,7 +13149,7 @@
13127
13149
 
13128
13150
  // If a decimal place other than `.` is used, it needs to be given to the
13129
13151
  // function so we can detect it and replace with a `.` which is the only
13130
- // decimal place Javascript recognises - it is not locale aware.
13152
+ // decimal place JavaScript recognises - it is not locale aware.
13131
13153
  if ( decimalPlace ) {
13132
13154
  d = _numToDecimal( d, decimalPlace );
13133
13155
  }
@@ -13185,7 +13207,7 @@
13185
13207
  // on destroy, while the `dt` namespaced event is the one we are
13186
13208
  // listening for
13187
13209
  $(settings.nTable).on( 'order.dt.DT column-visibility.dt.DT', function ( e, ctx, column ) {
13188
- if ( settings !== ctx ) { // need to check this this is the host
13210
+ if ( settings !== ctx ) { // need to check if this is the host
13189
13211
  return; // table, not a nested one
13190
13212
  }
13191
13213