1、增加本地预保存功能

2、候选函数框标题修改 ,文件名和代码方法分开。
3.代码很长 做成左右拖拽
4.点赞和拖拽缩小,级别区分。
5、现在提交注释会增加断网超时提示
This commit is contained in:
杨树明775174143 2018-09-15 13:18:37 +08:00
parent 4098dedce4
commit 04d0443038
6 changed files with 253 additions and 55 deletions

View File

@ -437,10 +437,7 @@ a:hover {
} }
.codeline { .codeline {
min-width: 910px;
width: 100%; width: 100%;
/*height: 23px;*/
/*background: #f1efec;*/
display: flex; display: flex;
} }
@ -1434,7 +1431,7 @@ pre.prettyprint {
.mypre{ .mypre{
margin: 0 0 0; margin: 0 0 0;
overflow:visible !important; overflow:auto;
font-size: 16px; font-size: 16px;
white-space:pre; white-space:pre;
} }
@ -1492,25 +1489,37 @@ pre.prettyprint {
.deg270{ .deg270{
transform: rotate(270deg) !important; transform: rotate(270deg) !important;
font-size: 18px; font-size: 10px;
color: #8F8986; color: #8F8986;
margin-left: 1.2px;
} }
.deg90{ .deg90{
transform: rotate(90deg) !important; transform: rotate(90deg) !important;
font-size: 18px; font-size: 10px;
color: #8F8986; color: #8F8986;
margin-left: 0.6px;
} }
.topthumbsThis{ .topthumbsThis{
margin: 13px 0px 0px 15px; margin:48px 0px 0px 17px;
width: 27px; width: 27px;
padding-left: 7px; padding-left: 7px;
} }
.topthumbsThis p{
display: flex;
}
.thumbsThisnth2{ .thumbsThisnth2{
height: 20px; line-height: 12px;
height: 12px;
color: #000; color: #000;
text-align: center; text-align: center;
margin-left: -5px; margin-left: 2px;
display: flex;
}
.margin003{
margin: 0 0px -3px;
}
.margin023{
margin: 0 2px -3px;
} }
.newtopthumbs{ .newtopthumbs{
margin: 4px 0px 0px 16px; margin: 4px 0px 0px 16px;
@ -1518,7 +1527,7 @@ pre.prettyprint {
padding-left: 8px; padding-left: 8px;
} }
.thumbsmarginLeft{ .thumbsmarginLeft{
margin-left: 0px; margin-left: 2px;
} }
.modify-anno{ .modify-anno{
float: right; float: right;
@ -1675,4 +1684,10 @@ animation: myfirst 10s;
width: 87%; width: 87%;
margin-left: 28px; margin-left: 28px;
padding: 13px 3px 13px 0px !important; padding: 13px 3px 13px 0px !important;
}
.newItemcommentPanel .pr .commentPanel .thumbsThis .mt15 .margin003{
margin: 0 0px 0px;
}
.newItemcommentPanel .pr .commentPanel .thumbsThis .mt15 .margin023 {
margin: 0 2px 0px;
} }

View File

@ -1,5 +1,18 @@
var flag = true;//左侧默认显示 var flag = true;//左侧默认显示
function setlocalStorage(id,value){
var newlocalStoragevaule=localStorage.setItem(id,value);
return newlocalStoragevaule;
}
function getlocalStorage(id){
var oldlocalStoragevaule=localStorage.getItem(id)
return oldlocalStoragevaule;
}
function deletelocalStorage(id){
localStorage.removeItem(id);
}
function getCookie(name) { function getCookie(name) {
var cookieValue = null; var cookieValue = null;
if (document.cookie && document.cookie !== '') { if (document.cookie && document.cookie !== '') {
@ -68,6 +81,14 @@ function close_modify_anno(){
//注入html代码 //注入html代码
function inject_modifyAnno_html(item,file_id,linenum,anno_id) { function inject_modifyAnno_html(item,file_id,linenum,anno_id) {
var modifyAnno_id= Number(getlocalStorage("modifyAnno_id"));
var modifyAnno_num=Number(getlocalStorage("modifyAnno_num"));
var modifyAnno_line=Number(getlocalStorage("modifyAnno_line"));
var modifyAnno_value=getlocalStorage("modifyAnno_value");
$("#modification").hide(); $("#modification").hide();
$(".modify_anno_div").remove(); $(".modify_anno_div").remove();
$("#modify_anno_textarea").removeAttr("readonly"); $("#modify_anno_textarea").removeAttr("readonly");
@ -83,6 +104,10 @@ function inject_modifyAnno_html(item,file_id,linenum,anno_id) {
ev=arguments.callee.caller.arguments[0]||window.event; ev=arguments.callee.caller.arguments[0]||window.event;
} }
ev.stopPropagation(); ev.stopPropagation();
if(file_id===modifyAnno_id&&linenum===modifyAnno_num&&anno_id===modifyAnno_line){
$("#modify_anno_textarea").val(modifyAnno_value);
}
} }
// FIXME // FIXME
@ -103,16 +128,26 @@ function modify_anno(file_id,line_num,anno_id){
beforeSend: function (xhr, settings) { beforeSend: function (xhr, settings) {
xhr.setRequestHeader("X-CSRFToken", csrftoken); xhr.setRequestHeader("X-CSRFToken", csrftoken);
}, },
timeout: 8000,
success: function (data) { success: function (data) {
if (data.status === "success") { if (data.status === "success") {
alert(data.msg) alert(data.msg)
$("#ItemcommentPanel").remove() $("#ItemcommentPanel").remove()
$("."+file_id+line_num).text(data.anno_content) $("."+file_id+line_num).text(data.anno_content)
show_annotation(file_id,line_num) show_annotation(file_id,line_num);
deletelocalStorage("modifyAnno_id");
deletelocalStorage("modifyAnno_num")
deletelocalStorage("modifyAnno_line")
deletelocalStorage("modifyAnno_value")
}else{ }else{
alert(data.msg) alert(data.msg)
} }
} },error:function(jqXHR, textStatus, errorThrown){
if(textStatus == 'timeout'){
alert('网络故障!');
}
}
}); });
} }
@ -229,6 +264,7 @@ function add_comment_action(item, id, type) {
data: { 'object_id': id, 'type': type, "content": content }, data: { 'object_id': id, 'type': type, "content": content },
dataType: 'json', dataType: 'json',
async: true, async: true,
timeout: 8000,
beforeSend: function (xhr, settings) { beforeSend: function (xhr, settings) {
xhr.setRequestHeader("X-CSRFToken", csrftoken); xhr.setRequestHeader("X-CSRFToken", csrftoken);
}, },
@ -236,10 +272,17 @@ function add_comment_action(item, id, type) {
if (data.status === 'success') { if (data.status === 'success') {
html_str = data.html_str html_str = data.html_str
show_new_comment(item, html_str); show_new_comment(item, html_str);
deletelocalStorage("writetext_id");
deletelocalStorage("writetext_value");
} else { } else {
alert(data.msg); alert(data.msg);
} }
} },error:function(jqXHR, textStatus, errorThrown){
alert(1)
if(textStatus == 'timeout'){
alert('网络故障!');
}
}
}); });
ev = window.event; ev = window.event;
if(ev==undefined){ if(ev==undefined){
@ -249,7 +292,7 @@ function add_comment_action(item, id, type) {
} }
//添加评论 //添加评论
function show_new_comment(item, html_str) { function show_new_comment(item, html_str) {onclick="add_annotation(this,199,18)"
$(item).parents(".parthalf_comment").after(html_str); $(item).parents(".parthalf_comment").after(html_str);
$(item).parents(".comment-btn").find(".comment-write").addClass("none"); $(item).parents(".comment-btn").find(".comment-write").addClass("none");
@ -304,7 +347,6 @@ function add_annotation(item,file_id, line_num) {
var selectValue = $(item).siblings(".put-select").find(".active").html().trim(); var selectValue = $(item).siblings(".put-select").find(".active").html().trim();
var text_context = "#addno-text-" + file_id+"-"+line_num; var text_context = "#addno-text-" + file_id+"-"+line_num;
var content = $(text_context).val(); var content = $(text_context).val();
console.log(content);
if (content.trim().length == 0) { if (content.trim().length == 0) {
@ -314,9 +356,16 @@ function add_annotation(item,file_id, line_num) {
if (selectValue == "注释") { if (selectValue == "注释") {
// 向addAnnatation中发请求 // 向addAnnatation中发请求
submit_annotation(file_id, line_num, content); submit_annotation(file_id, line_num, content);
deletelocalStorage("file_id");
deletelocalStorage("line_num");
deletelocalStorage("item_value");
deletelocalStorage("status_value");
} else { } else {
submit_question(file_id, line_num, content); submit_question(file_id, line_num, content);
deletelocalStorage("issuefile_id");
deletelocalStorage("issueline_num");
deletelocalStorage("issueitem_value");
deletelocalStorage("status_value");
} }
} }
@ -331,6 +380,7 @@ function submit_annotation(file_id, line_num, content) {
beforeSend: function (xhr, settings) { beforeSend: function (xhr, settings) {
xhr.setRequestHeader("X-CSRFToken", csrftoken); xhr.setRequestHeader("X-CSRFToken", csrftoken);
}, },
timeout: 8000,
success: function (data) { success: function (data) {
if (data.status == 'success') { if (data.status == 'success') {
// 因为可能注释或问题没有值的时候不会为该代码块添加html代码所以首先判断 // 因为可能注释或问题没有值的时候不会为该代码块添加html代码所以首先判断
@ -352,7 +402,11 @@ function submit_annotation(file_id, line_num, content) {
}else{ }else{
alert(data.msg) alert(data.msg)
} }
} },error:function(jqXHR, textStatus, errorThrown){
if(textStatus == 'timeout'){
alert('网络故障!');
}
}
}); });
} }
@ -641,7 +695,9 @@ $(function () {
ev.stopPropagation(); ev.stopPropagation();
}) })
}) })
function addcomments(item) { function addcomments(item,annopk) {
var annopkid= Number(getlocalStorage("writetext_id"));
var writetext_value= getlocalStorage("writetext_value")
$(item).siblings(".comment-write").removeClass("none"); $(item).siblings(".comment-write").removeClass("none");
$(item).addClass("none"); $(item).addClass("none");
ev = window.event; ev = window.event;
@ -649,6 +705,9 @@ function addcomments(item) {
ev=arguments.callee.caller.arguments[0]||window.event; ev=arguments.callee.caller.arguments[0]||window.event;
} }
ev.stopPropagation(); ev.stopPropagation();
if(annopk===annopkid){
$("#writetext_"+annopkid).val(writetext_value);
}
} }
function cancelcom(item) { function cancelcom(item) {
@ -1073,19 +1132,131 @@ function close_tab(path) {
// 对应目录级别的addnoPanel // 对应目录级别的addnoPanel
function show_next_addnoPanel(file_id){ function show_next_addnoPanel(file_id){
var oldfile_id= Number(getlocalStorage("rightannotationid"));
var olditem_value=getlocalStorage("rightannotationvalue");
$("#addno-panel-"+file_id).show(); $("#addno-panel-"+file_id).show();
ev = window.event; ev = window.event;
if(ev==undefined){ if(ev==undefined){
ev=arguments.callee.caller.arguments[0]||window.event; ev=arguments.callee.caller.arguments[0]||window.event;
} }
ev.stopPropagation(); ev.stopPropagation()
if(file_id===oldfile_id){
$("#addno-text-"+file_id+"-0").val(olditem_value);
}
}
function Input_Content(item,file_id,line_num) {
var status_value= getlocalStorage("status_value");
if(status_value==="注释"){
setlocalStorage("item_value",item.value);
setlocalStorage("file_id",file_id);
setlocalStorage("line_num",line_num);
}else if(status_value==="问题"){
setlocalStorage("issueitem_value",item.value);
setlocalStorage("issuefile_id",file_id);
setlocalStorage("issueline_num",line_num);
}
}
function Input_modifyAnno(item,file_id,line_num,row){
setlocalStorage("modifyAnno_value",item.value);
setlocalStorage("modifyAnno_id",file_id);
setlocalStorage("modifyAnno_num",line_num);
setlocalStorage("modifyAnno_line",row);
}
function Input_writetext(item,annopk){
setlocalStorage("writetext_value",item.value);
setlocalStorage("writetext_id",annopk);
} }
function addannotation(id,num){
setlocalStorage("status_value","注释");
var oldfile_id= Number(getlocalStorage("file_id"));
var oldline_num=Number(getlocalStorage("line_num"));
var olditem_value=getlocalStorage("item_value");
$("#addno-text-"+id+"-"+num).val(" ");
if(oldfile_id!=null){
if(id===oldfile_id&&num===oldline_num){
$("#addno-text-"+oldfile_id+"-"+oldline_num).val(olditem_value);
}
}
}
function addissue(id,num) {
setlocalStorage("status_value","问题");
var oldline_num= Number(getlocalStorage("issueline_num"));
var oldfile_id=Number(getlocalStorage("issuefile_id"));
var olditem_value=getlocalStorage("issueitem_value");
$("#addno-text-"+id+"-"+num).val(" ");
if(oldfile_id!=null){
if(id===oldfile_id&&num===oldline_num){
$("#addno-text-"+oldfile_id+"-"+oldline_num).val(olditem_value);
}
}
}
function rightaddannotation(id,num){
console.log(id)
console.log(num)
setlocalStorage("rightstatus_value","注释");
var oldfile_id= Number(getlocalStorage("rightannotationid"));
var oldline_num=Number(getlocalStorage("rightannotationnum"));
var olditem_value=getlocalStorage("rightannotationvalue");
$("#addno-text-"+id+"-"+num).val(" ");
if(oldfile_id!=null){
if(id===oldfile_id&&num===oldline_num){
$("#addno-text-"+id+"-"+num).val(olditem_value);
}
}
}
function rightaddissue(id,num) {
console.log(id)
console.log(num)
setlocalStorage("rightstatus_value","问题");
var oldline_num= Number(getlocalStorage("righissuenum"));
var oldfile_id=Number(getlocalStorage("righissuevid"));
var olditem_value=getlocalStorage("righissuevalue");
$("#addno-text-"+id+"-"+num).val(" ");
if(oldfile_id!=null){
if(id===oldfile_id&&num===oldline_num){
$("#addno-text-"+id+"-"+num).val(olditem_value);
}
}
}
function Input_file(item,file_id,line_num){
var status_value= getlocalStorage("rightstatus_value");
if(status_value==="注释"){
setlocalStorage("rightannotationvalue",item.value);
setlocalStorage("rightannotationid",file_id);
setlocalStorage("rightannotationnum",line_num);
}else if(status_value==="问题"){
setlocalStorage("righissuevalue",item.value);
setlocalStorage("righissuevid",file_id);
setlocalStorage("righissuenum",line_num);
}
}
//注入html代码 //注入html代码
function inject_addnoPanel_html(item,file_id,linenum) { function inject_addnoPanel_html(item,file_id,linenum) {
// console.log(file_id);
// console.log(linenum); var status_value= getlocalStorage("status_value");
var oldfile_id= Number(getlocalStorage("file_id"));
var oldline_num=Number(getlocalStorage("line_num"));
var olditem_value=getlocalStorage("item_value");
$("#ItemcommentPanel").remove(); $("#ItemcommentPanel").remove();
$("#ItemquestionPanel").remove(); $("#ItemquestionPanel").remove();
@ -1093,10 +1264,10 @@ function inject_addnoPanel_html(item,file_id,linenum) {
'<div class="trangle-op"></div>'+ '<div class="trangle-op"></div>'+
'<div class="put-content">'+ '<div class="put-content">'+
'<p class="put-select clearfix" id="addno-select-'+linenum+'">'+ '<p class="put-select clearfix" id="addno-select-'+linenum+'">'+
'<span class="active put-selectspanactive" onclick=\'$(this).siblings("span").removeClass("active");$(this).addClass("active");\'>注释</span>'+ '<span class="active put-selectspanactive" onclick=\'$(this).siblings("span").removeClass("active");$(this).addClass("active");addannotation('+file_id+','+linenum+');\'>注释</span>'+
'<span class="put-selectspanactive" onclick=\'$(this).siblings("span").removeClass("active"); $(this).addClass("active");\'>问题</span>'+ '<span class="put-selectspanactive" onclick=\'$(this).siblings("span").removeClass("active"); $(this).addClass("active");addissue('+file_id+','+linenum+');\'>问题</span>'+
'</p>'+ '</p>'+
'<textarea id="addno-text-'+file_id+'-'+linenum+'" class="put-text" placeholder="输入注释或者问题"> </textarea>'+ '<textarea id="addno-text-'+file_id+'-'+linenum+'" oninput="Input_Content(this,'+file_id+','+linenum+')" class="put-text" placeholder="输入注释或者问题"> </textarea>'+
'<a href="#" onclick="add_annotation(this,'+file_id+','+linenum+')" class="submit fr" id="submit">提交</a>'+ '<a href="#" onclick="add_annotation(this,'+file_id+','+linenum+')" class="submit fr" id="submit">提交</a>'+
'</div>'+ '</div>'+
'</div>'; '</div>';
@ -1106,6 +1277,9 @@ function inject_addnoPanel_html(item,file_id,linenum) {
ev=arguments.callee.caller.arguments[0]||window.event; ev=arguments.callee.caller.arguments[0]||window.event;
} }
ev.stopPropagation(); ev.stopPropagation();
if(file_id===oldfile_id&&linenum===oldline_num){
$("#addno-text-"+file_id+"-"+linenum).val(olditem_value);
}
} }
@ -1148,7 +1322,6 @@ function show_dir_annotation(file_id){
}, },
success: function (data) { success: function (data) {
if (data.status === "success") { if (data.status === "success") {
console.log(1111)
//console.log("linestatus_"+line_num); //console.log("linestatus_"+line_num);
//$("#loadCommentpanel").html(data.html_str); //$("#loadCommentpanel").html(data.html_str);
//$("#commentPanel").css("top", mousePos.y); //$("#commentPanel").css("top", mousePos.y);
@ -1298,8 +1471,17 @@ function add_file_annotation(item, file_id, line_num){
if (selectValue == "注释") { if (selectValue == "注释") {
// 向addAnnatation中发请求 // 向addAnnatation中发请求
submit_file_annotation(file_id, line_num, content); submit_file_annotation(file_id, line_num, content);
deletelocalStorage("rightannotationid");
deletelocalStorage("rightannotationnum");
deletelocalStorage("rightannotationvalue");
deletelocalStorage("rightstatus_value");
} else { } else {
submit_file_question(file_id, line_num, content); submit_file_question(file_id, line_num, content);
alert(1)
deletelocalStorage("righissuevid");
deletelocalStorage("righissuenum");
deletelocalStorage("righissuevalue");
deletelocalStorage("rightstatus_value");
} }
} }
@ -1322,9 +1504,9 @@ function show_file_annotation(file_id){
}, },
success: function (data) { success: function (data) {
if (data.status === "success") { if (data.status === "success") {
console.log(1111)
$("#ItemcommentPanel").remove() $("#ItemcommentPanel").remove()
var html="<div id='ItemcommentPanel' style='margin-top: 140px;'>"+data.html_str+"</div>" var html="<div id='ItemcommentPanel' class='newItemcommentPanel' style='margin-top: 140px;'>"+data.html_str+"</div>"
$("#dir_anno_"+file_id).append(html); $("#dir_anno_"+file_id).append(html);
}else{ }else{
alert(data.msg) alert(data.msg)

View File

@ -14,7 +14,7 @@
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},1)"></i> </p> <p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},1)"></i> </p>
{% endif %} {% endif %}
<p class="thumbsThisnth2"><span id="annosum_{{self_anno.id}}">{{ self_anno.voteup | add:self_anno.votedown }}</span></p> <p class="thumbsThisnth2 thumbsThisnthnew"><span id="annosum_{{self_anno.id}}">{{ self_anno.voteup | add:self_anno.votedown }}</span></p>
{% if self_anno.id in anno_vote_map and anno_vote_map|keyValue:self_anno.id == -1 %} {% if self_anno.id in anno_vote_map and anno_vote_map|keyValue:self_anno.id == -1 %}
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},-1)"></i> </p> <p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsAnno(this,{{self_anno.pk}},-1)"></i> </p>
@ -25,21 +25,21 @@
</div> </div>
<div class="fl commentparthalf"> <div class="fl commentparthalf">
<div class="parthalf_con clearfix"> <div class="parthalf_con clearfix">
<textarea id="modify_anno_textarea" class="fl break_word color-grey-des colorblack inlineBlock wi216" style="border:none" readonly>{{ self_anno.content }}</textarea> <textarea id="modify_anno_textarea" class="fl break_word color-grey-des colorblack inlineBlock wi216" oninput="Input_modifyAnno(this,{{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})" style="border:none" readonly>{{ self_anno.content }}</textarea>
{% if allow_modify %} {% if allow_modify %}
<a class="modify-anno btn btn-blue fr mt10 mb10" id="modification" href="javascript:void(0)" onclick="inject_modifyAnno_html(this,{{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})">修改</a> <a class="modify-anno btn btn-blue fr mt10 mb10" id="modification" href="javascript:void(0)" onclick="inject_modifyAnno_html(this,{{self_anno.file_id}},{{self_anno.linenum}},{{self_anno.id}})">修改</a>
<span class="color-grey-des inlineBlock marbox fr mt11">{{self_anno.user.nick_name}}</span> <span class="color-grey-des inlineBlock marbox fr mt11">{{self_anno.user.nick_name}}</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="parthalf_comment"> <div class="parthalf_comment">
<div class="comment-btn clearfix borderbottom borderbottombox"> <div class="comment-btn clearfix borderbottom borderbottombox">
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this)" >添加评论</a> <a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this,{{ self_anno.pk }})" >添加评论</a>
<div class="comment-write clearfix none"> <div class="comment-write clearfix none">
<textarea class="writetext" id="writetext_{{ self_anno.pk }}" placehoder="请输入评论内容"></textarea> <textarea class="writetext" id="writetext_{{ self_anno.pk }}" oninput="Input_writetext(this,{{ self_anno.pk }})" placehoder="请输入评论内容"></textarea>
<a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a> <a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a>
<a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ self_anno.pk }},"annotation")'>添加评论</a> <a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ self_anno.pk }},"annotation")'>添加评论</a>
</div> </div>
@ -50,13 +50,13 @@
{% for comment in anno_comments %} {% for comment in anno_comments %}
{% if comment.annotation.pk == self_anno.pk %} {% if comment.annotation.pk == self_anno.pk %}
<div class="fl thumbsThis newtopthumbs"> <div class="fl thumbsThis newtopthumbs">
<div class="fl"> <div class="fl mt15">
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %} {% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %}
<p><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p> <p style="height:10px;" class="margin003"><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
{% else %} {% else %}
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p> <p class="margin003"><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
{% endif %} {% endif %}
<p class="thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p> <p class="margin023 thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == -1 %} {% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == -1 %}
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p> <p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
@ -75,8 +75,8 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% for anno in annos%} {% for anno in annos%}
{% if anno not in self_annos %} {% if anno not in self_annos %}
@ -90,7 +90,7 @@
{% endif %} {% endif %}
<p class="thumbsThisnth2"><span id="annosum_{{anno.id}}">{{ anno.voteup | add:anno.votedown }}</span></p> <p class="thumbsThisnth2"><span id="annosum_{{anno.id}}">{{ anno.voteup | add:anno.votedown }}</span></p>
{% if anno.id in anno_vote_map and anno_vote_map|keyValue:anno.id == -1 %} {% if anno.id in anno_vote_map and anno_vote_map|keyValue:anno.id == -1 %}
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},-1)"></i> </p> <p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},-1)"></i> </p>
{% else %} {% else %}
<p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},-1)"></i> </p> <p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsAnno(this,{{anno.pk}},-1)"></i> </p>
@ -107,9 +107,9 @@
<div class="parthalf_comment"> <div class="parthalf_comment">
<div class="comment-btn clearfix borderbottom"> <div class="comment-btn clearfix borderbottom">
<span class="color-grey-des inlineBlock marbox">{{anno.user.nick_name}}</span> <span class="color-grey-des inlineBlock marbox">{{anno.user.nick_name}}</span>
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this)" >添加评论</a> <a href="javascript:void(0)" class="btn btn-blue fr" onclick="addcomments(this,{{ anno.pk }})" >添加评论</a>
<div class="comment-write clearfix none"> <div class="comment-write clearfix none">
<textarea class="writetext" id="writetext_{{ anno.pk }}" placehoder="请输入评论内容"></textarea> <textarea class="writetext" id="writetext_{{ anno.pk }}" oninput="Input_writetext(this,{{ anno.pk }})" placehoder="请输入评论内容"></textarea>
<a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a> <a href="javascript:void(0)" class="btn fr" onclick="cancelcom(this)">取消</a>
<a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ anno.pk }},"annotation")'>添加评论</a> <a href="javascript:void(0)" class="btn btn-blue fr" style="margin-right:10px;" onclick='add_comment_action(this,{{ anno.pk }},"annotation")'>添加评论</a>
</div> </div>
@ -120,13 +120,13 @@
{% for comment in anno_comments %} {% for comment in anno_comments %}
{% if comment.annotation.pk == anno.pk %} {% if comment.annotation.pk == anno.pk %}
<div class="fl thumbsThis newtopthumbs"> <div class="fl thumbsThis newtopthumbs">
<div class="fl"> <div class="fl mt15">
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %} {% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == 1 %}
<p><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p> <p class="margin003"><i class="fa fa-play thumbs_active deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
{% else %} {% else %}
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p> <p class="margin003"><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
{% endif %} {% endif %}
<p class="thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p> <p class="margin023 thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
{% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == -1 %} {% if comment.id in comment_vote_map and comment_vote_map|keyValue:comment.id == -1 %}
<p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p> <p><i class="fa fa-play thumbs_active deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
@ -144,7 +144,7 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

