Created
July 2, 2014 19:17
-
-
Save fitnr/d8eb1f57f9f585ffa253 to your computer and use it in GitHub Desktop.
Tinymouse - a simple tinymce editor to have on hand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>TinyMouse</title> | |
<!-- TinyMCE --> | |
<script type="text/javascript" src="tinymce-dist/tinymce.min.js"></script> | |
<script type="text/javascript"> | |
tinyMCE.init({ | |
mode : "exact", | |
elements: "elm1", | |
theme : "modern", | |
theme_advanced_buttons1: "styleselect,bold,italic,underline,|,bullist,numlist,|,code,", | |
fix_list_elements : true, | |
plugins : "paste", | |
auto_focus : "elm1", | |
style_formats : [ | |
{title: 'plain text', inline: 'p'}, | |
{title: 'header 1', block : 'h1' }, | |
{title: 'header 2', block : 'h2' }, | |
{title: 'header 2', block : 'h3' }, | |
{title: 'arr link', inline : 'a', classes: 'arr' } | |
], | |
//apply_source_formatting : true, | |
entity_encoding: "named" | |
}); | |
</script> | |
<style type="text/css"> | |
body { | |
padding: 0; | |
} | |
form { | |
width: 100%; | |
height: 100%; | |
padding: 5px; | |
} | |
#elm1 { | |
height: 75%; | |
} | |
#elm1, #elm2 { | |
width: 95%; | |
margin: 0; | |
width: 95%; | |
} | |
#elm2 { | |
height: 25%; | |
} | |
#elm1_tbl { | |
width: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<form id="form"> | |
<textarea id="elm1" name="elm1"> | |
</textarea> | |
<p> | |
<a href="#" id="action">Get HTML</a> | |
</p> | |
<textarea id="elm2" name="elm2"> | |
</textarea> | |
</form> | |
<script type="text/javascript"> | |
var e = document.getElementById('action'); | |
e.addEventListener('click', function() { | |
document.getElementById('elm2').value = tinyMCE.get('elm1').getContent(); | |
return false; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Drop https://github.com/tinymce/tinymce-dist in the folder to make it go.