Changeset - 5f883a5be2d1
[Not reviewed]
default
0 4 0
Mads Kiilerich - 11 years ago 2014-07-18 19:22:01
madski@unity3d.com
comments: show icon to the left of the code, only visible and clickable when hovering the code
4 files changed with 27 insertions and 18 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/diffs.py
Show inline comments
 
@@ -711,25 +711,25 @@ class DiffProcessor(object):
 
                        'link': _link_to_if(True, change['new_lineno'],
 
                                            '#%s' % anchor_new)
 
                    })
 
                    _html.append('''</td>\n''')
 
                    ###########################################################
 
                    # CODE
 
                    ###########################################################
 
                    comments = '' if enable_comments else 'no-comment'
 
                    _html.append('''\t<td class="%(cc)s %(inc)s">''' % {
 
                        'cc': code_class,
 
                        'inc': comments
 
                    })
 
                    _html.append('''\n\t\t<pre>%(code)s</pre>\n''' % {
 
                    _html.append('''\n\t\t<div class="add-bubble"><div>&nbsp;</div></div><pre>%(code)s</pre>\n''' % {
 
                        'code': change['line']
 
                    })
 

	
 
                    _html.append('''\t</td>''')
 
                    _html.append('''\n</tr>\n''')
 
        _html.append('''</table>''')
 
        if _html_empty:
 
            return None
 
        return ''.join(_html)
 

	
 
    def stat(self):
 
        """
kallithea/public/css/style.css
Show inline comments
 
@@ -4906,24 +4906,25 @@ div.diffblock {
 
    padding: 0px;
 
    border: 1px solid #ccc;
 
    background: #f8f8f8;
 
    font-size: 100%;
 
    line-height: 100%;
 
    /* new */
 
    line-height: 125%;
 
    -webkit-border-radius: 6px 6px 0px 0px;
 
    border-radius: 6px 6px 0px 0px;
 
}
 
div.diffblock.margined {
 
    margin: 0px 20px 0px 20px;
 
    overflow: hidden;
 
}
 
div.diffblock .code-header {
 
    border-bottom: 1px solid #CCCCCC;
 
    background: #EEEEEE;
 
    padding: 10px 0 10px 0;
 
    min-height: 14px;
 
}
 

	
 
div.diffblock .code-header.banner {
 
    border-bottom: 1px solid #CCCCCC;
 
    background: #EEEEEE;
 
    height: 14px;
 
@@ -5076,37 +5077,45 @@ table.code-difftable .code {
 
}
 
table.code-difftable .code td {
 
    margin: 0;
 
    padding: 0;
 
}
 
table.code-difftable .code pre {
 
    margin: 0;
 
    padding: 0;
 
    height: 17px;
 
    line-height: 17px;
 
}
 

	
 

	
 
.diffblock.margined.comm .line .code:hover {
 
    background-color: #FFFFCC !important;
 
    cursor: pointer !important;
 
    background-image: url("../images/icons/comment_add.png") !important;
 
    background-repeat: no-repeat !important;
 
    background-position: right !important;
 
    background-position: 0% 50% !important;
 
}
 
.diffblock.margined.comm .line .code.no-comment:hover {
 
    background-image: none !important;
 
    cursor: auto !important;
 
    background-color: inherit !important;
 
.add-bubble {
 
    display: none;
 
    float: left;
 
    width: 0px;
 
    height: 0px;
 
}
 

	
 
tr.line.add td.code:hover .add-bubble,
 
tr.line.del td.code:hover .add-bubble,
 
tr.line.unmod td.code:hover .add-bubble {
 
    display: inherit;
 
}
 

	
 
.add-bubble div {
 
    position: relative;
 
    left: -32px;
 
    width: 32px;
 
    top: -8px;
 
    height: 32px;
 
    background: url("../images/icons/comment_add.png") no-repeat 100% 50%;
 
    cursor: pointer;
 
}
 

	
 
div.comment:target>.comment-wrapp {
 
    border: solid 2px #ee0 !important;
 
}
 

	
 
.lineno:target a {
 
    border: solid 2px #ee0 !important;
 
    margin: -2px;
 
}
 

	
 
div.prev-next-comment div.prev-comment,
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -188,30 +188,30 @@ ${self.repo_context_bar('changelog', c.c
 
              }
 
              var boxid = YUD.getAttribute(target,'id_for');
 
              var comments = YUQ('#{0} .inline-comments'.format(boxid));
 
              for(c in comments){
 
                 YUD.setStyle(comments[c],'display',show);
 
              }
 
              var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
 
              for(c in btns){
 
                  YUD.setStyle(btns[c],'display',show);
 
               }
 
          })
 

	
 
          YUE.on(YUQ('.line'),'click',function(e){
 
          YUE.on(YUQ('.add-bubble'),'click',function(e){
 
              var tr = e.currentTarget;
 
              if(tr == null){
 
                  tr = this;
 
              }
 
              injectInlineForm(tr);
 
              injectInlineForm(tr.parentNode.parentNode);
 
          });
 

	
 
          // inject comments into they proper positions
 
          var file_comments = YUQ('.inline-comment-placeholder');
 
          renderInlineComments(file_comments);
 

	
 
          linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment"));
 

	
 
          pyroutes.register('changeset_home',
 
                            "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}",
 
                            ['repo_name', 'revision']);
 

	
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -341,27 +341,27 @@ ${self.repo_context_bar('showpullrequest
 
              }
 
              var boxid = YUD.getAttribute(target,'id_for');
 
              var comments = YUQ('#{0} .inline-comments'.format(boxid));
 
              for(c in comments){
 
                 YUD.setStyle(comments[c],'display',show);
 
              }
 
              var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
 
              for(c in btns){
 
                  YUD.setStyle(btns[c],'display',show);
 
               }
 
          })
 

	
 
          YUE.on(YUQ('.line'),'click',function(e){
 
          YUE.on(YUQ('.add-bubble'),'click',function(e){
 
              var tr = e.currentTarget;
 
              injectInlineForm(tr);
 
              injectInlineForm(tr.parentNode.parentNode);
 
          });
 

	
 
          // inject comments into they proper positions
 
          var file_comments = YUQ('.inline-comment-placeholder');
 
          renderInlineComments(file_comments);
 

	
 
          linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment"));
 

	
 
          YUE.on(YUD.get('update_pull_request'),'click',function(e){
 
              updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
 
          })
 

	
0 comments (0 inline, 0 general)