[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
abarth at webkit.org
abarth at webkit.org
Wed Dec 22 12:49:57 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 274afd8659a4e744c2a222ef6d8b2b328ca16024
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 31 09:40:06 2010 +0000
2010-08-31 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
[reviewtool] Allow reviewer to select lines of context by dragging over the line numbers
https://bugs.webkit.org/show_bug.cgi?id=44936
* PrettyPatch/PrettyPatch.rb:
- Add a version number to bust through bugs.webkit.org's aggressive
cacheing.
* code-review.js:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/BugsSite/ChangeLog b/BugsSite/ChangeLog
index ef170f0..bb1ad9a 100644
--- a/BugsSite/ChangeLog
+++ b/BugsSite/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-31 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [reviewtool] Allow reviewer to select lines of context by dragging over the line numbers
+ https://bugs.webkit.org/show_bug.cgi?id=44936
+
+ * PrettyPatch/PrettyPatch.rb:
+ - Add a version number to bust through bugs.webkit.org's aggressive
+ cacheing.
+ * code-review.js:
+
2010-08-30 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/BugsSite/PrettyPatch/PrettyPatch.rb b/BugsSite/PrettyPatch/PrettyPatch.rb
index e67e94d..ac71996 100644
--- a/BugsSite/PrettyPatch/PrettyPatch.rb
+++ b/BugsSite/PrettyPatch/PrettyPatch.rb
@@ -269,9 +269,15 @@ body {
.commentContext .lineNumber {
background-color: yellow;
}
+
+.selected .lineNumber {
+ background-color: #69F;
+ border-bottom-color: #69F;
+ border-right-color: #69F;
+}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
-<script src="code-review.js"></script>
+<script src="code-review.js?version=3"></script>
EOF
def self.revisionOrDescription(string)
diff --git a/BugsSite/code-review.js b/BugsSite/code-review.js
index cc1912d..25df6a5 100644
--- a/BugsSite/code-review.js
+++ b/BugsSite/code-review.js
@@ -63,22 +63,24 @@
findCommentPositionFor(line).after(block);
}
- function addCommentField() {
- var id = $(this).attr('data-comment-for');
- if (!id) {
- id = this.id;
- $(this).addClass('commentContext');
- }
- var line = $('#' + id);
+ function addCommentFor(line) {
if (line.attr('data-has-comment'))
return;
line.attr('data-has-comment', 'true');
+ line.addClass('commentContext');
- var comment_block = $('<div class="comment"><textarea data-comment-for="' + id + '"></textarea><div class="actions"><button class="delete">Delete</button></div></div>');
+ var comment_block = $('<div class="comment"><textarea data-comment-for="' + line.attr('id') + '"></textarea><div class="actions"><button class="delete">Delete</button></div></div>');
insertCommentFor(line, comment_block);
comment_block.children('textarea').focus();
}
+ function addCommentField() {
+ var id = $(this).attr('data-comment-for');
+ if (!id)
+ id = this.id;
+ addCommentFor($('#' + id));
+ }
+
function displayPreviousComments() {
comment_collection = this;
forEachLine(function(line) {
@@ -130,25 +132,47 @@
}
}
- function tryToExpandCommentContextTo(line) {
- var context_line = line;
- while (context_line.length != 0) {
- context_line = context_line.next();
- if (context_line.hasClass('commentContext'))
- break;
- }
- if (context_line.length == 0)
- return; // No comment context to expand.
- line.addClass('commentContext').nextUntil('.commentContext').addClass('commentContext');
+ var in_drag_select = false;
+
+ function stopDragSelect() {
+ $('.selected').removeClass('selected');
+ in_drag_select = false;
}
$('.lineNumber').live('click', function() {
var line = $(this).parent();
if (line.hasClass('commentContext'))
trimCommentContextToBefore(line.prev());
- else
- tryToExpandCommentContextTo(line);
+ }).live('mousedown', function() {
+ in_drag_select = true;
+ $(this).parent().addClass('selected');
+ event.preventDefault();
});
+
+ $('.Line').live('mouseenter', function() {
+ if (!in_drag_select)
+ return;
+
+ var before = $(this).prevUntil('.selected')
+ if (before.prev().hasClass('selected'))
+ before.addClass('selected');
+
+ var after = $(this).nextUntil('.selected')
+ if (after.next().hasClass('selected'))
+ after.addClass('selected');
+
+ $(this).addClass('selected');
+ }).live('mouseup', function() {
+ if (!in_drag_select)
+ return;
+ var selected = $('.selected');
+ var should_add_comment = !selected.last().next().hasClass('commentContext');
+ selected.addClass('commentContext');
+ if (should_add_comment)
+ addCommentFor(selected.last());
+ });
+
+ $('.DiffSection').live('mouseleave', stopDragSelect).live('mouseup', stopDragSelect);
function contextSnippetFor(line) {
var snippets = []
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list