Index: trunk/phase3/skins/common/config.js |
— | — | @@ -67,9 +67,9 @@ |
68 | 68 | $( '.enableForOther' ).click( function() { |
69 | 69 | var $textbox = $( '#' + $(this).attr( 'rel' ) ); |
70 | 70 | if ( $(this).val() == 'other' ) { // FIXME: Ugh, this is ugly |
71 | | - $textbox.removeAttr( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' ); |
| 71 | + $textbox.removeProp( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' ); |
72 | 72 | } else { |
73 | | - $textbox.attr( 'readonly', 'readonly' ).closest( '.config-block' ).slideUp( 'fast' ); |
| 73 | + $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' ); |
74 | 74 | } |
75 | 75 | } ); |
76 | 76 | |
Index: trunk/phase3/skins/common/preview.js |
— | — | @@ -37,8 +37,8 @@ |
38 | 38 | // with the content of the loaded page |
39 | 39 | var copyContent = page.find( copyElements[i] ).contents(); |
40 | 40 | $(copyElements[i]).empty().append( copyContent ); |
41 | | - var newClasses = page.find( copyElements[i] ).attr('class'); |
42 | | - $(copyElements[i]).attr( 'class', newClasses ); |
| 41 | + var newClasses = page.find( copyElements[i] ).prop('class'); |
| 42 | + $(copyElements[i]).prop( 'class', newClasses ); |
43 | 43 | } |
44 | 44 | |
45 | 45 | $.each( copyElements, function(k,v) { |
Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js |
— | — | @@ -93,10 +93,8 @@ |
94 | 94 | byteLimitTest({ |
95 | 95 | description: 'Limit using the maxlength attribute', |
96 | 96 | $input: $( '<input>' ) |
97 | | - .attr( { |
98 | | - 'type': 'text', |
99 | | - 'maxlength': '10' |
100 | | - }) |
| 97 | + .attr( 'type', 'text' ) |
| 98 | + .prop( 'maxLength', '10' ) |
101 | 99 | .byteLimit(), |
102 | 100 | sample: simpleSample, |
103 | 101 | hasLimit: true, |
— | — | @@ -120,10 +118,8 @@ |
121 | 119 | byteLimitTest({ |
122 | 120 | description: 'Limit using a custom value, overriding maxlength attribute', |
123 | 121 | $input: $( '<input>' ) |
124 | | - .attr( { |
125 | | - 'type': 'text', |
126 | | - 'maxLength': '10' |
127 | | - }) |
| 122 | + .attr( 'type', 'text' ) |
| 123 | + .prop( 'maxLength', '10' ) |
128 | 124 | .byteLimit( 15 ), |
129 | 125 | sample: simpleSample, |
130 | 126 | hasLimit: true, |
— | — | @@ -183,10 +179,8 @@ |
184 | 180 | byteLimitTest({ |
185 | 181 | description: 'Limit using the maxlength attribute and pass a callback as input filter', |
186 | 182 | $input: $( '<input>' ) |
187 | | - .attr( { |
188 | | - 'type': 'text', |
189 | | - 'maxLength': '6' |
190 | | - }) |
| 183 | + .attr( 'type', 'text' ) |
| 184 | + .prop( 'maxLength', '6' ) |
191 | 185 | .byteLimit( function( val ) { |
192 | 186 | _titleConfig(); |
193 | 187 | |
Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | function( $table ) { |
306 | 306 | //Quick&Dirty mod |
307 | 307 | $table.find('tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)').remove(); |
308 | | - $table.find('tr:eq(2) td:eq(1)').attr('rowspan', '3'); |
| 308 | + $table.find('tr:eq(2) td:eq(1)').prop('rowspan', '3'); |
309 | 309 | $table.tablesorter(); |
310 | 310 | $table.find('.headerSort:eq(0)').click(); |
311 | 311 | } |
— | — | @@ -317,7 +317,7 @@ |
318 | 318 | function( $table ) { |
319 | 319 | //Quick&Dirty mod |
320 | 320 | $table.find('tr:eq(3) td:eq(0), tr:eq(4) td:eq(0)').remove(); |
321 | | - $table.find('tr:eq(2) td:eq(0)').attr('rowspan', '3'); |
| 321 | + $table.find('tr:eq(2) td:eq(0)').prop('rowspan', '3'); |
322 | 322 | $table.tablesorter(); |
323 | 323 | $table.find('.headerSort:eq(0)').click(); |
324 | 324 | } |
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js |
— | — | @@ -37,34 +37,34 @@ |
38 | 38 | // TODO abstract the double strictEquals |
39 | 39 | |
40 | 40 | // At first checkboxes are enabled |
41 | | - strictEqual( $( '#nsinvert' ).attr( 'disabled' ), undefined ); |
42 | | - strictEqual( $( '#nsassociated' ).attr( 'disabled' ), undefined ); |
| 41 | + strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false ); |
| 42 | + strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false ); |
43 | 43 | |
44 | 44 | // Initiate the recentchanges module |
45 | 45 | mw.special.recentchanges.init(); |
46 | 46 | |
47 | 47 | // By default |
48 | | - strictEqual( $( '#nsinvert' ).attr( 'disabled' ), 'disabled' ); |
49 | | - strictEqual( $( '#nsassociated' ).attr( 'disabled' ), 'disabled' ); |
| 48 | + strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true ); |
| 49 | + strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true ); |
50 | 50 | |
51 | 51 | // select second option... |
52 | 52 | var $options = $( '#namespace' ).find( 'option' ); |
53 | | - $options.eq(0).removeAttr( 'selected' ); |
54 | | - $options.eq(1).attr( 'selected', 'selected' ); |
| 53 | + $options.eq(0).removeProp( 'selected' ); |
| 54 | + $options.eq(1).prop( 'selected', true ); |
55 | 55 | $( '#namespace' ).change(); |
56 | 56 | |
57 | 57 | // ... and checkboxes should be enabled again |
58 | | - strictEqual( $( '#nsinvert' ).attr( 'disabled' ), undefined ); |
59 | | - strictEqual( $( '#nsassociated' ).attr( 'disabled' ), undefined ); |
| 58 | + strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false ); |
| 59 | + strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false ); |
60 | 60 | |
61 | 61 | // select first option ( 'all' namespace)... |
62 | | - $options.eq(1).removeAttr( 'selected' ); |
63 | | - $options.eq(0).attr( 'selected', 'selected' );; |
| 62 | + $options.eq(1).removeProp( 'selected' ); |
| 63 | + $options.eq(0).prop( 'selected', true ); |
64 | 64 | $( '#namespace' ).change(); |
65 | 65 | |
66 | 66 | // ... and checkboxes should now be disabled |
67 | | - strictEqual( $( '#nsinvert' ).attr( 'disabled' ), 'disabled' ); |
68 | | - strictEqual( $( '#nsassociated' ).attr( 'disabled' ), 'disabled' ); |
| 67 | + strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true ); |
| 68 | + strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true ); |
69 | 69 | |
70 | 70 | // DOM cleanup |
71 | 71 | $env.remove(); |
Index: trunk/phase3/resources/jquery/jquery.byteLimit.js |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | |
33 | 33 | // Default limit to current attribute value |
34 | 34 | if ( limit === undefined ) { |
35 | | - limit = this.attr( 'maxLength' ); |
| 35 | + limit = this.prop( 'maxLength' ); |
36 | 36 | } |
37 | 37 | |
38 | 38 | // Update/set attribute value, but only if there is no callback set. |
— | — | @@ -40,10 +40,10 @@ |
41 | 41 | // Usually this isn't a problem since browsers ignore maxLength when setting |
42 | 42 | // the value property through JavaScript, but Safari 4 violates that rule, so |
43 | 43 | // we have to remove or not set the property if we have a callback. |
44 | | - if ( fn === undefined ) { |
45 | | - this.attr( 'maxLength', limit ); |
| 44 | + if ( fn == undefined ) { |
| 45 | + this.prop( 'maxLength', limit ); |
46 | 46 | } else { |
47 | | - this.removeAttr( 'maxLength' ); |
| 47 | + this.removeProp( 'maxLength' ); |
48 | 48 | } |
49 | 49 | |
50 | 50 | // Nothing passed and/or empty attribute, return without binding an event. |
Index: trunk/phase3/resources/jquery/jquery.checkboxShiftClick.js |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | $box.slice( |
20 | 20 | Math.min( $box.index( prevCheckbox ), $box.index( e.target ) ), |
21 | 21 | Math.max( $box.index( prevCheckbox ), $box.index( e.target ) ) + 1 |
22 | | - ).attr( {checked: e.target.checked ? 'checked' : ''} ); |
| 22 | + ).prop( {checked: e.target.checked ? true : false} ); |
23 | 23 | } |
24 | 24 | // Either way, update the prevCheckbox variable to the one clicked now |
25 | 25 | prevCheckbox = e.target; |
Index: trunk/phase3/resources/jquery/jquery.tabIndex.js |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | $.fn.firstTabIndex = function() { |
12 | 12 | var minTabIndex = null; |
13 | 13 | $(this).find( '[tabindex]' ).each( function() { |
14 | | - var tabIndex = parseInt( $(this).attr( 'tabindex' ), 10 ); |
| 14 | + var tabIndex = parseInt( $(this).prop( 'tabindex' ), 10 ); |
15 | 15 | // In IE6/IE7 the above jQuery selector returns all elements, |
16 | 16 | // becuase it has a default value for tabIndex in IE6/IE7 of 0 |
17 | 17 | // (rather than null/undefined). Therefore check "> 0" as well. |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $.fn.lastTabIndex = function() { |
37 | 37 | var maxTabIndex = null; |
38 | 38 | $(this).find( '[tabindex]' ).each( function() { |
39 | | - var tabIndex = parseInt( $(this).attr( 'tabindex' ), 10 ); |
| 39 | + var tabIndex = parseInt( $(this).prop( 'tabindex' ), 10 ); |
40 | 40 | if ( tabIndex > 0 && !isNaN( tabIndex ) ) { |
41 | 41 | // Initial value |
42 | 42 | if ( maxTabIndex === null ) { |
Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js |
— | — | @@ -75,9 +75,9 @@ |
76 | 76 | // Bug 12395 - update the watch checkbox on edit pages when the |
77 | 77 | // page is watched or unwatched via the tab. |
78 | 78 | if ( watchResponse.watched !== undefined ) { |
79 | | - $( '#wpWatchthis' ).attr( 'checked', 'checked' ); |
| 79 | + $( '#wpWatchthis' ).prop( 'checked', 'checked' ); |
80 | 80 | } else { |
81 | | - $( '#wpWatchthis' ).removeAttr( 'checked' ); |
| 81 | + $( '#wpWatchthis' ).removeProp( 'checked' ); |
82 | 82 | } |
83 | 83 | return true; |
84 | 84 | }; |
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js |
— | — | @@ -252,9 +252,9 @@ |
253 | 253 | $( '.mw-upload-source-error' ).remove(); |
254 | 254 | if ( this.checked ) { |
255 | 255 | // Disable all inputs |
256 | | - $( 'input[name!="wpSourceType"]', rows ).attr( 'disabled', true ); |
| 256 | + $( 'input[name!="wpSourceType"]', rows ).prop( 'disabled', 'disabled' ); |
257 | 257 | // Re-enable the current one |
258 | | - $( 'input', currentRow ).attr( 'disabled', false ); |
| 258 | + $( 'input', currentRow ).prop( 'disabled', false ); |
259 | 259 | } |
260 | 260 | }; |
261 | 261 | }() ); |
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.recentchanges.js |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | |
22 | 22 | // Iterates over checkboxes and propagate the selected option |
23 | 23 | $.each( checkboxes, function( i, id ) { |
24 | | - $( '#' + id ).attr( 'disabled', isAllNS ); |
| 24 | + $( '#' + id ).prop( 'disabled', isAllNS ); |
25 | 25 | }); |
26 | 26 | }, |
27 | 27 | |
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js |
— | — | @@ -454,7 +454,7 @@ |
455 | 455 | } |
456 | 456 | |
457 | 457 | if ( className ) { |
458 | | - $messageDiv.attr( 'class', 'mw-js-message-' + className ); |
| 458 | + $messageDiv.prop( 'class', 'mw-js-message-' + className ); |
459 | 459 | } |
460 | 460 | |
461 | 461 | if ( typeof message === 'object' ) { |