Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -185,12 +185,6 @@ |
186 | 186 | 'messages' => array( 'codereview-overview-title', 'codereview-overview-desc' ), |
187 | 187 | ) + $commonModuleInfo; |
188 | 188 | |
189 | | -// Add, remove tags from a revision view |
190 | | -$wgResourceModules['ext.codereview.tags'] = array( |
191 | | - 'scripts' => 'ext.codereview.tags.js', |
192 | | - 'styles' => 'ext.codereview.tags.css', |
193 | | -) + $commonModuleInfo; |
194 | | - |
195 | 189 | // If you are running a closed svn, fill the following two lines with the username and password |
196 | 190 | // of a user allowed to access it. Otherwise, leave it false. |
197 | 191 | // This is only necessary if using the shell method to access Subversion |
Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -82,8 +82,6 @@ |
83 | 83 | 'code-rev-tags' => 'Tags:', |
84 | 84 | 'code-rev-tag-add' => 'Add tags:', |
85 | 85 | 'code-rev-tag-remove' => 'Remove tags:', |
86 | | - 'code-rev-tag-addtag-tooltip' => 'Add new tags to this revision', |
87 | | - 'code-rev-tag-removetag-tooltip' => 'Click to remove tag "$1"', |
88 | 86 | 'code-rev-comment-by' => 'Comment by $1', |
89 | 87 | 'code-rev-comment-preview' => 'Preview', |
90 | 88 | 'code-rev-comment-preview-accesskey' => 'p', |
Index: trunk/extensions/CodeReview/modules/ext.codereview.tags.css |
— | — | @@ -1,17 +0,0 @@ |
2 | | -/* Unique green box to add new tags */ |
3 | | -#codereview-add-tag { |
4 | | - color: #00FF00; |
5 | | - font-size: 1.2em; |
6 | | - |
7 | | - background-color: #EDFFED; |
8 | | - padding: 0 0.5em; |
9 | | - border: 1px solid #00FF00; |
10 | | - cursor: pointer; |
11 | | -} |
12 | | - |
13 | | -/* Red 'erase to the left' signs to remove a tag */ |
14 | | -.codereview-remove-tag { |
15 | | - color: #FF0000; |
16 | | - font-size: 1.2em; |
17 | | - cursor: crosshair; |
18 | | -} |
Index: trunk/extensions/CodeReview/modules/ext.codereview.tags.js |
— | — | @@ -1,59 +0,0 @@ |
2 | | -( function( $ ) { |
3 | | -var $rev = 0; |
4 | | - |
5 | | -window.CodeReview = $.extend( window.CodeReview, { |
6 | | - |
7 | | - /* TODO we should probably add that click handling from PHP |
8 | | - * ui/CodeRevisionView.php */ |
9 | | - tagInit: function( rev ) { |
10 | | - $rev = rev; |
11 | | - $('.codereview-remove-tag').click( function() { |
12 | | - CodeReview.tagRemove( $(this).attr( 'id' ) ) |
13 | | - }); |
14 | | - }, |
15 | | - tagAdd: function() { |
16 | | - |
17 | | - }, |
18 | | - tagRemove: function( HTMLId ) { |
19 | | - var tag = HTMLId.replace( /codereview-remove-tag-(.*)/, "$1" ); |
20 | | - $.ajax({ |
21 | | - url: mw.util.wikiScript( 'api' ), |
22 | | - data: { |
23 | | - 'action': 'coderevisionupdate', |
24 | | - |
25 | | - 'repo' : mw.config.get( 'wgCodeReviewRepository' ), |
26 | | - 'rev' : $rev, |
27 | | - |
28 | | - 'removetags': tag, |
29 | | - |
30 | | - 'format': 'json', |
31 | | - }, |
32 | | - dataType: 'json', |
33 | | - type: 'POST', |
34 | | - success: function( data ) { |
35 | | - var remover = $( '#'+HTMLId ); |
36 | | - // remove tag: |
37 | | - remover.prev().fadeOut().remove(); |
38 | | - |
39 | | - /** |
40 | | - * tag might be followed by a text node ', ' |
41 | | - * which can not be reached with jQuery next() |
42 | | - */ |
43 | | - var nextNode = remover[0].nextSibling; |
44 | | - console.log( nextNode ); |
45 | | - if( nextNode.nodeType === 3 |
46 | | - && nextNode.nodeValue === ", " ) { |
47 | | - nextNode.parentNode.removeChild( nextNode ); |
48 | | - } |
49 | | - // finally remove the tag removal sign |
50 | | - remover.fadeOut().remove(); |
51 | | - }, |
52 | | - error: function() { |
53 | | - // TODO |
54 | | - }, |
55 | | - }); |
56 | | - }, |
57 | | - |
58 | | - |
59 | | -}); // window.CodeReview |
60 | | -})( jQuery ); |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -212,11 +212,6 @@ |
213 | 213 | ); |
214 | 214 | } |
215 | 215 | |
216 | | - $wgOut->addModules( 'ext.codereview.tags' ); |
217 | | - $wgOut->addInlineScript( |
218 | | - "CodeReview.tagInit( $encRev );" |
219 | | - ); |
220 | | - |
221 | 216 | $wgOut->addHTML( $html ); |
222 | 217 | } |
223 | 218 | |
— | — | @@ -352,17 +347,10 @@ |
353 | 348 | array_map( |
354 | 349 | array( $this, 'formatTag' ), |
355 | 350 | $tags ) |
356 | | - ) . '<br/>'; |
| 351 | + ) . ' '; |
357 | 352 | } |
358 | 353 | if ( $wgUser->isAllowed( 'codereview-add-tag' ) ) { |
359 | | - $list .= Xml::inputLabel( wfMsg( 'code-rev-tag-add' ), 'wpTag', 'wpTag', 20, |
360 | | - self::listTags( $this->mAddTags ) ); |
361 | | - $list .= Xml::Element( 'span', array( |
362 | | - 'id' => "codereview-add-tag", |
363 | | - 'title' => wfMsg( 'code-rev-tag-addtag-tooltip' ), |
364 | | - ), '+' ); // TODO: replace '+' with a message |
365 | | - //old tag form: |
366 | | - //$list .= $this->addTagForm( $this->mAddTags, $this->mRemoveTags ); |
| 354 | + $list .= $this->addTagForm( $this->mAddTags, $this->mRemoveTags ); |
367 | 355 | } |
368 | 356 | return $list; |
369 | 357 | } |
— | — | @@ -446,27 +434,9 @@ |
447 | 435 | * @return string |
448 | 436 | */ |
449 | 437 | protected function formatTag( $tag ) { |
450 | | - global $wgUser; |
451 | | - |
452 | 438 | $repo = $this->mRepo->getName(); |
453 | 439 | $special = SpecialPage::getTitleFor( 'Code', "$repo/tag/$tag" ); |
454 | | - $link = $this->skin->link( |
455 | | - $special, |
456 | | - htmlspecialchars( $tag ), |
457 | | - array( 'class' => 'mw-codereview-tag' ) |
458 | | - ); |
459 | | - |
460 | | - # Let allowed users to remove tags using JS |
461 | | - if( $wgUser->isAllowed( 'codereview-add-tag' ) ) { |
462 | | - $link .= ' '. |
463 | | - Xml::Element( 'span', array( |
464 | | - 'id' => "codereview-remove-tag-{$tag}", |
465 | | - 'class' => 'codereview-remove-tag', |
466 | | - 'title' => wfMsg( 'code-rev-tag-removetag-tooltip', $tag ), |
467 | | - ), '⌫' ); // TODO: replace '⌫' with a message |
468 | | - } |
469 | | - |
470 | | - return $link; |
| 440 | + return $this->skin->link( $special, htmlspecialchars( $tag ) ); |
471 | 441 | } |
472 | 442 | |
473 | 443 | /** |