r92798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92797‎ | r92798 | r92799 >
Date:21:43, 21 July 2011
Author:werdna
Status:deferred
Tags:
Comment:
Make privacy policy and disable links functional
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)

Diff [purge]

Index: trunk/extensions/MoodBar/MoodBar.i18n.php
@@ -35,7 +35,9 @@
3636 'moodbar-what-content' => 'This feature is designed to help the Wikipedia community understand the experience of people editing Wikipedia.
3737 For more information, please visit the $1.',
3838 'moodbar-what-link' => 'feature page',
39 - 'moodbar-disable' => "I'm not interested. Please disable this feature.",
 39+ 'moodbar-privacy' => 'By submitting, you agree that we may use your feedback as explained in $1.',
 40+ 'moodbar-privacy-link' => 'our policy',
 41+ 'moodbar-disable-link' => "I'm not interested. Please disable this feature.",
4042 'moodbar-form-title' => 'Because...',
4143 'moodbar-form-note' => '140 character maximum',
4244 'moodbar-form-note-dynamic' => '$1 characters remaining',
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.css
@@ -41,6 +41,7 @@
4242 }
4343
4444 .mw-moodBar-typeTitle,
 45+.mw-moodBar-privacy,
4546 .mw-moodBar-overlayWhat {
4647 font-size: 12px;
4748 }
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js
@@ -20,6 +20,7 @@
2121 <html:msg key="moodbar-form-title" />\
2222 </div>\
2323 <textarea maxlength="140" class="mw-moodBar-formInput" /></textarea>\
 24+ <div class="mw-moodBar-privacy"></div>\
2425 <input type="button" class="mw-moodBar-formSubmit" />\
2526 \
2627 </div>\
@@ -133,7 +134,8 @@
134135 .find( '.mw-moodBar-overlayWhatContent' )
135136 .html(
136137 function() {
137 - var message, linkMessage, link;
 138+ var message, linkMessage, link,
 139+ disableMsg, disableLink, out;
138140
139141 message = mw.message( 'moodbar-what-content' );
140142 linkMessage = mw.msg( 'moodbar-what-link' );
@@ -142,6 +144,40 @@
143145 'title': linkMessage
144146 }, linkMessage );
145147
 148+ out = message.escaped().replace( /\$1/, link );
 149+ out = mw.html.element( 'p', {},
 150+ new mw.html.Raw( out )
 151+ );
 152+
 153+ disableMsg = mw.msg( 'moodbar-disable-link' )
 154+ disableLink = mw.html.element( 'a', {
 155+ 'href' : '#',
 156+ 'class' : 'mw-moodBar-disable'
 157+ }, disableMsg );
 158+
 159+ out += mw.html.element( 'p', {},
 160+ new mw.html.Raw( disableLink )
 161+ );
 162+
 163+ return out;
 164+ }
 165+ )
 166+ .find('.mw-moodBar-disable')
 167+ .click( mb.event.disable )
 168+ .end()
 169+ .end()
 170+ .find( '.mw-moodBar-privacy' )
 171+ .html(
 172+ function() {
 173+ var message, linkMessage, link;
 174+
 175+ message = mw.message( 'moodbar-privacy' );
 176+ linkMessage = mw.msg( 'moodbar-privacy-link' );
 177+ link = mw.html.element( 'a', {
 178+ 'href': mb.conf.privacyUrl,
 179+ 'title': linkMessage
 180+ }, linkMessage );
 181+
146182 return message.escaped().replace( /\$1/, link );
147183 }
148184 )
Index: trunk/extensions/MoodBar/MoodBar.php
@@ -84,6 +84,9 @@
8585 'moodbar-form-policy-text',
8686 'moodbar-form-policy-label',
8787 'moodbar-form-submit',
 88+ 'moodbar-privacy',
 89+ 'moodbar-privacy-link',
 90+ 'moodbar-disable-link',
8891 ),
8992 'dependencies' => array(
9093 'mediawiki.util',
@@ -122,4 +125,5 @@
123126 'expires' => 30,
124127 ),
125128 'infoUrl' => 'http://www.mediawiki.org/wiki/MoodBar',
 129+ 'privacyUrl' => 'about:blank',
126130 );

Status & tagging log