r92769 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92768‎ | r92769 | r92770 >
Date:18:56, 21 July 2011
Author:krinkle
Status:deferred
Tags:
Comment:
MoodBar front-end dev:
* ext.moodBar.core:
- New images from Brandon
- Updates the 3 "normal" states to be the same size (40x40px)
- Change :hover to -hover as class due to CSS point cascading rules (:hover would override -selected, one could use !important but then you add a shitload of points at once that would also override -selected:hover so we need another !important and another one and another one...)

- Implemented "What is this" slide trigger

Other verbosity left out for Andrew's sanity.
Modified paths:
  • /trunk/extensions/MoodBar/MoodBar.i18n.php (modified) (history)
  • /trunk/extensions/MoodBar/MoodBar.php (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.css (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-dull.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hovered.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hoverside.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-normal.png (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-selected.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-dull.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hovered.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hoverside.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-normal.png (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-selected.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-dull.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hovered.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hoverside.png (added) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-normal.png (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-selected.png (added) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/MoodBar.i18n.php
@@ -30,6 +30,9 @@
3131 'tooltip-moodbar-what' => 'Learn more about this feature',
3232 'moodbar-what-target' => 'http://www.mediawiki.org/wiki/MoodBar',
3333 'moodbar-what-label' => 'What is this?',
 34+ 'moodbar-what-expanded' => '▼', // Ignore, do not translate
 35+ 'moodbar-what-collapsed' => '▶', // Ignore, do not translate
 36+ 'moodbar-what-content' => '--- @todo ---',
3437 // Special:MoodBar
3538 'right-moodbar-view' => 'View and export MoodBar feedback',
3639 'moodbar-admin-title' => 'MoodBar feedback',
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.css
@@ -42,6 +42,10 @@
4343 font-size: 12px;
4444 }
4545
 46+.mw-moodBar-overlayWhatContent {
 47+ display: none;
 48+}
 49+
4650 /**
4751 * Types
4852 */
@@ -50,14 +54,14 @@
5155 .mw-moodBar-types .mw-moodBar-type-happy {
5256 background-image: url(images/type-happy-normal.png);
5357 }
54 -.mw-moodBar-types:hover .mw-moodBar-type-happy {
55 - background-image: url(images/type-happy-hover.png);
 58+.mw-moodBar-types-hover .mw-moodBar-type-happy {
 59+ background-image: url(images/type-happy-hoverside.png);
5660 }
57 -.mw-moodBar-types:hover .mw-moodBar-type-happy:hover {
 61+.mw-moodBar-types-hover .mw-moodBar-type-happy:hover {
5862 background-image: url(images/type-happy-hovered.png);
5963 }
60 -.mw-moodBar-types-select .mw-moodBar-type-happy {
61 - background-image: url(images/type-happy-select.png);
 64+.mw-moodBar-types-select .mw-moodBar-type-happy {
 65+ background-image: url(images/type-happy-dull.png);
6266 }
6367 .mw-moodBar-types-select .mw-moodBar-type-happy.mw-moodBar-selected {
6468 background-image: url(images/type-happy-selected.png);
@@ -67,14 +71,14 @@
6872 .mw-moodBar-types .mw-moodBar-type-sad {
6973 background-image: url(images/type-sad-normal.png);
7074 }
71 -.mw-moodBar-types:hover .mw-moodBar-type-sad {
72 - background-image: url(images/type-sad-hover.png);
 75+.mw-moodBar-types-hover .mw-moodBar-type-sad {
 76+ background-image: url(images/type-sad-hoverside.png);
7377 }
74 -.mw-moodBar-types:hover .mw-moodBar-type-sad:hover {
 78+.mw-moodBar-types-hover .mw-moodBar-type-sad:hover {
7579 background-image: url(images/type-sad-hovered.png);
7680 }
7781 .mw-moodBar-types-select .mw-moodBar-type-sad {
78 - background-image: url(images/type-sad-select.png);
 82+ background-image: url(images/type-sad-dull.png);
7983 }
8084 .mw-moodBar-types-select .mw-moodBar-type-sad.mw-moodBar-selected {
8185 background-image: url(images/type-sad-selected.png);
@@ -84,14 +88,14 @@
8589 .mw-moodBar-types .mw-moodBar-type-confused {
8690 background-image: url(images/type-confused-normal.png);
8791 }
88 -.mw-moodBar-types:hover .mw-moodBar-type-confused {
89 - background-image: url(images/type-confused-hover.png);
 92+.mw-moodBar-types-hover .mw-moodBar-type-confused {
 93+ background-image: url(images/type-confused-hoverside.png);
9094 }
91 -.mw-moodBar-types:hover .mw-moodBar-type-confused:hover {
 95+.mw-moodBar-types-hover .mw-moodBar-type-confused:hover {
9296 background-image: url(images/type-confused-hovered.png);
9397 }
9498 .mw-moodBar-types-select .mw-moodBar-type-confused {
95 - background-image: url(images/type-confused-select.png);
 99+ background-image: url(images/type-confused-dull.png);
96100 }
97101 .mw-moodBar-types-select .mw-moodBar-type-confused.mw-moodBar-selected {
98102 background-image: url(images/type-confused-selected.png);
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js
@@ -14,7 +14,13 @@
1515 <span class="mw-moodBar-overlayClose"><a href="#"><html:msg key="moodbar-close" /></a></span>\
1616 <div class="mw-moodBar-overlayTitle"><html:msg key="moodbar-intro-using" /></div>\
1717 <div class="mw-moodBar-types"></div>\
18 - <span class="mw-moodBar-overlayWhat"><a title-msg="tooltip-moodbar-what"><html:msg key="moodbar-what-label" /></a></span>\
 18+ <span class="mw-moodBar-overlayWhat">\
 19+ <a title-msg="tooltip-moodbar-what">\
 20+ <span class="mw-moodBar-overlayWhatTrigger"></span>\
 21+ <span class="mw-moodBar-overlayWhatLabel"><html:msg key="moodbar-what-label" /></span>\
 22+ </a>\
 23+ <div class="mw-moodBar-overlayWhatContent"><html:msg key="moodbar-what-content" /></div>\
 24+ </span>\
1925 </div>',
2026 type: '\
2127 <div class="mw-moodBar-type mw-moodBar-type-$1" rel="$1">\
@@ -36,7 +42,14 @@
3743 feedbackItem: {
3844 comment: '',
3945 bucket: mb.conf.bucketKey,
40 - type: 'unknown'
 46+ type: 'unknown',
 47+ callback: function( data ) {
 48+ if ( data && data.moodbar && data.moodbar.result === 'success' ) {
 49+ alert(1);
 50+ } else {
 51+ alert(0);
 52+ }
 53+ }
4154 },
4255
4356 core: function() {
@@ -61,27 +74,47 @@
6275 $( mb.tpl.type.replace( /\$1/g, type ) )
6376 .localize()
6477 .click( function( e ) {
 78+ var $el = $( this );
6579 $mwMoodBarTypes.addClass( 'mw-moodBar-types-select' );
66 - mb.feedbackItem.type = $(this).attr( 'rel' );
 80+ mb.feedbackItem.type = $el.attr( 'rel' );
 81+ $el.addClass( 'mw-moodBar-selected' );
 82+ $el.parent()
 83+ .find( '.mw-moodBar-selected' )
 84+ .not( $el )
 85+ .removeClass( 'mw-moodBar-selected' );
6786 } )
6887 .get( 0 )
6988 );
7089 } );
71 - return elems;
 90+ return elems;ß
7291 } )
 92+ .hover( function() {
 93+ $( this ).addClass( 'mw-moodBar-types-hover' );
 94+ }, function() {
 95+ $( this ).removeClass( 'mw-moodBar-types-hover' );
 96+ } )
7397 .end()
7498 // Link what-button
 99+ .find( '.mw-moodBar-overlayWhatTrigger' )
 100+ .html( mw.msg( 'moodbar-what-collapsed' ) )
 101+ .end()
75102 .find( '.mw-moodBar-overlayWhat > a' )
76 - .attr( 'href', function() {
77 - var target = mw.msg( 'moodbar-what-target' ),
78 - r = new RegExp( '^(' + mw.config.get( 'wgUrlProtocols' ) + ')', 'i' );
79 - if ( r.exec( target ) ) {
80 - return target;
81 - } else {
82 - return mw.util.wikiGetlink( target );
83 - }
 103+ .click( function() {
 104+ mb.ui.overlay
 105+ .find( '.mw-moodBar-overlayWhatContent' )
 106+ .each( function() {
 107+ var $el = $( this ),
 108+ $trigger = mb.ui.overlay.find( '.mw-moodBar-overlayWhatTrigger' );
 109+ if ( $el.is( ':visible' ) ) {
 110+ $el.slideUp();
 111+ $trigger.html( mw.msg( 'moodbar-what-collapsed' ) );
 112+ } else {
 113+ $el.slideDown();
 114+ $trigger.html( mw.msg( 'moodbar-what-expanded' ) );
 115+ }
 116+ } )
84117 } )
85 - .end();
 118+ .end();
86119
87120 // Inject overlay
88121 mb.ui.overlay.appendTo( 'body' );
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-dull.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-dull.png
___________________________________________________________________
Added: svn:mime-type
89122 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hoverside.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hoverside.png
___________________________________________________________________
Added: svn:mime-type
90123 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-normal.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-selected.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-selected.png
___________________________________________________________________
Added: svn:mime-type
91124 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-selected.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-selected.png
___________________________________________________________________
Added: svn:mime-type
92125 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hoverside.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hoverside.png
___________________________________________________________________
Added: svn:mime-type
93126 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-normal.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hovered.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hovered.png
___________________________________________________________________
Added: svn:mime-type
94127 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hovered.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hovered.png
___________________________________________________________________
Added: svn:mime-type
95128 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-dull.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-dull.png
___________________________________________________________________
Added: svn:mime-type
96129 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-dull.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-dull.png
___________________________________________________________________
Added: svn:mime-type
97130 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hoverside.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hoverside.png
___________________________________________________________________
Added: svn:mime-type
98131 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-normal.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-selected.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-selected.png
___________________________________________________________________
Added: svn:mime-type
99132 + image/png
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hovered.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hovered.png
___________________________________________________________________
Added: svn:mime-type
100133 + image/png
Index: trunk/extensions/MoodBar/MoodBar.php
@@ -74,6 +74,9 @@
7575 'tooltip-moodbar-what',
7676 'moodbar-what-target',
7777 'moodbar-what-label',
 78+ 'moodbar-what-expanded',
 79+ 'moodbar-what-collapsed',
 80+ 'moodbar-what-content',
7881 ),
7982 'dependencies' => array(
8083 'mediawiki.util',

Follow-up revisions

RevisionCommit summaryAuthorDate
r92772Followup r92769: ignore messages for translatewiki.net....raymond19:00, 21 July 2011

Status & tagging log