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__UserSelectMenu.js
/*** module: node_modules/absol-tutor/js/scriptor/UserSelectMenu.js ***/
"use strict";

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

var _UserBaseAction = _interopRequireDefault(require("./UserBaseAction"));

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

require("../../css/basecommand.css");

var _TutorNameManager = _interopRequireDefault(require("./TutorNameManager"));

var _TACData = _interopRequireDefault(require("./TACData"));

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

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

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


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

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

StateWaitOpenModal.prototype.onStart = function () {
  this.command.elt.on('click', this.ev_click);
  this.command.onlyClickTo(this.command.elt);
  this.command.highlightElt(this.command.elt);
};

StateWaitOpenModal.prototype.onStop = function () {
  this.command.elt.off('click', this.ev_click);
  this.command.highlightElt(null);
  clearTimeout(this._checkTO);
  this.command.onlyClickTo(null);
};

StateWaitOpenModal.prototype.checkSelectBox = function () {
  var selectListBox = this.command.elt.$selectlistBox;

  if (selectListBox.getBoundingClientRect().width > 0) {
    this.goto('user_wait_close_modal');
  }
};

StateWaitOpenModal.prototype.ev_click = function () {
  this._checkTO = setTimeout(this.checkSelectBox.bind(this), 50);
};
/***
 * @extends BaseState
 * @constructor
 */


function StateWaitCloseModal() {
  _BaseState.default.apply(this, arguments);
}

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

StateWaitCloseModal.prototype.onStart = function () {
  this.inv = setInterval(this.checkSelectBox.bind(this), 150);
  var elt = this.command.elt;
  this.command.onlyClickTo(elt.$selectlistBox);
  var searchMessage = this.args.searchMessage;

  if (searchMessage && elt.enableSearch) {
    this.command.showTooltip(elt.$selectlistBox.$searchInput, searchMessage);
  }
};

StateWaitCloseModal.prototype.onStop = function () {
  clearInterval(this.inv);
  this.command.showTooltip(null);
};

StateWaitCloseModal.prototype.checkSelectBox = function () {
  var selectListBox = this.command.elt.$selectlistBox;
  var bound = selectListBox.getBoundingClientRect();

  if (bound.width === 0) {
    this.goto('check_value');
  }
};
/***
 * @extends BaseState
 * @constructor
 */


function StateCheckValue() {
  _BaseState.default.apply(this, arguments);
}

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

StateCheckValue.prototype.onStart = function () {
  if (this.command.elt.value === this.args.value) {
    this.goto('finish');
  } else {
    this.goto('user_begin');

    if (this.args.wrongMessage) {
      this.command.showTooltip(this.command.elt, this.args.wrongMessage);
    }
  }
};
/***
 * @extends UserBaseAction
 * @constructor
 */


function UserSelectMenu() {
  _UserBaseAction.default.apply(this, arguments);
}

(0, _TCommand.inheritCommand)(UserSelectMenu, _UserBaseAction.default);
UserSelectMenu.prototype.className = 'UserSelectMenu';
UserSelectMenu.prototype.name = 'userSelectMenu';
UserSelectMenu.prototype.argNames = ['eltPath', 'value', 'message', 'wrongMessage', 'searchMessage'];
UserSelectMenu.prototype.stateClasses.user_begin = StateWaitOpenModal;
UserSelectMenu.prototype.stateClasses.user_wait_close_modal = StateWaitCloseModal;
UserSelectMenu.prototype.stateClasses.check_value = StateCheckValue;

UserSelectMenu.prototype.verifyElt = function () {
  var elt = this.elt;

  if (!elt.containsClass || !(elt.containsClass('absol-selectmenu') || elt.containsClass('as-select-menu') || elt.containsClass('as-select-tree-menu'))) {
    return new Error("Type error: not a select-menu!");
  }

  return null;
};

_TutorEngine.default.installClass(UserSelectMenu);

_TACData.default.define('userSelectMenu', {
  type: 'function',
  args: [{
    name: 'eltPath',
    type: '(string|AElement)'
  }, {
    name: 'value',
    type: '(string|value)'
  }, {
    name: 'message',
    type: 'string'
  }, {
    name: 'wrongMessage',
    type: 'string'
  }, {
    name: 'searchMessage',
    type: 'string'
  }]
});

_TutorNameManager.default.addAsync('userSelectMenu');

var _default = UserSelectMenu;
exports.default = _default;

VaKeR 2022