Skip to content

Commit

Permalink
* Added support for placeholder attribute as requested in issue #143
Browse files Browse the repository at this point in the history
…and #136

* Created examples
	- Basic (no toolbar)
	- Simple Toolbar
	- Clear formatting button as per request #138
* Moved layout to css/ src/ js/
* Added :focus support as per request #141
* Validated bower.json as per request #134 (Valid JSON)
  • Loading branch information
Steve King committed Apr 28, 2014
1 parent 9a58103 commit 81d7fd3
Show file tree
Hide file tree
Showing 9 changed files with 307 additions and 8 deletions.
14 changes: 13 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
1.0.2 - Merged some extras

* Added support for placeholder attribute as requested in issue #143 and #136
* Created examples
- Basic (no toolbar)
- Simple Toolbar
- Clear formatting button as per request #138
* Moved layout to css/ src/ js/
* Added :focus support as per request #141
* Validated bower.json as per request #134 (Valid JSON)


1.0.1 - Released to the universe

* General improvements and fixes (see graph)
* Merged a number of wild forks in
* Fixed issue #23 (NS_ERROR_UNEXPECTED) by @jordandh
* Fixed issue #118 (Format block buttons) by @beatnbite
* Multiple instances support by @brutuscat
* Multiple instances support by @brutuscat as per request #140
* Fix range selection in IE8 by @tilleryd
* Added throttle to update to improve performance on old browsers by @VictorBjelkholm
* UglifyJS Version of the code (bootstrap-wysiwyg.min.js)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bootstrap-wysiwyg",
"description": "Tiny Bootstrap and JQuery Based WISWYG rich text editor based on browser execCommand.",
"version": "1.0.1",
"version": "1.0.2",
"keywords": [
"css",
"js",
Expand Down
10 changes: 10 additions & 0 deletions index.css → css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* of the key things about the widget is that it allows you to do your own styling!
*/


#editor {
max-height: 250px;
height: 250px;
Expand All @@ -17,6 +18,15 @@
overflow: scroll;
outline: none;
}
#editor:focus{
border-color:rgba(82, 168, 236, 0.8);
outline:0;
outline:thin dotted \9;
-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}

#voiceBtn {
width: 20px;
color: transparent;
Expand Down
38 changes: 38 additions & 0 deletions examples/basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tiny, opensource, Bootstrap WYSIWYG rich text editor</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link href="../external/google-code-prettify/prettify.css" rel="stylesheet" />
<link rel="stylesheet"
href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
<link
href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css"
rel="stylesheet" />
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="../external/jquery.hotkeys.js"></script>
<script
src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="../external/google-code-prettify/prettify.js"></script>

<link href="../css/style.css" rel="stylesheet" />
<script src="../src/bootstrap-wysiwyg.js"></script>
</head>

<body>
<div class="container">
<h1>Basic editor, no fancy bits.</h1>
<div id="editor" class="lead" placeholder="This is a basic example with no toolbars."></div>
<div id="editorPreview"></div>
<p style="text-align: center;">
<a class="btn btn-large btn-default jumbo"
href="#!" onClick="$('#editorPreview').html($('#editor').html());">Submit</a>
</p>
</div>
<script type='text/javascript'>$('#editor').wysiwyg();</script>
</body>
</html>
124 changes: 124 additions & 0 deletions examples/clear-formatting.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tiny, opensource, Bootstrap WYSIWYG rich text editor</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link href="../external/google-code-prettify/prettify.css" rel="stylesheet" />
<link rel="stylesheet"
href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
<link
href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css"
rel="stylesheet" />
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="../external/jquery.hotkeys.js"></script>
<script
src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="../external/google-code-prettify/prettify.js"></script>

<link href="../css/style.css" rel="stylesheet" />
<script src="../src/bootstrap-wysiwyg.js"></script>
</head>

<body>
<div class="container">

