Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -167,10 +167,6 @@ |
168 | 168 | 'scripts' => 'ext.codereview.loaddiff.js' |
169 | 169 | ) + $commonModuleInfo; |
170 | 170 | |
171 | | -$wgResourceModules['ext.codereview.linecomment'] = array( |
172 | | - 'scripts' => 'ext.codereview.linecomment.js' |
173 | | -) + $commonModuleInfo; |
174 | | - |
175 | 171 | // Revision tooltips CodeRevisionView: |
176 | 172 | $wgResourceModules['ext.codereview.tooltips'] = array( |
177 | 173 | 'scripts' => 'ext.codereview.tooltips.js', |
— | — | @@ -354,8 +350,6 @@ |
355 | 351 | |
356 | 352 | $updater->addExtensionIndex( 'code_rev', 'cr_repo_status_author', |
357 | 353 | "$base/archives/code_revs_status_author-index.sql" ); |
358 | | - $updater->addExtensionField( 'code_comment', 'cc_patch_line', |
359 | | - "$base/archives/code_comment_patch_line.sql" ); |
360 | 354 | |
361 | 355 | $updater->addExtensionUpdate( array( 'dropField', 'code_comment', 'cc_review', |
362 | 356 | "$base/archives/code_drop_cc_review.sql", true ) ); |
— | — | @@ -371,8 +365,6 @@ |
372 | 366 | "$base/archives/code_signoffs_timestamp_struck.sql", true ) ); |
373 | 367 | $updater->addExtensionUpdate( array( 'addIndex', 'code_paths', 'repo_path', |
374 | 368 | "$base/archives/codereview-repopath.sql", true ) ); |
375 | | - $updater->addExtensionUpdate( array( 'addField', 'code_comment', 'cc_patch_line', |
376 | | - "$base/archives/code_comment_patch_line.sql", true ) ); |
377 | 369 | break; |
378 | 370 | case 'postgres': |
379 | 371 | // TODO |
Index: trunk/extensions/CodeReview/tests/CodeReviewApiTest.php |
— | — | @@ -68,7 +68,6 @@ |
69 | 69 | $data = $this->doApiRequest( array( |
70 | 70 | 'action' => 'coderevisionupdate', |
71 | 71 | 'rev' => 777, |
72 | | - 'patchline' => 51, |
73 | 72 | 'comment' => 'Awesome comment', |
74 | 73 | |
75 | 74 | ) + $this->commonApiData ); |
Index: trunk/extensions/CodeReview/archives/code_comment_patch_line.sql |
— | — | @@ -1,2 +0,0 @@ |
2 | | -ALTER TABLE /*_*/code_comment |
3 | | - ADD COLUMN cc_patch_line int default null; |
Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -656,16 +656,15 @@ |
657 | 657 | * @param $text |
658 | 658 | * @param $review |
659 | 659 | * @param null $parent |
660 | | - * @param int $patchLine (default: null) |
661 | 660 | * @return int |
662 | 661 | */ |
663 | | - public function saveComment( $text, $review, $parent = null, $patchLine = null ) { |
| 662 | + public function saveComment( $text, $review, $parent = null ) { |
664 | 663 | $text = rtrim( $text ); |
665 | 664 | if ( !strlen( $text ) ) { |
666 | 665 | return 0; |
667 | 666 | } |
668 | 667 | $dbw = wfGetDB( DB_MASTER ); |
669 | | - $data = $this->commentData( $text, $review, $parent, $patchLine ); |
| 668 | + $data = $this->commentData( $text, $review, $parent ); |
670 | 669 | |
671 | 670 | $dbw->begin(); |
672 | 671 | $data['cc_id'] = $dbw->nextSequenceValue( 'code_comment_cc_id' ); |
— | — | @@ -735,10 +734,9 @@ |
736 | 735 | * @param $text |
737 | 736 | * @param $review |
738 | 737 | * @param null $parent |
739 | | - * @param int $patchLine (default: null) |
740 | 738 | * @return array |
741 | 739 | */ |
742 | | - protected function commentData( $text, $review, $parent = null, $patchLine = null ) { |
| 740 | + protected function commentData( $text, $review, $parent = null ) { |
743 | 741 | global $wgUser; |
744 | 742 | $dbw = wfGetDB( DB_MASTER ); |
745 | 743 | $ts = wfTimestamp( TS_MW ); |
— | — | @@ -748,7 +746,6 @@ |
749 | 747 | 'cc_rev_id' => $this->id, |
750 | 748 | 'cc_text' => $text, |
751 | 749 | 'cc_parent' => $parent, |
752 | | - 'cc_patch_line' => $patchLine, |
753 | 750 | 'cc_user' => $wgUser->getId(), |
754 | 751 | 'cc_user_text' => $wgUser->getName(), |
755 | 752 | 'cc_timestamp' => $dbw->timestamp( $ts ), |
— | — | @@ -782,21 +779,9 @@ |
783 | 780 | } |
784 | 781 | |
785 | 782 | /** |
786 | | - * @param $attached boolean Fetch comment attached to a line of code (default: false) |
787 | 783 | * @return array |
788 | 784 | */ |
789 | | - public function getComments( $attached = false ) { |
790 | | - $conditions = array( |
791 | | - 'cc_repo_id' => $this->repoId, |
792 | | - 'cc_rev_id' => $this->id |
793 | | - ); |
794 | | - |
795 | | - if( $attached ) { |
796 | | - $conditions[] = 'cc_patch_line != null'; |
797 | | - } else { |
798 | | - $conditions['cc_patch_line'] = null; |
799 | | - } |
800 | | - |
| 785 | + public function getComments() { |
801 | 786 | $dbr = wfGetDB( DB_SLAVE ); |
802 | 787 | $result = $dbr->select( 'code_comment', |
803 | 788 | array( |
— | — | @@ -804,10 +789,11 @@ |
805 | 790 | 'cc_text', |
806 | 791 | 'cc_user', |
807 | 792 | 'cc_user_text', |
808 | | - 'cc_patch_line', |
809 | 793 | 'cc_timestamp', |
810 | 794 | 'cc_sortkey' ), |
811 | | - $conditions, |
| 795 | + array( |
| 796 | + 'cc_repo_id' => $this->repoId, |
| 797 | + 'cc_rev_id' => $this->id ), |
812 | 798 | __METHOD__, |
813 | 799 | array( |
814 | 800 | 'ORDER BY' => 'cc_sortkey' ) |
Index: trunk/extensions/CodeReview/backend/CodeComment.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | * Represents a comment made to a revision. |
6 | 6 | */ |
7 | 7 | class CodeComment { |
8 | | - public $id, $text, $user, $userText, $timestamp, $sortkey, $attrib, $removed, $added, $patchLine; |
| 8 | + public $id, $text, $user, $userText, $timestamp, $sortkey, $attrib, $removed, $added; |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * @var CodeRevision |
— | — | @@ -68,7 +68,6 @@ |
69 | 69 | $comment->user = $data['cc_user']; |
70 | 70 | $comment->userText = $data['cc_user_text']; |
71 | 71 | $comment->timestamp = wfTimestamp( TS_MW, $data['cc_timestamp'] ); |
72 | | - $comment->patchLine = $data['cc_patch_line']; |
73 | 72 | $comment->sortkey = $data['cc_sortkey']; |
74 | 73 | return $comment; |
75 | 74 | } |
Index: trunk/extensions/CodeReview/backend/DiffHighlighter.php |
— | — | @@ -14,67 +14,19 @@ |
15 | 15 | protected $lineNumber = 0; |
16 | 16 | |
17 | 17 | /** |
18 | | - * @var CodeRepositor The repository for this revision |
19 | | - */ |
20 | | - protected $repo = null; |
21 | | - |
22 | | - /** |
23 | | - * @var CodeRevision revision the diff comes from |
24 | | - */ |
25 | | - protected $rev = null; |
26 | | - |
27 | | - /** |
28 | | - * Comments inside the diff. |
29 | | - * initialized with fetchInlineComments() |
30 | | - */ |
31 | | - private $inlineComments = null; |
32 | | - |
33 | | - /** |
34 | 18 | * Main entry point. Given a diff text, highlight it |
35 | 19 | * and wrap it in a div |
36 | | - * Pass both $repos and $rev to have the diff rendered with inline comments |
37 | 20 | * |
38 | 21 | * @param $text string Text to highlight |
39 | | - * @param $repo CodeRepository (default: null) |
40 | | - * @param $repo CodeRevision (default: null) |
41 | 22 | * @return string |
42 | 23 | */ |
43 | | - function render( $text, CodeRepository $repo = null, CodeRevision $rev = null ) { |
44 | | - if( $repo xor $rev ) { |
45 | | - throw new MWException( __METHOD__ . " must have both repository and revision or none of them\n" ); |
46 | | - } elseif( $repo && $rev ) { |
47 | | - $this->repo = $repo; |
48 | | - $this->rev = $rev; |
49 | | - $this->fetchInlineComments(); |
50 | | - } |
51 | | - |
| 24 | + function render( $text ) { |
52 | 25 | return '<table class="mw-codereview-diff">' . |
53 | 26 | $this->splitLines( $text ) . |
54 | 27 | "</table>\n"; |
55 | 28 | } |
56 | 29 | |
57 | 30 | /** |
58 | | - * Fetch comments attached to a patch line. |
59 | | - * Comments can be accessed through the array inlineComments. Its format is: |
60 | | - * array( |
61 | | - * line# => array( |
62 | | - * CodeComment, CodeComment ... |
63 | | - * ), |
64 | | - * line# => array( |
65 | | - * CodeComment, CodeComment ... |
66 | | - * ), |
67 | | - * ... |
68 | | - * ); |
69 | | - */ |
70 | | - private function fetchInlineComments() { |
71 | | - $inline = $this->rev->getComments( 'which are attached' ); |
72 | | - foreach( $inline as $comment ) { |
73 | | - $line = $comment->patchLine; # absolute line number in the diff |
74 | | - $this->inlineComments[$line][] = $comment; |
75 | | - } |
76 | | - } |
77 | | - |
78 | | - /** |
79 | 31 | * Given a bunch of text, split it into individual |
80 | 32 | * lines, color them, then put it back into one big |
81 | 33 | * string |
— | — | @@ -128,39 +80,14 @@ |
129 | 81 | $r = $this->handleLineFile( $line ); |
130 | 82 | } |
131 | 83 | |
132 | | - # Finally add up any lineComments that might apply to this line |
133 | | - $r .= $this->addLineComments(); |
134 | | - |
135 | 84 | # Return HTML generated by one of the handler |
136 | 85 | return $r; |
137 | 86 | } |
138 | 87 | |
139 | | - function addLineComments() { |
140 | | - $return = ''; |
141 | | - if( !isset( $this->inlineComments ) ) { |
142 | | - # No inline comments for this revision. |
143 | | - return $return; |
144 | | - } |
145 | | - if( !array_key_exists( $this->lineNumber, $this->inlineComments ) ) { |
146 | | - # Line does not have any comment applying to |
147 | | - return $return; |
148 | | - } |
149 | | - |
150 | | - $comments = $this->inlineComments[$this->lineNumber]; |
151 | | - # FIXME: comment formatting can only be handled by a view |
152 | | - # Would need abstraction, for example as a class of views helpers. |
153 | | - $view = new CodeRevisionView( $this->repo, $this->rev ); |
154 | | - foreach( $comments as $comment ) { |
155 | | - $return .= "<li>{$view->formatComment( $comment )}</li>\n" ; |
156 | | - } |
157 | | - return "<tr class=\"mw-codereview-inlineComment\"><td colspan=\"3\"><ul>{$return}</ul></td></tr>\n"; |
158 | | - } |
159 | | - |
160 | 88 | function formatLine( $content, $class = null ) { |
161 | 89 | |
162 | 90 | if( is_null($class) ) { |
163 | | - return Html::rawElement( 'tr', |
164 | | - array_merge( $this->getLineIdAttr(), array( 'class' => 'commentable' ) ), |
| 91 | + return Html::rawElement( 'tr', $this->getLineIdAttr(), |
165 | 92 | Html::Element( 'td', array( 'class'=>'linenumbers' ), $this->left ) |
166 | 93 | . Html::Element( 'td', array( 'class'=>'linenumbers' ), $this->right ) |
167 | 94 | . Html::Element( 'td', array() , $content ) |
— | — | @@ -190,8 +117,7 @@ |
191 | 118 | } |
192 | 119 | |
193 | 120 | $classAttr = is_null($class) ? array() : array( 'class' => $class ); |
194 | | - return Html::rawElement( 'tr', |
195 | | - array_merge( $this->getLineIdAttr(), array( 'class' => 'commentable' ) ), |
| 121 | + return Html::rawElement( 'tr', $this->getLineIdAttr(), |
196 | 122 | Html::rawElement( 'td', array( 'class'=>'linenumbers' ), $left ) |
197 | 123 | . Html::rawElement( 'td', array( 'class'=>'linenumbers' ), $right ) |
198 | 124 | . Html::Element( 'td', $classAttr, $content ) |
Index: trunk/extensions/CodeReview/modules/ext.codereview.linecomment.js |
— | — | @@ -1,110 +0,0 @@ |
2 | | -( function( $ ) { |
3 | | -var $rev = 0; |
4 | | - |
5 | | -window.CodeReview = $.extend( window.CodeReview, { |
6 | | - |
7 | | - /* initialization from PHP */ |
8 | | - lcInit: function( rev ) { |
9 | | - $rev = rev; |
10 | | - // Register click() event to each diff lines |
11 | | - $( 'table.mw-codereview-diff tr.commentable').click( |
12 | | - function () { CodeReview.lcShowForm( $(this) ); } |
13 | | - ); |
14 | | - }, |
15 | | - |
16 | | - /** |
17 | | - * Show the line comment code below a line of code |
18 | | - * @param lineCode jQuery object |
19 | | - */ |
20 | | - lcShowForm: function( lineCode ) { |
21 | | - // Make sure the line id is an integer: |
22 | | - var lineNumber = parseInt( lineCode.attr('id') ) + 0; |
23 | | - // Forge the line comment HTML id: |
24 | | - var htmlId = 'comment-for-' + lineNumber; |
25 | | - |
26 | | - lineCode.unbind( 'click' ); |
27 | | - lineCode.click( function () { |
28 | | - $( '#'+htmlId ).fadeOut( 200 ).remove(); |
29 | | - |
30 | | - lineCode.unbind( 'click' ); |
31 | | - lineCode.click( function() { |
32 | | - CodeReview.lcShowForm( lineCode ); |
33 | | - }); |
34 | | - }); |
35 | | - |
36 | | - var lineComment = |
37 | | - $('<tr id="' + htmlId + '"><td colspan="3">' |
38 | | - +'<textarea id="lineCommentContent" rows="5"></textarea><br/>' |
39 | | - +'<input id="lineCommentSend" type="button" value="Send">' |
40 | | - +'</td></tr>'); |
41 | | - lineComment.insertAfter( lineCode ); |
42 | | - $( '#lineCommentContent' ).focus(); |
43 | | - |
44 | | - $( '#lineCommentSend' ).click( function() { |
45 | | - CodeReview.lcSubmitComment( |
46 | | - lineCode, |
47 | | - lineComment, |
48 | | - $( '#lineCommentContent' ).val() |
49 | | - ); |
50 | | - }); |
51 | | - }, |
52 | | - |
53 | | - lcSubmitComment: function( lineCode, lineComment, comment ) { |
54 | | - |
55 | | - // retrieve line number from the code line id attribute: |
56 | | - var lineId = lineCode.attr('id'); |
57 | | - lineId = lineId.substring( lineId.indexOf( '-' ) + 1); |
58 | | - |
59 | | - $.ajax({ |
60 | | - url: mw.util.wikiScript( 'api' ), |
61 | | - data: { |
62 | | - 'action': 'coderevisionupdate', |
63 | | - |
64 | | - 'repo' : mw.config.get( 'wgCodeReviewRepository' ), |
65 | | - 'rev' : $rev, |
66 | | - |
67 | | - 'comment': comment, |
68 | | - 'patchline' : lineId, |
69 | | - |
70 | | - 'format': 'json', |
71 | | - }, |
72 | | - dataType: 'json', |
73 | | - type: 'POST', |
74 | | - success: function( data ) { |
75 | | - // our API return usage error as a success! |
76 | | - if( data.error !== undefined ) { |
77 | | - console.log( lineComment.find( 'input' ) ); |
78 | | - lineComment.find( 'input' ).after( |
79 | | - $('<span class="errorbox"></span>') |
80 | | - .text( data.error.info ) |
81 | | - ); |
82 | | - return; |
83 | | - } |
84 | | - |
85 | | - var text = data.coderevisionupdate.HTML |
86 | | - lineComment.fadeOut( 200 ).remove(); |
87 | | - |
88 | | - // check we have a list to insert the comment in. |
89 | | - var next = lineCode.next( '.inlineComment' ); |
90 | | - if( next.length === 0 ) { |
91 | | - $( '<tr class="inlineComment"><td colspan="3"><ul><li>'+text+'</li></ul></td></tr>' ).insertAfter( lineCode ) |
92 | | - } else { |
93 | | - lineCode.next('.inlineComment').find( 'ul' ).append( |
94 | | - $( '<li>' + text + '</li>' ) |
95 | | - ); |
96 | | - } |
97 | | - |
98 | | - |
99 | | - // rebind event handler |
100 | | - lineCode.click( |
101 | | - function () { CodeReview.lcShowForm( $(this) ); } |
102 | | - ); |
103 | | - }, |
104 | | - error: function() { |
105 | | - console.log( "AJAX ERROR" ); |
106 | | - } |
107 | | - }); |
108 | | - }, |
109 | | - |
110 | | -}); // window.CodeReview |
111 | | -})( jQuery ); |
Index: trunk/extensions/CodeReview/modules/ext.codereview.styles.css |
— | — | @@ -58,15 +58,6 @@ |
59 | 59 | padding: 16px 16px 16px 48px; |
60 | 60 | } |
61 | 61 | |
62 | | -/** list containers to insert comments inside the diff table */ |
63 | | -.mw-codereview-inlineComment ul { |
64 | | - list-style-image: none; /* override Vector default */ |
65 | | - list-style-type: none; |
66 | | - padding:0; |
67 | | - padding-left: 2em; |
68 | | - margin-bottom: 8px; |
69 | | -} |
70 | | - |
71 | 62 | .mw-codereview-status-new, |
72 | 63 | .mw-codereview-status-new td { |
73 | 64 | background: #ffffc0 !important; |
Index: trunk/extensions/CodeReview/api/ApiRevisionUpdate.php |
— | — | @@ -66,14 +66,12 @@ |
67 | 67 | $params['removeflags'], |
68 | 68 | $params['addreferences'], |
69 | 69 | $params['removereferences'], |
70 | | - $params['comment'], |
71 | | - null, // parent |
72 | | - 0, // review |
73 | | - $params['patchline'] |
| 70 | + $params['comment'] |
74 | 71 | ); |
75 | 72 | |
76 | 73 | // Forge a response object |
77 | 74 | $r = array( 'result' => 'Success' ); |
| 75 | + |
78 | 76 | if ( $commentID !== 0 ) { |
79 | 77 | // id inserted |
80 | 78 | $r['commentid'] = intval($commentID); |
— | — | @@ -81,7 +79,6 @@ |
82 | 80 | $view = new CodeRevisionView( $repo, $rev); |
83 | 81 | $comment = CodeComment::newFromID( $commentID, $rev ); |
84 | 82 | $r['HTML'] = $view->formatComment( $comment ); |
85 | | - //$r['HTML'] = print_r( $comment, true ); |
86 | 83 | } |
87 | 84 | |
88 | 85 | $this->getResult()->addValue( null, $this->getModuleName(), $r ); |
— | — | @@ -137,10 +134,6 @@ |
138 | 135 | ApiBase::PARAM_TYPE => 'integer', |
139 | 136 | ApiBase::PARAM_ISMULTI => true, |
140 | 137 | ), |
141 | | - 'patchline' => array( |
142 | | - ApiBase::PARAM_TYPE => 'integer', |
143 | | - ApiBase::PARAM_MIN => 1, |
144 | | - ), |
145 | 138 | ); |
146 | 139 | } |
147 | 140 | |
— | — | @@ -156,7 +149,6 @@ |
157 | 150 | 'removeflags' => 'Code Signoff flags to strike from the revision by the current user', |
158 | 151 | 'addreferences' => 'Add references to this revision', |
159 | 152 | 'removereferences' => 'Remove references from this revision', |
160 | | - 'patchline' => 'Diff line to attach the comment to (optional)', |
161 | 153 | ); |
162 | 154 | } |
163 | 155 | |
Index: trunk/extensions/CodeReview/api/ApiCodeDiff.php |
— | — | @@ -47,7 +47,6 @@ |
48 | 48 | $html = 'Diff too large.'; |
49 | 49 | } else { |
50 | 50 | $hilite = new CodeDiffHighlighter(); |
51 | | - # Fetch diff rendered without inline comments |
52 | 51 | $html = $hilite->render( $diff ); |
53 | 52 | } |
54 | 53 | |
Index: trunk/extensions/CodeReview/api/ApiQueryCodeComments.php |
— | — | @@ -95,9 +95,6 @@ |
96 | 96 | if ( isset( $this->props['text'] ) ) { |
97 | 97 | ApiResult::setContent( $item, $row->cc_text ); |
98 | 98 | } |
99 | | - if ( isset( $this->props['patchline'] ) ) { |
100 | | - $item['patchline'] = $row->cc_patch_line; |
101 | | - } |
102 | 99 | return $item; |
103 | 100 | } |
104 | 101 | |
— | — | @@ -125,7 +122,6 @@ |
126 | 123 | 'user', |
127 | 124 | 'status', |
128 | 125 | 'text', |
129 | | - 'patchline', |
130 | 126 | 'revid', |
131 | 127 | 'revision', |
132 | 128 | ), |
Index: trunk/extensions/CodeReview/codereview.sql |
— | — | @@ -173,9 +173,6 @@ |
174 | 174 | -- cc_id of parent comment if a threaded child, otherwise NULL |
175 | 175 | cc_parent int, |
176 | 176 | |
177 | | - -- patch line the comment eventually applies to or NULL |
178 | | - cc_patch_line int default null, |
179 | | - |
180 | 177 | -- User id/name of the commenter |
181 | 178 | cc_user int not null, |
182 | 179 | cc_user_text varchar(255) not null, |
Index: trunk/extensions/CodeReview/ui/CodeCommentsListView.php |
— | — | @@ -57,8 +57,6 @@ |
58 | 58 | 'cr_status' => wfMsg( 'code-field-status' ), |
59 | 59 | 'cr_message' => wfMsg( 'code-field-message' ), |
60 | 60 | 'cc_text' => wfMsg( 'code-field-text' ), |
61 | | - # patch line is only used for API call. No need for an i18n message |
62 | | - 'cc_patch_line' => null, |
63 | 61 | ); |
64 | 62 | } |
65 | 63 | |
Index: trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php |
— | — | @@ -58,12 +58,11 @@ |
59 | 59 | * @param string $commentText Comment to add to the revision |
60 | 60 | * @param null|int $parent What the parent comment is (if a subcomment) |
61 | 61 | * @param int $review (unused) |
62 | | - * @param int $patchLine Patch line number to which the comment will be attached (default: null). |
63 | 62 | * @return int Comment ID if added, else 0 |
64 | 63 | */ |
65 | 64 | public function revisionUpdate( $status, $addTags, $removeTags, $addSignoffs, $strikeSignoffs, |
66 | 65 | $addReferences, $removeReferences, $commentText, |
67 | | - $parent = null, $review = 0, $patchLine = null) { |
| 66 | + $parent = null, $review = 0 ) { |
68 | 67 | if ( !$this->mRev ) { |
69 | 68 | return false; |
70 | 69 | } |
— | — | @@ -111,7 +110,7 @@ |
112 | 111 | $commentId = 0; |
113 | 112 | if ( strlen( $commentText ) && $this->validPost( 'codereview-post-comment' ) ) { |
114 | 113 | // $isPreview = $wgRequest->getCheck( 'wpPreview' ); |
115 | | - $commentId = $this->mRev->saveComment( $commentText, $review, $parent, $patchLine ); |
| 114 | + $commentId = $this->mRev->saveComment( $commentText, $review, $parent ); |
116 | 115 | |
117 | 116 | $commentAdded = ($commentId !== 0); |
118 | 117 | } |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -202,16 +202,6 @@ |
203 | 203 | } |
204 | 204 | $html .= xml::closeElement( 'form' ); |
205 | 205 | |
206 | | - // Encode revision id for our modules |
207 | | - $encRev = Xml::encodeJsVar( $this->mRev->getId() ); |
208 | | - |
209 | | - if( $wgCodeReviewInlineComments ) { |
210 | | - $wgOut->addModules( 'ext.codereview.linecomment' ); |
211 | | - $wgOut->addInlineScript( |
212 | | - "$(document).ready( CodeReview.lcInit( $encRev ) );" |
213 | | - ); |
214 | | - } |
215 | | - |
216 | 206 | $wgOut->addHTML( $html ); |
217 | 207 | } |
218 | 208 | |
— | — | @@ -470,8 +460,7 @@ |
471 | 461 | return htmlspecialchars( wfMsg( 'code-rev-diff-too-large' ) ); |
472 | 462 | } else { |
473 | 463 | $hilite = new CodeDiffHighlighter(); |
474 | | - # Diff rendered with inline comments |
475 | | - return $hilite->render( $diff, $this->mRepo, $this->mRev ); |
| 464 | + return $hilite->render( $diff ); |
476 | 465 | } |
477 | 466 | } |
478 | 467 | |