$lis.removeClass( 'selected' );
$lis.each( function() {
var $this = $(this);
- var $inputs = $this.find( 'input[type=radio]' );
+ var $inputs = $this.find( 'input[type="radio"]' );
if ( $inputs.length !== 2 ) {
return true;
}
});
return true;
};
-
+
var fixCompare = function () {
var $diffList = $( '#pagehistory' ),
$histForm = $( '#mw-history-compare' ),
}
var copyAttrs = ['title', 'accesskey'];
$buttons.each(function() {
+ console.log(this);
var $button = $(this),
$compareLink= $( '<a></a>', {
- 'class': 'compare-link',
- 'text': $button.val()
- }).button();
- $.each(copyAttrs, function(i, name) {
- var val = $button.attr(name);
+ 'class': 'compare-link',
+ 'text': $button.val()
+ }).button();
+ $.each( copyAttrs, function( i, name ) {
+ var val = $button.attr( name );
if (val) {
- $compareLink.attr(name, val);
+ $compareLink.attr( name, val );
}
});
- $button.replaceWith($compareLink);
+ $button.replaceWith( $compareLink );
});
var updateCompare = function() {
- var $radio = $histForm.find( 'input[type=radio]:checked' );
+ var $radio = $histForm.find( 'input[type="radio"]:checked' );
var genLink = mw.config.get( 'wgScript' )
+ '?title=' + mw.util.wikiUrlencode( mw.config.get( 'wgPageName' ) )
+ '&diff=' + $radio.eq(0).val()
});
test( 'mw.loader', function(){
+ expect(1);
- ok( mw.loader, 'loader defined' );
- ok( mw.loader.work, 'loader.work defined' );
- ok( mw.loader.register, 'loader.register defined' );
- ok( mw.loader.implement, 'loader.implement defined' );
- ok( mw.loader.using, 'loader.using defined' );
- ok( mw.loader.load, 'loader.load defined' );
- ok( mw.loader.go, 'loader.go defined' );
- ok( mw.loader.state, 'loader.state defined' );
- ok( mw.loader.version, 'loader.version defined' );
+ stop();
+
+ mw.loader.implement( 'is.awesome', [location.href.match(/[^#\?]*/)[0] + 'sample/awesome.js'], {}, {} );
+ mw.loader.using( 'is.awesome', function(){
+ start();
+ same( window.awesome, true, 'Implementing a module, is the callback timed properly ?');
+ }, function(){
+ start();
+ same( 'mw.loader.using error callback fired', true, 'Implementing a module, is the callback timed properly ?');
+ });
});