<h1>Simple Editor with Toolbar</h1>
<div class="btn-toolbar" data-role="editor-toolbar"
data-target="#editor">
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown"
title="Font Size"><i class="icon-text-height"></i>&nbsp;<b
class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a data-edit="fontSize 5"><font size="5">Huge</font>
</a>
</li>
<li><a data-edit="fontSize 3"><font size="3">Normal</font>
</a>
</li>
<li><a data-edit="fontSize 1"><font size="1">Small</font>
</a>
</li>
</ul>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="bold"
title="Bold (Ctrl/Cmd+B)"><i class="icon-bold"></i>
</a> <a class="btn btn-default" data-edit="italic"
title="Italic (Ctrl/Cmd+I)"><i class="icon-italic"></i>
</a> <a class="btn btn-default" data-edit="strikethrough"
title="Strikethrough"><i class="icon-strikethrough"></i>
</a> <a class="btn btn-default" data-edit="underline"
title="Underline (Ctrl/Cmd+U)"><i class="icon-underline"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="insertunorderedlist"
title="Bullet list"><i class="icon-list-ul"></i>
</a> <a class="btn btn-default" data-edit="insertorderedlist"
title="Number list"><i class="icon-list-ol"></i>
</a> <a class="btn btn-default" data-edit="outdent"
title="Reduce indent (Shift+Tab)"><i class="icon-indent-left"></i>
</a> <a class="btn btn-default" data-edit="indent" title="Indent (Tab)"><i
class="icon-indent-right"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="justifyleft"
title="Align Left (Ctrl/Cmd+L)"><i class="icon-align-left"></i>
</a> <a class="btn btn-default" data-edit="justifycenter"
title="Center (Ctrl/Cmd+E)"><i class="icon-align-center"></i>
</a> <a class="btn btn-default" data-edit="justifyright"
title="Align Right (Ctrl/Cmd+R)"><i class="icon-align-right"></i>
</a> <a class="btn btn-default" data-edit="justifyfull"
title="Justify (Ctrl/Cmd+J)"><i class="icon-align-justify"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown"
title="Hyperlink"><i class="icon-link"></i>
</a>
<div class="dropdown-menu input-append">
<input class="span2" placeholder="URL" type="text"
data-edit="createLink" />
<button class="btn" type="button">Add</button>
</div>
</div>

<div class="btn-group">
<a class="btn btn-default" data-edit="unlink"
title="Remove Hyperlink"><i class="icon-cut"></i>
</a> <a class="btn btn-default"
title="Insert picture (or just drag & drop)" id="pictureBtn">
<i class="icon-picture"></i> <input type="file"
data-role="magic-overlay" data-target="#pictureBtn"
data-edit="insertImage" /> </a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="undo"
title="Undo (Ctrl/Cmd+Z)"><i class="icon-undo"></i>
</a> <a class="btn btn-default" data-edit="redo"
title="Redo (Ctrl/Cmd+Y)"><i class="icon-repeat"></i>
</a>

<a class="btn btn-default" data-edit="clearformat"
title="Clear Formatting" onClick="$('#editor').html($('#editor').text());"><i class='glyphicon glyphicon-fire'></i>
</a>

</div>
</div>
<div id="editor" class="lead" placeholder="This is a basic example with a simple toolbar."></div>
<div id="editorPreview"></div>
<p style="text-align: center;">
<a class="btn btn-large btn-default jumbo"
href="#!" onClick="$('#editorPreview').html($('#editor').html());">Submit</a>
</p>
</div>
<script type='text/javascript'>$('#editor').wysiwyg();</script>
</body>
</html>
119 changes: 119 additions & 0 deletions examples/simple-toolbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Tiny, opensource, Bootstrap WYSIWYG rich text editor</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link href="../external/google-code-prettify/prettify.css" rel="stylesheet" />
<link rel="stylesheet"
href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
<link
href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css"
rel="stylesheet" />
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="../external/jquery.hotkeys.js"></script>
<script
src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="../external/google-code-prettify/prettify.js"></script>

<link href="../css/style.css" rel="stylesheet" />
<script src="../src/bootstrap-wysiwyg.js"></script>
</head>

<body>
<div class="container">

