-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathknowledge-view-preview.js
More file actions
70 lines (60 loc) · 2.19 KB
/
knowledge-view-preview.js
File metadata and controls
70 lines (60 loc) · 2.19 KB
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
67
68
$(document).ready(function() {
});
// 登録者で無い
var preview = function() {
$.post(_CONTEXT + '/open.knowledge/marked', {
title : '',
content : $('#comment').val()
}, function(data) {
var html = '<div class="question_Box">';
html += '<div class="question_image">';
html += '<img src="' + _CONTEXT + '/open.account/icon/' + $('#loginuser').val() + '" ';
// html += '<img src="' + _CONTEXT + '/images/loader.gif" ';
// html += 'data-echo="' + _CONTEXT + '/open.account/icon/' + $('#loginuser').val() + '" ';
html += 'alt="icon" width="64" height="64"/>';
html += '</div>';
html += '<div class="arrow_question">';
html += '<div style="word-break:normal" id="content">';
var content = data.content;
html += content;
html += '</div>';
html += '</div><!-- /.arrow_question -->';
html += '</div><!-- /.question_Box -->';
var target = '#preview';
var jqObj = $(target);
jqObj.html(html);
processDecoration(target).then(function() {
return processMathJax(target);
}).then(function() {
return processMermaid();
});
});
};
//登録者の場合
var previewans = function() {
$.post(_CONTEXT + '/open.knowledge/marked', {
title : '',
content : $('#comment').val()
}, function(data) {
var html = '<div class="question_Box">';
html += '<div class="answer_image">';
html += '<img src="' + _CONTEXT + '/open.account/icon/' + $('#loginuser').val() + '" ';
html += 'alt="icon" width="64" height="64"/>';
html += '</div>';
html += '<div class="arrow_answer">';
html += '<div style="word-break:normal" id="content">';
var content = data.content;
html += content;
html += '</div>';
html += '</div>';
html += '</div>';
var target = '#preview';
var jqObj = $(target);
jqObj.html(html);
processDecoration(target).then(function() {
return processMathJax(target);
}).then(function() {
return processMermaid();
});
});
};