Skip to content

shgysk8zer0/WYSIWYG-Editor

Repository files navigation

HTML5 WYSIWYG-Editor

An all HTML, CSS, & JavaScript HTML5 WYSIWYG Editor
Uses <menu type="context"> and contenteditable to write HTML

Requirements

  • Firefox or Chrome (IE = 💩)
  • document.execCommand support
  • SVG, including <use>

Features

  • WYSIWYG Editor written in HTML & JavaScript using execCommand
  • Offline access using ApplicationCache
  • Full-Screen editing
  • Drag-n-Drop images to add them (base64 encoded data-URI)
  • Drag-n-Drop HTML files to import
  • Save and restore work using localStorage
  • Save work as file using download attribute

Keyboard Shortcuts

  • CTRL + a — Select All
  • CTRL + z — Undo
  • CTRL + y — Redo
  • CTRL + b — Toggle Bold
  • CTRL + i — Toggle Italic
  • CTRL + u — Toggle Underline
  • CTRL + k — Toggle Strike-through (Firefox Only)
  • CTRL + e — Justify Center (Firefox Only)
  • CTRL + l — Justify Left (Firefox Only)
  • CTRL + r — Justify Right (Firefox Only)
  • CTRL + j — Justify Full (Firefox Only)
  • tab — Increase Indentation (Blockquote for paragraphs)
  • SHIFT + tab — Decrease Indentation

:godmode: Contributing :godmode:

Helpful Tools

Installation

From source using Git

  1. Fork from GitHub
cd {/path/to/clone/to}
git clone git://github.com/{your-username}/WYSIWYG-Editor.git
cd WYSIWYG-Editor
git submodule init
git submodule update
  1. Edit, stage, commit, push
  2. Send pull request

Editing Stylesheets

Rather than use LESS, SASS, or whatever the "cool kids" are doing these days, I decided to use @import along with --css-vars

Requires

  • Firefox
  • Myth
  • Node.js
  • Comment out stylesheets/css/style.css and uncomment stylesheets/css/import.css

To update style.css

myth -c stylesheets/css/import.css stylesheets/css/style.css

Editing JavaScript

I have written a bash script for concatenating .js files.
You may either set executable permissions and run it from a GUI or execute it from command line with

bash scripts/combine.bash

You will have to comment out scripts/combined.js and uncomment all of the rest of the <script> tags.

Submodules used

Contact