<h1>Simple Editor with Toolbar</h1>
<div class="btn-toolbar" data-role="editor-toolbar"
data-target="#editor">
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown"
title="Font Size"><i class="icon-text-height"></i>&nbsp;<b
class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a data-edit="fontSize 5"><font size="5">Huge</font>
</a>
</li>
<li><a data-edit="fontSize 3"><font size="3">Normal</font>
</a>
</li>
<li><a data-edit="fontSize 1"><font size="1">Small</font>
</a>
</li>
</ul>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="bold"
title="Bold (Ctrl/Cmd+B)"><i class="icon-bold"></i>
</a> <a class="btn btn-default" data-edit="italic"
title="Italic (Ctrl/Cmd+I)"><i class="icon-italic"></i>
</a> <a class="btn btn-default" data-edit="strikethrough"
title="Strikethrough"><i class="icon-strikethrough"></i>
</a> <a class="btn btn-default" data-edit="underline"
title="Underline (Ctrl/Cmd+U)"><i class="icon-underline"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="insertunorderedlist"
title="Bullet list"><i class="icon-list-ul"></i>
</a> <a class="btn btn-default" data-edit="insertorderedlist"
title="Number list"><i class="icon-list-ol"></i>
</a> <a class="btn btn-default" data-edit="outdent"
title="Reduce indent (Shift+Tab)"><i class="icon-indent-left"></i>
</a> <a class="btn btn-default" data-edit="indent" title="Indent (Tab)"><i
class="icon-indent-right"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="justifyleft"
title="Align Left (Ctrl/Cmd+L)"><i class="icon-align-left"></i>
</a> <a class="btn btn-default" data-edit="justifycenter"
title="Center (Ctrl/Cmd+E)"><i class="icon-align-center"></i>
</a> <a class="btn btn-default" data-edit="justifyright"
title="Align Right (Ctrl/Cmd+R)"><i class="icon-align-right"></i>
</a> <a class="btn btn-default" data-edit="justifyfull"
title="Justify (Ctrl/Cmd+J)"><i class="icon-align-justify"></i>
</a>
</div>
<div class="btn-group">
<a class="btn btn-default dropdown-toggle" data-toggle="dropdown"
title="Hyperlink"><i class="icon-link"></i>
</a>
<div class="dropdown-menu input-append">
<input class="span2" placeholder="URL" type="text"
data-edit="createLink" />
<button class="btn" type="button">Add</button>
</div>
</div>

<div class="btn-group">
<a class="btn btn-default" data-edit="unlink"
title="Remove Hyperlink"><i class="icon-cut"></i>
</a> <a class="btn btn-default"
title="Insert picture (or just drag & drop)" id="pictureBtn">
<i class="icon-picture"></i> <input type="file"
data-role="magic-overlay" data-target="#pictureBtn"
data-edit="insertImage" /> </a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="undo"
title="Undo (Ctrl/Cmd+Z)"><i class="icon-undo"></i>
</a> <a class="btn btn-default" data-edit="redo"
title="Redo (Ctrl/Cmd+Y)"><i class="icon-repeat"></i>
</a>
</div>
</div>
<div id="editor" class="lead" placeholder="This is a basic example with a simple toolbar."></div>
<div id="editorPreview"></div>
<p style="text-align: center;">
<a class="btn btn-large btn-default jumbo"
href="#!" onClick="$('#editorPreview').html($('#editor').html());">Submit</a>
</p>
</div>
<script type='text/javascript'>$('#editor').wysiwyg();</script>
</body>
</html>
8 changes: 2 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
content="opensource rich wysiwyg text editor jquery bootstrap execCommand html5" />
<meta name="description"
content="This tiny jQuery Bootstrap WYSIWYG plugin turns any DIV into a HTML5 rich text editor" />
<link rel="apple-touch-icon"
href="//mindmup.s3.amazonaws.com/lib/img/apple-touch-icon.png" />
<link rel="shortcut icon"
href="http://mindmup.s3.amazonaws.com/lib/img/favicon.ico" />
<link href="external/google-code-prettify/prettify.css" rel="stylesheet" />
<link rel="stylesheet"
href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
Expand All @@ -25,8 +21,8 @@
<script
src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="external/google-code-prettify/prettify.js"></script>
<link href="index.css" rel="stylesheet" />
<script src="bootstrap-wysiwyg.js"></script>
<link href="css/style.css" rel="stylesheet" />
<script src="src/bootstrap-wysiwyg.js"></script>
</head>
<body>

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 81d7fd3

Please sign in to comment.