r17660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17659‎ | r17660 | r17661 >
Date:06:33, 14 November 2006
Author:simetrical
Status:old
Tags:
Comment:
(bug 7811) Allow preview of edit summaries. Slight tweak added to stylesheet for Monobook but no others; possibly some small margins would be good additions to other skins, but it should look fine in all.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/main.css
@@ -1533,4 +1533,8 @@
15341534 .imagelist .TablePager_col_img_description { white-space: normal }
15351535 .imagelist th.TablePager_sort { background-color: #ccccff }
15361536
1537 -.templatesUsed { margin-top: 1.5em; }
\ No newline at end of file
 1537+.templatesUsed { margin-top: 1.5em; }
 1538+
 1539+.mw-summary-preview {
 1540+ margin: 0.1em 0;
 1541+}
Index: trunk/phase3/includes/EditPage.php
@@ -1021,9 +1021,11 @@
10221022 if( $this->section == 'new' ) {
10231023 $commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}:</label></span>\n<div class='editOptions'>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
10241024 $editsummary = '';
 1025+ $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('subject-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : '';
10251026 } else {
10261027 $commentsubject = '';
10271028 $editsummary="<span id='wpSummaryLabel'><label for='wpSummary'>{$summary}:</label></span>\n<div class='editOptions'>\n<input tabindex='2' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
 1029+ $summarypreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('summary-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : '';
10281030 }
10291031
10301032 # Set focus to the edit box on load, except on preview or diff, where it would interfere with the display
@@ -1141,6 +1143,7 @@
11421144 $wgOut->addHTML( <<<END
11431145 $recreate
11441146 {$commentsubject}
 1147+{$subjectpreview}
11451148 <textarea tabindex='1' accesskey="," name="wpTextbox1" id="wpTextbox1" rows='{$rows}'
11461149 cols='{$cols}'{$ew} $hidden>
11471150 END
@@ -1153,6 +1156,7 @@
11541157 $wgOut->addHTML( "
11551158 {$metadata}
11561159 {$editsummary}
 1160+{$summarypreview}
11571161 {$checkboxhtml}
11581162 {$safemodehtml}
11591163 ");
@@ -1237,6 +1241,7 @@
12381242 */
12391243 function showPreview() {
12401244 global $wgOut;
 1245+
12411246 $wgOut->addHTML( '<div id="wikiPreview">' );
12421247 if($this->mTitle->getNamespace() == NS_CATEGORY) {
12431248 $this->mArticle->openShowCategory();
@@ -1246,7 +1251,6 @@
12471252 if($this->mTitle->getNamespace() == NS_CATEGORY) {
12481253 $this->mArticle->closeShowCategory();
12491254 }
1250 - $wgOut->addHTML( "<br style=\"clear:both;\" />\n" );
12511255 $wgOut->addHTML( '</div>' );
12521256 }
12531257
Index: trunk/phase3/RELEASE-NOTES
@@ -181,8 +181,9 @@
182182 * (bug 3687) Add distinct heading for media files in category display.
183183 * (bug 1578) Add different icons for external links to audio, video, or PDF in
184184 Monobook.
185 -* Made autoblocks block account creation if the user block has that bit set.
 185+* Made autoblocks block account creation if the user block has that option enabled.
186186 * Add auto-summaries to blankings and large removals without summaries.
 187+* (bug 7811) Allow preview of edit summaries.
187188
188189 == Languages updated ==
189190
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -889,6 +889,8 @@
890890 'missingsummary' => "'''Reminder:''' You have not provided an edit summary. If you click Save again, your edit will be saved without one.",
891891 'missingcommenttext' => 'Please enter a comment below.',
892892 'missingcommentheader' => "'''Reminder:''' You have not provided a subject/headline for this comment. If you click Save again, your edit will be saved without one.",
 893+'summary-preview' => 'Summary preview',
 894+'subject-preview' => 'Subject/headline preview',
893895 'blockedtitle' => 'User is blocked',
894896 'blockedtext' => "<big>'''Your user name or IP address has been blocked.'''</big>
895897