r95070 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95069‎ | r95070 | r95071 >
Date:08:33, 20 August 2011
Author:salvatoreingala
Status:deferred
Tags:
Comment:
- Some fixes for IE7/8.
- Improved (un-)styling of dialog buttons.
Modified paths:
  • /branches/salvatoreingala/Gadgets/ui/resources/ext.gadgets.preferences.js (modified) (history)
  • /branches/salvatoreingala/Gadgets/ui/resources/jquery.formBuilder.css (modified) (history)

Diff [purge]

Index: branches/salvatoreingala/Gadgets/ui/resources/jquery.formBuilder.css
@@ -10,6 +10,8 @@
1111 margin-right: 2%;
1212 width: 45%;
1313 vertical-align: middle;
 14+ /* IE7 */
 15+ *width: 42%;
1416 }
1517
1618 .formbuilder label.error {
@@ -30,6 +32,9 @@
3133 vertical-align: middle;
3234 display: inline-block;
3335 width: 50%;
 36+ /* IE7 */
 37+ zoom: 1;
 38+ *display: inline;
3439 }
3540
3641 .formBuilder-slider-tooltip {
Index: branches/salvatoreingala/Gadgets/ui/resources/ext.gadgets.preferences.js
@@ -43,7 +43,19 @@
4444 styleSheet.ownerNode : //not-IE or IE >= 9
4545 styleSheet.owningElement; //IE < 9
4646 owner.parentNode.removeChild( owner );
47 - }
 47+ }
 48+
 49+ //Function to set/remove "wait" cursor for all elements
 50+ var toggleWaitCursor = ( function() {
 51+ var waitCSS = null;
 52+ return function() {
 53+ if ( waitCSS === null ) {
 54+ waitCSS = mw.util.addCSS( '* { cursor: wait !important; }' );
 55+ } else {
 56+ waitCSS.disabled = !waitCSS.disabled;
 57+ }
 58+ };
 59+ } )();
4860
4961 //Shows a message in the bottom of the dialog, with fading
5062 function showMsg( msg ) {
@@ -63,13 +75,13 @@
6476 //disable all dialog buttons
6577 $( '#mw-gadgets-prefsDialog-close, #mw-gadgets-prefsDialog-save' ).button( 'disable' );
6678
67 - //Set cursor to "wait" for all elements; save the stylesheet so it can be removed later
68 - var waitCSS = mw.util.addCSS( '* { cursor: wait !important; }' );
 79+ //Set "wait" cursor
 80+ toggleWaitCursor();
6981
7082 //just to avoid code duplication
7183 function error() {
7284 //Remove "wait" cursor
73 - removeStylesheet( waitCSS );
 85+ toggleWaitCursor();
7486
7587 //Warn the user
7688 showMsg( mw.msg( 'gadgets-save-failed' ) );
@@ -92,7 +104,7 @@
93105 success: function( response ) {
94106 if ( typeof response.error == 'undefined' ) {
95107 //Remove "wait" cursor
96 - removeStylesheet( waitCSS );
 108+ toggleWaitCursor();
97109
98110 //Notify success to user
99111 showMsg( mw.msg( 'gadgets-save-success' ) );
@@ -189,7 +201,10 @@
190202 create: function() {
191203 //Remove styles to dialog buttons
192204 $( this ).dialog( 'widget' ).find( '.ui-button' )
193 - .removeClass().unbind( 'mouseover' ).unbind( 'mousedown' );
 205+ .removeClass().addClass( 'ui-button-text-only' )
 206+ .unbind( 'mouseover' )
 207+ .unbind( 'mousedown' )
 208+ .unbind( 'focus' );
194209 },
195210 close: function() {
196211 $( this ).remove();

Status & tagging log