Skip to content

Commit 042ccd1

Browse files
committed
代码评论模板更新
1 parent 68f5494 commit 042ccd1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Coding_iOS/Resources/diff-ios.html

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html><head lang="zh-cn">
22
<meta charset="UTF-8">
33
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4-
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=0.5,maximum-scale=2.0,user-scalable=1">
4+
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=0.5,maximum-scale=2.0,user-scalable=1">
55
<meta name="apple-mobile-web-app-capable" content="yes">
66
<meta name="apple-mobile-web-app-status-bar-style" content="black">
77
<meta name="format-detection" content="telephone=no">
@@ -839,15 +839,15 @@
839839
html.push('<td class="diff-line-num '+prefixClass+'">...</td>');
840840
html.push('<td class="diff-line-num '+prefixClass+'">...</td>');
841841
} else if (prefixClass === 'gi') {
842-
html.push('data-line="'+diffLine.rightNo+'">');
842+
html.push('data-line="'+diffLine.rightNo+'" data-type="1">');
843843
html.push('<td class="diff-line-num '+prefixClass+'" ></td>');
844844
html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.rightNo+'"></td>');
845845
} else if (prefixClass === 'gd') {
846-
html.push('data-line="'+diffLine.leftNo+'">');
846+
html.push('data-line="'+diffLine.leftNo+'" data-type="2">');
847847
html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.leftNo+'"></td>');
848848
html.push('<td class="diff-line-num '+prefixClass+'" ></td>');
849849
} else {
850-
html.push('data-line="'+diffLine.leftNo+'">');
850+
html.push('data-line="'+diffLine.leftNo+'" data-type="3">');
851851
html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.leftNo+'"></td>');
852852
html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.rightNo+'"></td>');
853853
}
@@ -867,6 +867,7 @@
867867
htmls.push('data-noteable-id="'+item.noteable_id+'" ');
868868
htmls.push('data-id="'+item.id+'" ');
869869
htmls.push('data-line="'+item.line+'" ');
870+
htmls.push('data-type="'+item.change_type+'" ');
870871
htmls.push('data-position="'+item.position+'" ');
871872
htmls.push('data-path="'+item.path+'" ');
872873
htmls.push('>');
@@ -904,7 +905,7 @@
904905
var generateComments = function(comments) {
905906
$.each(comments, function(index, item) {
906907
var position = item.position;
907-
var $tr = $('tr[data-position="'+position+'"]');
908+
var $tr = item.change_type > 0 ? $('tr[data-line='+item.line+'][data-type='+item.change_type+']') : $('tr[data-position='+item.position+']');
908909
var html = '';
909910
if ($tr.next().hasClass('inline-comments')) {
910911
html = drawComment(item);
@@ -1013,6 +1014,7 @@
10131014
'path': path,
10141015
'position': $this.parent().data('position'),
10151016
'line': $this.parent().data('line'),
1017+
'change_type': $this.parent().data('type'),
10161018
'anchor': anchor
10171019
};
10181020
document.location.href = 'coding://line_note?' + $.param(params);
@@ -1031,6 +1033,7 @@
10311033
'path': $this.data('path'),
10321034
'position': $this.data('position'),
10331035
'line': $this.data('line'),
1036+
'change_type': $this.data('type'),
10341037
'anchor': anchor
10351038
};
10361039
document.location.href = 'coding://line_note_comment?' + $.param(params);

0 commit comments

Comments
 (0)