Skip to content

Instantly share code, notes, and snippets.

@leandromarques
Created July 20, 2016 20:10
Show Gist options
  • Save leandromarques/d810166faf7c4daaa66878a792785435 to your computer and use it in GitHub Desktop.
Save leandromarques/d810166faf7c4daaa66878a792785435 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Summernote1</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<script src="//cdn.jsdelivr.net/medium-editor/latest/js/medium-editor.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/medium-editor/latest/css/medium-editor.min.css" type="text/css" media="screen" charset="utf-8">
</head>
<style>
*{
padding: 0;
margin: 0;
}
#main {
width: 100%;
height: 600px;
background-image: url('images/doctor.jpg');
background-size: 100%;
}
#phrase {
margin-top: 150px;
width: 70%;
text-align: center;
font-size: 70px;
font-family: Verdana, sans-serif;
}
.editable {
border: 1px dotted blue;
}
</style>
<body>
<section id="main">
<div class="container">
<h1 class="editable" id="phrase">Isto é um teste</h1>
</div>
</section>
<script>
var onFocusOut = document.getElementById("phrase").onfocusout = function() {myFunction()};
function myFunction() {
console.log("saiu");
}
var elements = document.querySelectorAll('.editable'), editor = new MediumEditor(elements, {
toolbar: {
/* These are the default options for the toolbar,
if nothing is passed this is what is used */
anchorPreview: false,
allowMultiParagraphSelection: true,
buttons: ['bold', 'italic', 'underline', 'anchor', 'h2', 'h3', 'quote'],
diffLeft: 0,
diffTop: -10,
firstButtonClass: 'medium-editor-button-first',
lastButtonClass: 'medium-editor-button-last',
relativeContainer: null,
standardizeSelectionStart: false,
static: false,
/* options which only apply when static is true */
align: 'center',
sticky: false,
updateOnEmptySelection: false
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment