|
|
@ -1,113 +1,114 @@
|
|
|
|
/*!***************************************************
|
|
|
|
/*!***************************************************
|
|
|
|
* datatables.mark.js v2.0.0
|
|
|
|
* datatables.mark.js v2.0.1
|
|
|
|
* https://github.com/julmot/datatables.mark.js
|
|
|
|
* https://github.com/julmot/datatables.mark.js
|
|
|
|
* Copyright (c) 2016, Julian Motz
|
|
|
|
* Copyright (c) 2016–2017, Julian Motz
|
|
|
|
* Released under the MIT license https://git.io/voRZ7
|
|
|
|
* Released under the MIT license https://git.io/voRZ7
|
|
|
|
*****************************************************/
|
|
|
|
*****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
|
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
|
|
(function (factory, window, document) {
|
|
|
|
(function (factory, window, document) {
|
|
|
|
if (typeof define === "function" && define.amd) {
|
|
|
|
if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') {
|
|
|
|
define(["jquery", "datatables.net", "markjs"], function (jQuery) {
|
|
|
|
var jquery = require('jquery');
|
|
|
|
return factory(window, document, jQuery);
|
|
|
|
require('datatables.net');
|
|
|
|
});
|
|
|
|
require('mark.js/dist/jquery.mark.js');
|
|
|
|
} else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object") {
|
|
|
|
module.exports = factory(window, document, jquery);
|
|
|
|
require("datatables.net");
|
|
|
|
} else if (typeof define === 'function' && define.amd) {
|
|
|
|
require("markjs");
|
|
|
|
define(['jquery', 'datatables.net', 'markjs'], function (jQuery) {
|
|
|
|
factory(window, document, require("jquery"));
|
|
|
|
return factory(window, document, jQuery);
|
|
|
|
} else {
|
|
|
|
});
|
|
|
|
factory(window, document, jQuery);
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
factory(window, document, jQuery);
|
|
|
|
|
|
|
|
}
|
|
|
|
})(function (window, document, $) {
|
|
|
|
})(function (window, document, $) {
|
|
|
|
var Mark_DataTables = function () {
|
|
|
|
var MarkDataTables = function () {
|
|
|
|
function Mark_DataTables(dtInstance, options) {
|
|
|
|
function MarkDataTables(dtInstance, options) {
|
|
|
|
_classCallCheck(this, Mark_DataTables);
|
|
|
|
_classCallCheck(this, MarkDataTables);
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof $.fn.mark !== "function" || typeof $.fn.unmark !== "function") {
|
|
|
|
if (!$.fn.mark || !$.fn.unmark) {
|
|
|
|
throw new Error("jquery.mark.js is necessary for datatables.mark.js");
|
|
|
|
throw new Error('jquery.mark.js is necessary for datatables.mark.js');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.instance = dtInstance;
|
|
|
|
this.instance = dtInstance;
|
|
|
|
this.options = (typeof options === "undefined" ? "undefined" : _typeof(options)) === "object" ? options : {};
|
|
|
|
this.options = (typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' ? options : {};
|
|
|
|
this.intervalThreshold = 49;
|
|
|
|
this.intervalThreshold = 49;
|
|
|
|
this.intervalMs = 300;
|
|
|
|
this.intervalMs = 300;
|
|
|
|
this.initMarkListener();
|
|
|
|
this.initMarkListener();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_createClass(Mark_DataTables, [{
|
|
|
|
_createClass(MarkDataTables, [{
|
|
|
|
key: "initMarkListener",
|
|
|
|
key: 'initMarkListener',
|
|
|
|
value: function initMarkListener() {
|
|
|
|
value: function initMarkListener() {
|
|
|
|
var _this = this;
|
|
|
|
var _this = this;
|
|
|
|
|
|
|
|
|
|
|
|
var ev = "draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth";
|
|
|
|
var ev = 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth';
|
|
|
|
var intvl = null;
|
|
|
|
var intvl = null;
|
|
|
|
this.instance.on(ev, function () {
|
|
|
|
this.instance.on(ev, function () {
|
|
|
|
var rows = _this.instance.rows({
|
|
|
|
var rows = _this.instance.rows({
|
|
|
|
filter: "applied",
|
|
|
|
filter: 'applied',
|
|
|
|
page: "current"
|
|
|
|
page: 'current'
|
|
|
|
}).nodes().length;
|
|
|
|
}).nodes().length;
|
|
|
|
if (rows > _this.intervalThreshold) {
|
|
|
|
if (rows > _this.intervalThreshold) {
|
|
|
|
clearTimeout(intvl);
|
|
|
|
clearTimeout(intvl);
|
|
|
|
intvl = setTimeout(function () {
|
|
|
|
intvl = setTimeout(function () {
|
|
|
|
_this.mark();
|
|
|
|
_this.mark();
|
|
|
|
}, _this.intervalMs);
|
|
|
|
}, _this.intervalMs);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
_this.mark();
|
|
|
|
_this.mark();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.instance.on("destroy", function () {
|
|
|
|
this.instance.on('destroy', function () {
|
|
|
|
_this.instance.off(ev);
|
|
|
|
_this.instance.off(ev);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.mark();
|
|
|
|
this.mark();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
key: "mark",
|
|
|
|
key: 'mark',
|
|
|
|
value: function mark() {
|
|
|
|
value: function mark() {
|
|
|
|
var _this2 = this;
|
|
|
|
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
|
|
var globalSearch = this.instance.search();
|
|
|
|
var globalSearch = this.instance.search();
|
|
|
|
$(this.instance.table().body()).unmark(this.options);
|
|
|
|
$(this.instance.table().body()).unmark(this.options);
|
|
|
|
this.instance.columns({
|
|
|
|
this.instance.columns({
|
|
|
|
search: "applied",
|
|
|
|
search: 'applied',
|
|
|
|
page: "current"
|
|
|
|
page: 'current'
|
|
|
|
}).nodes().each(function (nodes, colIndex) {
|
|
|
|
}).nodes().each(function (nodes, colIndex) {
|
|
|
|
var columnSearch = _this2.instance.column(colIndex).search(),
|
|
|
|
var columnSearch = _this2.instance.column(colIndex).search(),
|
|
|
|
searchVal = columnSearch || globalSearch;
|
|
|
|
searchVal = columnSearch || globalSearch;
|
|
|
|
if (searchVal) {
|
|
|
|
if (searchVal) {
|
|
|
|
nodes.forEach(function (node) {
|
|
|
|
nodes.forEach(function (node) {
|
|
|
|
$(node).mark(searchVal, _this2.options);
|
|
|
|
$(node).mark(searchVal, _this2.options);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
return Mark_DataTables;
|
|
|
|
return MarkDataTables;
|
|
|
|
}();
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on("init.dt.dth", function (event, settings) {
|
|
|
|
$(document).on('init.dt.dth', function (event, settings) {
|
|
|
|
if (event.namespace !== "dt") {
|
|
|
|
if (event.namespace !== 'dt') {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var dtInstance = $.fn.dataTable.Api(settings);
|
|
|
|
var dtInstance = $.fn.dataTable.Api(settings);
|
|
|
|
|
|
|
|
|
|
|
|
var options = null;
|
|
|
|
var options = null;
|
|
|
|
if (dtInstance.init().mark) {
|
|
|
|
if (dtInstance.init().mark) {
|
|
|
|
options = dtInstance.init().mark;
|
|
|
|
options = dtInstance.init().mark;
|
|
|
|
} else if ($.fn.dataTable.defaults.mark) {
|
|
|
|
} else if ($.fn.dataTable.defaults.mark) {
|
|
|
|
options = $.fn.dataTable.defaults.mark;
|
|
|
|
options = $.fn.dataTable.defaults.mark;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (options === null) {
|
|
|
|
if (options === null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
new Mark_DataTables(dtInstance, options);
|
|
|
|
new MarkDataTables(dtInstance, options);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, window, document);
|
|
|
|
}, window, document);
|
|
|
|