From 0e64ae88f7a7e00a69eeb2d62be7677281b7a925 Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Sun, 10 May 2020 15:43:29 +0530 Subject: [PATCH] delete api working --- .../plugins/sweetalerts/custom-sweetalert.js | 251 -- .../table/datatable/custom_dt_custom.css | 163 +- static/plugins/table/datatable/datatables.js | 3920 ++++++++--------- .../table/datatable/dt-global_style-dark.css | 203 - .../table/datatable/dt-global_style.css | 5 +- targetApp/templates/target/list.html | 67 +- targetApp/urls.py | 1 + targetApp/views.py | 11 +- 8 files changed, 2108 insertions(+), 2513 deletions(-) delete mode 100644 static/plugins/table/datatable/dt-global_style-dark.css diff --git a/static/plugins/sweetalerts/custom-sweetalert.js b/static/plugins/sweetalerts/custom-sweetalert.js index ec98e567..e69de29b 100644 --- a/static/plugins/sweetalerts/custom-sweetalert.js +++ b/static/plugins/sweetalerts/custom-sweetalert.js @@ -1,251 +0,0 @@ - -$('.widget-content .message').on('click', function () { - swal({ - title: 'Saved succesfully', - padding: '2em' - }) -}) - -$('.widget-content .success').on('click', function () { - swal({ - title: 'Good job!', - text: "You clicked the!", - type: 'success', - padding: '2em' - }) - -}) - -$('.widget-content .html-jquery').on('click', function () { - swal({ - title: 'Custom animation with Animate.css', - animation: false, - customClass: 'animated tada', - padding: '2em' - }) -}) - -$('.widget-content .title-text').on('click', function () { - swal({ - title: 'The Internet?', - text: "That thing is still around?", - type: 'question', - padding: '2em' - }) - -}) - -$('.widget-content .custom-width-padding-background').on('click', function () { - swal({ - title: 'Custom width, padding, background.', - width: 600, - padding: "7em", - customClass: "background-modal", - background: '#fff url(assets/img/640x426.jpg) no-repeat 100% 100%', - }) -}) - -$('.widget-content .warning.confirm').on('click', function () { - swal({ - title: 'Are you sure?', - text: "You won't be able to revert this!", - type: 'warning', - showCancelButton: true, - confirmButtonText: 'Delete', - padding: '2em' - }).then(function(result) { - if (result.value) { - swal( - 'Deleted!', - 'Your file has been deleted.', - 'success' - ) - } - }) -}) - -$('.widget-content .warning.cancel').on('click', function () { - const swalWithBootstrapButtons = swal.mixin({ - confirmButtonClass: 'btn btn-success', - cancelButtonClass: 'btn btn-danger mr-3', - buttonsStyling: false, - }) - - swalWithBootstrapButtons({ - title: 'Are you sure?', - text: "You won't be able to revert this!", - type: 'warning', - showCancelButton: true, - confirmButtonText: 'Yes, delete it!', - cancelButtonText: 'No, cancel!', - reverseButtons: true, - padding: '2em' - }).then(function(result) { - if (result.value) { - swalWithBootstrapButtons( - 'Deleted!', - 'Your file has been deleted.', - 'success' - ) - } else if ( - // Read more about handling dismissals - result.dismiss === swal.DismissReason.cancel - ) { - swalWithBootstrapButtons( - 'Cancelled', - 'Your imaginary file is safe :)', - 'error' - ) - } - }) -}) - -$('.widget-content .html').on('click', function () { - swal({ - title: 'HTML example', - type: 'info', - html: - 'You can use bold text, ' + - 'links ' + - 'and other HTML tags', - showCloseButton: true, - showCancelButton: true, - focusConfirm: false, - confirmButtonText: - ' Great!', - confirmButtonAriaLabel: 'Thumbs up, great!', - cancelButtonText: - ' Cancel', - cancelButtonAriaLabel: 'Thumbs down', - padding: '2em' - }) - -}) - -$('.widget-content .custom-image').on('click', function () { - swal({ - title: 'Sweet!', - text: 'Modal with a custom image.', - imageUrl: 'assets/img/300x300.jpg', - imageWidth: 400, - imageHeight: 200, - imageAlt: 'Custom image', - animation: false, - padding: '2em' - }) -}) - -$('.widget-content .timer').on('click', function () { - swal({ - title: 'Auto close alert!', - text: 'I will close in 2 seconds.', - timer: 2000, - padding: '2em', - onOpen: function () { - swal.showLoading() - } - }).then(function (result) { - if ( - // Read more about handling dismissals - result.dismiss === swal.DismissReason.timer - ) { - console.log('I was closed by the timer') - } - }) -}) - -$('.widget-content .chaining-modals').on('click', function () { - swal.mixin({ - input: 'text', - confirmButtonText: 'Next →', - showCancelButton: true, - progressSteps: ['1', '2', '3'], - padding: '2em', - }).queue([ - { - title: 'Question 1', - text: 'Chaining swal2 modals is easy' - }, - 'Question 2', - 'Question 3' - ]).then(function(result) { - if (result.value) { - swal({ - title: 'All done!', - padding: '2em', - html: - 'Your answers:
' +
-            JSON.stringify(result.value) +
-          '
', - confirmButtonText: 'Lovely!' - }) - } - }) -}) - -$('.widget-content .dynamic-queue').on('click', function () { - const ipAPI = 'https://api.ipify.org?format=json' - swal.queue([{ - title: 'Your public IP', - confirmButtonText: 'Show my public IP', - text: - 'Your public IP will be received ' + - 'via AJAX request', - showLoaderOnConfirm: true, - preConfirm: function() { - return fetch(ipAPI) - .then(function (response) { - return response.json(); - }) - .then(function(data) { - return swal.insertQueueStep(data.ip) - }) - .catch(function() { - swal.insertQueueStep({ - type: 'error', - title: 'Unable to get your public IP' - }) - }) - } - }]) - -}) - -$('.widget-content .footer').on('click', function () { - swal({ - type: 'error', - title: 'Oops...', - text: 'Something went wrong!', - footer: 'Why do I have this issue?', - padding: '2em' - }) -}) - -$('.widget-content .RTL').on('click', function () { - swal({ - title: 'هل تريد الاستمرار؟', - confirmButtonText: 'نعم', - cancelButtonText: 'لا', - showCancelButton: true, - showCloseButton: true, - padding: '2em', - target: document.getElementById('rtl-container') - }) - -}) - -$('.widget-content .mixin').on('click', function () { - const toast = swal.mixin({ - toast: true, - position: 'top-end', - showConfirmButton: false, - timer: 3000, - padding: '2em' - }); - toast({ - type: 'success', - title: 'Signed in successfully', - padding: '2em', - }) - -}) \ No newline at end of file diff --git a/static/plugins/table/datatable/custom_dt_custom.css b/static/plugins/table/datatable/custom_dt_custom.css index d2582eb4..ac169542 100644 --- a/static/plugins/table/datatable/custom_dt_custom.css +++ b/static/plugins/table/datatable/custom_dt_custom.css @@ -1,122 +1,103 @@ /* - =============================== - @Import Function - =============================== +=============================== +@Import Function +=============================== */ /* - =============================== - @Import Mixins - =============================== +=============================== +@Import Mixins +=============================== */ .widget-content-area { - box-shadow: none !important; } + box-shadow: none !important; +} table.dataTable { - border-collapse: separate !important; - border-spacing: 0 5px; - margin-top: 50px !important; - margin-bottom: 50px !important; - border-collapse: collapse !important; } + border-collapse: separate !important; + border-spacing: 0 5px; + margin-top: 50px !important; + margin-bottom: 50px !important; + border-collapse: collapse !important; +} .table-hover:not(.table-dark) tbody tr td:first-child { - border-left: none !important; - border-left: none !important; } + border-left: none !important; + border-left: none !important; +} .table-hover:not(.table-dark) tbody tr:hover .new-control.new-checkbox .new-control-indicator { - border: 2px solid #1b55e2; } - -/*Style. 1*/ -.style-1 .user-name { - font-size: 15px; - font-weight: 600; - color: #e2a03f; } - -.style-1 .profile-img img { - width: 50px; - height: 50px; - border: 2px solid #d3d3d3; - border-radius: 6px; - box-shadow: 0px 0px 14px 3px rgba(126, 142, 177, 0.24); } + border: 2px solid #1b55e2; +} /*Style. 2*/ .style-2 .new-control.new-checkbox .new-control-indicator { - top: 1px; } + top: 1px; +} .style-2 .user-name { - font-size: 15px; - font-weight: 600; - color: #e2a03f; } + font-size: 15px; + font-weight: 600; + color: #e2a03f; +} .style-2 img.profile-img { - width: 50px; - height: 50px; - border: 2px solid #d3d3d3; - box-shadow: 0px 0px 14px 3px rgba(126, 142, 177, 0.24); } + width: 50px; + height: 50px; + border: 2px solid #d3d3d3; + box-shadow: 0px 0px 14px 3px rgba(126, 142, 177, 0.24); +} .style-2 .badge { - background: transparent; - transform: none; } + background: transparent; + transform: none; +} .style-2 .badge-primary { - color: #1b55e2; - border: 2px dashed #1b55e2; } + color: #1b55e2; + border: 2px dashed #1b55e2; +} .style-2 .badge-warning { - color: #e2a03f; - border: 2px dashed #e2a03f; } + color: #e2a03f; + border: 2px dashed #e2a03f; +} .style-2 .badge-danger { - color: #e7515a; - border: 2px dashed #e7515a; } + color: #e7515a; + border: 2px dashed #e7515a; +} -/*Style. 3*/ -.style-3 .new-control.new-checkbox .new-control-indicator { - top: 1px; } +.table-scan { + color: #888ea8; + margin-right: 6px; + vertical-align: middle; + fill: rgba(0, 23, 55, 0.08); + cursor: pointer; +} -.style-3 .user-name { - font-size: 15px; - font-weight: 600; - color: #e2a03f; } +.table-hover:not(.table-dark) tbody tr:hover .table-scan { + color: #2962FF; +} -.style-3 img.profile-img { - width: 50px; - height: 50px; - border: 2px solid #d3d3d3; - border-radius: 6px; - box-shadow: 0px 0px 14px 3px rgba(126, 142, 177, 0.24); } +.table-edit { + color: #888ea8; + margin-right: 6px; + vertical-align: middle; + fill: rgba(0, 23, 55, 0.08); + cursor: pointer; +} -.style-3 .badge { - background: transparent; - transform: none; } +.table-hover:not(.table-dark) tbody tr:hover .table-edit { + color: #FF6D00; +} +.table-delete { + color: #888ea8; + margin-right: 6px; + vertical-align: middle; + fill: rgba(0, 23, 55, 0.08); + cursor: pointer; +} -.style-3 .badge-primary { - color: #1b55e2; - border: 2px dashed #1b55e2; } - -.style-3 .badge-warning { - color: #e2a03f; - border: 2px dashed #e2a03f; } - -.style-3 .badge-danger { - color: #e7515a; - border: 2px dashed #e7515a; } - -.style-3 .table-controls { - padding: 0; } - .style-3 .table-controls li { - list-style: none; - display: inline; } - .style-3 .table-controls li svg { - color: #888ea8; - vertical-align: middle; - width: 28px; - height: 28px; - fill: rgba(0, 23, 55, 0.08); - cursor: pointer; } - -.style-3.table-hover:not(.table-dark) tbody tr:hover .table-controls li svg { - color: #e7515a; - fill: rgba(231, 81, 90, 0.219608); } - -.style-3.table-hover:not(.table-dark) tbody tr:hover td:first-child { - color: #1b55e2 !important; } +.table-hover:not(.table-dark) tbody tr:hover .table-delete { + color: #e7515a; +} diff --git a/static/plugins/table/datatable/datatables.js b/static/plugins/table/datatable/datatables.js index bc4dedea..f9c8b0b7 100644 --- a/static/plugins/table/datatable/datatables.js +++ b/static/plugins/table/datatable/datatables.js @@ -145,8 +145,8 @@ { return this.api(true).$( sSelector, oOpts ); }; - - + + /** * Almost identical to $ in operation, but in this case returns the data for the matched * rows - as such, the jQuery selector used should match TR row nodes or TD/TH cell nodes @@ -199,8 +199,8 @@ { return this.api(true).rows( sSelector, oOpts ).data(); }; - - + + /** * Create a DataTables Api instance, with the currently selected tables for * the Api's context. @@ -218,8 +218,8 @@ ) : new _Api( this ); }; - - + + /** * Add a single new row or multiple rows of data to the table. Please note * that this is suitable for client-side processing only - if you are using @@ -261,20 +261,20 @@ this.fnAddData = function( data, redraw ) { var api = this.api( true ); - + /* Check if we want to add multiple rows or not */ var rows = $.isArray(data) && ( $.isArray(data[0]) || $.isPlainObject(data[0]) ) ? api.rows.add( data ) : api.row.add( data ); - + if ( redraw === undefined || redraw ) { api.draw(); } - + return rows.flatten().toArray(); }; - - + + /** * This function will make DataTables recalculate the column sizes, based on the data * contained in the table and the sizes applied to the columns (in the DOM, CSS or @@ -301,7 +301,7 @@ var api = this.api( true ).columns.adjust(); var settings = api.settings()[0]; var scroll = settings.oScroll; - + if ( bRedraw === undefined || bRedraw ) { api.draw( false ); } @@ -310,8 +310,8 @@ _fnScrollDraw( settings ); } }; - - + + /** * Quickly and simply clear a table * @param {bool} [bRedraw=true] redraw the table or not @@ -329,13 +329,13 @@ this.fnClearTable = function( bRedraw ) { var api = this.api( true ).clear(); - + if ( bRedraw === undefined || bRedraw ) { api.draw(); } }; - - + + /** * The exact opposite of 'opening' a row, this function will close any rows which * are currently 'open'. @@ -364,8 +364,8 @@ { this.api( true ).row( nTr ).child.hide(); }; - - + + /** * Remove a row for the table * @param {mixed} target The index of the row from aoData to be deleted, or @@ -390,21 +390,21 @@ var rows = api.rows( target ); var settings = rows.settings()[0]; var data = settings.aoData[ rows[0][0] ]; - + rows.remove(); - + if ( callback ) { callback.call( this, settings, data ); } - + if ( redraw === undefined || redraw ) { api.draw(); } - + return data; }; - - + + /** * Restore the table to it's original state in the DOM by removing all of DataTables * enhancements, alterations to the DOM structure of the table and event listeners. @@ -423,8 +423,8 @@ { this.api( true ).destroy( remove ); }; - - + + /** * Redraw the table * @param {bool} [complete=true] Re-filter and resort (if enabled) the table before the draw. @@ -445,8 +445,8 @@ // into account the new data, but can hold position. this.api( true ).draw( complete ); }; - - + + /** * Filter the input based on data * @param {string} sInput String to filter the table on @@ -469,18 +469,18 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive ) { var api = this.api( true ); - + if ( iColumn === null || iColumn === undefined ) { api.search( sInput, bRegex, bSmart, bCaseInsensitive ); } else { api.column( iColumn ).search( sInput, bRegex, bSmart, bCaseInsensitive ); } - + api.draw(); }; - - + + /** * Get the data for the whole table, an individual row or an individual cell based on the * provided parameters. @@ -521,19 +521,19 @@ this.fnGetData = function( src, col ) { var api = this.api( true ); - + if ( src !== undefined ) { var type = src.nodeName ? src.nodeName.toLowerCase() : ''; - + return col !== undefined || type == 'td' || type == 'th' ? api.cell( src, col ).data() : api.row( src ).data() || null; } - + return api.data().toArray(); }; - - + + /** * Get an array of the TR nodes that are used in the table's body. Note that you will * typically want to use the '$' API method in preference to this as it is more @@ -555,13 +555,13 @@ this.fnGetNodes = function( iRow ) { var api = this.api( true ); - + return iRow !== undefined ? api.row( iRow ).node() : api.rows().nodes().flatten().toArray(); }; - - + + /** * Get the array indexes of a particular cell from it's DOM element * and column index including hidden columns @@ -594,13 +594,13 @@ { var api = this.api( true ); var nodeName = node.nodeName.toUpperCase(); - + if ( nodeName == 'TR' ) { return api.row( node ).index(); } else if ( nodeName == 'TD' || nodeName == 'TH' ) { var cell = api.cell( node ).index(); - + return [ cell.row, cell.columnVisible, @@ -609,8 +609,8 @@ } return null; }; - - + + /** * Check to see if a row is 'open' or not. * @param {node} nTr the table row to check @@ -638,8 +638,8 @@ { return this.api( true ).row( nTr ).child.isShown(); }; - - + + /** * This function will place a new row directly after a row which is currently * on display on the page, with the HTML contents that is passed into the @@ -678,8 +678,8 @@ .show() .child()[0]; }; - - + + /** * Change the pagination - provides the internal logic for pagination in a simple API * function. With this function you can have a DataTables table go to the next, @@ -699,13 +699,13 @@ this.fnPageChange = function ( mAction, bRedraw ) { var api = this.api( true ).page( mAction ); - + if ( bRedraw === undefined || bRedraw ) { api.draw(false); } }; - - + + /** * Show a particular column * @param {int} iCol The column whose display should be changed @@ -725,13 +725,13 @@ this.fnSetColumnVis = function ( iCol, bShow, bRedraw ) { var api = this.api( true ).column( iCol ).visible( bShow ); - + if ( bRedraw === undefined || bRedraw ) { api.columns.adjust().draw(); } }; - - + + /** * Get the settings for a particular table for external manipulation * @returns {object} DataTables settings object. See @@ -752,8 +752,8 @@ { return _fnSettingsFromNode( this[_ext.iApiIndex] ); }; - - + + /** * Sort the table by a particular column * @param {int} iCol the data index to sort on. Note that this will not match the @@ -773,8 +773,8 @@ { this.api( true ).order( aaSort ).draw(); }; - - + + /** * Attach a sort listener to an element for a given column * @param {node} nNode the element to attach the sort listener to @@ -795,8 +795,8 @@ { this.api( true ).order.listener( nNode, iColumn, fnCallback ); }; - - + + /** * Update a table cell or row - this method will accept either a single value to * update the cell with, an array of values with one element for each column or @@ -822,25 +822,25 @@ this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction ) { var api = this.api( true ); - + if ( iColumn === undefined || iColumn === null ) { api.row( mRow ).data( mData ); } else { api.cell( mRow, iColumn ).data( mData ); } - + if ( bAction === undefined || bAction ) { api.columns.adjust(); } - + if ( bRedraw === undefined || bRedraw ) { api.draw(); } return 0; }; - - + + /** * Provide a common method for plug-ins to check the version of DataTables being used, in order * to ensure compatibility. @@ -859,7 +859,7 @@ * } ); */ this.fnVersionCheck = _ext.fnVersionCheck; - + var _that = this; var emptyInit = options === undefined; @@ -892,40 +892,40 @@ var bInitHandedOff = false; var defaults = DataTable.defaults; var $this = $(this); - - + + /* Sanity check */ if ( this.nodeName.toLowerCase() != 'table' ) { _fnLog( null, 0, 'Non-table node initialisation ('+this.nodeName+')', 2 ); return; } - + /* Backwards compatibility for the defaults */ _fnCompatOpts( defaults ); _fnCompatCols( defaults.column ); - + /* Convert the camel-case defaults to Hungarian */ _fnCamelToHungarian( defaults, defaults, true ); _fnCamelToHungarian( defaults.column, defaults.column, true ); - + /* Setting up the initialisation object */ _fnCamelToHungarian( defaults, $.extend( oInit, $this.data() ) ); - - - + + + /* Check to see if we are re-initialising a table */ var allSettings = DataTable.settings; for ( i=0, iLen=allSettings.length ; i').appendTo($this); } oSettings.nTHead = thead[0]; - + var tbody = $this.children('tbody'); if ( tbody.length === 0 ) { tbody = $('').appendTo($this); } oSettings.nTBody = tbody[0]; - + var tfoot = $this.children('tfoot'); if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") ) { // If we are a scrolling table, and no footer has been given, then we need to create // a tfoot element for the caption element to be appended to tfoot = $('').appendTo($this); } - + if ( tfoot.length === 0 || tfoot.children().length === 0 ) { $this.addClass( oClasses.sNoFooter ); } @@ -1279,7 +1279,7 @@ oSettings.nTFoot = tfoot[0]; _fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot ); } - + /* Check if there is data passing into the constructor */ if ( oInit.aaData ) { for ( i=0 ; i/g; - + // This is not strict ISO8601 - Date.parse() is quite lax, although // implementations differ between browsers. var _re_date = /^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/; - + // Escape regular expression special characters var _re_escape_regex = new RegExp( '(\\' + [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ].join('|\\') + ')', 'g' ); - + // http://en.wikipedia.org/wiki/Foreign_exchange_market // - \u20BD - Russian ruble. // - \u20a9 - South Korean Won @@ -1368,18 +1368,18 @@ // - \u2009 is thin space and \u202F is narrow no-break space, both used in many // standards as thousands separators. var _re_formatted_numeric = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi; - - + + var _empty = function ( d ) { return !d || d === true || d === '-' ? true : false; }; - - + + var _intVal = function ( s ) { var integer = parseInt( s, 10 ); return !isNaN(integer) && isFinite(s) ? integer : null; }; - + // Convert from a formatted number with characters other than `.` as the // decimal place, to a Javascript number var _numToDecimal = function ( num, decimalPoint ) { @@ -1391,41 +1391,41 @@ num.replace( /\./g, '' ).replace( _re_dic[ decimalPoint ], '.' ) : num; }; - - + + var _isNumber = function ( d, decimalPoint, formatted ) { var strType = typeof d === 'string'; - + // If empty return immediately so there must be a number if it is a // formatted string (this stops the string "k", or "kr", etc being detected // as a formatted number for currency if ( _empty( d ) ) { return true; } - + if ( decimalPoint && strType ) { d = _numToDecimal( d, decimalPoint ); } - + if ( formatted && strType ) { d = d.replace( _re_formatted_numeric, '' ); } - + return !isNaN( parseFloat(d) ) && isFinite( d ); }; - - + + // A string without HTML in it can be considered to be HTML still var _isHtml = function ( d ) { return _empty( d ) || typeof d === 'string'; }; - - + + var _htmlNumeric = function ( d, decimalPoint, formatted ) { if ( _empty( d ) ) { return true; } - + var html = _isHtml( d ); return ! html ? null : @@ -1433,12 +1433,12 @@ true : null; }; - - + + var _pluck = function ( a, prop, prop2 ) { var out = []; var i=0, ien=a.length; - + // Could have the test in the loop for slightly smaller code, but speed // is essential here if ( prop2 !== undefined ) { @@ -1455,18 +1455,18 @@ } } } - + return out; }; - - + + // Basically the same as _pluck, but rather than looping over `a` we use `order` // as the indexes to pick from `a` var _pluck_order = function ( a, order, prop, prop2 ) { var out = []; var i=0, ien=order.length; - + // Could have the test in the loop for slightly smaller code, but speed // is essential here if ( prop2 !== undefined ) { @@ -1481,16 +1481,16 @@ out.push( a[ order[i] ][ prop ] ); } } - + return out; }; - - + + var _range = function ( len, start ) { var out = []; var end; - + if ( start === undefined ) { start = 0; end = len; @@ -1499,34 +1499,34 @@ end = start; start = len; } - + for ( var i=start ; i') .css( { @@ -1890,10 +1890,10 @@ ) ) .appendTo( 'body' ); - + var outer = n.children(); var inner = outer.children(); - + // Numbers below, in order, are: // inner.offsetWidth, inner.clientWidth, outer.offsetWidth, outer.clientWidth // @@ -1903,30 +1903,30 @@ // Evergreen Windows: 83 83 100 83 // Evergreen Mac with scrollbars: 85 85 100 85 // Evergreen Mac without scrollbars: 100 100 100 100 - + // Get scrollbar width browser.barWidth = outer[0].offsetWidth - outer[0].clientWidth; - + // IE6/7 will oversize a width 100% element inside a scrolling element, to // include the width of the scrollbar, while other browsers ensure the inner // element is contained without forcing scrolling browser.bScrollOversize = inner[0].offsetWidth === 100 && outer[0].clientWidth !== 100; - + // In rtl text layout, some browsers (most, but not all) will place the // scrollbar on the left, rather than the right. browser.bScrollbarLeft = Math.round( inner.offset().left ) !== 1; - + // IE8- don't provide height and width for getBoundingClientRect browser.bBounding = n[0].getBoundingClientRect().width ? true : false; - + n.remove(); } - + $.extend( settings.oBrowser, DataTable.__browser ); settings.oScroll.iBarWidth = DataTable.__browser.barWidth; } - - + + /** * Array.prototype reduce[Right] method, used for browsers which don't support * JS 1.6. Done this way to reduce code size, since we iterate either way @@ -1939,28 +1939,28 @@ i = start, value, isSet = false; - + if ( init !== undefined ) { value = init; isSet = true; } - + while ( i !== end ) { if ( ! that.hasOwnProperty(i) ) { continue; } - + value = isSet ? fn( value, that[i], i, that ) : that[i]; - + isSet = true; i += inc; } - + return value; } - + /** * Add a column to the list used for the table with default values * @param {object} oSettings dataTables settings object @@ -1980,18 +1980,18 @@ idx: iCol } ); oSettings.aoColumns.push( oCol ); - + // Add search object for column specific search. Note that the `searchCols[ iCol ]` // passed into extend can be undefined. This allows the user to give a default // with only some of the parameters defined, and also not give a default var searchCols = oSettings.aoPreSearchCols; searchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch, searchCols[ iCol ] ); - + // Use the default column options function to initialise classes etc _fnColumnOptions( oSettings, iCol, $(nTh).data() ); } - - + + /** * Apply options for a column * @param {object} oSettings dataTables settings object @@ -2004,40 +2004,40 @@ var oCol = oSettings.aoColumns[ iCol ]; var oClasses = oSettings.oClasses; var th = $(oCol.nTh); - + // Try to get width information from the DOM. We can't get it from CSS // as we'd need to parse the CSS stylesheet. `width` option can override if ( ! oCol.sWidthOrig ) { // Width attribute oCol.sWidthOrig = th.attr('width') || null; - + // Style attribute var t = (th.attr('style') || '').match(/width:\s*(\d+[pxem%]+)/); if ( t ) { oCol.sWidthOrig = t[1]; } } - + /* User specified column options */ if ( oOptions !== undefined && oOptions !== null ) { // Backwards compatibility _fnCompatCols( oOptions ); - + // Map camel case parameters to their Hungarian counterparts _fnCamelToHungarian( DataTable.defaults.column, oOptions ); - + /* Backwards compatibility for mDataProp */ if ( oOptions.mDataProp !== undefined && !oOptions.mData ) { oOptions.mData = oOptions.mDataProp; } - + if ( oOptions.sType ) { oCol._sManualType = oOptions.sType; } - + // `class` is a reserved word in Javascript, so we need to provide // the ability to use a valid name for the camel case input if ( oOptions.className && ! oOptions.sClass ) @@ -2047,10 +2047,10 @@ if ( oOptions.sClass ) { th.addClass( oOptions.sClass ); } - + $.extend( oCol, oOptions ); _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" ); - + /* iDataSort to be applied (backwards compatibility), but aDataSort will take * priority if defined */ @@ -2060,12 +2060,12 @@ } _fnMap( oCol, oOptions, "aDataSort" ); } - + /* Cache the data get and set functions for speed */ var mDataSrc = oCol.mData; var mData = _fnGetObjectDataFn( mDataSrc ); var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null; - + var attrTest = function( src ) { return typeof src === 'string' && src.indexOf('@') !== -1; }; @@ -2073,10 +2073,10 @@ attrTest(mDataSrc.sort) || attrTest(mDataSrc.type) || attrTest(mDataSrc.filter) ); oCol._setter = null; - + oCol.fnGetData = function (rowData, type, meta) { var innerData = mData( rowData, type, undefined, meta ); - + return mRender && type ? mRender( innerData, type, rowData, meta ) : innerData; @@ -2084,20 +2084,20 @@ oCol.fnSetData = function ( rowData, val, meta ) { return _fnSetObjectDataFn( mDataSrc )( rowData, val, meta ); }; - + // Indicate if DataTables should read DOM data as an object or array // Used in _fnGetRowElements if ( typeof mDataSrc !== 'number' ) { oSettings._rowReadObject = true; } - + /* Feature sorting overrides column specific when off */ if ( !oSettings.oFeatures.bSort ) { oCol.bSortable = false; th.addClass( oClasses.sSortableNone ); // Have to add class here as order event isn't called } - + /* Check that the class assignment is correct for sorting */ var bAsc = $.inArray('asc', oCol.asSorting) !== -1; var bDesc = $.inArray('desc', oCol.asSorting) !== -1; @@ -2122,8 +2122,8 @@ oCol.sSortingClassJUI = oClasses.sSortJUI; } } - - + + /** * Adjust the table column widths for new data. Note: you would probably want to * do a redraw after calling this function! @@ -2136,24 +2136,24 @@ if ( settings.oFeatures.bAutoWidth !== false ) { var columns = settings.aoColumns; - + _fnCalculateColumnWidths( settings ); for ( var i=0 , iLen=columns.length ; i