mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 06:55:26 +02:00
remove unused
This commit is contained in:
parent
447b126b45
commit
5940d32080
6 changed files with 4 additions and 148 deletions
2
public/dist/code-styling.bundle.js
vendored
2
public/dist/code-styling.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
public/dist/editor.bundle.js
vendored
2
public/dist/editor.bundle.js
vendored
|
@ -1,4 +1,4 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{106:function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return E});n(6),n(71);var r=n(75),o=n.n(r),i=n(76),a=n.n(i),s=n(77),u=n.n(s),c=n(78),l=n.n(c),f=n(79),d=n.n(f),p=n(80),h=n.n(p),v=n(81),g=n.n(v),y=n(82),m=n.n(y),b=n(83),x=n.n(b),k=(n(84),n(85)),w=n.n(k);function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var E=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r={tools:{header:{class:a.a,inlineToolbar:["link","marker"],config:{placeholder:n.headerPlaceholder||""}},list:{class:m.a,inlineToolbar:!0},quote:{class:u.a,inlineToolbar:!0},code:{class:d.a,shortcut:"CMD+SHIFT+D"},inlineCode:{class:g.a,shortcut:"CMD+SHIFT+C"},rawTool:{class:x.a,shortcut:"CMD+SHIFT+R"},marker:{class:l.a,shortcut:"CMD+SHIFT+M"},delimiter:h.a,embed:w.a},data:{blocks:[{type:"header",data:{text:"",level:2}}]}};this.editor=new o.a(Object.assign(r,e))}var e,n,r;return e=t,(n=[{key:"save",value:function(){return this.editor.saver.save()}},{key:"focus",value:function(){document.querySelector(".codex-editor__redactor").click()}}])&&S(e.prototype,n),r&&S(e,r),t}()},62:function(t,e,n){var r=n(63),o=n(17);t.exports=function(t){return r(o(t))}},63:function(t,e,n){var r=n(13);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},64:function(t,e,n){var r=n(35)("keys"),o=n(23);t.exports=function(t){return r[t]||(r[t]=o(t))}},65:function(t,e,n){var r=n(67),o=n(66);t.exports=Object.keys||function(t){return r(t,o)}},66:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},67:function(t,e,n){var r=n(21),o=n(62),i=n(68)(!1),a=n(64)("IE_PROTO");t.exports=function(t,e){var n,s=o(t),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~i(c,n)||c.push(n));return c}},68:function(t,e,n){var r=n(62),o=n(12),i=n(69);t.exports=function(t){return function(e,n,a){var s,u=r(e),c=o(u.length),l=i(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},69:function(t,e,n){var r=n(16),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},71:function(t,e,n){var r=n(10);r(r.S+r.F,"Object",{assign:n(72)})},72:function(t,e,n){"use strict";var r=n(65),o=n(73),i=n(74),a=n(33),s=n(63),u=Object.assign;t.exports=!u||n(14)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){for(var n=a(t),u=arguments.length,c=1,l=o.f,f=i.f;u>c;)for(var d,p=s(arguments[c++]),h=l?r(p).concat(l(p)):r(p),v=h.length,g=0;v>g;)f.call(p,d=h[g++])&&(n[d]=p[d]);return n}:u},73:function(t,e){e.f=Object.getOwnPropertySymbols},74:function(t,e){e.f={}.propertyIsEnumerable},75:function(t,e,n){
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{106:function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return E});n(6),n(71);var r=n(75),o=n.n(r),i=n(76),a=n.n(i),s=n(77),u=n.n(s),c=n(78),l=n.n(c),f=n(79),d=n.n(f),p=n(80),h=n.n(p),v=n(81),g=n.n(v),y=n(82),m=n.n(y),b=n(83),x=n.n(b),k=(n(84),n(85)),w=n.n(k);function S(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var E=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r={tools:{header:{class:a.a,inlineToolbar:["link","marker"],config:{placeholder:n.headerPlaceholder||""}},list:{class:m.a,inlineToolbar:!0},quote:{class:u.a,inlineToolbar:!0},code:{class:d.a,shortcut:"CMD+SHIFT+D"},inlineCode:{class:g.a,shortcut:"CMD+SHIFT+C"},rawTool:{class:x.a,shortcut:"CMD+SHIFT+R"},marker:{class:l.a,shortcut:"CMD+SHIFT+M"},delimiter:h.a,embed:w.a},data:{blocks:[{type:"header",data:{text:"",level:2}}]}};this.editor=new o.a(Object.assign(r,e))}var e,n,r;return e=t,(n=[{key:"save",value:function(){return this.editor.saver.save()}},{key:"focus",value:function(){document.querySelector(".codex-editor__redactor").click()}}])&&S(e.prototype,n),r&&S(e,r),t}()},33:function(t,e,n){var r=n(17);t.exports=function(t){return Object(r(t))}},62:function(t,e,n){var r=n(63),o=n(17);t.exports=function(t){return r(o(t))}},63:function(t,e,n){var r=n(13);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},64:function(t,e,n){var r=n(35)("keys"),o=n(23);t.exports=function(t){return r[t]||(r[t]=o(t))}},65:function(t,e,n){var r=n(67),o=n(66);t.exports=Object.keys||function(t){return r(t,o)}},66:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},67:function(t,e,n){var r=n(21),o=n(62),i=n(68)(!1),a=n(64)("IE_PROTO");t.exports=function(t,e){var n,s=o(t),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~i(c,n)||c.push(n));return c}},68:function(t,e,n){var r=n(62),o=n(12),i=n(69);t.exports=function(t){return function(e,n,a){var s,u=r(e),c=o(u.length),l=i(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},69:function(t,e,n){var r=n(16),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},71:function(t,e,n){var r=n(10);r(r.S+r.F,"Object",{assign:n(72)})},72:function(t,e,n){"use strict";var r=n(65),o=n(73),i=n(74),a=n(33),s=n(63),u=Object.assign;t.exports=!u||n(14)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){for(var n=a(t),u=arguments.length,c=1,l=o.f,f=i.f;u>c;)for(var d,p=s(arguments[c++]),h=l?r(p).concat(l(p)):r(p),v=h.length,g=0;v>g;)f.call(p,d=h[g++])&&(n[d]=p[d]);return n}:u},73:function(t,e){e.f=Object.getOwnPropertySymbols},74:function(t,e){e.f={}.propertyIsEnumerable},75:function(t,e,n){
|
||||
/*!
|
||||
* Codex Editor
|
||||
*
|
||||
|
|
4
public/dist/main.bundle.js
vendored
4
public/dist/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,6 @@ import ModuleDispatcher from 'module-dispatcher';
|
|||
*/
|
||||
import Writing from './modules/writing';
|
||||
import Page from './modules/page';
|
||||
import Landing from './modules/landing';
|
||||
|
||||
/**
|
||||
* Main app class
|
||||
|
@ -26,7 +25,6 @@ class Docs {
|
|||
constructor() {
|
||||
this.writing = new Writing();
|
||||
this.page = new Page();
|
||||
this.landing = new Landing();
|
||||
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
this.docReady();
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* Module to compose output JSON preview
|
||||
*/
|
||||
const cPreview = (function() {
|
||||
/**
|
||||
* Shows JSON in pretty preview
|
||||
* @param {object} output - what to show
|
||||
* @param {Element} holder - where to show
|
||||
*/
|
||||
function show(output, holder) {
|
||||
/** Make JSON pretty */
|
||||
output = JSON.stringify(output, null, 4);
|
||||
/** Encode HTML entities */
|
||||
output = encodeHTMLEntities(output);
|
||||
/** Stylize! */
|
||||
output = stylize(output);
|
||||
holder.innerHTML = output;
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts '>', '<', '&' symbols to entities
|
||||
*/
|
||||
function encodeHTMLEntities(string) {
|
||||
return string.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Some styling magic
|
||||
*/
|
||||
function stylize(string) {
|
||||
/** Stylize JSON keys */
|
||||
string = string.replace(/"(\w+)"\s?:/g, '"<span class=sc_key>$1</span>" :');
|
||||
/** Stylize tool names */
|
||||
string = string.replace(/"(paragraph|quote|list|header|link|code|image|delimiter|raw|table)"/g, '"<span class=sc_toolname>$1</span>"');
|
||||
/** Stylize HTML tags */
|
||||
string = string.replace(/(<[/a-z]+(>)?)/gi, '<span class=sc_tag>$1</span>');
|
||||
/** Stylize strings */
|
||||
string = string.replace(/"([^"]+)"/gi, '"<span class=sc_attr>$1</span>"');
|
||||
/** Boolean/Null */
|
||||
string = string.replace(/\b(true|false|null)\b/gi, '<span class=sc_bool>$1</span>');
|
||||
|
||||
string = string.replace(/\b(\d+)\b/gi, '<span class=sc_digit>$1</span>');
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
return {
|
||||
show
|
||||
};
|
||||
})();
|
||||
|
||||
export default cPreview;
|
|
@ -1,90 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* Module to compose output JSON preview
|
||||
*/
|
||||
const {default: cPreview} = require('../classes/cPreview');
|
||||
|
||||
/**
|
||||
* Module for pages using Editor
|
||||
*/
|
||||
export default class Landing {
|
||||
constructor() {
|
||||
/**
|
||||
* Editor class Instance
|
||||
*/
|
||||
this.editor = null;
|
||||
|
||||
/**
|
||||
* DOM elements
|
||||
*/
|
||||
this.nodes = {
|
||||
/**
|
||||
* Container to output saved Editor data
|
||||
*/
|
||||
outputWrapper: null
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} editorLandingSettings - Editor landing class settings
|
||||
* @property {String} editorLandingSettings.output_id - ID of container where Editor's saved data will be shown
|
||||
* @property {function} editorLandingSettings.onChange - Modifications callback for the Editor
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialization. Called by Module Dispatcher
|
||||
*/
|
||||
init(editorLandingSettings) {
|
||||
/**
|
||||
* Prepare node to output Editor data preview
|
||||
* @type {HTMLElement} - JSON preview container
|
||||
*/
|
||||
this.nodes.outputWrapper = document.getElementById(editorLandingSettings.output_id);
|
||||
|
||||
if (!this.nodes.outputWrapper) {
|
||||
console.warn('Can\'t find output target with ID: «' + editorLandingSettings.output_id + '»');
|
||||
}
|
||||
|
||||
this.loadEditor({
|
||||
data: {
|
||||
blocks: editorLandingSettings.blocks
|
||||
},
|
||||
/**
|
||||
* Bind onchange callback to preview JSON data
|
||||
*/
|
||||
onChange: () => {
|
||||
this.previewData();
|
||||
},
|
||||
/**
|
||||
* When Editor is ready, preview JSON output with initial data
|
||||
*/
|
||||
onReady: () => {
|
||||
this.previewData();
|
||||
this.editor.focus();
|
||||
}
|
||||
}).then((editor) => {
|
||||
this.editor = editor;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Load Editor from separate chunk
|
||||
* @param settings - settings for Editor initialization
|
||||
* @return {Promise<Editor>} - CodeX Editor promise
|
||||
*/
|
||||
async loadEditor(settings) {
|
||||
const {default: Editor} = await import(/* webpackChunkName: "editor" */ './../classes/editor');
|
||||
|
||||
return new Editor(settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows JSON output of editor saved data
|
||||
*/
|
||||
previewData() {
|
||||
this.editor.save().then((savedData) => {
|
||||
cPreview.show(savedData, this.nodes.outputWrapper);
|
||||
});
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue