Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.history.js |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | $lis.removeClass( 'selected' ); |
15 | 15 | $lis.each( function() { |
16 | 16 | var $this = $(this); |
17 | | - var $inputs = $this.find( 'input[type=radio]' ); |
| 17 | + var $inputs = $this.find( 'input[type="radio"]' ); |
18 | 18 | if ( $inputs.length !== 2 ) { |
19 | 19 | return true; |
20 | 20 | } |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | }); |
49 | 49 | return true; |
50 | 50 | }; |
51 | | - |
| 51 | + |
52 | 52 | var fixCompare = function () { |
53 | 53 | var $diffList = $( '#pagehistory' ), |
54 | 54 | $histForm = $( '#mw-history-compare' ), |
— | — | @@ -59,21 +59,22 @@ |
60 | 60 | } |
61 | 61 | var copyAttrs = ['title', 'accesskey']; |
62 | 62 | $buttons.each(function() { |
| 63 | + console.log(this); |
63 | 64 | var $button = $(this), |
64 | 65 | $compareLink= $( '<a></a>', { |
65 | | - 'class': 'compare-link', |
66 | | - 'text': $button.val() |
67 | | - }).button(); |
68 | | - $.each(copyAttrs, function(i, name) { |
69 | | - var val = $button.attr(name); |
| 66 | + 'class': 'compare-link', |
| 67 | + 'text': $button.val() |
| 68 | + }).button(); |
| 69 | + $.each( copyAttrs, function( i, name ) { |
| 70 | + var val = $button.attr( name ); |
70 | 71 | if (val) { |
71 | | - $compareLink.attr(name, val); |
| 72 | + $compareLink.attr( name, val ); |
72 | 73 | } |
73 | 74 | }); |
74 | | - $button.replaceWith($compareLink); |
| 75 | + $button.replaceWith( $compareLink ); |
75 | 76 | }); |
76 | 77 | var updateCompare = function() { |
77 | | - var $radio = $histForm.find( 'input[type=radio]:checked' ); |
| 78 | + var $radio = $histForm.find( 'input[type="radio"]:checked' ); |
78 | 79 | var genLink = mw.config.get( 'wgScript' ) |
79 | 80 | + '?title=' + mw.util.wikiUrlencode( mw.config.get( 'wgPageName' ) ) |
80 | 81 | + '&diff=' + $radio.eq(0).val() |
Index: trunk/phase3/resources/test/unit/mediawiki.util/mediawiki.util.js |
— | — | @@ -109,8 +109,6 @@ |
110 | 110 | |
111 | 111 | }); |
112 | 112 | |
113 | | - |
114 | | - |
115 | 113 | test( 'isIPv6Address', function(){ |
116 | 114 | |
117 | 115 | // Based on IPTest.php > IPv6 |
— | — | @@ -123,7 +121,6 @@ |
124 | 122 | |
125 | 123 | }); |
126 | 124 | |
127 | | - |
128 | 125 | test( 'isIPv4Address', function(){ |
129 | 126 | |
130 | 127 | // Based on IPTest.php > IPv4 |
Index: trunk/phase3/resources/test/unit/mediawiki/mediawiki.js |
— | — | @@ -128,16 +128,18 @@ |
129 | 129 | }); |
130 | 130 | |
131 | 131 | test( 'mw.loader', function(){ |
| 132 | + expect(1); |
132 | 133 | |
133 | | - ok( mw.loader, 'loader defined' ); |
134 | | - ok( mw.loader.work, 'loader.work defined' ); |
135 | | - ok( mw.loader.register, 'loader.register defined' ); |
136 | | - ok( mw.loader.implement, 'loader.implement defined' ); |
137 | | - ok( mw.loader.using, 'loader.using defined' ); |
138 | | - ok( mw.loader.load, 'loader.load defined' ); |
139 | | - ok( mw.loader.go, 'loader.go defined' ); |
140 | | - ok( mw.loader.state, 'loader.state defined' ); |
141 | | - ok( mw.loader.version, 'loader.version defined' ); |
| 134 | + stop(); |
| 135 | + |
| 136 | + mw.loader.implement( 'is.awesome', [location.href.match(/[^#\?]*/)[0] + 'sample/awesome.js'], {}, {} ); |
| 137 | + mw.loader.using( 'is.awesome', function(){ |
| 138 | + start(); |
| 139 | + same( window.awesome, true, 'Implementing a module, is the callback timed properly ?'); |
| 140 | + }, function(){ |
| 141 | + start(); |
| 142 | + same( 'mw.loader.using error callback fired', true, 'Implementing a module, is the callback timed properly ?'); |
| 143 | + }); |
142 | 144 | |
143 | 145 | }); |
144 | 146 | |