View File

@ -63,10 +63,11 @@
<div class="trangle-op"></div> <div class="trangle-op"></div>
<div class="put-content"> <div class="put-content">
<p class="put-select clearfix" id="addno-select-0"> <p class="put-select clearfix" id="addno-select-0">
<span class="active put-selectspanactive" onclick='$(this).siblings("span").removeClass("active"); $(this).addClass("active");'>注释</span> <span class="active put-selectspanactive" onclick='$(this).siblings("span").removeClass("active"); $(this).addClass("active");rightaddannotation({{file_id}},0);'>注释</span>
<span class="put-selectspanactive" onclick='$(this).siblings("span").removeClass("active"); $(this).addClass("active");'>问题</span> <span class="put-selectspanactive" onclick='$(this).siblings("span").removeClass("active"); $(this).addClass("active");rightaddissue({{file_id}},0);'>问题</span>
</p> </p>
<textarea id="addno-text-{{file_id}}-0" class="put-text" placeholder="输入注释或者问题"> </textarea> <textarea id="addno-text-{{file_id}}-0" oninput="Input_file(this,{{file_id}},0)" class="put-text" placeholder="输入注释或者问题"> </textarea>
<a href="#" onclick="add_file_annotation(this,{{file_id}},0)" class="submit fr" id="submit">提交</a> <a href="#" onclick="add_file_annotation(this,{{file_id}},0)" class="submit fr" id="submit">提交</a>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="fl thumbsThis newtopthumbs"> <div class="fl thumbsThis newtopthumbs">
<div class="fl"> <div class="fl mt15">
<p><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p> <p class="margin003"><i class="fa fa-play deg270" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},1)"></i> </p>
<p class="thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p> <p class="margin023 thumbsThisnth2 thumbsmarginLeft"><span id="comment_{{comment.pk}}">{{ comment.voteup | add:comment.votedown}}</span></p>
<p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p> <p><i class="fa fa-play deg90" aria-hidden="true" onclick="thumbsComment(this,{{comment.pk}},-1)"></i> </p>
</div> </div>
<div class="fl comment-item"> <div class="fl comment-item">

