##// END OF EJS Templates
inline comment form is displayed now under all comments.
marcink -
r1704:3efc47f5 beta
parent child Browse files
Show More
@@ -3456,6 +3456,9 form.comment-inline-form {
3456 color: #666;
3456 color: #666;
3457 font-size: 16px;
3457 font-size: 16px;
3458 }
3458 }
3459 .inline-comments-button .add-comment{
3460 margin:10px 5px !important;
3461 }
3459 .notifications{
3462 .notifications{
3460 width:22px;
3463 width:22px;
3461 padding:2px;
3464 padding:2px;
@@ -217,8 +217,6
217 YUD.setStyle(comments[c],'display',show);
217 YUD.setStyle(comments[c],'display',show);
218 }
218 }
219 })
219 })
220
221
222
220
223 YUE.on(YUQ('.line'),'click',function(e){
221 YUE.on(YUQ('.line'),'click',function(e){
224 var tr = e.currentTarget;
222 var tr = e.currentTarget;
@@ -230,7 +228,12
230 var f_path = YUD.getAttribute(node,'path');
228 var f_path = YUD.getAttribute(node,'path');
231 var lineno = getLineNo(tr);
229 var lineno = getLineNo(tr);
232 var form = createInlineForm(tr, f_path, lineno);
230 var form = createInlineForm(tr, f_path, lineno);
233 YUD.insertAfter(form,tr);
231 var target_tr = tr;
232 if(YUD.hasClass(YUD.getNextSibling(tr),'inline-comments')){
233 target_tr = YUD.getNextSibling(tr);
234 }
235 YUD.insertAfter(form,target_tr);
236 YUD.get('text_'+lineno).focus()
234 });
237 });
235
238
236 // inject comments into they proper positions
239 // inject comments into they proper positions
@@ -241,12 +244,13
241 var inlines = box.children;
244 var inlines = box.children;
242 for(var i=0; i<inlines.length; i++){
245 for(var i=0; i<inlines.length; i++){
243 try{
246 try{
247
244 var inline = inlines[i];
248 var inline = inlines[i];
245 var lineno = YUD.getAttribute(inlines[i],'line');
249 var lineno = YUD.getAttribute(inlines[i],'line');
246 var lineid = "{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno);
250 var lineid = "{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno);
247 var target_line = YUD.get(lineid);
251 var target_line = YUD.get(lineid);
248 var comments = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML))
252 var comment = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML))
249 YUD.insertAfter(comments,target_line.parentNode);
253 YUD.insertAfter(comment,target_line.parentNode);
250 }catch(e){}
254 }catch(e){}
251 }
255 }
252 }
256 }
@@ -40,7 +40,7
40 <div class="clearfix">
40 <div class="clearfix">
41 <div class="comment-help">${_('Commenting on line')} {1} ${_('comments parsed using')}
41 <div class="comment-help">${_('Commenting on line')} {1} ${_('comments parsed using')}
42 <a href="${h.url('rst_help')}">RST</a> ${_('syntax')}</div>
42 <a href="${h.url('rst_help')}">RST</a> ${_('syntax')}</div>
43 ${h.textarea('text')}
43 <textarea id="text_{1}" name="text"></textarea>
44 </div>
44 </div>
45 <div class="comment-button">
45 <div class="comment-button">
46 <input type="hidden" name="f_path" value="{0}">
46 <input type="hidden" name="f_path" value="{0}">
General Comments 0
You need to be logged in to leave comments. Login now