r105518 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105517‎ | r105518 | r105519 >
Date:06:33, 8 December 2011
Author:tstarling
Status:ok
Tags:
Comment:
Reverting r96158, r96159: incomplete project, can't be deployed as is, see CR r96158.
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/modules/ext.codereview.tags.css (deleted) (history)
  • /trunk/extensions/CodeReview/modules/ext.codereview.tags.js (deleted) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -185,12 +185,6 @@
186186 'messages' => array( 'codereview-overview-title', 'codereview-overview-desc' ),
187187 ) + $commonModuleInfo;
188188
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 -
195189 // If you are running a closed svn, fill the following two lines with the username and password
196190 // of a user allowed to access it. Otherwise, leave it false.
197191 // This is only necessary if using the shell method to access Subversion
Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -82,8 +82,6 @@
8383 'code-rev-tags' => 'Tags:',
8484 'code-rev-tag-add' => 'Add tags:',
8585 '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"',
8886 'code-rev-comment-by' => 'Comment by $1',
8987 'code-rev-comment-preview' => 'Preview',
9088 '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 @@
213213 );
214214 }
215215
216 - $wgOut->addModules( 'ext.codereview.tags' );
217 - $wgOut->addInlineScript(
218 - "CodeReview.tagInit( $encRev );"
219 - );
220 -
221216 $wgOut->addHTML( $html );
222217 }
223218
@@ -352,17 +347,10 @@
353348 array_map(
354349 array( $this, 'formatTag' ),
355350 $tags )
356 - ) . '<br/>';
 351+ ) . '&#160;';
357352 }
358353 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 );
367355 }
368356 return $list;
369357 }
@@ -446,27 +434,9 @@
447435 * @return string
448436 */
449437 protected function formatTag( $tag ) {
450 - global $wgUser;
451 -
452438 $repo = $this->mRepo->getName();
453439 $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 .= '&#160;'.
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 ) );
471441 }
472442
473443 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96158(bug 26084) add some ajax to easily delete tags...hashar22:41, 2 September 2011
r96159Get ride of old Tag form...hashar22:41, 2 September 2011

Status & tagging log