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

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

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

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

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

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

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

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

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


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

  this.checkTO = -1;
}

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

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

  this.command.clickCb = function () {
    this.command.showTooltip(this.command.elt, this.command.args.wrongMessage);
  }.bind(this);
};

StateWaitCheck.prototype.onStop = function () {
  this.command.elt.off('click', this.ev_click);
  clearTimeout(this.checkTO);
};

StateWaitCheck.prototype.delayCheck = function () {
  this.checkTO = setTimeout(function () {
    if (!!this.command.elt.checked === !!this.args.checked) {
      this.goto('finish');
    }
  }.bind(this), 50);
};

StateWaitCheck.prototype.ev_click = function () {
  this.delayCheck();
};
/***
 * @extends UserBaseAction
 * @constructor
 */


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

(0, _TCommand.inheritCommand)(UserCheckbox, _UserBaseAction.default);
UserCheckbox.prototype.name = 'userCheckbox';
UserCheckbox.prototype.stateClasses['user_begin'] = StateWaitCheck;
UserCheckbox.prototype.argNames = ['eltPath', 'checked', 'message', 'wrongMessage'];

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

  if (!elt.hasClass || !(elt.hasClass('absol-checkbox') || elt.hasClass('absol-radio') || elt.hasClass('as-checkbox-input') || elt.hasClass('as-checkbox-input') || elt.hasClass('as-radio-input') || elt.hasClass('absol-switch') || elt.tagName.toLowerCase() === 'input' && (elt.type === 'checkbox' || elt.type === 'radio'))) {
    return new Error('Type error: not a radio or checkbox');
  }

  return null;
};
/***
 * @extends UserCheckbox
 * @constructor
 */


function UserSwitch() {
  UserCheckbox.apply(this, arguments);
}

(0, _TCommand.inheritCommand)(UserSwitch, UserCheckbox);
UserSwitch.prototype.name = 'userSwitch';
/***
 * @extends UserCheckbox
 * @constructor
 */

function UserRadio() {
  UserCheckbox.apply(this, arguments);
}

(0, _TCommand.inheritCommand)(UserRadio, UserCheckbox);
UserRadio.prototype.name = 'userRadio';

_TutorEngine.default.installClass(UserCheckbox);

_TutorEngine.default.installClass(UserSwitch);

_TutorEngine.default.installClass(UserRadio);

_TutorNameManager.default.addAsync('userCheckbox');

_TutorNameManager.default.addAsync('userSwitch');

_TutorNameManager.default.addAsync('userRadio');

_TACData.default.define('userCheckbox', {
  type: 'function',
  args: [{
    name: 'eltPath',
    type: '(string|AElement)'
  }, {
    name: 'checked',
    type: 'boolean'
  }, {
    name: 'message',
    type: 'string'
  }, {
    name: 'wrongMessage',
    type: 'string'
  }]
}).define('userRadio', {
  type: 'function',
  args: [{
    name: 'eltPath',
    type: '(string|AElement)'
  }, {
    name: 'checked',
    type: 'boolean'
  }, {
    name: 'message',
    type: 'string'
  }, {
    name: 'wrongMessage',
    type: 'string'
  }]
});

var _default = UserCheckbox;
exports.default = _default;

VaKeR 2022