From 7dcec0a53a12134a4e25079b99ff5c764bcb542b Mon Sep 17 00:00:00 2001 From: Julian Motz Date: Thu, 14 Sep 2017 13:09:15 +0200 Subject: [PATCH] Update datatables.mark.js to v2.0.1 --- features/mark.js/datatables.mark.css | 4 +- features/mark.js/datatables.mark.es6.js | 163 ++++++++--------- features/mark.js/datatables.mark.es6.min.js | 14 +- features/mark.js/datatables.mark.js | 189 ++++++++++---------- features/mark.js/datatables.mark.min.js | 14 +- 5 files changed, 193 insertions(+), 191 deletions(-) diff --git a/features/mark.js/datatables.mark.css b/features/mark.js/datatables.mark.css index c11a41e..aa5eaaa 100644 --- a/features/mark.js/datatables.mark.css +++ b/features/mark.js/datatables.mark.css @@ -1,4 +1,4 @@ mark { - background: orange; - color: black; + background: orange; + color: black; } diff --git a/features/mark.js/datatables.mark.es6.js b/features/mark.js/datatables.mark.es6.js index c10a2b5..813bb6e 100644 --- a/features/mark.js/datatables.mark.es6.js +++ b/features/mark.js/datatables.mark.es6.js @@ -1,96 +1,97 @@ -/*!*************************************************** - * datatables.mark.js v2.0.0 - * https://github.com/julmot/datatables.mark.js - * Copyright (c) 2016, Julian Motz - * Released under the MIT license https://git.io/voRZ7 - *****************************************************/ +/*!*************************************************** + * datatables.mark.js v2.0.1 + * https://github.com/julmot/datatables.mark.js + * Copyright (c) 2016–2017, Julian Motz + * Released under the MIT license https://git.io/voRZ7 + *****************************************************/ -"use strict"; +'use strict'; ((factory, window, document) => { - if (typeof define === "function" && define.amd) { - define(["jquery", "datatables.net", "markjs"], jQuery => { - return factory(window, document, jQuery); - }); - } else if (typeof exports === "object") { - require("datatables.net"); - require("markjs"); - factory(window, document, require("jquery")); - } else { - factory(window, document, jQuery); - } + if (typeof exports === 'object') { + const jquery = require('jquery'); + require('datatables.net'); + require('mark.js/dist/jquery.mark.js'); + module.exports = factory(window, document, jquery); + } else if (typeof define === 'function' && define.amd) { + define(['jquery', 'datatables.net', 'markjs'], jQuery => { + return factory(window, document, jQuery); + }); + } else { + factory(window, document, jQuery); + } })((window, document, $) => { - class Mark_DataTables { - constructor(dtInstance, options) { - if (typeof $.fn.mark !== "function" || typeof $.fn.unmark !== "function") { - throw new Error("jquery.mark.js is necessary for datatables.mark.js"); - } - this.instance = dtInstance; - this.options = typeof options === "object" ? options : {}; - this.intervalThreshold = 49; - this.intervalMs = 300; - this.initMarkListener(); - } + class MarkDataTables { + constructor(dtInstance, options) { + if (!$.fn.mark || !$.fn.unmark) { + throw new Error('jquery.mark.js is necessary for datatables.mark.js'); + } + this.instance = dtInstance; + this.options = typeof options === 'object' ? options : {}; + this.intervalThreshold = 49; + this.intervalMs = 300; + this.initMarkListener(); + } - initMarkListener() { - const ev = "draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth"; - let intvl = null; - this.instance.on(ev, () => { - const rows = this.instance.rows({ - filter: "applied", - page: "current" - }).nodes().length; - if (rows > this.intervalThreshold) { - clearTimeout(intvl); - intvl = setTimeout(() => { - this.mark(); - }, this.intervalMs); - } else { - this.mark(); - } - }); - this.instance.on("destroy", () => { - this.instance.off(ev); - }); + initMarkListener() { + const ev = 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth'; + let intvl = null; + this.instance.on(ev, () => { + const rows = this.instance.rows({ + filter: 'applied', + page: 'current' + }).nodes().length; + if (rows > this.intervalThreshold) { + clearTimeout(intvl); + intvl = setTimeout(() => { this.mark(); + }, this.intervalMs); + } else { + this.mark(); } + }); + this.instance.on('destroy', () => { + this.instance.off(ev); + }); + this.mark(); + } - mark() { - const globalSearch = this.instance.search(); - $(this.instance.table().body()).unmark(this.options); - this.instance.columns({ - search: "applied", - page: "current" - }).nodes().each((nodes, colIndex) => { - const columnSearch = this.instance.column(colIndex).search(), - searchVal = columnSearch || globalSearch; - if (searchVal) { - nodes.forEach(node => { - $(node).mark(searchVal, this.options); - }); - } - }); + mark() { + const globalSearch = this.instance.search(); + $(this.instance.table().body()).unmark(this.options); + this.instance.columns({ + search: 'applied', + page: 'current' + }).nodes().each((nodes, colIndex) => { + const columnSearch = this.instance.column(colIndex).search(), + searchVal = columnSearch || globalSearch; + if (searchVal) { + nodes.forEach(node => { + $(node).mark(searchVal, this.options); + }); } - + }); } - $(document).on("init.dt.dth", (event, settings) => { - if (event.namespace !== "dt") { - return; - } + } - const dtInstance = $.fn.dataTable.Api(settings); + $(document).on('init.dt.dth', (event, settings) => { + if (event.namespace !== 'dt') { + return; + } - let options = null; - if (dtInstance.init().mark) { - options = dtInstance.init().mark; - } else if ($.fn.dataTable.defaults.mark) { - options = $.fn.dataTable.defaults.mark; - } - if (options === null) { - return; - } + const dtInstance = $.fn.dataTable.Api(settings); - new Mark_DataTables(dtInstance, options); - }); + let options = null; + if (dtInstance.init().mark) { + options = dtInstance.init().mark; + } else if ($.fn.dataTable.defaults.mark) { + options = $.fn.dataTable.defaults.mark; + } + if (options === null) { + return; + } + + new MarkDataTables(dtInstance, options); + }); }, window, document); diff --git a/features/mark.js/datatables.mark.es6.min.js b/features/mark.js/datatables.mark.es6.min.js index dadd6fa..f9a7fc5 100644 --- a/features/mark.js/datatables.mark.es6.min.js +++ b/features/mark.js/datatables.mark.es6.min.js @@ -1,7 +1,7 @@ -/*!*************************************************** - * datatables.mark.js v2.0.0 - * https://github.com/julmot/datatables.mark.js - * Copyright (c) 2016, Julian Motz - * Released under the MIT license https://git.io/voRZ7 - *****************************************************/ -"use strict";((factory,window,document)=>{if(typeof define==="function"&&define.amd){define(["jquery","datatables.net","markjs"],jQuery=>{return factory(window,document,jQuery);});}else if(typeof exports==="object"){require("datatables.net");require("markjs");factory(window,document,require("jquery"));}else{factory(window,document,jQuery);}})((window,document,$)=>{class Mark_DataTables{constructor(dtInstance,options){if(typeof $.fn.mark!=="function"||typeof $.fn.unmark!=="function"){throw new Error("jquery.mark.js is necessary for datatables.mark.js");}this.instance=dtInstance;this.options=typeof options==="object"?options:{};this.intervalThreshold=49;this.intervalMs=300;this.initMarkListener();}initMarkListener(){const ev="draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth";let intvl=null;this.instance.on(ev,()=>{const rows=this.instance.rows({filter:"applied",page:"current"}).nodes().length;if(rows>this.intervalThreshold){clearTimeout(intvl);intvl=setTimeout(()=>{this.mark();},this.intervalMs);}else{this.mark();}});this.instance.on("destroy",()=>{this.instance.off(ev);});this.mark();}mark(){const globalSearch=this.instance.search();$(this.instance.table().body()).unmark(this.options);this.instance.columns({search:"applied",page:"current"}).nodes().each((nodes,colIndex)=>{const columnSearch=this.instance.column(colIndex).search(),searchVal=columnSearch||globalSearch;if(searchVal){nodes.forEach(node=>{$(node).mark(searchVal,this.options);});}});}}$(document).on("init.dt.dth",(event,settings)=>{if(event.namespace!=="dt"){return;}const dtInstance=$.fn.dataTable.Api(settings);let options=null;if(dtInstance.init().mark){options=dtInstance.init().mark;}else if($.fn.dataTable.defaults.mark){options=$.fn.dataTable.defaults.mark;}if(options===null){return;}new Mark_DataTables(dtInstance,options);});},window,document); +/*!*************************************************** + * datatables.mark.js v2.0.1 + * https://github.com/julmot/datatables.mark.js + * Copyright (c) 2016–2017, Julian Motz + * Released under the MIT license https://git.io/voRZ7 + *****************************************************/ +'use strict';((factory,window,document)=>{if(typeof exports==='object'){const jquery=require('jquery');require('datatables.net');require('mark.js/dist/jquery.mark.js');module.exports=factory(window,document,jquery);}else if(typeof define==='function'&&define.amd){define(['jquery','datatables.net','markjs'],jQuery=>{return factory(window,document,jQuery);});}else{factory(window,document,jQuery);}})((window,document,$)=>{class MarkDataTables{constructor(dtInstance,options){if(!$.fn.mark||!$.fn.unmark){throw new Error('jquery.mark.js is necessary for datatables.mark.js');}this.instance=dtInstance;this.options=typeof options==='object'?options:{};this.intervalThreshold=49;this.intervalMs=300;this.initMarkListener();}initMarkListener(){const ev='draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth';let intvl=null;this.instance.on(ev,()=>{const rows=this.instance.rows({filter:'applied',page:'current'}).nodes().length;if(rows>this.intervalThreshold){clearTimeout(intvl);intvl=setTimeout(()=>{this.mark();},this.intervalMs);}else{this.mark();}});this.instance.on('destroy',()=>{this.instance.off(ev);});this.mark();}mark(){const globalSearch=this.instance.search();$(this.instance.table().body()).unmark(this.options);this.instance.columns({search:'applied',page:'current'}).nodes().each((nodes,colIndex)=>{const columnSearch=this.instance.column(colIndex).search(),searchVal=columnSearch||globalSearch;if(searchVal){nodes.forEach(node=>{$(node).mark(searchVal,this.options);});}});}}$(document).on('init.dt.dth',(event,settings)=>{if(event.namespace!=='dt'){return;}const dtInstance=$.fn.dataTable.Api(settings);let options=null;if(dtInstance.init().mark){options=dtInstance.init().mark;}else if($.fn.dataTable.defaults.mark){options=$.fn.dataTable.defaults.mark;}if(options===null){return;}new MarkDataTables(dtInstance,options);});},window,document); diff --git a/features/mark.js/datatables.mark.js b/features/mark.js/datatables.mark.js index 29ec0c0..4f4f41a 100644 --- a/features/mark.js/datatables.mark.js +++ b/features/mark.js/datatables.mark.js @@ -1,113 +1,114 @@ -/*!*************************************************** - * datatables.mark.js v2.0.0 - * https://github.com/julmot/datatables.mark.js - * Copyright (c) 2016, Julian Motz - * Released under the MIT license https://git.io/voRZ7 - *****************************************************/ +/*!*************************************************** + * datatables.mark.js v2.0.1 + * https://github.com/julmot/datatables.mark.js + * Copyright (c) 2016–2017, Julian Motz + * 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 _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 (factory, window, document) { - if (typeof define === "function" && define.amd) { - define(["jquery", "datatables.net", "markjs"], function (jQuery) { - return factory(window, document, jQuery); - }); - } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object") { - require("datatables.net"); - require("markjs"); - factory(window, document, require("jquery")); - } else { - factory(window, document, jQuery); - } + if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') { + var jquery = require('jquery'); + require('datatables.net'); + require('mark.js/dist/jquery.mark.js'); + module.exports = factory(window, document, jquery); + } else if (typeof define === 'function' && define.amd) { + define(['jquery', 'datatables.net', 'markjs'], function (jQuery) { + return factory(window, document, jQuery); + }); + } else { + factory(window, document, jQuery); + } })(function (window, document, $) { - var Mark_DataTables = function () { - function Mark_DataTables(dtInstance, options) { - _classCallCheck(this, Mark_DataTables); + var MarkDataTables = function () { + function MarkDataTables(dtInstance, options) { + _classCallCheck(this, MarkDataTables); - if (typeof $.fn.mark !== "function" || typeof $.fn.unmark !== "function") { - throw new Error("jquery.mark.js is necessary for datatables.mark.js"); - } - this.instance = dtInstance; - this.options = (typeof options === "undefined" ? "undefined" : _typeof(options)) === "object" ? options : {}; - this.intervalThreshold = 49; - this.intervalMs = 300; - this.initMarkListener(); - } + if (!$.fn.mark || !$.fn.unmark) { + throw new Error('jquery.mark.js is necessary for datatables.mark.js'); + } + this.instance = dtInstance; + this.options = (typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' ? options : {}; + this.intervalThreshold = 49; + this.intervalMs = 300; + this.initMarkListener(); + } - _createClass(Mark_DataTables, [{ - key: "initMarkListener", - value: function initMarkListener() { - var _this = this; + _createClass(MarkDataTables, [{ + key: 'initMarkListener', + value: function initMarkListener() { + var _this = this; - var ev = "draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth"; - var intvl = null; - this.instance.on(ev, function () { - var rows = _this.instance.rows({ - filter: "applied", - page: "current" - }).nodes().length; - if (rows > _this.intervalThreshold) { - clearTimeout(intvl); - intvl = setTimeout(function () { - _this.mark(); - }, _this.intervalMs); - } else { - _this.mark(); - } - }); - this.instance.on("destroy", function () { - _this.instance.off(ev); - }); - this.mark(); - } - }, { - key: "mark", - value: function mark() { - var _this2 = this; + var ev = 'draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth'; + var intvl = null; + this.instance.on(ev, function () { + var rows = _this.instance.rows({ + filter: 'applied', + page: 'current' + }).nodes().length; + if (rows > _this.intervalThreshold) { + clearTimeout(intvl); + intvl = setTimeout(function () { + _this.mark(); + }, _this.intervalMs); + } else { + _this.mark(); + } + }); + this.instance.on('destroy', function () { + _this.instance.off(ev); + }); + this.mark(); + } + }, { + key: 'mark', + value: function mark() { + var _this2 = this; - var globalSearch = this.instance.search(); - $(this.instance.table().body()).unmark(this.options); - this.instance.columns({ - search: "applied", - page: "current" - }).nodes().each(function (nodes, colIndex) { - var columnSearch = _this2.instance.column(colIndex).search(), - searchVal = columnSearch || globalSearch; - if (searchVal) { - nodes.forEach(function (node) { - $(node).mark(searchVal, _this2.options); - }); - } - }); - } - }]); + var globalSearch = this.instance.search(); + $(this.instance.table().body()).unmark(this.options); + this.instance.columns({ + search: 'applied', + page: 'current' + }).nodes().each(function (nodes, colIndex) { + var columnSearch = _this2.instance.column(colIndex).search(), + searchVal = columnSearch || globalSearch; + if (searchVal) { + nodes.forEach(function (node) { + $(node).mark(searchVal, _this2.options); + }); + } + }); + } + }]); - return Mark_DataTables; - }(); + return MarkDataTables; + }(); - $(document).on("init.dt.dth", function (event, settings) { - if (event.namespace !== "dt") { - return; - } + $(document).on('init.dt.dth', function (event, settings) { + if (event.namespace !== 'dt') { + return; + } - var dtInstance = $.fn.dataTable.Api(settings); + var dtInstance = $.fn.dataTable.Api(settings); - var options = null; - if (dtInstance.init().mark) { - options = dtInstance.init().mark; - } else if ($.fn.dataTable.defaults.mark) { - options = $.fn.dataTable.defaults.mark; - } - if (options === null) { - return; - } + var options = null; + if (dtInstance.init().mark) { + options = dtInstance.init().mark; + } else if ($.fn.dataTable.defaults.mark) { + options = $.fn.dataTable.defaults.mark; + } + if (options === null) { + return; + } - new Mark_DataTables(dtInstance, options); - }); + new MarkDataTables(dtInstance, options); + }); }, window, document); diff --git a/features/mark.js/datatables.mark.min.js b/features/mark.js/datatables.mark.min.js index cf68e6f..4edde4b 100644 --- a/features/mark.js/datatables.mark.min.js +++ b/features/mark.js/datatables.mark.min.js @@ -1,7 +1,7 @@ -/*!*************************************************** - * datatables.mark.js v2.0.0 - * https://github.com/julmot/datatables.mark.js - * Copyright (c) 2016, Julian Motz - * Released under the MIT license https://git.io/voRZ7 - *****************************************************/ -"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function a(a,b){for(var c=0;ca.intervalThreshold?(clearTimeout(c),c=setTimeout(function(){a.mark()},a.intervalMs)):a.mark()}),this.instance.on("destroy",function(){a.instance.off(b)}),this.mark()}},{key:"mark",value:function(){var a=this,b=this.instance.search();c(this.instance.table().body()).unmark(this.options),this.instance.columns({search:"applied",page:"current"}).nodes().each(function(d,e){var f=a.instance.column(e).search(),g=f||b;g&&d.forEach(function(b){c(b).mark(g,a.options)})})}}]),a}();c(b).on("init.dt.dth",function(a,b){if("dt"===a.namespace){var e=c.fn.dataTable.Api(b),f=null;e.init().mark?f=e.init().mark:c.fn.dataTable.defaults.mark&&(f=c.fn.dataTable.defaults.mark),null!==f&&new d(e,f)}})},window,document); \ No newline at end of file +/*!*************************************************** + * datatables.mark.js v2.0.1 + * https://github.com/julmot/datatables.mark.js + * Copyright (c) 2016–2017, Julian Motz + * Released under the MIT license https://git.io/voRZ7 + *****************************************************/ +"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;ne.intervalThreshold?(clearTimeout(n),n=setTimeout(function(){e.mark()},e.intervalMs)):e.mark()}),this.instance.on("destroy",function(){e.instance.off(t)}),this.mark()}},{key:"mark",value:function(){var e=this,t=this.instance.search();n(this.instance.table().body()).unmark(this.options),this.instance.columns({search:"applied",page:"current"}).nodes().each(function(r,a){var i=e.instance.column(a).search()||t;i&&r.forEach(function(t){n(t).mark(i,e.options)})})}}]),e}();n(t).on("init.dt.dth",function(e,t){if("dt"===e.namespace){var a=n.fn.dataTable.Api(t),i=null;a.init().mark?i=a.init().mark:n.fn.dataTable.defaults.mark&&(i=n.fn.dataTable.defaults.mark),null!==i&&new r(a,i)}})},window,document); \ No newline at end of file