Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.

theonion/editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Nov 7, 2016
272c7d1 · Nov 7, 2016
Nov 7, 2016
Sep 18, 2015
Nov 7, 2016
Feb 5, 2016
Jul 24, 2014
May 18, 2016
Jul 31, 2014
Jul 12, 2016
Sep 18, 2015
Mar 20, 2014
Sep 1, 2014
Nov 7, 2016
Feb 17, 2016
Feb 5, 2016
Nov 7, 2016
Feb 5, 2016

Repository files navigation

Onion Editor Build Status

Overview

Onion Editor is built on top of The Guardian's Scribe, with extra features for inserting inline media.

Getting started

Install dependencies:

npm install
npm install -g bower
bower install

Run grunt to build

Adding modules

Because Scribe uses requirejs so are we.

See Scribe's readme for more info about writing plugins: https://github.com/guardian/scribe#architecture

Add your module to build.js and inlcude it as a dependecny in onion-editor.js

Module overview

We've written a few plugins for our needs:

betty-cropper Integrates OnionEditor with externally defined Betty Cropper tools

embed Enables embedding html snippets, other embed players, etc.

hr Inserts a horizontal rule

inline-objects Manages the needs & desires of all inline elements inserted into the editor. Mabybe a bit overloaded and should be split out into several plugins.

Consumes a JSON config file See: https://github.com/theonion/editor/blob/master/public/inline-config.json

link-ui Link prompt for creating and editing links.

onion-video Integrates Onion Video tools with the editor

placeholder Shows configurable placeholder text when the editor has no contents.

youtube Embed a youtube video by URL

sanitizer Patched version of Scribe's santize plugin that ignores the contents of DIVs

link-formatter Makes sure hrefs relative to a configured domain. Formatting happens on paste & when entered via the link ui.

NOTEZ:

  • ctrl+enter does a soft return on safari, while all other browsers use shift-return. WEIRD.
  • The AV Club css has a different margin-top for h4 tags than it does for p tags, so that's making it look like "extra space" is inserted when the make something an "h2"