View File

@ -1,4 +1,4 @@
<p class="search-title">搜索结果</p> <p class="search-title">候选函数</p>
<div class="resultform"> <div class="resultform">
{% if results|length == 0 %} {% if results|length == 0 %}
@ -7,7 +7,7 @@
{% for item in results %} {% for item in results %}
<div class="result-line"> <div class="result-line">
<span class="fl">{{ forloop.counter }}. </span> <span class="fl">{{ forloop.counter }}. </span>
<a class="fl" href="javascript:void(0)" class="re-path" title="{{item.2}}" onclick='add_tab({{project_id}},"{{item.1}}","{{item.0}}")'>{{ item.2|safe }}</a> <a class="fl mr20" href="javascript:void(0)" class="re-path" title="{{item.2}}" onclick='add_tab({{project_id}},"{{item.1}}","{{item.0}}")'>{{ item.2|safe }}</a>
<a class="fl" href="javascript:void(0)" class="path-content" title="{{item.3}}" onclick='add_tab({{project_id}},"{{item.1}}","{{item.0}}")'>{{ item.3|safe }}</a> <a class="fl" href="javascript:void(0)" class="path-content" title="{{item.3}}" onclick='add_tab({{project_id}},"{{item.1}}","{{item.0}}")'>{{ item.3|safe }}</a>
<div class="fr FontFatimes" onclick='onClick_FeedbackButton(0,{{current_file_id}},"{{item.1}}",{{line_num}},"{{function_name}}");'><i class="fa fa-times" aria-hidden="true"></i></div> <div class="fr FontFatimes" onclick='onClick_FeedbackButton(0,{{current_file_id}},"{{item.1}}",{{line_num}},"{{function_name}}");'><i class="fa fa-times" aria-hidden="true"></i></div>
<div class="fr FontFaCheck" onclick='onClick_FeedbackButton(1,{{current_file_id}},"{{item.1}}",{{line_num}},"{{function_name}}");'><i class="fa fa-check" aria-hidden="true"></i></div> <div class="fr FontFaCheck" onclick='onClick_FeedbackButton(1,{{current_file_id}},"{{item.1}}",{{line_num}},"{{function_name}}");'><i class="fa fa-check" aria-hidden="true"></i></div>