r99170 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99169‎ | r99170 | r99171 >
Date:23:36, 6 October 2011
Author:yaron
Status:deferred
Tags:
Comment:
Follow-up to r98358 - improved and standardized display of warning and error boxes, especially for versions of MW before 1.19
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)
  • /trunk/extensions/SemanticForms/libs/SemanticForms.js (modified) (history)
  • /trunk/extensions/SemanticForms/skins/SemanticForms.css (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -1518,7 +1518,7 @@
15191519 // Add a warning in, if we're editing an existing page and that
15201520 // page appears to not have been created with this form.
15211521 if ( $this->mPageTitle->exists() && ( $existing_page_content != '' ) && ! $source_page_matches_this_form ) {
1522 - $form_text = "\t" . '<div class="warningbox">' . wfMsg( 'sf_formedit_formwarning', $this->mPageTitle->getFullURL() ) . "</div>\n" . $form_text;
 1522+ $form_text = "\t" . '<div class="warningbox">' . wfMsg( 'sf_formedit_formwarning', $this->mPageTitle->getFullURL() ) . "</div>\n<br clear=\"both\" />\n" . $form_text;
15231523 }
15241524
15251525 // add form bottom, if no custom "standard inputs" have been defined
Index: trunk/extensions/SemanticForms/skins/SemanticForms.css
@@ -80,13 +80,26 @@
8181 width: auto;
8282 background: #eeeeee;
8383 }
84 -#sfForm div.warningbox {
 84+/**
 85+ * errorbox and warningbox CSS classes were added in MediaWiki 1.19 -
 86+ * the CSS here exists for backwards compatibility, and to provide
 87+ * some improvements for SF's specific usage.
 88+ */
 89+.errorbox, .warningbox {
 90+ margin: 20px 0 0 0;
 91+ width: auto;
 92+ float: none;
 93+}
 94+.errorbox {
8595 border: 2px solid red;
 96+ background-color: #fff2f2;
8697 padding: 5px 10px 5px 10px;
87 - margin: 25px;
88 - width: auto;
89 - float:none;
9098 }
 99+.warningbox {
 100+ border: 2px solid #ff8c00;
 101+ background-color: #ffffc0;
 102+ padding: 12px;
 103+}
91104 span.errorMessage {
92105 color: red;
93106 }
Index: trunk/extensions/SemanticForms/libs/SemanticForms.js
@@ -605,7 +605,7 @@
606606 if (num_errors > 0) {
607607 // add error header, if it's not there already
608608 if (jQuery("#form_error_header").size() == 0) {
609 - jQuery("#contentSub").append('<div id="form_error_header" class="warningMessage" style="font-size: medium"><img src="' + sfgScriptPath + '/skins/MW-Icon-AlertMark.png" />&nbsp;' + sfgFormErrorsHeader + '</div>');
 609+ jQuery("#contentSub").append('<div id="form_error_header" class="errorbox" style="font-size: medium"><img src="' + sfgScriptPath + '/skins/MW-Icon-AlertMark.png" />&nbsp;' + sfgFormErrorsHeader + '</div><br clear="both" />');
610610 }
611611 scroll(0, 0);
612612 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98358small change to use standard warningbox to have a consistant UI...dasch19:41, 28 September 2011