Newer
Older
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
@extends('layouts.app')
@section('content')
<div id="test-editor">
<div class="d-flex justify-content-center" id="loadingSpinner">
<div class="spinner-border" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<textarea style="display:none;" id="noteeditor">loading note
</textarea>
<input type="hidden" id="noteid">
</div>
<button type="button" class="btn btn-success">Success</button>
@endsection
@section('css')
<link rel="stylesheet" href="/editormd/css/editormd.css"/>
@endsection
@section('js')
<script src="/js/aes.js"></script>
<script src="/js/app.js"></script>
<script src="/editormd/editormd.min.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
loadNote();
});
function loadNote() {
$.ajax({
type: "GET",
url: '/api/getnote/{{$id}}',
success: function (data) {
var decrypted=decryptString(data.body);
$('#noteeditor').html(decrypted);
initEditor();
},
error: function (request, status, error) {
}
});
}
function initEditor(){
var editor = editormd("test-editor", {
width: "100%",
height: 720,
path: "/editormd/lib/"
});
}
</script>
@endsection