Widget:TalkToc:修订间差异
跳到导航
跳到搜索
imported>=海豚= ([InPageEdit] 没有编辑摘要 (编辑自Special:Diff/43088)) |
标签:回退 |
||
(未显示4个用户的51个中间版本) | |||
第1行: | 第1行: | ||
<noinclude>Only for | <noinclude>Only for Talk</noinclude><includeonly><!--{if !isset($wgTalkToc) || !$wgTalkToc}--><!--{assign var="wgTalkToc" value=true scope="global"}--><script> | ||
window. | window.addEventListener('jquery-ready', function() { | ||
if (location.hostname.includes("m.hmoegirl.info")) return; | |||
if (location.hostname.includes("m.hmoegirl. | |||
mw.loader.using(["oojs-ui"]).then(function() { | mw.loader.using(["oojs-ui"]).then(function() { | ||
if (!mw.config.get('talkTocLoaded', false)) { | if (!mw.config.get('talkTocLoaded', false)) { | ||
第136行: | 第135行: | ||
var self = $('#talkTocBox table'), | var self = $('#talkTocBox table'), | ||
a = $('<' + 'a/>').text(''); | a = $('<' + 'a/>').text(''); | ||
self.append('<' + 'caption/>').find('caption').append | self.append('<' + 'caption/>').find('caption').append('<br/>').append('').append(a).append('') | ||
.end().append('<' + 'tbody/>'); | .end().append('<' + 'tbody/>'); | ||
containers.not('.savedDiscussion').each(function(i) { | containers.not('.savedDiscussion').each(function(i) { | ||
第254行: | 第253行: | ||
} else { | } else { | ||
$('#tocBox').show(); | $('#tocBox').show(); | ||
}); | $('.cbutton').text(''); | ||
}); | $(toclist.filter(function(l) { | ||
return l !== "tocBox"; | |||
}).map(function(l) { | |||
return 'a[href="#' + l + '"'; | |||
}).join(', ')).attr("href", "#tocBox"); | |||
} | } | ||
$tocBox.css({ | |||
position: 'relative', | |||
'z-index': 10 | |||
}); | |||
$(window).on('hashchange', function(e) { | |||
try { | |||
var hash = location.hash.substring(1); | |||
var target = $('[id="' + decodeURIComponent(hash).replace(/"/g, '\\\"') + '"]'); | |||
if (target[0]) { | |||
var scrollTop = target.offset().top; | |||
if (target.closest('.discussionHead').length === 0) { | |||
var parent = target.closest('h1, h2, h3, h4, h5, h6'); | |||
if (parent.length > 0) { | |||
scrollTop -= parent.outerHeight(true) - parent.height(); | |||
var h = parent.prevAll('h1, h2, h3, h4, h5, h6').filter(function() { | |||
return $(this).css('position') === 'sticky'; | |||
}); | |||
if (h.length > 0) scrollTop -= h.outerHeight(); | |||
} | |||
} else scrollTop = target.closest('.discussionContainer').offset().top; | |||
setTimeout(function() { | |||
$('html,body').animate({ | |||
scrollTop: scrollTop | |||
}, 0); | |||
}, 1); | |||
return false; | |||
} | |||
} catch (e) { | |||
return; | |||
} | |||
}).trigger('hashchange'); | |||
const g = ["sysop", "patroller"]; | |||
} | } | ||
} | } | ||
第263行: | 第298行: | ||
</script><style> | </script><style> | ||
/* <pre> */ | /* <pre> */ | ||
@media screen and (min-width: 600px) { | |||
body { | |||
opacity: 0.95; | |||
background-image:url(https://www.hmoegirl.info/images/a/af/%E8%AE%A8%E8%AE%BA%E7%89%88%E8%AF%8D%E4%BA%91.jpg); | |||
background-repeat:no-repeat; | |||
} | |||
} | |||
#ca-nstab-project { | |||
display: none; | |||
} | |||
.widgetTalkTocEnable #tocBox { | .widgetTalkTocEnable #tocBox { | ||
max-width: 37%; | max-width: 37%; | ||
第271行: | 第316行: | ||
display: table; | display: table; | ||
} | } | ||
.widgetTalkTocEnable div.toc#toc { | .widgetTalkTocEnable div.toc#toc:not(.toc-custom) { | ||
min-width: 300px; | min-width: 300px; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
第321行: | 第366行: | ||
display: inline-block; | display: inline-block; | ||
} | } | ||
#toc:not(.toc-custom), | |||
#tocBox, | #tocBox, | ||
#talkTocBox { | #talkTocBox { | ||
display: none; | display: none; | ||
} | } | ||
.widgetTalkTocDisable #toc { | .widgetTalkTocDisable #toc:not(.toc-custom) { | ||
display: table; | display: table; | ||
} | } | ||
第367行: | 第396行: | ||
.widgetTalkTocEnable .cbutton { | .widgetTalkTocEnable .cbutton { | ||
cursor: pointer; | cursor: pointer; | ||
} | |||
#ca-edit, #ca-editTopSection .mw-editsection { | |||
display: none !important; | |||
} | } | ||
.signInfo { | .signInfo { | ||
第391行: | 第423行: | ||
#right-navigation.no-need-to-edit-whole-page ul>li#Wikiplus-Edit-TopBtn, | #right-navigation.no-need-to-edit-whole-page ul>li#Wikiplus-Edit-TopBtn, | ||
#right-navigation.no-need-to-edit-whole-page ul>li#ca-edit, | #right-navigation.no-need-to-edit-whole-page ul>li#ca-edit, | ||
#right-navigation.no-need-to-edit-whole-page ul>li#ca-editTopSection { | #right-navigation.no-need-to-edit-whole-page ul>li#ca-editTopSection{ | ||
display: none; | display: none; | ||
} | } |
2023年8月18日 (五) 10:14的最新版本
Only for Talk