-
Notifications
You must be signed in to change notification settings - Fork 669
/
tinyMCE.html
53 lines (48 loc) · 1.91 KB
/
tinyMCE.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="x-ua-compatible" content="IE=Edge"/>
<title>At.js</title>
<link rel="stylesheet" href="../dist/css/jquery.atwho.css" />
<link rel="stylesheet" href="./style.css" />
<!-- // <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> -->
<!-- // <script type="text/javascript" src="http://ichord.github.io/Caret.js/src/jquery.caret.js"></script> -->
<script type="text/javascript" src="../bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../bower_components/Caret.js/dist/jquery.caret.js"></script>
<script type="text/javascript" src="../dist/js/jquery.atwho.js"></script>
<script src="http://tinymce.cachefly.net/4.1/tinymce.min.js"></script>
<script type="text/javascript">
$(function(){
var jeremy = decodeURI("J%C3%A9r%C3%A9my") // Jérémy
var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", jeremy];
tinymce.init({
selector: "#editor",
init_instance_callback: function(editor) {
$(editor.contentDocument.activeElement).atwho({at: "@", data: names});
},
setup: function(editor) {
editor.on('keydown', function(e) {
if(e.keyCode == 13 && $(editor.contentDocument.activeElement).atwho('isSelecting'))
return false
})
}
});
});
</script>
</head>
<body>
<div class="container wrapper">
<header>
<h3>Example for tinyMCE editor</h3>
</header>
<div id="main">
<textarea id="editor">Easy! You should check out MoxieManager!</textarea>
<footer>
<h2>
-> <a class="github" href="https://github.com/ichord/At.js">Fork me on GitHub!</a>
</h2>
</footer>
</div>
</div>
</body>
</html>