r105286 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105285‎ | r105286 | r105287 >
Date:11:19, 6 December 2011
Author:santhosh
Status:ok
Tags:
Comment:
Removed the monobook skin specific code added in r105181.
Changed the UI binding to skin slightly to make it work in vector and monobook.
Followed the method used for Narayam extension in r105281
Modified paths:
  • /trunk/extensions/WebFonts/WebFonts.php (modified) (history)
  • /trunk/extensions/WebFonts/resources/ext.webfonts.css (modified) (history)
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)
  • /trunk/extensions/WebFonts/resources/ext.webfonts.monobook.css (deleted) (history)
  • /trunk/extensions/WebFonts/resources/ext.webfonts.monobook.js (deleted) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.monobook.css
@@ -1,9 +0,0 @@
2 -
3 -div#webfonts-menu {
4 - float: none;
5 -}
6 -
7 -ul#webfonts-fontsmenu {
8 - position: relative;
9 - margin: 0px;
10 -}
Index: trunk/extensions/WebFonts/resources/ext.webfonts.monobook.js
@@ -1,22 +0,0 @@
2 -/**
3 - * scripts specific for monobook skin of mediawiki.
4 - */
5 -
6 -( function ( $ ) {
7 - /**
8 - * Prepare the menu for the webfonts.
9 - * @param config The webfont configuration.
10 - */
11 - mw.webfonts.buildMenu = function(config) {
12 - var $menuItemsDiv = mw.webfonts.buildMenuItems( config );
13 - if( $menuItemsDiv == null ) {
14 - return;
15 - }
16 - var $div = $( '<div>' )
17 - .attr( 'id', 'webfonts-menu' )
18 - .addClass( 'portlet' )
19 - .append( $( '<h5>' ).text( mw.message( 'webfonts-load' ).escaped() ) )
20 - .append( $menuItemsDiv .find ('ul').addClass('pBody'));
21 - $div.insertAfter( '#p-search');
22 - };
23 -} ) ( jQuery );
Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -323,21 +323,26 @@
324324 if( $menuItemsDiv == null ) {
325325 return;
326326 }
327 - var $div = $( '<div>' )
 327+ var $menu = $( '<div>' )
328328 .attr( 'id', 'webfonts-menu' )
329329 .addClass( 'webfontMenu' )
330 - .append( $( '<a>' ).prop( 'href', '#' ).text( mw.message( 'webfonts-load' ).escaped() ) )
331330 .append( $menuItemsDiv );
332 -
 331+ var $link = $( '<a>' ).prop( 'href', '#' ).text( mw.message( 'webfonts-load' ).escaped() );
333332 // This is the fonts link
334 - var $li = $( '<li>' )
335 - .attr( 'id', 'pt-webfont' )
336 - .append( $div );
337 -
 333+ var $li = $( '<li>' ).attr( 'id', 'pt-webfont' ).append( $link );
338334 // If RTL, add to the right of top personal links. Else, to the left
339335 var fn = $( 'body' ).hasClass( 'rtl' ) ? 'append' : 'prepend';
340336 $( '#p-personal ul:first' )[fn]( $li );
341 -
 337+ $( 'body').prepend($menu);
 338+ $menu.hide();
 339+ $li.hover( function() {
 340+ $menuItemsDiv.css( 'left', $li.offset().left );
 341+ $menu.slideDown( 'slow' );
 342+ });
 343+ $menu.hover( function() {
 344+ }, function() {
 345+ $menu.slideUp( 'slow' );
 346+ });
342347 // Workaround for IE bug - ActiveX components like input fields coming on top of everything.
343348 // @todo Is there a better solution other than hiding it on hover?
344349 if ( $.browser.msie ) {
Index: trunk/extensions/WebFonts/resources/ext.webfonts.css
@@ -44,9 +44,12 @@
4545
4646 div.webfontMenu div.menu {
4747 position: relative;
48 - display: none;
 48+ display: block;
4949 clear: both;
5050 text-align: left;
 51+ top: 20px;
 52+ width: 300px;
 53+ font-size: 0.8em;
5154 }
5255
5356 /* OVERRIDDEN BY COMPLIANT BROWSERS */
@@ -66,11 +69,7 @@
6770 x:-moz-any-link {
6871 margin-left: 23px;
6972 }
70 -/* Enable forcing showing of the menu for accessibility */
71 -div.webfontMenu:hover div.menu,
72 -div.webfontMenu div.menuForceShow {
73 - display: block;
74 -}
 73+
7574 div.webfontMenu ul {
7675 position: absolute;
7776 background-color: white;
@@ -107,7 +106,6 @@
108107 padding: 0.5em;
109108 white-space: nowrap;
110109 color: #0645ad;
111 - font-size: 0.8em;
112110 }
113111 /* IGNORED BY IE6 */
114112 div.webfontMenu li > a {
Index: trunk/extensions/WebFonts/WebFonts.php
@@ -50,13 +50,9 @@
5151
5252 $wgResourceModules['ext.webfonts.core'] = array(
5353 'scripts' => array( 'resources/ext.webfonts.js', 'resources/ext.webfonts.fontlist.js' ),
54 - 'skinScripts' => array(
55 - 'monobook' => 'resources/ext.webfonts.monobook.js',
56 - ),
5754 'styles' => 'resources/ext.webfonts.css',
5855 'skinStyles' => array(
5956 'modern' => 'resources/ext.webfonts.modern.css',
60 - 'monobook' => 'resources/ext.webfonts.monobook.css',
6157 ),
6258 'localBasePath' => $dir,
6359 'remoteExtPath' => 'WebFonts',

Follow-up revisions

RevisionCommit summaryAuthorDate
r105429CSS cleanup,...santhosh14:28, 7 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105181Add webfont extension support for monobook skin.santhosh14:39, 5 December 2011
r105281Fix Narayam for monobook skin(Bug 32124)...santhosh10:02, 6 December 2011

Status & tagging log