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

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

var _VideoUrlDialog = require("../videourldialog/VideoUrlDialog");

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

var _base = require("absol/src/Converter/base64");

var name = 'video';
var command = 'insert_video';

function getInfoFromCKImage(elt) {
  var initInfo = null;

  if (elt.getAttribute('data-node-type') === 'video') {
    initInfo = JSON.parse((0, _base.base64DecodeUnicode)(elt.getAttribute('data-info')));
    initInfo.embedUrl = elt.getAttribute('data-embed-url');
    initInfo.image = elt.getAttribute('src');
    initInfo.image = elt.getAttribute('src');
  }

  return initInfo;
}

function init(editor) {
  editor.ui.addButton(command, {
    label: 'Insert Video',
    command: command
  });
  editor.on('doubleclick', event => {
    var info;

    if (event.data && event.data.element) {
      info = getInfoFromCKImage(event.data.element);

      if (info) {
        event.cancel();
        editor.execCommand(command);
      }
    }
  });
  editor.addCommand(command, {
    exec: function (editor) {
      var initInfo;
      var sel = editor.getSelection();
      var elt;

      if (sel) {
        elt = sel.getSelectedElement();
      }

      if (elt) {
        initInfo = getInfoFromCKImage(elt);
      }

      (0, _VideoUrlDialog.openVideUrlDialog)(initInfo).then(result => {
        var savedInfo = Object.assign({}, result);
        delete savedInfo.image;
        delete savedInfo.embedUrl;

        if (result) {
          var html = `<img src="${result.image}" data-type="${result.type}" \
                        onload="window.ckeditorVideoInit && window.ckeditorVideoInit(this)"\
                         data-embed-url="${result.embedUrl}"\
                         width="${result.displayWidth}px"  height="${result.displayHeight}px"\
                          data-node-type="video" \
                          data-info="${(0, _base.base64EncodeUnicode)(JSON.stringify(savedInfo))}"
                          
                         >`;
          editor.insertHtml(html);
        }
      });
    }
  });
}

window.ckeditorVideoInit = function (elt) {
  (0, _ACore.$)(elt);
  if (!elt.isDescendantOf(document.body)) return;
  var newElt;
  var type = elt.attr('data-type');

  if (type.startsWith('video/')) {
    newElt = (0, _ACore._)({
      tag: 'video',
      attr: {
        crossorigin: "anonymous",
        crossOrigin: "anonymous",
        preload: 'auto',
        src: elt.attr('data-embed-url'),
        width: elt.attr('width'),
        height: elt.attr('height'),
        controls: true
      }
    });
  } else {
    newElt = (0, _ACore._)({
      tag: 'iframe',
      attr: {
        src: elt.attr('data-embed-url'),
        width: elt.attr('width'),
        height: elt.attr('height')
      }
    });
  }

  elt.selfReplace(newElt);
};

var _default = {
  name: name,
  command: command,
  plugin: {
    init: init
  },
  extendMethods: {}
};
/***
 * @name variables
 * @type {{}}
 * @memberOf CKPlaceholder#
 */

exports.default = _default;

VaKeR 2022