http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99170
Revision: 99170 Author: yaron Date: 2011-10-06 23:36:15 +0000 (Thu, 06 Oct 2011) Log Message: ----------- 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 trunk/extensions/SemanticForms/libs/SemanticForms.js trunk/extensions/SemanticForms/skins/SemanticForms.css Modified: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php =================================================================== --- trunk/extensions/SemanticForms/includes/SF_FormPrinter.php 2011-10-06 23:28:13 UTC (rev 99169) +++ trunk/extensions/SemanticForms/includes/SF_FormPrinter.php 2011-10-06 23:36:15 UTC (rev 99170) @@ -1518,7 +1518,7 @@ // Add a warning in, if we're editing an existing page and that // page appears to not have been created with this form. if ( $this->mPageTitle->exists() && ( $existing_page_content != '' ) && ! $source_page_matches_this_form ) { - $form_text = "\t" . '<div class="warningbox">' . wfMsg( 'sf_formedit_formwarning', $this->mPageTitle->getFullURL() ) . "</div>\n" . $form_text; + $form_text = "\t" . '<div class="warningbox">' . wfMsg( 'sf_formedit_formwarning', $this->mPageTitle->getFullURL() ) . "</div>\n<br clear=\"both\" />\n" . $form_text; } // add form bottom, if no custom "standard inputs" have been defined Modified: trunk/extensions/SemanticForms/libs/SemanticForms.js =================================================================== --- trunk/extensions/SemanticForms/libs/SemanticForms.js 2011-10-06 23:28:13 UTC (rev 99169) +++ trunk/extensions/SemanticForms/libs/SemanticForms.js 2011-10-06 23:36:15 UTC (rev 99170) @@ -605,7 +605,7 @@ if (num_errors > 0) { // add error header, if it's not there already if (jQuery("#form_error_header").size() == 0) { - jQuery("#contentSub").append('<div id="form_error_header" class="warningMessage" style="font-size: medium"><img src="' + sfgScriptPath + '/skins/MW-Icon-AlertMark.png" /> ' + sfgFormErrorsHeader + '</div>'); + jQuery("#contentSub").append('<div id="form_error_header" class="errorbox" style="font-size: medium"><img src="' + sfgScriptPath + '/skins/MW-Icon-AlertMark.png" /> ' + sfgFormErrorsHeader + '</div><br clear="both" />'); } scroll(0, 0); } else { Modified: trunk/extensions/SemanticForms/skins/SemanticForms.css =================================================================== --- trunk/extensions/SemanticForms/skins/SemanticForms.css 2011-10-06 23:28:13 UTC (rev 99169) +++ trunk/extensions/SemanticForms/skins/SemanticForms.css 2011-10-06 23:36:15 UTC (rev 99170) @@ -80,13 +80,26 @@ width: auto; background: #eeeeee; } -#sfForm div.warningbox { +/** + * errorbox and warningbox CSS classes were added in MediaWiki 1.19 - + * the CSS here exists for backwards compatibility, and to provide + * some improvements for SF's specific usage. + */ +.errorbox, .warningbox { + margin: 20px 0 0 0; + width: auto; + float: none; +} +.errorbox { border: 2px solid red; + background-color: #fff2f2; padding: 5px 10px 5px 10px; - margin: 25px; - width: auto; - float:none; } +.warningbox { + border: 2px solid #ff8c00; + background-color: #ffffc0; + padding: 12px; +} span.errorMessage { color: red; } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs