MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针。
如果在编辑的过程中遇到了什么问题,可以去讨论板提问。
为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证。
MCBBS Wiki GitHub群组已上线!
您可以在回声洞中发表吐槽!
服务器状态监控。点击进入
本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>
Gadget:displaytitle.js:修订间差异
跳到导航
跳到搜索
(创建页面,内容为“const $h1 = $( '.mw-page-title-main' ); const title = $h1.text(); const origTitle = $( '.origTitle' ).text(); $h1.css( 'cursor', 'pointer' ); $h1.attr( 'data-title-change', '' ); $h1.on( 'click', () => { if ( $h1.attr( 'data-title-change' ) === undefined ) { $h1.text( title ); $h1.attr( 'data-title-change', '' ); } else { $h1.text( origTitle ); $h1.removeAttr( 'data-title-change' ); } } );”) |
(// Edit via Wikiplus) |
||
| (未显示同一用户的6个中间版本) | |||
| 第1行: | 第1行: | ||
const $h1 = $( ' | $(function (){const $h1 = $( '#firstHeading' ); | ||
const title = $h1.text(); | const title = $h1.text(); | ||
const origTitle = $( '.origTitle' ).text(); | const $origTitle = $( '.origTitle' ); | ||
$h1.css( 'cursor', 'pointer' ); | if ( $origTitle.length > 0 ) { | ||
$h1.attr( 'data-title-change', '' ); | const origTitleText = $origTitle.text(); | ||
$h1.on( 'click', () | $h1.css( 'cursor', 'pointer' ); | ||
$h1.attr( 'data-title-change', '0' ); | |||
$h1.attr('title', '原页面名: ' + origTitleText) | |||
$h1.on( 'click', function () { | |||
if ( $h1.attr( 'data-title-change' ) === '1' ) { | |||
$h1.text( title ); | |||
$h1.attr( 'data-title-change', '0' ); | |||
} | $h1.attr('title', '原页面名: ' + origTitleText) | ||
} ); | } else { | ||
$h1.text( origTitleText ); | |||
$h1.attr( 'data-title-change', '1' ); | |||
$h1.removeAttr('title') | |||
} | |||
} ); | |||
}}); | |||
2023年5月14日 (日) 10:35的最新版本
$(function (){const $h1 = $( '#firstHeading' );
const title = $h1.text();
const $origTitle = $( '.origTitle' );
if ( $origTitle.length > 0 ) {
const origTitleText = $origTitle.text();
$h1.css( 'cursor', 'pointer' );
$h1.attr( 'data-title-change', '0' );
$h1.attr('title', '原页面名: ' + origTitleText)
$h1.on( 'click', function () {
if ( $h1.attr( 'data-title-change' ) === '1' ) {
$h1.text( title );
$h1.attr( 'data-title-change', '0' );
$h1.attr('title', '原页面名: ' + origTitleText)
} else {
$h1.text( origTitleText );
$h1.attr( 'data-title-change', '1' );
$h1.removeAttr('title')
}
} );
}});