From 893ce5777a57d6eed9e667634846dfcf6b4e8c0f Mon Sep 17 00:00:00 2001 From: Jillian Date: Tue, 10 Jan 2017 20:06:59 -0800 Subject: [PATCH] Removing mark.js and search highlighting. --- assets/css/datatables.mark.ABOUT | 12 - assets/css/datatables.mark.LICENSE | 21 -- assets/css/datatables.mark.css | 4 - assets/css/datatables.mark.min.css | 1 - assets/js/datatables.mark.ABOUT | 12 - assets/js/datatables.mark.LICENSE | 21 -- assets/js/datatables.mark.js | 113 ------- assets/js/datatables.mark.min.js | 7 - assets/js/jquery.mark.ABOUT | 12 - assets/js/jquery.mark.LICENSE | 21 -- assets/js/jquery.mark.js | 512 ----------------------------- assets/js/jquery.mark.min.js | 7 - assets/js/scancode.js | 1 - index.html | 3 - 14 files changed, 747 deletions(-) delete mode 100644 assets/css/datatables.mark.ABOUT delete mode 100644 assets/css/datatables.mark.LICENSE delete mode 100755 assets/css/datatables.mark.css delete mode 100755 assets/css/datatables.mark.min.css delete mode 100644 assets/js/datatables.mark.ABOUT delete mode 100644 assets/js/datatables.mark.LICENSE delete mode 100755 assets/js/datatables.mark.js delete mode 100755 assets/js/datatables.mark.min.js delete mode 100644 assets/js/jquery.mark.ABOUT delete mode 100644 assets/js/jquery.mark.LICENSE delete mode 100755 assets/js/jquery.mark.js delete mode 100755 assets/js/jquery.mark.min.js diff --git a/assets/css/datatables.mark.ABOUT b/assets/css/datatables.mark.ABOUT deleted file mode 100644 index c3a9f3a1..00000000 --- a/assets/css/datatables.mark.ABOUT +++ /dev/null @@ -1,12 +0,0 @@ -about_resource: datatables.mark.css -download_url: https://github.com/julmot/datatables.mark.js/releases/tag/v2.0.0 - -version: 2.0.0 -name: datatables.mark.js -home_url: https://github.com/julmot/datatables.mark.js -owner: Julian Motz -copyright: Copyright (c) 2016, Julian Motz - -license_url: https://raw.githubusercontent.com/julmot/datatables.mark.js/v2.0.0/LICENSE -dje_license: mit -license_text_file: datatables.mark.LICENSE \ No newline at end of file diff --git a/assets/css/datatables.mark.LICENSE b/assets/css/datatables.mark.LICENSE deleted file mode 100644 index 83133695..00000000 --- a/assets/css/datatables.mark.LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Julian Motz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/assets/css/datatables.mark.css b/assets/css/datatables.mark.css deleted file mode 100755 index b9e4e461..00000000 --- a/assets/css/datatables.mark.css +++ /dev/null @@ -1,4 +0,0 @@ -mark { - background: #EEFF41; - color: black; -} diff --git a/assets/css/datatables.mark.min.css b/assets/css/datatables.mark.min.css deleted file mode 100755 index 722870b7..00000000 --- a/assets/css/datatables.mark.min.css +++ /dev/null @@ -1 +0,0 @@ -mark{background:orange;color:black;} diff --git a/assets/js/datatables.mark.ABOUT b/assets/js/datatables.mark.ABOUT deleted file mode 100644 index 3b4145b7..00000000 --- a/assets/js/datatables.mark.ABOUT +++ /dev/null @@ -1,12 +0,0 @@ -about_resource: datatables.mark.js -download_url: https://github.com/julmot/datatables.mark.js/releases/tag/v2.0.0 - -version: 2.0.0 -name: datatables.mark.js -home_url: https://github.com/julmot/datatables.mark.js -owner: Julian Motz -copyright: Copyright (c) 2016, Julian Motz - -license_url: https://raw.githubusercontent.com/julmot/datatables.mark.js/v2.0.0/LICENSE -dje_license: mit -license_text_file: datatables.mark.LICENSE \ No newline at end of file diff --git a/assets/js/datatables.mark.LICENSE b/assets/js/datatables.mark.LICENSE deleted file mode 100644 index 83133695..00000000 --- a/assets/js/datatables.mark.LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Julian Motz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/assets/js/datatables.mark.js b/assets/js/datatables.mark.js deleted file mode 100755 index 29ec0c07..00000000 --- a/assets/js/datatables.mark.js +++ /dev/null @@ -1,113 +0,0 @@ -/*!*************************************************** - * 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"; - -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; }; - -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); - } -})(function (window, document, $) { - var Mark_DataTables = function () { - function Mark_DataTables(dtInstance, options) { - _classCallCheck(this, Mark_DataTables); - - 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(); - } - - _createClass(Mark_DataTables, [{ - 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 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; - }(); - - $(document).on("init.dt.dth", function (event, settings) { - if (event.namespace !== "dt") { - return; - } - - 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; - } - - new Mark_DataTables(dtInstance, options); - }); -}, window, document); diff --git a/assets/js/datatables.mark.min.js b/assets/js/datatables.mark.min.js deleted file mode 100755 index cf68e6f0..00000000 --- a/assets/js/datatables.mark.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*!*************************************************** - * 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 diff --git a/assets/js/jquery.mark.ABOUT b/assets/js/jquery.mark.ABOUT deleted file mode 100644 index 955ba8c5..00000000 --- a/assets/js/jquery.mark.ABOUT +++ /dev/null @@ -1,12 +0,0 @@ -about_resource: jquery.mark.js -download_url: https://github.com/julmot/datatables.mark.js/releases/tag/v7.0.0 - -version: 7.0.0 -name: mark.js -home_url: https://github.com/julmot/mark.js/tree/7.0.0 -owner: Julian Motz -copyright: Copyright (c) 2014–2016 Julian Motz - -license_url: https://raw.githubusercontent.com/julmot/mark.js/7.0.0/LICENSE -dje_license: mit -license_text_file: jquery.mark.LICENSE \ No newline at end of file diff --git a/assets/js/jquery.mark.LICENSE b/assets/js/jquery.mark.LICENSE deleted file mode 100644 index f0fccc37..00000000 --- a/assets/js/jquery.mark.LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014–2016 Julian Motz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/assets/js/jquery.mark.js b/assets/js/jquery.mark.js deleted file mode 100755 index 747eb48b..00000000 --- a/assets/js/jquery.mark.js +++ /dev/null @@ -1,512 +0,0 @@ -/*!*************************************************** - * mark.js v7.0.0 - * https://github.com/julmot/mark.js - * Copyright (c) 2014–2016, Julian Motz - * Released under the MIT license https://git.io/vwTVl - *****************************************************/ - -"use strict"; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -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; }; - -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"], function (jQuery) { - return factory(window, document, jQuery); - }); - } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object") { - factory(window, document, require("jquery")); - } else { - factory(window, document, jQuery); - } -})(function (window, document, $) { - var Mark = function () { - function Mark(ctx) { - _classCallCheck(this, Mark); - - this.ctx = ctx; - } - - _createClass(Mark, [{ - key: "log", - value: function log(msg) { - var level = arguments.length <= 1 || arguments[1] === undefined ? "debug" : arguments[1]; - - var log = this.opt.log; - if (!this.opt.debug) { - return; - } - if ((typeof log === "undefined" ? "undefined" : _typeof(log)) === "object" && typeof log[level] === "function") { - log[level]("mark.js: " + msg); - } - } - }, { - key: "escapeStr", - value: function escapeStr(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } - }, { - key: "createRegExp", - value: function createRegExp(str) { - str = this.escapeStr(str); - if (Object.keys(this.opt.synonyms).length) { - str = this.createSynonymsRegExp(str); - } - if (this.opt.diacritics) { - str = this.createDiacriticsRegExp(str); - } - str = this.createMergedBlanksRegExp(str); - str = this.createAccuracyRegExp(str); - return str; - } - }, { - key: "createSynonymsRegExp", - value: function createSynonymsRegExp(str) { - var syn = this.opt.synonyms; - for (var index in syn) { - if (syn.hasOwnProperty(index)) { - var value = syn[index], - k1 = this.escapeStr(index), - k2 = this.escapeStr(value); - str = str.replace(new RegExp("(" + k1 + "|" + k2 + ")", "gmi"), "(" + k1 + "|" + k2 + ")"); - } - } - return str; - } - }, { - key: "createDiacriticsRegExp", - value: function createDiacriticsRegExp(str) { - var dct = ["aÀÁÂÃÄÅàáâãäåĀāąĄ", "cÇçćĆčČ", "dđĐďĎ", "eÈÉÊËèéêëěĚĒēęĘ", "iÌÍÎÏìíîïĪī", "lłŁ", "nÑñňŇńŃ", "oÒÓÔÕÕÖØòóôõöøŌō", "rřŘ", "sŠšśŚ", "tťŤ", "uÙÚÛÜùúûüůŮŪū", "yŸÿýÝ", "zŽžżŻźŹ"]; - var handled = []; - str.split("").forEach(function (ch) { - dct.every(function (dct) { - if (dct.indexOf(ch) !== -1) { - if (handled.indexOf(dct) > -1) { - return false; - } - - str = str.replace(new RegExp("[" + dct + "]", "gmi"), "[" + dct + "]"); - handled.push(dct); - } - return true; - }); - }); - return str; - } - }, { - key: "createMergedBlanksRegExp", - value: function createMergedBlanksRegExp(str) { - return str.replace(/[\s]+/gmi, "[\\s]*"); - } - }, { - key: "createAccuracyRegExp", - value: function createAccuracyRegExp(str) { - var _this = this; - - var acc = this.opt.accuracy, - val = typeof acc === "string" ? acc : acc.value, - ls = typeof acc === "string" ? [] : acc.limiters, - lsJoin = ""; - ls.forEach(function (limiter) { - lsJoin += "|" + _this.escapeStr(limiter); - }); - switch (val) { - case "partially": - return "()(" + str + ")"; - case "complementary": - return "()([^\\s" + lsJoin + "]*" + str + "[^\\s" + lsJoin + "]*)"; - case "exactly": - return "(^|\\s" + lsJoin + ")(" + str + ")(?=$|\\s" + lsJoin + ")"; - } - } - }, { - key: "getSeparatedKeywords", - value: function getSeparatedKeywords(sv) { - var _this2 = this; - - var stack = []; - sv.forEach(function (kw) { - if (!_this2.opt.separateWordSearch) { - if (kw.trim()) { - stack.push(kw); - } - } else { - kw.split(" ").forEach(function (kwSplitted) { - if (kwSplitted.trim()) { - stack.push(kwSplitted); - } - }); - } - }); - return { - "keywords": stack, - "length": stack.length - }; - } - }, { - key: "getElements", - value: function getElements() { - var ctx = void 0, - stack = []; - if (typeof this.ctx === "undefined") { - ctx = []; - } else if (this.ctx instanceof HTMLElement) { - ctx = [this.ctx]; - } else if (Array.isArray(this.ctx)) { - ctx = this.ctx; - } else { - ctx = Array.prototype.slice.call(this.ctx); - } - ctx.forEach(function (ctx) { - stack.push(ctx); - var childs = ctx.querySelectorAll("*"); - if (childs.length) { - stack = stack.concat(Array.prototype.slice.call(childs)); - } - }); - if (!ctx.length) { - this.log("Empty context", "warn"); - } - return { - "elements": stack, - "length": stack.length - }; - } - }, { - key: "matches", - value: function matches(el, selector) { - return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); - } - }, { - key: "matchesExclude", - value: function matchesExclude(el, exclM) { - var _this3 = this; - - var remain = true; - var excl = this.opt.exclude.concat(["script", "style", "title"]); - if (!this.opt.iframes) { - excl = excl.concat(["iframe"]); - } - if (exclM) { - excl = excl.concat(["*[data-markjs='true']"]); - } - excl.every(function (sel) { - if (_this3.matches(el, sel)) { - return remain = false; - } - return true; - }); - return !remain; - } - }, { - key: "onIframeReady", - value: function onIframeReady(ifr, successFn, errorFn) { - try { - (function () { - var ifrWin = ifr.contentWindow, - bl = "about:blank", - compl = "complete"; - var callCallback = function callCallback() { - try { - if (ifrWin.document === null) { - throw new Error("iframe inaccessible"); - } - successFn(ifrWin.document); - } catch (e) { - errorFn(); - } - }; - var isBlank = function isBlank() { - var src = ifr.getAttribute("src").trim(), - href = ifrWin.location.href; - return href === bl && src !== bl && src; - }; - var observeOnload = function observeOnload() { - var listener = function listener() { - try { - if (!isBlank()) { - ifr.removeEventListener("load", listener); - callCallback(); - } - } catch (e) { - errorFn(); - } - }; - ifr.addEventListener("load", listener); - }; - if (ifrWin.document.readyState === compl) { - if (isBlank()) { - observeOnload(); - } else { - callCallback(); - } - } else { - observeOnload(); - } - })(); - } catch (e) { - errorFn(); - } - } - }, { - key: "forEachElementInIframe", - value: function forEachElementInIframe(ifr, cb) { - var _this4 = this; - - var end = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2]; - - var open = 0; - var checkEnd = function checkEnd() { - if (--open < 1) { - end(); - } - }; - this.onIframeReady(ifr, function (con) { - var stack = Array.prototype.slice.call(con.querySelectorAll("*")); - if ((open = stack.length) === 0) { - checkEnd(); - } - stack.forEach(function (el) { - if (el.tagName.toLowerCase() === "iframe") { - (function () { - var j = 0; - _this4.forEachElementInIframe(el, function (iel, len) { - cb(iel, len); - if (len - 1 === j) { - checkEnd(); - } - j++; - }, checkEnd); - })(); - } else { - cb(el, stack.length); - checkEnd(); - } - }); - }, function () { - var src = ifr.getAttribute("src"); - _this4.log("iframe '" + src + "' could not be accessed", "warn"); - checkEnd(); - }); - } - }, { - key: "forEachElement", - value: function forEachElement(cb) { - var _this5 = this; - - var end = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1]; - var exclM = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; - - var _getElements = this.getElements(); - - var stack = _getElements.elements; - var open = _getElements.length; - - var checkEnd = function checkEnd() { - if (--open === 0) { - end(); - } - }; - checkEnd(++open); - stack.forEach(function (el) { - if (!_this5.matchesExclude(el, exclM)) { - if (el.tagName.toLowerCase() === "iframe") { - _this5.forEachElementInIframe(el, function (iel) { - if (!_this5.matchesExclude(iel, exclM)) { - cb(iel); - } - }, checkEnd); - return; - } else { - cb(el); - } - } - checkEnd(); - }); - } - }, { - key: "forEachNode", - value: function forEachNode(cb) { - var end = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1]; - - this.forEachElement(function (n) { - for (n = n.firstChild; n; n = n.nextSibling) { - if (n.nodeType === 3 && n.textContent.trim()) { - cb(n); - } - } - }, end); - } - }, { - key: "wrapMatches", - value: function wrapMatches(node, regex, custom, filterCb, eachCb) { - var hEl = !this.opt.element ? "mark" : this.opt.element, - index = custom ? 0 : 2; - var match = void 0; - while ((match = regex.exec(node.textContent)) !== null) { - if (!filterCb(match[index])) { - continue; - } - - var pos = match.index; - if (!custom) { - pos += match[index - 1].length; - } - var startNode = node.splitText(pos); - - node = startNode.splitText(match[index].length); - if (startNode.parentNode !== null) { - var repl = document.createElement(hEl); - repl.setAttribute("data-markjs", "true"); - if (this.opt.className) { - repl.setAttribute("class", this.opt.className); - } - repl.textContent = match[index]; - startNode.parentNode.replaceChild(repl, startNode); - eachCb(repl); - } - regex.lastIndex = 0; - } - } - }, { - key: "unwrapMatches", - value: function unwrapMatches(node) { - var parent = node.parentNode; - var docFrag = document.createDocumentFragment(); - while (node.firstChild) { - docFrag.appendChild(node.removeChild(node.firstChild)); - } - parent.replaceChild(docFrag, node); - parent.normalize(); - } - }, { - key: "markRegExp", - value: function markRegExp(regexp, opt) { - var _this6 = this; - - this.opt = opt; - this.log("Searching with expression \"" + regexp + "\""); - var totalMatches = 0; - var eachCb = function eachCb(element) { - totalMatches++; - _this6.opt.each(element); - }; - this.forEachNode(function (node) { - _this6.wrapMatches(node, regexp, true, function (match) { - return _this6.opt.filter(node, match, totalMatches); - }, eachCb); - }, function () { - if (totalMatches === 0) { - _this6.opt.noMatch(regexp); - } - _this6.opt.done(totalMatches); - }); - } - }, { - key: "mark", - value: function mark(sv, opt) { - var _this7 = this; - - this.opt = opt; - - var _getSeparatedKeywords = this.getSeparatedKeywords(typeof sv === "string" ? [sv] : sv); - - var kwArr = _getSeparatedKeywords.keywords; - var kwArrLen = _getSeparatedKeywords.length; - - var totalMatches = 0; - if (kwArrLen === 0) { - this.opt.done(totalMatches); - } - kwArr.forEach(function (kw) { - var regex = new RegExp(_this7.createRegExp(kw), "gmi"), - matches = 0; - var eachCb = function eachCb(element) { - matches++; - totalMatches++; - _this7.opt.each(element); - }; - _this7.log("Searching with expression \"" + regex + "\""); - _this7.forEachNode(function (node) { - _this7.wrapMatches(node, regex, false, function () { - return _this7.opt.filter(node, kw, matches, totalMatches); - }, eachCb); - }, function () { - if (matches === 0) { - _this7.opt.noMatch(kw); - } - if (kwArr[kwArrLen - 1] === kw) { - _this7.opt.done(totalMatches); - } - }); - }); - } - }, { - key: "unmark", - value: function unmark(opt) { - var _this8 = this; - - this.opt = opt; - var sel = this.opt.element ? this.opt.element : "*"; - sel += "[data-markjs]"; - if (this.opt.className) { - sel += "." + this.opt.className; - } - this.log("Removal selector \"" + sel + "\""); - this.forEachElement(function (el) { - if (_this8.matches(el, sel)) { - _this8.unwrapMatches(el); - } - }, function () { - _this8.opt.done(); - }, false); - } - }, { - key: "opt", - set: function set(val) { - this._opt = _extends({}, { - "element": "", - "className": "", - "exclude": [], - "iframes": false, - "separateWordSearch": true, - "diacritics": true, - "synonyms": {}, - "accuracy": "partially", - "each": function each() {}, - "noMatch": function noMatch() {}, - "filter": function filter() { - return true; - }, - "done": function done() {}, - "debug": false, - "log": window.console - }, val); - }, - get: function get() { - return this._opt; - } - }]); - - return Mark; - }(); - - $.fn.mark = function (sv, opt) { - new Mark(this).mark(sv, opt); - return this; - }; - $.fn.markRegExp = function (regexp, opt) { - new Mark(this).markRegExp(regexp, opt); - return this; - }; - $.fn.unmark = function (opt) { - new Mark(this).unmark(opt); - return this; - }; -}, window, document); diff --git a/assets/js/jquery.mark.min.js b/assets/js/jquery.mark.min.js deleted file mode 100755 index 32fb0f50..00000000 --- a/assets/js/jquery.mark.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*!*************************************************** - * mark.js v7.0.0 - * https://github.com/julmot/mark.js - * Copyright (c) 2014–2016, Julian Motz - * Released under the MIT license https://git.io/vwTVl - *****************************************************/ -"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var _extends=Object.assign||function(a){for(var b=1;b-1)return!1;a=a.replace(new RegExp("["+b+"]","gmi"),"["+b+"]"),c.push(b)}return!0})}),a}},{key:"createMergedBlanksRegExp",value:function(a){return a.replace(/[\s]+/gim,"[\\s]*")}},{key:"createAccuracyRegExp",value:function(a){var b=this,c=this.opt.accuracy,d="string"==typeof c?c:c.value,e="string"==typeof c?[]:c.limiters,f="";switch(e.forEach(function(a){f+="|"+b.escapeStr(a)}),d){case"partially":return"()("+a+")";case"complementary":return"()([^\\s"+f+"]*"+a+"[^\\s"+f+"]*)";case"exactly":return"(^|\\s"+f+")("+a+")(?=$|\\s"+f+")"}}},{key:"getSeparatedKeywords",value:function(a){var b=this,c=[];return a.forEach(function(a){b.opt.separateWordSearch?a.split(" ").forEach(function(a){a.trim()&&c.push(a)}):a.trim()&&c.push(a)}),{keywords:c,length:c.length}}},{key:"getElements",value:function(){var a=void 0,b=[];return a="undefined"==typeof this.ctx?[]:this.ctx instanceof HTMLElement?[this.ctx]:Array.isArray(this.ctx)?this.ctx:Array.prototype.slice.call(this.ctx),a.forEach(function(a){b.push(a);var c=a.querySelectorAll("*");c.length&&(b=b.concat(Array.prototype.slice.call(c)))}),a.length||this.log("Empty context","warn"),{elements:b,length:b.length}}},{key:"matches",value:function(a,b){return(a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector).call(a,b)}},{key:"matchesExclude",value:function(a,b){var c=this,d=!0,e=this.opt.exclude.concat(["script","style","title"]);return this.opt.iframes||(e=e.concat(["iframe"])),b&&(e=e.concat(["*[data-markjs='true']"])),e.every(function(b){return c.matches(a,b)?d=!1:!0}),!d}},{key:"onIframeReady",value:function(a,b,c){try{!function(){var d=a.contentWindow,e="about:blank",f="complete",g=function(){try{if(null===d.document)throw new Error("iframe inaccessible");b(d.document)}catch(a){c()}},h=function(){var b=a.getAttribute("src").trim(),c=d.location.href;return c===e&&b!==e&&b},i=function(){var b=function b(){try{h()||(a.removeEventListener("load",b),g())}catch(a){c()}};a.addEventListener("load",b)};d.document.readyState===f?h()?i():g():i()}()}catch(a){c()}}},{key:"forEachElementInIframe",value:function(a,b){var c=this,d=arguments.length<=2||void 0===arguments[2]?function(){}:arguments[2],e=0,f=function(){--e<1&&d()};this.onIframeReady(a,function(a){var d=Array.prototype.slice.call(a.querySelectorAll("*"));0===(e=d.length)&&f(),d.forEach(function(a){"iframe"===a.tagName.toLowerCase()?!function(){var d=0;c.forEachElementInIframe(a,function(a,c){b(a,c),c-1===d&&f(),d++},f)}():(b(a,d.length),f())})},function(){var b=a.getAttribute("src");c.log("iframe '"+b+"' could not be accessed","warn"),f()})}},{key:"forEachElement",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]?function(){}:arguments[1],d=arguments.length<=2||void 0===arguments[2]?!0:arguments[2],e=this.getElements(),f=e.elements,g=e.length,h=function(){0===--g&&c()};h(++g),f.forEach(function(c){if(!b.matchesExclude(c,d)){if("iframe"===c.tagName.toLowerCase())return void b.forEachElementInIframe(c,function(c){b.matchesExclude(c,d)||a(c)},h);a(c)}h()})}},{key:"forEachNode",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?function(){}:arguments[1];this.forEachElement(function(b){for(b=b.firstChild;b;b=b.nextSibling)3===b.nodeType&&b.textContent.trim()&&a(b)},b)}},{key:"wrapMatches",value:function(a,c,d,e,f){for(var g=this.opt.element?this.opt.element:"mark",h=d?0:2,i=void 0;null!==(i=c.exec(a.textContent));)if(e(i[h])){var j=i.index;d||(j+=i[h-1].length);var k=a.splitText(j);if(a=k.splitText(i[h].length),null!==k.parentNode){var l=b.createElement(g);l.setAttribute("data-markjs","true"),this.opt.className&&l.setAttribute("class",this.opt.className),l.textContent=i[h],k.parentNode.replaceChild(l,k),f(l)}c.lastIndex=0}}},{key:"unwrapMatches",value:function(a){for(var c=a.parentNode,d=b.createDocumentFragment();a.firstChild;)d.appendChild(a.removeChild(a.firstChild));c.replaceChild(d,a),c.normalize()}},{key:"markRegExp",value:function(a,b){var c=this;this.opt=b,this.log('Searching with expression "'+a+'"');var d=0,e=function(a){d++,c.opt.each(a)};this.forEachNode(function(b){c.wrapMatches(b,a,!0,function(a){return c.opt.filter(b,a,d)},e)},function(){0===d&&c.opt.noMatch(a),c.opt.done(d)})}},{key:"mark",value:function(a,b){var c=this;this.opt=b;var d=this.getSeparatedKeywords("string"==typeof a?[a]:a),e=d.keywords,f=d.length,g=0;0===f&&this.opt.done(g),e.forEach(function(a){var b=new RegExp(c.createRegExp(a),"gmi"),d=0,h=function(a){d++,g++,c.opt.each(a)};c.log('Searching with expression "'+b+'"'),c.forEachNode(function(e){c.wrapMatches(e,b,!1,function(){return c.opt.filter(e,a,d,g)},h)},function(){0===d&&c.opt.noMatch(a),e[f-1]===a&&c.opt.done(g)})})}},{key:"unmark",value:function(a){var b=this;this.opt=a;var c=this.opt.element?this.opt.element:"*";c+="[data-markjs]",this.opt.className&&(c+="."+this.opt.className),this.log('Removal selector "'+c+'"'),this.forEachElement(function(a){b.matches(a,c)&&b.unwrapMatches(a)},function(){b.opt.done()},!1)}},{key:"opt",set:function(b){this._opt=_extends({},{element:"",className:"",exclude:[],iframes:!1,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:a.console},b)},get:function(){return this._opt}}]),c}();c.fn.mark=function(a,b){return new d(this).mark(a,b),this},c.fn.markRegExp=function(a,b){return new d(this).markRegExp(a,b),this},c.fn.unmark=function(a){return new d(this).unmark(a),this}},window,document); \ No newline at end of file diff --git a/assets/js/scancode.js b/assets/js/scancode.js index 9162c05e..31d7b2fd 100644 --- a/assets/js/scancode.js +++ b/assets/js/scancode.js @@ -317,7 +317,6 @@ $(document).ready(function () { "paging": false, "info": false, "colReorder": true, - "mark": true, "ajax": { url: './samples/sample-data.json', // loading json data dataType: 'json', diff --git a/index.html b/index.html index ca58baa0..423e8787 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,6 @@ - @@ -49,8 +48,6 @@ - -