Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including codex.editor.personality with all npm packages installed. Try it out:

var codexEditorPersonality = require("codex.editor.personality")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

codex.editor.personality v1.0.2

Personality tool for Codex Editor

Personality Tool for CodeX Editor

This tool allows you to create Personality block in your articles.

Example

Install via npm

npm i --save codex.editor.personality

Connect with Webpack

Include module in your application

var cdxEditorPersonality = require('exports-loader?cdxEditorPersonality!codex.editor.personality');

Include CSS filee

@import url("~codex.editor.personality/personality.css");

You will need exports-loader, css-loader and file-loader.

Install directly

  1. Download folder
  2. Add personality.js and personality.css files on your page

Usage

Pass new tool to the codex.editor.start method in tools array:

personality: {
    type             : 'personality',
    displayInToolbox : true,
    iconClassname    : 'cdx-personality-icon',
    prepare          : cdxEditorPersonality.prepare,
    render           : cdxEditorPersonality.render,
    save             : cdxEditorPersonality.save,
    validate         : cdxEditorPersonality.validate,
    destroy          : cdxEditorPersonality.destroy,
    enableLineBreaks : true,
    showInlineToolbar: true,
    config: {
        uploadURL: '/uploadPhoto',
    }
}
  1. Specify config.uploadURL with route for file uploading.

File uploading

To set personality photo, you will need server-side image uploader method.

Tool will send selected file on the route passed with config.uploadURL. Then you free to implement your own file-saving scheme.

Expected server response format:

{
  "success": 1,
  "data" : {
    "url" : "/uploaded/file/path.jpg"
  }
}

CodeX Editor

API oriented, open-source, block-styled Edtior.

https://github.com/codex-team/codex.editor

Authors

We are small team of Web-developing fans consisting of IFMO students and graduates located in St. Petersburg, Russia. Fell free to give us a feedback on team@ifmo.su

https://ifmo.su

Follow us!

VK: https://vk.com/codex_team

Telegram: https://t.me/codex_team

Instagram: https://www.instagram.com/codex_team

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free