From 0225bdb772d1334cc1aa7ab0fc3678df0864df6b Mon Sep 17 00:00:00 2001 From: AlisaLinUwU Date: Sun, 26 Jan 2025 10:42:28 +0500 Subject: Initialize --- .../css/autoFill.bootstrap4.css | 91 ++ .../css/autoFill.bootstrap4.min.css | 1 + .../datatables-autofill/js/autoFill.bootstrap4.js | 43 + .../js/autoFill.bootstrap4.min.js | 5 + .../datatables-autofill/js/dataTables.autoFill.js | 1212 ++++++++++++++++++++ .../js/dataTables.autoFill.min.js | 46 + 6 files changed, 1398 insertions(+) create mode 100644 build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.css create mode 100644 build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.min.css create mode 100644 build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.js create mode 100644 build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.min.js create mode 100644 build/resources/main/static/plugins/datatables-autofill/js/dataTables.autoFill.js create mode 100644 build/resources/main/static/plugins/datatables-autofill/js/dataTables.autoFill.min.js (limited to 'build/resources/main/static/plugins/datatables-autofill') diff --git a/build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.css b/build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.css new file mode 100644 index 0000000..6abac44 --- /dev/null +++ b/build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.css @@ -0,0 +1,91 @@ +div.dt-autofill-handle { + position: absolute; + height: 8px; + width: 8px; + z-index: 102; + box-sizing: border-box; + background: #0275d8; + cursor: pointer; +} + +div.dtk-focus-alt div.dt-autofill-handle { + background: #ff8b33; +} + +div.dt-autofill-select { + position: absolute; + z-index: 1001; + background-color: #0275d8; + background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.5) 5px, rgba(255, 255, 255, 0.5) 10px); +} +div.dt-autofill-select.top, div.dt-autofill-select.bottom { + height: 3px; + margin-top: -1px; +} +div.dt-autofill-select.left, div.dt-autofill-select.right { + width: 3px; + margin-left: -1px; +} + +div.dt-autofill-list { + position: fixed; + top: 50%; + left: 50%; + width: 500px; + margin-left: -250px; + background-color: white; + border-radius: 6px; + box-shadow: 0 0 5px #555; + border: 2px solid #444; + z-index: 11; + box-sizing: border-box; + padding: 1.5em 2em; +} +div.dt-autofill-list ul { + display: table; + margin: 0; + padding: 0; + list-style: none; + width: 100%; +} +div.dt-autofill-list ul li { + display: table-row; +} +div.dt-autofill-list ul li:last-child div.dt-autofill-question, div.dt-autofill-list ul li:last-child div.dt-autofill-button { + border-bottom: none; +} +div.dt-autofill-list ul li:hover { + background-color: #f6f6f6; +} +div.dt-autofill-list div.dt-autofill-question { + display: table-cell; + padding: 0.5em 0; + border-bottom: 1px solid #ccc; +} +div.dt-autofill-list div.dt-autofill-question input[type=number] { + padding: 6px; + width: 30px; + margin: -2px 0; +} +div.dt-autofill-list div.dt-autofill-button { + display: table-cell; + padding: 0.5em 0; + border-bottom: 1px solid #ccc; +} + +div.dt-autofill-background { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.7); + background: radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%); + z-index: 10; +} + +div.dt-autofill-list div.dt-autofill-question input[type=number] { + padding: 6px; + width: 60px; + margin: -2px 0; +} diff --git a/build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.min.css b/build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.min.css new file mode 100644 index 0000000..50bc3be --- /dev/null +++ b/build/resources/main/static/plugins/datatables-autofill/css/autoFill.bootstrap4.min.css @@ -0,0 +1 @@ +div.dt-autofill-handle{position:absolute;height:8px;width:8px;z-index:102;box-sizing:border-box;background:#0275d8;cursor:pointer}div.dtk-focus-alt div.dt-autofill-handle{background:#ff8b33}div.dt-autofill-select{position:absolute;z-index:1001;background-color:#0275d8;background-image:repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.5) 5px, rgba(255, 255, 255, 0.5) 10px)}div.dt-autofill-select.top,div.dt-autofill-select.bottom{height:3px;margin-top:-1px}div.dt-autofill-select.left,div.dt-autofill-select.right{width:3px;margin-left:-1px}div.dt-autofill-list{position:fixed;top:50%;left:50%;width:500px;margin-left:-250px;background-color:white;border-radius:6px;box-shadow:0 0 5px #555;border:2px solid #444;z-index:11;box-sizing:border-box;padding:1.5em 2em}div.dt-autofill-list ul{display:table;margin:0;padding:0;list-style:none;width:100%}div.dt-autofill-list ul li{display:table-row}div.dt-autofill-list ul li:last-child div.dt-autofill-question,div.dt-autofill-list ul li:last-child div.dt-autofill-button{border-bottom:none}div.dt-autofill-list ul li:hover{background-color:#f6f6f6}div.dt-autofill-list div.dt-autofill-question{display:table-cell;padding:.5em 0;border-bottom:1px solid #ccc}div.dt-autofill-list div.dt-autofill-question input[type=number]{padding:6px;width:30px;margin:-2px 0}div.dt-autofill-list div.dt-autofill-button{display:table-cell;padding:.5em 0;border-bottom:1px solid #ccc}div.dt-autofill-background{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);background:radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);z-index:10}div.dt-autofill-list div.dt-autofill-question input[type=number]{padding:6px;width:60px;margin:-2px 0} diff --git a/build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.js b/build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.js new file mode 100644 index 0000000..40037e4 --- /dev/null +++ b/build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.js @@ -0,0 +1,43 @@ +/*! Bootstrap integration for DataTables' AutoFill + * ©2015 SpryMedia Ltd - datatables.net/license + */ + +(function( factory ){ + if ( typeof define === 'function' && define.amd ) { + // AMD + define( ['jquery', 'datatables.net-bs4', 'datatables.net-autofill'], function ( $ ) { + return factory( $, window, document ); + } ); + } + else if ( typeof exports === 'object' ) { + // CommonJS + module.exports = function (root, $) { + if ( ! root ) { + root = window; + } + + if ( ! $ || ! $.fn.dataTable ) { + $ = require('datatables.net-bs4')(root, $).$; + } + + if ( ! $.fn.dataTable.AutoFill ) { + require('datatables.net-autofill')(root, $); + } + + return factory( $, root, root.document ); + }; + } + else { + // Browser + factory( jQuery, window, document ); + } +}(function( $, window, document, undefined ) { +'use strict'; +var DataTable = $.fn.dataTable; + + +DataTable.AutoFill.classes.btn = 'btn btn-primary'; + + +return DataTable; +})); \ No newline at end of file diff --git a/build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.min.js b/build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.min.js new file mode 100644 index 0000000..e97763d --- /dev/null +++ b/build/resources/main/static/plugins/datatables-autofill/js/autoFill.bootstrap4.min.js @@ -0,0 +1,5 @@ +/*! + Bootstrap integration for DataTables' AutoFill + ©2015 SpryMedia Ltd - datatables.net/license +*/ +(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs4","datatables.net-autofill"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,c){a||(a=window);c&&c.fn.dataTable||(c=require("datatables.net-bs4")(a,c).$);c.fn.dataTable.AutoFill||require("datatables.net-autofill")(a,c);return b(c,a,a.document)}:b(jQuery,window,document)})(function(b,a,c,d){b=b.fn.dataTable;b.AutoFill.classes.btn="btn btn-primary";return b}); diff --git a/build/resources/main/static/plugins/datatables-autofill/js/dataTables.autoFill.js b/build/resources/main/static/plugins/datatables-autofill/js/dataTables.autoFill.js new file mode 100644 index 0000000..bc13b7d --- /dev/null +++ b/build/resources/main/static/plugins/datatables-autofill/js/dataTables.autoFill.js @@ -0,0 +1,1212 @@ +/*! AutoFill 2.3.9 + * ©2008-2021 SpryMedia Ltd - datatables.net/license + */ + +/** + * @summary AutoFill + * @description Add Excel like click and drag auto-fill options to DataTables + * @version 2.3.9 + * @file dataTables.autoFill.js + * @author SpryMedia Ltd (www.sprymedia.co.uk) + * @contact www.sprymedia.co.uk/contact + * @copyright Copyright 2010-2021 SpryMedia Ltd. + * + * This source file is free software, available under the following license: + * MIT license - http://datatables.net/license/mit + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + * + * For details please refer to: http://www.datatables.net + */ +(function( factory ){ + if ( typeof define === 'function' && define.amd ) { + // AMD + define( ['jquery', 'datatables.net'], function ( $ ) { + return factory( $, window, document ); + } ); + } + else if ( typeof exports === 'object' ) { + // CommonJS + module.exports = function (root, $) { + if ( ! root ) { + root = window; + } + + if ( ! $ || ! $.fn.dataTable ) { + $ = require('datatables.net')(root, $).$; + } + + return factory( $, root, root.document ); + }; + } + else { + // Browser + factory( jQuery, window, document ); + } +}(function( $, window, document, undefined ) { +'use strict'; +var DataTable = $.fn.dataTable; + + +var _instance = 0; + +/** + * AutoFill provides Excel like auto-fill features for a DataTable + * + * @class AutoFill + * @constructor + * @param {object} oTD DataTables settings object + * @param {object} oConfig Configuration object for AutoFill + */ +var AutoFill = function( dt, opts ) +{ + if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.8' ) ) { + throw( "Warning: AutoFill requires DataTables 1.10.8 or greater"); + } + + // User and defaults configuration object + this.c = $.extend( true, {}, + DataTable.defaults.autoFill, + AutoFill.defaults, + opts + ); + + /** + * @namespace Settings object which contains customisable information for AutoFill instance + */ + this.s = { + /** @type {DataTable.Api} DataTables' API instance */ + dt: new DataTable.Api( dt ), + + /** @type {String} Unique namespace for events attached to the document */ + namespace: '.autoFill'+(_instance++), + + /** @type {Object} Cached dimension information for use in the mouse move event handler */ + scroll: {}, + + /** @type {integer} Interval object used for smooth scrolling */ + scrollInterval: null, + + handle: { + height: 0, + width: 0 + }, + + /** + * Enabled setting + * @type {Boolean} + */ + enabled: false + }; + + + /** + * @namespace Common and useful DOM elements for the class instance + */ + this.dom = { + /** @type {jQuery} AutoFill handle */ + handle: $('
'), + + /** + * @type {Object} Selected cells outline - Need to use 4 elements, + * otherwise the mouse over if you back into the selected rectangle + * will be over that element, rather than the cells! + */ + select: { + top: $('
'), + right: $('
'), + bottom: $('
'), + left: $('
') + }, + + /** @type {jQuery} Fill type chooser background */ + background: $('
'), + + /** @type {jQuery} Fill type chooser */ + list: $('
'+this.s.dt.i18n('autoFill.info', '')+'
    '), + + /** @type {jQuery} DataTables scrolling container */ + dtScroll: null, + + /** @type {jQuery} Offset parent element */ + offsetParent: null + }; + + + /* Constructor logic */ + this._constructor(); +}; + + + +$.extend( AutoFill.prototype, { + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Public methods (exposed via the DataTables API below) + */ + enabled: function () + { + return this.s.enabled; + }, + + + enable: function ( flag ) + { + var that = this; + + if ( flag === false ) { + return this.disable(); + } + + this.s.enabled = true; + + this._focusListener(); + + this.dom.handle.on( 'mousedown', function (e) { + that._mousedown( e ); + return false; + } ); + + return this; + }, + + disable: function () + { + this.s.enabled = false; + + this._focusListenerRemove(); + + return this; + }, + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Constructor + */ + + /** + * Initialise the RowReorder instance + * + * @private + */ + _constructor: function () + { + var that = this; + var dt = this.s.dt; + var dtScroll = $('div.dataTables_scrollBody', this.s.dt.table().container()); + + // Make the instance accessible to the API + dt.settings()[0].autoFill = this; + + if ( dtScroll.length ) { + this.dom.dtScroll = dtScroll; + + // Need to scroll container to be the offset parent + if ( dtScroll.css('position') === 'static' ) { + dtScroll.css( 'position', 'relative' ); + } + } + + if ( this.c.enable !== false ) { + this.enable(); + } + + dt.on( 'destroy.autoFill', function () { + that._focusListenerRemove(); + } ); + }, + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Private methods + */ + + /** + * Display the AutoFill drag handle by appending it to a table cell. This + * is the opposite of the _detach method. + * + * @param {node} node TD/TH cell to insert the handle into + * @private + */ + _attach: function ( node ) + { + var dt = this.s.dt; + var idx = dt.cell( node ).index(); + var handle = this.dom.handle; + var handleDim = this.s.handle; + + if ( ! idx || dt.columns( this.c.columns ).indexes().indexOf( idx.column ) === -1 ) { + this._detach(); + return; + } + + if ( ! this.dom.offsetParent ) { + // We attach to the table's offset parent + this.dom.offsetParent = $( dt.table().node() ).offsetParent(); + } + + if ( ! handleDim.height || ! handleDim.width ) { + // Append to document so we can get its size. Not expecting it to + // change during the life time of the page + handle.appendTo( 'body' ); + handleDim.height = handle.outerHeight(); + handleDim.width = handle.outerWidth(); + } + + // Might need to go through multiple offset parents + var offset = this._getPosition( node, this.dom.offsetParent ); + + this.dom.attachedTo = node; + handle + .css( { + top: offset.top + node.offsetHeight - handleDim.height, + left: offset.left + node.offsetWidth - handleDim.width + } ) + .appendTo( this.dom.offsetParent ); + }, + + + /** + * Determine can the fill type should be. This can be automatic, or ask the + * end user. + * + * @param {array} cells Information about the selected cells from the key + * up function + * @private + */ + _actionSelector: function ( cells ) + { + var that = this; + var dt = this.s.dt; + var actions = AutoFill.actions; + var available = []; + + // "Ask" each plug-in if it wants to handle this data + $.each( actions, function ( key, action ) { + if ( action.available( dt, cells ) ) { + available.push( key ); + } + } ); + + if ( available.length === 1 && this.c.alwaysAsk === false ) { + // Only one action available - enact it immediately + var result = actions[ available[0] ].execute( dt, cells ); + this._update( result, cells ); + } + else if ( available.length > 1 ) { + // Multiple actions available - ask the end user what they want to do + var list = this.dom.list.children('ul').empty(); + + // Add a cancel option + available.push( 'cancel' ); + + $.each( available, function ( i, name ) { + list.append( $('
  • ') + .append( + '
    '+ + actions[ name ].option( dt, cells )+ + '
    ' + ) + .append( $('
    ' ) + .append( $('') + .on( 'click', function () { + var result = actions[ name ].execute( + dt, cells, $(this).closest('li') + ); + that._update( result, cells ); + + that.dom.background.remove(); + that.dom.list.remove(); + } ) + ) + ) + ); + } ); + + this.dom.background.appendTo( 'body' ); + this.dom.list.appendTo( 'body' ); + + this.dom.list.css( 'margin-top', this.dom.list.outerHeight()/2 * -1 ); + } + }, + + + /** + * Remove the AutoFill handle from the document + * + * @private + */ + _detach: function () + { + this.dom.attachedTo = null; + this.dom.handle.detach(); + }, + + + /** + * Draw the selection outline by calculating the range between the start + * and end cells, then placing the highlighting elements to draw a rectangle + * + * @param {node} target End cell + * @param {object} e Originating event + * @private + */ + _drawSelection: function ( target, e ) + { + // Calculate boundary for start cell to this one + var dt = this.s.dt; + var start = this.s.start; + var startCell = $(this.dom.start); + var end = { + row: this.c.vertical ? + dt.rows( { page: 'current' } ).nodes().indexOf( target.parentNode ) : + start.row, + column: this.c.horizontal ? + $(target).index() : + start.column + }; + var colIndx = dt.column.index( 'toData', end.column ); + var endRow = dt.row( ':eq('+end.row+')', { page: 'current' } ); // Workaround for M581 + var endCell = $( dt.cell( endRow.index(), colIndx ).node() ); + + // Be sure that is a DataTables controlled cell + if ( ! dt.cell( endCell ).any() ) { + return; + } + + // if target is not in the columns available - do nothing + if ( dt.columns( this.c.columns ).indexes().indexOf( colIndx ) === -1 ) { + return; + } + + this.s.end = end; + + var top, bottom, left, right, height, width; + + top = start.row < end.row ? startCell : endCell; + bottom = start.row < end.row ? endCell : startCell; + left = start.column < end.column ? startCell : endCell; + right = start.column < end.column ? endCell : startCell; + + top = this._getPosition( top.get(0) ).top; + left = this._getPosition( left.get(0) ).left; + height = this._getPosition( bottom.get(0) ).top + bottom.outerHeight() - top; + width = this._getPosition( right.get(0) ).left + right.outerWidth() - left; + + var select = this.dom.select; + select.top.css( { + top: top, + left: left, + width: width + } ); + + select.left.css( { + top: top, + left: left, + height: height + } ); + + select.bottom.css( { + top: top + height, + left: left, + width: width + } ); + + select.right.css( { + top: top, + left: left + width, + height: height + } ); + }, + + + /** + * Use the Editor API to perform an update based on the new data for the + * cells + * + * @param {array} cells Information about the selected cells from the key + * up function + * @private + */ + _editor: function ( cells ) + { + var dt = this.s.dt; + var editor = this.c.editor; + + if ( ! editor ) { + return; + } + + // Build the object structure for Editor's multi-row editing + var idValues = {}; + var nodes = []; + var fields = editor.fields(); + + for ( var i=0, ien=cells.length ; i=end ; i-- ) { + out.push( i ); + } + } + + return out; + }, + + + /** + * Move the window and DataTables scrolling during a drag to scroll new + * content into view. This is done by proximity to the edge of the scrolling + * container of the mouse - for example near the top edge of the window + * should scroll up. This is a little complicated as there are two elements + * that can be scrolled - the window and the DataTables scrolling view port + * (if scrollX and / or scrollY is enabled). + * + * @param {object} e Mouse move event object + * @private + */ + _shiftScroll: function ( e ) + { + var that = this; + var dt = this.s.dt; + var scroll = this.s.scroll; + var runInterval = false; + var scrollSpeed = 5; + var buffer = 65; + var + windowY = e.pageY - document.body.scrollTop, + windowX = e.pageX - document.body.scrollLeft, + windowVert, windowHoriz, + dtVert, dtHoriz; + + // Window calculations - based on the mouse position in the window, + // regardless of scrolling + if ( windowY < buffer ) { + windowVert = scrollSpeed * -1; + } + else if ( windowY > scroll.windowHeight - buffer ) { + windowVert = scrollSpeed; + } + + if ( windowX < buffer ) { + windowHoriz = scrollSpeed * -1; + } + else if ( windowX > scroll.windowWidth - buffer ) { + windowHoriz = scrollSpeed; + } + + // DataTables scrolling calculations - based on the table's position in + // the document and the mouse position on the page + if ( scroll.dtTop !== null && e.pageY < scroll.dtTop + buffer ) { + dtVert = scrollSpeed * -1; + } + else if ( scroll.dtTop !== null && e.pageY > scroll.dtTop + scroll.dtHeight - buffer ) { + dtVert = scrollSpeed; + } + + if ( scroll.dtLeft !== null && e.pageX < scroll.dtLeft + buffer ) { + dtHoriz = scrollSpeed * -1; + } + else if ( scroll.dtLeft !== null && e.pageX > scroll.dtLeft + scroll.dtWidth - buffer ) { + dtHoriz = scrollSpeed; + } + + // This is where it gets interesting. We want to continue scrolling + // without requiring a mouse move, so we need an interval to be + // triggered. The interval should continue until it is no longer needed, + // but it must also use the latest scroll commands (for example consider + // that the mouse might move from scrolling up to scrolling left, all + // with the same interval running. We use the `scroll` object to "pass" + // this information to the interval. Can't use local variables as they + // wouldn't be the ones that are used by an already existing interval! + if ( windowVert || windowHoriz || dtVert || dtHoriz ) { + scroll.windowVert = windowVert; + scroll.windowHoriz = windowHoriz; + scroll.dtVert = dtVert; + scroll.dtHoriz = dtHoriz; + runInterval = true; + } + else if ( this.s.scrollInterval ) { + // Don't need to scroll - remove any existing timer + clearInterval( this.s.scrollInterval ); + this.s.scrollInterval = null; + } + + // If we need to run the interval to scroll and there is no existing + // interval (if there is an existing one, it will continue to run) + if ( ! this.s.scrollInterval && runInterval ) { + this.s.scrollInterval = setInterval( function () { + // Don't need to worry about setting scroll <0 or beyond the + // scroll bound as the browser will just reject that. + if ( scroll.windowVert ) { + document.body.scrollTop += scroll.windowVert; + } + if ( scroll.windowHoriz ) { + document.body.scrollLeft += scroll.windowHoriz; + } + + // DataTables scrolling + if ( scroll.dtVert || scroll.dtHoriz ) { + var scroller = that.dom.dtScroll[0]; + + if ( scroll.dtVert ) { + scroller.scrollTop += scroll.dtVert; + } + if ( scroll.dtHoriz ) { + scroller.scrollLeft += scroll.dtHoriz; + } + } + }, 20 ); + } + }, + + + /** + * Update the DataTable after the user has selected what they want to do + * + * @param {false|undefined} result Return from the `execute` method - can + * be false internally to do nothing. This is not documented for plug-ins + * and is used only by the cancel option. + * @param {array} cells Information about the selected cells from the key + * up function, argumented with the set values + * @private + */ + _update: function ( result, cells ) + { + // Do nothing on `false` return from an execute function + if ( result === false ) { + return; + } + + var dt = this.s.dt; + var cell; + var columns = dt.columns( this.c.columns ).indexes(); + + // Potentially allow modifications to the cells matrix + this._emitEvent( 'preAutoFill', [ dt, cells ] ); + + this._editor( cells ); + + // Automatic updates are not performed if `update` is null and the + // `editor` parameter is passed in - the reason being that Editor will + // update the data once submitted + var update = this.c.update !== null ? + this.c.update : + this.c.editor ? + false : + true; + + if ( update ) { + for ( var i=0, ien=cells.length ; i' + ); + }, + + execute: function ( dt, cells, node ) { + var value = cells[0][0].data * 1; + var increment = $('input', node).val() * 1; + + for ( var i=0, ien=cells.length ; i%d', cells[0][0].label ); + }, + + execute: function ( dt, cells, node ) { + var value = cells[0][0].data; + + for ( var i=0, ien=cells.length ; i 1 && cells[0].length > 1; + }, + + option: function ( dt, cells ) { + return dt.i18n('autoFill.fillHorizontal', 'Fill cells horizontally' ); + }, + + execute: function ( dt, cells, node ) { + for ( var i=0, ien=cells.length ; i 1; + }, + + option: function ( dt, cells ) { + return dt.i18n('autoFill.fillVertical', 'Fill cells vertically' ); + }, + + execute: function ( dt, cells, node ) { + for ( var i=0, ien=cells.length ; i'),select:{top:c('
    '),right:c('
    '),bottom:c('
    '),left:c('
    ')},background:c('
    '),list:c('
    '+this.s.dt.i18n("autoFill.info", +"")+"
      "),dtScroll:null,offsetParent:null};this._constructor()};c.extend(r.prototype,{enabled:function(){return this.s.enabled},enable:function(a){var d=this;if(!1===a)return this.disable();this.s.enabled=!0;this._focusListener();this.dom.handle.on("mousedown",function(b){d._mousedown(b);return!1});return this},disable:function(){this.s.enabled=!1;this._focusListenerRemove();return this},_constructor:function(){var a=this,d=this.s.dt,b=c("div.dataTables_scrollBody",this.s.dt.table().container()); +d.settings()[0].autoFill=this;b.length&&(this.dom.dtScroll=b,"static"===b.css("position")&&b.css("position","relative"));!1!==this.c.enable&&this.enable();d.on("destroy.autoFill",function(){a._focusListenerRemove()})},_attach:function(a){var d=this.s.dt,b=d.cell(a).index(),e=this.dom.handle,f=this.s.handle;b&&-1!==d.columns(this.c.columns).indexes().indexOf(b.column)?(this.dom.offsetParent||(this.dom.offsetParent=c(d.table().node()).offsetParent()),f.height&&f.width||(e.appendTo("body"),f.height= +e.outerHeight(),f.width=e.outerWidth()),d=this._getPosition(a,this.dom.offsetParent),this.dom.attachedTo=a,e.css({top:d.top+a.offsetHeight-f.height,left:d.left+a.offsetWidth-f.width}).appendTo(this.dom.offsetParent)):this._detach()},_actionSelector:function(a){var d=this,b=this.s.dt,e=r.actions,f=[];c.each(e,function(p,q){q.available(b,a)&&f.push(p)});if(1===f.length&&!1===this.c.alwaysAsk){var m=e[f[0]].execute(b,a);this._update(m,a)}else if(1").append('
      '+e[q].option(b,a)+"
      ").append(c('
      ').append(c('").on("click",function(){var v=e[q].execute(b,a,c(this).closest("li"));d._update(v,a);d.dom.background.remove();d.dom.list.remove()}))))});this.dom.background.appendTo("body");this.dom.list.appendTo("body");this.dom.list.css("margin-top", +this.dom.list.outerHeight()/2*-1)}},_detach:function(){this.dom.attachedTo=null;this.dom.handle.detach()},_drawSelection:function(a,d){var b=this.s.dt;d=this.s.start;var e=c(this.dom.start),f={row:this.c.vertical?b.rows({page:"current"}).nodes().indexOf(a.parentNode):d.row,column:this.c.horizontal?c(a).index():d.column};a=b.column.index("toData",f.column);var m=b.row(":eq("+f.row+")",{page:"current"});m=c(b.cell(m.index(),a).node());if(b.cell(m).any()&&-1!==b.columns(this.c.columns).indexes().indexOf(a)){this.s.end= +f;b=d.row=d;a--)b.push(a);return b},_shiftScroll:function(a){var d=this,b=this.s.scroll,e=!1,f=a.pageY-g.body.scrollTop,m=a.pageX-g.body.scrollLeft,n,p,q,v;65>f?n=-5:f>b.windowHeight-65&&(n=5);65>m?p=-5:m>b.windowWidth-65&&(p=5);null!==b.dtTop&&a.pageYb.dtTop+b.dtHeight-65&&(q=5);null!==b.dtLeft&&a.pageX< +b.dtLeft+65?v=-5:null!==b.dtLeft&&a.pageX>b.dtLeft+b.dtWidth-65&&(v=5);n||p||q||v?(b.windowVert=n,b.windowHoriz=p,b.dtVert=q,b.dtHoriz=v,e=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),this.s.scrollInterval=null);!this.s.scrollInterval&&e&&(this.s.scrollInterval=setInterval(function(){b.windowVert&&(g.body.scrollTop+=b.windowVert);b.windowHoriz&&(g.body.scrollLeft+=b.windowHoriz);if(b.dtVert||b.dtHoriz){var u=d.dom.dtScroll[0];b.dtVert&&(u.scrollTop+=b.dtVert);b.dtHoriz&&(u.scrollLeft+= +b.dtHoriz)}},20))},_update:function(a,d){if(!1!==a){a=this.s.dt;var b=a.columns(this.c.columns).indexes();this._emitEvent("preAutoFill",[a,d]);this._editor(d);if(null!==this.c.update?this.c.update:!this.c.editor){for(var e=0,f=d.length;e')},execute:function(a,d,b){a=1*d[0][0].data;b=1*c("input",b).val();for(var e=0,f=d.length;e%d",d[0][0].label)},execute:function(a,d,b){a=d[0][0].data;b=0;for(var e=d.length;b