Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -14,8 +14,21 @@ |
15 | 15 | |
16 | 16 | $messages['en'] = array( |
17 | 17 | 'moodbar-desc' => 'Allows specified users to send their "mood" back to the site operator', |
| 18 | + 'moodbar-trigger-using' => 'Using $1...', |
| 19 | + 'tooltip-p-moodbar-trigger-using' => '', |
| 20 | + 'moodbar-trigger-feedback' => 'Feedback', |
| 21 | + 'tooltip-p-moodbar-trigger-feedback' => '', |
18 | 22 | ); |
| 23 | + |
| 24 | +/** Message documentation |
| 25 | + * @author Krinkle |
| 26 | + */ |
19 | 27 | |
| 28 | +$messages['qqq'] = array( |
| 29 | + 'moodbar-trigger-using' => 'Link text of the MoodBar overlay trigger. $1 is the SITENAME.', |
| 30 | + 'moodbar-trigger-feedback' => 'Link text of the MoodBar overlay trigger. $1 is the SITENAME.', |
| 31 | +); |
| 32 | + |
20 | 33 | /** Afrikaans (Afrikaans) |
21 | 34 | * @author Naudefj |
22 | 35 | */ |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/speechbubble-icon-rndrectangle-blue.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/speechbubble-icon-rndrectangle-blue.png |
___________________________________________________________________ |
Added: svn:mime-type |
23 | 36 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/speechbubble-icon-ellipse-blue.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/speechbubble-icon-ellipse-blue.png |
___________________________________________________________________ |
Added: svn:mime-type |
24 | 37 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.css |
— | — | @@ -0,0 +1,22 @@ |
| 2 | +/* Based on p-personal */ |
| 3 | +#p-moodbar { |
| 4 | + position: absolute; |
| 5 | + left: 10.75em; |
| 6 | + top: 0px; |
| 7 | +} |
| 8 | + |
| 9 | +#p-moodbar p { |
| 10 | + margin-top: 0.5em; |
| 11 | + margin-right: 0.75em; |
| 12 | + font-size: 0.75em; |
| 13 | + white-space: nowrap; |
| 14 | + line-height: 1.125em; |
| 15 | + text-transform: none; |
| 16 | + padding-left: 20px !important; |
| 17 | + /* @embed */ |
| 18 | + background: url(images/speechbubble-icon-ellipse-blue.png) left top no-repeat; |
| 19 | +} |
| 20 | + |
| 21 | +#mw-moodbar-overlay { |
| 22 | + |
| 23 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 24 | + native |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.js |
— | — | @@ -0,0 +1,52 @@ |
| 2 | +/** |
| 3 | + * Front-end scripting for the MoodBar MediaWiki extension |
| 4 | + * |
| 5 | + * @author Timo Tijhof, 2011 |
| 6 | + */ |
| 7 | +( function( $ ) { |
| 8 | + |
| 9 | + var mb = mw.moodBar = { |
| 10 | + |
| 11 | + ui: { |
| 12 | + // jQuery objects |
| 13 | + pMoodbar: null, |
| 14 | + trigger: null, |
| 15 | + overlay: null // @todo |
| 16 | + }, |
| 17 | + event: { |
| 18 | + trigger: function( e ) { |
| 19 | + e.preventDefault(); |
| 20 | + } |
| 21 | + }, |
| 22 | + init: function() { |
| 23 | + var ui = mb.ui; |
| 24 | + |
| 25 | + // Create portlet |
| 26 | + ui.pMoodbar = $( '<div id="p-moodbar"></div>' ); |
| 27 | + |
| 28 | + // Create trigger |
| 29 | + ui.trigger = $( '<a>', { |
| 30 | + href: '#', |
| 31 | + title: mw.msg( 'tooltip-p-moodbar-trigger-using' ), |
| 32 | + text: mw.msg( 'moodbar-trigger-using', mw.config.get( 'wgSiteName' ) ), |
| 33 | + click: mb.event.trigger |
| 34 | + }); |
| 35 | + |
| 36 | + // Insert trigger into portlet |
| 37 | + ui.trigger |
| 38 | + .wrap( '<p>' ) |
| 39 | + .parent() |
| 40 | + .appendTo( ui.pMoodbar ); |
| 41 | + |
| 42 | + // Inject portlet into document, when document is ready |
| 43 | + $( mb.inject ); |
| 44 | + }, |
| 45 | + inject: function() { |
| 46 | + $( '#mw-head' ).append( mb.ui.pMoodbar ); |
| 47 | + } |
| 48 | + |
| 49 | + }; |
| 50 | + |
| 51 | + mw.moodBar.init(); |
| 52 | + |
| 53 | +} )( jQuery ); |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 54 | + native |
Index: trunk/extensions/MoodBar/MoodBar.php |
— | — | @@ -30,13 +30,18 @@ |
31 | 31 | |
32 | 32 | // Resources |
33 | 33 | $mbResourceTemplate = array( |
34 | | - 'localBasePath' => dirname(__FILE__), |
35 | | - 'remoteExtPath' => 'MoodBar' |
| 34 | + 'localBasePath' => dirname(__FILE__) . '/modules', |
| 35 | + 'remoteExtPath' => 'MoodBar/modules' |
36 | 36 | ); |
37 | 37 | |
38 | | -$wgResourceModules['ext.moodbar'] = $mbResourceTemplate + array( |
39 | | - 'styles' => array( ), |
40 | | - 'scripts' => array( ), |
41 | | - 'dependencies' => array( ), |
42 | | - 'messages' => array( ), |
| 38 | +$wgResourceModules['ext.moodBar'] = $mbResourceTemplate + array( |
| 39 | + 'styles' => 'ext.moodBar/ext.moodBar.css', |
| 40 | + 'scripts' => 'ext.moodBar/ext.moodBar.js', |
| 41 | + 'messages' => array( |
| 42 | + 'moodbar-trigger-using', |
| 43 | + 'tooltip-p-moodbar-trigger-using', |
| 44 | + 'moodbar-trigger-feedback', |
| 45 | + 'tooltip-p-moodbar-trigger-feedback', |
| 46 | + ), |
| 47 | + 'position' => 'top', |
43 | 48 | ); |
Index: trunk/extensions/MoodBar/MoodBar.hooks.php |
— | — | @@ -5,8 +5,8 @@ |
6 | 6 | * Adds MoodBar JS to the output if appropriate. |
7 | 7 | */ |
8 | 8 | public static function onPageDisplay( &$output, &$skin ) { |
9 | | - if ( self::shouldShowMoodbar() ) { |
10 | | - $output->addModules( array('ext.moodbar') ); |
| 9 | + if ( self::shouldShowMoodbar( $output, $skin ) ) { |
| 10 | + $output->addModules( array('ext.moodBar') ); |
11 | 11 | } |
12 | 12 | |
13 | 13 | return true; |
— | — | @@ -15,8 +15,15 @@ |
16 | 16 | /** |
17 | 17 | * Determines whether or not we should show the MoodBar. |
18 | 18 | */ |
19 | | - public static function shouldShowMoodbar() { |
20 | | - return true; |
| 19 | + public static function shouldShowMoodbar( &$output, &$skin ) { |
| 20 | + // Front-end appends to header elements, which have different |
| 21 | + // locations and IDs in every skin. |
| 22 | + // Untill there is some kind of central registry of element-ids |
| 23 | + // that skins implement, or a fixed name for each of them, just |
| 24 | + // show it in Vector for now. |
| 25 | + if ( $skin->getSkinName() == 'vector' ) { |
| 26 | + return true; |
| 27 | + } |
21 | 28 | } |
22 | 29 | |
23 | 30 | /** |