'id' => $name,
'cols' => $wgUser->getIntOption( 'cols' ),
'rows' => $wgUser->getIntOption( 'rows' ),
+ // The following classes can be used here:
+ // * mw-editfont-default
+ // * mw-editfont-monospace
+ // * mw-editfont-sans-serif
+ // * mw-editfont-serif
+ 'class' => 'mw-editfont-' . $wgUser->getOption( 'editfont' ),
// Avoid PHP notices when appending preferences
// (appending allows customAttribs['style'] to still work).
'style' => ''
$rules[] = "a { text-decoration: " .
( $options['underline'] ? 'underline' : 'none' ) . "; }";
}
- if ( $options['editfont'] !== 'default' ) {
- // Double-check that $options['editfont'] consists of safe characters only
- if ( preg_match( '/^[a-zA-Z0-9_, -]+$/', $options['editfont'] ) ) {
- $rules[] = "textarea { font-family: {$options['editfont']}; }\n";
- }
- }
$style = implode( "\n", $rules );
if ( $this->getFlip( $context ) ) {
$style = CSSJanus::transform( $style, true, false );
clear: both;
}
+/* Edit font preference */
+/* TODO: for 'default' on non-textareas we could compute the default font of textarea in the client */
+.mw-editfont-default:not( textarea ) {
+ font-family: monospace;
+}
+
+/* Keep this rule separate from the :not rule above so it still works in older browsers */
+.mw-editfont-monospace {
+ font-family: monospace;
+}
+
+.mw-editfont-sans-serif {
+ font-family: sans-serif;
+}
+
+.mw-editfont-serif {
+ font-family: serif;
+}
+
/**
* rev_deleted stuff
*/