mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-19 21:29:41 +02:00
341 lines
15 KiB
JavaScript
341 lines
15 KiB
JavaScript
|
var Docs =
|
||
|
/******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // install a JSONP callback for chunk loading
|
||
|
/******/ function webpackJsonpCallback(data) {
|
||
|
/******/ var chunkIds = data[0];
|
||
|
/******/ var moreModules = data[1];
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // add "moreModules" to the modules object,
|
||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||
|
/******/ var moduleId, chunkId, i = 0, resolves = [];
|
||
|
/******/ for(;i < chunkIds.length; i++) {
|
||
|
/******/ chunkId = chunkIds[i];
|
||
|
/******/ if(installedChunks[chunkId]) {
|
||
|
/******/ resolves.push(installedChunks[chunkId][0]);
|
||
|
/******/ }
|
||
|
/******/ installedChunks[chunkId] = 0;
|
||
|
/******/ }
|
||
|
/******/ for(moduleId in moreModules) {
|
||
|
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
|
||
|
/******/ modules[moduleId] = moreModules[moduleId];
|
||
|
/******/ }
|
||
|
/******/ }
|
||
|
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
|
||
|
/******/
|
||
|
/******/ while(resolves.length) {
|
||
|
/******/ resolves.shift()();
|
||
|
/******/ }
|
||
|
/******/
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
/******/
|
||
|
/******/ // object to store loaded and loading chunks
|
||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||
|
/******/ // Promise = chunk loading, 0 = chunk loaded
|
||
|
/******/ var installedChunks = {
|
||
|
/******/ 0: 0
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // script path function
|
||
|
/******/ function jsonpScriptSrc(chunkId) {
|
||
|
/******/ return __webpack_require__.p + "" + ({"1":"vendors~codex-editor"}[chunkId]||chunkId) + ".bundle.js"
|
||
|
/******/ }
|
||
|
/******/
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
/******/
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId]) {
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
/******/ }
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ i: moduleId,
|
||
|
/******/ l: false,
|
||
|
/******/ exports: {}
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
/******/
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.l = true;
|
||
|
/******/
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
/******/
|
||
|
/******/ // This file contains only the entry chunk.
|
||
|
/******/ // The chunk loading function for additional chunks
|
||
|
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
|
||
|
/******/ var promises = [];
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // JSONP chunk loading for javascript
|
||
|
/******/
|
||
|
/******/ var installedChunkData = installedChunks[chunkId];
|
||
|
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
||
|
/******/
|
||
|
/******/ // a Promise means "currently loading".
|
||
|
/******/ if(installedChunkData) {
|
||
|
/******/ promises.push(installedChunkData[2]);
|
||
|
/******/ } else {
|
||
|
/******/ // setup Promise in chunk cache
|
||
|
/******/ var promise = new Promise(function(resolve, reject) {
|
||
|
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
|
||
|
/******/ });
|
||
|
/******/ promises.push(installedChunkData[2] = promise);
|
||
|
/******/
|
||
|
/******/ // start chunk loading
|
||
|
/******/ var head = document.getElementsByTagName('head')[0];
|
||
|
/******/ var script = document.createElement('script');
|
||
|
/******/ var onScriptComplete;
|
||
|
/******/
|
||
|
/******/ script.charset = 'utf-8';
|
||
|
/******/ script.timeout = 120;
|
||
|
/******/ if (__webpack_require__.nc) {
|
||
|
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
||
|
/******/ }
|
||
|
/******/ script.src = jsonpScriptSrc(chunkId);
|
||
|
/******/
|
||
|
/******/ onScriptComplete = function (event) {
|
||
|
/******/ // avoid mem leaks in IE.
|
||
|
/******/ script.onerror = script.onload = null;
|
||
|
/******/ clearTimeout(timeout);
|
||
|
/******/ var chunk = installedChunks[chunkId];
|
||
|
/******/ if(chunk !== 0) {
|
||
|
/******/ if(chunk) {
|
||
|
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
||
|
/******/ var realSrc = event && event.target && event.target.src;
|
||
|
/******/ var error = new Error('Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')');
|
||
|
/******/ error.type = errorType;
|
||
|
/******/ error.request = realSrc;
|
||
|
/******/ chunk[1](error);
|
||
|
/******/ }
|
||
|
/******/ installedChunks[chunkId] = undefined;
|
||
|
/******/ }
|
||
|
/******/ };
|
||
|
/******/ var timeout = setTimeout(function(){
|
||
|
/******/ onScriptComplete({ type: 'timeout', target: script });
|
||
|
/******/ }, 120000);
|
||
|
/******/ script.onerror = script.onload = onScriptComplete;
|
||
|
/******/ head.appendChild(script);
|
||
|
/******/ }
|
||
|
/******/ }
|
||
|
/******/ return Promise.all(promises);
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
/******/
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
/******/
|
||
|
/******/ // define getter function for harmony exports
|
||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||
|
/******/ }
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // define __esModule on exports
|
||
|
/******/ __webpack_require__.r = function(exports) {
|
||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
|
/******/ }
|
||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // create a fake namespace object
|
||
|
/******/ // mode & 1: value is a module id, require it
|
||
|
/******/ // mode & 2: merge all properties of value into the ns
|
||
|
/******/ // mode & 4: return value when already ns object
|
||
|
/******/ // mode & 8|1: behave like require
|
||
|
/******/ __webpack_require__.t = function(value, mode) {
|
||
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
||
|
/******/ if(mode & 8) return value;
|
||
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||
|
/******/ var ns = Object.create(null);
|
||
|
/******/ __webpack_require__.r(ns);
|
||
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||
|
/******/ return ns;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
|
/******/ __webpack_require__.n = function(module) {
|
||
|
/******/ var getter = module && module.__esModule ?
|
||
|
/******/ function getDefault() { return module['default']; } :
|
||
|
/******/ function getModuleExports() { return module; };
|
||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||
|
/******/ return getter;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||
|
/******/
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "/dist/";
|
||
|
/******/
|
||
|
/******/ // on error function for async loading
|
||
|
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
|
||
|
/******/
|
||
|
/******/ var jsonpArray = window["webpackJsonpDocs"] = window["webpackJsonpDocs"] || [];
|
||
|
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
|
||
|
/******/ jsonpArray.push = webpackJsonpCallback;
|
||
|
/******/ jsonpArray = jsonpArray.slice();
|
||
|
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
|
||
|
/******/ var parentJsonpFunction = oldJsonpFunction;
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(__webpack_require__.s = 1);
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ([
|
||
|
/* 0 */,
|
||
|
/* 1 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
var _main = __webpack_require__(4);
|
||
|
|
||
|
var _main2 = _interopRequireDefault(_main);
|
||
|
|
||
|
var _moduleDispatcher = __webpack_require__(2);
|
||
|
|
||
|
var _moduleDispatcher2 = _interopRequireDefault(_moduleDispatcher);
|
||
|
|
||
|
var _writing = __webpack_require__(3);
|
||
|
|
||
|
var _writing2 = _interopRequireDefault(_writing);
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||
|
|
||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||
|
|
||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||
|
|
||
|
/**
|
||
|
* Main app class
|
||
|
*/
|
||
|
var Docs =
|
||
|
/*#__PURE__*/
|
||
|
function () {
|
||
|
/**
|
||
|
* @constructor
|
||
|
*/
|
||
|
function Docs() {
|
||
|
var _this = this;
|
||
|
|
||
|
_classCallCheck(this, Docs);
|
||
|
|
||
|
console.log('CodeX Docs initialized');
|
||
|
this.writing = new _writing2.default();
|
||
|
document.addEventListener('DOMContentLoaded', function (event) {
|
||
|
_this.docReady();
|
||
|
});
|
||
|
}
|
||
|
/**
|
||
|
* Document is ready
|
||
|
*/
|
||
|
|
||
|
|
||
|
_createClass(Docs, [{
|
||
|
key: "docReady",
|
||
|
value: function docReady() {
|
||
|
this.moduleDispatcher = new _moduleDispatcher2.default({
|
||
|
Library: window.Docs
|
||
|
});
|
||
|
}
|
||
|
}]);
|
||
|
|
||
|
return Docs;
|
||
|
}();
|
||
|
|
||
|
module.exports = new Docs();
|
||
|
|
||
|
/***/ }),
|
||
|
/* 2 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
/*!
|
||
|
* CodeX Module Dispatcher — Initialize frontend Modules from the DOM without inline scripts
|
||
|
*
|
||
|
* @copyright CodeX Team <team@ifmo.su>
|
||
|
* @license MIT https://github.com/codex-team/dispatcher/LICENSE
|
||
|
* @author @polinashneider https://github.com/polinashneider
|
||
|
* @version 0.0.1
|
||
|
*/
|
||
|
!function(e,t){ true?module.exports=t():undefined}("undefined"!=typeof self?self:this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=function(){function e(t){var n=t.name,o=t.element,s=t.settings,i=t.moduleClass;r(this,e),this.name=n,this.element=o,this.settings=s,this.moduleClass=i}return s(e,[{key:"init",value:function(){try{console.assert(this.moduleClass.init instanceof Function,"Module «"+this.name+"» should implement init method"),this.moduleClass.init instanceof Function&&(this.moduleClass.init(this.settings,this.element),console.log("Module «"+this.name+"» initialized"))}catch(e){console.warn("Module «"+this.name+"» was not initialized because of ",e)}}},{key:"destroy",value:function(){this.moduleClass.destroy instanceof Function&&(this.moduleClass.destroy(),console.log("Module «"+this.name+"» destroyed."))}}]),e}(),u=function(){function e(t){r(this,e),this.Library=t.Library||window,this.modules=this.findModules(document),this.initModules()}return s(e,[{key:"findModules",value:function(e){for(var t=[],n=e.querySelectorAll("[data-module]"),r=n.length-1;r>=0;r--)t.push.apply(t,o(this.extractModulesData(n[r])));return t}},{key:"extractModulesData",value:function(e){var t=this,n=[],o=e.dataset.module;return o=o.replace(/\s+/," "),o.split(" ").forEach(function(o,r){var s=new i({name:o,element:e,settings:t.getModuleSettings(e,r,o),moduleClass:t.Library[o]});n.push(s)}),n}},{key:"getModuleSettings",value:function(e,t,n){var o=e.querySelector("module-settings"),r=void 0;if(!o)return null;try{r=o.textContent.trim(),r=JSON.parse(r)}catch(e){return console.warn("Can not parse Module «"+n+"» settings bacause of: "+e),console.groupCollapsed(n+" settings"),console.log(r),console.groupEnd(),null}return Array.isArray(r)?r[t]?r[t]:null:0===t?r:(console.warn("Wrong settings format. For several Modules use an array instead of object."),null)}},{key:"initModules",value:function(){console.groupCollapsed("ModuleDispatcher"),this.modules.forEach(function(e){e.init()}),console.groupEnd()}}]),e}();t.default=u}])});
|
||
|
|
||
|
/***/ }),
|
||
|
/* 3 */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
|
||
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||
|
|
||
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||
|
|
||
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||
|
|
||
|
/**
|
||
|
* Module for pages create/edit
|
||
|
*/
|
||
|
module.exports =
|
||
|
/*#__PURE__*/
|
||
|
function () {
|
||
|
function Writing() {
|
||
|
_classCallCheck(this, Writing);
|
||
|
}
|
||
|
/**
|
||
|
* Called by ModuleDispatcher to initialize module from DOM
|
||
|
*/
|
||
|
|
||
|
|
||
|
_createClass(Writing, [{
|
||
|
key: "init",
|
||
|
value: function init(config, moduleEl) {
|
||
|
this.editorWrapper = document.createElement('div');
|
||
|
this.editorWrapper.id = 'codex-editor';
|
||
|
moduleEl.appendChild(this.editorWrapper);
|
||
|
this.loadEditor().then(function () {
|
||
|
console.log('Editor loaded');
|
||
|
});
|
||
|
}
|
||
|
}, {
|
||
|
key: "loadEditor",
|
||
|
value: function loadEditor() {
|
||
|
return __webpack_require__.e(/* import() | codex-editor */ 1).then(__webpack_require__.t.bind(null, 0, 7)).then(function (_ref) {
|
||
|
var CodexEditor = _ref.default;
|
||
|
console.log('codex-editor', new CodexEditor());
|
||
|
}).catch(function (error) {
|
||
|
return 'An error occurred while loading CodeX Editor';
|
||
|
});
|
||
|
}
|
||
|
}]);
|
||
|
|
||
|
return Writing;
|
||
|
}();
|
||
|
|
||
|
/***/ }),
|
||
|
/* 4 */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
// removed by extract-text-webpack-plugin
|
||
|
|
||
|
/***/ })
|
||
|
/******/ ]);
|