r114004 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114003‎ | r114004 | r114005 >
Date:09:08, 16 March 2012
Author:zaran
Status:reverted (Comments)
Tags:gerritmigration 
Comment:
Bug 34942 - Add a show Headers preference. Apply ThomasPT's patch
Modified paths:
  • /trunk/extensions/ProofreadPage/ProofreadPage.i18n.php (modified) (history)
  • /trunk/extensions/ProofreadPage/ProofreadPage.php (modified) (history)
  • /trunk/extensions/ProofreadPage/ProofreadPage_body.php (modified) (history)
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php
@@ -1644,4 +1644,18 @@
16451645 return true;
16461646 }
16471647
 1648+ /**
 1649+ * Add ProofreadPage preferences to the preferences menu
 1650+ */
 1651+ public static function onGetPreferences( $user, &$preferences ) {
 1652+
 1653+ //Show header and footer fields when editing in the Page namespace
 1654+ $preferences['proofreadpage-showheaders'] = array(
 1655+ 'type' => 'toggle',
 1656+ 'label-message' => 'proofreadpage-preferences-showheaders-label',
 1657+ 'section' => 'editing/advancedediting',
 1658+ );
 1659+
 1660+ return true;
 1661+ }
16481662 }
Index: trunk/extensions/ProofreadPage/ProofreadPage.i18n.php
@@ -73,7 +73,8 @@
7474 'proofreadpage-button-zoom-out-label' => 'Zoom out',
7575 'proofreadpage-button-reset-zoom-label' => 'Original size',
7676 'proofreadpage-button-zoom-in-label' => 'Zoom in',
77 - 'proofreadpage-button-toggle-layout-label' => 'Vertical/horizontal layout'
 77+ 'proofreadpage-button-toggle-layout-label' => 'Vertical/horizontal layout',
 78+ 'proofreadpage-preferences-showheaders-label' => 'Show header and footer fields when editing in the Page namespace'
7879 );
7980
8081 /** Message documentation (Message documentation)
@@ -139,6 +140,7 @@
140141 'proofreadpage-button-zoom-out-label' => 'Tooltip text in button for zoom out, only visible in edit mode.',
141142 'proofreadpage-button-zoom-in-label' => 'Tooltip text in button for zoom in, only visible in edit mode.',
142143 'proofreadpage-button-toggle-layout-label' => 'Tooltip text in button for horizontal or vertical layout toggle, only visible in edit mode.',
 144+ 'proofreadpage-preferences-showheaders-label' => 'Description of the checkbox preference to show/hide the header and footer fields in the edit form of the Page namespace.'
143145 );
144146
145147 /** زَوُن ( زَوُن)
Index: trunk/extensions/ProofreadPage/proofread.js
@@ -754,10 +754,10 @@
755755 pr_make_edit_area( self.text_container, text.value );
756756 f.insertBefore( table, text.nextSibling ); // Inserts table after text
757757 f.removeChild( text );
758 - if ( !self.proofreadpage_show_headers ) {
759 - hookEvent( 'load', pr_toggle_visibility );
 758+ if ( mw.user.options.get( 'proofreadpage-showheaders' ) ) {
 759+ hookEvent( 'load', pr_reset_size );
760760 } else {
761 - hookEvent( 'load', pr_reset_size );
 761+ hookEvent( 'load', pr_toggle_visibility );
762762 }
763763 } else {
764764 var new_text = f.removeChild( text );
Index: trunk/extensions/ProofreadPage/ProofreadPage.php
@@ -83,6 +83,7 @@
8484 'proofreadpage-button-reset-zoom-label',
8585 'proofreadpage-button-zoom-in-label',
8686 'proofreadpage-button-toggle-layout-label',
 87+ 'proofreadpage-preferences-showheaders-label',
8788 )
8889 ),
8990 'ext.proofreadpage.article' => $prpResourceTemplate + array(
@@ -107,3 +108,4 @@
108109 $wgHooks['EditPage::importFormData'][] = 'ProofreadPage::onEditPageImportFormData';
109110 $wgHooks['OutputPageParserOutput'][] = 'ProofreadPage::onOutputPageParserOutput';
110111 $wgHooks['wgQueryPages'][] = 'ProofreadPage::onwgQueryPages';
 112+$wgHooks['GetPreferences'][] = 'ProofreadPage::onGetPreferences';

Follow-up revisions

RevisionCommit summaryAuthorDate
r114122Follow-up to r114004 - Use tabs instead of spaceszaran02:30, 19 March 2012
r114398Revert r113358, r113461, r114004, r114122. Unreviewed revs in ProofreadPage....catrope19:44, 21 March 2012

Comments

#Comment by Reedy (talk | contribs)   23:19, 16 March 2012

Minor nitpick, we use tabs for indenting, not spaces. So in the javascript changes you're using a mix of spaces and tabs.

#Comment by MZMcBride (talk | contribs)   03:13, 2 June 2012

Status & tagging log