VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/libs/absol-full/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-full/dist/js/mdls__absol-tutor__js__scriptor__Appear.js
/*** module: node_modules/absol-tutor/js/scriptor/Appear.js ***/
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StateWaitEltAppear = StateWaitEltAppear;
exports.default = void 0;

var _BaseCommand = _interopRequireDefault(require("./BaseCommand"));

var _OOP = _interopRequireDefault(require("absol/src/HTML5/OOP"));

var _Core = require("../dom/Core");

var _TCommand = require("../engine/TCommand");

var _BaseState = _interopRequireDefault(require("./BaseState"));

var _TutorEngine = _interopRequireDefault(require("./TutorEngine"));


/***
 * @extends BaseState
 * @constructor
 */
function StateWaitEltAppear() {
  _BaseState.default.apply(this, arguments);

  this.timeOut = -1;
}

_OOP.default.mixClass(StateWaitEltAppear, _BaseState.default);

StateWaitEltAppear.prototype.onStart = function () {
  this.endTime = new Date().getTime() + (this.args.timeout || 100);
  this.checkElt();
};

StateWaitEltAppear.prototype.onStop = function () {
  if (this.timeOut >= 0) {
    clearTimeout(this.timeOut);
    this.timeOut = -1;
  }
};

StateWaitEltAppear.prototype.isVisibility = function (elt) {
  var eltBound;

  if (elt) {
    eltBound = elt.getBoundingClientRect();

    if (eltBound.width > 0 || eltBound.height > 0) {
      if ((0, _Core.$)(elt).getComputedStyleValue('visibility') !== 'hidden') {
        return true;
      }
    }
  }

  return false;
};

StateWaitEltAppear.prototype.checkElt = function () {
  var now = new Date().getTime();
  this.timeOut = -1;
  var elt = this.command.findNode(this.args.eltPath, true);

  if (this.isVisibility(elt)) {
    this.command.resolve(true);
  } else if (now > this.endTime) {
    this.command.resolve(false);
  } else {
    this.timeOut = setTimeout(this.checkElt.bind(this), Math.min(100, this.endTime - now));
  }
};
/***
 * @extends {BaseCommand}
 * @constructor
 */


function Appear() {
  _BaseCommand.default.apply(this, arguments);
}

(0, _TCommand.inheritCommand)(Appear, _BaseCommand.default);
Appear.prototype.className = 'Appear';
Appear.prototype.argNames = ['eltPath', 'timeout'];
Appear.prototype.name = 'APPEAR';
Appear.prototype.stateClasses.entry = StateWaitEltAppear;
Appear.prototype.type = 'sync';

_TutorEngine.default.installClass(Appear);

var _default = Appear;
exports.default = _default;

VaKeR 2022