MediaWiki:Common.js:修订间差异

来自圣洛神教
跳转到导航 跳转到搜索
创建页面,内容为“$( function () { $( '.touch‑heimu' ).on( 'click touchstart', function ( e ) { if ( ! window.matchMedia( '(hover: none)' ).matches ) return; e.preventDefault(); $( this ).toggleClass( 'active' ); }); });”
 
无编辑摘要
标签已被回退
第5行: 第5行:
$( this ).toggleClass( 'active' );
$( this ).toggleClass( 'active' );
});
});
});
mw.hook('wikipage.content').add(function ($content) {
    $content.find('.audio‑click').on('click', function (e) {
        e.preventDefault();
        const audioUrl = $(this).data('audio');
        const audio = new Audio(audioUrl);
        audio.play();
    });
});
});

2026年9月3日 (四) 11:03的版本

$( function () {
	$( '.touch‑heimu' ).on( 'click touchstart', function ( e ) {
		if ( ! window.matchMedia( '(hover: none)' ).matches ) return;
		e.preventDefault();
		$( this ).toggleClass( 'active' );
	});
});
mw.hook('wikipage.content').add(function ($content) {
    $content.find('.audio‑click').on('click', function (e) {
        e.preventDefault();
        const audioUrl = $(this).data('audio');
        const audio = new Audio(audioUrl);
        audio.play();
    });
});