LLWiki正在建设中,欢迎加入我们

MediaWiki:Gadget-Vector.js

来自LLWiki
跳转到导航 跳转到搜索

注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件
const $user = $('#pt-userpage').addClass( 'vectorMenu' ).children( 'a' ),
	$menu = $('<ul>', {class: 'menu', html: $('<li>', {html: $user.clone().removeAttr( 'accesskey' )})}),
	$item = $('<input>', {type: 'checkbox', class: 'vectorMenuCheckbox', 'aria-labelledby': 'pt-userpage'}),
	$panel = $('#mw-panel').addClass( 'menu' ),
	$toggle = $('<div>', {
	class: 'vectorMenu', id: 'mw-side', html: [
		$item.clone().attr('aria-labelledby', 'mw-side'),
		$('<h3>', {html: $('<span>', {html: $('<i>', {class: 'fa fa-bars'})})})
	]
}).insertAfter( '#mw-head' ),
	responsive = function() {
	if (matchMedia( '(max-width:720px)' ).matches) {
		$('#pt-notifications-notice').nextAll( ':not(#utcdate)' ).appendTo( $menu );
		$user.after([ $item, $menu ]);
		$panel.appendTo( $toggle );
	} else {
		$menu.children( ':not(:first-child)' ).insertAfter( '#pt-notifications-notice' );
		$item.add( $menu ).detach();
		$panel.insertAfter( '#mw-head' );
	}
};
responsive();
$(window).resize( responsive );