Ignore:
Timestamp:
10/21/21 23:45:59 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
4b7e2d3
Parents:
6b95845
Message:

added fileTypes controller, notifications, excel export, edited views

File:
1 edited

Legend:

Unmodified
Added
Removed
  • public/vendors/dataTable/datatables.js

    r6b95845 rc6b84df  
    57405740
    57415741  //
    5742   // Setup limits is not necessary because in js we should not preallocate memory 
     5742  // Setup limits is not necessary because in js we should not preallocate memory
    57435743  // for inflate use constant limit in 65536 bytes
    57445744  //
     
    1610016100    var res = encoder.write(str);
    1610116101    var trail = encoder.end();
    16102    
     16102
    1610316103    return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
    1610416104}
     
    1614016140    if (!iconv.encodings)
    1614116141        iconv.encodings = __webpack_require__(171); // Lazy load all encoding definitions.
    16142    
     16142
    1614316143    // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
    1614416144    var enc = (''+encoding).toLowerCase().replace(/[^0-9a-z]|:\d{4}$/g, "");
     
    1616416164                if (!codecOptions.encodingName)
    1616516165                    codecOptions.encodingName = enc;
    16166                
     16166
    1616716167                enc = codecDef.type;
    1616816168                break;
     
    1665416654  UnicodeTrie = __webpack_require__(43);
    1665516655
    16656  
     16656
    1665716657
    1665816658  base64 = __webpack_require__(131);
     
    1682816828  this.tag = 0;
    1682916829  this.bitcount = 0;
    16830  
     16830
    1683116831  this.dest = dest;
    1683216832  this.destLen = 0;
    16833  
     16833
    1683416834  this.ltree = new Tree();  /* dynamic length/symbol tree */
    1683516835  this.dtree = new Tree();  /* dynamic distance tree */
     
    1697316973    d.bitcount += 8;
    1697416974  }
    16975  
     16975
    1697616976  var sum = 0, cur = 0, len = 0;
    1697716977  var tag = d.tag;
     
    1698616986    cur -= t.table[len];
    1698716987  } while (cur >= 0);
    16988  
     16988
    1698916989  d.tag = tag;
    1699016990  d.bitcount -= len;
     
    1709717097  var length, invlength;
    1709817098  var i;
    17099  
     17099
    1710017100  /* unread from bitbuffer */
    1710117101  while (d.bitcount > 8) {
     
    1717017170      return d.dest.subarray(0, d.destLen);
    1717117171  }
    17172  
     17172
    1717317173  return d.dest;
    1717417174}
     
    2067720677    return 16;
    2067820678  }
    20679  
     20679
    2068020680  n = br.readBits(3);
    2068120681  if (n > 0) {
    2068220682    return 17 + n;
    2068320683  }
    20684  
     20684
    2068520685  n = br.readBits(3);
    2068620686  if (n > 0) {
    2068720687    return 8 + n;
    2068820688  }
    20689  
     20689
    2069020690  return 17;
    2069120691}
     
    2071220712
    2071320713function DecodeMetaBlockLength(br) {
    20714   var out = new MetaBlockLength; 
     20714  var out = new MetaBlockLength;
    2071520715  var size_nibbles;
    2071620716  var size_bytes;
    2071720717  var i;
    20718  
     20718
    2071920719  out.input_end = br.readBits(1);
    2072020720  if (out.input_end && br.readBits(1)) {
    2072120721    return out;
    2072220722  }
    20723  
     20723
    2072420724  size_nibbles = br.readBits(2) + 4;
    2072520725  if (size_nibbles === 7) {
    2072620726    out.is_metadata = true;
    20727    
     20727
    2072820728    if (br.readBits(1) !== 0)
    2072920729      throw new Error('Invalid reserved bit');
    20730    
     20730
    2073120731    size_bytes = br.readBits(2);
    2073220732    if (size_bytes === 0)
    2073320733      return out;
    20734    
     20734
    2073520735    for (i = 0; i < size_bytes; i++) {
    2073620736      var next_byte = br.readBits(8);
    2073720737      if (i + 1 === size_bytes && size_bytes > 1 && next_byte === 0)
    2073820738        throw new Error('Invalid size byte');
    20739      
     20739
    2074020740      out.meta_block_length |= next_byte << (i * 8);
    2074120741    }
     
    2074520745      if (i + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0)
    2074620746        throw new Error('Invalid size nibble');
    20747      
     20747
    2074820748      out.meta_block_length |= next_nibble << (i * 4);
    2074920749    }
    2075020750  }
    20751  
     20751
    2075220752  ++out.meta_block_length;
    20753  
     20753
    2075420754  if (!out.input_end && !out.is_metadata) {
    2075520755    out.is_uncompressed = br.readBits(1);
    2075620756  }
    20757  
     20757
    2075820758  return out;
    2075920759}
     
    2076220762function ReadSymbol(table, index, br) {
    2076320763  var start_index = index;
    20764  
     20764
    2076520765  var nbits;
    2076620766  br.fillBitWindow();
     
    2078220782  var repeat_code_len = 0;
    2078320783  var space = 32768;
    20784  
     20784
    2078520785  var table = [];
    2078620786  for (var i = 0; i < 32; i++)
    2078720787    table.push(new HuffmanCode(0, 0));
    20788  
     20788
    2078920789  BrotliBuildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES);
    2079020790
     
    2079220792    var p = 0;
    2079320793    var code_len;
    20794    
     20794
    2079520795    br.readMoreInput();
    2079620796    br.fillBitWindow();
     
    2082720827        throw new Error('[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols');
    2082820828      }
    20829      
     20829
    2083020830      for (var x = 0; x < repeat_delta; x++)
    2083120831        code_lengths[symbol + x] = repeat_code_len;
    20832      
     20832
    2083320833      symbol += repeat_delta;
    20834      
     20834
    2083520835      if (repeat_code_len !== 0) {
    2083620836        space -= repeat_delta << (15 - repeat_code_len);
     
    2084120841    throw new Error("[ReadHuffmanCodeLengths] space = " + space);
    2084220842  }
    20843  
     20843
    2084420844  for (; symbol < num_symbols; symbol++)
    2084520845    code_lengths[symbol] = 0;
     
    2085020850  var simple_code_or_skip;
    2085120851  var code_lengths = new Uint8Array(alphabet_size);
    20852  
     20852
    2085320853  br.readMoreInput();
    20854  
     20854
    2085520855  /* simple_code_or_skip is used as follows:
    2085620856     1 for simple code;
     
    2088820888          throw new Error('[ReadHuffmanCode] invalid symbols');
    2088920889        }
    20890        
     20890
    2089120891        code_lengths[symbols[1]] = 1;
    2089220892        break;
     
    2090020900          throw new Error('[ReadHuffmanCode] invalid symbols');
    2090120901        }
    20902        
     20902
    2090320903        if (br.readBits(1)) {
    2090420904          code_lengths[symbols[2]] = 3;
     
    2091620916    /* Static Huffman code for the code length code lengths */
    2091720917    var huff = [
    20918       new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), 
     20918      new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
    2091920919      new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1),
    20920       new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), 
     20920      new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2),
    2092120921      new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5)
    2092220922    ];
     
    2093520935      }
    2093620936    }
    20937    
     20937
    2093820938    if (!(num_codes === 1 || space === 0))
    2093920939      throw new Error('[ReadHuffmanCode] invalid num_codes or space');
    20940    
     20940
    2094120941    ReadHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br);
    2094220942  }
    20943  
     20943
    2094420944  table_size = BrotliBuildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size);
    20945  
     20945
    2094620946  if (table_size === 0) {
    2094720947    throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");
    2094820948  }
    20949  
     20949
    2095020950  return table_size;
    2095120951}
     
    2099520995  this.alphabet_size = alphabet_size;
    2099620996  this.num_htrees = num_htrees;
    20997   this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]); 
     20997  this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]);
    2099820998  this.htrees = new Uint32Array(num_htrees);
    2099920999}
     
    2101621016  var table;
    2101721017  var i;
    21018  
     21018
    2101921019  br.readMoreInput();
    2102021020  var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1;
     
    2102921029    max_run_length_prefix = br.readBits(4) + 1;
    2103021030  }
    21031  
     21031
    2103221032  table = [];
    2103321033  for (i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++) {
    2103421034    table[i] = new HuffmanCode(0, 0);
    2103521035  }
    21036  
     21036
    2103721037  ReadHuffmanCode(num_htrees + max_run_length_prefix, table, 0, br);
    21038  
     21038
    2103921039  for (i = 0; i < context_map_size;) {
    2104021040    var code;
     
    2106221062    InverseMoveToFrontTransform(context_map, context_map_size);
    2106321063  }
    21064  
     21064
    2106521065  return out;
    2106621066}
     
    2112321123    for (var x = 0; x < tail; x++)
    2112421124      ringbuffer[rb_pos + x] = br.buf_[br_pos + x];
    21125    
     21125
    2112621126    nbytes -= tail;
    2112721127    rb_pos += tail;
     
    2113221132  for (var x = 0; x < nbytes; x++)
    2113321133    ringbuffer[rb_pos + x] = br.buf_[br_pos + x];
    21134  
     21134
    2113521135  rb_pos += nbytes;
    2113621136  len -= nbytes;
     
    2114021140  if (rb_pos >= rb_size) {
    2114121141    output.write(ringbuffer, rb_size);
    21142     rb_pos -= rb_size;   
     21142    rb_pos -= rb_size;
    2114321143    for (var x = 0; x < rb_pos; x++)
    2114421144      ringbuffer[x] = ringbuffer[rb_size + x];
     
    2118821188function BrotliDecompressBuffer(buffer, output_size) {
    2118921189  var input = new BrotliInput(buffer);
    21190  
     21190
    2119121191  if (output_size == null) {
    2119221192    output_size = BrotliDecompressedSize(buffer);
    2119321193  }
    21194  
     21194
    2119521195  var output_buffer = new Uint8Array(output_size);
    2119621196  var output = new BrotliOutput(output_buffer);
    21197  
     21197
    2119821198  BrotliDecompress(input, output);
    21199  
     21199
    2120021200  if (output.pos < output.buffer.length) {
    2120121201    output.buffer = output.buffer.subarray(0, output.pos);
    2120221202  }
    21203  
     21203
    2120421204  return output.buffer;
    2120521205}
     
    2128821288
    2128921289    br.readMoreInput();
    21290    
     21290
    2129121291    var _out = DecodeMetaBlockLength(br);
    2129221292    meta_block_remaining_len = _out.meta_block_length;
     
    2129621296      tmp.set( output.buffer );
    2129721297      output.buffer = tmp;
    21298     }   
     21298    }
    2129921299    input_end = _out.input_end;
    2130021300    is_uncompressed = _out.is_uncompressed;
    21301    
     21301
    2130221302    if (_out.is_metadata) {
    2130321303      JumpToByteBoundary(br);
    21304      
     21304
    2130521305      for (; meta_block_remaining_len > 0; --meta_block_remaining_len) {
    2130621306        br.readMoreInput();
     
    2130821308        br.readBits(8);
    2130921309      }
    21310      
     21310
    2131121311      continue;
    2131221312    }
    21313    
     21313
    2131421314    if (meta_block_remaining_len === 0) {
    2131521315      continue;
    2131621316    }
    21317    
     21317
    2131821318    if (is_uncompressed) {
    2131921319      br.bit_pos_ = (br.bit_pos_ + 7) & ~7;
     
    2132321323      continue;
    2132421324    }
    21325    
     21325
    2132621326    for (i = 0; i < 3; ++i) {
    2132721327      num_block_types[i] = DecodeVarLenUint8(br) + 1;
     
    2133321333      }
    2133421334    }
    21335    
     21335
    2133621336    br.readMoreInput();
    21337    
     21337
    2133821338    distance_postfix_bits = br.readBits(2);
    2133921339    num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits);
     
    2134621346       context_modes[i] = (br.readBits(2) << 1);
    2134721347    }
    21348    
     21348
    2134921349    var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br);
    2135021350    num_literal_htrees = _o1.num_htrees;
    2135121351    context_map = _o1.context_map;
    21352    
     21352
    2135321353    var _o2 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br);
    2135421354    num_dist_htrees = _o2.num_htrees;
    2135521355    dist_context_map = _o2.context_map;
    21356    
     21356
    2135721357    hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees);
    2135821358    hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]);
     
    2138421384
    2138521385      br.readMoreInput();
    21386      
     21386
    2138721387      if (block_length[1] === 0) {
    2138821388        DecodeBlockType(num_block_types[1],
     
    2144021440      if (distance_code < 0) {
    2144121441        var context;
    21442        
     21442
    2144321443        br.readMoreInput();
    2144421444        if (block_length[2] === 0) {
     
    2150221502            if (copy_dst >= ringbuffer_end) {
    2150321503              output.write(ringbuffer, ringbuffer_size);
    21504              
     21504
    2150521505              for (var _x = 0; _x < (copy_dst - ringbuffer_end); _x++)
    2150621506                ringbuffer[_x] = ringbuffer[ringbuffer_end + _x];
     
    2156721567    count = this.buffer.length - this.pos;
    2156821568  }
    21569  
     21569
    2157021570  for (var p = 0; p < count; p++)
    2157121571    buf[i + p] = this.buffer[this.pos + p];
    21572  
     21572
    2157321573  this.pos += count;
    2157421574  return count;
     
    2158521585  if (this.pos + count > this.buffer.length)
    2158621586    throw new Error('Output buffer is not large enough');
    21587  
     21587
    2158821588  this.buffer.set(buf.subarray(0, count), this.pos);
    2158921589  this.pos += count;
     
    2171721717    }
    2171821718  }
    21719  
     21719
    2172021720  table_bits = root_bits;
    2172121721  table_size = 1 << table_bits;
     
    2172721727      root_table[table + key] = new HuffmanCode(0, sorted[0] & 0xffff);
    2172821728    }
    21729    
     21729
    2173021730    return total_size;
    2173121731  }
     
    2176021760    }
    2176121761  }
    21762  
     21762
    2176321763  return total_size;
    2176421764}
     
    2177221772
    2177321773/*
    21774 PDFImage - embeds images in PDF documents
     21774PDFImage - embeds images in PDF folders
    2177521775By Devon Govett
    2177621776 */
     
    2230722307 * var docDefinition = {
    2230822308 *      info: {
    22309  *              title: 'awesome Document',
     22309 *              title: 'awesome Folder',
    2231022310 *              author: 'john doe',
    2231122311 *              subject: 'subject of document',
     
    3468634686      this._font = null;
    3468734687      this._registeredFonts = {};
    34688      
     34688
    3468934689    },
    3469034690    font: function(src, family, size) {
     
    3518535185
    3518635186// ISO (deprecated)
    35187 [], { // windows                                       
     35187[], { // windows
    3518835188  0x0436: 'af', 0x4009: 'en-IN', 0x0487: 'rw', 0x0432: 'tn',
    3518935189  0x041C: 'sq', 0x1809: 'en-IE', 0x0441: 'sw', 0x045B: 'si',
     
    4258742587 *   - apply ljmo, vjmo, and tjmo OpenType features to decomposed Jamo sequences.
    4258842588 *
    42589  * This logic is based on the following documents:
     42589 * This logic is based on the following folders:
    4259042590 *   - http://www.microsoft.com/typography/OpenTypeDev/hangul/intro.htm
    4259142591 *   - http://ktug.org/~nomos/harfbuzz-hangul/hangulshaper.pdf
     
    4995849958];
    4995949959
    49960 // Put all encoding/alias/codec definitions to single object and export it. 
     49960// Put all encoding/alias/codec definitions to single object and export it.
    4996149961for (var i = 0; i < modules.length; i++) {
    4996249962    var module = modules[i];
     
    5011050110
    5011150111InternalDecoderCesu8.prototype.write = function(buf) {
    50112     var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, 
     50112    var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
    5011350113        res = '';
    5011450114    for (var i = 0; i < buf.length; i++) {
     
    5028450284        this.initialBytes.push(buf);
    5028550285        this.initialBytesLen += buf.length;
    50286        
     50286
    5028750287        if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)
    5028850288            return '';
     
    5038050380    // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
    5038150381    return new Buffer(str.replace(nonDirectChars, function(chunk) {
    50382         return "+" + (chunk === '+' ? '' : 
    50383             this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) 
     50382        return "+" + (chunk === '+' ? '' :
     50383            this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
    5038450384            + "-";
    5038550385    }.bind(this)));
     
    5040350403    base64Chars[i] = base64Regex.test(String.fromCharCode(i));
    5040450404
    50405 var plusChar = '+'.charCodeAt(0), 
     50405var plusChar = '+'.charCodeAt(0),
    5040650406    minusChar = '-'.charCodeAt(0),
    5040750407    andChar = '&'.charCodeAt(0);
     
    5065250652
    5065350653// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
    50654 // correspond to encoded bytes (if 128 - then lower half is ASCII). 
     50654// correspond to encoded bytes (if 128 - then lower half is ASCII).
    5065550655
    5065650656exports._sbcs = SBCSCodec;
     
    5065850658    if (!codecOptions)
    5065950659        throw new Error("SBCS codec is called without the data.")
    50660    
     50660
    5066150661    // Prepare char buffer for decoding.
    5066250662    if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
    5066350663        throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
    50664    
     50664
    5066550665    if (codecOptions.chars.length === 128) {
    5066650666        var asciiString = "";
     
    5067150671
    5067250672    this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2');
    50673    
     50673
    5067450674    // Encoding buffer.
    5067550675    var encodeBuf = new Buffer(65536);
     
    5069450694    for (var i = 0; i < str.length; i++)
    5069550695        buf[i] = this.encodeBuf[str.charCodeAt(i)];
    50696    
     50696
    5069750697    return buf;
    5069850698}
     
    5142751427    this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.
    5142851428
    51429     // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. 
     51429    // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here.
    5143051430    this.decodeTableSeq = [];
    5143151431
     
    5143651436    this.defaultCharUnicode = iconv.defaultCharUnicode;
    5143751437
    51438    
     51438
    5143951439    // Encode tables: Unicode -> DBCS.
    5144051440
     
    5144551445    //         <= SEQ_START  -> it's an index in encodeTableSeq, see below. The character starts a sequence.
    5144651446    this.encodeTable = [];
    51447    
     51447
    5144851448    // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
    5144951449    // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
     
    5146351463                    skipEncodeChars[j] = true;
    5146451464        }
    51465        
     51465
    5146651466    // Use decode trie to recursively fill out encode tables.
    5146751467    this._fillEncodeTable(0, 0, skipEncodeChars);
     
    5150051500        for (var i = 0x30; i <= 0x39; i++)
    5150151501            fourthByteNode[i] = GB18030_CODE
    51502     }       
     51502    }
    5150351503}
    5150451504
     
    5156551565                    writeTable[curAddr++] = code; // Basic char
    5156651566            }
    51567         } 
     51567        }
    5156851568        else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character.
    5156951569            var charCode = writeTable[curAddr - 1] + 1;
     
    5159651596
    5159751597DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
    51598    
     51598
    5159951599    // Get the root of character tree according to first character of the sequence.
    5160051600    var uCode = seq[0];
     
    5165751657    this.leadSurrogate = -1;
    5165851658    this.seqObj = undefined;
    51659    
     51659
    5166051660    // Static data
    5166151661    this.encodeTable = codec.encodeTable;
     
    5166651666
    5166751667DBCSEncoder.prototype.write = function(str) {
    51668     var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)), 
     51668    var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)),
    5166951669        leadSurrogate = this.leadSurrogate,
    5167051670        seqObj = this.seqObj, nextChar = -1,
     
    5167951679        else {
    5168051680            var uCode = nextChar;
    51681             nextChar = -1;   
     51681            nextChar = -1;
    5168251682        }
    5168351683
     
    5170151701                    uCode = UNASSIGNED;
    5170251702                }
    51703                
     51703
    5170451704            }
    5170551705        }
     
    5174251742            if (subtable !== undefined)
    5174351743                dbcsCode = subtable[uCode & 0xFF];
    51744            
     51744
    5174551745            if (dbcsCode <= SEQ_START) { // Sequence start
    5174651746                seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];
     
    5176551765        if (dbcsCode === UNASSIGNED)
    5176651766            dbcsCode = this.defaultCharSingleByte;
    51767        
     51767
    5176851768        if (dbcsCode < 0x100) {
    5176951769            newBuf[j++] = dbcsCode;
     
    5181251812        this.leadSurrogate = -1;
    5181351813    }
    51814    
     51814
    5181551815    return newBuf.slice(0, j);
    5181651816}
     
    5183651836DBCSDecoder.prototype.write = function(buf) {
    5183751837    var newBuf = new Buffer(buf.length*2),
    51838         nodeIdx = this.nodeIdx, 
     51838        nodeIdx = this.nodeIdx,
    5183951839        prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
    5184051840        seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
     
    5184351843    if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.
    5184451844        prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
    51845    
     51845
    5184651846    for (var i = 0, j = 0; i < buf.length; i++) {
    5184751847        var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];
     
    5185051850        var uCode = this.decodeTables[nodeIdx][curByte];
    5185151851
    51852         if (uCode >= 0) { 
     51852        if (uCode >= 0) {
    5185351853            // Normal character, just use it.
    5185451854        }
     
    5188251882
    5188351883        // Write the character to buffer, handling higher planes using surrogate pair.
    51884         if (uCode > 0xFFFF) { 
     51884        if (uCode > 0xFFFF) {
    5188551885            uCode -= 0x10000;
    5188651886            var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);
     
    5195251952
    5195351953module.exports = {
    51954    
     51954
    5195551955    // == Japanese/ShiftJIS ====================================================
    5195651956    // All japanese encodings are based on JIS X set of standards:
    5195751957    // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
    51958     // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. 
     51958    // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
    5195951959    //              Has several variations in 1978, 1983, 1990 and 1997.
    5196051960    // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
     
    5197451974    //  * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
    5197551975    //               Used as-is in ISO2022 family.
    51976     //  * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, 
     51976    //  * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
    5197751977    //                0201-1976 Roman, 0208-1978, 0208-1983.
    5197851978    //  * ISO2022-JP-1: Adds esc seq for 0212-1990.
     
    5208652086    //  * Big5-2003 (Taiwan standard) almost superset of cp950.
    5208752087    //  * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
    52088     //  * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. 
     52088    //  * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
    5208952089    //    many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
    5209052090    //    Plus, it has 4 combining sequences.
     
    5209752097    //    Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
    5209852098    //                   http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
    52099     // 
     52099    //
    5210052100    // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
    5210152101    // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
     
    5216652166// == Exports ==================================================================
    5216752167module.exports = function(iconv) {
    52168    
     52168
    5216952169    // Additional Public API.
    5217052170    iconv.encodeStream = function encodeStream(encoding, options) {
     
    5226152261    try {
    5226252262        var res = this.conv.end();
    52263         if (res && res.length) this.push(res, this.encoding);               
     52263        if (res && res.length) this.push(res, this.encoding);
    5226452264        done();
    5226552265    }
     
    5230952309
    5231052310        var nodeNativeEncodings = {
    52311             'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, 
     52311            'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true,
    5231252312            'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,
    5231352313        };
     
    5616456164  this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE);
    5616556165  this.input_ = input;    /* input callback */
    56166  
     56166
    5616756167  this.reset();
    5616856168}
     
    5617856178  this.bit_end_pos_ = 0;  /* bit-reading end position from LSB of val_ */
    5617956179  this.eos_ = 0;          /* input stream is finished */
    56180  
     56180
    5618156181  this.readMoreInput();
    5618256182  for (var i = 0; i < 4; i++) {
     
    5618456184    ++this.pos_;
    5618556185  }
    56186  
     56186
    5618756187  return this.bit_end_pos_ > 0;
    5618856188};
     
    5621256212      throw new Error('Unexpected end of input');
    5621356213    }
    56214    
     56214
    5621556215    if (bytes_read < BROTLI_READ_SIZE) {
    5621656216      this.eos_ = 1;
     
    5621956219        this.buf_[dst + bytes_read + p] = 0;
    5622056220    }
    56221    
     56221
    5622256222    if (dst === 0) {
    5622356223      /* Copy the head of the ringbuffer to the slack region. */
     
    5622956229      this.buf_ptr_ = 0;
    5623056230    }
    56231    
     56231
    5623256232    this.bit_end_pos_ += bytes_read << 3;
    5623356233  }
     
    5623556235
    5623656236/* Guarantees that there are at least 24 bits in the buffer. */
    56237 BrotliBitReader.prototype.fillBitWindow = function() {   
     56237BrotliBitReader.prototype.fillBitWindow = function() {
    5623856238  while (this.bit_pos_ >= 8) {
    5623956239    this.val_ >>>= 8;
     
    5625056250    this.fillBitWindow();
    5625156251  }
    56252  
     56252
    5625356253  var val = ((this.val_ >>> this.bit_pos_) & kBitMask[n_bits]);
    5625456254  this.bit_pos_ += n_bits;
     
    5626756267
    5626856268/**
    56269  * The normal dictionary-data.js is quite large, which makes it 
    56270  * unsuitable for browser usage. In order to make it smaller, 
     56269 * The normal dictionary-data.js is quite large, which makes it
     56270 * unsuitable for browser usage. In order to make it smaller,
    5627156271 * we read dictionary.bin, which is a compressed version of
    56272  * the dictionary, and on initial load, Brotli decompresses 
     56272 * the dictionary, and on initial load, Brotli decompresses
    5627356273 * it's own dictionary. 😜
    5627456274 */
     
    5678156781  this.transform = transform;
    5678256782  this.suffix = new Uint8Array(suffix.length);
    56783  
     56783
    5678456784  for (var i = 0; i < prefix.length; i++)
    5678556785    this.prefix[i] = prefix.charCodeAt(i);
    56786  
     56786
    5678756787  for (var i = 0; i < suffix.length; i++)
    5678856788    this.suffix[i] = suffix.charCodeAt(i);
     
    5692356923    return 1;
    5692456924  }
    56925  
     56925
    5692656926  /* An overly simplified uppercasing model for utf-8. */
    5692756927  if (p[i] < 0xe0) {
     
    5692956929    return 2;
    5693056930  }
    56931  
     56931
    5693256932  /* An arbitrary transform for three byte characters. */
    5693356933  p[i + 2] ^= 5;
     
    5694356943  var start_idx = idx;
    5694456944  var uppercase;
    56945  
     56945
    5694656946  if (skip > len) {
    5694756947    skip = len;
    5694856948  }
    56949  
     56949
    5695056950  var prefix_pos = 0;
    5695156951  while (prefix_pos < prefix.length) {
    5695256952    dst[idx++] = prefix[prefix_pos++];
    5695356953  }
    56954  
     56954
    5695556955  word += skip;
    5695656956  len -= skip;
    56957  
     56957
    5695856958  if (t <= kOmitLast9) {
    5695956959    len -= t;
    5696056960  }
    56961  
     56961
    5696256962  for (i = 0; i < len; i++) {
    5696356963    dst[idx++] = BrotliDictionary.dictionary[word + i];
    5696456964  }
    56965  
     56965
    5696656966  uppercase = idx - len;
    56967  
     56967
    5696856968  if (t === kUppercaseFirst) {
    5696956969    ToUpperCase(dst, uppercase);
     
    5697556975    }
    5697656976  }
    56977  
     56977
    5697856978  var suffix_pos = 0;
    5697956979  while (suffix_pos < suffix.length) {
    5698056980    dst[idx++] = suffix[suffix_pos++];
    5698156981  }
    56982  
     56982
    5698356983  return idx - start_idx;
    5698456984}
     
    5871358713# MIT LICENSE
    5871458714# Copyright (c) 2011 Devon Govett
    58715 # 
    58716 # Permission is hereby granted, free of charge, to any person obtaining a copy of this 
    58717 # software and associated documentation files (the "Software"), to deal in the Software 
    58718 # without restriction, including without limitation the rights to use, copy, modify, merge, 
    58719 # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 
     58715#
     58716# Permission is hereby granted, free of charge, to any person obtaining a copy of this
     58717# software and associated documentation files (the "Software"), to deal in the Software
     58718# without restriction, including without limitation the rights to use, copy, modify, merge,
     58719# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
    5872058720# to whom the Software is furnished to do so, subject to the following conditions:
    58721 # 
    58722 # The above copyright notice and this permission notice shall be included in all copies or 
     58721#
     58722# The above copyright notice and this permission notice shall be included in all copies or
    5872358723# substantial portions of the Software.
    58724 # 
    58725 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
    58726 # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
    58727 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
    58728 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
     58724#
     58725# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
     58726# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     58727# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
     58728# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    5872958729# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    5873058730*/
     
    5980059800                        return this.api(true).$( sSelector, oOpts );
    5980159801                };
    59802                
    59803                
     59802
     59803
    5980459804                /**
    5980559805                 * Almost identical to $ in operation, but in this case returns the data for the matched
     
    5985459854                        return this.api(true).rows( sSelector, oOpts ).data();
    5985559855                };
    59856                
    59857                
     59856
     59857
    5985859858                /**
    5985959859                 * Create a DataTables Api instance, with the currently selected tables for
     
    5987359873                                new _Api( this );
    5987459874                };
    59875                
    59876                
     59875
     59876
    5987759877                /**
    5987859878                 * Add a single new row or multiple rows of data to the table. Please note
     
    5991659916                {
    5991759917                        var api = this.api( true );
    59918                
     59918
    5991959919                        /* Check if we want to add multiple rows or not */
    5992059920                        var rows = $.isArray(data) && ( $.isArray(data[0]) || $.isPlainObject(data[0]) ) ?
    5992159921                                api.rows.add( data ) :
    5992259922                                api.row.add( data );
    59923                
     59923
    5992459924                        if ( redraw === undefined || redraw ) {
    5992559925                                api.draw();
    5992659926                        }
    59927                
     59927
    5992859928                        return rows.flatten().toArray();
    5992959929                };
    59930                
    59931                
     59930
     59931
    5993259932                /**
    5993359933                 * This function will make DataTables recalculate the column sizes, based on the data
     
    5995659956                        var settings = api.settings()[0];
    5995759957                        var scroll = settings.oScroll;
    59958                
     59958
    5995959959                        if ( bRedraw === undefined || bRedraw ) {
    5996059960                                api.draw( false );
     
    5996559965                        }
    5996659966                };
    59967                
    59968                
     59967
     59968
    5996959969                /**
    5997059970                 * Quickly and simply clear a table
     
    5998459984                {
    5998559985                        var api = this.api( true ).clear();
    59986                
     59986
    5998759987                        if ( bRedraw === undefined || bRedraw ) {
    5998859988                                api.draw();
    5998959989                        }
    5999059990                };
    59991                
    59992                
     59991
     59992
    5999359993                /**
    5999459994                 * The exact opposite of 'opening' a row, this function will close any rows which
     
    6001960019                        this.api( true ).row( nTr ).child.hide();
    6002060020                };
    60021                
    60022                
     60021
     60022
    6002360023                /**
    6002460024                 * Remove a row for the table
     
    6004560045                        var settings = rows.settings()[0];
    6004660046                        var data = settings.aoData[ rows[0][0] ];
    60047                
     60047
    6004860048                        rows.remove();
    60049                
     60049
    6005060050                        if ( callback ) {
    6005160051                                callback.call( this, settings, data );
    6005260052                        }
    60053                
     60053
    6005460054                        if ( redraw === undefined || redraw ) {
    6005560055                                api.draw();
    6005660056                        }
    60057                
     60057
    6005860058                        return data;
    6005960059                };
    60060                
    60061                
     60060
     60061
    6006260062                /**
    6006360063                 * Restore the table to it's original state in the DOM by removing all of DataTables
     
    6007860078                        this.api( true ).destroy( remove );
    6007960079                };
    60080                
    60081                
     60080
     60081
    6008260082                /**
    6008360083                 * Redraw the table
     
    6010060100                        this.api( true ).draw( complete );
    6010160101                };
    60102                
    60103                
     60102
     60103
    6010460104                /**
    6010560105                 * Filter the input based on data
     
    6012460124                {
    6012560125                        var api = this.api( true );
    60126                
     60126
    6012760127                        if ( iColumn === null || iColumn === undefined ) {
    6012860128                                api.search( sInput, bRegex, bSmart, bCaseInsensitive );
     
    6013160131                                api.column( iColumn ).search( sInput, bRegex, bSmart, bCaseInsensitive );
    6013260132                        }
    60133                
     60133
    6013460134                        api.draw();
    6013560135                };
    60136                
    60137                
     60136
     60137
    6013860138                /**
    6013960139                 * Get the data for the whole table, an individual row or an individual cell based on the
     
    6017660176                {
    6017760177                        var api = this.api( true );
    60178                
     60178
    6017960179                        if ( src !== undefined ) {
    6018060180                                var type = src.nodeName ? src.nodeName.toLowerCase() : '';
    60181                
     60181
    6018260182                                return col !== undefined || type == 'td' || type == 'th' ?
    6018360183                                        api.cell( src, col ).data() :
    6018460184                                        api.row( src ).data() || null;
    6018560185                        }
    60186                
     60186
    6018760187                        return api.data().toArray();
    6018860188                };
    60189                
    60190                
     60189
     60190
    6019160191                /**
    6019260192                 * Get an array of the TR nodes that are used in the table's body. Note that you will
     
    6021060210                {
    6021160211                        var api = this.api( true );
    60212                
     60212
    6021360213                        return iRow !== undefined ?
    6021460214                                api.row( iRow ).node() :
    6021560215                                api.rows().nodes().flatten().toArray();
    6021660216                };
    60217                
    60218                
     60217
     60218
    6021960219                /**
    6022060220                 * Get the array indexes of a particular cell from it's DOM element
     
    6024960249                        var api = this.api( true );
    6025060250                        var nodeName = node.nodeName.toUpperCase();
    60251                
     60251
    6025260252                        if ( nodeName == 'TR' ) {
    6025360253                                return api.row( node ).index();
     
    6025560255                        else if ( nodeName == 'TD' || nodeName == 'TH' ) {
    6025660256                                var cell = api.cell( node ).index();
    60257                
     60257
    6025860258                                return [
    6025960259                                        cell.row,
     
    6026460264                        return null;
    6026560265                };
    60266                
    60267                
     60266
     60267
    6026860268                /**
    6026960269                 * Check to see if a row is 'open' or not.
     
    6029360293                        return this.api( true ).row( nTr ).child.isShown();
    6029460294                };
    60295                
    60296                
     60295
     60296
    6029760297                /**
    6029860298                 * This function will place a new row directly after a row which is currently
     
    6033360333                                .child()[0];
    6033460334                };
    60335                
    60336                
     60335
     60336
    6033760337                /**
    6033860338                 * Change the pagination - provides the internal logic for pagination in a simple API
     
    6035460354                {
    6035560355                        var api = this.api( true ).page( mAction );
    60356                
     60356
    6035760357                        if ( bRedraw === undefined || bRedraw ) {
    6035860358                                api.draw(false);
    6035960359                        }
    6036060360                };
    60361                
    60362                
     60361
     60362
    6036360363                /**
    6036460364                 * Show a particular column
     
    6038060380                {
    6038160381                        var api = this.api( true ).column( iCol ).visible( bShow );
    60382                
     60382
    6038360383                        if ( bRedraw === undefined || bRedraw ) {
    6038460384                                api.columns.adjust().draw();
    6038560385                        }
    6038660386                };
    60387                
    60388                
     60387
     60388
    6038960389                /**
    6039060390                 * Get the settings for a particular table for external manipulation
     
    6040760407                        return _fnSettingsFromNode( this[_ext.iApiIndex] );
    6040860408                };
    60409                
    60410                
     60409
     60410
    6041160411                /**
    6041260412                 * Sort the table by a particular column
     
    6042860428                        this.api( true ).order( aaSort ).draw();
    6042960429                };
    60430                
    60431                
     60430
     60431
    6043260432                /**
    6043360433                 * Attach a sort listener to an element for a given column
     
    6045060450                        this.api( true ).order.listener( nNode, iColumn, fnCallback );
    6045160451                };
    60452                
    60453                
     60452
     60453
    6045460454                /**
    6045560455                 * Update a table cell or row - this method will accept either a single value to
     
    6047760477                {
    6047860478                        var api = this.api( true );
    60479                
     60479
    6048060480                        if ( iColumn === undefined || iColumn === null ) {
    6048160481                                api.row( mRow ).data( mData );
     
    6048460484                                api.cell( mRow, iColumn ).data( mData );
    6048560485                        }
    60486                
     60486
    6048760487                        if ( bAction === undefined || bAction ) {
    6048860488                                api.columns.adjust();
    6048960489                        }
    60490                
     60490
    6049160491                        if ( bRedraw === undefined || bRedraw ) {
    6049260492                                api.draw();
     
    6049460494                        return 0;
    6049560495                };
    60496                
    60497                
     60496
     60497
    6049860498                /**
    6049960499                 * Provide a common method for plug-ins to check the version of DataTables being used, in order
     
    6051460514                 */
    6051560515                this.fnVersionCheck = _ext.fnVersionCheck;
    60516                
     60516
    6051760517
    6051860518                var _that = this;
     
    6054760547                        var defaults = DataTable.defaults;
    6054860548                        var $this = $(this);
    60549                        
    60550                        
     60549
     60550
    6055160551                        /* Sanity check */
    6055260552                        if ( this.nodeName.toLowerCase() != 'table' )
     
    6055560555                                return;
    6055660556                        }
    60557                        
     60557
    6055860558                        /* Backwards compatibility for the defaults */
    6055960559                        _fnCompatOpts( defaults );
    6056060560                        _fnCompatCols( defaults.column );
    60561                        
     60561
    6056260562                        /* Convert the camel-case defaults to Hungarian */
    6056360563                        _fnCamelToHungarian( defaults, defaults, true );
    6056460564                        _fnCamelToHungarian( defaults.column, defaults.column, true );
    60565                        
     60565
    6056660566                        /* Setting up the initialisation object */
    6056760567                        _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ), true );
    60568                        
    60569                        
    60570                        
     60568
     60569
     60570
    6057160571                        /* Check to see if we are re-initialising a table */
    6057260572                        var allSettings = DataTable.settings;
     
    6057460574                        {
    6057560575                                var s = allSettings[i];
    60576                        
     60576
    6057760577                                /* Base check on table node */
    6057860578                                if (
     
    6058360583                                        var bRetrieve = oInit.bRetrieve !== undefined ? oInit.bRetrieve : defaults.bRetrieve;
    6058460584                                        var bDestroy = oInit.bDestroy !== undefined ? oInit.bDestroy : defaults.bDestroy;
    60585                        
     60585
    6058660586                                        if ( emptyInit || bRetrieve )
    6058760587                                        {
     
    6059960599                                        }
    6060060600                                }
    60601                        
     60601
    6060260602                                /* If the element we are initialising has the same ID as a table which was previously
    6060360603                                 * initialised, but the table nodes don't match (from before) then we destroy the old
     
    6061160611                                }
    6061260612                        }
    60613                        
     60613
    6061460614                        /* Ensure the table has an ID - required for accessibility */
    6061560615                        if ( sId === null || sId === "" )
     
    6061860618                                this.id = sId;
    6061960619                        }
    60620                        
     60620
    6062160621                        /* Create the settings object for this table and set some of the default parameters */
    6062260622                        var oSettings = $.extend( true, {}, DataTable.models.oSettings, {
     
    6062860628                        oSettings.oApi   = _that.internal;
    6062960629                        oSettings.oInit  = oInit;
    60630                        
     60630
    6063160631                        allSettings.push( oSettings );
    60632                        
     60632
    6063360633                        // Need to add the instance after the instance after the settings object has been added
    6063460634                        // to the settings array, so we can self reference the table instance if more than one
    6063560635                        oSettings.oInstance = (_that.length===1) ? _that : $this.dataTable();
    60636                        
     60636
    6063760637                        // Backwards compatibility, before we apply all the defaults
    6063860638                        _fnCompatOpts( oInit );
    6063960639                        _fnLanguageCompat( oInit.oLanguage );
    60640                        
     60640
    6064160641                        // If the length menu is given, but the init display length is not, use the length menu
    6064260642                        if ( oInit.aLengthMenu && ! oInit.iDisplayLength )
     
    6064560645                                        oInit.aLengthMenu[0][0] : oInit.aLengthMenu[0];
    6064660646                        }
    60647                        
     60647
    6064860648                        // Apply the defaults and init options to make a single init object will all
    6064960649                        // options defined from defaults and instance options.
    6065060650                        oInit = _fnExtend( $.extend( true, {}, defaults ), oInit );
    60651                        
    60652                        
     60651
     60652
    6065360653                        // Map the initialisation options onto the settings object
    6065460654                        _fnMap( oSettings.oFeatures, oInit, [
     
    6069860698                        ] );
    6069960699                        _fnMap( oSettings.oLanguage, oInit, "fnInfoCallback" );
    60700                        
     60700
    6070160701                        /* Callback functions which are array driven */
    6070260702                        _fnCallbackReg( oSettings, 'aoDrawCallback',       oInit.fnDrawCallback,      'user' );
     
    6071160711                        _fnCallbackReg( oSettings, 'aoInitComplete',       oInit.fnInitComplete,      'user' );
    6071260712                        _fnCallbackReg( oSettings, 'aoPreDrawCallback',    oInit.fnPreDrawCallback,   'user' );
    60713                        
     60713
    6071460714                        oSettings.rowIdFn = _fnGetObjectDataFn( oInit.rowId );
    60715                        
     60715
    6071660716                        /* Browser support detection */
    6071760717                        _fnBrowserDetect( oSettings );
    60718                        
     60718
    6071960719                        var oClasses = oSettings.oClasses;
    60720                        
     60720
    6072160721                        $.extend( oClasses, DataTable.ext.classes, oInit.oClasses );
    6072260722                        $this.addClass( oClasses.sTable );
    60723                        
    60724                        
     60723
     60724
    6072560725                        if ( oSettings.iInitDisplayStart === undefined )
    6072660726                        {
     
    6072960729                                oSettings._iDisplayStart = oInit.iDisplayStart;
    6073060730                        }
    60731                        
     60731
    6073260732                        if ( oInit.iDeferLoading !== null )
    6073360733                        {
     
    6073760737                                oSettings._iRecordsTotal = tmp ? oInit.iDeferLoading[1] : oInit.iDeferLoading;
    6073860738                        }
    60739                        
     60739
    6074060740                        /* Language definitions */
    6074160741                        var oLanguage = oSettings.oLanguage;
    6074260742                        $.extend( true, oLanguage, oInit.oLanguage );
    60743                        
     60743
    6074460744                        if ( oLanguage.sUrl )
    6074560745                        {
     
    6076460764                                bInitHandedOff = true;
    6076560765                        }
    60766                        
     60766
    6076760767                        /*
    6076860768                         * Stripes
     
    6077560775                                ];
    6077660776                        }
    60777                        
     60777
    6077860778                        /* Remove row stripe classes if they are already on the table row */
    6077960779                        var stripeClasses = oSettings.asStripeClasses;
     
    6078560785                                oSettings.asDestroyStripes = stripeClasses.slice();
    6078660786                        }
    60787                        
     60787
    6078860788                        /*
    6078960789                         * Columns
     
    6079860798                                anThs = _fnGetUniqueThs( oSettings );
    6079960799                        }
    60800                        
     60800
    6080160801                        /* If not given a column array, generate one with nulls */
    6080260802                        if ( oInit.aoColumns === null )
     
    6081260812                                aoColumnsInit = oInit.aoColumns;
    6081360813                        }
    60814                        
     60814
    6081560815                        /* Add the columns */
    6081660816                        for ( i=0, iLen=aoColumnsInit.length ; i<iLen ; i++ )
     
    6081860818                                _fnAddColumn( oSettings, anThs ? anThs[i] : null );
    6081960819                        }
    60820                        
     60820
    6082160821                        /* Apply the column definitions */
    6082260822                        _fnApplyColumnDefs( oSettings, oInit.aoColumnDefs, aoColumnsInit, function (iCol, oDef) {
    6082360823                                _fnColumnOptions( oSettings, iCol, oDef );
    6082460824                        } );
    60825                        
     60825
    6082660826                        /* HTML5 attribute detection - build an mData object automatically if the
    6082760827                         * attributes are found
     
    6083160831                                        return cell.getAttribute( 'data-'+name ) !== null ? name : null;
    6083260832                                };
    60833                        
     60833
    6083460834                                $( rowOne[0] ).children('th, td').each( function (i, cell) {
    6083560835                                        var col = oSettings.aoColumns[i];
    60836                        
     60836
    6083760837                                        if ( col.mData === i ) {
    6083860838                                                var sort = a( cell, 'sort' ) || a( cell, 'order' );
    6083960839                                                var filter = a( cell, 'filter' ) || a( cell, 'search' );
    60840                        
     60840
    6084160841                                                if ( sort !== null || filter !== null ) {
    6084260842                                                        col.mData = {
     
    6084660846                                                                filter: filter !== null ? i+'.@data-'+filter : undefined
    6084760847                                                        };
    60848                        
     60848
    6084960849                                                        _fnColumnOptions( oSettings, i );
    6085060850                                                }
     
    6085260852                                } );
    6085360853                        }
    60854                        
     60854
    6085560855                        var features = oSettings.oFeatures;
    6085660856                        var loadedInit = function () {
     
    6085960859                                 * @todo For modularisation (1.11) this needs to do into a sort start up handler
    6086060860                                 */
    60861                        
     60861
    6086260862                                // If aaSorting is not defined, then we use the first indicator in asSorting
    6086360863                                // in case that has been altered, so the default sort reflects that option
     
    6086860868                                        }
    6086960869                                }
    60870                        
     60870
    6087160871                                /* Do a first pass on the sorting classes (allows any size changes to be taken into
    6087260872                                 * account, and also will apply sorting disabled classes if disabled
    6087360873                                 */
    6087460874                                _fnSortingClasses( oSettings );
    60875                        
     60875
    6087660876                                if ( features.bSort ) {
    6087760877                                        _fnCallbackReg( oSettings, 'aoDrawCallback', function () {
     
    6087960879                                                        var aSort = _fnSortFlatten( oSettings );
    6088060880                                                        var sortedColumns = {};
    60881                        
     60881
    6088260882                                                        $.each( aSort, function (i, val) {
    6088360883                                                                sortedColumns[ val.src ] = val.dir;
    6088460884                                                        } );
    60885                        
     60885
    6088660886                                                        _fnCallbackFire( oSettings, null, 'order', [oSettings, aSort, sortedColumns] );
    6088760887                                                        _fnSortAria( oSettings );
     
    6088960889                                        } );
    6089060890                                }
    60891                        
     60891
    6089260892                                _fnCallbackReg( oSettings, 'aoDrawCallback', function () {
    6089360893                                        if ( oSettings.bSorted || _fnDataSource( oSettings ) === 'ssp' || features.bDeferRender ) {
     
    6089560895                                        }
    6089660896                                }, 'sc' );
    60897                        
    60898                        
     60897
     60898
    6089960899                                /*
    6090060900                                 * Final init
    6090160901                                 * Cache the header, body and footer as required, creating them if needed
    6090260902                                 */
    60903                        
     60903
    6090460904                                // Work around for Webkit bug 83867 - store the caption-side before removing from doc
    6090560905                                var captions = $this.children('caption').each( function () {
    6090660906                                        this._captionSide = $(this).css('caption-side');
    6090760907                                } );
    60908                        
     60908
    6090960909                                var thead = $this.children('thead');
    6091060910                                if ( thead.length === 0 ) {
     
    6091260912                                }
    6091360913                                oSettings.nTHead = thead[0];
    60914                        
     60914
    6091560915                                var tbody = $this.children('tbody');
    6091660916                                if ( tbody.length === 0 ) {
     
    6091860918                                }
    6091960919                                oSettings.nTBody = tbody[0];
    60920                        
     60920
    6092160921                                var tfoot = $this.children('tfoot');
    6092260922                                if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") ) {
     
    6092560925                                        tfoot = $('<tfoot/>').appendTo($this);
    6092660926                                }
    60927                        
     60927
    6092860928                                if ( tfoot.length === 0 || tfoot.children().length === 0 ) {
    6092960929                                        $this.addClass( oClasses.sNoFooter );
     
    6093360933                                        _fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot );
    6093460934                                }
    60935                        
     60935
    6093660936                                /* Check if there is data passing into the constructor */
    6093760937                                if ( oInit.aaData ) {
     
    6094760947                                        _fnAddTr( oSettings, $(oSettings.nTBody).children('tr') );
    6094860948                                }
    60949                        
     60949
    6095060950                                /* Copy the data index array */
    6095160951                                oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
    60952                        
     60952
    6095360953                                /* Initialisation complete - table can be drawn */
    6095460954                                oSettings.bInitialised = true;
    60955                        
     60955
    6095660956                                /* Check if we need to initialise the table (it might not have been handed off to the
    6095760957                                 * language processor)
     
    6096160961                                }
    6096260962                        };
    60963                        
     60963
    6096460964                        /* Must be done after everything which can be overridden by the state saving! */
    6096560965                        if ( oInit.bStateSave )
     
    6097260972                                loadedInit();
    6097360973                        }
    60974                        
     60974
    6097560975                } );
    6097660976                _that = null;
     
    6097860978        };
    6097960979
    60980        
     60980
    6098160981        /*
    6098260982         * It is useful to have variables which are scoped locally so only the
     
    6098760987         * clashing of variable names and that they can easily referenced for reuse.
    6098860988         */
    60989        
    60990        
     60989
     60990
    6099160991        // Defined else where
    6099260992        //  _selector_run
     
    6099460994        //  _selector_first
    6099560995        //  _selector_row_indexes
    60996        
     60996
    6099760997        var _ext; // DataTable.ext
    6099860998        var _Api; // DataTable.Api
    6099960999        var _api_register; // DataTable.Api.register
    6100061000        var _api_registerPlural; // DataTable.Api.registerPlural
    61001        
     61001
    6100261002        var _re_dic = {};
    6100361003        var _re_new_lines = /[\r\n\u2028]/g;
    6100461004        var _re_html = /<.*?>/g;
    61005        
     61005
    6100661006        // This is not strict ISO8601 - Date.parse() is quite lax, although
    6100761007        // implementations differ between browsers.
    6100861008        var _re_date = /^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/;
    61009        
     61009
    6101061010        // Escape regular expression special characters
    6101161011        var _re_escape_regex = new RegExp( '(\\' + [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ].join('|\\') + ')', 'g' );
    61012        
     61012
    6101361013        // http://en.wikipedia.org/wiki/Foreign_exchange_market
    6101461014        // - \u20BD - Russian ruble.
     
    6102461024        //   standards as thousands separators.
    6102561025        var _re_formatted_numeric = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi;
    61026        
    61027        
     61026
     61027
    6102861028        var _empty = function ( d ) {
    6102961029                return !d || d === true || d === '-' ? true : false;
    6103061030        };
    61031        
    61032        
     61031
     61032
    6103361033        var _intVal = function ( s ) {
    6103461034                var integer = parseInt( s, 10 );
    6103561035                return !isNaN(integer) && isFinite(s) ? integer : null;
    6103661036        };
    61037        
     61037
    6103861038        // Convert from a formatted number with characters other than `.` as the
    6103961039        // decimal place, to a Javascript number
     
    6104761047                        num;
    6104861048        };
    61049        
    61050        
     61049
     61050
    6105161051        var _isNumber = function ( d, decimalPoint, formatted ) {
    6105261052                var strType = typeof d === 'string';
    61053        
     61053
    6105461054                // If empty return immediately so there must be a number if it is a
    6105561055                // formatted string (this stops the string "k", or "kr", etc being detected
     
    6105861058                        return true;
    6105961059                }
    61060        
     61060
    6106161061                if ( decimalPoint && strType ) {
    6106261062                        d = _numToDecimal( d, decimalPoint );
    6106361063                }
    61064        
     61064
    6106561065                if ( formatted && strType ) {
    6106661066                        d = d.replace( _re_formatted_numeric, '' );
    6106761067                }
    61068        
     61068
    6106961069                return !isNaN( parseFloat(d) ) && isFinite( d );
    6107061070        };
    61071        
    61072        
     61071
     61072
    6107361073        // A string without HTML in it can be considered to be HTML still
    6107461074        var _isHtml = function ( d ) {
    6107561075                return _empty( d ) || typeof d === 'string';
    6107661076        };
    61077        
    61078        
     61077
     61078
    6107961079        var _htmlNumeric = function ( d, decimalPoint, formatted ) {
    6108061080                if ( _empty( d ) ) {
    6108161081                        return true;
    6108261082                }
    61083        
     61083
    6108461084                var html = _isHtml( d );
    6108561085                return ! html ?
     
    6108961089                                null;
    6109061090        };
    61091        
    61092        
     61091
     61092
    6109361093        var _pluck = function ( a, prop, prop2 ) {
    6109461094                var out = [];
    6109561095                var i=0, ien=a.length;
    61096        
     61096
    6109761097                // Could have the test in the loop for slightly smaller code, but speed
    6109861098                // is essential here
     
    6111161111                        }
    6111261112                }
    61113        
     61113
    6111461114                return out;
    6111561115        };
    61116        
    61117        
     61116
     61117
    6111861118        // Basically the same as _pluck, but rather than looping over `a` we use `order`
    6111961119        // as the indexes to pick from `a`
     
    6112261122                var out = [];
    6112361123                var i=0, ien=order.length;
    61124        
     61124
    6112561125                // Could have the test in the loop for slightly smaller code, but speed
    6112661126                // is essential here
     
    6113761137                        }
    6113861138                }
    61139        
     61139
    6114061140                return out;
    6114161141        };
    61142        
    61143        
     61142
     61143
    6114461144        var _range = function ( len, start )
    6114561145        {
    6114661146                var out = [];
    6114761147                var end;
    61148        
     61148
    6114961149                if ( start === undefined ) {
    6115061150                        start = 0;
     
    6115561155                        start = len;
    6115661156                }
    61157        
     61157
    6115861158                for ( var i=start ; i<end ; i++ ) {
    6115961159                        out.push( i );
    6116061160                }
    61161        
     61161
    6116261162                return out;
    6116361163        };
    61164        
    61165        
     61164
     61165
    6116661166        var _removeEmpty = function ( a )
    6116761167        {
    6116861168                var out = [];
    61169        
     61169
    6117061170                for ( var i=0, ien=a.length ; i<ien ; i++ ) {
    6117161171                        if ( a[i] ) { // careful - will remove all falsy values!
     
    6117361173                        }
    6117461174                }
    61175        
     61175
    6117661176                return out;
    6117761177        };
    61178        
    61179        
     61178
     61179
    6118061180        var _stripHtml = function ( d ) {
    6118161181                return d.replace( _re_html, '' );
    6118261182        };
    61183        
    61184        
     61183
     61184
    6118561185        /**
    6118661186         * Determine if all values in the array are unique. This means we can short
     
    6119661196                        return true;
    6119761197                }
    61198        
     61198
    6119961199                var sorted = src.slice().sort();
    6120061200                var last = sorted[0];
    61201        
     61201
    6120261202                for ( var i=1, ien=sorted.length ; i<ien ; i++ ) {
    6120361203                        if ( sorted[i] === last ) {
    6120461204                                return false;
    6120561205                        }
    61206        
     61206
    6120761207                        last = sorted[i];
    6120861208                }
    61209        
     61209
    6121061210                return true;
    6121161211        };
    61212        
    61213        
     61212
     61213
    6121461214        /**
    6121561215         * Find the unique elements in a source array.
     
    6122461224                        return src.slice();
    6122561225                }
    61226        
     61226
    6122761227                // A faster unique method is to use object keys to identify used values,
    6122861228                // but this doesn't work with arrays or objects, which we must also
     
    6123461234                        i, ien=src.length,
    6123561235                        j, k=0;
    61236        
     61236
    6123761237                again: for ( i=0 ; i<ien ; i++ ) {
    6123861238                        val = src[i];
    61239        
     61239
    6124061240                        for ( j=0 ; j<k ; j++ ) {
    6124161241                                if ( out[j] === val ) {
     
    6124361243                                }
    6124461244                        }
    61245        
     61245
    6124661246                        out.push( val );
    6124761247                        k++;
    6124861248                }
    61249        
     61249
    6125061250                return out;
    6125161251        };
    61252        
    61253        
     61252
     61253
    6125461254        /**
    6125561255         * DataTables utility methods
    61256          * 
     61256         *
    6125761257         * This namespace provides helper methods that DataTables uses internally to
    6125861258         * create a DataTable, but which are not exclusively used only for DataTables.
     
    6127661276                                last,
    6127761277                                timer;
    61278        
     61278
    6127961279                        return function () {
    6128061280                                var
     
    6128261282                                        now  = +new Date(),
    6128361283                                        args = arguments;
    61284        
     61284
    6128561285                                if ( last && now < last + frequency ) {
    6128661286                                        clearTimeout( timer );
    61287        
     61287
    6128861288                                        timer = setTimeout( function () {
    6128961289                                                last = undefined;
     
    6129761297                        };
    6129861298                },
    61299        
    61300        
     61299
     61300
    6130161301                /**
    6130261302                 * Escape a string such that it can be used in a regular expression
     
    6130961309                }
    6131061310        };
    61311        
    61312        
    61313        
     61311
     61312
     61313
    6131461314        /**
    6131561315         * Create a mapping object that allows camel case parameters to be looked up
     
    6132661326                        newKey,
    6132761327                        map = {};
    61328        
     61328
    6132961329                $.each( o, function (key, val) {
    6133061330                        match = key.match(/^([^A-Z]+?)([A-Z])/);
    61331        
     61331
    6133261332                        if ( match && hungarian.indexOf(match[1]+' ') !== -1 )
    6133361333                        {
    6133461334                                newKey = key.replace( match[0], match[2].toLowerCase() );
    6133561335                                map[ newKey ] = key;
    61336        
     61336
    6133761337                                if ( match[1] === 'o' )
    6133861338                                {
     
    6134161341                        }
    6134261342                } );
    61343        
     61343
    6134461344                o._hungarianMap = map;
    6134561345        }
    61346        
    61347        
     61346
     61347
    6134861348        /**
    6134961349         * Convert from camel case parameters to Hungarian, based on a Hungarian map
     
    6136261362                        _fnHungarianMap( src );
    6136361363                }
    61364        
     61364
    6136561365                var hungarianKey;
    61366        
     61366
    6136761367                $.each( user, function (key, val) {
    6136861368                        hungarianKey = src._hungarianMap[ key ];
    61369        
     61369
    6137061370                        if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )
    6137161371                        {
     
    6137861378                                        }
    6137961379                                        $.extend( true, user[hungarianKey], user[key] );
    61380        
     61380
    6138161381                                        _fnCamelToHungarian( src[hungarianKey], user[hungarianKey], force );
    6138261382                                }
     
    6138761387                } );
    6138861388        }
    61389        
    61390        
     61389
     61390
    6139161391        /**
    6139261392         * Language compatibility - when certain options are given, and others aren't, we
     
    6140161401                // this is called after the mapping of camelCase to Hungarian
    6140261402                var defaults = DataTable.defaults.oLanguage;
    61403        
     61403
    6140461404                // Default mapping
    6140561405                var defaultDecimal = defaults.sDecimal;
     
    6140761407                        _addNumericSort( defaultDecimal );
    6140861408                }
    61409        
     61409
    6141061410                if ( lang ) {
    6141161411                        var zeroRecords = lang.sZeroRecords;
    61412        
     61412
    6141361413                        // Backwards compatibility - if there is no sEmptyTable given, then use the same as
    6141461414                        // sZeroRecords - assuming that is given.
     
    6141861418                                _fnMap( lang, lang, 'sZeroRecords', 'sEmptyTable' );
    6141961419                        }
    61420        
     61420
    6142161421                        // Likewise with loading records
    6142261422                        if ( ! lang.sLoadingRecords && zeroRecords &&
     
    6142561425                                _fnMap( lang, lang, 'sZeroRecords', 'sLoadingRecords' );
    6142661426                        }
    61427        
     61427
    6142861428                        // Old parameter name of the thousands separator mapped onto the new
    6142961429                        if ( lang.sInfoThousands ) {
    6143061430                                lang.sThousands = lang.sInfoThousands;
    6143161431                        }
    61432        
     61432
    6143361433                        var decimal = lang.sDecimal;
    6143461434                        if ( decimal && defaultDecimal !== decimal ) {
     
    6143761437                }
    6143861438        }
    61439        
    61440        
     61439
     61440
    6144161441        /**
    6144261442         * Map one parameter onto another
     
    6145061450                }
    6145161451        };
    61452        
    61453        
     61452
     61453
    6145461454        /**
    6145561455         * Provide backwards compatibility for the main DT options. Note that the new
     
    6147061470                _fnCompatMap( init, 'pageLength',    'iDisplayLength' );
    6147161471                _fnCompatMap( init, 'searching',     'bFilter' );
    61472        
     61472
    6147361473                // Boolean initialisation of x-scrolling
    6147461474                if ( typeof init.sScrollX === 'boolean' ) {
     
    6147861478                        init.scrollX = init.scrollX ? '100%' : '';
    6147961479                }
    61480        
     61480
    6148161481                // Column search objects are in an array, so it needs to be converted
    6148261482                // element by element
    6148361483                var searchCols = init.aoSearchCols;
    61484        
     61484
    6148561485                if ( searchCols ) {
    6148661486                        for ( var i=0, ien=searchCols.length ; i<ien ; i++ ) {
     
    6149161491                }
    6149261492        }
    61493        
    61494        
     61493
     61494
    6149561495        /**
    6149661496         * Provide backwards compatibility for column options. Note that the new options
     
    6150561505                _fnCompatMap( init, 'orderSequence', 'asSorting' );
    6150661506                _fnCompatMap( init, 'orderDataType', 'sortDataType' );
    61507        
     61507
    6150861508                // orderData can be given as an integer
    6150961509                var dataSort = init.aDataSort;
     
    6151261512                }
    6151361513        }
    61514        
    61515        
     61514
     61515
    6151661516        /**
    6151761517         * Browser feature detection for capabilities, quirks
     
    6152761527                        var browser = {};
    6152861528                        DataTable.__browser = browser;
    61529        
     61529
    6153061530                        // Scrolling feature / quirks detection
    6153161531                        var n = $('<div/>')
     
    6155661556                                )
    6155761557                                .appendTo( 'body' );
    61558        
     61558
    6155961559                        var outer = n.children();
    6156061560                        var inner = outer.children();
    61561        
     61561
    6156261562                        // Numbers below, in order, are:
    6156361563                        // inner.offsetWidth, inner.clientWidth, outer.offsetWidth, outer.clientWidth
     
    6156961569                        // Evergreen Mac with scrollbars:     85  85 100  85
    6157061570                        // Evergreen Mac without scrollbars: 100 100 100 100
    61571        
     61571
    6157261572                        // Get scrollbar width
    6157361573                        browser.barWidth = outer[0].offsetWidth - outer[0].clientWidth;
    61574        
     61574
    6157561575                        // IE6/7 will oversize a width 100% element inside a scrolling element, to
    6157661576                        // include the width of the scrollbar, while other browsers ensure the inner
    6157761577                        // element is contained without forcing scrolling
    6157861578                        browser.bScrollOversize = inner[0].offsetWidth === 100 && outer[0].clientWidth !== 100;
    61579        
     61579
    6158061580                        // In rtl text layout, some browsers (most, but not all) will place the
    6158161581                        // scrollbar on the left, rather than the right.
    6158261582                        browser.bScrollbarLeft = Math.round( inner.offset().left ) !== 1;
    61583        
     61583
    6158461584                        // IE8- don't provide height and width for getBoundingClientRect
    6158561585                        browser.bBounding = n[0].getBoundingClientRect().width ? true : false;
    61586        
     61586
    6158761587                        n.remove();
    6158861588                }
    61589        
     61589
    6159061590                $.extend( settings.oBrowser, DataTable.__browser );
    6159161591                settings.oScroll.iBarWidth = DataTable.__browser.barWidth;
    6159261592        }
    61593        
    61594        
     61593
     61594
    6159561595        /**
    6159661596         * Array.prototype reduce[Right] method, used for browsers which don't support
     
    6160561605                        value,
    6160661606                        isSet = false;
    61607        
     61607
    6160861608                if ( init !== undefined ) {
    6160961609                        value = init;
    6161061610                        isSet = true;
    6161161611                }
    61612        
     61612
    6161361613                while ( i !== end ) {
    6161461614                        if ( ! that.hasOwnProperty(i) ) {
    6161561615                                continue;
    6161661616                        }
    61617        
     61617
    6161861618                        value = isSet ?
    6161961619                                fn( value, that[i], i, that ) :
    6162061620                                that[i];
    61621        
     61621
    6162261622                        isSet = true;
    6162361623                        i += inc;
    6162461624                }
    61625        
     61625
    6162661626                return value;
    6162761627        }
    61628        
     61628
    6162961629        /**
    6163061630         * Add a column to the list used for the table with default values
     
    6164661646                } );
    6164761647                oSettings.aoColumns.push( oCol );
    61648        
     61648
    6164961649                // Add search object for column specific search. Note that the `searchCols[ iCol ]`
    6165061650                // passed into extend can be undefined. This allows the user to give a default
     
    6165261652                var searchCols = oSettings.aoPreSearchCols;
    6165361653                searchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch, searchCols[ iCol ] );
    61654        
     61654
    6165561655                // Use the default column options function to initialise classes etc
    6165661656                _fnColumnOptions( oSettings, iCol, $(nTh).data() );
    6165761657        }
    61658        
    61659        
     61658
     61659
    6166061660        /**
    6166161661         * Apply options for a column
     
    6167061670                var oClasses = oSettings.oClasses;
    6167161671                var th = $(oCol.nTh);
    61672        
     61672
    6167361673                // Try to get width information from the DOM. We can't get it from CSS
    6167461674                // as we'd need to parse the CSS stylesheet. `width` option can override
     
    6167661676                        // Width attribute
    6167761677                        oCol.sWidthOrig = th.attr('width') || null;
    61678        
     61678
    6167961679                        // Style attribute
    6168061680                        var t = (th.attr('style') || '').match(/width:\s*(\d+[pxem%]+)/);
     
    6168361683                        }
    6168461684                }
    61685        
     61685
    6168661686                /* User specified column options */
    6168761687                if ( oOptions !== undefined && oOptions !== null )
     
    6168961689                        // Backwards compatibility
    6169061690                        _fnCompatCols( oOptions );
    61691        
     61691
    6169261692                        // Map camel case parameters to their Hungarian counterparts
    6169361693                        _fnCamelToHungarian( DataTable.defaults.column, oOptions, true );
    61694        
     61694
    6169561695                        /* Backwards compatibility for mDataProp */
    6169661696                        if ( oOptions.mDataProp !== undefined && !oOptions.mData )
     
    6169861698                                oOptions.mData = oOptions.mDataProp;
    6169961699                        }
    61700        
     61700
    6170161701                        if ( oOptions.sType )
    6170261702                        {
    6170361703                                oCol._sManualType = oOptions.sType;
    6170461704                        }
    61705        
     61705
    6170661706                        // `class` is a reserved word in Javascript, so we need to provide
    6170761707                        // the ability to use a valid name for the camel case input
     
    6171361713                                th.addClass( oOptions.sClass );
    6171461714                        }
    61715        
     61715
    6171661716                        $.extend( oCol, oOptions );
    6171761717                        _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );
    61718        
     61718
    6171961719                        /* iDataSort to be applied (backwards compatibility), but aDataSort will take
    6172061720                         * priority if defined
     
    6172661726                        _fnMap( oCol, oOptions, "aDataSort" );
    6172761727                }
    61728        
     61728
    6172961729                /* Cache the data get and set functions for speed */
    6173061730                var mDataSrc = oCol.mData;
    6173161731                var mData = _fnGetObjectDataFn( mDataSrc );
    6173261732                var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;
    61733        
     61733
    6173461734                var attrTest = function( src ) {
    6173561735                        return typeof src === 'string' && src.indexOf('@') !== -1;
     
    6173961739                );
    6174061740                oCol._setter = null;
    61741        
     61741
    6174261742                oCol.fnGetData = function (rowData, type, meta) {
    6174361743                        var innerData = mData( rowData, type, undefined, meta );
    61744        
     61744
    6174561745                        return mRender && type ?
    6174661746                                mRender( innerData, type, rowData, meta ) :
     
    6175061750                        return _fnSetObjectDataFn( mDataSrc )( rowData, val, meta );
    6175161751                };
    61752        
     61752
    6175361753                // Indicate if DataTables should read DOM data as an object or array
    6175461754                // Used in _fnGetRowElements
     
    6175661756                        oSettings._rowReadObject = true;
    6175761757                }
    61758        
     61758
    6175961759                /* Feature sorting overrides column specific when off */
    6176061760                if ( !oSettings.oFeatures.bSort )
     
    6176361763                        th.addClass( oClasses.sSortableNone ); // Have to add class here as order event isn't called
    6176461764                }
    61765        
     61765
    6176661766                /* Check that the class assignment is correct for sorting */
    6176761767                var bAsc = $.inArray('asc', oCol.asSorting) !== -1;
     
    6178861788                }
    6178961789        }
    61790        
    61791        
     61790
     61791
    6179261792        /**
    6179361793         * Adjust the table column widths for new data. Note: you would probably want to
     
    6180261802                {
    6180361803                        var columns = settings.aoColumns;
    61804        
     61804
    6180561805                        _fnCalculateColumnWidths( settings );
    6180661806                        for ( var i=0 , iLen=columns.length ; i<iLen ; i++ )
     
    6180961809                        }
    6181061810                }
    61811        
     61811
    6181261812                var scroll = settings.oScroll;
    6181361813                if ( scroll.sY !== '' || scroll.sX !== '')
     
    6181561815                        _fnScrollDraw( settings );
    6181661816                }
    61817        
     61817
    6181861818                _fnCallbackFire( settings, null, 'column-sizing', [settings] );
    6181961819        }
    61820        
    61821        
     61820
     61821
    6182261822        /**
    6182361823         * Covert the index of a visible column to the index in the data array (take account
     
    6183161831        {
    6183261832                var aiVis = _fnGetColumns( oSettings, 'bVisible' );
    61833        
     61833
    6183461834                return typeof aiVis[iMatch] === 'number' ?
    6183561835                        aiVis[iMatch] :
    6183661836                        null;
    6183761837        }
    61838        
    61839        
     61838
     61839
    6184061840        /**
    6184161841         * Covert the index of an index in the data array and convert it to the visible
     
    6185061850                var aiVis = _fnGetColumns( oSettings, 'bVisible' );
    6185161851                var iPos = $.inArray( iMatch, aiVis );
    61852        
     61852
    6185361853                return iPos !== -1 ? iPos : null;
    6185461854        }
    61855        
    61856        
     61855
     61856
    6185761857        /**
    6185861858         * Get the number of visible columns
     
    6186461864        {
    6186561865                var vis = 0;
    61866        
     61866
    6186761867                // No reduce in IE8, use a loop for now
    6186861868                $.each( oSettings.aoColumns, function ( i, col ) {
     
    6187161871                        }
    6187261872                } );
    61873        
     61873
    6187461874                return vis;
    6187561875        }
    61876        
    61877        
     61876
     61877
    6187861878        /**
    6187961879         * Get an array of column indexes that match a given property
     
    6188761887        {
    6188861888                var a = [];
    61889        
     61889
    6189061890                $.map( oSettings.aoColumns, function(val, i) {
    6189161891                        if ( val[sParam] ) {
     
    6189361893                        }
    6189461894                } );
    61895        
     61895
    6189661896                return a;
    6189761897        }
    61898        
    61899        
     61898
     61899
    6190061900        /**
    6190161901         * Calculate the 'type' of a column
     
    6191061910                var i, ien, j, jen, k, ken;
    6191161911                var col, cell, detectedType, cache;
    61912        
    61913                 // For each column, spin over the 
     61912
     61913                // For each column, spin over the
    6191461914                for ( i=0, ien=columns.length ; i<ien ; i++ ) {
    6191561915                        col = columns[i];
    6191661916                        cache = [];
    61917        
     61917
    6191861918                        if ( ! col.sType && col._sManualType ) {
    6191961919                                col.sType = col._sManualType;
     
    6192761927                                                        cache[k] = _fnGetCellData( settings, k, i, 'type' );
    6192861928                                                }
    61929        
     61929
    6193061930                                                detectedType = types[j]( cache[k], settings );
    61931        
     61931
    6193261932                                                // If null, then this type can't apply to this column, so
    6193361933                                                // rather than testing all cells, break out. There is an
     
    6193861938                                                        break;
    6193961939                                                }
    61940        
     61940
    6194161941                                                // Only a single match is needed for html type since it is
    6194261942                                                // bottom of the pile and very similar to string
     
    6194561945                                                }
    6194661946                                        }
    61947        
     61947
    6194861948                                        // Type is valid for all data points in the column - use this
    6194961949                                        // type
     
    6195361953                                        }
    6195461954                                }
    61955        
     61955
    6195661956                                // Fall back - if no type was detected, always use string
    6195761957                                if ( ! col.sType ) {
     
    6196161961                }
    6196261962        }
    61963        
    61964        
     61963
     61964
    6196561965        /**
    6196661966         * Take the column definitions and static columns arrays and calculate how
     
    6197861978                var i, iLen, j, jLen, k, kLen, def;
    6197961979                var columns = oSettings.aoColumns;
    61980        
     61980
    6198161981                // Column definitions with aTargets
    6198261982                if ( aoColDefs )
     
    6198661986                        {
    6198761987                                def = aoColDefs[i];
    61988        
     61988
    6198961989                                /* Each definition can target multiple columns, as it is an array */
    6199061990                                var aTargets = def.targets !== undefined ?
    6199161991                                        def.targets :
    6199261992                                        def.aTargets;
    61993        
     61993
    6199461994                                if ( ! $.isArray( aTargets ) )
    6199561995                                {
    6199661996                                        aTargets = [ aTargets ];
    6199761997                                }
    61998        
     61998
    6199961999                                for ( j=0, jLen=aTargets.length ; j<jLen ; j++ )
    6200062000                                {
     
    6200662006                                                        _fnAddColumn( oSettings );
    6200762007                                                }
    62008        
     62008
    6200962009                                                /* Integer, basic index */
    6201062010                                                fn( aTargets[j], def );
     
    6203062030                        }
    6203162031                }
    62032        
     62032
    6203362033                // Statically defined columns array
    6203462034                if ( aoCols )
     
    6204062040                }
    6204162041        }
    62042        
     62042
    6204362043        /**
    6204462044         * Add a data array to the table, creating DOM node etc. This is the parallel to
     
    6206262062                        idx: iRow
    6206362063                } );
    62064        
     62064
    6206562065                oData._aData = aDataIn;
    6206662066                oSettings.aoData.push( oData );
    62067        
     62067
    6206862068                /* Create the cells */
    6206962069                var nTd, sThisType;
    6207062070                var columns = oSettings.aoColumns;
    62071        
     62071
    6207262072                // Invalidate the column types as the new data needs to be revalidated
    6207362073                for ( var i=0, iLen=columns.length ; i<iLen ; i++ )
     
    6207562075                        columns[i].sType = null;
    6207662076                }
    62077        
     62077
    6207862078                /* Add to the display array */
    6207962079                oSettings.aiDisplayMaster.push( iRow );
    62080        
     62080
    6208162081                var id = oSettings.rowIdFn( aDataIn );
    6208262082                if ( id !== undefined ) {
    6208362083                        oSettings.aIds[ id ] = oData;
    6208462084                }
    62085        
     62085
    6208662086                /* Create the DOM information, or register it if already present */
    6208762087                if ( nTr || ! oSettings.oFeatures.bDeferRender )
     
    6208962089                        _fnCreateTr( oSettings, iRow, nTr, anTds );
    6209062090                }
    62091        
     62091
    6209262092                return iRow;
    6209362093        }
    62094        
    62095        
     62094
     62095
    6209662096        /**
    6209762097         * Add one or more TR elements to the table. Generally we'd expect to
     
    6210762107        {
    6210862108                var row;
    62109        
     62109
    6211062110                // Allow an individual node to be passed in
    6211162111                if ( ! (trs instanceof $) ) {
    6211262112                        trs = $(trs);
    6211362113                }
    62114        
     62114
    6211562115                return trs.map( function (i, el) {
    6211662116                        row = _fnGetRowElements( settings, el );
     
    6211862118                } );
    6211962119        }
    62120        
    62121        
     62120
     62121
    6212262122        /**
    6212362123         * Take a TR element and convert it to an index in aoData
     
    6213162131                return (n._DT_RowIndex!==undefined) ? n._DT_RowIndex : null;
    6213262132        }
    62133        
    62134        
     62133
     62134
    6213562135        /**
    6213662136         * Take a TD element and convert it into a column data index (not the visible index)
     
    6214562145                return $.inArray( n, oSettings.aoData[ iRow ].anCells );
    6214662146        }
    62147        
    62148        
     62147
     62148
    6214962149        /**
    6215062150         * Get the data for a given cell from the internal cache, taking into account data mapping
     
    6216762167                        col:      colIdx
    6216862168                } );
    62169        
     62169
    6217062170                if ( cellData === undefined ) {
    6217162171                        if ( settings.iDrawError != draw && defaultContent === null ) {
     
    6217762177                        return defaultContent;
    6217862178                }
    62179        
     62179
    6218062180                // When the data source is null and a specific data type is requested (i.e.
    6218162181                // not the original data), we can use default column data
     
    6218862188                        return cellData.call( rowData );
    6218962189                }
    62190        
     62190
    6219162191                if ( cellData === null && type == 'display' ) {
    6219262192                        return '';
     
    6219462194                return cellData;
    6219562195        }
    62196        
    62197        
     62196
     62197
    6219862198        /**
    6219962199         * Set the value for a specific cell, into the internal data cache
     
    6220862208                var col     = settings.aoColumns[colIdx];
    6220962209                var rowData = settings.aoData[rowIdx]._aData;
    62210        
     62210
    6221162211                col.fnSetData( rowData, val, {
    6221262212                        settings: settings,
     
    6221562215                }  );
    6221662216        }
    62217        
    62218        
     62217
     62218
    6221962219        // Private variable that is used to match action syntax in the data property object
    6222062220        var __reArray = /\[.*?\]$/;
    6222162221        var __reFn = /\(\)$/;
    62222        
     62222
    6222362223        /**
    6222462224         * Split string on periods, taking into account escaped periods
     
    6223262232                } );
    6223362233        }
    62234        
    62235        
     62234
     62235
    6223662236        /**
    6223762237         * Return a function that can be used to get data from a source object, taking
     
    6225262252                                }
    6225362253                        } );
    62254        
     62254
    6225562255                        return function (data, type, row, meta) {
    6225662256                                var t = o[type] || o._;
     
    6228462284                        var fetchData = function (data, type, src) {
    6228562285                                var arrayNotation, funcNotation, out, innerSrc;
    62286        
     62286
    6228762287                                if ( src !== "" )
    6228862288                                {
    6228962289                                        var a = _fnSplitObjNotation( src );
    62290        
     62290
    6229162291                                        for ( var i=0, iLen=a.length ; i<iLen ; i++ )
    6229262292                                        {
     
    6229462294                                                arrayNotation = a[i].match(__reArray);
    6229562295                                                funcNotation = a[i].match(__reFn);
    62296        
     62296
    6229762297                                                if ( arrayNotation )
    6229862298                                                {
    6229962299                                                        // Array notation
    6230062300                                                        a[i] = a[i].replace(__reArray, '');
    62301        
     62301
    6230262302                                                        // Condition allows simply [] to be passed in
    6230362303                                                        if ( a[i] !== "" ) {
     
    6230562305                                                        }
    6230662306                                                        out = [];
    62307        
     62307
    6230862308                                                        // Get the remainder of the nested object to get
    6230962309                                                        a.splice( 0, i+1 );
    6231062310                                                        innerSrc = a.join('.');
    62311        
     62311
    6231262312                                                        // Traverse each entry in the array getting the properties requested
    6231362313                                                        if ( $.isArray( data ) ) {
     
    6231662316                                                                }
    6231762317                                                        }
    62318        
     62318
    6231962319                                                        // If a string is given in between the array notation indicators, that
    6232062320                                                        // is used to join the strings together, otherwise an array is returned
    6232162321                                                        var join = arrayNotation[0].substring(1, arrayNotation[0].length-1);
    6232262322                                                        data = (join==="") ? out : out.join(join);
    62323        
     62323
    6232462324                                                        // The inner call to fetchData has already traversed through the remainder
    6232562325                                                        // of the source requested, so we exit from the loop
     
    6233362333                                                        continue;
    6233462334                                                }
    62335        
     62335
    6233662336                                                if ( data === null || data[ a[i] ] === undefined )
    6233762337                                                {
     
    6234162341                                        }
    6234262342                                }
    62343        
     62343
    6234462344                                return data;
    6234562345                        };
    62346        
     62346
    6234762347                        return function (data, type) { // row and meta also passed, but not used
    6234862348                                return fetchData( data, type, mSource );
     
    6235762357                }
    6235862358        }
    62359        
    62360        
     62359
     62360
    6236162361        /**
    6236262362         * Return a function that can be used to set data from a source object, taking
     
    6239662396                                var aLast = a[a.length-1];
    6239762397                                var arrayNotation, funcNotation, o, innerSrc;
    62398        
     62398
    6239962399                                for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
    6240062400                                {
     
    6240262402                                        arrayNotation = a[i].match(__reArray);
    6240362403                                        funcNotation = a[i].match(__reFn);
    62404        
     62404
    6240562405                                        if ( arrayNotation )
    6240662406                                        {
    6240762407                                                a[i] = a[i].replace(__reArray, '');
    6240862408                                                data[ a[i] ] = [];
    62409        
     62409
    6241062410                                                // Get the remainder of the nested object to set so we can recurse
    6241162411                                                b = a.slice();
    6241262412                                                b.splice( 0, i+1 );
    6241362413                                                innerSrc = b.join('.');
    62414        
     62414
    6241562415                                                // Traverse each entry in the array setting the properties requested
    6241662416                                                if ( $.isArray( val ) )
     
    6243062430                                                        data[ a[i] ] = val;
    6243162431                                                }
    62432        
     62432
    6243362433                                                // The inner call to setData has already traversed through the remainder
    6243462434                                                // of the source and has set the data, thus we can exit here
     
    6244162441                                                data = data[ a[i] ]( val );
    6244262442                                        }
    62443        
     62443
    6244462444                                        // If the nested object doesn't currently exist - since we are
    6244562445                                        // trying to set the value - create it
     
    6245062450                                        data = data[ a[i] ];
    6245162451                                }
    62452        
     62452
    6245362453                                // Last item in the input - i.e, the actual set
    6245462454                                if ( aLast.match(__reFn ) )
     
    6246462464                                }
    6246562465                        };
    62466        
     62466
    6246762467                        return function (data, val) { // meta is also passed in, but not used
    6246862468                                return setData( data, val, mSource );
     
    6247762477                }
    6247862478        }
    62479        
    62480        
     62479
     62480
    6248162481        /**
    6248262482         * Return an array with the full table data
     
    6248962489                return _pluck( settings.aoData, '_aData' );
    6249062490        }
    62491        
    62492        
     62491
     62492
    6249362493        /**
    6249462494         * Nuke the table
     
    6250362503                settings.aIds = {};
    6250462504        }
    62505        
    62506        
     62505
     62506
    6250762507         /**
    6250862508         * Take an array of integers (index array) and remove a target integer (value - not
     
    6251562515        {
    6251662516                var iTargetIndex = -1;
    62517        
     62517
    6251862518                for ( var i=0, iLen=a.length ; i<iLen ; i++ )
    6251962519                {
     
    6252762527                        }
    6252862528                }
    62529        
     62529
    6253062530                if ( iTargetIndex != -1 && splice === undefined )
    6253162531                {
     
    6253362533                }
    6253462534        }
    62535        
    62536        
     62535
     62536
    6253762537        /**
    6253862538         * Mark cached data as invalid such that a re-read of the data will occur when
     
    6256262562                                cell.removeChild( cell.firstChild );
    6256362563                        }
    62564        
     62564
    6256562565                        cell.innerHTML = _fnGetCellData( settings, rowIdx, col, 'display' );
    6256662566                };
    62567        
     62567
    6256862568                // Are we reading last data from DOM or the data object?
    6256962569                if ( src === 'dom' || ((! src || src === 'auto') && row.src === 'dom') ) {
     
    6257762577                        // Reading from data object, update the DOM
    6257862578                        var cells = row.anCells;
    62579        
     62579
    6258062580                        if ( cells ) {
    6258162581                                if ( colIdx !== undefined ) {
     
    6258962589                        }
    6259062590                }
    62591        
     62591
    6259262592                // For both row and cell invalidation, the cached data for sorting and
    6259362593                // filtering is nulled out
    6259462594                row._aSortData = null;
    6259562595                row._aFilterData = null;
    62596        
     62596
    6259762597                // Invalidate the type for a specific column (if given) or all columns since
    6259862598                // the data might have changed
     
    6260562605                                cols[i].sType = null;
    6260662606                        }
    62607        
     62607
    6260862608                        // Update DataTables special `DT_*` attributes for the row
    6260962609                        _fnRowAttributes( settings, row );
    6261062610                }
    6261162611        }
    62612        
    62613        
     62612
     62613
    6261462614        /**
    6261562615         * Build a data source object from an HTML row, reading the contents of the
     
    6263762637                        columns = settings.aoColumns,
    6263862638                        objectRead = settings._rowReadObject;
    62639        
     62639
    6264062640                // Allow the data object to be passed in, or construct
    6264162641                d = d !== undefined ?
     
    6264462644                                {} :
    6264562645                                [];
    62646        
     62646
    6264762647                var attr = function ( str, td  ) {
    6264862648                        if ( typeof str === 'string' ) {
    6264962649                                var idx = str.indexOf('@');
    62650        
     62650
    6265162651                                if ( idx !== -1 ) {
    6265262652                                        var attr = str.substring( idx+1 );
     
    6265662656                        }
    6265762657                };
    62658        
     62658
    6265962659                // Read data from a cell and store into the data object
    6266062660                var cellProcess = function ( cell ) {
     
    6266262662                                col = columns[i];
    6266362663                                contents = $.trim(cell.innerHTML);
    62664        
     62664
    6266562665                                if ( col && col._bAttrSrc ) {
    6266662666                                        var setter = _fnSetObjectDataFn( col.mData._ );
    6266762667                                        setter( d, contents );
    62668        
     62668
    6266962669                                        attr( col.mData.sort, cell );
    6267062670                                        attr( col.mData.type, cell );
     
    6268662686                                }
    6268762687                        }
    62688        
     62688
    6268962689                        i++;
    6269062690                };
    62691        
     62691
    6269262692                if ( td ) {
    6269362693                        // `tr` element was passed in
    6269462694                        while ( td ) {
    6269562695                                name = td.nodeName.toUpperCase();
    62696        
     62696
    6269762697                                if ( name == "TD" || name == "TH" ) {
    6269862698                                        cellProcess( td );
    6269962699                                        tds.push( td );
    6270062700                                }
    62701        
     62701
    6270262702                                td = td.nextSibling;
    6270362703                        }
     
    6270662706                        // Existing row object passed in
    6270762707                        tds = row.anCells;
    62708        
     62708
    6270962709                        for ( var j=0, jen=tds.length ; j<jen ; j++ ) {
    6271062710                                cellProcess( tds[j] );
    6271162711                        }
    6271262712                }
    62713        
     62713
    6271462714                // Read the ID from the DOM if present
    6271562715                var rowNode = row.firstChild ? row : row.nTr;
    62716        
     62716
    6271762717                if ( rowNode ) {
    6271862718                        var id = rowNode.getAttribute( 'id' );
    62719        
     62719
    6272062720                        if ( id ) {
    6272162721                                _fnSetObjectDataFn( settings.rowId )( d, id );
    6272262722                        }
    6272362723                }
    62724        
     62724
    6272562725                return {
    6272662726                        data: d,
     
    6274662746                        nTr, nTd, oCol,
    6274762747                        i, iLen, create;
    62748        
     62748
    6274962749                if ( row.nTr === null )
    6275062750                {
    6275162751                        nTr = nTrIn || document.createElement('tr');
    62752        
     62752
    6275362753                        row.nTr = nTr;
    6275462754                        row.anCells = cells;
    62755        
     62755
    6275662756                        /* Use a private property on the node to allow reserve mapping from the node
    6275762757                         * to the aoData array for fast look up
    6275862758                         */
    6275962759                        nTr._DT_RowIndex = iRow;
    62760        
     62760
    6276162761                        /* Special parameters can be given by the data source to be used on the row */
    6276262762                        _fnRowAttributes( oSettings, row );
    62763        
     62763
    6276462764                        /* Process each column */
    6276562765                        for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
     
    6276762767                                oCol = oSettings.aoColumns[i];
    6276862768                                create = nTrIn ? false : true;
    62769        
     62769
    6277062770                                nTd = create ? document.createElement( oCol.sCellType ) : anTds[i];
    6277162771                                nTd._DT_CellIndex = {
     
    6277362773                                        column: i
    6277462774                                };
    62775                                
     62775
    6277662776                                cells.push( nTd );
    62777        
     62777
    6277862778                                // Need to create the HTML if new, or if a rendering function is defined
    6277962779                                if ( create || ((!nTrIn || oCol.mRender || oCol.mData !== i) &&
     
    6278262782                                        nTd.innerHTML = _fnGetCellData( oSettings, iRow, i, 'display' );
    6278362783                                }
    62784        
     62784
    6278562785                                /* Add user defined class */
    6278662786                                if ( oCol.sClass )
     
    6278862788                                        nTd.className += ' '+oCol.sClass;
    6278962789                                }
    62790        
     62790
    6279162791                                // Visibility - add or remove as required
    6279262792                                if ( oCol.bVisible && ! nTrIn )
     
    6279862798                                        nTd.parentNode.removeChild( nTd );
    6279962799                                }
    62800        
     62800
    6280162801                                if ( oCol.fnCreatedCell )
    6280262802                                {
     
    6280662806                                }
    6280762807                        }
    62808        
     62808
    6280962809                        _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [nTr, rowData, iRow, cells] );
    6281062810                }
    62811        
     62811
    6281262812                // Remove once webkit bug 131819 and Chromium bug 365619 have been resolved
    6281362813                // and deployed
    6281462814                row.nTr.setAttribute( 'role', 'row' );
    6281562815        }
    62816        
    62817        
     62816
     62817
    6281862818        /**
    6281962819         * Add attributes to a row based on the special `DT_*` parameters in a data
     
    6282762827                var tr = row.nTr;
    6282862828                var data = row._aData;
    62829        
     62829
    6283062830                if ( tr ) {
    6283162831                        var id = settings.rowIdFn( data );
    62832        
     62832
    6283362833                        if ( id ) {
    6283462834                                tr.id = id;
    6283562835                        }
    62836        
     62836
    6283762837                        if ( data.DT_RowClass ) {
    6283862838                                // Remove any classes added by DT_RowClass before
     
    6284162841                                        _unique( row.__rowc.concat( a ) ) :
    6284262842                                        a;
    62843        
     62843
    6284462844                                $(tr)
    6284562845                                        .removeClass( row.__rowc.join(' ') )
    6284662846                                        .addClass( data.DT_RowClass );
    6284762847                        }
    62848        
     62848
    6284962849                        if ( data.DT_RowAttr ) {
    6285062850                                $(tr).attr( data.DT_RowAttr );
    6285162851                        }
    62852        
     62852
    6285362853                        if ( data.DT_RowData ) {
    6285462854                                $(tr).data( data.DT_RowData );
     
    6285662856                }
    6285762857        }
    62858        
    62859        
     62858
     62859
    6286062860        /**
    6286162861         * Create the HTML header for the table
     
    6287162871                var classes = oSettings.oClasses;
    6287262872                var columns = oSettings.aoColumns;
    62873        
     62873
    6287462874                if ( createHeader ) {
    6287562875                        row = $('<tr/>').appendTo( thead );
    6287662876                }
    62877        
     62877
    6287862878                for ( i=0, ien=columns.length ; i<ien ; i++ ) {
    6287962879                        column = columns[i];
    6288062880                        cell = $( column.nTh ).addClass( column.sClass );
    62881        
     62881
    6288262882                        if ( createHeader ) {
    6288362883                                cell.appendTo( row );
    6288462884                        }
    62885        
     62885
    6288662886                        // 1.11 move into sorting
    6288762887                        if ( oSettings.oFeatures.bSort ) {
    6288862888                                cell.addClass( column.sSortingClass );
    62889        
     62889
    6289062890                                if ( column.bSortable !== false ) {
    6289162891                                        cell
    6289262892                                                .attr( 'tabindex', oSettings.iTabIndex )
    6289362893                                                .attr( 'aria-controls', oSettings.sTableId );
    62894        
     62894
    6289562895                                        _fnSortAttachListener( oSettings, column.nTh, i );
    6289662896                                }
    6289762897                        }
    62898        
     62898
    6289962899                        if ( column.sTitle != cell[0].innerHTML ) {
    6290062900                                cell.html( column.sTitle );
    6290162901                        }
    62902        
     62902
    6290362903                        _fnRenderer( oSettings, 'header' )(
    6290462904                                oSettings, cell, column, classes
    6290562905                        );
    6290662906                }
    62907        
     62907
    6290862908                if ( createHeader ) {
    6290962909                        _fnDetectHeader( oSettings.aoHeader, thead );
    6291062910                }
    62911                
     62911
    6291262912                /* ARIA role for the rows */
    6291362913                $(thead).find('>tr').attr('role', 'row');
    62914        
     62914
    6291562915                /* Deal with the footer - add classes if required */
    6291662916                $(thead).find('>tr>th, >tr>td').addClass( classes.sHeaderTH );
    6291762917                $(tfoot).find('>tr>th, >tr>td').addClass( classes.sFooterTH );
    62918        
     62918
    6291962919                // Cache the footer cells. Note that we only take the cells from the first
    6292062920                // row in the footer. If there is more than one row the user wants to
     
    6292362923                if ( tfoot !== null ) {
    6292462924                        var cells = oSettings.aoFooter[0];
    62925        
     62925
    6292662926                        for ( i=0, ien=cells.length ; i<ien ; i++ ) {
    6292762927                                column = columns[i];
    6292862928                                column.nTf = cells[i].cell;
    62929        
     62929
    6293062930                                if ( column.sClass ) {
    6293162931                                        $(column.nTf).addClass( column.sClass );
     
    6293462934                }
    6293562935        }
    62936        
    62937        
     62936
     62937
    6293862938        /**
    6293962939         * Draw the header (or footer) element based on the column visibility states. The
     
    6295662956                var iColumns = oSettings.aoColumns.length;
    6295762957                var iRowspan, iColspan;
    62958        
     62958
    6295962959                if ( ! aoSource )
    6296062960                {
    6296162961                        return;
    6296262962                }
    62963        
     62963
    6296462964                if (  bIncludeHidden === undefined )
    6296562965                {
    6296662966                        bIncludeHidden = false;
    6296762967                }
    62968        
     62968
    6296962969                /* Make a copy of the master layout array, but without the visible columns in it */
    6297062970                for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )
     
    6297262972                        aoLocal[i] = aoSource[i].slice();
    6297362973                        aoLocal[i].nTr = aoSource[i].nTr;
    62974        
     62974
    6297562975                        /* Remove any columns which are currently hidden */
    6297662976                        for ( j=iColumns-1 ; j>=0 ; j-- )
     
    6298162981                                }
    6298262982                        }
    62983        
     62983
    6298462984                        /* Prep the applied array - it needs an element for each row */
    6298562985                        aApplied.push( [] );
    6298662986                }
    62987        
     62987
    6298862988                for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )
    6298962989                {
    6299062990                        nLocalTr = aoLocal[i].nTr;
    62991        
     62991
    6299262992                        /* All cells are going to be replaced, so empty out the row */
    6299362993                        if ( nLocalTr )
     
    6299862998                                }
    6299962999                        }
    63000        
     63000
    6300163001                        for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )
    6300263002                        {
    6300363003                                iRowspan = 1;
    6300463004                                iColspan = 1;
    63005        
     63005
    6300663006                                /* Check to see if there is already a cell (row/colspan) covering our target
    6300763007                                 * insert point. If there is, then there is nothing to do.
     
    6301163011                                        nLocalTr.appendChild( aoLocal[i][j].cell );
    6301263012                                        aApplied[i][j] = 1;
    63013        
     63013
    6301463014                                        /* Expand the cell to cover as many rows as needed */
    6301563015                                        while ( aoLocal[i+iRowspan] !== undefined &&
     
    6301963019                                                iRowspan++;
    6302063020                                        }
    63021        
     63021
    6302263022                                        /* Expand the cell to cover as many columns as needed */
    6302363023                                        while ( aoLocal[i][j+iColspan] !== undefined &&
     
    6303163031                                                iColspan++;
    6303263032                                        }
    63033        
     63033
    6303463034                                        /* Do the actual expansion in the DOM */
    6303563035                                        $(aoLocal[i][j].cell)
     
    6304063040                }
    6304163041        }
    63042        
    63043        
     63042
     63043
    6304463044        /**
    6304563045         * Insert the required TR nodes into the table for display
     
    6305663056                        return;
    6305763057                }
    63058        
     63058
    6305963059                var i, iLen, n;
    6306063060                var anRows = [];
     
    6306763067                var bServerSide = _fnDataSource( oSettings ) == 'ssp';
    6306863068                var aiDisplay = oSettings.aiDisplay;
    63069        
     63069
    6307063070                oSettings.bDrawing = true;
    63071        
     63071
    6307263072                /* Check and see if we have an initial draw position from state saving */
    6307363073                if ( iInitDisplayStart !== undefined && iInitDisplayStart !== -1 )
     
    6307863078                                        0 :
    6307963079                                        iInitDisplayStart;
    63080        
     63080
    6308163081                        oSettings.iInitDisplayStart = -1;
    6308263082                }
    63083        
     63083
    6308463084                var iDisplayStart = oSettings._iDisplayStart;
    6308563085                var iDisplayEnd = oSettings.fnDisplayEnd();
    63086        
     63086
    6308763087                /* Server-side processing draw intercept */
    6308863088                if ( oSettings.bDeferLoading )
     
    6310063100                        return;
    6310163101                }
    63102        
     63102
    6310363103                if ( aiDisplay.length !== 0 )
    6310463104                {
    6310563105                        var iStart = bServerSide ? 0 : iDisplayStart;
    6310663106                        var iEnd = bServerSide ? oSettings.aoData.length : iDisplayEnd;
    63107        
     63107
    6310863108                        for ( var j=iStart ; j<iEnd ; j++ )
    6310963109                        {
     
    6311463114                                        _fnCreateTr( oSettings, iDataIndex );
    6311563115                                }
    63116        
     63116
    6311763117                                var nRow = aoData.nTr;
    63118        
     63118
    6311963119                                /* Remove the old striping classes and then add the new one */
    6312063120                                if ( iStripes !== 0 )
     
    6312763127                                        }
    6312863128                                }
    63129        
     63129
    6313063130                                // Row callback functions - might want to manipulate the row
    6313163131                                // iRowCount and j are not currently documented. Are they at all
     
    6313363133                                _fnCallbackFire( oSettings, 'aoRowCallback', null,
    6313463134                                        [nRow, aoData._aData, iRowCount, j, iDataIndex] );
    63135        
     63135
    6313663136                                anRows.push( nRow );
    6313763137                                iRowCount++;
     
    6315063150                                sZero = oLang.sEmptyTable;
    6315163151                        }
    63152        
     63152
    6315363153                        anRows[ 0 ] = $( '<tr/>', { 'class': iStripes ? asStripeClasses[0] : '' } )
    6315463154                                .append( $('<td />', {
     
    6315863158                                } ).html( sZero ) )[0];
    6315963159                }
    63160        
     63160
    6316163161                /* Header and footer callbacks */
    6316263162                _fnCallbackFire( oSettings, 'aoHeaderCallback', 'header', [ $(oSettings.nTHead).children('tr')[0],
    6316363163                        _fnGetDataMaster( oSettings ), iDisplayStart, iDisplayEnd, aiDisplay ] );
    63164        
     63164
    6316563165                _fnCallbackFire( oSettings, 'aoFooterCallback', 'footer', [ $(oSettings.nTFoot).children('tr')[0],
    6316663166                        _fnGetDataMaster( oSettings ), iDisplayStart, iDisplayEnd, aiDisplay ] );
    63167        
     63167
    6316863168                var body = $(oSettings.nTBody);
    63169        
     63169
    6317063170                body.children().detach();
    6317163171                body.append( $(anRows) );
    63172        
     63172
    6317363173                /* Call all required callback functions for the end of a draw */
    6317463174                _fnCallbackFire( oSettings, 'aoDrawCallback', 'draw', [oSettings] );
    63175        
     63175
    6317663176                /* Draw is complete, sorting and filtering must be as well */
    6317763177                oSettings.bSorted = false;
     
    6317963179                oSettings.bDrawing = false;
    6318063180        }
    63181        
    63182        
     63181
     63182
    6318363183        /**
    6318463184         * Redraw the table - taking account of the various features which are enabled
     
    6319463194                        sort     = features.bSort,
    6319563195                        filter   = features.bFilter;
    63196        
     63196
    6319763197                if ( sort ) {
    6319863198                        _fnSort( settings );
    6319963199                }
    63200        
     63200
    6320163201                if ( filter ) {
    6320263202                        _fnFilterComplete( settings, settings.oPreviousSearch );
     
    6320663206                        settings.aiDisplay = settings.aiDisplayMaster.slice();
    6320763207                }
    63208        
     63208
    6320963209                if ( holdPosition !== true ) {
    6321063210                        settings._iDisplayStart = 0;
    6321163211                }
    63212        
     63212
    6321363213                // Let any modules know about the draw hold position state (used by
    6321463214                // scrolling internally)
    6321563215                settings._drawHold = holdPosition;
    63216        
     63216
    6321763217                _fnDraw( settings );
    63218        
     63218
    6321963219                settings._drawHold = false;
    6322063220        }
    63221        
    63222        
     63221
     63222
    6322363223        /**
    6322463224         * Add the options to the page HTML for the table
     
    6323263232                var holding = $('<div/>').insertBefore( table ); // Holding element for speed
    6323363233                var features = oSettings.oFeatures;
    63234        
     63234
    6323563235                // All DataTables are wrapped in a div
    6323663236                var insert = $('<div/>', {
     
    6323863238                        'class': classes.sWrapper + (oSettings.nTFoot ? '' : ' '+classes.sNoFooter)
    6323963239                } );
    63240        
     63240
    6324163241                oSettings.nHolding = holding[0];
    6324263242                oSettings.nTableWrapper = insert[0];
    6324363243                oSettings.nTableReinsertBefore = oSettings.nTable.nextSibling;
    63244        
     63244
    6324563245                /* Loop over the user set positioning and place the elements as needed */
    6324663246                var aDom = oSettings.sDom.split('');
     
    6325063250                        featureNode = null;
    6325163251                        cOption = aDom[i];
    63252        
     63252
    6325363253                        if ( cOption == '<' )
    6325463254                        {
    6325563255                                /* New container div */
    6325663256                                nNewNode = $('<div/>')[0];
    63257        
     63257
    6325863258                                /* Check to see if we should append an id and/or a class name to the container */
    6325963259                                cNext = aDom[i+1];
     
    6326763267                                                j++;
    6326863268                                        }
    63269        
     63269
    6327063270                                        /* Replace jQuery UI constants @todo depreciated */
    6327163271                                        if ( sAttr == "H" )
     
    6327763277                                                sAttr = classes.sJUIFooter;
    6327863278                                        }
    63279        
     63279
    6328063280                                        /* The attribute can be in the format of "#id.class", "#id" or "class" This logic
    6328163281                                         * breaks the string into parts and applies them as needed
     
    6329563295                                                nNewNode.className = sAttr;
    6329663296                                        }
    63297        
     63297
    6329863298                                        i += j; /* Move along the position array */
    6329963299                                }
    63300        
     63300
    6330163301                                insert.append( nNewNode );
    6330263302                                insert = $(nNewNode);
     
    6335163351                                }
    6335263352                        }
    63353        
     63353
    6335463354                        /* Add to the 2D features array */
    6335563355                        if ( featureNode )
    6335663356                        {
    6335763357                                var aanFeatures = oSettings.aanFeatures;
    63358        
     63358
    6335963359                                if ( ! aanFeatures[cOption] )
    6336063360                                {
    6336163361                                        aanFeatures[cOption] = [];
    6336263362                                }
    63363        
     63363
    6336463364                                aanFeatures[cOption].push( featureNode );
    6336563365                                insert.append( featureNode );
    6336663366                        }
    6336763367                }
    63368        
     63368
    6336963369                /* Built our DOM structure - replace the holding div with what we want */
    6337063370                holding.replaceWith( insert );
    6337163371                oSettings.nHolding = null;
    6337263372        }
    63373        
    63374        
     63373
     63374
    6337563375        /**
    6337663376         * Use the DOM source to create up an array of header cells. The idea here is to
     
    6339563395                        return j;
    6339663396                };
    63397        
     63397
    6339863398                aLayout.splice( 0, aLayout.length );
    63399        
     63399
    6340063400                /* We know how many rows there are in the layout - so prep it */
    6340163401                for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
     
    6340363403                        aLayout.push( [] );
    6340463404                }
    63405        
     63405
    6340663406                /* Calculate a layout array */
    6340763407                for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
     
    6340963409                        nTr = nTrs[i];
    6341063410                        iColumn = 0;
    63411        
     63411
    6341263412                        /* For every cell in the row... */
    6341363413                        nCell = nTr.firstChild;
     
    6342163421                                        iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
    6342263422                                        iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;
    63423        
     63423
    6342463424                                        /* There might be colspan cells already in this row, so shift our target
    6342563425                                         * accordingly
    6342663426                                         */
    6342763427                                        iColShifted = fnShiftCol( aLayout, i, iColumn );
    63428        
     63428
    6342963429                                        /* Cache calculation for unique columns */
    6343063430                                        bUnique = iColspan === 1 ? true : false;
    63431        
     63431
    6343263432                                        /* If there is col / rowspan, copy the information into the layout grid */
    6343363433                                        for ( l=0 ; l<iColspan ; l++ )
     
    6344763447                }
    6344863448        }
    63449        
    63450        
     63449
     63450
    6345163451        /**
    6345263452         * Get an array of unique th elements, one for each column
     
    6346963469                        }
    6347063470                }
    63471        
     63471
    6347263472                for ( var i=0, iLen=aLayout.length ; i<iLen ; i++ )
    6347363473                {
     
    6348163481                        }
    6348263482                }
    63483        
     63483
    6348463484                return aReturn;
    6348563485        }
    63486        
     63486
    6348763487        /**
    6348863488         * Create an Ajax call based on the table's settings, taking into account that
     
    6349863498                // Compatibility with 1.9-, allow fnServerData and event to manipulate
    6349963499                _fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [data] );
    63500        
     63500
    6350163501                // Convert to object based for 1.10+ if using the old array scheme which can
    6350263502                // come from server-side processing or serverParams
     
    6350463504                        var tmp = {};
    6350563505                        var rbracket = /(.*?)\[\]$/;
    63506        
     63506
    6350763507                        $.each( data, function (key, val) {
    6350863508                                var match = val.name.match(rbracket);
    63509        
     63509
    6351063510                                if ( match ) {
    6351163511                                        // Support for arrays
    6351263512                                        var name = match[0];
    63513        
     63513
    6351463514                                        if ( ! tmp[ name ] ) {
    6351563515                                                tmp[ name ] = [];
     
    6352363523                        data = tmp;
    6352463524                }
    63525        
     63525
    6352663526                var ajaxData;
    6352763527                var ajax = oSettings.ajax;
     
    6353163531                        fn( json );
    6353263532                };
    63533        
     63533
    6353463534                if ( $.isPlainObject( ajax ) && ajax.data )
    6353563535                {
    6353663536                        ajaxData = ajax.data;
    63537        
     63537
    6353863538                        var newData = typeof ajaxData === 'function' ?
    6353963539                                ajaxData( data, oSettings ) :  // fn can manipulate data or return
    6354063540                                ajaxData;                      // an object object or array to merge
    63541        
     63541
    6354263542                        // If the function returned something, use that alone
    6354363543                        data = typeof ajaxData === 'function' && newData ?
    6354463544                                newData :
    6354563545                                $.extend( true, data, newData );
    63546        
     63546
    6354763547                        // Remove the data property as we've resolved it already and don't want
    6354863548                        // jQuery to do it again (it is restored at the end of the function)
    6354963549                        delete ajax.data;
    6355063550                }
    63551        
     63551
    6355263552                var baseAjax = {
    6355363553                        "data": data,
     
    6355763557                                        _fnLog( oSettings, 0, error );
    6355863558                                }
    63559        
     63559
    6356063560                                oSettings.json = json;
    6356163561                                callback( json );
     
    6356663566                        "error": function (xhr, error, thrown) {
    6356763567                                var ret = _fnCallbackFire( oSettings, null, 'xhr', [oSettings, null, oSettings.jqXHR] );
    63568        
     63568
    6356963569                                if ( $.inArray( true, ret ) === -1 ) {
    6357063570                                        if ( error == "parsererror" ) {
     
    6357563575                                        }
    6357663576                                }
    63577        
     63577
    6357863578                                _fnProcessingDisplay( oSettings, false );
    6357963579                        }
    6358063580                };
    63581        
     63581
    6358263582                // Store the data submitted for the API
    6358363583                oSettings.oAjaxData = data;
    63584        
     63584
    6358563585                // Allow plug-ins and external processes to modify the data
    6358663586                _fnCallbackFire( oSettings, null, 'preXhr', [oSettings, data] );
    63587        
     63587
    6358863588                if ( oSettings.fnServerData )
    6358963589                {
     
    6361463614                        // Object to extend the base settings
    6361563615                        oSettings.jqXHR = $.ajax( $.extend( baseAjax, ajax ) );
    63616        
     63616
    6361763617                        // Restore for next time around
    6361863618                        ajax.data = ajaxData;
    6361963619                }
    6362063620        }
    63621        
    63622        
     63621
     63622
    6362363623        /**
    6362463624         * Update the table using an Ajax call
     
    6363263632                        settings.iDraw++;
    6363363633                        _fnProcessingDisplay( settings, true );
    63634        
     63634
    6363563635                        _fnBuildAjax(
    6363663636                                settings,
     
    6364063640                                }
    6364163641                        );
    63642        
     63642
    6364363643                        return false;
    6364463644                }
    6364563645                return true;
    6364663646        }
    63647        
    63648        
     63647
     63648
    6364963649        /**
    6365063650         * Build up the parameters in an object needed for a server-side processing
     
    6367263672                                settings._iDisplayLength :
    6367363673                                -1;
    63674        
     63674
    6367563675                var param = function ( name, value ) {
    6367663676                        data.push( { 'name': name, 'value': value } );
    6367763677                };
    63678        
     63678
    6367963679                // DataTables 1.9- compatible method
    6368063680                param( 'sEcho',          settings.iDraw );
     
    6368363683                param( 'iDisplayStart',  displayStart );
    6368463684                param( 'iDisplayLength', displayLength );
    63685        
     63685
    6368663686                // DataTables 1.10+ method
    6368763687                var d = {
     
    6369663696                        }
    6369763697                };
    63698        
     63698
    6369963699                for ( i=0 ; i<columnCount ; i++ ) {
    6370063700                        column = columns[i];
    6370163701                        columnSearch = preColSearch[i];
    6370263702                        dataProp = typeof column.mData=="function" ? 'function' : column.mData ;
    63703        
     63703
    6370463704                        d.columns.push( {
    6370563705                                data:       dataProp,
     
    6371263712                                }
    6371363713                        } );
    63714        
     63714
    6371563715                        param( "mDataProp_"+i, dataProp );
    63716        
     63716
    6371763717                        if ( features.bFilter ) {
    6371863718                                param( 'sSearch_'+i,     columnSearch.sSearch );
     
    6372063720                                param( 'bSearchable_'+i, column.bSearchable );
    6372163721                        }
    63722        
     63722
    6372363723                        if ( features.bSort ) {
    6372463724                                param( 'bSortable_'+i, column.bSortable );
    6372563725                        }
    6372663726                }
    63727        
     63727
    6372863728                if ( features.bFilter ) {
    6372963729                        param( 'sSearch', preSearch.sSearch );
    6373063730                        param( 'bRegex', preSearch.bRegex );
    6373163731                }
    63732        
     63732
    6373363733                if ( features.bSort ) {
    6373463734                        $.each( sort, function ( i, val ) {
    6373563735                                d.order.push( { column: val.col, dir: val.dir } );
    63736        
     63736
    6373763737                                param( 'iSortCol_'+i, val.col );
    6373863738                                param( 'sSortDir_'+i, val.dir );
    6373963739                        } );
    63740        
     63740
    6374163741                        param( 'iSortingCols', sort.length );
    6374263742                }
    63743        
     63743
    6374463744                // If the legacy.ajax parameter is null, then we automatically decide which
    6374563745                // form to use, based on sAjaxSource
     
    6374863748                        return settings.sAjaxSource ? data : d;
    6374963749                }
    63750        
     63750
    6375163751                // Otherwise, if legacy has been specified then we use that to decide on the
    6375263752                // form
    6375363753                return legacy ? data : d;
    6375463754        }
    63755        
    63756        
     63755
     63756
    6375763757        /**
    6375863758         * Data the data from the server (nuking the old) and redraw the table
     
    6377363773                        return json[old] !== undefined ? json[old] : json[modern];
    6377463774                };
    63775        
     63775
    6377663776                var data = _fnAjaxDataSrc( settings, json );
    6377763777                var draw            = compat( 'sEcho',                'draw' );
    6377863778                var recordsTotal    = compat( 'iTotalRecords',        'recordsTotal' );
    6377963779                var recordsFiltered = compat( 'iTotalDisplayRecords', 'recordsFiltered' );
    63780        
     63780
    6378163781                if ( draw ) {
    6378263782                        // Protect against out of sequence returns
     
    6378663786                        settings.iDraw = draw * 1;
    6378763787                }
    63788        
     63788
    6378963789                _fnClearTable( settings );
    6379063790                settings._iRecordsTotal   = parseInt(recordsTotal, 10);
    6379163791                settings._iRecordsDisplay = parseInt(recordsFiltered, 10);
    63792        
     63792
    6379363793                for ( var i=0, ien=data.length ; i<ien ; i++ ) {
    6379463794                        _fnAddData( settings, data[i] );
    6379563795                }
    6379663796                settings.aiDisplay = settings.aiDisplayMaster.slice();
    63797        
     63797
    6379863798                settings.bAjaxDataGet = false;
    6379963799                _fnDraw( settings );
    63800        
     63800
    6380163801                if ( ! settings._bInitComplete ) {
    6380263802                        _fnInitComplete( settings, json );
    6380363803                }
    63804        
     63804
    6380563805                settings.bAjaxDataGet = true;
    6380663806                _fnProcessingDisplay( settings, false );
    6380763807        }
    63808        
    63809        
     63808
     63809
    6381063810        /**
    6381163811         * Get the data from the JSON data source to use for drawing a table. Using
     
    6382163821                        oSettings.ajax.dataSrc :
    6382263822                        oSettings.sAjaxDataProp; // Compatibility with 1.9-.
    63823        
     63823
    6382463824                // Compatibility with 1.9-. In order to read from aaData, check if the
    6382563825                // default has been changed, if not, check for aaData
     
    6382763827                        return json.aaData || json[dataSrc];
    6382863828                }
    63829        
     63829
    6383063830                return dataSrc !== "" ?
    6383163831                        _fnGetObjectDataFn( dataSrc )( json ) :
    6383263832                        json;
    6383363833        }
    63834        
     63834
    6383563835        /**
    6383663836         * Generate the node required for filtering text
     
    6384763847                var features = settings.aanFeatures;
    6384863848                var input = '<input type="search" class="'+classes.sFilterInput+'"/>';
    63849        
     63849
    6385063850                var str = language.sSearch;
    6385163851                str = str.match(/_INPUT_/) ?
    6385263852                        str.replace('_INPUT_', input) :
    6385363853                        str+input;
    63854        
     63854
    6385563855                var filter = $('<div/>', {
    6385663856                                'id': ! features.f ? tableId+'_filter' : null,
     
    6385863858                        } )
    6385963859                        .append( $('<label/>' ).append( str ) );
    63860        
     63860
    6386163861                var searchFn = function() {
    6386263862                        /* Update all other filter input elements for the new display */
    6386363863                        var n = features.f;
    6386463864                        var val = !this.value ? "" : this.value; // mental IE8 fix :-(
    63865        
     63865
    6386663866                        /* Now do the filter */
    6386763867                        if ( val != previousSearch.sSearch ) {
     
    6387263872                                        "bCaseInsensitive": previousSearch.bCaseInsensitive
    6387363873                                } );
    63874        
     63874
    6387563875                                // Need to redraw, without resorting
    6387663876                                settings._iDisplayStart = 0;
     
    6387863878                        }
    6387963879                };
    63880        
     63880
    6388163881                var searchDelay = settings.searchDelay !== null ?
    6388263882                        settings.searchDelay :
     
    6388463884                                400 :
    6388563885                                0;
    63886        
     63886
    6388763887                var jqFilter = $('input', filter)
    6388863888                        .val( previousSearch.sSearch )
     
    6390163901                        } )
    6390263902                        .attr('aria-controls', tableId);
    63903        
     63903
    6390463904                // Update the input elements whenever the table is filtered
    6390563905                $(settings.nTable).on( 'search.dt.DT', function ( ev, s ) {
     
    6391563915                        }
    6391663916                } );
    63917        
     63917
    6391863918                return filter[0];
    6391963919        }
    63920        
    63921        
     63920
     63921
    6392263922        /**
    6392363923         * Filter the table using both the global filter and column based filtering
     
    6394263942                        return o.bEscapeRegex !== undefined ? !o.bEscapeRegex : o.bRegex;
    6394363943                };
    63944        
     63944
    6394563945                // Resolve any column types that are unknown due to addition or invalidation
    6394663946                // @todo As per sort - can this be moved into an event handler?
    6394763947                _fnColumnTypes( oSettings );
    63948        
     63948
    6394963949                /* In server-side processing all filtering is done by the server, so no point hanging around here */
    6395063950                if ( _fnDataSource( oSettings ) != 'ssp' )
     
    6395363953                        _fnFilter( oSettings, oInput.sSearch, iForce, fnRegex(oInput), oInput.bSmart, oInput.bCaseInsensitive );
    6395463954                        fnSaveFilter( oInput );
    63955        
     63955
    6395663956                        /* Now do the individual column filter */
    6395763957                        for ( var i=0 ; i<aoPrevSearch.length ; i++ )
     
    6396063960                                        aoPrevSearch[i].bSmart, aoPrevSearch[i].bCaseInsensitive );
    6396163961                        }
    63962        
     63962
    6396363963                        /* Custom filtering */
    6396463964                        _fnFilterCustom( oSettings );
     
    6396863968                        fnSaveFilter( oInput );
    6396963969                }
    63970        
     63970
    6397163971                /* Tell the draw function we have been filtering */
    6397263972                oSettings.bFiltered = true;
    6397363973                _fnCallbackFire( oSettings, null, 'search', [oSettings] );
    6397463974        }
    63975        
    63976        
     63975
     63976
    6397763977        /**
    6397863978         * Apply custom filtering functions
     
    6398563985                var displayRows = settings.aiDisplay;
    6398663986                var row, rowIdx;
    63987        
     63987
    6398863988                for ( var i=0, ien=filters.length ; i<ien ; i++ ) {
    6398963989                        var rows = [];
    63990        
     63990
    6399163991                        // Loop over each row and see if it should be included
    6399263992                        for ( var j=0, jen=displayRows.length ; j<jen ; j++ ) {
    6399363993                                rowIdx = displayRows[ j ];
    6399463994                                row = settings.aoData[ rowIdx ];
    63995        
     63995
    6399663996                                if ( filters[i]( settings, row._aFilterData, rowIdx, row._aData, j ) ) {
    6399763997                                        rows.push( rowIdx );
    6399863998                                }
    6399963999                        }
    64000        
     64000
    6400164001                        // So the array reference doesn't break set the results into the
    6400264002                        // existing array
     
    6400564005                }
    6400664006        }
    64007        
    64008        
     64007
     64008
    6400964009        /**
    6401064010         * Filter the table on a per-column basis
     
    6402264022                        return;
    6402364023                }
    64024        
     64024
    6402564025                var data;
    6402664026                var out = [];
    6402764027                var display = settings.aiDisplay;
    6402864028                var rpSearch = _fnFilterCreateSearch( searchStr, regex, smart, caseInsensitive );
    64029        
     64029
    6403064030                for ( var i=0 ; i<display.length ; i++ ) {
    6403164031                        data = settings.aoData[ display[i] ]._aFilterData[ colIdx ];
    64032        
     64032
    6403364033                        if ( rpSearch.test( data ) ) {
    6403464034                                out.push( display[i] );
    6403564035                        }
    6403664036                }
    64037        
     64037
    6403864038                settings.aiDisplay = out;
    6403964039        }
    64040        
    64041        
     64040
     64041
    6404264042        /**
    6404364043         * Filter the data table based on user input and draw the table
     
    6405764057                var display, invalidated, i;
    6405864058                var filtered = [];
    64059        
     64059
    6406064060                // Need to take account of custom filtering functions - always filter
    6406164061                if ( DataTable.ext.search.length !== 0 ) {
    6406264062                        force = true;
    6406364063                }
    64064        
     64064
    6406564065                // Check if any of the rows were invalidated
    6406664066                invalidated = _fnFilterData( settings );
    64067        
     64067
    6406864068                // If the input is blank - we just want the full data set
    6406964069                if ( input.length <= 0 ) {
     
    6408264082                                settings.aiDisplay = displayMaster.slice();
    6408364083                        }
    64084        
     64084
    6408564085                        // Search the display array
    6408664086                        display = settings.aiDisplay;
    64087        
     64087
    6408864088                        for ( i=0 ; i<display.length ; i++ ) {
    6408964089                                if ( rpSearch.test( settings.aoData[ display[i] ]._sFilterRow ) ) {
     
    6409164091                                }
    6409264092                        }
    64093        
     64093
    6409464094                        settings.aiDisplay = filtered;
    6409564095                }
    6409664096        }
    64097        
    64098        
     64097
     64098
    6409964099        /**
    6410064100         * Build a regular expression object suitable for searching a table
     
    6411164111                        search :
    6411264112                        _fnEscapeRegex( search );
    64113                
     64113
    6411464114                if ( smart ) {
    6411564115                        /* For smart filtering we want to allow the search to work regardless of
     
    6411764117                         * order is important - a la google. So this is what we want to
    6411864118                         * generate:
    64119                          * 
     64119                         *
    6412064120                         * ^(?=.*?\bone\b)(?=.*?\btwo three\b)(?=.*?\bfour\b).*$
    6412164121                         */
     
    6412564125                                        word = m ? m[1] : word;
    6412664126                                }
    64127        
     64127
    6412864128                                return word.replace('"', '');
    6412964129                        } );
    64130        
     64130
    6413164131                        search = '^(?=.*?'+a.join( ')(?=.*?' )+').*$';
    6413264132                }
    64133        
     64133
    6413464134                return new RegExp( search, caseInsensitive ? 'i' : '' );
    6413564135        }
    64136        
    64137        
     64136
     64137
    6413864138        /**
    6413964139         * Escape a string such that it can be used in a regular expression
     
    6414364143         */
    6414464144        var _fnEscapeRegex = DataTable.util.escapeRegex;
    64145        
     64145
    6414664146        var __filter_div = $('<div>')[0];
    6414764147        var __filter_div_textContent = __filter_div.textContent !== undefined;
    64148        
     64148
    6414964149        // Update the filtering data for each row if needed (by invalidation or first run)
    6415064150        function _fnFilterData ( settings )
     
    6415564155                var fomatters = DataTable.ext.type.search;
    6415664156                var wasInvalidated = false;
    64157        
     64157
    6415864158                for ( i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
    6415964159                        row = settings.aoData[i];
    64160        
     64160
    6416164161                        if ( ! row._aFilterData ) {
    6416264162                                filterData = [];
    64163        
     64163
    6416464164                                for ( j=0, jen=columns.length ; j<jen ; j++ ) {
    6416564165                                        column = columns[j];
    64166        
     64166
    6416764167                                        if ( column.bSearchable ) {
    6416864168                                                cellData = _fnGetCellData( settings, i, j, 'filter' );
    64169        
     64169
    6417064170                                                if ( fomatters[ column.sType ] ) {
    6417164171                                                        cellData = fomatters[ column.sType ]( cellData );
    6417264172                                                }
    64173        
     64173
    6417464174                                                // Search in DataTables 1.10 is string based. In 1.11 this
    6417564175                                                // should be altered to also allow strict type checking.
     
    6417764177                                                        cellData = '';
    6417864178                                                }
    64179        
     64179
    6418064180                                                if ( typeof cellData !== 'string' && cellData.toString ) {
    6418164181                                                        cellData = cellData.toString();
     
    6418564185                                                cellData = '';
    6418664186                                        }
    64187        
     64187
    6418864188                                        // If it looks like there is an HTML entity in the string,
    6418964189                                        // attempt to decode it so sorting works as expected. Note that
     
    6419664196                                                        __filter_div.innerText;
    6419764197                                        }
    64198        
     64198
    6419964199                                        if ( cellData.replace ) {
    6420064200                                                cellData = cellData.replace(/[\r\n\u2028]/g, '');
    6420164201                                        }
    64202        
     64202
    6420364203                                        filterData.push( cellData );
    6420464204                                }
    64205        
     64205
    6420664206                                row._aFilterData = filterData;
    6420764207                                row._sFilterRow = filterData.join('  ');
     
    6420964209                        }
    6421064210                }
    64211        
     64211
    6421264212                return wasInvalidated;
    6421364213        }
    64214        
    64215        
     64214
     64215
    6421664216        /**
    6421764217         * Convert from the internal Hungarian notation to camelCase for external
     
    6423064230                };
    6423164231        }
    64232        
    64233        
    64234        
     64232
     64233
     64234
    6423564235        /**
    6423664236         * Convert from camelCase notation to the internal Hungarian. We could use the
     
    6424964249                };
    6425064250        }
    64251        
     64251
    6425264252        /**
    6425364253         * Generate the node required for the info display
     
    6426564265                                'id': ! nodes ? tid+'_info' : null
    6426664266                        } );
    64267        
     64267
    6426864268                if ( ! nodes ) {
    6426964269                        // Update display on each draw
     
    6427264272                                "sName": "information"
    6427364273                        } );
    64274        
     64274
    6427564275                        n
    6427664276                                .attr( 'role', 'status' )
    6427764277                                .attr( 'aria-live', 'polite' );
    64278        
     64278
    6427964279                        // Table is described by our info div
    6428064280                        $(settings.nTable).attr( 'aria-describedby', tid+'_info' );
    6428164281                }
    64282        
     64282
    6428364283                return n[0];
    6428464284        }
    64285        
    64286        
     64285
     64286
    6428764287        /**
    6428864288         * Update the information elements in the display
     
    6429764297                        return;
    6429864298                }
    64299        
     64299
    6430064300                var
    6430164301                        lang  = settings.oLanguage,
     
    6430764307                                lang.sInfo :
    6430864308                                lang.sInfoEmpty;
    64309        
     64309
    6431064310                if ( total !== max ) {
    6431164311                        /* Record set after filtering */
    6431264312                        out += ' ' + lang.sInfoFiltered;
    6431364313                }
    64314        
     64314
    6431564315                // Convert the macros
    6431664316                out += lang.sInfoPostFix;
    6431764317                out = _fnInfoMacros( settings, out );
    64318        
     64318
    6431964319                var callback = lang.fnInfoCallback;
    6432064320                if ( callback !== null ) {
     
    6432364323                        );
    6432464324                }
    64325        
     64325
    6432664326                $(nodes).html( out );
    6432764327        }
    64328        
    64329        
     64328
     64329
    6433064330        function _fnInfoMacros ( settings, str )
    6433164331        {
     
    6433864338                        vis        = settings.fnRecordsDisplay(),
    6433964339                        all        = len === -1;
    64340        
     64340
    6434164341                return str.
    6434264342                        replace(/_START_/g, formatter.call( settings, start ) ).
     
    6434764347                        replace(/_PAGES_/g, formatter.call( settings, all ? 1 : Math.ceil( vis / len ) ) );
    6434864348        }
    64349        
    64350        
    64351        
     64349
     64350
     64351
    6435264352        /**
    6435364353         * Draw the table for the first time, adding all required features
     
    6436164361                var features = settings.oFeatures;
    6436264362                var deferLoading = settings.bDeferLoading; // value modified by the draw
    64363        
     64363
    6436464364                /* Ensure that the table data is fully initialised */
    6436564365                if ( ! settings.bInitialised ) {
     
    6436764367                        return;
    6436864368                }
    64369        
     64369
    6437064370                /* Show the display HTML options */
    6437164371                _fnAddOptionsHtml( settings );
    64372        
     64372
    6437364373                /* Build and draw the header / footer for the table */
    6437464374                _fnBuildHead( settings );
    6437564375                _fnDrawHead( settings, settings.aoHeader );
    6437664376                _fnDrawHead( settings, settings.aoFooter );
    64377        
     64377
    6437864378                /* Okay to show that something is going on now */
    6437964379                _fnProcessingDisplay( settings, true );
    64380        
     64380
    6438164381                /* Calculate sizes for columns */
    6438264382                if ( features.bAutoWidth ) {
    6438364383                        _fnCalculateColumnWidths( settings );
    6438464384                }
    64385        
     64385
    6438664386                for ( i=0, iLen=columns.length ; i<iLen ; i++ ) {
    6438764387                        column = columns[i];
    64388        
     64388
    6438964389                        if ( column.sWidth ) {
    6439064390                                column.nTh.style.width = _fnStringToCss( column.sWidth );
    6439164391                        }
    6439264392                }
    64393        
     64393
    6439464394                _fnCallbackFire( settings, null, 'preInit', [settings] );
    64395        
     64395
    6439664396                // If there is default sorting required - let's do it. The sort function
    6439764397                // will do the drawing for us. Otherwise we draw the table regardless of the
     
    6439964399                // data (show 'loading' message possibly)
    6440064400                _fnReDraw( settings );
    64401        
     64401
    6440264402                // Server-side processing init complete is done by _fnAjaxUpdateDraw
    6440364403                var dataSrc = _fnDataSource( settings );
     
    6440764407                                _fnBuildAjax( settings, [], function(json) {
    6440864408                                        var aData = _fnAjaxDataSrc( settings, json );
    64409        
     64409
    6441064410                                        // Got the data - add it to the table
    6441164411                                        for ( i=0 ; i<aData.length ; i++ ) {
    6441264412                                                _fnAddData( settings, aData[i] );
    6441364413                                        }
    64414        
     64414
    6441564415                                        // Reset the init display for cookie saving. We've already done
    6441664416                                        // a filter, and therefore cleared it before. So we need to make
    6441764417                                        // it appear 'fresh'
    6441864418                                        settings.iInitDisplayStart = iAjaxStart;
    64419        
     64419
    6442064420                                        _fnReDraw( settings );
    64421        
     64421
    6442264422                                        _fnProcessingDisplay( settings, false );
    6442364423                                        _fnInitComplete( settings, json );
     
    6443064430                }
    6443164431        }
    64432        
    64433        
     64432
     64433
    6443464434        /**
    6443564435         * Draw the table for the first time, adding all required features
     
    6444264442        {
    6444364443                settings._bInitComplete = true;
    64444        
     64444
    6444564445                // When data was added after the initialisation (data or Ajax) we need to
    6444664446                // calculate the column sizing
     
    6444864448                        _fnAdjustColumnSizing( settings );
    6444964449                }
    64450        
     64450
    6445164451                _fnCallbackFire( settings, null, 'plugin-init', [settings, json] );
    6445264452                _fnCallbackFire( settings, 'aoInitComplete', 'init', [settings, json] );
    6445364453        }
    64454        
    64455        
     64454
     64455
    6445664456        function _fnLengthChange ( settings, val )
    6445764457        {
    6445864458                var len = parseInt( val, 10 );
    6445964459                settings._iDisplayLength = len;
    64460        
     64460
    6446164461                _fnLengthOverflow( settings );
    64462        
     64462
    6446364463                // Fire length change event
    6446464464                _fnCallbackFire( settings, null, 'length', [settings, len] );
    6446564465        }
    64466        
    64467        
     64466
     64467
    6446864468        /**
    6446964469         * Generate the node required for user display length changing
     
    6448164481                        lengths  = d2 ? menu[0] : menu,
    6448264482                        language = d2 ? menu[1] : menu;
    64483        
     64483
    6448464484                var select = $('<select/>', {
    6448564485                        'name':          tableId+'_length',
     
    6448764487                        'class':         classes.sLengthSelect
    6448864488                } );
    64489        
     64489
    6449064490                for ( var i=0, ien=lengths.length ; i<ien ; i++ ) {
    6449164491                        select[0][ i ] = new Option(
     
    6449664496                        );
    6449764497                }
    64498        
     64498
    6449964499                var div = $('<div><label/></div>').addClass( classes.sLength );
    6450064500                if ( ! settings.aanFeatures.l ) {
    6450164501                        div[0].id = tableId+'_length';
    6450264502                }
    64503        
     64503
    6450464504                div.children().append(
    6450564505                        settings.oLanguage.sLengthMenu.replace( '_MENU_', select[0].outerHTML )
    6450664506                );
    64507        
     64507
    6450864508                // Can't use `select` variable as user might provide their own and the
    6450964509                // reference is broken by the use of outerHTML
     
    6451464514                                _fnDraw( settings );
    6451564515                        } );
    64516        
     64516
    6451764517                // Update node value whenever anything changes the table's length
    6451864518                $(settings.nTable).on( 'length.dt.DT', function (e, s, len) {
     
    6452164521                        }
    6452264522                } );
    64523        
     64523
    6452464524                return div[0];
    6452564525        }
    64526        
    64527        
    64528        
     64526
     64527
     64528
    6452964529        /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    6453064530         * Note that most of the paging logic is done in
    6453164531         * DataTable.ext.pager
    6453264532         */
    64533        
     64533
    6453464534        /**
    6453564535         * Generate the node required for default pagination
     
    6454964549                        node = $('<div/>').addClass( settings.oClasses.sPaging + type )[0],
    6455064550                        features = settings.aanFeatures;
    64551        
     64551
    6455264552                if ( ! modern ) {
    6455364553                        plugin.fnInit( settings, node, redraw );
    6455464554                }
    64555        
     64555
    6455664556                /* Add a draw callback for the pagination on first instance, to update the paging display */
    6455764557                if ( ! features.p )
    6455864558                {
    6455964559                        node.id = settings.sTableId+'_paginate';
    64560        
     64560
    6456164561                        settings.aoDrawCallback.push( {
    6456264562                                "fn": function( settings ) {
     
    6457164571                                                        buttons = plugin(page, pages),
    6457264572                                                        i, ien;
    64573        
     64573
    6457464574                                                for ( i=0, ien=features.p.length ; i<ien ; i++ ) {
    6457564575                                                        _fnRenderer( settings, 'pageButton' )(
     
    6458564585                        } );
    6458664586                }
    64587        
     64587
    6458864588                return node;
    6458964589        }
    64590        
    64591        
     64590
     64591
    6459264592        /**
    6459364593         * Alter the display settings to change the page
     
    6460564605                        len       = settings._iDisplayLength,
    6460664606                        records   = settings.fnRecordsDisplay();
    64607        
     64607
    6460864608                if ( records === 0 || len === -1 )
    6460964609                {
     
    6461364613                {
    6461464614                        start = action * len;
    64615        
     64615
    6461664616                        if ( start > records )
    6461764617                        {
     
    6462864628                                start - len :
    6462964629                                0;
    64630        
     64630
    6463164631                        if ( start < 0 )
    6463264632                        {
     
    6464964649                        _fnLog( settings, 0, "Unknown paging action: "+action, 5 );
    6465064650                }
    64651        
     64651
    6465264652                var changed = settings._iDisplayStart !== start;
    6465364653                settings._iDisplayStart = start;
    64654        
     64654
    6465564655                if ( changed ) {
    6465664656                        _fnCallbackFire( settings, null, 'page', [settings] );
    64657        
     64657
    6465864658                        if ( redraw ) {
    6465964659                                _fnDraw( settings );
    6466064660                        }
    6466164661                }
    64662        
     64662
    6466364663                return changed;
    6466464664        }
    64665        
    64666        
    64667        
     64665
     64666
     64667
    6466864668        /**
    6466964669         * Generate the node required for the processing node
     
    6468164681                        .insertBefore( settings.nTable )[0];
    6468264682        }
    64683        
    64684        
     64683
     64684
    6468564685        /**
    6468664686         * Display or hide the processing indicator
     
    6469464694                        $(settings.aanFeatures.r).css( 'display', show ? 'block' : 'none' );
    6469564695                }
    64696        
     64696
    6469764697                _fnCallbackFire( settings, null, 'processing', [settings, show] );
    6469864698        }
    64699        
     64699
    6470064700        /**
    6470164701         * Add any control elements for the table - specifically scrolling
     
    6470764707        {
    6470864708                var table = $(settings.nTable);
    64709        
     64709
    6471064710                // Add the ARIA grid role to the table
    6471164711                table.attr( 'role', 'grid' );
    64712        
     64712
    6471364713                // Scrolling from here on in
    6471464714                var scroll = settings.oScroll;
    64715        
     64715
    6471664716                if ( scroll.sX === '' && scroll.sY === '' ) {
    6471764717                        return settings.nTable;
    6471864718                }
    64719        
     64719
    6472064720                var scrollX = scroll.sX;
    6472164721                var scrollY = scroll.sY;
     
    6473064730                        return !s ? null : _fnStringToCss( s );
    6473164731                };
    64732        
     64732
    6473364733                if ( ! footer.length ) {
    6473464734                        footer = null;
    6473564735                }
    64736        
     64736
    6473764737                /*
    6473864738                 * The HTML structure that we want to generate in this function is:
     
    6478664786                                        .append( table )
    6478764787                        );
    64788        
     64788
    6478964789                if ( footer ) {
    6479064790                        scroller.append(
     
    6480964809                        );
    6481064810                }
    64811        
     64811
    6481264812                var children = scroller.children();
    6481364813                var scrollHead = children[0];
    6481464814                var scrollBody = children[1];
    6481564815                var scrollFoot = footer ? children[2] : null;
    64816        
     64816
    6481764817                // When the body is scrolled, then we also want to scroll the headers
    6481864818                if ( scrollX ) {
    6481964819                        $(scrollBody).on( 'scroll.DT', function (e) {
    6482064820                                var scrollLeft = this.scrollLeft;
    64821        
     64821
    6482264822                                scrollHead.scrollLeft = scrollLeft;
    64823        
     64823
    6482464824                                if ( footer ) {
    6482564825                                        scrollFoot.scrollLeft = scrollLeft;
     
    6482764827                        } );
    6482864828                }
    64829        
     64829
    6483064830                $(scrollBody).css(
    64831                         scrollY && scroll.bCollapse ? 'max-height' : 'height', 
     64831                        scrollY && scroll.bCollapse ? 'max-height' : 'height',
    6483264832                        scrollY
    6483364833                );
    64834        
     64834
    6483564835                settings.nScrollHead = scrollHead;
    6483664836                settings.nScrollBody = scrollBody;
    6483764837                settings.nScrollFoot = scrollFoot;
    64838        
     64838
    6483964839                // On redraw - align columns
    6484064840                settings.aoDrawCallback.push( {
     
    6484264842                        "sName": "scrolling"
    6484364843                } );
    64844        
     64844
    6484564845                return scroller[0];
    6484664846        }
    64847        
    64848        
    64849        
     64847
     64848
     64849
    6485064850        /**
    6485164851         * Update the header, footer and body tables for resizing - i.e. column
     
    6490564905                                style.height = 0;
    6490664906                        };
    64907        
     64907
    6490864908                // If the scrollbar visibility has changed from the last draw, we need to
    6490964909                // adjust the column sizes as the table width will have changed to account
    6491064910                // for the scrollbar
    6491164911                var scrollBarVis = divBodyEl.scrollHeight > divBodyEl.clientHeight;
    64912                
     64912
    6491364913                if ( settings.scrollBarVis !== scrollBarVis && settings.scrollBarVis !== undefined ) {
    6491464914                        settings.scrollBarVis = scrollBarVis;
     
    6491964919                        settings.scrollBarVis = scrollBarVis;
    6492064920                }
    64921        
     64921
    6492264922                /*
    6492364923                 * 1. Re-create the table inside the scrolling div
    6492464924                 */
    64925        
     64925
    6492664926                // Remove the old minimised thead and tfoot elements in the inner table
    6492764927                table.children('thead, tfoot').remove();
    64928        
     64928
    6492964929                if ( footer ) {
    6493064930                        footerCopy = footer.clone().prependTo( table );
     
    6493264932                        footerSrcEls = footerCopy.find('tr');
    6493364933                }
    64934        
     64934
    6493564935                // Clone the current header and footer elements and then place it into the inner table
    6493664936                headerCopy = header.clone().prependTo( table );
     
    6493864938                headerSrcEls = headerCopy.find('tr');
    6493964939                headerCopy.find('th, td').removeAttr('tabindex');
    64940        
    64941        
     64940
     64941
    6494264942                /*
    6494364943                 * 2. Take live measurements from the DOM - do not alter the DOM itself!
    6494464944                 */
    64945        
     64945
    6494664946                // Remove old sizing and apply the calculated column widths
    6494764947                // Get the unique column headers in the newly created (cloned) header. We want to apply the
     
    6495264952                        divHeader[0].style.width = '100%';
    6495364953                }
    64954        
     64954
    6495564955                $.each( _fnGetUniqueThs( settings, headerCopy ), function ( i, el ) {
    6495664956                        idx = _fnVisibleToColumnIndex( settings, i );
    6495764957                        el.style.width = settings.aoColumns[idx].sWidth;
    6495864958                } );
    64959        
     64959
    6496064960                if ( footer ) {
    6496164961                        _fnApplyToChildren( function(n) {
     
    6496364963                        }, footerSrcEls );
    6496464964                }
    64965        
     64965
    6496664966                // Size the table as a whole
    6496764967                sanityWidth = table.outerWidth();
     
    6496964969                        // No x scrolling
    6497064970                        tableStyle.width = "100%";
    64971        
     64971
    6497264972                        // IE7 will make the width of the table when 100% include the scrollbar
    6497364973                        // - which is shouldn't. When there is a scrollbar we need to take this
     
    6497864978                                tableStyle.width = _fnStringToCss( table.outerWidth() - barWidth);
    6497964979                        }
    64980        
     64980
    6498164981                        // Recalculate the sanity width
    6498264982                        sanityWidth = table.outerWidth();
     
    6498564985                        // legacy x scroll inner has been given - use it
    6498664986                        tableStyle.width = _fnStringToCss(scrollXInner);
    64987        
     64987
    6498864988                        // Recalculate the sanity width
    6498964989                        sanityWidth = table.outerWidth();
    6499064990                }
    64991        
     64991
    6499264992                // Hidden header should have zero height, so remove padding and borders. Then
    6499364993                // set the width based on the real headers
    64994        
     64994
    6499564995                // Apply all styles in one pass
    6499664996                _fnApplyToChildren( zeroOut, headerSrcEls );
    64997        
     64997
    6499864998                // Read all widths in next pass
    6499964999                _fnApplyToChildren( function(nSizer) {
     
    6500165001                        headerWidths.push( _fnStringToCss( $(nSizer).css('width') ) );
    6500265002                }, headerSrcEls );
    65003        
     65003
    6500465004                // Apply all widths in final pass
    6500565005                _fnApplyToChildren( function(nToSize, i) {
     
    6501065010                        }
    6501165011                }, headerTrgEls );
    65012        
     65012
    6501365013                $(headerSrcEls).height(0);
    65014        
     65014
    6501565015                /* Same again with the footer if we have one */
    6501665016                if ( footer )
    6501765017                {
    6501865018                        _fnApplyToChildren( zeroOut, footerSrcEls );
    65019        
     65019
    6502065020                        _fnApplyToChildren( function(nSizer) {
    6502165021                                footerContent.push( nSizer.innerHTML );
    6502265022                                footerWidths.push( _fnStringToCss( $(nSizer).css('width') ) );
    6502365023                        }, footerSrcEls );
    65024        
     65024
    6502565025                        _fnApplyToChildren( function(nToSize, i) {
    6502665026                                nToSize.style.width = footerWidths[i];
    6502765027                        }, footerTrgEls );
    65028        
     65028
    6502965029                        $(footerSrcEls).height(0);
    6503065030                }
    65031        
    65032        
     65031
     65032
    6503365033                /*
    6503465034                 * 3. Apply the measurements
    6503565035                 */
    65036        
     65036
    6503765037                // "Hide" the header and footer that we used for the sizing. We need to keep
    6503865038                // the content of the cell so that the width applied to the header and body
     
    6504565045                        nSizer.style.width = headerWidths[i];
    6504665046                }, headerSrcEls );
    65047        
     65047
    6504865048                if ( footer )
    6504965049                {
     
    6505565055                        }, footerSrcEls );
    6505665056                }
    65057        
     65057
    6505865058                // Sanity check that the table is of a sensible width. If not then we are going to get
    6505965059                // misalignment - try to prevent this by not allowing the table to shrink below its min width
     
    6506565065                                        sanityWidth+barWidth :
    6506665066                                        sanityWidth;
    65067        
     65067
    6506865068                        // IE6/7 are a law unto themselves...
    6506965069                        if ( ie67 && (divBodyEl.scrollHeight >
     
    6507265072                                tableStyle.width = _fnStringToCss( correction-barWidth );
    6507365073                        }
    65074        
     65074
    6507565075                        // And give the user a warning that we've stopped the table getting too small
    6507665076                        if ( scrollX === "" || scrollXInner !== "" ) {
     
    6508265082                        correction = '100%';
    6508365083                }
    65084        
     65084
    6508565085                // Apply to the container elements
    6508665086                divBodyStyle.width = _fnStringToCss( correction );
    6508765087                divHeaderStyle.width = _fnStringToCss( correction );
    65088        
     65088
    6508965089                if ( footer ) {
    6509065090                        settings.nScrollFoot.style.width = _fnStringToCss( correction );
    6509165091                }
    65092        
    65093        
     65092
     65093
    6509465094                /*
    6509565095                 * 4. Clean up
     
    6510465104                        }
    6510565105                }
    65106        
     65106
    6510765107                /* Finally set the width's of the header and footer tables */
    6510865108                var iOuterWidth = table.outerWidth();
    6510965109                divHeaderTable[0].style.width = _fnStringToCss( iOuterWidth );
    6511065110                divHeaderInnerStyle.width = _fnStringToCss( iOuterWidth );
    65111        
     65111
    6511265112                // Figure out if there are scrollbar present - if so then we need a the header and footer to
    6511365113                // provide a bit more space to allow "overflow" scrolling (i.e. past the scrollbar)
     
    6511565115                var padding = 'padding' + (browser.bScrollbarLeft ? 'Left' : 'Right' );
    6511665116                divHeaderInnerStyle[ padding ] = bScrolling ? barWidth+"px" : "0px";
    65117        
     65117
    6511865118                if ( footer ) {
    6511965119                        divFooterTable[0].style.width = _fnStringToCss( iOuterWidth );
     
    6512165121                        divFooterInner[0].style[padding] = bScrolling ? barWidth+"px" : "0px";
    6512265122                }
    65123        
     65123
    6512465124                // Correct DOM ordering for colgroup - comes before the thead
    6512565125                table.children('colgroup').insertBefore( table.children('thead') );
    65126        
     65126
    6512765127                /* Adjust the position of the header in case we loose the y-scrollbar */
    6512865128                divBody.trigger('scroll');
    65129        
     65129
    6513065130                // If sorting or filtering has occurred, jump the scrolling back to the top
    6513165131                // only if we aren't holding the position
     
    6513465134                }
    6513565135        }
    65136        
    65137        
    65138        
     65136
     65137
     65138
    6513965139        /**
    6514065140         * Apply a given function to the display child nodes of an element array (typically
     
    6514965149                var index=0, i=0, iLen=an1.length;
    6515065150                var nNode1, nNode2;
    65151        
     65151
    6515265152                while ( i < iLen ) {
    6515365153                        nNode1 = an1[i].firstChild;
    6515465154                        nNode2 = an2 ? an2[i].firstChild : null;
    65155        
     65155
    6515665156                        while ( nNode1 ) {
    6515765157                                if ( nNode1.nodeType === 1 ) {
     
    6516265162                                                fn( nNode1, index );
    6516365163                                        }
    65164        
     65164
    6516565165                                        index++;
    6516665166                                }
    65167        
     65167
    6516865168                                nNode1 = nNode1.nextSibling;
    6516965169                                nNode2 = an2 ? nNode2.nextSibling : null;
    6517065170                        }
    65171        
     65171
    6517265172                        i++;
    6517365173                }
    6517465174        }
    65175        
    65176        
    65177        
     65175
     65176
     65177
    6517865178        var __re_html_remove = /<.*?>/g;
    65179        
    65180        
     65179
     65180
    6518165181        /**
    6518265182         * Calculate the width of columns for the table
     
    6520265202                        browser = oSettings.oBrowser,
    6520365203                        ie67 = browser.bScrollOversize;
    65204        
     65204
    6520565205                var styleWidth = table.style.width;
    6520665206                if ( styleWidth && styleWidth.indexOf('%') !== -1 ) {
    6520765207                        tableWidthAttr = styleWidth;
    6520865208                }
    65209        
     65209
    6521065210                /* Convert any user input sizes into pixel sizes */
    6521165211                for ( i=0 ; i<visibleColumns.length ; i++ ) {
    6521265212                        column = columns[ visibleColumns[i] ];
    65213        
     65213
    6521465214                        if ( column.sWidth !== null ) {
    6521565215                                column.sWidth = _fnConvertToWidth( column.sWidthOrig, tableContainer );
    65216        
     65216
    6521765217                                userInputs = true;
    6521865218                        }
    6521965219                }
    65220        
     65220
    6522165221                /* If the number of columns in the DOM equals the number that we have to
    6522265222                 * process in DataTables, then we can use the offsets that are created by
     
    6523065230                        for ( i=0 ; i<columnCount ; i++ ) {
    6523165231                                var colIdx = _fnVisibleToColumnIndex( oSettings, i );
    65232        
     65232
    6523365233                                if ( colIdx !== null ) {
    6523465234                                        columns[ colIdx ].sWidth = _fnStringToCss( headerCells.eq(i).width() );
     
    6524565245                                .css( 'visibility', 'hidden' )
    6524665246                                .removeAttr( 'id' );
    65247        
     65247
    6524865248                        // Clean up the table body
    6524965249                        tmpTable.find('tbody tr').remove();
    6525065250                        var tr = $('<tr/>').appendTo( tmpTable.find('tbody') );
    65251        
     65251
    6525265252                        // Clone the table header and footer - we can't use the header / footer
    6525365253                        // from the cloned table, since if scrolling is active, the table's
     
    6525765257                                .append( $(oSettings.nTHead).clone() )
    6525865258                                .append( $(oSettings.nTFoot).clone() );
    65259        
     65259
    6526065260                        // Remove any assigned widths from the footer (from scrolling)
    6526165261                        tmpTable.find('tfoot th, tfoot td').css('width', '');
    65262        
     65262
    6526365263                        // Apply custom sizing to the cloned header
    6526465264                        headerCells = _fnGetUniqueThs( oSettings, tmpTable.find('thead')[0] );
    65265        
     65265
    6526665266                        for ( i=0 ; i<visibleColumns.length ; i++ ) {
    6526765267                                column = columns[ visibleColumns[i] ];
    65268        
     65268
    6526965269                                headerCells[i].style.width = column.sWidthOrig !== null && column.sWidthOrig !== '' ?
    6527065270                                        _fnStringToCss( column.sWidthOrig ) :
    6527165271                                        '';
    65272        
     65272
    6527365273                                // For scrollX we need to force the column width otherwise the
    6527465274                                // browser will collapse it. If this width is smaller than the
     
    6528465284                                }
    6528565285                        }
    65286        
     65286
    6528765287                        // Find the widest cell for each column and put it into the table
    6528865288                        if ( oSettings.aoData.length ) {
     
    6529065290                                        columnIdx = visibleColumns[i];
    6529165291                                        column = columns[ columnIdx ];
    65292        
     65292
    6529365293                                        $( _fnGetWidestNode( oSettings, columnIdx ) )
    6529465294                                                .clone( false )
     
    6529765297                                }
    6529865298                        }
    65299        
     65299
    6530065300                        // Tidy the temporary table - remove name attributes so there aren't
    6530165301                        // duplicated in the dom (radio elements for example)
    6530265302                        $('[name]', tmpTable).removeAttr('name');
    65303        
     65303
    6530465304                        // Table has been built, attach to the document so we can work with it.
    6530565305                        // A holding element is used, positioned at the top of the container
     
    6532065320                                .append( tmpTable )
    6532165321                                .appendTo( tableContainer );
    65322        
    65323                         // When scrolling (X or Y) we want to set the width of the table as 
     65322
     65323                        // When scrolling (X or Y) we want to set the width of the table as
    6532465324                        // appropriate. However, when not scrolling leave the table width as it
    6532565325                        // is. This results in slightly different, but I think correct behaviour
     
    6533065330                                tmpTable.css( 'width', 'auto' );
    6533165331                                tmpTable.removeAttr('width');
    65332        
     65332
    6533365333                                // If there is no width attribute or style, then allow the table to
    6533465334                                // collapse
     
    6534365343                                tmpTable.width( tableWidthAttr );
    6534465344                        }
    65345        
     65345
    6534665346                        // Get the width of each column in the constructed table - we need to
    6534765347                        // know the inner width (so it can be assigned to the other table's
     
    6535465354                                var cell = $(headerCells[i]);
    6535565355                                var border = cell.outerWidth() - cell.width();
    65356        
     65356
    6535765357                                // Use getBounding... where possible (not IE8-) because it can give
    6535865358                                // sub-pixel accuracy, which we then want to round up!
     
    6536065360                                        Math.ceil( headerCells[i].getBoundingClientRect().width ) :
    6536165361                                        cell.outerWidth();
    65362        
     65362
    6536365363                                // Total is tracked to remove any sub-pixel errors as the outerWidth
    6536465364                                // of the table might not equal the total given here (IE!).
    6536565365                                total += bounding;
    65366        
     65366
    6536765367                                // Width for each column to use
    6536865368                                columns[ visibleColumns[i] ].sWidth = _fnStringToCss( bounding - border );
    6536965369                        }
    65370        
     65370
    6537165371                        table.style.width = _fnStringToCss( total );
    65372        
     65372
    6537365373                        // Finished with the table - ditch it
    6537465374                        holder.remove();
    6537565375                }
    65376        
     65376
    6537765377                // If there is a width attr, we want to attach an event listener which
    6537865378                // allows the table sizing to automatically adjust when the window is
     
    6538265382                        table.style.width = _fnStringToCss( tableWidthAttr );
    6538365383                }
    65384        
     65384
    6538565385                if ( (tableWidthAttr || scrollX) && ! oSettings._reszEvt ) {
    6538665386                        var bindResize = function () {
     
    6538965389                                } ) );
    6539065390                        };
    65391        
     65391
    6539265392                        // IE6/7 will crash if we bind a resize event handler on page load.
    6539365393                        // To be removed in 1.11 which drops IE6/7 support
     
    6539865398                                bindResize();
    6539965399                        }
    65400        
     65400
    6540165401                        oSettings._reszEvt = true;
    6540265402                }
    6540365403        }
    65404        
    65405        
     65404
     65405
    6540665406        /**
    6540765407         * Throttle the calls to a function. Arguments and context are maintained for
     
    6541365413         */
    6541465414        var _fnThrottle = DataTable.util.throttle;
    65415        
    65416        
     65415
     65416
    6541765417        /**
    6541865418         * Convert a CSS unit width to pixels (e.g. 2em)
     
    6542765427                        return 0;
    6542865428                }
    65429        
     65429
    6543065430                var n = $('<div/>')
    6543165431                        .css( 'width', _fnStringToCss( width ) )
    6543265432                        .appendTo( parent || document.body );
    65433        
     65433
    6543465434                var val = n[0].offsetWidth;
    6543565435                n.remove();
    65436        
     65436
    6543765437                return val;
    6543865438        }
    65439        
    65440        
     65439
     65440
    6544165441        /**
    6544265442         * Get the widest node
     
    6545265452                        return null;
    6545365453                }
    65454        
     65454
    6545565455                var data = settings.aoData[ idx ];
    6545665456                return ! data.nTr ? // Might not have been created when deferred rendering
     
    6545865458                        data.anCells[ colIdx ];
    6545965459        }
    65460        
    65461        
     65460
     65461
    6546265462        /**
    6546365463         * Get the maximum strlen for each data column
     
    6547065470        {
    6547165471                var s, max=-1, maxIdx = -1;
    65472        
     65472
    6547365473                for ( var i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
    6547465474                        s = _fnGetCellData( settings, i, colIdx, 'display' )+'';
    6547565475                        s = s.replace( __re_html_remove, '' );
    6547665476                        s = s.replace( /&nbsp;/g, ' ' );
    65477        
     65477
    6547865478                        if ( s.length > max ) {
    6547965479                                max = s.length;
     
    6548165481                        }
    6548265482                }
    65483        
     65483
    6548465484                return maxIdx;
    6548565485        }
    65486        
    65487        
     65486
     65487
    6548865488        /**
    6548965489         * Append a CSS unit (only if required) to a string
     
    6549765497                        return '0px';
    6549865498                }
    65499        
     65499
    6550065500                if ( typeof s == 'number' ) {
    6550165501                        return s < 0 ?
     
    6550365503                                s+'px';
    6550465504                }
    65505        
     65505
    6550665506                // Check it has a unit character already
    6550765507                return s.match(/\d$/) ?
     
    6550965509                        s;
    6551065510        }
    65511        
    65512        
    65513        
     65511
     65512
     65513
    6551465514        function _fnSortFlatten ( settings )
    6551565515        {
     
    6553365533                                }
    6553465534                        };
    65535        
     65535
    6553665536                // Build the sort array, with pre-fix and post-fix options if they have been
    6553765537                // specified
     
    6553965539                        add( fixed );
    6554065540                }
    65541        
     65541
    6554265542                if ( fixedObj && fixed.pre ) {
    6554365543                        add( fixed.pre );
    6554465544                }
    65545        
     65545
    6554665546                add( settings.aaSorting );
    65547        
     65547
    6554865548                if (fixedObj && fixed.post ) {
    6554965549                        add( fixed.post );
    6555065550                }
    65551        
     65551
    6555265552                for ( i=0 ; i<nestedSort.length ; i++ )
    6555365553                {
    6555465554                        srcCol = nestedSort[i][0];
    6555565555                        aDataSort = aoColumns[ srcCol ].aDataSort;
    65556        
     65556
    6555765557                        for ( k=0, kLen=aDataSort.length ; k<kLen ; k++ )
    6555865558                        {
    6555965559                                iCol = aDataSort[k];
    6556065560                                sType = aoColumns[ iCol ].sType || 'string';
    65561        
     65561
    6556265562                                if ( nestedSort[i]._idx === undefined ) {
    6556365563                                        nestedSort[i]._idx = $.inArray( nestedSort[i][1], aoColumns[iCol].asSorting );
    6556465564                                }
    65565        
     65565
    6556665566                                aSort.push( {
    6556765567                                        src:       srcCol,
     
    6557465574                        }
    6557565575                }
    65576        
     65576
    6557765577                return aSort;
    6557865578        }
    65579        
     65579
    6558065580        /**
    6558165581         * Change the order of the table
     
    6559865598                        displayMaster = oSettings.aiDisplayMaster,
    6559965599                        aSort;
    65600        
     65600
    6560165601                // Resolve any column types that are unknown due to addition or invalidation
    6560265602                // @todo Can this be moved into a 'data-ready' handler which is called when
    6560365603                //   data is going to be used in the table?
    6560465604                _fnColumnTypes( oSettings );
    65605        
     65605
    6560665606                aSort = _fnSortFlatten( oSettings );
    65607        
     65607
    6560865608                for ( i=0, ien=aSort.length ; i<ien ; i++ ) {
    6560965609                        sortCol = aSort[i];
    65610        
     65610
    6561165611                        // Track if we can use the fast sort algorithm
    6561265612                        if ( sortCol.formatter ) {
    6561365613                                formatters++;
    6561465614                        }
    65615        
     65615
    6561665616                        // Load the data needed for the sort, for each cell
    6561765617                        _fnSortData( oSettings, sortCol.col );
    6561865618                }
    65619        
     65619
    6562065620                /* No sorting required if server-side or no sorting array */
    6562165621                if ( _fnDataSource( oSettings ) != 'ssp' && aSort.length !== 0 )
     
    6562665626                                aiOrig[ displayMaster[i] ] = i;
    6562765627                        }
    65628        
     65628
    6562965629                        /* Do the sort - here we want multi-column sorting based on a given data source (column)
    6563065630                         * and sorting function (from oSort) in a certain direction. It's reasonably complex to
     
    6565665656                                                dataA = aoData[a]._aSortData,
    6565765657                                                dataB = aoData[b]._aSortData;
    65658        
     65658
    6565965659                                        for ( k=0 ; k<len ; k++ ) {
    6566065660                                                sort = aSort[k];
    65661        
     65661
    6566265662                                                x = dataA[ sort.col ];
    6566365663                                                y = dataB[ sort.col ];
    65664        
     65664
    6566565665                                                test = x<y ? -1 : x>y ? 1 : 0;
    6566665666                                                if ( test !== 0 ) {
     
    6566865668                                                }
    6566965669                                        }
    65670        
     65670
    6567165671                                        x = aiOrig[a];
    6567265672                                        y = aiOrig[b];
     
    6568465684                                                dataA = aoData[a]._aSortData,
    6568565685                                                dataB = aoData[b]._aSortData;
    65686        
     65686
    6568765687                                        for ( k=0 ; k<len ; k++ ) {
    6568865688                                                sort = aSort[k];
    65689        
     65689
    6569065690                                                x = dataA[ sort.col ];
    6569165691                                                y = dataB[ sort.col ];
    65692        
     65692
    6569365693                                                fn = oExtSort[ sort.type+"-"+sort.dir ] || oExtSort[ "string-"+sort.dir ];
    6569465694                                                test = fn( x, y );
     
    6569765697                                                }
    6569865698                                        }
    65699        
     65699
    6570065700                                        x = aiOrig[a];
    6570165701                                        y = aiOrig[b];
     
    6570465704                        }
    6570565705                }
    65706        
     65706
    6570765707                /* Tell the draw function that we have sorted the data */
    6570865708                oSettings.bSorted = true;
    6570965709        }
    65710        
    65711        
     65710
     65711
    6571265712        function _fnSortAria ( settings )
    6571365713        {
     
    6571765717                var aSort = _fnSortFlatten( settings );
    6571865718                var oAria = settings.oLanguage.oAria;
    65719        
     65719
    6572065720                // ARIA attributes - need to loop all columns, to update all (removing old
    6572165721                // attributes as needed)
     
    6572665726                        var sTitle = col.sTitle.replace( /<.*?>/g, "" );
    6572765727                        var th = col.nTh;
    65728        
     65728
    6572965729                        // IE7 is throwing an error when setting these properties with jQuery's
    6573065730                        // attr() and removeAttr() methods...
    6573165731                        th.removeAttribute('aria-sort');
    65732        
     65732
    6573365733                        /* In ARIA only the first sorting column can be marked as sorting - no multi-sort option */
    6573465734                        if ( col.bSortable ) {
     
    6574065740                                        nextSort = asSorting[0];
    6574165741                                }
    65742        
     65742
    6574365743                                label = sTitle + ( nextSort === "asc" ?
    6574465744                                        oAria.sSortAscending :
     
    6574965749                                label = sTitle;
    6575065750                        }
    65751        
     65751
    6575265752                        th.setAttribute('aria-label', label);
    6575365753                }
    6575465754        }
    65755        
    65756        
     65755
     65756
    6575765757        /**
    6575865758         * Function to run on user sort request
     
    6577665776                                idx = $.inArray( a[1], asSorting );
    6577765777                        }
    65778        
     65778
    6577965779                        return idx+1 < asSorting.length ?
    6578065780                                idx+1 :
     
    6578365783                                        0;
    6578465784                };
    65785        
     65785
    6578665786                // Convert to 2D array if needed
    6578765787                if ( typeof sorting[0] === 'number' ) {
    6578865788                        sorting = settings.aaSorting = [ sorting ];
    6578965789                }
    65790        
     65790
    6579165791                // If appending the sort then we are multi-column sorting
    6579265792                if ( append && settings.oFeatures.bSortMulti ) {
    6579365793                        // Are we already doing some kind of sort on this column?
    6579465794                        var sortIdx = $.inArray( colIdx, _pluck(sorting, '0') );
    65795        
     65795
    6579665796                        if ( sortIdx !== -1 ) {
    6579765797                                // Yes, modify the sort
    6579865798                                nextSortIdx = next( sorting[sortIdx], true );
    65799        
     65799
    6580065800                                if ( nextSortIdx === null && sorting.length === 1 ) {
    6580165801                                        nextSortIdx = 0; // can't remove sorting completely
    6580265802                                }
    65803        
     65803
    6580465804                                if ( nextSortIdx === null ) {
    6580565805                                        sorting.splice( sortIdx, 1 );
     
    6581965819                        // Single column - already sorting on this column, modify the sort
    6582065820                        nextSortIdx = next( sorting[0] );
    65821        
     65821
    6582265822                        sorting.length = 1;
    6582365823                        sorting[0][1] = asSorting[ nextSortIdx ];
     
    6583065830                        sorting[0]._idx = 0;
    6583165831                }
    65832        
     65832
    6583365833                // Run the sort by calling a full redraw
    6583465834                _fnReDraw( settings );
    65835        
     65835
    6583665836                // callback used for async user interaction
    6583765837                if ( typeof callback == 'function' ) {
     
    6583965839                }
    6584065840        }
    65841        
    65842        
     65841
     65842
    6584365843        /**
    6584465844         * Attach a sort handler (click) to a node
     
    6585265852        {
    6585365853                var col = settings.aoColumns[ colIdx ];
    65854        
     65854
    6585565855                _fnBindAction( attachTo, {}, function (e) {
    6585665856                        /* If the column is not sortable - don't to anything */
     
    6585865858                                return;
    6585965859                        }
    65860        
     65860
    6586165861                        // If processing is enabled use a timeout to allow the processing
    6586265862                        // display to be shown - otherwise to it synchronously
    6586365863                        if ( settings.oFeatures.bProcessing ) {
    6586465864                                _fnProcessingDisplay( settings, true );
    65865        
     65865
    6586665866                                setTimeout( function() {
    6586765867                                        _fnSortListener( settings, colIdx, e.shiftKey, callback );
    65868        
     65868
    6586965869                                        // In server-side processing, the draw callback will remove the
    6587065870                                        // processing display
     
    6587965879                } );
    6588065880        }
    65881        
    65882        
     65881
     65882
    6588365883        /**
    6588465884         * Set the sorting classes on table's body, Note: it is safe to call this function
     
    6589465894                var features = settings.oFeatures;
    6589565895                var i, ien, colIdx;
    65896        
     65896
    6589765897                if ( features.bSort && features.bSortClasses ) {
    6589865898                        // Remove old sorting classes
    6589965899                        for ( i=0, ien=oldSort.length ; i<ien ; i++ ) {
    6590065900                                colIdx = oldSort[i].src;
    65901        
     65901
    6590265902                                // Remove column sorting
    6590365903                                $( _pluck( settings.aoData, 'anCells', colIdx ) )
    6590465904                                        .removeClass( sortClass + (i<2 ? i+1 : 3) );
    6590565905                        }
    65906        
     65906
    6590765907                        // Add new column sorting
    6590865908                        for ( i=0, ien=sort.length ; i<ien ; i++ ) {
    6590965909                                colIdx = sort[i].src;
    65910        
     65910
    6591165911                                $( _pluck( settings.aoData, 'anCells', colIdx ) )
    6591265912                                        .addClass( sortClass + (i<2 ? i+1 : 3) );
    6591365913                        }
    6591465914                }
    65915        
     65915
    6591665916                settings.aLastSort = sort;
    6591765917        }
    65918        
    65919        
     65918
     65919
    6592065920        // Get the data to sort a column, be it from cache, fresh (populating the
    6592165921        // cache), or from a sort formatter
     
    6592665926                var customSort = DataTable.ext.order[ column.sSortDataType ];
    6592765927                var customData;
    65928        
     65928
    6592965929                if ( customSort ) {
    6593065930                        customData = customSort.call( settings.oInstance, settings, idx,
     
    6593265932                        );
    6593365933                }
    65934        
     65934
    6593565935                // Use / populate cache
    6593665936                var row, cellData;
    6593765937                var formatter = DataTable.ext.type.order[ column.sType+"-pre" ];
    65938        
     65938
    6593965939                for ( var i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
    6594065940                        row = settings.aoData[i];
    65941        
     65941
    6594265942                        if ( ! row._aSortData ) {
    6594365943                                row._aSortData = [];
    6594465944                        }
    65945        
     65945
    6594665946                        if ( ! row._aSortData[idx] || customSort ) {
    6594765947                                cellData = customSort ?
    6594865948                                        customData[i] : // If there was a custom sort function, use data from there
    6594965949                                        _fnGetCellData( settings, i, idx, 'sort' );
    65950        
     65950
    6595165951                                row._aSortData[ idx ] = formatter ?
    6595265952                                        formatter( cellData ) :
     
    6595565955                }
    6595665956        }
    65957        
    65958        
    65959        
     65957
     65958
     65959
    6596065960        /**
    6596165961         * Save the state of a table
     
    6596965969                        return;
    6597065970                }
    65971        
     65971
    6597265972                /* Store the interesting variables */
    6597365973                var state = {
     
    6598465984                        } )
    6598565985                };
    65986        
     65986
    6598765987                _fnCallbackFire( settings, "aoStateSaveParams", 'stateSaveParams', [settings, state] );
    65988        
     65988
    6598965989                settings.oSavedState = state;
    6599065990                settings.fnStateSaveCallback.call( settings.oInstance, settings, state );
    6599165991        }
    65992        
    65993        
     65992
     65993
    6599465994        /**
    6599565995         * Attempt to load a saved table state
     
    6600866008                                return;
    6600966009                        }
    66010        
     66010
    6601166011                        // Allow custom and plug-in manipulation functions to alter the saved data set and
    6601266012                        // cancelling of loading by returning false
     
    6601666016                                return;
    6601766017                        }
    66018        
     66018
    6601966019                        // Reject old data
    6602066020                        var duration = settings.iStateDuration;
     
    6602366023                                return;
    6602466024                        }
    66025        
     66025
    6602666026                        // Number of columns have changed - all bets are off, no restore of settings
    6602766027                        if ( s.columns && columns.length !== s.columns.length ) {
     
    6602966029                                return;
    6603066030                        }
    66031        
     66031
    6603266032                        // Store the saved state so it might be accessed at any time
    6603366033                        settings.oLoadedState = $.extend( true, {}, s );
    66034        
     66034
    6603566035                        // Restore key features - todo - for 1.11 this needs to be done by
    6603666036                        // subscribed events
     
    6604266042                                settings._iDisplayLength   = s.length;
    6604366043                        }
    66044        
     66044
    6604566045                        // Order
    6604666046                        if ( s.order !== undefined ) {
     
    6605366053                                } );
    6605466054                        }
    66055        
     66055
    6605666056                        // Search
    6605766057                        if ( s.search !== undefined ) {
    6605866058                                $.extend( settings.oPreviousSearch, _fnSearchToHung( s.search ) );
    6605966059                        }
    66060        
     66060
    6606166061                        // Columns
    6606266062                        //
     
    6606466064                                for ( i=0, ien=s.columns.length ; i<ien ; i++ ) {
    6606566065                                        var col = s.columns[i];
    66066        
     66066
    6606766067                                        // Visibility
    6606866068                                        if ( col.visible !== undefined ) {
    6606966069                                                columns[i].bVisible = col.visible;
    6607066070                                        }
    66071        
     66071
    6607266072                                        // Search
    6607366073                                        if ( col.search !== undefined ) {
     
    6607666076                                }
    6607766077                        }
    66078        
     66078
    6607966079                        _fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, s] );
    6608066080                        callback();
    6608166081                };
    66082        
     66082
    6608366083                if ( ! settings.oFeatures.bStateSave ) {
    6608466084                        callback();
    6608566085                        return;
    6608666086                }
    66087        
     66087
    6608866088                var state = settings.fnStateLoadCallback.call( settings.oInstance, settings, loaded );
    66089        
     66089
    6609066090                if ( state !== undefined ) {
    6609166091                        loaded( state );
     
    6609366093                // otherwise, wait for the loaded callback to be executed
    6609466094        }
    66095        
    66096        
     66095
     66096
    6609766097        /**
    6609866098         * Return the settings object for a particular table
     
    6610566105                var settings = DataTable.settings;
    6610666106                var idx = $.inArray( table, _pluck( settings, 'nTable' ) );
    66107        
     66107
    6610866108                return idx !== -1 ?
    6610966109                        settings[ idx ] :
    6611066110                        null;
    6611166111        }
    66112        
    66113        
     66112
     66113
    6611466114        /**
    6611566115         * Log an error message
     
    6612466124                msg = 'DataTables warning: '+
    6612566125                        (settings ? 'table id='+settings.sTableId+' - ' : '')+msg;
    66126        
     66126
    6612766127                if ( tn ) {
    6612866128                        msg += '. For more information about this error, please see '+
    6612966129                        'http://datatables.net/tn/'+tn;
    6613066130                }
    66131        
     66131
    6613266132                if ( ! level  ) {
    6613366133                        // Backwards compatibility pre 1.10
    6613466134                        var ext = DataTable.ext;
    6613566135                        var type = ext.sErrMode || ext.errMode;
    66136        
     66136
    6613766137                        if ( settings ) {
    6613866138                                _fnCallbackFire( settings, null, 'error', [ settings, tn, msg ] );
    6613966139                        }
    66140        
     66140
    6614166141                        if ( type == 'alert' ) {
    6614266142                                alert( msg );
     
    6615366153                }
    6615466154        }
    66155        
    66156        
     66155
     66156
    6615766157        /**
    6615866158         * See if a property is defined on one object, if so assign it to the other object
     
    6617466174                                }
    6617566175                        } );
    66176        
     66176
    6617766177                        return;
    6617866178                }
    66179        
     66179
    6618066180                if ( mappedName === undefined ) {
    6618166181                        mappedName = name;
    6618266182                }
    66183        
     66183
    6618466184                if ( src[name] !== undefined ) {
    6618566185                        ret[mappedName] = src[name];
    6618666186                }
    6618766187        }
    66188        
    66189        
     66188
     66189
    6619066190        /**
    6619166191         * Extend objects - very similar to jQuery.extend, but deep copy objects, and
     
    6620866208        {
    6620966209                var val;
    66210        
     66210
    6621166211                for ( var prop in extender ) {
    6621266212                        if ( extender.hasOwnProperty(prop) ) {
    6621366213                                val = extender[prop];
    66214        
     66214
    6621566215                                if ( $.isPlainObject( val ) ) {
    6621666216                                        if ( ! $.isPlainObject( out[prop] ) ) {
     
    6622766227                        }
    6622866228                }
    66229        
     66229
    6623066230                return out;
    6623166231        }
    66232        
    66233        
     66232
     66233
    6623466234        /**
    6623566235         * Bind an event handers to allow a click or return key to activate the callback.
     
    6625966259                                } );
    6626066260        }
    66261        
    66262        
     66261
     66262
    6626366263        /**
    6626466264         * Register a callback function. Easily allows a callback function to be added to
     
    6628066280                }
    6628166281        }
    66282        
    66283        
     66282
     66283
    6628466284        /**
    6628566285         * Fire callback functions and trigger events. Note that the loop over the
     
    6629966299        {
    6630066300                var ret = [];
    66301        
     66301
    6630266302                if ( callbackArr ) {
    6630366303                        ret = $.map( settings[callbackArr].slice().reverse(), function (val, i) {
     
    6630566305                        } );
    6630666306                }
    66307        
     66307
    6630866308                if ( eventName !== null ) {
    6630966309                        var e = $.Event( eventName+'.dt' );
    66310        
     66310
    6631166311                        $(settings.nTable).trigger( e, args );
    66312        
     66312
    6631366313                        ret.push( e.result );
    6631466314                }
    66315        
     66315
    6631666316                return ret;
    6631766317        }
    66318        
    66319        
     66318
     66319
    6632066320        function _fnLengthOverflow ( settings )
    6632166321        {
     
    6632466324                        end = settings.fnDisplayEnd(),
    6632566325                        len = settings._iDisplayLength;
    66326        
     66326
    6632766327                /* If we have space to show extra rows (backing up from the end point - then do so */
    6632866328                if ( start >= end )
     
    6633066330                        start = end - len;
    6633166331                }
    66332        
     66332
    6633366333                // Keep the start record on the current page
    6633466334                start -= (start % len);
    66335        
     66335
    6633666336                if ( len === -1 || start < 0 )
    6633766337                {
    6633866338                        start = 0;
    6633966339                }
    66340        
     66340
    6634166341                settings._iDisplayStart = start;
    6634266342        }
    66343        
    66344        
     66343
     66344
    6634566345        function _fnRenderer( settings, type )
    6634666346        {
    6634766347                var renderer = settings.renderer;
    6634866348                var host = DataTable.ext.renderer[type];
    66349        
     66349
    6635066350                if ( $.isPlainObject( renderer ) && renderer[type] ) {
    6635166351                        // Specific renderer for this type. If available use it, otherwise use
     
    6635866358                        return host[renderer] || host._;
    6635966359                }
    66360        
     66360
    6636166361                // Use the default
    6636266362                return host._;
    6636366363        }
    66364        
    66365        
     66364
     66365
    6636666366        /**
    6636766367         * Detect the data source being used for the table. Used to simplify the code
     
    6638266382                return 'dom';
    6638366383        }
    66384        
    66385 
    66386        
    66387        
     66384
     66385
     66386
     66387
    6638866388        /**
    6638966389         * Computed structure of the DataTables API, defined by the options passed to
     
    6642366423         */
    6642466424        var __apiStruct = [];
    66425        
    66426        
     66425
     66426
    6642766427        /**
    6642866428         * `Array.prototype` reference.
     
    6643266432         */
    6643366433        var __arrayProto = Array.prototype;
    66434        
    66435        
     66434
     66435
    6643666436        /**
    6643766437         * Abstraction for `context` parameter of the `Api` constructor to allow it to
     
    6646166461                        return el.nTable;
    6646266462                } );
    66463        
     66463
    6646466464                if ( ! mixed ) {
    6646566465                        return [];
     
    6648566485                        jq = mixed;
    6648666486                }
    66487        
     66487
    6648866488                if ( jq ) {
    6648966489                        return jq.map( function(i) {
     
    6649366493                }
    6649466494        };
    66495        
    66496        
     66495
     66496
    6649766497        /**
    6649866498         * DataTables API class - used to control and interface with  one or more
     
    6655466554                        return new _Api( context, data );
    6655566555                }
    66556        
     66556
    6655766557                var settings = [];
    6655866558                var ctxSettings = function ( o ) {
     
    6656266562                        }
    6656366563                };
    66564        
     66564
    6656566565                if ( $.isArray( context ) ) {
    6656666566                        for ( var i=0, ien=context.length ; i<ien ; i++ ) {
     
    6657166571                        ctxSettings( context );
    6657266572                }
    66573        
     66573
    6657466574                // Remove duplicates
    6657566575                this.context = _unique( settings );
    66576        
     66576
    6657766577                // Initial data
    6657866578                if ( data ) {
    6657966579                        $.merge( this, data );
    6658066580                }
    66581        
     66581
    6658266582                // selector
    6658366583                this.selector = {
     
    6658666586                        opts: null
    6658766587                };
    66588        
     66588
    6658966589                _Api.extend( this, this, __apiStruct );
    6659066590        };
    66591        
     66591
    6659266592        DataTable.Api = _Api;
    66593        
     66593
    6659466594        // Don't destroy the existing prototype, just extend it. Required for jQuery 2's
    6659566595        // isPlainObject.
     
    6659966599                        return this.count() !== 0;
    6660066600                },
    66601        
    66602        
     66601
     66602
    6660366603                concat:  __arrayProto.concat,
    66604        
    66605        
     66604
     66605
    6660666606                context: [], // array of table settings objects
    66607        
    66608        
     66607
     66608
    6660966609                count: function ()
    6661066610                {
    6661166611                        return this.flatten().length;
    6661266612                },
    66613        
    66614        
     66613
     66614
    6661566615                each: function ( fn )
    6661666616                {
     
    6661866618                                fn.call( this, this[i], i, this );
    6661966619                        }
    66620        
     66620
    6662166621                        return this;
    6662266622                },
    66623        
    66624        
     66623
     66624
    6662566625                eq: function ( idx )
    6662666626                {
    6662766627                        var ctx = this.context;
    66628        
     66628
    6662966629                        return ctx.length > idx ?
    6663066630                                new _Api( ctx[idx], this[idx] ) :
    6663166631                                null;
    6663266632                },
    66633        
    66634        
     66633
     66634
    6663566635                filter: function ( fn )
    6663666636                {
    6663766637                        var a = [];
    66638        
     66638
    6663966639                        if ( __arrayProto.filter ) {
    6664066640                                a = __arrayProto.filter.call( this, fn, this );
     
    6664866648                                }
    6664966649                        }
    66650        
     66650
    6665166651                        return new _Api( this.context, a );
    6665266652                },
    66653        
    66654        
     66653
     66654
    6665566655                flatten: function ()
    6665666656                {
     
    6665866658                        return new _Api( this.context, a.concat.apply( a, this.toArray() ) );
    6665966659                },
    66660        
    66661        
     66660
     66661
    6666266662                join:    __arrayProto.join,
    66663        
    66664        
     66663
     66664
    6666566665                indexOf: __arrayProto.indexOf || function (obj, start)
    6666666666                {
     
    6667266672                        return -1;
    6667366673                },
    66674        
     66674
    6667566675                iterator: function ( flatten, type, fn, alwaysNew ) {
    6667666676                        var
     
    6668066680                                rows, items, item,
    6668166681                                selector = this.selector;
    66682        
     66682
    6668366683                        // Argument shifting
    6668466684                        if ( typeof flatten === 'string' ) {
     
    6668866688                                flatten = false;
    6668966689                        }
    66690        
     66690
    6669166691                        for ( i=0, ien=context.length ; i<ien ; i++ ) {
    6669266692                                var apiInst = new _Api( context[i] );
    66693        
     66693
    6669466694                                if ( type === 'table' ) {
    6669566695                                        ret = fn.call( apiInst, context[i], i );
    66696        
     66696
    6669766697                                        if ( ret !== undefined ) {
    6669866698                                                a.push( ret );
     
    6670266702                                        // this has same length as context - one entry for each table
    6670366703                                        ret = fn.call( apiInst, context[i], this[i], i );
    66704        
     66704
    6670566705                                        if ( ret !== undefined ) {
    6670666706                                                a.push( ret );
     
    6671166711                                        // 'this' is an array of column indexes for each context
    6671266712                                        items = this[i];
    66713        
     66713
    6671466714                                        if ( type === 'column-rows' ) {
    6671566715                                                rows = _selector_row_indexes( context[i], selector.opts );
    6671666716                                        }
    66717        
     66717
    6671866718                                        for ( j=0, jen=items.length ; j<jen ; j++ ) {
    6671966719                                                item = items[j];
    66720        
     66720
    6672166721                                                if ( type === 'cell' ) {
    6672266722                                                        ret = fn.call( apiInst, context[i], item.row, item.column, i, j );
     
    6672566725                                                        ret = fn.call( apiInst, context[i], item, i, j, rows );
    6672666726                                                }
    66727        
     66727
    6672866728                                                if ( ret !== undefined ) {
    6672966729                                                        a.push( ret );
     
    6673266732                                }
    6673366733                        }
    66734        
     66734
    6673566735                        if ( a.length || alwaysNew ) {
    6673666736                                var api = new _Api( context, flatten ? a.concat.apply( [], a ) : a );
     
    6674366743                        return this;
    6674466744                },
    66745        
    66746        
     66745
     66746
    6674766747                lastIndexOf: __arrayProto.lastIndexOf || function (obj, start)
    6674866748                {
     
    6675066750                        return this.indexOf.apply( this.toArray.reverse(), arguments );
    6675166751                },
    66752        
    66753        
     66752
     66753
    6675466754                length:  0,
    66755        
    66756        
     66755
     66756
    6675766757                map: function ( fn )
    6675866758                {
    6675966759                        var a = [];
    66760        
     66760
    6676166761                        if ( __arrayProto.map ) {
    6676266762                                a = __arrayProto.map.call( this, fn, this );
     
    6676866768                                }
    6676966769                        }
    66770        
     66770
    6677166771                        return new _Api( this.context, a );
    6677266772                },
    66773        
    66774        
     66773
     66774
    6677566775                pluck: function ( prop )
    6677666776                {
     
    6677966779                        } );
    6678066780                },
    66781        
     66781
    6678266782                pop:     __arrayProto.pop,
    66783        
    66784        
     66783
     66784
    6678566785                push:    __arrayProto.push,
    66786        
    66787        
     66786
     66787
    6678866788                // Does not return an API instance
    6678966789                reduce: __arrayProto.reduce || function ( fn, init )
     
    6679166791                        return _fnReduce( this, fn, init, 0, this.length, 1 );
    6679266792                },
    66793        
    66794        
     66793
     66794
    6679566795                reduceRight: __arrayProto.reduceRight || function ( fn, init )
    6679666796                {
    6679766797                        return _fnReduce( this, fn, init, this.length-1, -1, -1 );
    6679866798                },
    66799        
    66800        
     66799
     66800
    6680166801                reverse: __arrayProto.reverse,
    66802        
    66803        
     66802
     66803
    6680466804                // Object with rows, columns and opts
    6680566805                selector: null,
    66806        
    66807        
     66806
     66807
    6680866808                shift:   __arrayProto.shift,
    66809        
    66810        
     66809
     66810
    6681166811                slice: function () {
    6681266812                        return new _Api( this.context, this );
    6681366813                },
    66814        
    66815        
     66814
     66815
    6681666816                sort:    __arrayProto.sort, // ? name - order?
    66817        
    66818        
     66817
     66818
    6681966819                splice:  __arrayProto.splice,
    66820        
    66821        
     66820
     66821
    6682266822                toArray: function ()
    6682366823                {
    6682466824                        return __arrayProto.slice.call( this );
    6682566825                },
    66826        
    66827        
     66826
     66827
    6682866828                to$: function ()
    6682966829                {
    6683066830                        return $( this );
    6683166831                },
    66832        
    66833        
     66832
     66833
    6683466834                toJQuery: function ()
    6683566835                {
    6683666836                        return $( this );
    6683766837                },
    66838        
    66839        
     66838
     66839
    6684066840                unique: function ()
    6684166841                {
    6684266842                        return new _Api( this.context, _unique(this) );
    6684366843                },
    66844        
    66845        
     66844
     66845
    6684666846                unshift: __arrayProto.unshift
    6684766847        } );
    66848        
    66849        
     66848
     66849
    6685066850        _Api.extend = function ( scope, obj, ext )
    6685166851        {
     
    6685466854                        return;
    6685566855                }
    66856        
     66856
    6685766857                var
    6685866858                        i, ien,
     
    6686166861                                return function () {
    6686266862                                        var ret = fn.apply( scope, arguments );
    66863        
     66863
    6686466864                                        // Method extension
    6686566865                                        _Api.extend( ret, ret, struc.methodExt );
     
    6686766867                                };
    6686866868                        };
    66869        
     66869
    6687066870                for ( i=0, ien=ext.length ; i<ien ; i++ ) {
    6687166871                        struct = ext[i];
    66872        
     66872
    6687366873                        // Value
    6687466874                        obj[ struct.name ] = struct.type === 'function' ?
     
    6687766877                                        {} :
    6687866878                                        struct.val;
    66879        
     66879
    6688066880                        obj[ struct.name ].__dt_wrapper = true;
    66881        
     66881
    6688266882                        // Property extension
    6688366883                        _Api.extend( scope, obj[ struct.name ], struct.propExt );
    6688466884                }
    6688566885        };
    66886        
    66887        
     66886
     66887
    6688866888        // @todo - Is there need for an augment function?
    6688966889        // _Api.augment = function ( inst, name )
     
    6689166891        //      // Find src object in the structure from the name
    6689266892        //      var parts = name.split('.');
    66893        
     66893
    6689466894        //      _Api.extend( inst, obj );
    6689566895        // };
    66896        
    66897        
     66896
     66897
    6689866898        //     [
    6689966899        //       {
     
    6691866918        //       }
    6691966919        //     ]
    66920        
     66920
    6692166921        _Api.register = _api_register = function ( name, val )
    6692266922        {
     
    6692766927                        return;
    6692866928                }
    66929        
     66929
    6693066930                var
    6693166931                        i, ien,
     
    6693366933                        struct = __apiStruct,
    6693466934                        key, method;
    66935        
     66935
    6693666936                var find = function ( src, name ) {
    6693766937                        for ( var i=0, ien=src.length ; i<ien ; i++ ) {
     
    6694266942                        return null;
    6694366943                };
    66944        
     66944
    6694566945                for ( i=0, ien=heir.length ; i<ien ; i++ ) {
    6694666946                        method = heir[i].indexOf('()') !== -1;
     
    6694866948                                heir[i].replace('()', '') :
    6694966949                                heir[i];
    66950        
     66950
    6695166951                        var src = find( struct, key );
    6695266952                        if ( ! src ) {
     
    6696066960                                struct.push( src );
    6696166961                        }
    66962        
     66962
    6696366963                        if ( i === ien-1 ) {
    6696466964                                src.val = val;
     
    6697666976                }
    6697766977        };
    66978        
     66978
    6697966979        _Api.registerPlural = _api_registerPlural = function ( pluralName, singularName, val ) {
    6698066980                _Api.register( pluralName, val );
    66981        
     66981
    6698266982                _Api.register( singularName, function () {
    6698366983                        var ret = val.apply( this, arguments );
    66984        
     66984
    6698566985                        if ( ret === this ) {
    6698666986                                // Returned item is the API instance that was passed in, return it
     
    6699666996                                        undefined;
    6699766997                        }
    66998        
     66998
    6699966999                        // Non-API return - just fire it back
    6700067000                        return ret;
    6700167001                } );
    6700267002        };
    67003        
    67004        
     67003
     67004
    6700567005        /**
    6700667006         * Selector for HTML tables. Apply the given selector to the give array of
     
    6701867018                        return [ a[ selector ] ];
    6701967019                }
    67020        
     67020
    6702167021                // Perform a jQuery selector on the table nodes
    6702267022                var nodes = $.map( a, function (el, i) {
    6702367023                        return el.nTable;
    6702467024                } );
    67025        
     67025
    6702667026                return $(nodes)
    6702767027                        .filter( selector )
     
    6703367033                        .toArray();
    6703467034        };
    67035        
    67036        
    67037        
     67035
     67036
     67037
    6703867038        /**
    6703967039         * Context selector for the API's context (i.e. the tables the API instance
     
    6705367053                        this;
    6705467054        } );
    67055        
    67056        
     67055
     67056
    6705767057        _api_register( 'table()', function ( selector ) {
    6705867058                var tables = this.tables( selector );
    6705967059                var ctx = tables.context;
    67060        
     67060
    6706167061                // Truncate to the first matched table
    6706267062                return ctx.length ?
     
    6706467064                        tables;
    6706567065        } );
    67066        
    67067        
     67066
     67067
    6706867068        _api_registerPlural( 'tables().nodes()', 'table().node()' , function () {
    6706967069                return this.iterator( 'table', function ( ctx ) {
     
    6707167071                }, 1 );
    6707267072        } );
    67073        
    67074        
     67073
     67074
    6707567075        _api_registerPlural( 'tables().body()', 'table().body()' , function () {
    6707667076                return this.iterator( 'table', function ( ctx ) {
     
    6707867078                }, 1 );
    6707967079        } );
    67080        
    67081        
     67080
     67081
    6708267082        _api_registerPlural( 'tables().header()', 'table().header()' , function () {
    6708367083                return this.iterator( 'table', function ( ctx ) {
     
    6708567085                }, 1 );
    6708667086        } );
    67087        
    67088        
     67087
     67088
    6708967089        _api_registerPlural( 'tables().footer()', 'table().footer()' , function () {
    6709067090                return this.iterator( 'table', function ( ctx ) {
     
    6709267092                }, 1 );
    6709367093        } );
    67094        
    67095        
     67094
     67095
    6709667096        _api_registerPlural( 'tables().containers()', 'table().container()' , function () {
    6709767097                return this.iterator( 'table', function ( ctx ) {
     
    6709967099                }, 1 );
    6710067100        } );
    67101        
    67102        
    67103        
     67101
     67102
     67103
    6710467104        /**
    6710567105         * Redraw the tables in the current context.
     
    6711667116                                                true;
    6711767117                                }
    67118        
     67118
    6711967119                                _fnReDraw( settings, paging===false );
    6712067120                        }
    6712167121                } );
    6712267122        } );
    67123        
    67124        
    67125        
     67123
     67124
     67125
    6712667126        /**
    6712767127         * Get the current page index.
     
    6714767147                        return this.page.info().page; // not an expensive call
    6714867148                }
    67149        
     67149
    6715067150                // else, have an action to take on all tables
    6715167151                return this.iterator( 'table', function ( settings ) {
     
    6715367153                } );
    6715467154        } );
    67155        
    67156        
     67155
     67156
    6715767157        /**
    6715867158         * Paging information for the first table in the current context.
     
    6717767177                        return undefined;
    6717867178                }
    67179        
     67179
    6718067180                var
    6718167181                        settings   = this.context[0],
     
    6718467184                        visRecords = settings.fnRecordsDisplay(),
    6718567185                        all        = len === -1;
    67186        
     67186
    6718767187                return {
    6718867188                        "page":           all ? 0 : Math.floor( start / len ),
     
    6719667196                };
    6719767197        } );
    67198        
    67199        
     67198
     67199
    6720067200        /**
    6720167201         * Get the current page length.
     
    6721867218                                undefined;
    6721967219                }
    67220        
     67220
    6722167221                // else, set the page length
    6722267222                return this.iterator( 'table', function ( settings ) {
     
    6722467224                } );
    6722567225        } );
    67226        
    67227        
    67228        
     67226
     67227
     67228
    6722967229        var __reload = function ( settings, holdPosition, callback ) {
    6723067230                // Use the draw event to trigger a callback
    6723167231                if ( callback ) {
    6723267232                        var api = new _Api( settings );
    67233        
     67233
    6723467234                        api.one( 'draw', function () {
    6723567235                                callback( api.ajax.json() );
    6723667236                        } );
    6723767237                }
    67238        
     67238
    6723967239                if ( _fnDataSource( settings ) == 'ssp' ) {
    6724067240                        _fnReDraw( settings, holdPosition );
     
    6724267242                else {
    6724367243                        _fnProcessingDisplay( settings, true );
    67244        
     67244
    6724567245                        // Cancel an existing request
    6724667246                        var xhr = settings.jqXHR;
     
    6724867248                                xhr.abort();
    6724967249                        }
    67250        
     67250
    6725167251                        // Trigger xhr
    6725267252                        _fnBuildAjax( settings, [], function( json ) {
    6725367253                                _fnClearTable( settings );
    67254        
     67254
    6725567255                                var data = _fnAjaxDataSrc( settings, json );
    6725667256                                for ( var i=0, ien=data.length ; i<ien ; i++ ) {
    6725767257                                        _fnAddData( settings, data[i] );
    6725867258                                }
    67259        
     67259
    6726067260                                _fnReDraw( settings, holdPosition );
    6726167261                                _fnProcessingDisplay( settings, false );
     
    6726367263                }
    6726467264        };
    67265        
    67266        
     67265
     67266
    6726767267        /**
    6726867268         * Get the JSON response from the last Ajax request that DataTables made to the
     
    6727467274        _api_register( 'ajax.json()', function () {
    6727567275                var ctx = this.context;
    67276        
     67276
    6727767277                if ( ctx.length > 0 ) {
    6727867278                        return ctx[0].json;
    6727967279                }
    67280        
     67280
    6728167281                // else return undefined;
    6728267282        } );
    67283        
    67284        
     67283
     67284
    6728567285        /**
    6728667286         * Get the data submitted in the last Ajax request
     
    6728867288        _api_register( 'ajax.params()', function () {
    6728967289                var ctx = this.context;
    67290        
     67290
    6729167291                if ( ctx.length > 0 ) {
    6729267292                        return ctx[0].oAjaxData;
    6729367293                }
    67294        
     67294
    6729567295                // else return undefined;
    6729667296        } );
    67297        
    67298        
     67297
     67298
    6729967299        /**
    6730067300         * Reload tables from the Ajax data source. Note that this function will
     
    6731167311                } );
    6731267312        } );
    67313        
    67314        
     67313
     67314
    6731567315        /**
    6731667316         * Get the current Ajax URL. Note that this returns the URL from the first
     
    6732767327        _api_register( 'ajax.url()', function ( url ) {
    6732867328                var ctx = this.context;
    67329        
     67329
    6733067330                if ( url === undefined ) {
    6733167331                        // get
     
    6733467334                        }
    6733567335                        ctx = ctx[0];
    67336        
     67336
    6733767337                        return ctx.ajax ?
    6733867338                                $.isPlainObject( ctx.ajax ) ?
     
    6734167341                                ctx.sAjaxSource;
    6734267342                }
    67343        
     67343
    6734467344                // set
    6734567345                return this.iterator( 'table', function ( settings ) {
     
    6735567355                } );
    6735667356        } );
    67357        
    67358        
     67357
     67358
    6735967359        /**
    6736067360         * Load data from the newly set Ajax URL. Note that this method is only
     
    6737367373                } );
    6737467374        } );
    67375        
    67376        
    67377        
    67378        
     67375
     67376
     67377
     67378
    6737967379        var _selector_run = function ( type, selector, selectFn, settings, opts )
    6738067380        {
     
    6738367383                        a, i, ien, j, jen,
    6738467384                        selectorType = typeof selector;
    67385        
     67385
    6738667386                // Can't just check for isArray here, as an API or jQuery instance might be
    6738767387                // given with their array like look
     
    6738967389                        selector = [ selector ];
    6739067390                }
    67391        
     67391
    6739267392                for ( i=0, ien=selector.length ; i<ien ; i++ ) {
    6739367393                        // Only split on simple strings - complex expressions will be jQuery selectors
     
    6739567395                                selector[i].split(',') :
    6739667396                                [ selector[i] ];
    67397        
     67397
    6739867398                        for ( j=0, jen=a.length ; j<jen ; j++ ) {
    6739967399                                res = selectFn( typeof a[j] === 'string' ? $.trim(a[j]) : a[j] );
    67400        
     67400
    6740167401                                if ( res && res.length ) {
    6740267402                                        out = out.concat( res );
     
    6740467404                        }
    6740567405                }
    67406        
     67406
    6740767407                // selector extensions
    6740867408                var ext = _ext.selector[ type ];
     
    6741267412                        }
    6741367413                }
    67414        
     67414
    6741567415                return _unique( out );
    6741667416        };
    67417        
    67418        
     67417
     67418
    6741967419        var _selector_opts = function ( opts )
    6742067420        {
     
    6742267422                        opts = {};
    6742367423                }
    67424        
     67424
    6742567425                // Backwards compatibility for 1.9- which used the terminology filter rather
    6742667426                // than search
     
    6742867428                        opts.search = opts.filter;
    6742967429                }
    67430        
     67430
    6743167431                return $.extend( {
    6743267432                        search: 'none',
     
    6743567435                }, opts );
    6743667436        };
    67437        
    67438        
     67437
     67438
    6743967439        var _selector_first = function ( inst )
    6744067440        {
     
    6744867448                                inst.length = 1;
    6744967449                                inst.context = [ inst.context[i] ];
    67450        
     67450
    6745167451                                return inst;
    6745267452                        }
    6745367453                }
    67454        
     67454
    6745567455                // Not found - return an empty instance
    6745667456                inst.length = 0;
    6745767457                return inst;
    6745867458        };
    67459        
    67460        
     67459
     67460
    6746167461        var _selector_row_indexes = function ( settings, opts )
    6746267462        {
     
    6746567465                        displayFiltered = settings.aiDisplay,
    6746667466                        displayMaster = settings.aiDisplayMaster;
    67467        
     67467
    6746867468                var
    6746967469                        search = opts.search,  // none, applied, removed
    6747067470                        order  = opts.order,   // applied, current, index (original - compatibility with 1.9)
    6747167471                        page   = opts.page;    // all, current
    67472        
     67472
    6747367473                if ( _fnDataSource( settings ) == 'ssp' ) {
    6747467474                        // In server-side processing mode, most options are irrelevant since
     
    6749867498                                // O(n+m) solution by creating a hash map
    6749967499                                var displayFilteredMap = {};
    67500        
     67500
    6750167501                                for ( var i=0, ien=displayFiltered.length ; i<ien ; i++ ) {
    6750267502                                        displayFilteredMap[displayFiltered[i]] = null;
    6750367503                                }
    67504        
     67504
    6750567505                                a = $.map( displayMaster, function (el) {
    6750667506                                        return ! displayFilteredMap.hasOwnProperty(el) ?
     
    6751767517                                else { // applied | removed
    6751867518                                        tmp = $.inArray( i, displayFiltered );
    67519        
     67519
    6752067520                                        if ((tmp === -1 && search == 'removed') ||
    6752167521                                                (tmp >= 0   && search == 'applied') )
     
    6752667526                        }
    6752767527                }
    67528        
     67528
    6752967529                return a;
    6753067530        };
    67531        
    67532        
     67531
     67532
    6753367533        /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    6753467534         * Rows
     
    6754867548                        var i, ien;
    6754967549                        var aoData = settings.aoData;
    67550        
     67550
    6755167551                        // Short cut - selector is a number and no options provided (default is
    6755267552                        // all records, so no need to check if the index is in there, since it
     
    6755567555                                return [ selInt ];
    6755667556                        }
    67557        
     67557
    6755867558                        if ( ! rows ) {
    6755967559                                rows = _selector_row_indexes( settings, opts );
    6756067560                        }
    67561        
     67561
    6756267562                        if ( selInt !== null && $.inArray( selInt, rows ) !== -1 ) {
    6756367563                                // Selector - integer
     
    6756867568                                return rows;
    6756967569                        }
    67570        
     67570
    6757167571                        // Selector - function
    6757267572                        if ( typeof sel === 'function' ) {
     
    6757667576                                } );
    6757767577                        }
    67578        
     67578
    6757967579                        // Selector - node
    6758067580                        if ( sel.nodeName ) {
    6758167581                                var rowIdx = sel._DT_RowIndex;  // Property added by DT for fast lookup
    6758267582                                var cellIdx = sel._DT_CellIndex;
    67583        
     67583
    6758467584                                if ( rowIdx !== undefined ) {
    6758567585                                        // Make sure that the row is actually still present in the table
     
    6760067600                                }
    6760167601                        }
    67602        
     67602
    6760367603                        // ID selector. Want to always be able to select rows by id, regardless
    6760467604                        // of if the tr element has been created or not, so can't rely upon
     
    6761667616                                        return [ rowObj.idx ];
    6761767617                                }
    67618        
     67618
    6761967619                                // need to fall through to jQuery in case there is DOM id that
    6762067620                                // matches
    6762167621                        }
    67622                        
     67622
    6762367623                        // Get nodes in the order from the `rows` array with null values removed
    6762467624                        var nodes = _removeEmpty(
    6762567625                                _pluck_order( settings.aoData, rows, 'nTr' )
    6762667626                        );
    67627        
     67627
    6762867628                        // Selector - jQuery selector string, array of nodes or jQuery object/
    6762967629                        // As jQuery's .filter() allows jQuery objects to be passed in filter,
     
    6763667636                                .toArray();
    6763767637                };
    67638        
     67638
    6763967639                return _selector_run( 'row', selector, run, settings, opts );
    6764067640        };
    67641        
    67642        
     67641
     67642
    6764367643        _api_register( 'rows()', function ( selector, opts ) {
    6764467644                // argument shifting
     
    6765067650                        selector = '';
    6765167651                }
    67652        
     67652
    6765367653                opts = _selector_opts( opts );
    67654        
     67654
    6765567655                var inst = this.iterator( 'table', function ( settings ) {
    6765667656                        return __row_selector( settings, selector, opts );
    6765767657                }, 1 );
    67658        
     67658
    6765967659                // Want argument shifting here and in __row_selector?
    6766067660                inst.selector.rows = selector;
    6766167661                inst.selector.opts = opts;
    67662        
     67662
    6766367663                return inst;
    6766467664        } );
    67665        
     67665
    6766667666        _api_register( 'rows().nodes()', function () {
    6766767667                return this.iterator( 'row', function ( settings, row ) {
     
    6766967669                }, 1 );
    6767067670        } );
    67671        
     67671
    6767267672        _api_register( 'rows().data()', function () {
    6767367673                return this.iterator( true, 'rows', function ( settings, rows ) {
     
    6767567675                }, 1 );
    6767667676        } );
    67677        
     67677
    6767867678        _api_registerPlural( 'rows().cache()', 'row().cache()', function ( type ) {
    6767967679                return this.iterator( 'row', function ( settings, row ) {
     
    6768267682                }, 1 );
    6768367683        } );
    67684        
     67684
    6768567685        _api_registerPlural( 'rows().invalidate()', 'row().invalidate()', function ( src ) {
    6768667686                return this.iterator( 'row', function ( settings, row ) {
     
    6768867688                } );
    6768967689        } );
    67690        
     67690
    6769167691        _api_registerPlural( 'rows().indexes()', 'row().index()', function () {
    6769267692                return this.iterator( 'row', function ( settings, row ) {
     
    6769467694                }, 1 );
    6769567695        } );
    67696        
     67696
    6769767697        _api_registerPlural( 'rows().ids()', 'row().id()', function ( hash ) {
    6769867698                var a = [];
    6769967699                var context = this.context;
    67700        
     67700
    6770167701                // `iterator` will drop undefined values, but in this case we want them
    6770267702                for ( var i=0, ien=context.length ; i<ien ; i++ ) {
     
    6770667706                        }
    6770767707                }
    67708        
     67708
    6770967709                return new _Api( context, a );
    6771067710        } );
    67711        
     67711
    6771267712        _api_registerPlural( 'rows().remove()', 'row().remove()', function () {
    6771367713                var that = this;
    67714        
     67714
    6771567715                this.iterator( 'row', function ( settings, row, thatIdx ) {
    6771667716                        var data = settings.aoData;
     
    6771867718                        var i, ien, j, jen;
    6771967719                        var loopRow, loopCells;
    67720        
     67720
    6772167721                        data.splice( row, 1 );
    67722        
     67722
    6772367723                        // Update the cached indexes
    6772467724                        for ( i=0, ien=data.length ; i<ien ; i++ ) {
    6772567725                                loopRow = data[i];
    6772667726                                loopCells = loopRow.anCells;
    67727        
     67727
    6772867728                                // Rows
    6772967729                                if ( loopRow.nTr !== null ) {
    6773067730                                        loopRow.nTr._DT_RowIndex = i;
    6773167731                                }
    67732        
     67732
    6773367733                                // Cells
    6773467734                                if ( loopCells !== null ) {
     
    6773867738                                }
    6773967739                        }
    67740        
     67740
    6774167741                        // Delete from the display arrays
    6774267742                        _fnDeleteIndex( settings.aiDisplayMaster, row );
    6774367743                        _fnDeleteIndex( settings.aiDisplay, row );
    6774467744                        _fnDeleteIndex( that[ thatIdx ], row, false ); // maintain local indexes
    67745        
     67745
    6774667746                        // For server-side processing tables - subtract the deleted row from the count
    6774767747                        if ( settings._iRecordsDisplay > 0 ) {
    6774867748                                settings._iRecordsDisplay--;
    6774967749                        }
    67750        
     67750
    6775167751                        // Check for an 'overflow' they case for displaying the table
    6775267752                        _fnLengthOverflow( settings );
    67753        
     67753
    6775467754                        // Remove the row's ID reference if there is one
    6775567755                        var id = settings.rowIdFn( rowData._aData );
     
    6775867758                        }
    6775967759                } );
    67760        
     67760
    6776167761                this.iterator( 'table', function ( settings ) {
    6776267762                        for ( var i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
     
    6776467764                        }
    6776567765                } );
    67766        
     67766
    6776767767                return this;
    6776867768        } );
    67769        
    67770        
     67769
     67770
    6777167771        _api_register( 'rows.add()', function ( rows ) {
    6777267772                var newRows = this.iterator( 'table', function ( settings ) {
    6777367773                                var row, i, ien;
    6777467774                                var out = [];
    67775        
     67775
    6777667776                                for ( i=0, ien=rows.length ; i<ien ; i++ ) {
    6777767777                                        row = rows[i];
    67778        
     67778
    6777967779                                        if ( row.nodeName && row.nodeName.toUpperCase() === 'TR' ) {
    6778067780                                                out.push( _fnAddTr( settings, row )[0] );
     
    6778467784                                        }
    6778567785                                }
    67786        
     67786
    6778767787                                return out;
    6778867788                        }, 1 );
    67789        
     67789
    6779067790                // Return an Api.rows() extended instance, so rows().nodes() etc can be used
    6779167791                var modRows = this.rows( -1 );
    6779267792                modRows.pop();
    6779367793                $.merge( modRows, newRows );
    67794        
     67794
    6779567795                return modRows;
    6779667796        } );
    67797        
    67798        
    67799        
    67800        
    67801        
     67797
     67798
     67799
     67800
     67801
    6780267802        /**
    6780367803         *
     
    6780667806                return _selector_first( this.rows( selector, opts ) );
    6780767807        } );
    67808        
    67809        
     67808
     67809
    6781067810        _api_register( 'row().data()', function ( data ) {
    6781167811                var ctx = this.context;
    67812        
     67812
    6781367813                if ( data === undefined ) {
    6781467814                        // Get
     
    6781767817                                undefined;
    6781867818                }
    67819        
     67819
    6782067820                // Set
    6782167821                var row = ctx[0].aoData[ this[0] ];
    6782267822                row._aData = data;
    67823        
     67823
    6782467824                // If the DOM has an id, and the data source is an array
    6782567825                if ( $.isArray( data ) && row.nTr.id ) {
    6782667826                        _fnSetObjectDataFn( ctx[0].rowId )( data, row.nTr.id );
    6782767827                }
    67828        
     67828
    6782967829                // Automatically invalidate
    6783067830                _fnInvalidate( ctx[0], this[0], 'data' );
    67831        
     67831
    6783267832                return this;
    6783367833        } );
    67834        
    67835        
     67834
     67835
    6783667836        _api_register( 'row().node()', function () {
    6783767837                var ctx = this.context;
    67838        
     67838
    6783967839                return ctx.length && this.length ?
    6784067840                        ctx[0].aoData[ this[0] ].nTr || null :
    6784167841                        null;
    6784267842        } );
    67843        
    67844        
     67843
     67844
    6784567845        _api_register( 'row.add()', function ( row ) {
    6784667846                // Allow a jQuery object to be passed in - only a single row is added from
     
    6784967849                        row = row[0];
    6785067850                }
    67851        
     67851
    6785267852                var rows = this.iterator( 'table', function ( settings ) {
    6785367853                        if ( row.nodeName && row.nodeName.toUpperCase() === 'TR' ) {
     
    6785667856                        return _fnAddData( settings, row );
    6785767857                } );
    67858        
     67858
    6785967859                // Return an Api.rows() extended instance, with the newly added row selected
    6786067860                return this.row( rows[0] );
    6786167861        } );
    67862        
    67863        
    67864        
     67862
     67863
     67864
    6786567865        var __details_add = function ( ctx, row, data, klass )
    6786667866        {
     
    6787567875                                return;
    6787667876                        }
    67877        
     67877
    6787867878                        // If we get a TR element, then just add it directly - up to the dev
    6787967879                        // to add the correct number of columns etc
     
    6788867888                                        .html( r )
    6788967889                                        [0].colSpan = _fnVisbleColumns( ctx );
    67890        
     67890
    6789167891                                rows.push( created[0] );
    6789267892                        }
    6789367893                };
    67894        
     67894
    6789567895                addRow( data, klass );
    67896        
     67896
    6789767897                if ( row._details ) {
    6789867898                        row._details.detach();
    6789967899                }
    67900        
     67900
    6790167901                row._details = $(rows);
    67902        
     67902
    6790367903                // If the children were already shown, that state should be retained
    6790467904                if ( row._detailsShow ) {
     
    6790667906                }
    6790767907        };
    67908        
    67909        
     67908
     67909
    6791067910        var __details_remove = function ( api, idx )
    6791167911        {
    6791267912                var ctx = api.context;
    67913        
     67913
    6791467914                if ( ctx.length ) {
    6791567915                        var row = ctx[0].aoData[ idx !== undefined ? idx : api[0] ];
    67916        
     67916
    6791767917                        if ( row && row._details ) {
    6791867918                                row._details.remove();
    67919        
     67919
    6792067920                                row._detailsShow = undefined;
    6792167921                                row._details = undefined;
     
    6792367923                }
    6792467924        };
    67925        
    67926        
     67925
     67926
    6792767927        var __details_display = function ( api, show ) {
    6792867928                var ctx = api.context;
    67929        
     67929
    6793067930                if ( ctx.length && api.length ) {
    6793167931                        var row = ctx[0].aoData[ api[0] ];
    67932        
     67932
    6793367933                        if ( row._details ) {
    6793467934                                row._detailsShow = show;
    67935        
     67935
    6793667936                                if ( show ) {
    6793767937                                        row._details.insertAfter( row.nTr );
     
    6794067940                                        row._details.detach();
    6794167941                                }
    67942        
     67942
    6794367943                                __details_events( ctx[0] );
    6794467944                        }
    6794567945                }
    6794667946        };
    67947        
    67948        
     67947
     67948
    6794967949        var __details_events = function ( settings )
    6795067950        {
     
    6795567955                var destroyEvent = 'destroy'+namespace;
    6795667956                var data = settings.aoData;
    67957        
     67957
    6795867958                api.off( drawEvent +' '+ colvisEvent +' '+ destroyEvent );
    67959        
     67959
    6796067960                if ( _pluck( data, '_details' ).length > 0 ) {
    6796167961                        // On each draw, insert the required elements into the document
     
    6796467964                                        return;
    6796567965                                }
    67966        
     67966
    6796767967                                api.rows( {page:'current'} ).eq(0).each( function (idx) {
    6796867968                                        // Internal data grab
    6796967969                                        var row = data[ idx ];
    67970        
     67970
    6797167971                                        if ( row._detailsShow ) {
    6797267972                                                row._details.insertAfter( row.nTr );
     
    6797467974                                } );
    6797567975                        } );
    67976        
     67976
    6797767977                        // Column visibility change - update the colspan
    6797867978                        api.on( colvisEvent, function ( e, ctx, idx, vis ) {
     
    6798067980                                        return;
    6798167981                                }
    67982        
     67982
    6798367983                                // Update the colspan for the details rows (note, only if it already has
    6798467984                                // a colspan)
    6798567985                                var row, visible = _fnVisbleColumns( ctx );
    67986        
     67986
    6798767987                                for ( var i=0, ien=data.length ; i<ien ; i++ ) {
    6798867988                                        row = data[i];
    67989        
     67989
    6799067990                                        if ( row._details ) {
    6799167991                                                row._details.children('td[colspan]').attr('colspan', visible );
     
    6799367993                                }
    6799467994                        } );
    67995        
     67995
    6799667996                        // Table destroyed - nuke any child rows
    6799767997                        api.on( destroyEvent, function ( e, ctx ) {
     
    6799967999                                        return;
    6800068000                                }
    68001        
     68001
    6800268002                                for ( var i=0, ien=data.length ; i<ien ; i++ ) {
    6800368003                                        if ( data[i]._details ) {
     
    6800868008                }
    6800968009        };
    68010        
     68010
    6801168011        // Strings for the method names to help minification
    6801268012        var _emp = '';
    6801368013        var _child_obj = _emp+'row().child';
    6801468014        var _child_mth = _child_obj+'()';
    68015        
     68015
    6801668016        // data can be:
    6801768017        //  tr
     
    6802068020        _api_register( _child_mth, function ( data, klass ) {
    6802168021                var ctx = this.context;
    68022        
     68022
    6802368023                if ( data === undefined ) {
    6802468024                        // get
     
    6803968039                        __details_add( ctx[0], ctx[0].aoData[ this[0] ], data, klass );
    6804068040                }
    68041        
     68041
    6804268042                return this;
    6804368043        } );
    68044        
    68045        
     68044
     68045
    6804668046        _api_register( [
    6804768047                _child_obj+'.show()',
     
    6805168051                return this;
    6805268052        } );
    68053        
    68054        
     68053
     68054
    6805568055        _api_register( [
    6805668056                _child_obj+'.hide()',
     
    6806068060                return this;
    6806168061        } );
    68062        
    68063        
     68062
     68063
    6806468064        _api_register( [
    6806568065                _child_obj+'.remove()',
     
    6806968069                return this;
    6807068070        } );
    68071        
    68072        
     68071
     68072
    6807368073        _api_register( _child_obj+'.isShown()', function () {
    6807468074                var ctx = this.context;
    68075        
     68075
    6807668076                if ( ctx.length && this.length ) {
    6807768077                        // _detailsShown as false or undefined will fall through to return false
     
    6808068080                return false;
    6808168081        } );
    68082        
    68083        
    68084        
     68082
     68083
     68084
    6808568085        /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    6808668086         * Columns
     
    6809368093         *
    6809468094         */
    68095        
     68095
    6809668096        // can be an array of these items, comma separated list, or an array of comma
    6809768097        // separated lists
    68098        
     68098
    6809968099        var __re_column_selector = /^([^:]+):(name|visIdx|visible)$/;
    68100        
    68101        
     68100
     68101
    6810268102        // r1 and r2 are redundant - but it means that the parameters match for the
    6810368103        // iterator callback in columns().data()
     
    6810968109                return a;
    6811068110        };
    68111        
    68112        
     68111
     68112
    6811368113        var __column_selector = function ( settings, selector, opts )
    6811468114        {
     
    6811768117                        names = _pluck( columns, 'sName' ),
    6811868118                        nodes = _pluck( columns, 'nTh' );
    68119        
     68119
    6812068120                var run = function ( s ) {
    6812168121                        var selInt = _intVal( s );
    68122        
     68122
    6812368123                        // Selector - all
    6812468124                        if ( s === '' ) {
    6812568125                                return _range( columns.length );
    6812668126                        }
    68127        
     68127
    6812868128                        // Selector - index
    6812968129                        if ( selInt !== null ) {
     
    6813368133                                ];
    6813468134                        }
    68135        
     68135
    6813668136                        // Selector = function
    6813768137                        if ( typeof s === 'function' ) {
    6813868138                                var rows = _selector_row_indexes( settings, opts );
    68139        
     68139
    6814068140                                return $.map( columns, function (col, idx) {
    6814168141                                        return s(
     
    6814668146                                } );
    6814768147                        }
    68148        
     68148
    6814968149                        // jQuery or string selector
    6815068150                        var match = typeof s === 'string' ?
    6815168151                                s.match( __re_column_selector ) :
    6815268152                                '';
    68153        
     68153
    6815468154                        if ( match ) {
    6815568155                                switch( match[2] ) {
     
    6816768167                                                // Counting from the left
    6816868168                                                return [ _fnVisibleToColumnIndex( settings, idx ) ];
    68169        
     68169
    6817068170                                        case 'name':
    6817168171                                                // match by name. `names` is column index complete and in order
     
    6817368173                                                        return name === match[1] ? i : null;
    6817468174                                                } );
    68175        
     68175
    6817668176                                        default:
    6817768177                                                return [];
    6817868178                                }
    6817968179                        }
    68180        
     68180
    6818168181                        // Cell in the table body
    6818268182                        if ( s.nodeName && s._DT_CellIndex ) {
    6818368183                                return [ s._DT_CellIndex.column ];
    6818468184                        }
    68185        
     68185
    6818668186                        // jQuery selector on the TH elements for the columns
    6818768187                        var jqResult = $( nodes )
     
    6819168191                                } )
    6819268192                                .toArray();
    68193        
     68193
    6819468194                        if ( jqResult.length || ! s.nodeName ) {
    6819568195                                return jqResult;
    6819668196                        }
    68197        
     68197
    6819868198                        // Otherwise a node which might have a `dt-column` data attribute, or be
    6819968199                        // a child or such an element
     
    6820368203                                [];
    6820468204                };
    68205        
     68205
    6820668206                return _selector_run( 'column', selector, run, settings, opts );
    6820768207        };
    68208        
    68209        
     68208
     68209
    6821068210        var __setColumnVis = function ( settings, column, vis ) {
    6821168211                var
     
    6821468214                        data = settings.aoData,
    6821568215                        row, cells, i, ien, tr;
    68216        
     68216
    6821768217                // Get
    6821868218                if ( vis === undefined ) {
    6821968219                        return col.bVisible;
    6822068220                }
    68221        
     68221
    6822268222                // Set
    6822368223                // No change
     
    6822568225                        return;
    6822668226                }
    68227        
     68227
    6822868228                if ( vis ) {
    6822968229                        // Insert column
    6823068230                        // Need to decide if we should use appendChild or insertBefore
    6823168231                        var insertBefore = $.inArray( true, _pluck(cols, 'bVisible'), column+1 );
    68232        
     68232
    6823368233                        for ( i=0, ien=data.length ; i<ien ; i++ ) {
    6823468234                                tr = data[i].nTr;
    6823568235                                cells = data[i].anCells;
    68236        
     68236
    6823768237                                if ( tr ) {
    6823868238                                        // insertBefore can act like appendChild if 2nd arg is null
     
    6824568245                        $( _pluck( settings.aoData, 'anCells', column ) ).detach();
    6824668246                }
    68247        
     68247
    6824868248                // Common actions
    6824968249                col.bVisible = vis;
    6825068250        };
    68251        
    68252        
     68251
     68252
    6825368253        _api_register( 'columns()', function ( selector, opts ) {
    6825468254                // argument shifting
     
    6826068260                        selector = '';
    6826168261                }
    68262        
     68262
    6826368263                opts = _selector_opts( opts );
    68264        
     68264
    6826568265                var inst = this.iterator( 'table', function ( settings ) {
    6826668266                        return __column_selector( settings, selector, opts );
    6826768267                }, 1 );
    68268        
     68268
    6826968269                // Want argument shifting here and in _row_selector?
    6827068270                inst.selector.cols = selector;
    6827168271                inst.selector.opts = opts;
    68272        
     68272
    6827368273                return inst;
    6827468274        } );
    68275        
     68275
    6827668276        _api_registerPlural( 'columns().header()', 'column().header()', function ( selector, opts ) {
    6827768277                return this.iterator( 'column', function ( settings, column ) {
     
    6827968279                }, 1 );
    6828068280        } );
    68281        
     68281
    6828268282        _api_registerPlural( 'columns().footer()', 'column().footer()', function ( selector, opts ) {
    6828368283                return this.iterator( 'column', function ( settings, column ) {
     
    6828568285                }, 1 );
    6828668286        } );
    68287        
     68287
    6828868288        _api_registerPlural( 'columns().data()', 'column().data()', function () {
    6828968289                return this.iterator( 'column-rows', __columnData, 1 );
    6829068290        } );
    68291        
     68291
    6829268292        _api_registerPlural( 'columns().dataSrc()', 'column().dataSrc()', function () {
    6829368293                return this.iterator( 'column', function ( settings, column ) {
     
    6829568295                }, 1 );
    6829668296        } );
    68297        
     68297
    6829868298        _api_registerPlural( 'columns().cache()', 'column().cache()', function ( type ) {
    6829968299                return this.iterator( 'column-rows', function ( settings, column, i, j, rows ) {
     
    6830368303                }, 1 );
    6830468304        } );
    68305        
     68305
    6830668306        _api_registerPlural( 'columns().nodes()', 'column().nodes()', function () {
    6830768307                return this.iterator( 'column-rows', function ( settings, column, i, j, rows ) {
     
    6830968309                }, 1 );
    6831068310        } );
    68311        
     68311
    6831268312        _api_registerPlural( 'columns().visible()', 'column().visible()', function ( vis, calc ) {
    6831368313                var that = this;
     
    6831868318                        __setColumnVis( settings, column, vis );
    6831968319                } );
    68320        
     68320
    6832168321                // Group the column visibility changes
    6832268322                if ( vis !== undefined ) {
     
    6832568325                                _fnDrawHead( settings, settings.aoHeader );
    6832668326                                _fnDrawHead( settings, settings.aoFooter );
    68327                
     68327
    6832868328                                // Update colspan for no records display. Child rows and extensions will use their own
    6832968329                                // listeners to do this - only need to update the empty table item here
     
    6833168331                                        $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisbleColumns(settings));
    6833268332                                }
    68333                
     68333
    6833468334                                _fnSaveState( settings );
    68335        
     68335
    6833668336                                // Second loop once the first is done for events
    6833768337                                that.iterator( 'column', function ( settings, column ) {
    6833868338                                        _fnCallbackFire( settings, null, 'column-visibility', [settings, column, vis, calc] );
    6833968339                                } );
    68340        
     68340
    6834168341                                if ( calc === undefined || calc ) {
    6834268342                                        that.columns.adjust();
     
    6834468344                        });
    6834568345                }
    68346        
     68346
    6834768347                return ret;
    6834868348        } );
    68349        
     68349
    6835068350        _api_registerPlural( 'columns().indexes()', 'column().index()', function ( type ) {
    6835168351                return this.iterator( 'column', function ( settings, column ) {
     
    6835568355                }, 1 );
    6835668356        } );
    68357        
     68357
    6835868358        _api_register( 'columns.adjust()', function () {
    6835968359                return this.iterator( 'table', function ( settings ) {
     
    6836168361                }, 1 );
    6836268362        } );
    68363        
     68363
    6836468364        _api_register( 'column.index()', function ( type, idx ) {
    6836568365                if ( this.context.length !== 0 ) {
    6836668366                        var ctx = this.context[0];
    68367        
     68367
    6836868368                        if ( type === 'fromVisible' || type === 'toData' ) {
    6836968369                                return _fnVisibleToColumnIndex( ctx, idx );
     
    6837468374                }
    6837568375        } );
    68376        
     68376
    6837768377        _api_register( 'column()', function ( selector, opts ) {
    6837868378                return _selector_first( this.columns( selector, opts ) );
    6837968379        } );
    68380        
    68381        
    68382        
     68380
     68381
     68382
    6838368383        var __cell_selector = function ( settings, selector, opts )
    6838468384        {
     
    6839068390                var columns = settings.aoColumns.length;
    6839168391                var a, i, ien, j, o, host;
    68392        
     68392
    6839368393                var run = function ( s ) {
    6839468394                        var fnSelector = typeof s === 'function';
    68395        
     68395
    6839668396                        if ( s === null || s === undefined || fnSelector ) {
    6839768397                                // All cells and function selectors
    6839868398                                a = [];
    68399        
     68399
    6840068400                                for ( i=0, ien=rows.length ; i<ien ; i++ ) {
    6840168401                                        row = rows[i];
    68402        
     68402
    6840368403                                        for ( j=0 ; j<columns ; j++ ) {
    6840468404                                                o = {
     
    6840668406                                                        column: j
    6840768407                                                };
    68408        
     68408
    6840968409                                                if ( fnSelector ) {
    6841068410                                                        // Selector - function
    6841168411                                                        host = data[ row ];
    68412        
     68412
    6841368413                                                        if ( s( o, _fnGetCellData(settings, row, j), host.anCells ? host.anCells[j] : null ) ) {
    6841468414                                                                a.push( o );
     
    6842168421                                        }
    6842268422                                }
    68423        
     68423
    6842468424                                return a;
    6842568425                        }
    68426                        
     68426
    6842768427                        // Selector - index
    6842868428                        if ( $.isPlainObject( s ) ) {
     
    6843268432                                        [];
    6843368433                        }
    68434        
     68434
    6843568435                        // Selector - jQuery filtered cells
    6843668436                        var jqResult = allCells
     
    6844368443                                } )
    6844468444                                .toArray();
    68445        
     68445
    6844668446                        if ( jqResult.length || ! s.nodeName ) {
    6844768447                                return jqResult;
    6844868448                        }
    68449        
     68449
    6845068450                        // Otherwise the selector is a node, and there is one last option - the
    6845168451                        // element might be a child of an element which has dt-row and dt-column
     
    6845968459                                [];
    6846068460                };
    68461        
     68461
    6846268462                return _selector_run( 'cell', selector, run, settings, opts );
    6846368463        };
    68464        
    68465        
    68466        
    68467        
     68464
     68465
     68466
     68467
    6846868468        _api_register( 'cells()', function ( rowSelector, columnSelector, opts ) {
    6846968469                // Argument shifting
     
    6848568485                        columnSelector = null;
    6848668486                }
    68487        
     68487
    6848868488                // Cell selector
    6848968489                if ( columnSelector === null || columnSelector === undefined ) {
     
    6849268492                        } );
    6849368493                }
    68494        
     68494
    6849568495                // The default built in options need to apply to row and columns
    6849668496                var internalOpts = opts ? {
     
    6849968499                        search: opts.search
    6850068500                } : {};
    68501        
     68501
    6850268502                // Row + column selector
    6850368503                var columns = this.columns( columnSelector, internalOpts );
    6850468504                var rows = this.rows( rowSelector, internalOpts );
    6850568505                var i, ien, j, jen;
    68506        
     68506
    6850768507                var cellsNoOpts = this.iterator( 'table', function ( settings, idx ) {
    6850868508                        var a = [];
    68509        
     68509
    6851068510                        for ( i=0, ien=rows[idx].length ; i<ien ; i++ ) {
    6851168511                                for ( j=0, jen=columns[idx].length ; j<jen ; j++ ) {
     
    6851668516                                }
    6851768517                        }
    68518        
     68518
    6851968519                        return a;
    6852068520                }, 1 );
    68521        
     68521
    6852268522                // There is currently only one extension which uses a cell selector extension
    6852368523                // It is a _major_ performance drag to run this if it isn't needed, so this is
     
    6852668526                        this.cells( cellsNoOpts, opts ) :
    6852768527                        cellsNoOpts;
    68528        
     68528
    6852968529                $.extend( cells.selector, {
    6853068530                        cols: columnSelector,
     
    6853268532                        opts: opts
    6853368533                } );
    68534        
     68534
    6853568535                return cells;
    6853668536        } );
    68537        
    68538        
     68537
     68538
    6853968539        _api_registerPlural( 'cells().nodes()', 'cell().node()', function () {
    6854068540                return this.iterator( 'cell', function ( settings, row, column ) {
    6854168541                        var data = settings.aoData[ row ];
    68542        
     68542
    6854368543                        return data && data.anCells ?
    6854468544                                data.anCells[ column ] :
     
    6854668546                }, 1 );
    6854768547        } );
    68548        
    68549        
     68548
     68549
    6855068550        _api_register( 'cells().data()', function () {
    6855168551                return this.iterator( 'cell', function ( settings, row, column ) {
     
    6855368553                }, 1 );
    6855468554        } );
    68555        
    68556        
     68555
     68556
    6855768557        _api_registerPlural( 'cells().cache()', 'cell().cache()', function ( type ) {
    6855868558                type = type === 'search' ? '_aFilterData' : '_aSortData';
    68559        
     68559
    6856068560                return this.iterator( 'cell', function ( settings, row, column ) {
    6856168561                        return settings.aoData[ row ][ type ][ column ];
    6856268562                }, 1 );
    6856368563        } );
    68564        
    68565        
     68564
     68565
    6856668566        _api_registerPlural( 'cells().render()', 'cell().render()', function ( type ) {
    6856768567                return this.iterator( 'cell', function ( settings, row, column ) {
     
    6856968569                }, 1 );
    6857068570        } );
    68571        
    68572        
     68571
     68572
    6857368573        _api_registerPlural( 'cells().indexes()', 'cell().index()', function () {
    6857468574                return this.iterator( 'cell', function ( settings, row, column ) {
     
    6858068580                }, 1 );
    6858168581        } );
    68582        
    68583        
     68582
     68583
    6858468584        _api_registerPlural( 'cells().invalidate()', 'cell().invalidate()', function ( src ) {
    6858568585                return this.iterator( 'cell', function ( settings, row, column ) {
     
    6858768587                } );
    6858868588        } );
    68589        
    68590        
    68591        
     68589
     68590
     68591
    6859268592        _api_register( 'cell()', function ( rowSelector, columnSelector, opts ) {
    6859368593                return _selector_first( this.cells( rowSelector, columnSelector, opts ) );
    6859468594        } );
    68595        
    68596        
     68595
     68596
    6859768597        _api_register( 'cell().data()', function ( data ) {
    6859868598                var ctx = this.context;
    6859968599                var cell = this[0];
    68600        
     68600
    6860168601                if ( data === undefined ) {
    6860268602                        // Get
     
    6860568605                                undefined;
    6860668606                }
    68607        
     68607
    6860868608                // Set
    6860968609                _fnSetCellData( ctx[0], cell[0].row, cell[0].column, data );
    6861068610                _fnInvalidate( ctx[0], cell[0].row, 'data', cell[0].column );
    68611        
     68611
    6861268612                return this;
    6861368613        } );
    68614        
    68615        
    68616        
     68614
     68615
     68616
    6861768617        /**
    6861868618         * Get current ordering (sorting) that has been applied to the table.
     
    6864568645        _api_register( 'order()', function ( order, dir ) {
    6864668646                var ctx = this.context;
    68647        
     68647
    6864868648                if ( order === undefined ) {
    6864968649                        // get
     
    6865268652                                undefined;
    6865368653                }
    68654        
     68654
    6865568655                // set
    6865668656                if ( typeof order === 'number' ) {
     
    6866368663                }
    6866468664                // otherwise a 2D array was passed in
    68665        
     68665
    6866668666                return this.iterator( 'table', function ( settings ) {
    6866768667                        settings.aaSorting = order.slice();
    6866868668                } );
    6866968669        } );
    68670        
    68671        
     68670
     68671
    6867268672        /**
    6867368673         * Attach a sort listener to an element for a given column
     
    6868568685                } );
    6868668686        } );
    68687        
    68688        
     68687
     68688
    6868968689        _api_register( 'order.fixed()', function ( set ) {
    6869068690                if ( ! set ) {
     
    6869368693                                ctx[0].aaSortingFixed :
    6869468694                                undefined;
    68695        
     68695
    6869668696                        return $.isArray( fixed ) ?
    6869768697                                { pre: fixed } :
    6869868698                                fixed;
    6869968699                }
    68700        
     68700
    6870168701                return this.iterator( 'table', function ( settings ) {
    6870268702                        settings.aaSortingFixed = $.extend( true, {}, set );
    6870368703                } );
    6870468704        } );
    68705        
    68706        
     68705
     68706
    6870768707        // Order by the selected column(s)
    6870868708        _api_register( [
     
    6871168711        ], function ( dir ) {
    6871268712                var that = this;
    68713        
     68713
    6871468714                return this.iterator( 'table', function ( settings, i ) {
    6871568715                        var sort = [];
    68716        
     68716
    6871768717                        $.each( that[i], function (j, col) {
    6871868718                                sort.push( [ col, dir ] );
    6871968719                        } );
    68720        
     68720
    6872168721                        settings.aaSorting = sort;
    6872268722                } );
    6872368723        } );
    68724        
    68725        
    68726        
     68724
     68725
     68726
    6872768727        _api_register( 'search()', function ( input, regex, smart, caseInsen ) {
    6872868728                var ctx = this.context;
    68729        
     68729
    6873068730                if ( input === undefined ) {
    6873168731                        // get
     
    6873468734                                undefined;
    6873568735                }
    68736        
     68736
    6873768737                // set
    6873868738                return this.iterator( 'table', function ( settings ) {
     
    6874068740                                return;
    6874168741                        }
    68742        
     68742
    6874368743                        _fnFilterComplete( settings, $.extend( {}, settings.oPreviousSearch, {
    6874468744                                "sSearch": input+"",
     
    6874968749                } );
    6875068750        } );
    68751        
    68752        
     68751
     68752
    6875368753        _api_registerPlural(
    6875468754                'columns().search()',
     
    6875768757                        return this.iterator( 'column', function ( settings, column ) {
    6875868758                                var preSearch = settings.aoPreSearchCols;
    68759        
     68759
    6876068760                                if ( input === undefined ) {
    6876168761                                        // get
    6876268762                                        return preSearch[ column ].sSearch;
    6876368763                                }
    68764        
     68764
    6876568765                                // set
    6876668766                                if ( ! settings.oFeatures.bFilter ) {
    6876768767                                        return;
    6876868768                                }
    68769        
     68769
    6877068770                                $.extend( preSearch[ column ], {
    6877168771                                        "sSearch": input+"",
     
    6877468774                                        "bCaseInsensitive": caseInsen === null ? true : caseInsen
    6877568775                                } );
    68776        
     68776
    6877768777                                _fnFilterComplete( settings, settings.oPreviousSearch, 1 );
    6877868778                        } );
    6877968779                }
    6878068780        );
    68781        
     68781
    6878268782        /*
    6878368783         * State API methods
    6878468784         */
    68785        
     68785
    6878668786        _api_register( 'state()', function () {
    6878768787                return this.context.length ?
     
    6878968789                        null;
    6879068790        } );
    68791        
    68792        
     68791
     68792
    6879368793        _api_register( 'state.clear()', function () {
    6879468794                return this.iterator( 'table', function ( settings ) {
     
    6879768797                } );
    6879868798        } );
    68799        
    68800        
     68799
     68800
    6880168801        _api_register( 'state.loaded()', function () {
    6880268802                return this.context.length ?
     
    6880468804                        null;
    6880568805        } );
    68806        
    68807        
     68806
     68807
    6880868808        _api_register( 'state.save()', function () {
    6880968809                return this.iterator( 'table', function ( settings ) {
     
    6881168811                } );
    6881268812        } );
    68813        
    68814        
    68815        
     68813
     68814
     68815
    6881668816        /**
    6881768817         * Provide a common method for plug-ins to check the version of DataTables being
     
    6883468834                var aThat = version.split('.');
    6883568835                var iThis, iThat;
    68836        
     68836
    6883768837                for ( var i=0, iLen=aThat.length ; i<iLen ; i++ ) {
    6883868838                        iThis = parseInt( aThis[i], 10 ) || 0;
    6883968839                        iThat = parseInt( aThat[i], 10 ) || 0;
    68840        
     68840
    6884168841                        // Parts are the same, keep comparing
    6884268842                        if (iThis === iThat) {
    6884368843                                continue;
    6884468844                        }
    68845        
     68845
    6884668846                        // Parts are different, return immediately
    6884768847                        return iThis > iThat;
    6884868848                }
    68849        
     68849
    6885068850                return true;
    6885168851        };
    68852        
    68853        
     68852
     68853
    6885468854        /**
    6885568855         * Check if a `<table>` node is a DataTable table already or not.
     
    6887168871                var t = $(table).get(0);
    6887268872                var is = false;
    68873        
     68873
    6887468874                if ( table instanceof DataTable.Api ) {
    6887568875                        return true;
    6887668876                }
    68877        
     68877
    6887868878                $.each( DataTable.settings, function (i, o) {
    6887968879                        var head = o.nScrollHead ? $('table', o.nScrollHead)[0] : null;
    6888068880                        var foot = o.nScrollFoot ? $('table', o.nScrollFoot)[0] : null;
    68881        
     68881
    6888268882                        if ( o.nTable === t || head === t || foot === t ) {
    6888368883                                is = true;
    6888468884                        }
    6888568885                } );
    68886        
     68886
    6888768887                return is;
    6888868888        };
    68889        
    68890        
     68889
     68890
    6889168891        /**
    6889268892         * Get all DataTable tables that have been initialised - optionally you can
     
    6890868908        {
    6890968909                var api = false;
    68910        
     68910
    6891168911                if ( $.isPlainObject( visible ) ) {
    6891268912                        api = visible.api;
    6891368913                        visible = visible.visible;
    6891468914                }
    68915        
     68915
    6891668916                var a = $.map( DataTable.settings, function (o) {
    6891768917                        if ( !visible || (visible && $(o.nTable).is(':visible')) ) {
     
    6891968919                        }
    6892068920                } );
    68921        
     68921
    6892268922                return api ?
    6892368923                        new _Api( a ) :
    6892468924                        a;
    6892568925        };
    68926        
    68927        
     68926
     68927
    6892868928        /**
    6892968929         * Convert from camel case parameters to Hungarian notation. This is made public
     
    6894068940         */
    6894168941        DataTable.camelToHungarian = _fnCamelToHungarian;
    68942        
    68943        
    68944        
     68942
     68943
     68944
    6894568945        /**
    6894668946         *
     
    6895068950                        rows   = this.rows( opts ).nodes(), // Get all rows
    6895168951                        jqRows = $(rows);
    68952        
     68952
    6895368953                return $( [].concat(
    6895468954                        jqRows.filter( selector ).toArray(),
     
    6895668956                ) );
    6895768957        } );
    68958        
    68959        
     68958
     68959
    6896068960        // jQuery functions to operate on the tables
    6896168961        $.each( [ 'on', 'one', 'off' ], function (i, key) {
    6896268962                _api_register( key+'()', function ( /* event, handler */ ) {
    6896368963                        var args = Array.prototype.slice.call(arguments);
    68964        
     68964
    6896568965                        // Add the `dt` namespace automatically if it isn't already present
    6896668966                        args[0] = $.map( args[0].split( /\s/ ), function ( e ) {
     
    6896968969                                        e;
    6897068970                                } ).join( ' ' );
    68971        
     68971
    6897268972                        var inst = $( this.tables().nodes() );
    6897368973                        inst[key].apply( inst, args );
     
    6897568975                } );
    6897668976        } );
    68977        
    68978        
     68977
     68978
    6897968979        _api_register( 'clear()', function () {
    6898068980                return this.iterator( 'table', function ( settings ) {
     
    6898268982                } );
    6898368983        } );
    68984        
    68985        
     68984
     68985
    6898668986        _api_register( 'settings()', function () {
    6898768987                return new _Api( this.context, this.context );
    6898868988        } );
    68989        
    68990        
     68989
     68990
    6899168991        _api_register( 'init()', function () {
    6899268992                var ctx = this.context;
    6899368993                return ctx.length ? ctx[0].oInit : null;
    6899468994        } );
    68995        
    68996        
     68995
     68996
    6899768997        _api_register( 'data()', function () {
    6899868998                return this.iterator( 'table', function ( settings ) {
     
    6900069000                } ).flatten();
    6900169001        } );
    69002        
    69003        
     69002
     69003
    6900469004        _api_register( 'destroy()', function ( remove ) {
    6900569005                remove = remove || false;
    69006        
     69006
    6900769007                return this.iterator( 'table', function ( settings ) {
    6900869008                        var orig      = settings.nTableWrapper.parentNode;
     
    6901769017                        var rows      = $.map( settings.aoData, function (r) { return r.nTr; } );
    6901869018                        var i, ien;
    69019        
     69019
    6902069020                        // Flag to note that the table is currently being destroyed - no action
    6902169021                        // should be taken
    6902269022                        settings.bDestroying = true;
    69023        
     69023
    6902469024                        // Fire off the destroy callbacks for plug-ins etc
    6902569025                        _fnCallbackFire( settings, "aoDestroyCallback", "destroy", [settings] );
    69026        
     69026
    6902769027                        // If not being removed from the document, make all columns visible
    6902869028                        if ( ! remove ) {
    6902969029                                new _Api( settings ).columns().visible( true );
    6903069030                        }
    69031        
     69031
    6903269032                        // Blitz all `DT` namespaced events (these are internal events, the
    6903369033                        // lowercase, `dt` events are user subscribed and they are responsible
     
    6903569035                        jqWrapper.off('.DT').find(':not(tbody *)').off('.DT');
    6903669036                        $(window).off('.DT-'+settings.sInstance);
    69037        
     69037
    6903869038                        // When scrolling we had to break the table up - restore it
    6903969039                        if ( table != thead.parentNode ) {
     
    6904169041                                jqTable.append( thead );
    6904269042                        }
    69043        
     69043
    6904469044                        if ( tfoot && table != tfoot.parentNode ) {
    6904569045                                jqTable.children('tfoot').detach();
    6904669046                                jqTable.append( tfoot );
    6904769047                        }
    69048        
     69048
    6904969049                        settings.aaSorting = [];
    6905069050                        settings.aaSortingFixed = [];
    6905169051                        _fnSortingClasses( settings );
    69052        
     69052
    6905369053                        $( rows ).removeClass( settings.asStripeClasses.join(' ') );
    69054        
     69054
    6905569055                        $('th, td', thead).removeClass( classes.sSortable+' '+
    6905669056                                classes.sSortableAsc+' '+classes.sSortableDesc+' '+classes.sSortableNone
    6905769057                        );
    69058        
     69058
    6905969059                        // Add the TR elements back into the table in their original order
    6906069060                        jqTbody.children().detach();
    6906169061                        jqTbody.append( rows );
    69062        
     69062
    6906369063                        // Remove the DataTables generated nodes, events and classes
    6906469064                        var removedMethod = remove ? 'remove' : 'detach';
    6906569065                        jqTable[ removedMethod ]();
    6906669066                        jqWrapper[ removedMethod ]();
    69067        
     69067
    6906869068                        // If we need to reattach the table to the document
    6906969069                        if ( ! remove && orig ) {
    6907069070                                // insertBefore acts like appendChild if !arg[1]
    6907169071                                orig.insertBefore( table, settings.nTableReinsertBefore );
    69072        
     69072
    6907369073                                // Restore the width of the original table - was read from the style property,
    6907469074                                // so we can restore directly to that
     
    6907669076                                        .css( 'width', settings.sDestroyWidth )
    6907769077                                        .removeClass( classes.sTable );
    69078        
     69078
    6907969079                                // If the were originally stripe classes - then we add them back here.
    6908069080                                // Note this is not fool proof (for example if not all rows had stripe
    6908169081                                // classes - but it's a good effort without getting carried away
    6908269082                                ien = settings.asDestroyStripes.length;
    69083        
     69083
    6908469084                                if ( ien ) {
    6908569085                                        jqTbody.children().each( function (i) {
     
    6908869088                                }
    6908969089                        }
    69090        
     69090
    6909169091                        /* Remove the settings object from the settings array */
    6909269092                        var idx = $.inArray( settings, DataTable.settings );
     
    6909669096                } );
    6909769097        } );
    69098        
    69099        
     69098
     69099
    6910069100        // Add the `every()` method for rows, columns and cells in a compact form
    6910169101        $.each( [ 'column', 'row', 'cell' ], function ( i, type ) {
     
    6910369103                        var opts = this.selector.opts;
    6910469104                        var api = this;
    69105        
     69105
    6910669106                        return this.iterator( type, function ( settings, arg1, arg2, arg3, arg4 ) {
    6910769107                                // Rows and columns:
     
    6912669126                } );
    6912769127        } );
    69128        
    69129        
     69128
     69129
    6913069130        // i18n method for extensions to be able to use the language object from the
    6913169131        // DataTable
     
    6913369133                var ctx = this.context[0];
    6913469134                var resolved = _fnGetObjectDataFn( token )( ctx.oLanguage );
    69135        
     69135
    6913669136                if ( resolved === undefined ) {
    6913769137                        resolved = def;
    6913869138                }
    69139        
     69139
    6914069140                if ( plural !== undefined && $.isPlainObject( resolved ) ) {
    6914169141                        resolved = resolved[ plural ] !== undefined ?
     
    6914369143                                resolved._;
    6914469144                }
    69145        
     69145
    6914669146                return resolved.replace( '%d', plural ); // nb: plural might be undefined,
    6914769147        } );
     
    6917769177         */
    6917869178        DataTable.models = {};
    69179        
    69180        
    69181        
     69179
     69180
     69181
    6918269182        /**
    6918369183         * Template object for the way in which DataTables holds information about
     
    6919269192                 */
    6919369193                "bCaseInsensitive": true,
    69194        
     69194
    6919569195                /**
    6919669196                 * Applied search term
     
    6919969199                 */
    6920069200                "sSearch": "",
    69201        
     69201
    6920269202                /**
    6920369203                 * Flag to indicate if the search term should be interpreted as a
     
    6920869208                 */
    6920969209                "bRegex": false,
    69210        
     69210
    6921169211                /**
    6921269212                 * Flag to indicate if DataTables is to use its smart filtering or not.
     
    6921669216                "bSmart": true
    6921769217        };
    69218        
    69219        
    69220        
    69221        
     69218
     69219
     69220
     69221
    6922269222        /**
    6922369223         * Template object for the way in which DataTables holds information about
     
    6923369233                 */
    6923469234                "nTr": null,
    69235        
     69235
    6923669236                /**
    6923769237                 * Array of TD elements for each row. This is null until the row has been
     
    6924169241                 */
    6924269242                "anCells": null,
    69243        
     69243
    6924469244                /**
    6924569245                 * Data object from the original data source for the row. This is either
     
    6925269252                 */
    6925369253                "_aData": [],
    69254        
     69254
    6925569255                /**
    6925669256                 * Sorting data cache - this array is ostensibly the same length as the
     
    6926669266                 */
    6926769267                "_aSortData": null,
    69268        
     69268
    6926969269                /**
    6927069270                 * Per cell filtering data cache. As per the sort data cache, used to
     
    6927569275                 */
    6927669276                "_aFilterData": null,
    69277        
     69277
    6927869278                /**
    6927969279                 * Filtering data cache. This is the same as the cell filtering cache, but
     
    6928669286                 */
    6928769287                "_sFilterRow": null,
    69288        
     69288
    6928969289                /**
    6929069290                 * Cache of the class name that DataTables has applied to the row, so we
     
    6929669296                 */
    6929769297                "_sRowStripe": "",
    69298        
     69298
    6929969299                /**
    6930069300                 * Denote if the original data source was from the DOM, or the data source
     
    6930769307                 */
    6930869308                "src": null,
    69309        
     69309
    6931069310                /**
    6931169311                 * Index in the aoData array. This saves an indexOf lookup when we have the
     
    6931769317                "idx": -1
    6931869318        };
    69319        
    69320        
     69319
     69320
    6932169321        /**
    6932269322         * Template object for the column information object in DataTables. This object
     
    6933869338                 */
    6933969339                "idx": null,
    69340        
     69340
    6934169341                /**
    6934269342                 * A list of the columns that sorting should occur on when this column
     
    6934969349                 */
    6935069350                "aDataSort": null,
    69351        
     69351
    6935269352                /**
    6935369353                 * Define the sorting directions that are applied to the column, in sequence
     
    6935969359                 */
    6936069360                "asSorting": null,
    69361        
     69361
    6936269362                /**
    6936369363                 * Flag to indicate if the column is searchable, and thus should be included
     
    6936669366                 */
    6936769367                "bSearchable": null,
    69368        
     69368
    6936969369                /**
    6937069370                 * Flag to indicate if the column is sortable or not.
     
    6937269372                 */
    6937369373                "bSortable": null,
    69374        
     69374
    6937569375                /**
    6937669376                 * Flag to indicate if the column is currently visible in the table or not
     
    6937869378                 */
    6937969379                "bVisible": null,
    69380        
     69380
    6938169381                /**
    6938269382                 * Store for manual type assignment using the `column.type` option. This
     
    6938769387                 */
    6938869388                "_sManualType": null,
    69389        
     69389
    6939069390                /**
    6939169391                 * Flag to indicate if HTML5 data attributes should be used as the data
     
    6939669396                 */
    6939769397                "_bAttrSrc": false,
    69398        
     69398
    6939969399                /**
    6940069400                 * Developer definable function that is called whenever a cell is created (Ajax source,
     
    6941069410                 */
    6941169411                "fnCreatedCell": null,
    69412        
     69412
    6941369413                /**
    6941469414                 * Function to get data from a cell in a column. You should <b>never</b>
     
    6942669426                 */
    6942769427                "fnGetData": null,
    69428        
     69428
    6942969429                /**
    6943069430                 * Function to set data for a cell in the column. You should <b>never</b>
     
    6943969439                 */
    6944069440                "fnSetData": null,
    69441        
     69441
    6944269442                /**
    6944369443                 * Property to read the value for the cells in the column from the data
     
    6944869448                 */
    6944969449                "mData": null,
    69450        
     69450
    6945169451                /**
    6945269452                 * Partner property to mData which is used (only when defined) to get
     
    6945869458                 */
    6945969459                "mRender": null,
    69460        
     69460
    6946169461                /**
    6946269462                 * Unique header TH/TD element for this column - this is what the sorting
     
    6946669466                 */
    6946769467                "nTh": null,
    69468        
     69468
    6946969469                /**
    6947069470                 * Unique footer TH/TD element for this column (if there is one). Not used
     
    6947569475                 */
    6947669476                "nTf": null,
    69477        
     69477
    6947869478                /**
    6947969479                 * The class to apply to all TD elements in the table's TBODY for the column
     
    6948269482                 */
    6948369483                "sClass": null,
    69484        
     69484
    6948569485                /**
    6948669486                 * When DataTables calculates the column widths to assign to each column,
     
    6949569495                 */
    6949669496                "sContentPadding": null,
    69497        
     69497
    6949869498                /**
    6949969499                 * Allows a default value to be given for a column's data, and will be used
     
    6950469504                 */
    6950569505                "sDefaultContent": null,
    69506        
     69506
    6950769507                /**
    6950869508                 * Name for the column, allowing reference to the column by name as well as
     
    6951169511                 */
    6951269512                "sName": null,
    69513        
     69513
    6951469514                /**
    6951569515                 * Custom sorting data type - defines which of the available plug-ins in
     
    6951969519                 */
    6952069520                "sSortDataType": 'std',
    69521        
     69521
    6952269522                /**
    6952369523                 * Class to be applied to the header element when sorting on this column
     
    6952669526                 */
    6952769527                "sSortingClass": null,
    69528        
     69528
    6952969529                /**
    6953069530                 * Class to be applied to the header element when sorting on this column -
     
    6953469534                 */
    6953569535                "sSortingClassJUI": null,
    69536        
     69536
    6953769537                /**
    6953869538                 * Title of the column - what is seen in the TH element (nTh).
     
    6954069540                 */
    6954169541                "sTitle": null,
    69542        
     69542
    6954369543                /**
    6954469544                 * Column sorting and filtering type
     
    6954769547                 */
    6954869548                "sType": null,
    69549        
     69549
    6955069550                /**
    6955169551                 * Width of the column
     
    6955469554                 */
    6955569555                "sWidth": null,
    69556        
     69556
    6955769557                /**
    6955869558                 * Width of the column when it was first "encountered"
     
    6956269562                "sWidthOrig": null
    6956369563        };
    69564        
    69565        
     69564
     69565
    6956669566        /*
    6956769567         * Developer note: The properties of the object below are given in Hungarian
     
    6957969579         * installs (therefore is on-hold until v2).
    6958069580         */
    69581        
     69581
    6958269582        /**
    6958369583         * Initialisation options that can be given to DataTables at initialisation
     
    6964669646                 */
    6964769647                "aaData": null,
    69648        
    69649        
     69648
     69649
    6965069650                /**
    6965169651                 * If ordering is enabled, then DataTables will perform a first pass sort on
     
    6967669676                 */
    6967769677                "aaSorting": [[0,'asc']],
    69678        
    69679        
     69678
     69679
    6968069680                /**
    6968169681                 * This parameter is basically identical to the `sorting` parameter, but
     
    6969969699                 */
    6970069700                "aaSortingFixed": [],
    69701        
    69702        
     69701
     69702
    6970369703                /**
    6970469704                 * DataTables can be instructed to load data to display in the table from a
     
    6985669856                 */
    6985769857                "ajax": null,
    69858        
    69859        
     69858
     69859
    6986069860                /**
    6986169861                 * This parameter allows you to readily specify the entries in the length drop
     
    6988269882                 */
    6988369883                "aLengthMenu": [ 10, 25, 50, 100 ],
    69884        
    69885        
     69884
     69885
    6988669886                /**
    6988769887                 * The `columns` option in the initialisation parameter allows you to define
     
    6989769897                 */
    6989869898                "aoColumns": null,
    69899        
     69899
    6990069900                /**
    6990169901                 * Very similar to `columns`, `columnDefs` allows you to target a specific
     
    6991869918                 */
    6991969919                "aoColumnDefs": null,
    69920        
    69921        
     69920
     69921
    6992269922                /**
    6992369923                 * Basically the same as `search`, this parameter defines the individual column
     
    6994569945                 */
    6994669946                "aoSearchCols": [],
    69947        
    69948        
     69947
     69948
    6994969949                /**
    6995069950                 * An array of CSS classes that should be applied to displayed rows. This
     
    6996669966                 */
    6996769967                "asStripeClasses": null,
    69968        
    69969        
     69968
     69969
    6997069970                /**
    6997169971                 * Enable or disable automatic column width calculation. This can be disabled
     
    6998669986                 */
    6998769987                "bAutoWidth": true,
    69988        
    69989        
     69988
     69989
    6999069990                /**
    6999169991                 * Deferred rendering can provide DataTables with a huge speed boost when you
     
    7000970009                 */
    7001070010                "bDeferRender": false,
    70011        
    70012        
     70011
     70012
    7001370013                /**
    7001470014                 * Replace a DataTable which matches the given selector and replace it with
     
    7003770037                 */
    7003870038                "bDestroy": false,
    70039        
    70040        
     70039
     70040
    7004170041                /**
    7004270042                 * Enable or disable filtering of data. Filtering in DataTables is "smart" in
     
    7006170061                 */
    7006270062                "bFilter": true,
    70063        
    70064        
     70063
     70064
    7006570065                /**
    7006670066                 * Enable or disable the table information display. This shows information
     
    7008170081                 */
    7008270082                "bInfo": true,
    70083        
    70084        
     70083
     70084
    7008570085                /**
    7008670086                 * Allows the end user to select the size of a formatted page from a select
     
    7010070100                 */
    7010170101                "bLengthChange": true,
    70102        
    70103        
     70102
     70103
    7010470104                /**
    7010570105                 * Enable or disable pagination.
     
    7011870118                 */
    7011970119                "bPaginate": true,
    70120        
    70121        
     70120
     70121
    7012270122                /**
    7012370123                 * Enable or disable the display of a 'processing' indicator when the table is
     
    7013970139                 */
    7014070140                "bProcessing": false,
    70141        
    70142        
     70141
     70142
    7014370143                /**
    7014470144                 * Retrieve the DataTables object for the given selector. Note that if the
     
    7017770177                 */
    7017870178                "bRetrieve": false,
    70179        
    70180        
     70179
     70180
    7018170181                /**
    7018270182                 * When vertical (y) scrolling is enabled, DataTables will force the height of
     
    7020170201                 */
    7020270202                "bScrollCollapse": false,
    70203        
    70204        
     70203
     70204
    7020570205                /**
    7020670206                 * Configure DataTables to use server-side processing. Note that the
     
    7022370223                 */
    7022470224                "bServerSide": false,
    70225        
    70226        
     70225
     70226
    7022770227                /**
    7022870228                 * Enable or disable sorting of columns. Sorting of individual columns can be
     
    7024270242                 */
    7024370243                "bSort": true,
    70244        
    70245        
     70244
     70245
    7024670246                /**
    7024770247                 * Enable or display DataTables' ability to sort multiple columns at the
     
    7026270262                 */
    7026370263                "bSortMulti": true,
    70264        
    70265        
     70264
     70265
    7026670266                /**
    7026770267                 * Allows control over whether DataTables should use the top (true) unique
     
    7028270282                 */
    7028370283                "bSortCellsTop": false,
    70284        
    70285        
     70284
     70285
    7028670286                /**
    7028770287                 * Enable or disable the addition of the classes `sorting\_1`, `sorting\_2` and
     
    7030470304                 */
    7030570305                "bSortClasses": true,
    70306        
    70307        
     70306
     70307
    7030870308                /**
    7030970309                 * Enable or disable state saving. When enabled HTML5 `localStorage` will be
     
    7032970329                 */
    7033070330                "bStateSave": false,
    70331        
    70332        
     70331
     70332
    7033370333                /**
    7033470334                 * This function is called when a TR element is created (and all TD child
     
    7035770357                 */
    7035870358                "fnCreatedRow": null,
    70359        
    70360        
     70359
     70360
    7036170361                /**
    7036270362                 * This function is called on every 'draw' event, and allows you to
     
    7037870378                 */
    7037970379                "fnDrawCallback": null,
    70380        
    70381        
     70380
     70381
    7038270382                /**
    7038370383                 * Identical to fnHeaderCallback() but for the table footer this function
     
    7040670406                 */
    7040770407                "fnFooterCallback": null,
    70408        
    70409        
     70408
     70409
    7041070410                /**
    7041170411                 * When rendering large numbers in the information element for the table
     
    7044170441                        );
    7044270442                },
    70443        
    70444        
     70443
     70444
    7044570445                /**
    7044670446                 * This function is called on every 'draw' event, and allows you to
     
    7047070470                 */
    7047170471                "fnHeaderCallback": null,
    70472        
    70473        
     70472
     70473
    7047470474                /**
    7047570475                 * The information element can be used to convey information about the current
     
    7050070500                 */
    7050170501                "fnInfoCallback": null,
    70502        
    70503        
     70502
     70503
    7050470504                /**
    7050570505                 * Called when the table has been initialised. Normally DataTables will
     
    7052570525                 */
    7052670526                "fnInitComplete": null,
    70527        
    70528        
     70527
     70528
    7052970529                /**
    7053070530                 * Called at the very start of each table draw and can be used to cancel the
     
    7055170551                 */
    7055270552                "fnPreDrawCallback": null,
    70553        
    70554        
     70553
     70554
    7055570555                /**
    7055670556                 * This function allows you to 'post process' each row after it have been
     
    7058070580                 */
    7058170581                "fnRowCallback": null,
    70582        
    70583        
     70582
     70583
    7058470584                /**
    7058570585                 * __Deprecated__ The functionality provided by this parameter has now been
     
    7060670606                 */
    7060770607                "fnServerData": null,
    70608        
    70609        
     70608
     70609
    7061070610                /**
    7061170611                 * __Deprecated__ The functionality provided by this parameter has now been
     
    7063370633                 */
    7063470634                "fnServerParams": null,
    70635        
    70636        
     70635
     70636
    7063770637                /**
    7063870638                 * Load the table state. With this function you can define from where, and how, the
     
    7067470674                        } catch (e) {}
    7067570675                },
    70676        
    70677        
     70676
     70677
    7067870678                /**
    7067970679                 * Callback which allows modification of the saved state prior to loading that state.
     
    7071270712                 */
    7071370713                "fnStateLoadParams": null,
    70714        
    70715        
     70714
     70715
    7071670716                /**
    7071770717                 * Callback that is called when the state has been loaded from the state saving method
     
    7073670736                 */
    7073770737                "fnStateLoaded": null,
    70738        
    70739        
     70738
     70739
    7074070740                /**
    7074170741                 * Save the table state. This function allows you to define where and how the state
     
    7077570775                        } catch (e) {}
    7077670776                },
    70777        
    70778        
     70777
     70778
    7077970779                /**
    7078070780                 * Callback which allows modification of the state to be saved. Called when the table
     
    7080270802                 */
    7080370803                "fnStateSaveParams": null,
    70804        
    70805        
     70804
     70805
    7080670806                /**
    7080770807                 * Duration for which the saved state information is considered valid. After this period
     
    7082270822                 */
    7082370823                "iStateDuration": 7200,
    70824        
    70825        
     70824
     70825
    7082670826                /**
    7082770827                 * When enabled DataTables will not make a request to the server for the first
     
    7086670866                 */
    7086770867                "iDeferLoading": null,
    70868        
    70869        
     70868
     70869
    7087070870                /**
    7087170871                 * Number of rows to display on a single page when using pagination. If
     
    7088670886                 */
    7088770887                "iDisplayLength": 10,
    70888        
    70889        
     70888
     70889
    7089070890                /**
    7089170891                 * Define the starting point for data display when using DataTables with
     
    7090770907                 */
    7090870908                "iDisplayStart": 0,
    70909        
    70910        
     70909
     70910
    7091170911                /**
    7091270912                 * By default DataTables allows keyboard navigation of the table (sorting, paging,
     
    7093070930                 */
    7093170931                "iTabIndex": 0,
    70932        
    70933        
     70932
     70933
    7093470934                /**
    7093570935                 * Classes that DataTables assigns to the various components and features
     
    7094170941                 */
    7094270942                "oClasses": {},
    70943        
    70944        
     70943
     70944
    7094570945                /**
    7094670946                 * All strings that DataTables uses in the user interface that it creates
     
    7098170981                                 */
    7098270982                                "sSortAscending": ": activate to sort column ascending",
    70983        
     70983
    7098470984                                /**
    7098570985                                 * ARIA label that is added to the table headers when the column may be
     
    7100571005                                "sSortDescending": ": activate to sort column descending"
    7100671006                        },
    71007        
     71007
    7100871008                        /**
    7100971009                         * Pagination string used by DataTables for the built-in pagination
     
    7103471034                                 */
    7103571035                                "sFirst": "First",
    71036        
    71037        
     71036
     71037
    7103871038                                /**
    7103971039                                 * Text to use when using the 'full_numbers' type of pagination for the
     
    7105771057                                 */
    7105871058                                "sLast": "Last",
    71059        
    71060        
     71059
     71060
    7106171061                                /**
    7106271062                                 * Text to use for the 'next' pagination button (to take the user to the
     
    7108071080                                 */
    7108171081                                "sNext": "Next",
    71082        
    71083        
     71082
     71083
    7108471084                                /**
    7108571085                                 * Text to use for the 'previous' pagination button (to take the user to
     
    7110471104                                "sPrevious": "Previous"
    7110571105                        },
    71106        
     71106
    7110771107                        /**
    7110871108                         * This string is shown in preference to `zeroRecords` when the table is
     
    7112671126                         */
    7112771127                        "sEmptyTable": "No data available in table",
    71128        
    71129        
     71128
     71129
    7113071130                        /**
    7113171131                         * This string gives information to the end user about the information
     
    7115871158                         */
    7115971159                        "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
    71160        
    71161        
     71160
     71161
    7116271162                        /**
    7116371163                         * Display information string for when the table is empty. Typically the
     
    7117971179                         */
    7118071180                        "sInfoEmpty": "Showing 0 to 0 of 0 entries",
    71181        
    71182        
     71181
     71182
    7118371183                        /**
    7118471184                         * When a user filters the information in a table, this string is appended
     
    7120171201                         */
    7120271202                        "sInfoFiltered": "(filtered from _MAX_ total entries)",
    71203        
    71204        
     71203
     71204
    7120571205                        /**
    7120671206                         * If can be useful to append extra information to the info string at times,
     
    7122471224                         */
    7122571225                        "sInfoPostFix": "",
    71226        
    71227        
     71226
     71227
    7122871228                        /**
    7122971229                         * This decimal place operator is a little different from the other
     
    7123971239                         * decimal place characters.
    7124071240                         *  @type string
    71241                          *  @default 
     71241                         *  @default
    7124271242                         *
    7124371243                         *  @dtopt Language
     
    7125571255                         */
    7125671256                        "sDecimal": "",
    71257        
    71258        
     71257
     71258
    7125971259                        /**
    7126071260                         * DataTables has a build in number formatter (`formatNumber`) which is
     
    7127871278                         */
    7127971279                        "sThousands": ",",
    71280        
    71281        
     71280
     71281
    7128271282                        /**
    7128371283                         * Detail the action that will be taken when the drop down menu for the
     
    7131971319                         */
    7132071320                        "sLengthMenu": "Show _MENU_ entries",
    71321        
    71322        
     71321
     71322
    7132371323                        /**
    7132471324                         * When using Ajax sourced data and during the first draw when DataTables is
     
    7134371343                         */
    7134471344                        "sLoadingRecords": "Loading...",
    71345        
    71346        
     71345
     71346
    7134771347                        /**
    7134871348                         * Text which is displayed when the table is processing a user action
     
    7136471364                         */
    7136571365                        "sProcessing": "Processing...",
    71366        
    71367        
     71366
     71367
    7136871368                        /**
    7136971369                         * Details the actions that will be taken when the user types into the
     
    7139971399                         */
    7140071400                        "sSearch": "Search:",
    71401        
    71402        
     71401
     71402
    7140371403                        /**
    7140471404                         * Assign a `placeholder` attribute to the search `input` element
    7140571405                         *  @type string
    71406                          *  @default 
     71406                         *  @default
    7140771407                         *
    7140871408                         *  @dtopt Language
     
    7141071410                         */
    7141171411                        "sSearchPlaceholder": "",
    71412        
    71413        
     71412
     71413
    7141471414                        /**
    7141571415                         * All of the language information can be stored in a file on the
     
    7143571435                         */
    7143671436                        "sUrl": "",
    71437        
    71438        
     71437
     71438
    7143971439                        /**
    7144071440                         * Text shown inside the table records when the is no information to be
     
    7145871458                        "sZeroRecords": "No matching records found"
    7145971459                },
    71460        
    71461        
     71460
     71461
    7146271462                /**
    7146371463                 * This parameter allows you to have define the global filtering state at
     
    7148271482                 */
    7148371483                "oSearch": $.extend( {}, DataTable.models.oSearch ),
    71484        
    71485        
     71484
     71485
    7148671486                /**
    7148771487                 * __Deprecated__ The functionality provided by this parameter has now been
     
    7150371503                 */
    7150471504                "sAjaxDataProp": "data",
    71505        
    71506        
     71505
     71506
    7150771507                /**
    7150871508                 * __Deprecated__ The functionality provided by this parameter has now been
     
    7152271522                 */
    7152371523                "sAjaxSource": null,
    71524        
    71525        
     71524
     71525
    7152671526                /**
    7152771527                 * This initialisation variable allows you to specify exactly where in the
     
    7157671576                 */
    7157771577                "sDom": "lfrtip",
    71578        
    71579        
     71578
     71579
    7158071580                /**
    7158171581                 * Search delay option. This will throttle full table searches that use the
     
    7159671596                 */
    7159771597                "searchDelay": null,
    71598        
    71599        
     71598
     71599
    7160071600                /**
    7160171601                 * DataTables features six different built-in options for the buttons to
     
    7160871608                 * * `full_numbers` - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
    7160971609                 * * `first_last_numbers` - 'First' and 'Last' buttons, plus page numbers
    71610                  * 
     71610                 *
    7161171611                 * Further methods can be added using {@link DataTable.ext.oPagination}.
    7161271612                 *  @type string
     
    7162471624                 */
    7162571625                "sPaginationType": "simple_numbers",
    71626        
    71627        
     71626
     71627
    7162871628                /**
    7162971629                 * Enable horizontal scrolling. When a table is too wide to fit into a
     
    7164971649                 */
    7165071650                "sScrollX": "",
    71651        
    71652        
     71651
     71652
    7165371653                /**
    7165471654                 * This property can be used to force a DataTable to use more width than it
     
    7167371673                 */
    7167471674                "sScrollXInner": "",
    71675        
    71676        
     71675
     71676
    7167771677                /**
    7167871678                 * Enable vertical scrolling. Vertical scrolling will constrain the DataTable
     
    7169771697                 */
    7169871698                "sScrollY": "",
    71699        
    71700        
     71699
     71700
    7170171701                /**
    7170271702                 * __Deprecated__ The functionality provided by this parameter has now been
     
    7171571715                 */
    7171671716                "sServerMethod": "GET",
    71717        
    71718        
     71717
     71718
    7171971719                /**
    7172071720                 * DataTables makes use of renderers when displaying HTML elements for
     
    7173371733                 */
    7173471734                "renderer": null,
    71735        
    71736        
     71735
     71736
    7173771737                /**
    7173871738                 * Set the data property name that DataTables should use to get a row's id
     
    7174571745                "rowId": "DT_RowId"
    7174671746        };
    71747        
     71747
    7174871748        _fnHungarianMap( DataTable.defaults );
    71749        
    71750        
    71751        
     71749
     71750
     71751
    7175271752        /*
    7175371753         * Developer note - See note in model.defaults.js about the use of Hungarian
    7175471754         * notation and camel case.
    7175571755         */
    71756        
     71756
    7175771757        /**
    7175871758         * Column options that can be given to DataTables at initialisation time.
     
    7180071800                "aDataSort": null,
    7180171801                "iDataSort": -1,
    71802        
    71803        
     71802
     71803
    7180471804                /**
    7180571805                 * You can control the default ordering direction, and even alter the
     
    7183971839                 */
    7184071840                "asSorting": [ 'asc', 'desc' ],
    71841        
    71842        
     71841
     71842
    7184371843                /**
    7184471844                 * Enable or disable filtering on the data in this column.
     
    7187271872                 */
    7187371873                "bSearchable": true,
    71874        
    71875        
     71874
     71875
    7187671876                /**
    7187771877                 * Enable or disable ordering on this column.
     
    7190571905                 */
    7190671906                "bSortable": true,
    71907        
    71908        
     71907
     71908
    7190971909                /**
    7191071910                 * Enable or disable the display of this column.
     
    7193871938                 */
    7193971939                "bVisible": true,
    71940        
    71941        
     71940
     71941
    7194271942                /**
    7194371943                 * Developer definable function that is called whenever a cell is created (Ajax source,
     
    7197071970                 */
    7197171971                "fnCreatedCell": null,
    71972        
    71973        
     71972
     71973
    7197471974                /**
    7197571975                 * This parameter has been replaced by `data` in DataTables to ensure naming
     
    7197971979                 *  @name DataTable.defaults.column.dataProp
    7198071980                 */
    71981        
    71982        
     71981
     71982
    7198371983                /**
    7198471984                 * This property can be used to read data from any data source property,
     
    7215172151                 */
    7215272152                "mData": null,
    72153        
    72154        
     72153
     72154
    7215572155                /**
    7215672156                 * This property is the rendering partner to `data` and it is suggested that
     
    7227372273                 */
    7227472274                "mRender": null,
    72275        
    72276        
     72275
     72276
    7227772277                /**
    7227872278                 * Change the cell type created for the column - either TD cells or TH cells. This
     
    7229772297                 */
    7229872298                "sCellType": "td",
    72299        
    72300        
     72299
     72300
    7230172301                /**
    7230272302                 * Class to give to each cell in this column.
     
    7233272332                 */
    7233372333                "sClass": "",
    72334        
     72334
    7233572335                /**
    7233672336                 * When DataTables calculates the column widths to assign to each column,
     
    7236572365                 */
    7236672366                "sContentPadding": "",
    72367        
    72368        
     72367
     72368
    7236972369                /**
    7237072370                 * Allows a default value to be given for a column's data, and will be used
     
    7240872408                 */
    7240972409                "sDefaultContent": null,
    72410        
    72411        
     72410
     72411
    7241272412                /**
    7241372413                 * This parameter is only used in DataTables' server-side processing. It can
     
    7245272452                 */
    7245372453                "sName": "",
    72454        
    72455        
     72454
     72455
    7245672456                /**
    7245772457                 * Defines a data source type for the ordering which can be used to read
     
    7249472494                 */
    7249572495                "sSortDataType": "std",
    72496        
    72497        
     72496
     72497
    7249872498                /**
    7249972499                 * The title of this column.
     
    7253072530                 */
    7253172531                "sTitle": null,
    72532        
    72533        
     72532
     72533
    7253472534                /**
    7253572535                 * The type allows you to specify how the data for this column will be
     
    7257172571                 */
    7257272572                "sType": null,
    72573        
    72574        
     72573
     72574
    7257572575                /**
    7257672576                 * Defining the width of the column, this parameter may take any CSS value
     
    7261072610                "sWidth": null
    7261172611        };
    72612        
     72612
    7261372613        _fnHungarianMap( DataTable.defaults.column );
    72614        
    72615        
    72616        
     72614
     72615
     72616
    7261772617        /**
    7261872618         * DataTables settings object - this holds all the information needed for a
     
    7264372643                 */
    7264472644                "oFeatures": {
    72645        
     72645
    7264672646                        /**
    7264772647                         * Flag to say if DataTables should automatically try to calculate the
     
    7265272652                         */
    7265372653                        "bAutoWidth": null,
    72654        
     72654
    7265572655                        /**
    7265672656                         * Delay the creation of TR and TD elements until they are actually
     
    7266372663                         */
    7266472664                        "bDeferRender": null,
    72665        
     72665
    7266672666                        /**
    7266772667                         * Enable filtering on the table or not. Note that if this is disabled
     
    7267372673                         */
    7267472674                        "bFilter": null,
    72675        
     72675
    7267672676                        /**
    7267772677                         * Table information element (the 'Showing x of y records' div) enable
     
    7268272682                         */
    7268372683                        "bInfo": null,
    72684        
     72684
    7268572685                        /**
    7268672686                         * Present a user control allowing the end user to change the page size
     
    7269172691                         */
    7269272692                        "bLengthChange": null,
    72693        
     72693
    7269472694                        /**
    7269572695                         * Pagination enabled or not. Note that if this is disabled then length
     
    7270072700                         */
    7270172701                        "bPaginate": null,
    72702        
     72702
    7270372703                        /**
    7270472704                         * Processing indicator enable flag whenever DataTables is enacting a
     
    7270972709                         */
    7271072710                        "bProcessing": null,
    72711        
     72711
    7271272712                        /**
    7271372713                         * Server-side processing enabled flag - when enabled DataTables will
     
    7271972719                         */
    7272072720                        "bServerSide": null,
    72721        
     72721
    7272272722                        /**
    7272372723                         * Sorting enablement flag.
     
    7272772727                         */
    7272872728                        "bSort": null,
    72729        
     72729
    7273072730                        /**
    7273172731                         * Multi-column sorting
     
    7273572735                         */
    7273672736                        "bSortMulti": null,
    72737        
     72737
    7273872738                        /**
    7273972739                         * Apply a class to the columns which are being sorted to provide a
     
    7274572745                         */
    7274672746                        "bSortClasses": null,
    72747        
     72747
    7274872748                        /**
    7274972749                         * State saving enablement flag.
     
    7275472754                        "bStateSave": null
    7275572755                },
    72756        
    72757        
     72756
     72757
    7275872758                /**
    7275972759                 * Scrolling settings for a table.
     
    7276972769                         */
    7277072770                        "bCollapse": null,
    72771        
     72771
    7277272772                        /**
    7277372773                         * Width of the scrollbar for the web-browser's platform. Calculated
     
    7277772777                         */
    7277872778                        "iBarWidth": 0,
    72779        
     72779
    7278072780                        /**
    7278172781                         * Viewport width for horizontal scrolling. Horizontal scrolling is
     
    7278672786                         */
    7278772787                        "sX": null,
    72788        
     72788
    7278972789                        /**
    7279072790                         * Width to expand the table to when using x-scrolling. Typically you
     
    7279672796                         */
    7279772797                        "sXInner": null,
    72798        
     72798
    7279972799                        /**
    7280072800                         * Viewport height for vertical scrolling. Vertical scrolling is disabled
     
    7280672806                        "sY": null
    7280772807                },
    72808        
     72808
    7280972809                /**
    7281072810                 * Language information for the table.
     
    7282172821                        "fnInfoCallback": null
    7282272822                },
    72823        
     72823
    7282472824                /**
    7282572825                 * Browser support parameters
     
    7283472834                         */
    7283572835                        "bScrollOversize": false,
    72836        
     72836
    7283772837                        /**
    7283872838                         * Determine if the vertical scrollbar is on the right or left of the
     
    7284372843                         */
    7284472844                        "bScrollbarLeft": false,
    72845        
     72845
    7284672846                        /**
    7284772847                         * Flag for if `getBoundingClientRect` is fully supported or not
     
    7285072850                         */
    7285172851                        "bBounding": false,
    72852        
     72852
    7285372853                        /**
    7285472854                         * Browser scrollbar width
     
    7285872858                        "barWidth": 0
    7285972859                },
    72860        
    72861        
     72860
     72861
    7286272862                "ajax": null,
    72863        
    72864        
     72863
     72864
    7286572865                /**
    7286672866                 * Array referencing the nodes which are used for the features. The
     
    7287872878                 */
    7287972879                "aanFeatures": [],
    72880        
     72880
    7288172881                /**
    7288272882                 * Store data information - see {@link DataTable.models.oRow} for detailed
     
    7288672886                 */
    7288772887                "aoData": [],
    72888        
     72888
    7288972889                /**
    7289072890                 * Array of indexes which are in the current display (after filtering etc)
     
    7289372893                 */
    7289472894                "aiDisplay": [],
    72895        
     72895
    7289672896                /**
    7289772897                 * Array of indexes for display - no filtering
     
    7290072900                 */
    7290172901                "aiDisplayMaster": [],
    72902        
     72902
    7290372903                /**
    7290472904                 * Map of row ids to data indexes
     
    7290772907                 */
    7290872908                "aIds": {},
    72909        
     72909
    7291072910                /**
    7291172911                 * Store information about each column that is in use
     
    7291472914                 */
    7291572915                "aoColumns": [],
    72916        
     72916
    7291772917                /**
    7291872918                 * Store information about the table's header
     
    7292172921                 */
    7292272922                "aoHeader": [],
    72923        
     72923
    7292472924                /**
    7292572925                 * Store information about the table's footer
     
    7292872928                 */
    7292972929                "aoFooter": [],
    72930        
     72930
    7293172931                /**
    7293272932                 * Store the applied global search information in case we want to force a
     
    7293872938                 */
    7293972939                "oPreviousSearch": {},
    72940        
     72940
    7294172941                /**
    7294272942                 * Store the applied search for each column - see
     
    7294772947                 */
    7294872948                "aoPreSearchCols": [],
    72949        
     72949
    7295072950                /**
    7295172951                 * Sorting that is applied to the table. Note that the inner arrays are
     
    7296172961                 */
    7296272962                "aaSorting": null,
    72963        
     72963
    7296472964                /**
    7296572965                 * Sorting that is always applied to the table (i.e. prefixed in front of
     
    7297172971                 */
    7297272972                "aaSortingFixed": [],
    72973        
     72973
    7297472974                /**
    7297572975                 * Classes to use for the striping of a table.
     
    7298072980                 */
    7298172981                "asStripeClasses": null,
    72982        
     72982
    7298372983                /**
    7298472984                 * If restoring a table - we should restore its striping classes as well
     
    7298772987                 */
    7298872988                "asDestroyStripes": [],
    72989        
     72989
    7299072990                /**
    7299172991                 * If restoring a table - we should restore its width
     
    7299472994                 */
    7299572995                "sDestroyWidth": 0,
    72996        
     72996
    7299772997                /**
    7299872998                 * Callback functions array for every time a row is inserted (i.e. on a draw).
     
    7300173001                 */
    7300273002                "aoRowCallback": [],
    73003        
     73003
    7300473004                /**
    7300573005                 * Callback functions for the header on each draw.
     
    7300873008                 */
    7300973009                "aoHeaderCallback": [],
    73010        
     73010
    7301173011                /**
    7301273012                 * Callback function for the footer on each draw.
     
    7301573015                 */
    7301673016                "aoFooterCallback": [],
    73017        
     73017
    7301873018                /**
    7301973019                 * Array of callback functions for draw callback functions
     
    7302273022                 */
    7302373023                "aoDrawCallback": [],
    73024        
     73024
    7302573025                /**
    7302673026                 * Array of callback functions for row created function
     
    7302973029                 */
    7303073030                "aoRowCreatedCallback": [],
    73031        
     73031
    7303273032                /**
    7303373033                 * Callback functions for just before the table is redrawn. A return of
     
    7303773037                 */
    7303873038                "aoPreDrawCallback": [],
    73039        
     73039
    7304073040                /**
    7304173041                 * Callback functions for when the table has been initialised.
     
    7304473044                 */
    7304573045                "aoInitComplete": [],
    73046        
    73047        
     73046
     73047
    7304873048                /**
    7304973049                 * Callbacks for modifying the settings to be stored for state saving, prior to
     
    7305373053                 */
    7305473054                "aoStateSaveParams": [],
    73055        
     73055
    7305673056                /**
    7305773057                 * Callbacks for modifying the settings that have been stored for state saving
     
    7306173061                 */
    7306273062                "aoStateLoadParams": [],
    73063        
     73063
    7306473064                /**
    7306573065                 * Callbacks for operating on the settings object once the saved state has been
     
    7306973069                 */
    7307073070                "aoStateLoaded": [],
    73071        
     73071
    7307273072                /**
    7307373073                 * Cache the table ID for quick access
     
    7307673076                 */
    7307773077                "sTableId": "",
    73078        
     73078
    7307973079                /**
    7308073080                 * The TABLE node for the main table
     
    7308373083                 */
    7308473084                "nTable": null,
    73085        
     73085
    7308673086                /**
    7308773087                 * Permanent ref to the thead element
     
    7309073090                 */
    7309173091                "nTHead": null,
    73092        
     73092
    7309373093                /**
    7309473094                 * Permanent ref to the tfoot element - if it exists
     
    7309773097                 */
    7309873098                "nTFoot": null,
    73099        
     73099
    7310073100                /**
    7310173101                 * Permanent ref to the tbody element
     
    7310473104                 */
    7310573105                "nTBody": null,
    73106        
     73106
    7310773107                /**
    7310873108                 * Cache the wrapper node (contains all DataTables controlled elements)
     
    7311173111                 */
    7311273112                "nTableWrapper": null,
    73113        
     73113
    7311473114                /**
    7311573115                 * Indicate if when using server-side processing the loading of data
     
    7312173121                 */
    7312273122                "bDeferLoading": false,
    73123        
     73123
    7312473124                /**
    7312573125                 * Indicate if all required information has been read in
     
    7312873128                 */
    7312973129                "bInitialised": false,
    73130        
     73130
    7313173131                /**
    7313273132                 * Information about open rows. Each object in the array has the parameters
     
    7313673136                 */
    7313773137                "aoOpenRows": [],
    73138        
     73138
    7313973139                /**
    7314073140                 * Dictate the positioning of DataTables' control elements - see
     
    7314673146                 */
    7314773147                "sDom": null,
    73148        
     73148
    7314973149                /**
    7315073150                 * Search delay (in mS)
     
    7315373153                 */
    7315473154                "searchDelay": null,
    73155        
     73155
    7315673156                /**
    7315773157                 * Which type of pagination should be used.
     
    7316273162                 */
    7316373163                "sPaginationType": "two_button",
    73164        
     73164
    7316573165                /**
    7316673166                 * The state duration (for `stateSave`) in seconds.
     
    7317173171                 */
    7317273172                "iStateDuration": 0,
    73173        
     73173
    7317473174                /**
    7317573175                 * Array of callback functions for state saving. Each array element is an
     
    7318673186                 */
    7318773187                "aoStateSave": [],
    73188        
     73188
    7318973189                /**
    7319073190                 * Array of callback functions for state loading. Each array element is an
     
    7319973199                 */
    7320073200                "aoStateLoad": [],
    73201        
     73201
    7320273202                /**
    7320373203                 * State that was saved. Useful for back reference
     
    7320673206                 */
    7320773207                "oSavedState": null,
    73208        
     73208
    7320973209                /**
    7321073210                 * State that was loaded. Useful for back reference
     
    7321373213                 */
    7321473214                "oLoadedState": null,
    73215        
     73215
    7321673216                /**
    7321773217                 * Source url for AJAX data for the table.
     
    7322273222                 */
    7322373223                "sAjaxSource": null,
    73224        
     73224
    7322573225                /**
    7322673226                 * Property from a given object from which to read the table data from. This
     
    7323273232                 */
    7323373233                "sAjaxDataProp": null,
    73234        
     73234
    7323573235                /**
    7323673236                 * Note if draw should be blocked while getting data
     
    7323973239                 */
    7324073240                "bAjaxDataGet": true,
    73241        
     73241
    7324273242                /**
    7324373243                 * The last jQuery XHR object that was used for server-side data gathering.
     
    7324873248                 */
    7324973249                "jqXHR": null,
    73250        
     73250
    7325173251                /**
    7325273252                 * JSON returned from the server in the last Ajax request
     
    7325573255                 */
    7325673256                "json": undefined,
    73257        
     73257
    7325873258                /**
    7325973259                 * Data submitted as part of the last Ajax request
     
    7326273262                 */
    7326373263                "oAjaxData": undefined,
    73264        
     73264
    7326573265                /**
    7326673266                 * Function to get the server-side data.
     
    7327073270                 */
    7327173271                "fnServerData": null,
    73272        
     73272
    7327373273                /**
    7327473274                 * Functions which are called prior to sending an Ajax request so extra
     
    7327873278                 */
    7327973279                "aoServerParams": [],
    73280        
     73280
    7328173281                /**
    7328273282                 * Send the XHR HTTP method - GET or POST (could be PUT or DELETE if
     
    7328773287                 */
    7328873288                "sServerMethod": null,
    73289        
     73289
    7329073290                /**
    7329173291                 * Format numbers for display.
     
    7329573295                 */
    7329673296                "fnFormatNumber": null,
    73297        
     73297
    7329873298                /**
    7329973299                 * List of options that can be used for the user selectable length menu.
     
    7330473304                 */
    7330573305                "aLengthMenu": null,
    73306        
     73306
    7330773307                /**
    7330873308                 * Counter for the draws that the table does. Also used as a tracker for
     
    7331273312                 */
    7331373313                "iDraw": 0,
    73314        
     73314
    7331573315                /**
    7331673316                 * Indicate if a redraw is being done - useful for Ajax
     
    7331973319                 */
    7332073320                "bDrawing": false,
    73321        
     73321
    7332273322                /**
    7332373323                 * Draw index (iDraw) of the last error when parsing the returned data
     
    7332673326                 */
    7332773327                "iDrawError": -1,
    73328        
     73328
    7332973329                /**
    7333073330                 * Paging display length
     
    7333373333                 */
    7333473334                "_iDisplayLength": 10,
    73335        
     73335
    7333673336                /**
    7333773337                 * Paging start point - aiDisplay index
     
    7334073340                 */
    7334173341                "_iDisplayStart": 0,
    73342        
     73342
    7334373343                /**
    7334473344                 * Server-side processing - number of records in the result set
     
    7335173351                 */
    7335273352                "_iRecordsTotal": 0,
    73353        
     73353
    7335473354                /**
    7335573355                 * Server-side processing - number of records in the current display set
     
    7336273362                 */
    7336373363                "_iRecordsDisplay": 0,
    73364        
     73364
    7336573365                /**
    7336673366                 * The classes to use for the table
     
    7336973369                 */
    7337073370                "oClasses": {},
    73371        
     73371
    7337273372                /**
    7337373373                 * Flag attached to the settings object so you can check in the draw
     
    7337973379                 */
    7338073380                "bFiltered": false,
    73381        
     73381
    7338273382                /**
    7338373383                 * Flag attached to the settings object so you can check in the draw
     
    7338973389                 */
    7339073390                "bSorted": false,
    73391        
     73391
    7339273392                /**
    7339373393                 * Indicate that if multiple rows are in the header and there is more than
     
    7339973399                 */
    7340073400                "bSortCellsTop": null,
    73401        
     73401
    7340273402                /**
    7340373403                 * Initialisation object that is used for the table
     
    7340673406                 */
    7340773407                "oInit": null,
    73408        
     73408
    7340973409                /**
    7341073410                 * Destroy callback functions - for plug-ins to attach themselves to the
     
    7341473414                 */
    7341573415                "aoDestroyCallback": [],
    73416        
    73417        
     73416
     73417
    7341873418                /**
    7341973419                 * Get the number of records in the current record set, before filtering
     
    7342673426                                this.aiDisplayMaster.length;
    7342773427                },
    73428        
     73428
    7342973429                /**
    7343073430                 * Get the number of records in the current record set, after filtering
     
    7343773437                                this.aiDisplay.length;
    7343873438                },
    73439        
     73439
    7344073440                /**
    7344173441                 * Get the display end point - aiDisplay index
     
    7345173451                                features = this.oFeatures,
    7345273452                                paginate = features.bPaginate;
    73453        
     73453
    7345473454                        if ( features.bServerSide ) {
    7345573455                                return paginate === false || len === -1 ?
     
    7346373463                        }
    7346473464                },
    73465        
     73465
    7346673466                /**
    7346773467                 * The DataTables object for this table
     
    7347073470                 */
    7347173471                "oInstance": null,
    73472        
     73472
    7347373473                /**
    7347473474                 * Unique identifier for each instance of the DataTables object. If there
     
    7347973479                 */
    7348073480                "sInstance": null,
    73481        
     73481
    7348273482                /**
    7348373483                 * tabindex attribute value that is added to DataTables control elements, allowing
     
    7348573485                 */
    7348673486                "iTabIndex": 0,
    73487        
     73487
    7348873488                /**
    7348973489                 * DIV container for the footer scrolling table if scrolling
    7349073490                 */
    7349173491                "nScrollHead": null,
    73492        
     73492
    7349373493                /**
    7349473494                 * DIV container for the footer scrolling table if scrolling
    7349573495                 */
    7349673496                "nScrollFoot": null,
    73497        
     73497
    7349873498                /**
    7349973499                 * Last applied sort
     
    7350273502                 */
    7350373503                "aLastSort": [],
    73504        
     73504
    7350573505                /**
    7350673506                 * Stored plug-in instances
     
    7350973509                 */
    7351073510                "oPlugins": {},
    73511        
     73511
    7351273512                /**
    7351373513                 * Function used to get a row's id from the row's data
     
    7351673516                 */
    7351773517                "rowIdFn": null,
    73518        
     73518
    7351973519                /**
    7352073520                 * Data location where to store a row's id
     
    7353573535         *  @extends DataTable.models.ext
    7353673536         */
    73537        
    73538        
     73537
     73538
    7353973539        /**
    7354073540         * DataTables extensions
    73541          * 
     73541         *
    7354273542         * This namespace acts as a collection area for plug-ins that can be used to
    7354373543         * extend DataTables capabilities. Indeed many of the build in methods
     
    7356073560                 */
    7356173561                buttons: {},
    73562        
    73563        
     73562
     73563
    7356473564                /**
    7356573565                 * Element class names
     
    7356973569                 */
    7357073570                classes: {},
    73571        
    73572        
     73571
     73572
    7357373573                /**
    7357473574                 * DataTables build type (expanded by the download builder)
     
    7357773577                 */
    7357873578                build:"bs4/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.20/af-2.3.4/b-1.6.1/b-colvis-1.6.1/b-flash-1.6.1/b-html5-1.6.1/b-print-1.6.1/cr-1.5.2/fc-3.3.0/fh-3.1.6/kt-2.5.1/r-2.2.3/rg-1.1.1/rr-1.2.6/sc-2.0.1/sp-1.0.1/sl-1.3.1",
    73579        
    73580        
     73579
     73580
    7358173581                /**
    7358273582                 * Error reporting.
    73583                  * 
     73583                 *
    7358473584                 * How should DataTables report an error. Can take the value 'alert',
    7358573585                 * 'throw', 'none' or a function.
     
    7358973589                 */
    7359073590                errMode: "alert",
    73591        
    73592        
     73591
     73592
    7359373593                /**
    7359473594                 * Feature plug-ins.
    73595                  * 
     73595                 *
    7359673596                 * This is an array of objects which describe the feature plug-ins that are
    7359773597                 * available to DataTables. These feature plug-ins are then available for
    7359873598                 * use through the `dom` initialisation option.
    73599                  * 
     73599                 *
    7360073600                 * Each feature plug-in is described by an object which must have the
    7360173601                 * following properties:
    73602                  * 
     73602                 *
    7360373603                 * * `fnInit` - function that is used to initialise the plug-in,
    7360473604                 * * `cFeature` - a character so the feature can be enabled by the `dom`
     
    7361173611                 *
    7361273612                 * And the following return is expected:
    73613                  * 
     73613                 *
    7361473614                 * * {node|null} The element which contains your feature. Note that the
    7361573615                 *   return may also be void if your plug-in does not require to inject any
     
    7362973629                 */
    7363073630                feature: [],
    73631        
    73632        
     73631
     73632
    7363373633                /**
    7363473634                 * Row searching.
    73635                  * 
     73635                 *
    7363673636                 * This method of searching is complimentary to the default type based
    7363773637                 * searching, and a lot more comprehensive as it allows you complete control
     
    7369073690                 */
    7369173691                search: [],
    73692        
    73693        
     73692
     73693
    7369473694                /**
    7369573695                 * Selector extensions
     
    7372173721                        row: []
    7372273722                },
    73723        
    73724        
     73723
     73724
    7372573725                /**
    7372673726                 * Internal functions, exposed for used in plug-ins.
    73727                  * 
     73727                 *
    7372873728                 * Please note that you should not need to use the internal methods for
    7372973729                 * anything other than a plug-in (and even then, try to avoid if possible).
     
    7373473734                 */
    7373573735                internal: {},
    73736        
    73737        
     73736
     73737
    7373873738                /**
    7373973739                 * Legacy configuration options. Enable and disable legacy options that
     
    7375273752                        ajax: null
    7375373753                },
    73754        
    73755        
     73754
     73755
    7375673756                /**
    7375773757                 * Pagination plug-in methods.
    73758                  * 
     73758                 *
    7375973759                 * Each entry in this object is a function and defines which buttons should
    7376073760                 * be shown by the pagination rendering method that is used for the table:
     
    7380073800                 */
    7380173801                pager: {},
    73802        
    73803        
     73802
     73803
    7380473804                renderer: {
    7380573805                        pageButton: {},
    7380673806                        header: {}
    7380773807                },
    73808        
    73809        
     73808
     73809
    7381073810                /**
    7381173811                 * Ordering plug-ins - custom data source
    73812                  * 
     73812                 *
    7381373813                 * The extension options for ordering of data available here is complimentary
    7381473814                 * to the default type based ordering that DataTables typically uses. It
    7381573815                 * allows much greater control over the the data that is being used to
    7381673816                 * order a column, but is necessarily therefore more complex.
    73817                  * 
     73817                 *
    7381873818                 * This type of ordering is useful if you want to do ordering based on data
    7381973819                 * live from the DOM (for example the contents of an 'input' element) rather
    7382073820                 * than just the static string that DataTables knows of.
    73821                  * 
     73821                 *
    7382273822                 * The way these plug-ins work is that you create an array of the values you
    7382373823                 * wish to be ordering for the column in question and then return that
     
    7384973849                 */
    7385073850                order: {},
    73851        
    73852        
     73851
     73852
    7385373853                /**
    7385473854                 * Type based plug-ins.
     
    7390373903                         */
    7390473904                        detect: [],
    73905        
    73906        
     73905
     73906
    7390773907                        /**
    7390873908                         * Type based search formatting.
     
    7391473914                         * Note that is a search is not defined for a column of a given type,
    7391573915                         * no search formatting will be performed.
    73916                          * 
     73916                         *
    7391773917                         * Pre-processing of searching data plug-ins - When you assign the sType
    7391873918                         * for a column (or have it automatically detected for you by DataTables
     
    7394273942                         */
    7394373943                        search: {},
    73944        
    73945        
     73944
     73945
    7394673946                        /**
    7394773947                         * Type based ordering.
     
    7398473984                         *   >0 if the first parameter should be sorted height than the second
    7398573985                         *   parameter.
    73986                          * 
     73986                         *
    7398773987                         *  @type object
    7398873988                         *  @default {}
     
    7401074010                        order: {}
    7401174011                },
    74012        
     74012
    7401374013                /**
    7401474014                 * Unique DataTables instance counter
     
    7401874018                 */
    7401974019                _unique: 0,
    74020        
    74021        
     74020
     74021
    7402274022                //
    7402374023                // Depreciated
     
    7402674026                // version
    7402774027                //
    74028        
     74028
    7402974029                /**
    7403074030                 * Version check function.
     
    7403374033                 */
    7403474034                fnVersionCheck: DataTable.fnVersionCheck,
    74035        
    74036        
     74035
     74036
    7403774037                /**
    7403874038                 * Index for what 'this' index API functions should use
     
    7404174041                 */
    7404274042                iApiIndex: 0,
    74043        
    74044        
     74043
     74044
    7404574045                /**
    7404674046                 * jQuery UI class container
     
    7404974049                 */
    7405074050                oJUIClasses: {},
    74051        
    74052        
     74051
     74052
    7405374053                /**
    7405474054                 * Software version
     
    7405874058                sVersion: DataTable.version
    7405974059        };
    74060        
    74061        
     74060
     74061
    7406274062        //
    7406374063        // Backwards compatibility. Alias to pre 1.10 Hungarian notation counter parts
     
    7407474074                oPagination:  _ext.pager
    7407574075        } );
    74076        
    74077        
     74076
     74077
    7407874078        $.extend( DataTable.ext.classes, {
    7407974079                "sTable": "dataTable",
    7408074080                "sNoFooter": "no-footer",
    74081        
     74081
    7408274082                /* Paging buttons */
    7408374083                "sPageButton": "paginate_button",
    7408474084                "sPageButtonActive": "current",
    7408574085                "sPageButtonDisabled": "disabled",
    74086        
     74086
    7408774087                /* Striping classes */
    7408874088                "sStripeOdd": "odd",
    7408974089                "sStripeEven": "even",
    74090        
     74090
    7409174091                /* Empty row */
    7409274092                "sRowEmpty": "dataTables_empty",
    74093        
     74093
    7409474094                /* Features */
    7409574095                "sWrapper": "dataTables_wrapper",
     
    7409974099                "sLength": "dataTables_length",
    7410074100                "sProcessing": "dataTables_processing",
    74101        
     74101
    7410274102                /* Sorting */
    7410374103                "sSortAsc": "sorting_asc",
     
    7410874108                "sSortableNone": "sorting_disabled",
    7410974109                "sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */
    74110        
     74110
    7411174111                /* Filtering */
    7411274112                "sFilterInput": "",
    74113        
     74113
    7411474114                /* Page length */
    7411574115                "sLengthSelect": "",
    74116        
     74116
    7411774117                /* Scrolling */
    7411874118                "sScrollWrapper": "dataTables_scroll",
     
    7412274122                "sScrollFoot": "dataTables_scrollFoot",
    7412374123                "sScrollFootInner": "dataTables_scrollFootInner",
    74124        
     74124
    7412574125                /* Misc */
    7412674126                "sHeaderTH": "",
    7412774127                "sFooterTH": "",
    74128        
     74128
    7412974129                // Deprecated
    7413074130                "sSortJUIAsc": "",
     
    7413874138                "sJUIFooter": ""
    7413974139        } );
    74140        
    74141        
     74140
     74141
    7414274142        var extPagination = DataTable.ext.pager;
    74143        
     74143
    7414474144        function _numbers ( page, pages ) {
    7414574145                var
     
    7414874148                        half = Math.floor( buttons / 2 ),
    7414974149                        i = 1;
    74150        
     74150
    7415174151                if ( pages <= buttons ) {
    7415274152                        numbers = _range( 0, pages );
     
    7416974169                        numbers.splice( 0, 0, 0 );
    7417074170                }
    74171        
     74171
    7417274172                numbers.DT_el = 'span';
    7417374173                return numbers;
    7417474174        }
    74175        
    74176        
     74175
     74176
    7417774177        $.extend( extPagination, {
    7417874178                simple: function ( page, pages ) {
    7417974179                        return [ 'previous', 'next' ];
    7418074180                },
    74181        
     74181
    7418274182                full: function ( page, pages ) {
    7418374183                        return [  'first', 'previous', 'next', 'last' ];
    7418474184                },
    74185        
     74185
    7418674186                numbers: function ( page, pages ) {
    7418774187                        return [ _numbers(page, pages) ];
    7418874188                },
    74189        
     74189
    7419074190                simple_numbers: function ( page, pages ) {
    7419174191                        return [ 'previous', _numbers(page, pages), 'next' ];
    7419274192                },
    74193        
     74193
    7419474194                full_numbers: function ( page, pages ) {
    7419574195                        return [ 'first', 'previous', _numbers(page, pages), 'next', 'last' ];
    7419674196                },
    74197                
     74197
    7419874198                first_last_numbers: function (page, pages) {
    7419974199                        return ['first', _numbers(page, pages), 'last'];
    7420074200                },
    74201        
     74201
    7420274202                // For testing and plug-ins to use
    7420374203                _numbers: _numbers,
    74204        
     74204
    7420574205                // Number of number buttons (including ellipsis) to show. _Must be odd!_
    7420674206                numbers_length: 7
    7420774207        } );
    74208        
    74209        
     74208
     74209
    7421074210        $.extend( true, DataTable.ext.renderer, {
    7421174211                pageButton: {
     
    7421574215                                var aria = settings.oLanguage.oAria.paginate || {};
    7421674216                                var btnDisplay, btnClass, counter=0;
    74217        
     74217
    7421874218                                var attach = function( container, buttons ) {
    7421974219                                        var i, ien, node, button, tabIndex;
     
    7422274222                                                _fnPageChange( settings, e.data.action, true );
    7422374223                                        };
    74224        
     74224
    7422574225                                        for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
    7422674226                                                button = buttons[i];
    74227        
     74227
    7422874228                                                if ( $.isArray( button ) ) {
    7422974229                                                        var inner = $( '<'+(button.DT_el || 'div')+'/>' )
     
    7423574235                                                        btnClass = button;
    7423674236                                                        tabIndex = settings.iTabIndex;
    74237        
     74237
    7423874238                                                        switch ( button ) {
    7423974239                                                                case 'ellipsis':
    7424074240                                                                        container.append('<span class="ellipsis">&#x2026;</span>');
    7424174241                                                                        break;
    74242        
     74242
    7424374243                                                                case 'first':
    7424474244                                                                        btnDisplay = lang.sFirst;
    74245        
     74245
    7424674246                                                                        if ( page === 0 ) {
    7424774247                                                                                tabIndex = -1;
     
    7424974249                                                                        }
    7425074250                                                                        break;
    74251        
     74251
    7425274252                                                                case 'previous':
    7425374253                                                                        btnDisplay = lang.sPrevious;
    74254        
     74254
    7425574255                                                                        if ( page === 0 ) {
    7425674256                                                                                tabIndex = -1;
     
    7425874258                                                                        }
    7425974259                                                                        break;
    74260        
     74260
    7426174261                                                                case 'next':
    7426274262                                                                        btnDisplay = lang.sNext;
    74263        
     74263
    7426474264                                                                        if ( page === pages-1 ) {
    7426574265                                                                                tabIndex = -1;
     
    7426774267                                                                        }
    7426874268                                                                        break;
    74269        
     74269
    7427074270                                                                case 'last':
    7427174271                                                                        btnDisplay = lang.sLast;
    74272        
     74272
    7427374273                                                                        if ( page === pages-1 ) {
    7427474274                                                                                tabIndex = -1;
     
    7427674276                                                                        }
    7427774277                                                                        break;
    74278        
     74278
    7427974279                                                                default:
    7428074280                                                                        btnDisplay = button + 1;
     
    7428374283                                                                        break;
    7428474284                                                        }
    74285        
     74285
    7428674286                                                        if ( btnDisplay !== null ) {
    7428774287                                                                node = $('<a>', {
     
    7429774297                                                                        .html( btnDisplay )
    7429874298                                                                        .appendTo( container );
    74299        
     74299
    7430074300                                                                _fnBindAction(
    7430174301                                                                        node, {action: button}, clickHandler
    7430274302                                                                );
    74303        
     74303
    7430474304                                                                counter++;
    7430574305                                                        }
     
    7430774307                                        }
    7430874308                                };
    74309        
     74309
    7431074310                                // IE9 throws an 'unknown error' if document.activeElement is used
    7431174311                                // inside an iframe or frame. Try / catch the error. Not good for
    7431274312                                // accessibility, but neither are frames.
    7431374313                                var activeEl;
    74314        
     74314
    7431574315                                try {
    7431674316                                        // Because this approach is destroying and recreating the paging
     
    7432174321                                }
    7432274322                                catch (e) {}
    74323        
     74323
    7432474324                                attach( $(host).empty(), buttons );
    74325        
     74325
    7432674326                                if ( activeEl !== undefined ) {
    7432774327                                        $(host).find( '[data-dt-idx='+activeEl+']' ).focus();
     
    7433074330                }
    7433174331        } );
    74332        
    74333        
    74334        
     74332
     74333
     74334
    7433574335        // Built in type detection. See model.ext.aTypes for information about
    7433674336        // what is required from this methods.
     
    7434374343                        return _isNumber( d, decimal ) ? 'num'+decimal : null;
    7434474344                },
    74345        
     74345
    7434674346                // Dates (only those recognised by the browser's Date.parse)
    7434774347                function ( d, settings )
     
    7435674356                        return (parsed !== null && !isNaN(parsed)) || _empty(d) ? 'date' : null;
    7435774357                },
    74358        
     74358
    7435974359                // Formatted numbers
    7436074360                function ( d, settings )
     
    7436374363                        return _isNumber( d, decimal, true ) ? 'num-fmt'+decimal : null;
    7436474364                },
    74365        
     74365
    7436674366                // HTML numeric
    7436774367                function ( d, settings )
     
    7437074370                        return _htmlNumeric( d, decimal ) ? 'html-num'+decimal : null;
    7437174371                },
    74372        
     74372
    7437374373                // HTML numeric, formatted
    7437474374                function ( d, settings )
     
    7437774377                        return _htmlNumeric( d, decimal, true ) ? 'html-num-fmt'+decimal : null;
    7437874378                },
    74379        
     74379
    7438074380                // HTML (this is strict checking - there must be html)
    7438174381                function ( d, settings )
     
    7438574385                }
    7438674386        ] );
    74387        
    74388        
    74389        
     74387
     74388
     74389
    7439074390        // Filter formatting functions. See model.ext.ofnSearch for information about
    7439174391        // what is required from these methods.
    74392         // 
     74392        //
    7439374393        // Note that additional search methods are added for the html numbers and
    7439474394        // html formatted numbers by `_addNumericSort()` when we know what the decimal
    7439574395        // place is
    74396        
    74397        
     74396
     74397
    7439874398        $.extend( DataTable.ext.type.search, {
    7439974399                html: function ( data ) {
     
    7440674406                                        '';
    7440774407                },
    74408        
     74408
    7440974409                string: function ( data ) {
    7441074410                        return _empty(data) ?
     
    7441574415                }
    7441674416        } );
    74417        
    74418        
    74419        
     74417
     74418
     74419
    7442074420        var __numericReplace = function ( d, decimalPlace, re1, re2 ) {
    7442174421                if ( d !== 0 && (!d || d === '-') ) {
    7442274422                        return -Infinity;
    7442374423                }
    74424        
     74424
    7442574425                // If a decimal place other than `.` is used, it needs to be given to the
    7442674426                // function so we can detect it and replace with a `.` which is the only
     
    7442974429                        d = _numToDecimal( d, decimalPlace );
    7443074430                }
    74431        
     74431
    7443274432                if ( d.replace ) {
    7443374433                        if ( re1 ) {
    7443474434                                d = d.replace( re1, '' );
    7443574435                        }
    74436        
     74436
    7443774437                        if ( re2 ) {
    7443874438                                d = d.replace( re2, '' );
    7443974439                        }
    7444074440                }
    74441        
     74441
    7444274442                return d * 1;
    7444374443        };
    74444        
    74445        
     74444
     74445
    7444674446        // Add the numeric 'deformatting' functions for sorting and search. This is done
    7444774447        // in a function to provide an easy ability for the language options to add
     
    7445474454                                        return __numericReplace( d, decimalPlace );
    7445574455                                },
    74456        
     74456
    7445774457                                // Formatted numbers
    7445874458                                "num-fmt": function ( d ) {
    7445974459                                        return __numericReplace( d, decimalPlace, _re_formatted_numeric );
    7446074460                                },
    74461        
     74461
    7446274462                                // HTML numeric
    7446374463                                "html-num": function ( d ) {
    7446474464                                        return __numericReplace( d, decimalPlace, _re_html );
    7446574465                                },
    74466        
     74466
    7446774467                                // HTML numeric, formatted
    7446874468                                "html-num-fmt": function ( d ) {
     
    7447374473                                // Add the ordering method
    7447474474                                _ext.type.order[ key+decimalPlace+'-pre' ] = fn;
    74475        
     74475
    7447674476                                // For HTML types add a search formatter that will strip the HTML
    7447774477                                if ( key.match(/^html\-/) ) {
     
    7448174481                );
    7448274482        }
    74483        
    74484        
     74483
     74484
    7448574485        // Default sort methods
    7448674486        $.extend( _ext.type.order, {
     
    7449074490                        return isNaN(ts) ? -Infinity : ts;
    7449174491                },
    74492        
     74492
    7449374493                // html
    7449474494                "html-pre": function ( a ) {
     
    7449974499                                        a+'';
    7450074500                },
    74501        
     74501
    7450274502                // string
    7450374503                "string-pre": function ( a ) {
     
    7451274512                                                a.toString();
    7451374513                },
    74514        
     74514
    7451574515                // string-asc and -desc are retained only for compatibility with the old
    7451674516                // sort methods
     
    7451874518                        return ((x < y) ? -1 : ((x > y) ? 1 : 0));
    7451974519                },
    74520        
     74520
    7452174521                "string-desc": function ( x, y ) {
    7452274522                        return ((x < y) ? 1 : ((x > y) ? -1 : 0));
    7452374523                }
    7452474524        } );
    74525        
    74526        
     74525
     74526
    7452774527        // Numeric sorting types - order doesn't matter here
    7452874528        _addNumericSort( '' );
    74529        
    74530        
     74529
     74530
    7453174531        $.extend( true, DataTable.ext.renderer, {
    7453274532                header: {
     
    7454174541                                                return;               // table, not a nested one
    7454274542                                        }
    74543        
     74543
    7454474544                                        var colIdx = column.idx;
    74545        
     74545
    7454674546                                        cell
    7454774547                                                .removeClass(
     
    7455774557                                } );
    7455874558                        },
    74559        
     74559
    7456074560                        jqueryui: function ( settings, cell, column, classes ) {
    7456174561                                $('<div/>')
     
    7456674566                                        )
    7456774567                                        .appendTo( cell );
    74568        
     74568
    7456974569                                // Attach a sort listener to update on sort
    7457074570                                $(settings.nTable).on( 'order.dt.DT', function ( e, ctx, sorting, columns ) {
     
    7457274572                                                return;
    7457374573                                        }
    74574        
     74574
    7457574575                                        var colIdx = column.idx;
    74576        
     74576
    7457774577                                        cell
    7457874578                                                .removeClass( classes.sSortAsc +" "+classes.sSortDesc )
     
    7458274582                                                                column.sSortingClass
    7458374583                                                );
    74584        
     74584
    7458574585                                        cell
    7458674586                                                .find( 'span.'+classes.sSortIcon )
     
    7460174601                }
    7460274602        } );
    74603        
     74603
    7460474604        /*
    7460574605         * Public helper functions. These aren't used internally by DataTables, or
     
    7460874608         * to make working with DataTables a little bit easier.
    7460974609         */
    74610        
     74610
    7461174611        var __htmlEscapeEntities = function ( d ) {
    7461274612                return typeof d === 'string' ?
     
    7461474614                        d;
    7461574615        };
    74616        
     74616
    7461774617        /**
    7461874618         * Helpers for `columns.render`.
     
    7464874648                                                return d;
    7464974649                                        }
    74650        
     74650
    7465174651                                        var negative = d < 0 ? '-' : '';
    7465274652                                        var flo = parseFloat( d );
    74653        
     74653
    7465474654                                        // If NaN then there isn't much formatting that we can do - just
    7465574655                                        // return immediately, escaping any HTML (this was supposed to
     
    7465874658                                                return __htmlEscapeEntities( d );
    7465974659                                        }
    74660        
     74660
    7466174661                                        flo = flo.toFixed( precision );
    7466274662                                        d = Math.abs( flo );
    74663        
     74663
    7466474664                                        var intPart = parseInt( d, 10 );
    7466574665                                        var floatPart = precision ?
    7466674666                                                decimal+(d - intPart).toFixed( precision ).substring( 2 ):
    7466774667                                                '';
    74668        
     74668
    7466974669                                        return negative + (prefix||'') +
    7467074670                                                intPart.toString().replace(
     
    7467674676                        };
    7467774677                },
    74678        
     74678
    7467974679                text: function () {
    7468074680                        return {
     
    7468474684                }
    7468574685        };
    74686        
    74687        
     74686
     74687
    7468874688        /*
    7468974689         * This is really a good bit rubbish this method of exposing the internal methods
    7469074690         * publicly... - To be fixed in 2.0 using methods on the prototype
    7469174691         */
    74692        
    74693        
     74692
     74693
    7469474694        /**
    7469574695         * Create a wrapper function for exporting an internal functions to an external API.
     
    7470774707                };
    7470874708        }
    74709        
    74710        
     74709
     74710
    7471174711        /**
    7471274712         * Reference to internal functions for use by plug-in developers. Note that
     
    7481074810                                                // added to prevent errors
    7481174811        } );
    74812        
     74812
    7481374813
    7481474814        // jQuery access
     
    7516075160
    7516175161        // IE9 throws an 'unknown error' if document.activeElement is used
    75162         // inside an iframe or frame. 
     75162        // inside an iframe or frame.
    7516375163        var activeEl;
    7516475164
     
    7524175241var _instance = 0;
    7524275242
    75243 /** 
     75243/**
    7524475244 * AutoFill provides Excel like auto-fill features for a DataTable
    7524575245 *
     
    7587075870         */
    7587175871        _mousemove: function ( e )
    75872         {       
     75872        {
    7587375873                var that = this;
    7587475874                var dt = this.s.dt;
     
    7597675976
    7597775977                this._actionSelector( selected );
    75978                
     75978
    7597975979                // Stop shiftScroll
    7598075980                clearInterval( this.s.scrollInterval );
     
    7598675986         * Create an array with a range of numbers defined by the start and end
    7598775987         * parameters passed in (inclusive!).
    75988          * 
     75988         *
    7598975989         * @param  {integer} start Start
    7599075990         * @param  {integer} end   End
     
    7628776287/**
    7628876288 * AutoFill version
    76289  * 
     76289 *
    7629076290 * @static
    7629176291 * @type      String
     
    7629676296/**
    7629776297 * AutoFill defaults
    76298  * 
     76298 *
    7629976299 * @namespace
    7630076300 */
     
    7632876328/**
    7632976329 * Classes used by AutoFill that are configurable
    76330  * 
     76330 *
    7633176331 * @namespace
    7633276332 */
     
    7650676506        // If there is no config set it to an empty object
    7650776507        if ( typeof( config ) === 'undefined' ) {
    76508                 config = {};   
     76508                config = {};
    7650976509        }
    76510        
     76510
    7651176511        // Allow a boolean true for defaults
    7651276512        if ( config === true ) {
     
    7665576655                var buttons = this.s.buttons.slice();
    7665676656                var i, ien;
    76657                
     76657
    7665876658                for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
    7665976659                        this.remove( buttons[i].node );
     
    7700677006
    7700777007                        $(dt.table().node()).triggerHandler( 'buttons-action.dt', [
    77008                                 dt.button( button ), dt, button, config 
     77008                                dt.button( button ), dt, button, config
    7700977009                        ] );
    7701077010                };
     
    7747677476
    7747777477                        // Right alignment is enabled on a class, e.g. bootstrap:
    77478                         // $.fn.dataTable.Buttons.defaults.dom.collection.className += " dropdown-menu-right"; 
     77478                        // $.fn.dataTable.Buttons.defaults.dom.collection.className += " dropdown-menu-right";
    7747977479                        if ( display.hasClass( options.rightAlignClassName ) || options.align === 'button-right' ) {
    7748077480                                display.css( 'left', hostPosition.left + hostNode.outerWidth() - collectionWidth );
     
    7755177551 * Show / hide a background layer behind a collection
    7755277552 * @param  {boolean} Flag to indicate if the background should be shown or
    77553  *   hidden 
     77553 *   hidden
    7755477554 * @param  {string} Class to assign to the background
    7755577555 * @static
     
    7763477634                }
    7763577635        };
    77636        
     77636
    7763777637        process( group );
    7763877638
     
    7836278362                } ).toArray() :
    7836378363                null;
    78364        
     78364
    7836578365        // If Select is available on this table, and any rows are selected, limit the export
    7836678366        // to the selected rows. If no rows are selected, all rows will be exported. Specify
     
    7950179501
    7950279502/**
    79503  * Convert XML documents in an object to strings
     79503 * Convert XML folders in an object to strings
    7950479504 * @param  {object} obj XLSX document object
    7950579505 */
     
    8013880138
    8013980139        extension: '.xlsx',
    80140        
     80140
    8014180141        createEmptyCells: false
    8014280142} );
     
    8137781377                        $('row:last c', rels).attr( 's', '2' ); // bold
    8137881378                }
    81379        
     81379
    8138081380                dataStartRow = rowPos;
    8138181381
     
    8138381383                        addRow( data.body[n], rowPos );
    8138481384                }
    81385        
     81385
    8138681386                dataEndRow = rowPos;
    8138781387
     
    8377983779         * tables and get the index position for the data in the main table.
    8378083780         *  @param {node} node TR, TH or TD element to get the information about
    83781          *  @returns {int} If nNode is given as a TR, then a single index is 
     83781         *  @returns {int} If nNode is given as a TR, then a single index is
    8378283782         *    returned, or if given as a cell, an array of [row index, column index
    8378383783         *    (visible), column index (all)] is given.
     
    8520085200                return this.s.enable;
    8520185201        },
    85202        
     85202
    8520385203        /**
    85204          * Set header offset 
     85204         * Set header offset
    8520585205         *
    8520685206         * @param  {int} new value for headerOffset
     
    8521585215                return this.c.headerOffset;
    8521685216        },
    85217        
     85217
    8521885218        /**
    8521985219         * Set footer offset
     
    8523185231        },
    8523285232
    85233        
     85233
    8523485234        /**
    8523585235         * Recalculate the position of the fixed elements and force them into place
     
    8525485254         * Constructor
    8525585255         */
    85256        
     85256
    8525785257        /**
    8525885258         * FixedHeader constructor - adding the required event listeners and
     
    8541585415         *
    8541685416         * @param  {string} item       The `header` or `footer`
    85417          * @param  {int}    scrollLeft Document scrollLeft
     85417         * @param  {int}    scrollLeft Folder scrollLeft
    8541885418         * @private
    8541985419         */
     
    8543985439         * * `below` - (Header only) Fixed to the bottom of the table body
    8544085440         * * `above` - (Footer only) Fixed to the top of the table body
    85441          * 
     85441         *
    8544285442         * @param  {string}  mode        Mode that the item should be shown in
    8544385443         * @param  {string}  item        'header' or 'footer'
     
    8545885458                        document.activeElement :
    8545985459                        null;
    85460                
     85460
    8546185461                if ( focus ) {
    8546285462                        focus.blur();
     
    8640486404                                .indexes()
    8640586405                                .indexOf( index.row );
    86406                        
     86406
    8640786407                        // Don't focus rows that were filtered out.
    8640886408                        if ( row < 0 ) {
     
    8776687766                        }
    8776787767                }
    87768                
     87768
    8776987769                // Show the columns for that break point
    8777087770                var columnsVis = this._columnsVisiblity( breakpoint );
     
    8789787897                        $(clonedTable).addClass( 'dtr-inline collapsed' );
    8789887898                }
    87899                
     87899
    8790087900                // It is unsafe to insert elements with the same name into the DOM
    8790187901                // multiple times. For example, cloning and inserting a checked radio
     
    8790687906                // our container element, bypassing the height and width (Scroller)
    8790787907                $( clonedTable ).css( 'position', 'relative' )
    87908                
     87908
    8790987909                var inserted = $('<div/>')
    8791087910                        .css( {
     
    8863588635                                group = that.c.emptyDataGroup;
    8863688636                        }
    88637                        
     88637
    8863888638                        if ( last === undefined || group !== last ) {
    8863988639                                data.push( {
     
    8866788667                var dt = this.s.dt;
    8866888668                var display;
    88669        
     88669
    8867088670                for ( var i=0, ien=groups.length ; i<ien ; i++ ) {
    8867188671                        var group = groups[i];
     
    8871088710        {
    8871188711                var row;
    88712                
     88712
    8871388713                if ( display === null || display === '' ) {
    8871488714                        display = this.c.emptyDataGroup;
     
    8871888718                        return null;
    8871988719                }
    88720                
     88720
    8872188721                if ( typeof display === 'object' && display.nodeName && display.nodeName.toLowerCase() === 'tr') {
    8872288722                        row = $(display);
     
    8893588935 * * `new $.fn.dataTable.RowReorder( table, opts )` after DataTables
    8893688936 *   initialisation.
    88937  * 
     88937 *
    8893888938 *  @class
    8893988939 *  @param {object} settings DataTables settings object for the host table
     
    8899088990                windowHeight: 0,
    8899188991
    88992                 /** @type {integer} Document outer height cached value */
     88992                /** @type {integer} Folder outer height cached value */
    8899388993                documentOuterHeight: 0,
    8899488994
     
    8908089080         * Private methods
    8908189081         */
    89082        
     89082
    8908389083        /**
    8908489084         * Cache the measurements that RowReorder needs in the mouse move handler
     
    8939589395                        }
    8939689396                }
    89397                
     89397
    8939889398                // Create event args
    8939989399                var eventArgs = [ fullDiff, {
     
    8940489404                        originalEvent: e
    8940589405                } ];
    89406                
     89406
    8940789407                // Emit event
    8940889408                this._emitEvent( 'row-reorder', eventArgs );
     
    8977389773 *  @global
    8977489774 *  @param {object} dt DataTables settings object or API instance
    89775  *  @param {object} [opts={}] Configuration object for FixedColumns. Options 
     89775 *  @param {object} [opts={}] Configuration object for FixedColumns. Options
    8977689776 *    are defined by {@link Scroller.defaults}
    8977789777 *
     
    9001190011        pageInfo: function()
    9001290012        {
    90013                 var 
     90013                var
    9001490014                        dt = this.s.dt,
    9001590015                        iScrollTop = this.dom.scroller.scrollTop,
     
    9032490324            }
    9032590325                }
    90326        
     90326
    9032790327                $('div.'+dt.oClasses.sScrollBody, container).append( nTable );
    9032890328
     
    9045390453         *
    9045490454         *  @param {string} dir Domain transform direction, `virtualToPhysical` or
    90455          *    `physicalToVirtual` 
     90455         *    `physicalToVirtual`
    9045690456         *  @returns {number} Calculated transform
    9045790457         *  @private
     
    9229492294         */
    9229592295        SearchPanes.prototype.clearSelections = function () {
    92296             // Load in all of the searchBoxes in the documents
     92296            // Load in all of the searchBoxes in the folders
    9229792297            var searches = this.dom.container.find(this.classes.search);
    9229892298            // For each searchBox set the input text to be empty and then trigger
     
    9306493064                        blurable = opts.blurable;
    9306593065                }
    93066                
     93066
    9306793067                if ( opts.toggleable !== undefined ) {
    9306893068                        toggleable = opts.toggleable;
     
    9316193161```
    9316293162{
    93163         items:string       - Can be `rows`, `columns` or `cells`. Defines what item 
     93163        items:string       - Can be `rows`, `columns` or `cells`. Defines what item
    9316493164                             will be selected if the user is allowed to activate row
    9316593165                             selection using the mouse.
     
    9320093200 * click first in cell 1-1 and then shift click in 2-2 - cells 1-2 and 2-1
    9320193201 * should also be selected (and not 1-3, 1-4. etc)
    93202  * 
     93202 *
    9320393203 * @param  {DataTable.Api} dt   DataTable
    9320493204 * @param  {object}        idx  Cell index to select to
     
    9321793217                        start = tmp;
    9321893218                }
    93219                
     93219
    9322093220                var record = false;
    9322193221                return dt.columns( ':visible' ).indexes().filter( function (i) {
     
    9322393223                                record = true;
    9322493224                        }
    93225                        
     93225
    9322693226                        if ( i === end ) { // not else if, as start might === end
    9322793227                                record = false;
     
    9324893248                                record = true;
    9324993249                        }
    93250                        
     93250
    9325193251                        if ( i === end ) {
    9325293252                                record = false;
     
    9344493444 * Update the information element of the DataTable showing information about the
    9344593445 * items selected. This is done by adding tags to the existing text
    93446  * 
     93446 *
    9344793447 * @param {DataTable.Api} api DataTable to update
    9344893448 * @private
     
    9350893508        // was selected before the element was created. This will happen with the
    9350993509        // `deferRender` option enabled.
    93510         // 
     93510        //
    9351193511        // This method of attaching to `aoRowCreatedCallback` is a hack until
    9351293512        // DataTables has proper events for row manipulation If you are reviewing
     
    9363393633        if ( force || ctx._select.style === 'single' ) {
    9363493634                var api = new DataTable.Api( ctx );
    93635                
     93635
    9363693636                api.rows( { selected: true } ).deselect();
    9363793637                api.columns( { selected: true } ).deselect();
     
    9365593655        var toggleable = dt.select.toggleable();
    9365693656        var isSelected = dt[type]( idx, { selected: true } ).any();
    93657        
     93657
    9365893658        if ( isSelected && ! toggleable ) {
    9365993659                return;
     
    9385193851                var dt = new DataTable.Api( ctx );
    9385293852                disableMouseSelection( dt );
    93853                
     93853
    9385493854                if ( style !== 'api' ) {
    9385593855                        enableMouseSelection( dt );
Note: See TracChangeset for help on using the changeset viewer.