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-acomp__js__SinglePage.js
/*** module: node_modules/absol-acomp/js/SinglePage.js ***/
"use strict";

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

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

var _ACore = _interopRequireDefault(require("../ACore"));

var _Dom = _interopRequireDefault(require("absol/src/HTML5/Dom"));

var _AElement = _interopRequireDefault(require("absol/src/HTML5/AElement"));

var _ResizeSystem = _interopRequireDefault(require("absol/src/HTML5/ResizeSystem"));


var _ = _ACore.default._;
var $ = _ACore.default.$;
var warned = false;
/***
 * @extends TabFrame
 * @constructor
 */

function SinglePage() {
  var thisSP = this;
  this._updateIntv = -1;

  this._tick = function () {
    if (this.isDescendantOf(document.body)) {
      if (this.$header) {
        var headerHeight = this.$header.getBoundingClientRect().height;

        if (this._prevHeaderHeight !== headerHeight) {
          _ResizeSystem.default.update();
        }
      }
    } else {
      clearInterval(this._updateIntv);
      this._updateIntv = -1;
    }
  }.bind(this);

  this.$attachhook = $('attachhook', this).on('attached', function () {
    this.updateSize();
    setTimeout(this.updateSize, 20);

    _Dom.default.addToResizeSystem(this);

    if (thisSP._updateIntv < 0) {
      thisSP._updateIntv = setInterval(thisSP._tick, 200);
    }
  });
  this.$attachhook.updateSize = this.updateSize.bind(this);
  this.$header = null;
  this.$footer = null;
  this.$viewport = $('.absol-single-page-scroller-viewport', this);
  this.$scroller = $('.absol-single-page-scroller', this);
}

SinglePage.tag = 'SinglePage'.toLowerCase();

SinglePage.render = function () {
  return _({
    tag: 'tabframe',
    extendEvent: ['sizechange'],
    class: 'absol-single-page',
    child: [{
      class: 'absol-single-page-scroller',
      child: {
        class: 'absol-single-page-scroller-viewport'
      }
    }, 'attachhook']
  });
};

SinglePage.prototype.updateSize = function () {
  if (!this.isDescendantOf(document.body)) return;
  var paddingTop = parseFloat(this.getComputedStyleValue('padding-top').replace('px', '')) || 0;

  if (this.$header) {
    var headerBound = this.$header.getBoundingClientRect();
    var headerMarginTop = parseFloat(this.$header.getComputedStyleValue('margin-top').replace('px', '')) || 0;
    var headerMarginBottom = parseFloat(this.$header.getComputedStyleValue('margin-bottom').replace('px', '')) || 0;
    this.$scroller.addStyle('top', headerBound.height + headerMarginTop + headerMarginBottom + paddingTop + 'px');
    this._prevHeaderHeight = headerBound.height;
  }

  if (this.$footer) {
    var footerBound = this.$footer.getBoundingClientRect();
    this.$viewport.addStyle('padding-bottom', footerBound.height + 'px');
  }

  this.addStyle('--single-page-scroller-height', this.$scroller.clientHeight + 'px');
  if (this.isSupportedEvent('sizechange')) this.emit('sizechange', {
    type: 'sizechange',
    target: this
  }, this);
};

SinglePage.prototype.addChild = function (elt) {
  if (elt.classList.contains('absol-single-page-header')) {
    if (this.firstChild) {
      this.addChildBefore(elt, this.firstChild);
    } else {
      this.appendChild(elt);
    }

    this.$header = $(elt);
    this.updateSize();
  } else if (elt.classList.contains('absol-single-page-footer')) {
    this.$viewport.addChild(elt);
    this.$footer = $(elt);
    this.updateSize();
  } else {
    this.$viewport.addChild(elt);
  }
};

SinglePage.prototype.removeChild = function (elt) {
  if (elt == this.$footer) {
    this.$viewport.removeChild(elt);
    this.$footer = undefined;
    this.updateSize();
  } else if (elt == this.$header) {
    this.super(elt);
    this.$header = undefined;
    this.updateSize();
  } else {
    this.$viewport.removeChild(elt);
  }
};

_ACore.default.install(SinglePage);

var _default = SinglePage;
exports.default = _default;

VaKeR 2022