This repository has been archived by the owner on Mar 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 995
Neat Extras
Jonathan Camenisch edited this page Sep 9, 2013
·
5 revisions
Besides the well advertised feature set wysihtml5 offers some hidden gems that might be useful to developers (this is an incomplete list).
- When the browser supports rich text formatting the
<body>
of the page receives a css class “wysihtml5-supported”. This can be useful if you want to display some hints or activate certain UI elements. - When the browser supports rich text formatting a hidden
<input>
with name “_wysihtml5_mode” and value “1” is inserted after the textarea. This can be used on the server side to specially treat wysihtml5 output after form submit. - If within a
<form>
, the editor hooks into the “reset” and “submit” events and ensures that the rich text element is in sync with the original<textarea>
- Following keyboard shortcuts are supported: bold (CTRL + B), italic (CTRL + I), underline (CTRL + U)
For a start, let’s assume that you have a simple web page, you want to make editable with Aloha Editor and you already have placed Aloha Editor on your web server.
This is your web page:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Getting Started with Aloha Editor</title>
<link rel="stylesheet" href="index.css" type="text/css">
</head>
<body>
<div id="main">
<div id="content"><p>Getting started with Aloha Editor!</p></div>
</div>
</body>