mirror of
https://git.victorphan.net/basketballcantho/study4.git
synced 2026-08-16 18:16:01 +07:00
1 line
61 KiB
Plaintext
1 line
61 KiB
Plaintext
|
|
var APP=APP||{};APP.main=webpackJsonpAPP__name_([1],{208:function(t,e,n){"use strict";!function(t){var e="data-highlighted",n="data-timestamp",i={ELEMENT_NODE:1,TEXT_NODE:3},a=["SCRIPT","STYLE","SELECT","OPTION","BUTTON","OBJECT","APPLET","VIDEO","AUDIO","CANVAS","EMBED","PARAM","METER","PROGRESS"];function r(t,e){return s(t).color()===s(e).color()}function o(t,e){for(var n in t=t||{},e)e.hasOwnProperty(n)&&void 0===t[n]&&(t[n]=e[n]);return t}function l(t,e){t.sort(function(t,n){return s(e?n:t).parents().length-s(e?t:n).parents().length})}var s=function t(e){return{addClass:function(t){e.classList?e.classList.add(t):e.className+=" "+t},removeClass:function(t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t+"(\\b|$)","gi")," ")},prepend:function(t){for(var n=Array.prototype.slice.call(t),i=n.length;i--;)e.insertBefore(n[i],e.firstChild)},append:function(t){for(var n=Array.prototype.slice.call(t),i=0,a=n.length;i<a;++i)e.appendChild(n[i])},insertAfter:function(t){return t.parentNode.insertBefore(e,t.nextSibling)},insertBefore:function(t){if(t.parentNode)return t.parentNode.insertBefore(e,t)},remove:function(){e.parentNode&&e.parentNode.removeChild(e),e=null},contains:function(t){return e!==t&&e.contains(t)},wrap:function(t){return e.parentNode&&e.parentNode.insertBefore(t,e),t.appendChild(e),t},unwrap:function(){var n,i=Array.prototype.slice.call(e.childNodes);return i.forEach(function(e){n=e.parentNode,t(e).insertBefore(e.parentNode),t(n).remove()}),i},parents:function(){for(var t,n=[];t=e.parentNode;)n.push(t),e=t;return n},normalizeTextNodes:function(){if(e){if(e.nodeType===i.TEXT_NODE)for(;e.nextSibling&&e.nextSibling.nodeType===i.TEXT_NODE;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else t(e.firstChild).normalizeTextNodes();t(e.nextSibling).normalizeTextNodes()}},color:function(){return e.style.backgroundColor},fromHTML:function(t){var e=document.createElement("div");return e.innerHTML=t,e.childNodes},getRange:function(){var n,i=t(e).getSelection();return i.rangeCount>0&&(n=i.getRangeAt(0)),n},removeAllRanges:function(){t(e).getSelection().removeAllRanges()},removeRange:function(n){t(e).getSelection().removeRange(n)},getSelection:function(){return t(e).getWindow().getSelection()},getWindow:function(){return t(e).getDocument().defaultView},getDocument:function(){return e.ownerDocument||e}}};function c(t,e){if(!t)throw"Missing anchor element";var n,i;this.el=t,this.options=o(e,{color:"#ffff7b",underline:null,crossed:null,highlightedClass:"highlighted",contextClass:"highlighter-context",onRemoveHighlight:function(){return!0},onBeforeHighlight:function(){return!0},onAfterHighlight:function(){}}),s(this.el).addClass(this.options.contextClass),n=this.el,i=this,n.addEventListener("mouseup",i.highlightHandler.bind(i)),n.addEventListener("touchend",i.highlightHandler.bind(i)),n.addEventListener("touchcancel",i.highlightHandler.bind(i))}c.prototype.destroy=function(){var t,e;t=this.el,e=this,t.removeEventListener("mouseup",e.highlightHandler.bind(e)),t.removeEventListener("touchend",e.highlightHandler.bind(e)),t.removeEventListener("touchcancel",e.highlightHandler.bind(e)),s(this.el).removeClass(this.options.contextClass)},c.prototype.highlightHandler=function(t){2===t.detail?/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&this.doHighlight():this.doHighlight()},c.prototype.doHighlight=function(t){var e,i,a,r,o=s(this.el).getRange();o&&!o.collapsed&&!0===this.options.onBeforeHighlight(o)&&(r=+new Date,(e=c.createWrapper(this.options)).setAttribute(n,r),i=this.highlightRange(o,e),a=this.normalizeHighlights(i),this.options.onAfterHighlight(o,a,r),s(this.el).removeRange(o))},c.prototype.highlightRange=function(t,n){if(!t||t.collapsed)return[];var r,o,l,c=function(t){var e=t.startContainer,n=t.endContainer,a=t.commonAncestorContainer,r=!0;if(0===t.endOffset){for(;!n.previousSibling&&n.parentNode!==a;)n=n.parentNode;n=n.previousSibling}else n.nodeType===i.TEXT_NODE?t.endOffset<n.nodeValue.length&&n.splitText(t.endOf
|