/var/www/html/pure_test/txt_0.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_1.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_2.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_3.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_4.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_5.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_6.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_7.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_8.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_9.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_10.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_11.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_12.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_13.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_14.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_15.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_16.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_17.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_18.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_19.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_20.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_21.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_22.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_23.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_24.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_25.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_26.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_27.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_28.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_29.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_30.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_31.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_32.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_33.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_34.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_35.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_36.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_37.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_38.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_39.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_40.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_41.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_42.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_43.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_44.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_45.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_46.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_47.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_48.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_49.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_50.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_51.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_52.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_53.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_54.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_55.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_56.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_57.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_58.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_59.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_60.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_61.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_62.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_63.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_64.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_65.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_66.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_67.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_68.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_69.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_70.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_71.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_72.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_73.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_74.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_75.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_76.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_77.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_78.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_79.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_80.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_81.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_82.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_83.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_84.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_85.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_86.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_87.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_88.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_89.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_90.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_91.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_92.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_93.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_94.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_95.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_96.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_97.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_98.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_99.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_100.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_101.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_102.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_103.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_104.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_105.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_106.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_107.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_108.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_109.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_110.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_111.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_112.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_113.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_114.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_115.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_116.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_117.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_118.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_119.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_120.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_121.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_122.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_123.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_124.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_125.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_126.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_127.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_128.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_129.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_130.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_131.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_132.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_133.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_134.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_135.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_136.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_137.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_138.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_139.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_140.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_141.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_142.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_143.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_144.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_145.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_146.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_147.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_148.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_149.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_150.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_151.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_152.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_153.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_154.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_155.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_156.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_157.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_158.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_159.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_160.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_161.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_162.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_163.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_164.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_165.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_166.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_167.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_168.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_169.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_170.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_171.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_172.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_173.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_174.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_175.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_176.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_177.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_178.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_179.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_180.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_181.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_182.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_183.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_184.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_185.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_186.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_187.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_188.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_189.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_190.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_191.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_192.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_193.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_194.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_195.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_196.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_197.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_198.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_199.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_200.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_201.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_202.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_203.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_204.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_205.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_206.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_207.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_208.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_209.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_210.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_211.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_212.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_213.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_214.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_215.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_216.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_217.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_218.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_219.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_220.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_221.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_222.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_223.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_224.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_225.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_226.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_227.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_228.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_229.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_230.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_231.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_232.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_233.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_234.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_235.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_236.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_237.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_238.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_239.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_240.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_241.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_242.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_243.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_244.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_245.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_246.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_247.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_248.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_249.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_250.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_251.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_252.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_253.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_254.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_255.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_256.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_257.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_258.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_259.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_260.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_261.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_262.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_263.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_264.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_265.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_266.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_267.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_268.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_269.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_270.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_271.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_272.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_273.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_274.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_275.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_276.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_277.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_278.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_279.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_280.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_281.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_282.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_283.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_284.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_285.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_286.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_287.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_288.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_289.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_290.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_291.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_292.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_293.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_294.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_295.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_296.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_297.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_298.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900
/var/www/html/pure_test/txt_299.js
Modify: 1626388206
import EventEmitter from './EventEmitter';
import BrowserDetector from '../Detector/BrowserDetector';
import OOP from "./OOP";
/***
* @augments Node
* @augments ChildNode
* @augments ParentNode
* @augments Element
* @augments HTMLElement
* @augments EventEmitter
* @augments ElementCSSInlineStyle
* @constructor
*/
function AElement() {
EventEmitter.call(this);
this._azar_extendAttributes = this._azar_extendAttributes || {};
this._azar_extendTags = {};
this.eventHandler = {};
}
OOP.mixClass(AElement, EventEmitter);
AElement.prototype.init = function (props) {
Object.assign(this, props || {});
};
AElement.prototype.eventHandler = {};
/***
* run super-class method
*/
AElement.prototype.super = function () {/* nope */
};
/**
* @typedef {Object} AttributeDefiner
* @property {Function} set
* @property {Function} get
* @property {Function} remove
*
* @param {String} key
* @param {AttributeDefiner} def
*/
AElement.prototype.defineAttribute = function (key, def) {
this._azar_extendAttributes[key] = def;
};
AElement.prototype.defineAttributes = function (defs) {
for (var key in defs) {
this.defineAttribute(key, defs[key]);
}
};
AElement.prototype.attr = function () {
if (arguments.length == 1) {
if (typeof (arguments[0]) == 'string') {
if (this._azar_extendAttributes[arguments[0]]) {
return this._azar_extendAttributes[arguments[0]].get.call(this);
}
else
return this.getAttribute(arguments[0]);
}
else {
for (var key in arguments[0]) {
this.attr(key, arguments[0][key]);
}
}
}
else {
if (arguments.length == 2) {
if (arguments[1] === null || arguments[1] === undefined) {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].remove.call(this, arguments[1]);
}
else
this.removeAttribute(arguments[0]);
}
else {
if (this._azar_extendAttributes[arguments[0]]) {
this._azar_extendAttributes[arguments[0]].set.call(this, arguments[1]);
}
else {
this.setAttribute(arguments[0], arguments[1]);
}
}
}
}
return this;
};
/***
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @param {string} arg1
* @returns {AElement}
*/
/**
* add style
* @param {CSSStyleDeclaration|string|{}} arg0
* @returns {AElement}
*/
AElement.prototype.addStyle = function (arg0, arg1) {
if (typeof arg0 == 'string')
if (arg0.indexOf('-') >= 0) {
this.style.setProperty(arg0, arg1);
}
else {
this.style[arg0] = arg1;
}
else {
for (var key in arg0)
this.addStyle(key, arg0[key]);
}
return this;
};
/***
*
* @param {string|string[]|CSSStyleDeclaration} arg0
* @returns {AElement}
*/
AElement.prototype.removeStyle = function (arg0) {
var key;
if (arg0.charAt) {
if (arg0.indexOf('-') >= 0) {
this.style.removeProperty(arg0);
}
else {
this.style[arg0] = null;
delete this.style[arg0];
}
}
else {
if (arg0.map && arg0.forEach) {
for (var i = 0; i < arg0.length; ++i)
this.removeStyle(arg0[i]);
}
else {
for (key in arg0)
this.removeStyle(key);
}
}
return this;
};
AElement.prototype.addChild = function (child) {
if (child.indexOf && child.map && child.forEach) {
for (var i = 0; i < child.length; ++i)
this.appendChild(child[i]);
}
else
this.appendChild(child);
return this;
};
AElement.prototype.addTo = function (parent) {
if (parent && parent.appendChild) {
if (parent.addChild)
parent.addChild(this);
else
parent.appendChild(this);
}
else throw Error("Can not append to " + parent + "!");
return this;
};
AElement.prototype.selfRemove = function () {
if (this.parentElement)
this.parentElement.removeChild(this);
return this;
};
AElement.prototype.selfReplace = function (newNode) {
if (this.parentElement)
this.parentElement.replaceChild(newNode, this);
return this;
};
AElement.prototype.clearChild = function () {
while (this.firstChild) {
this.removeChild(this.firstChild);
}
return this;
};
/**
*
* @param {string|Array} className
* @returns {Boolean}
*/
AElement.prototype.containsClass = function (className) {
if (className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
if (!this.classList.containsClass(className[i])) return false;
return true;
}
else
return this.classList.contains(className);
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.addClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.add(className[i]);
}
else
this.classList.add(className);
return this;
};
/**
*
* @param {string|Array} className
* @returns {AElement}
*/
AElement.prototype.removeClass = function (className) {
if (className && className.forEach && className.map) {
for (var i = 0; i < className.length; ++i)
this.classList.remove(className[i]);
}
else
this.classList.remove(className);
return this;
};
AElement.prototype.getComputedStyleValue = function (key) {
return window.getComputedStyle(this).getPropertyValue(key);
};
AElement.prototype.getFontSize = function () {
return parseFloat(this.getComputedStyleValue('font-size').replace('px', ''));
};
AElement.prototype.findChildAfter = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i + 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.findChildBefore = function (obj) {
var r = 0;
for (var i = 0; i < this.childNodes.length; ++i) {
if (obj == this.childNodes[i]) {
r = i - 1;
break;
}
}
if (this.childNodes[r]) return this.childNodes[r];
return undefined;
};
AElement.prototype.addChildBefore = function (newItem, bf) {
this.insertBefore(newItem, bf);
return this;
};
AElement.prototype.addChildAfter = function (newItem, at) {
var bf = this.findChildAfter(at);
if (bf) return this.addChildBefore(newItem, bf);
return this.addChild(newItem);
};
/**
* @returns {DOMRect}
*/
AElement.prototype.getBoundingRecursiveRect = function (depth) {
if (depth === undefined) depth = 10000;
var current, next;
var oo = 1000000;
var ac = { left: oo, right: -oo, top: oo, bottom: -oo, width: 0, height: 0 };
var stacks = [{ e: this, d: 0 }];
while (stacks.length > 0) {
current = stacks.pop();
if (current.e.getBoundingClientRect) {
var cRect = current.e.getBoundingClientRect();
if (!cRect || !(cRect.width || cRect.height || cRect.left || cRect.right)) continue;
ac.left = Math.min(ac.left, cRect.left);
ac.top = Math.min(ac.top, cRect.top);
ac.bottom = Math.max(ac.bottom, cRect.bottom);
ac.right = Math.max(ac.right, cRect.right);
ac.height = ac.bottom - ac.top;
ac.width = ac.right - ac.left;
var childNodes = current.e.childNodes;
if (childNodes && childNodes.length > 0 && current.d < depth) {
for (var i = 0; i < childNodes.length; ++i) {
next = { e: childNodes[i], d: current.d + 1 };
stacks.push(next);
}
}
}
}
return ac;
};
/***
*
* @param parent
* @returns {boolean}
*/
AElement.prototype.isDescendantOf = function (parent) {
var child = this;
while (child) {
if (child === parent) return true;
child = child.parentNode;
}
return false;
};
/*************************** **********************/
AElement.prototype.getCSSRules = function () {
var sheets = document.styleSheets;
var ret = [];
this.matches = this.matches || this.webkitMatchesSelector || this.mozMatchesSelector
|| this.msMatchesSelector || this.oMatchesSelector;
for (var i in sheets) {
if (sheets[i].href) continue;//because can not access, you must clone link node instead
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (this.matches(rules[r].selectorText)) {
ret.push(rules[r]);
}
}
}
return ret;
};
/***
* @returns {Promise}
*/
/***
* WARNING: this function may be unsafe
*/
AElement.prototype.afterDisplayed = function (requestTimesOut) {
if (!requestTimesOut) requestTimesOut = 24 * 3600 * 33;
// var tracer = new Error();
var current = this;
return new Promise(function (resolve, reject) {
function trace() {
if (requestTimesOut < 0) {
// reject(tracer);
// if (absol.BUILD && absol.BUILD.version == "DEBUG")
// console.warn("Element not displayed", trace);
}
else {
requestTimesOut--;
var bound = current.getBoundingClientRect();
if (bound.width > 0 || bound.height > 0) {
resolve();
}
else {
setTimeout(trace, 33);
return;
}
}
}
trace();
});
};
!(function () {
var origin = AElement.prototype.on;
if (BrowserDetector.isSafari && !BrowserDetector.isMobile) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('mouseleave') && arguments[0] == 'mouseleave') {
this.defineEvent('mouseleave');
var mouseLeaveEventHandler = function (event) {
var bound = this.getBoundingClientRect();
var ok = false;
ok |= event.clientX < bound.left + 1;
ok |= event.clientX >= bound.right - 1;
ok |= event.clientY < bound.top + 1;
ok |= event.clientY >= bound.bottom - 1;
if (ok) this.emit('mouseleave', event);
};
this.addEventListener('mouseleave', mouseLeaveEventHandler, true);
}
origin.apply(this, arguments);
return this;
};
}
if (BrowserDetector.isFirefox) {
AElement.prototype.on = function () {
if (!this.isSupportedEvent('wheel') && arguments[0] == 'wheel') {
this.defineEvent('wheel');
var wheelEventHandler = function (oldEvent) {
//clone event to avoid some lib fix it
var event = oldEvent.absolEvent;
if (!event) {
event = Object.assign({}, oldEvent);
for (var i = 0; i < AElement.eventProperties.length; ++i) {
var key = AElement.eventProperties[i];
if (typeof (event[key]) == 'function') {
event[key] = event[key].bind(oldEvent);
}
}
event.preventDefault = function () {
oldEvent.preventDefault();
};
if (!event.mozFixWheelScale) {
event.mozDeltaY = oldEvent.deltaY;
event.mozFixWheelScale = true;
Object.defineProperty(event, 'deltaY', {
get: function () {
return this.mozDeltaY * 100 / 3;
}
});
}
oldEvent.absolEvent = event;
}
this.emit('wheel', event);
};
this.addEventListener('wheel', wheelEventHandler);
}
origin.apply(this, arguments);
return this;
};
}
}());
AElement.eventProperties = ["altKey", "bubbles", "button", "buttons", "cancelBubble", "cancelable", "clientX", "clientY", "composed",
"ctrlKey", "currentTarget", "defaultPrevented", "deltaMode", "deltaX", "deltaY", "deltaZ", "detail", "eventPhase",
"explicitOriginalTarget", "isTrusted", "layerX", "layerY", "metaKey", "movementX", "movementY", "mozInputSource",
"mozPressure", "offsetX", "offsetY", "originalTarget", "pageX", "pageY", "rangeOffset", "rangeParent", "region",
"relatedTarget", "returnValue", "screenX", "screenY", "shiftKey", "srcElement", "target", "timeStamp", "type",
"deltaMode", "deltaX", "deltaY", "deltaZ"];
export default AElement;13900