-
Notifications
You must be signed in to change notification settings - Fork 297
/
Copy pathsummernote.blade.php
66 lines (59 loc) · 2.01 KB
/
summernote.blade.php
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
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<!-- SummerNote -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.css" rel="stylesheet">
<title>File Manager and SummerNote</title>
</head>
<body>
<div class="container">
<div id="summernote"></div>
</div>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<!-- SummerNote js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote-bs4.js"></script>
<script>
$(document).ready(function(){
// File manager button (image icon)
const FMButton = function(context) {
const ui = $.summernote.ui;
const button = ui.button({
contents: '<i class="note-icon-picture"></i> ',
tooltip: 'File Manager',
click: function() {
window.open('/file-manager/summernote', 'fm', 'width=1400,height=800');
}
});
return button.render();
};
$('#summernote').summernote({
toolbar: [
// [groupName, [list of button]]
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['fm-button', ['fm']],
],
buttons: {
fm: FMButton
}
});
});
// set file link
function fmSetLink(url) {
$('#summernote').summernote('insertImage', url);
}
</script>
</body>
</html>