Index: trunk/extensions/ProofreadPage/ProofreadPage_body.php |
— | — | @@ -1644,4 +1644,18 @@ |
1645 | 1645 | return true; |
1646 | 1646 | } |
1647 | 1647 | |
| 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 | + } |
1648 | 1662 | } |
Index: trunk/extensions/ProofreadPage/ProofreadPage.i18n.php |
— | — | @@ -73,7 +73,8 @@ |
74 | 74 | 'proofreadpage-button-zoom-out-label' => 'Zoom out', |
75 | 75 | 'proofreadpage-button-reset-zoom-label' => 'Original size', |
76 | 76 | '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' |
78 | 79 | ); |
79 | 80 | |
80 | 81 | /** Message documentation (Message documentation) |
— | — | @@ -139,6 +140,7 @@ |
140 | 141 | 'proofreadpage-button-zoom-out-label' => 'Tooltip text in button for zoom out, only visible in edit mode.', |
141 | 142 | 'proofreadpage-button-zoom-in-label' => 'Tooltip text in button for zoom in, only visible in edit mode.', |
142 | 143 | '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.' |
143 | 145 | ); |
144 | 146 | |
145 | 147 | /** زَوُن ( زَوُن) |
Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -754,10 +754,10 @@ |
755 | 755 | pr_make_edit_area( self.text_container, text.value ); |
756 | 756 | f.insertBefore( table, text.nextSibling ); // Inserts table after text |
757 | 757 | 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 ); |
760 | 760 | } else { |
761 | | - hookEvent( 'load', pr_reset_size ); |
| 761 | + hookEvent( 'load', pr_toggle_visibility ); |
762 | 762 | } |
763 | 763 | } else { |
764 | 764 | var new_text = f.removeChild( text ); |
Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -83,6 +83,7 @@ |
84 | 84 | 'proofreadpage-button-reset-zoom-label', |
85 | 85 | 'proofreadpage-button-zoom-in-label', |
86 | 86 | 'proofreadpage-button-toggle-layout-label', |
| 87 | + 'proofreadpage-preferences-showheaders-label', |
87 | 88 | ) |
88 | 89 | ), |
89 | 90 | 'ext.proofreadpage.article' => $prpResourceTemplate + array( |
— | — | @@ -107,3 +108,4 @@ |
108 | 109 | $wgHooks['EditPage::importFormData'][] = 'ProofreadPage::onEditPageImportFormData'; |
109 | 110 | $wgHooks['OutputPageParserOutput'][] = 'ProofreadPage::onOutputPageParserOutput'; |
110 | 111 | $wgHooks['wgQueryPages'][] = 'ProofreadPage::onwgQueryPages'; |
| 112 | +$wgHooks['GetPreferences'][] = 'ProofreadPage::onGetPreferences'; |