-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhint-math.html
51 lines (47 loc) · 2.38 KB
/
hint-math.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
<!--
Data Source: http://www.htmlhelp.com/reference/html40/entities/symbols.html
HTML To Convert JSON http://convertjson.com/html-table-to-json.htm
Creator : ARGE|LOG [email protected]
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Mathematical symbol hinting</title>
<!-- include Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<!-- include summernote -->
<script type="text/javascript" src="/summernote-bs5.js"></script>
<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<link rel="stylesheet" href="example.css">
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
Summernote.init(document.querySelector('.summernote'), {
height: 200,
hint: {
match: /=(\w{0,})$/,
search: function(keyword, callback) {
fetch('symbols_mathematical-symbols_Greek-letters.json?v=1').then((response) => response.json()).then((data) => {
callback(data.filter(function(item){return item.Character.indexOf(keyword)>-1 || item.FIELD6.indexOf(keyword)>-1;}));
});
},
content: function(item) {
return item.FIELD6;
},
template: function(item) {
return '[<strong>' + item.FIELD6 + '</strong>] ' + item.Character;
},
},
});
});
</script>
</head>
<body>
<div class="container">
<h1>Summernote with Greek letters</h1>
<textarea class="summernote">type #su</textarea>
</div>
</body>
</html>