“User:850710247liu/common.js”的版本间的差异

来自萌娘共享
跳转至: 导航搜索
(测试新皮肤-850710247liu)
1个标签插入非https地址
 
(未显示同一用户的6个中间版本)
第1行: 第1行:
/*  放置于这里的CSS将应用于所有皮肤 */
+
/**
/*
+
  * JavaScript-based gallery preview using api.php
  * vector界面、主标题字体定制,参考Github添加了Emoji支持
+
* Version 0.2
  *  更改后要同步到 [[MediaWiki:Gadget-GothicMoe.css]]
+
  * (c) 2007 by Magnus Manske
*/
+
  * Released under GPL
/* 全站字型*/
+
  * Maintainers: [[User:Magnus Manske]], [[User:Krinkle]]
body {
+
**/
    font-size: 108%;
+
 
    -moz-hyphens: auto;
+
/*global mediaWiki:false, jQuery:false*/
    -webkit-hyphens: auto;
+
/*jshint curly:false, laxbreak:true*/
    hyphens: auto;
+
(function( $, mw ) {
 +
'use strict';
 +
 
 +
 
 +
// Install onload handler, which will display the link to start the script
 +
if ( mw.config.get('wgNamespaceNumber') !== 6 || mw.config.get('wgAction') !== 'view'  || mw.util.getParamValue('diff')) {
 +
return;
 
}
 
}
.mw-body-content {
+
 
    line-height: 1.85;
+
var gp_div, gp_head, gp_status,
 +
gp_xmlobjects,
 +
gp_cat_object,
 +
gp_cat_object2,
 +
gp_image_xml,
 +
gp_counter,
 +
gp_left,
 +
gp_found,
 +
gp_found2,
 +
gp_size = 75,
 +
gp_maxw;
 +
 
 +
// Avoid license categories etc.
 +
var gp_avoid_cats = [
 +
'CC-',
 +
'PD-',
 +
'PD ',
 +
'GPL',
 +
'Self',
 +
'GFDL',
 +
'Copyrighted free use',
 +
'Media with locations',
 +
'Deletion',
 +
'Incomplete deletion',
 +
'Flickr review needed',
 +
'Flickr images needing human review',
 +
'User-created GFDL images',
 +
'Images without source',
 +
'Images that should use vector graphics',
 +
'Uploaded with UploadWizard',
 +
'Author died more than',
 +
'License migration',
 +
'Images with annotations'
 +
];
 +
 
 +
 
 +
// Handler to toggle the listing of hits for a single language/project
 +
window.toggle_id = function ( id ) {
 +
var e = document.getElementById( id );
 +
if ( e.style.display === 'none' ) e.style.display = 'block';
 +
else e.style.display = 'none';
 +
};
 +
 
 +
function gp_check_done() {
 +
var i;
 +
for ( i = 0; i < gp_xmlobjects.length; i++ ) {
 +
if ( gp_xmlobjects[i].running ) return;
 +
}
 +
for ( i = 0; i < gp_image_xml.length; i++ ) {
 +
if ( gp_image_xml[i].running ) return;
 +
}
 +
gp_head.innerHTML = '<a href="#" style="float:right;" onClick="toggle_id(\'gallerypreview\');">Show/hide preview</a>Done.';
 
}
 
}
.oo-ui-window-content {
+
 
    font-size: 89.3%;
+
 
}
+
function get_thumbnail_url( url, width ) {
.mw-label {
+
url = url.replace( '/commons/', '/commons/thumb/' );
    white-space: nowrap;
+
var iname = url.split( '/' ).pop();
}
+
url += '/' + width + 'px-' + iname;
body .ui-dialog .ui-widget-header {
+
gp_check_done();
    background: #f1f1f1 !important;
+
return url;
}
 
body .ui-button {
 
    box-shadow: 0 0 0 0 !important;
 
}
 
::selection {
 
    text-shadow: none;
 
}
 
::-webkit-scrollbar {
 
    border: 0;
 
    width: 10px;
 
    height: 10px;
 
}
 
::-webkit-scrollbar-button {
 
    width: 0;
 
    height: 0;
 
}
 
::-webkit-scrollbar-thumb {
 
    border: 0;
 
    min-height: 34px;
 
    padding-top: 100;
 
    background-clip: padding-box;
 
    background-color: rgba(0,0,0,.15);
 
}
 
::-webkit-scrollbar-track {
 
    border: 0;
 
    background-clip: padding-box;
 
    background-color: rgba(206,205,197,.1);
 
}
 
::selection {
 
    background: rgba(0,0,0,.1);
 
    text-shadow: none;
 
}
 
.ve-init-mw-desktopArticleTarget-toolbar-open > .oo-ui-toolbar-bar {
 
    top: -1px;
 
    border-top: 1px solid #c8ccd1;
 
}
 
/* 链接显示效果 */
 
a:hover {
 
  text-decoration: none;
 
  color: #2a4b8d!important;
 
}
 
a, a:visited {
 
    text-decoration: none;
 
    color: #447ff5;
 
}
 
.mw-body a.external:visited {
 
    color: #447ff5;
 
}
 
/* 公告栏滚动Rollnews */
 
#scrollDiv {
 
    width: 100%;
 
    height: 25px;
 
    line-height: 25px;
 
    overflow: hidden
 
}
 
#scrollDiv ul {
 
    margin-left: 0!important;
 
}
 
#scrollDiv li {
 
    background-color: rgb(245,245,245,0.3);
 
    height: 25px;
 
    padding-left: 0px;
 
    list-style: none;
 
}
 
#localNotice {
 
    background-color: rgb(245,245,245,0.3);
 
}
 
/* 侧边栏、顶部栏、页脚 */
 
#p-personal {
 
    font-size: 17.5px;
 
    right: 1em;
 
 
}
 
}
div.vectorTabs {
 
    font-size: 16px;
 
    padding-top: 2px;
 
}
 
.vectorTabs #ca-unwatch.icon a, .vectorTabs #ca-watch.icon a, .vectorTabs #ca-wikilove.icon a {
 
    padding-top: 3.4em;
 
}
 
    #content {
 
        border: 0px !important;
 
        margin-left: 214px !important;
 
    }
 
  
    .portal {
 
        background: transparent !important;
 
    }
 
  
    #mw-panel {
+
function gp_image_callback() {
        width: 200px !important;
+
for ( var i = 0; i < gp_image_xml.length; i++ ) {
        border-right: 1px solid #bbb;
+
if (gp_image_xml[i].readyState === 4 && gp_image_xml[i].running === true ) {
        background: rgb(254,254,254,0.96) !important;
+
gp_image_xml[i].running = false;
        padding-left: 13px !important;
+
var xml = gp_image_xml[i].responseXML;
    }
+
var image = xml ? xml.getElementsByTagName( 'ii' )[0] : false;
   
+
        // Deleted/ hidden revision, ...
    #p-logo {
+
        if (!image) continue;
        left: 0px;
+
var width = image.getAttribute( 'width' );
        padding-left: 10px;
+
var height = image.getAttribute( 'height' );
    }
 
  
    #p-logo a {
+
var nw = gp_size;
        padding-left: 40px;
+
var nh = nw / width * height;
        left: 0px;
+
var off = ' style="position:relative; overflow:hidden;';
        border-right: 1px solid #aaa;
+
if ( nh < gp_size ) {
    }
+
nh = gp_size;
    #p-logo a:hover {
+
nw = nh / height * width;
        opacity: 1.0;
+
var xoff = -( nw - gp_size )/2;
    }
+
off += 'left:' + Math.floor( xoff ) + 'px;';
 +
}
 +
if ( nh > gp_size ) {
 +
var yoff = -( nh - gp_size )/2;
 +
off += 'top:' + Math.floor( yoff ) + 'px;';
 +
}
 +
off += '" ';
  
    #mw-head {
 
        background-color: rgb(254,254,254,0.95);
 
        opacity: 1.0;
 
        box-shadow: 0px 1px 2px #aaa;
 
        -webkit-transition-property: opacity !important;
 
        -moz-transition-property: opacity !important;
 
        -o-transition-property: opacity !important;
 
        -ms-transition-property: opacity !important;
 
        transition-property: opacity !important;
 
        -webkit-transition-duration: 0.5s !important;
 
        -moz-transition-duration: 0.5s !important;
 
        -o-transition-duration: 0.5s !important;
 
        -ms-transition-duration: 0.5s !important;
 
        transition-duration: 0.25s !important;
 
    }
 
  
    #mw-head:hover {
+
var url = get_thumbnail_url( image.getAttribute( 'url' ), Math.floor(nw) );
        opacity: 1.0 !important;
 
    }
 
  
    .uls-settings-trigger {
+
var target = document.getElementById(gp_image_xml[i].myid);
        display: none !important;
+
if(target) {
    }
+
target.innerHTML = "<div style='overflow:hidden;width:75px;height:75px'><a href=\"" + mw.util.getUrl(gp_image_xml[i].image) + "\"><img border='0' " + off + "src=\"" + url + "\"/></a></div>";
 +
}
 +
gp_check_done();
 +
}
 +
}
 +
gp_check_done();
 +
}
  
    #left-navigation {
+
function gp_add_thumbnail( image ) {
        margin-left: 233px !important;
+
var myid = 'gpid_' + gp_counter;
    }
+
gp_counter += 1;
#mw-page-base {
+
var ret = "<td id='" + myid + "' style='overflow:hidden;width:75px;height:75px;font-size:75%;text-align:left;color:white";
    height: 104px;
+
if ( image === '' ) {
}
+
ret += ";background-color:#BBBBBB'>";
#left-navigation,
+
ret += 'No other files here';
#right-navigation {
+
} else {
    margin-top: 60px;
+
ret += "'>";
}
+
}
#mw-head div.vectorMenu h4 {
+
ret += '</td>';
    height: 1.9em;
 
    margin-bottom: 0;
 
    padding-top: 1.25em;
 
    padding-bottom: 0;
 
    padding-right: 0.5em;
 
}
 
#mw-panel div.portal {
 
    padding-bottom: 0.7em;
 
    padding-top: 0.4em;
 
}
 
#mw-panel #p-logo .mw-wiki-logo {
 
    width: 175px;
 
}
 
#mw-panel {
 
    font-size: 18.5px;
 
    /* mw-panel的宽度是10em,改了font-size以后也需要修改一下 */
 
    width: 11.6rem;
 
}
 
    ul,li {
 
        background: transparent !important;
 
        border: 0px !important;
 
    }
 
  
    li span {
+
if ( image === '' ) return ret;
        border: 0px !important;
 
    }
 
  
  #mw-panel,#mw-head {
+
var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
        line-height: 1.7 !important;
+
format: 'xml',
        font-weight: 300 !important;
+
action: 'query',
    }
+
prop: 'imageinfo',
 +
iiprop: 'url|size',
 +
titles: image
 +
});
 +
var i = gp_image_xml.length;
 +
gp_image_xml.push( new XMLHttpRequest() );
 +
gp_image_xml[i].image = image;
 +
gp_image_xml[i].myid = myid;
 +
gp_image_xml[i].running = true;
 +
gp_image_xml[i].onreadystatechange = gp_image_callback;
 +
gp_image_xml[i].open( 'GET', url, true );
 +
gp_image_xml[i].send( null );
  
#mw-panel .portal .body li {
+
gp_check_done();
    line-height: 1.6em;
+
return ret;
}
 
    .mw-wiki-logo{
 
        padding-left: 5px !important;
 
        padding-top: 10px !important;
 
        border: none !important;
 
    }
 
.clear-div {
 
    clear: both;
 
}
 
.uls-trigger{
 
    display: none;
 
}
 
div.vectorMenu div.menu {
 
    top: 2.6em;
 
    width: 100%;
 
    background-color: rgba(251,251,251,0.9);
 
    border: 1px solid #a7d7f9;
 
    border-top: transparent;
 
}
 
#mw-panel .portal .body li a:visited {
 
  color: #0648AF;
 
}
 
#catlinks {
 
background-color: rgba(251,251,251,0.3);
 
}
 
.oo-ui-popupWidget-anchored-top {
 
    z-index: 10000;
 
}
 
#mp-banner {
 
    margin: -1.7em;
 
    margin-top: -4.1em;
 
    background-image: url(https://www.hmoegirl.com/images/0/09/80468767.jpg);
 
}
 
#footer {
 
    margin-left: 12.4em;
 
    padding: 1.25em;
 
}
 
/* 谷歌翻译框调整*/
 
.goog-te-gadget {
 
    margin-left: inherit!important;
 
    max-width: 95%!important;
 
    background-color: transparent;
 
}
 
/* 标题字型调整*/
 
#firstHeading {
 
    font-family: sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
 
    font-weight: 500;
 
    padding-bottom: 6px;
 
    font-variant: small-caps;
 
    font-size: 170%;
 
}
 
h2,
 
h3,
 
h4,
 
h5,
 
h6 {
 
        font-family: "roboto",sans-serif !important;
 
color: #404040 !important;
 
line-height: 1.8 !important;
 
border-bottom-color: rgba(0, 0, 0, .1) !important;
 
}
 
.mw-body-content h2 {
 
    font-weight: 540;
 
}
 
#siteSub {
 
    display: inline;
 
    font-size: 100%;
 
    font-weight: 400; /* 400 = normal */
 
    font-style: normal;
 
    text-align: right;
 
    padding-top: 11px;
 
    padding: 0.1em;
 
}
 
/* MW自带10em宽度,应该是留给测试链接的吧萌百没有就去掉 */
 
#p-personal ul {
 
    padding-left: 0;
 
}
 
/* 搜索框 */
 
#simpleSearch {
 
  max-width: 220px;
 
  background-image: none;
 
  border-radius: 20px;
 
  padding: 0px 10px;
 
  opacity: 0.625;
 
  display: flex;
 
  align-items: center;
 
  transition: width 0.4s;
 
}
 
 
#simpleSearch:hover {
 
  border-color: var(--theme-color) !important;
 
}
 
 
#simpleSearch:focus-within {
 
  width: 240px;
 
}
 
 
#searchInput::-webkit-input-placeholder {
 
  color: var(--theme-color) !important;
 
}
 
 
#searchInput::input-placeholder {
 
  color: var(--theme-color) !important;
 
}
 
 
#simpleSearch #searchButton {
 
  right: 8px !important;
 
  -webkit-mask-size: contain;
 
  mask-size: contain;
 
  -webkit-mask-position: center;
 
  mask-position: center;
 
  -webkit-mask-repeat: no-repeat;
 
  mask-repeat: no-repeat;
 
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E %3Cpath d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z'%3E%3C/path%3E %3C/svg%3E");
 
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E %3Cpath d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z'%3E%3C/path%3E %3C/svg%3E");
 
  background-color: var(--theme-color) !important;
 
  background-image: none !important;
 
  background-color: var(--theme-color) !important;
 
  width: 20px !important;
 
  height: 20px !important;
 
  padding-block-start: 21px;
 
}
 
 
#simpleSearch:hover>#searchButton {
 
  animation: shake 0.4s 1 forwards;
 
 
}
 
}
  
#p-search {
+
function categorypreview_callback() {
    float: left;
+
var i, k;
    margin-right: 0.5em;
+
for ( i = 0; i < gp_xmlobjects.length; i++ ) {
    margin-left: 0.6em;
+
if ( gp_xmlobjects[i].readyState === 4 && gp_xmlobjects[i].running === true ) {
    margin-top: 0.1em;
+
 
}
+
gp_xmlobjects[i].running = false;
@keyframes shake {
 
 
  0%,
 
  50% {
 
    transform: rotate(5deg) scale(1.05);
 
  }
 
 
  25%,
 
  75% {
 
    transform: rotate(-5deg) scale(1.05);
 
  }
 
 
  100% {
 
    transform: rotate(0deg) scale(1.05);
 
  }
 
}
 
.oo-ui-actionFieldLayout-input {
 
    font-size: 95%;
 
}
 
.mw-search-results {
 
    max-width: 50em;
 
}
 
/* 隐藏编辑提示修改和上传文件协议 */
 
div.sysop-show, p.sysop-show {
 
    display: none;
 
}
 
.mw-htmlform-field-Licenses{
 
    display: none;
 
}
 
/* 链接显示效果 */
 
a:hover {
 
  text-decoration: none;
 
  color: #2a4b8d!important;
 
}
 
a, a:visited {
 
    text-decoration: none;
 
    color: #3366cc;
 
}
 
/* 被点过的外部链接不变色。采取和默认皮肤相同写法,以便override */
 
.mw-body a.external:visited {
 
    color: #3366cc;
 
}
 
/* 斜体字右边距加大看以防止文字挤在一起 */
 
#mw-content-text i {
 
    margin-right: 3px;
 
}
 
/* Extension:MultimediaViewer的半透明化修改  */
 
.mw-mmv-overlay {
 
    position: fixed;
 
    top: 0;
 
    left: 0;
 
    right: 0;
 
    bottom: 0;
 
    background-color: rgba(0,0,0,0.8);
 
    opacity: 0.73;
 
}
 
body.mediawiki.mw-mmv-lightbox-open #mw-page-base,
 
body.mediawiki.mw-mmv-lightbox-open #mw-head-base,
 
body.mediawiki.mw-mmv-lightbox-open #mw-navigation,
 
body.mediawiki.mw-mmv-lightbox-open #content,
 
body.mediawiki.mw-mmv-lightbox-open #footer,
 
body.mediawiki.mw-mmv-lightbox-open #globalWrapper {
 
    display: inherit;
 
}
 
body.mediawiki.mw-mmv-lightbox-open > *  {
 
    display: inherit;
 
}
 
body.mediawiki.mw-mmv-lightbox-open > script,
 
body.mediawiki.mw-mmv-lightbox-open > style {
 
    display: none;
 
}
 
body.mediawiki.mw-mmv-lightbox-open {
 
    overflow: hidden;
 
}
 
body .mw-mmv-wrapper {
 
    position: fixed;
 
}
 
/* mutilmediaViewer 信息栏修复 */
 
.mw-mmv-image-metadata-column.mw-mmv-image-metadata-desc-column {
 
    width: 30%;
 
}
 
.mw-mmv-image-metadata-column.mw-mmv-image-metadata-links-column {
 
    width: 70%;
 
    max-width: 70%;
 
}
 
ul.mw-mmv-image-links li {
 
    float: left;
 
    padding: .3em 1em;
 
}
 
div.mw-mmv-image-desc-div,
 
div.mw-mmv-image-links-div{
 
    display:block
 
}
 
div.metadata-panel-is-closed .mw-mmv-image-links li.mw-mmv-license-li {
 
    height:inherit;
 
    line-height:inherit;
 
}
 
.mw-mmv-warning-visible .mw-mmv-download-dialog .mw-mmv-dialog-down-arrow {
 
    background-color: #ffffff;
 
}
 
.mw-mmv-warning-visible .mw-mmv-dialog-warning,
 
.mw-mmv-warning-visible .mw-mmv-download-attribution {
 
    display: none !important;
 
}
 
/* 通用圆角框 */
 
.common-box {
 
    padding: .2em .4em;
 
    border: 0.7px solid #ddd;
 
    -moz-border-radius: 10px;
 
    -webkit-border-radius: 10px;
 
    -khtml-border-radius: 10px;
 
    -o-border-radius: 10px;
 
    border-radius: 10px;
 
    background: rgba(250,250,250,0.65)!important;
 
}
 
/* 数据表格 */
 
.mw-datatable.TablePager {
 
    line-height: 1.7;
 
    width: 100%;
 
    table-layout: fixed;
 
    word-wrap: break-word;
 
}
 
/* 隐藏首页标题、空行、分类、讨论、查看源代码tab */
 
.page-Mainpage h1.firstHeading,
 
.page-Mainpage #siteSub,
 
.page-Mainpage #contentSub,
 
.page-Mainpage #ca-viewsource,
 
.page-Mainpage #siteNotice,
 
.page-Mainpage #ca-talk,
 
.page-Mainpage #catlinks,
 
.page-Mainpage #footer #footer-info
 
{
 
    display: none;
 
}
 
/* 黑幕模板配合CSS */
 
/* 把这几行单独拎出来写,否则会被Firefox合并到“.heimu a”这条规则,然后又被上面的“点过外链不变色”规则override */
 
span.heimu a.external,
 
span.heimu a.external:visited,
 
span.heimu a.extiw,
 
span.heimu a.extiw:visited {
 
    color: #252525;
 
}
 
.heimu,
 
.heimu a,
 
a .heimu,
 
.heimu a.new {
 
    background-color: #252525;
 
    color: #252525;
 
    text-shadow: none;
 
}
 
body:not(.heimu_toggle_on) .heimu:hover,
 
body:not(.heimu_toggle_on) .heimu:active,
 
body:not(.heimu_toggle_on) .heimu.off {
 
    transition: color .13s linear;
 
    color: white;
 
}
 
body:not(.heimu_toggle_on) .heimu:hover a,
 
body:not(.heimu_toggle_on) a:hover .heimu,
 
body:not(.heimu_toggle_on) .heimu.off a,
 
body:not(.heimu_toggle_on) a:hover .heimu.off {
 
    transition: color .13s linear;
 
    color: lightblue;
 
}
 
body:not(.heimu_toggle_on) .heimu.off .new,
 
body:not(.heimu_toggle_on) .heimu.off .new:hover,
 
body:not(.heimu_toggle_on) .new:hover .heimu.off,
 
body:not(.heimu_toggle_on) .heimu.off .new,
 
body:not(.heimu_toggle_on) .heimu.off .new:hover,
 
body:not(.heimu_toggle_on) .new:hover .heimu.off {
 
    transition: color .13s linear;
 
    color: #BA0000;
 
}
 
/* 隐藏目录 */
 
#toc:not(.toc-custom) {
 
  display: none;
 
}
 
/* 图片页隐藏媒体查看器 */
 
.mw-mmv-filepage-buttons .mw-mmv-view-expanded, .mw-mmv-filepage-buttons .mw-mmv-view-config {
 
    display: none;
 
}
 
/* 导航条(完全没有apple风格的apple风面包屑orz) 来源:http://www.jankoatwarpspeed.com/examples/breadcrumb/ */
 
#breadcrumb {
 
    background-image: url(//img.moegirl.org/breadcrumb/bc_bg.png);
 
    color: red;
 
    border: solid 1px #cacaca;
 
    border-radius: 10px;
 
    overflow: hidden;
 
}
 
#breadcrumb span {
 
    float: left;
 
    padding-left: 10px;
 
}
 
#breadcrumb a {
 
    display: block;
 
    background: url(//img.moegirl.org/breadcrumb/bc_separator.png) no-repeat right;
 
    padding-right: 15px;
 
    color: #454545;
 
}
 
#breadcrumb a:hover {
 
    color: #35acc5;
 
}
 
/* info类模板 */
 
.infoBox {
 
    margin: 0 auto;
 
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12), 0 2px 1px -2px rgba(0,0,0,.2);
 
}
 
.infobox1 {
 
  margin:0 auto;
 
  border-radius: 5px;
 
  overflow: hidden;
 
}
 
.infobox2 {
 
  margin-top: 0.4em ;
 
  margin-left: 1em;
 
  padding: 0.2em;
 
  float: right;
 
  clear: right;
 
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
 
  border-radius: 4px;
 
  overflow: hidden;
 
  background: rgba(251,251,251,0.7);
 
}
 
.infobox3 {
 
  margin:0 auto;
 
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.10);
 
  border-radius: 15px;
 
  overflow: hidden;
 
}
 
.infoBoxTitle {
 
    margin: 3px auto;
 
    padding: 0;
 
    text-align: center;
 
    font-weight: 700;
 
}
 
.infoBoxIcon {
 
    display: table-cell;
 
    padding: 2px 0 2px .5em;
 
    vertical-align: middle;
 
}
 
.infoBoxText {
 
    display: table-cell;
 
    padding: .25em .5em .25em 1.3em;
 
    width: 100%;
 
    vertical-align: middle;
 
}
 
.infoBoxContent new{
 
  padding: 0.6em;
 
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
 
  border-radius: 5px;
 
  overflow: hidden;
 
  background: rgba(251,251,251,0.7);
 
}
 
.infoBoxContent {
 
    padding: 5px;
 
    border-left-width: 0;
 
    background: #fbfbfb;
 
}
 
.infoBoxBelow {
 
    margin: 0 auto;
 
    padding: 0;
 
    text-align: center;
 
}
 
.infoBoxYellow {
 
  padding: 0.5em;
 
  background: rgba(255,255,245);
 
}
 
.infoBoxRed {
 
  padding: 0.5em;
 
  background: rgba(258,240,245);
 
}
 
.infoBoxBlue {
 
  padding: 0.4em;
 
  background: rgba(240,248,255);
 
}
 
.infoBoxPurple {
 
  padding: 0.4em;
 
  background: rgba(248,248,255);
 
}
 
.infoBoxGreen {
 
  padding: 0.5em;
 
  background: rgba(245,255,250);
 
}
 
.infoBoxOrange {
 
  padding: 0.5em;
 
  background: rgba(250,240,230);
 
}
 
/*热门评论*/
 
.comment-container-top>div:not(.comment-thread) {
 
  background-color: rgba(244, 196, 48, 0.8) !important;
 
  color: white !important;
 
  font-weight: bolder !important;
 
}
 
.comment-thread.comment-popular {
 
  background-color: rgba(244, 196, 48, 0.15) !important;
 
}
 
/* wikitable MD化 */
 
table.wikitable {
 
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
 
  border-radius: 4px;
 
  overflow: hidden;
 
}
 
/* 回到顶部 */
 
.backToTop {
 
    display: none;
 
    width: 20px;
 
    padding: 5px 0;
 
    background-color: #000;
 
    color: #fff;
 
    font-size: 12px;
 
    text-align: center;
 
    position: fixed;
 
    _position: absolute;
 
    right: 0;
 
    bottom: 100px;
 
    _bottom: "auto";
 
    cursor: pointer;
 
    opacity: .6;
 
    filter: Alpha(opacity=60);
 
    z-index: 73;
 
}
 
.mw-mmv-lightbox-open .backToTop {
 
    display: none !important;
 
}
 
/* 隐藏编辑页面中的返回顶部按钮 */
 
.page-Mainpage .backToTop,
 
.action-edit .backToTop,
 
.action-submit .backToTop {
 
  display: none !important;
 
}
 
/* 信息模板的css */
 
.infotemplatebox {
 
    float: right;
 
    width: 250px;
 
    font-size: 100%;
 
    margin: 1em 0 1em 1em;
 
    background: #f9f9f9;
 
    border: 1px #999 solid;
 
    border-collapse: collapse;
 
    word-break: break-all;
 
    clear: right;
 
}
 
/* 编辑区样式 */
 
.my-buttons {
 
    padding: 0em .6em .3em .6em;
 
}
 
.my-buttons a {
 
    text-decoration: none;
 
    border: 1px #069 outset;
 
    padding: .1em;
 
}
 
.my-buttons a:hover,
 
.my-buttons a:active {
 
    border-style: inset;
 
}
 
#wpTextbox1.mw-editfont-monospace{
 
font-size: 93%;
 
height: 450px;
 
}
 
#msupload-container.start-loading{
 
display:none;
 
}
 
#msupload-dropzone {
 
    padding: 3px;
 
    height: 19px;
 
    font-size: small;
 
}
 
.client-js .editButtons .editHelp {
 
    display: inline-block!important;
 
}
 
.oo-ui-buttonElement-frameless.oo-ui-labelElement:first-child {
 
    margin-left: .1em;
 
}
 
.ve-ui-mwSaveDialog-summaryLabel {
 
    display: none;
 
}
 
.wikiEditor-ui-toolbar {
 
    background-color: #f8f9fa!important;
 
    box-shadow: 0 2px 1px 0 rgba(0,0,0,0.1)!important;
 
    background-image: none!important;
 
}
 
.wikiEditor-ui-toolbar .sections .section {
 
    background-color: #f8f9fa!important;
 
    box-shadow: 0 2px 1px 0 rgba(0,0,0,0.1)!important;
 
}
 
#msupload-dropzone {
 
    box-shadow: 0 2px 1px 0 rgba(0,0,0,0.1)!important;
 
}
 
#msupload-container {
 
    position: absolute;
 
}
 
.wikiEditor-ui-toolbar .tabs {
 
    margin-left: 24px;
 
    border-left: 1px solid #c8ccd1;
 
}
 
.wikiEditor-ui-toolbar .tabs span.tab.tab-advanced {
 
    padding-left: 7px;
 
}
 
.tool-button.tool-active, .tool.tool-active.oo-ui-buttonElement-frameless.oo-ui-iconElement {
 
    outline: transparent;
 
    background-color: transparent;
 
    box-shadow: none;
 
}
 
/* 解决pre不换行的问题 */
 
pre {
 
    white-space: pre-wrap; /* CSS-3 */
 
    white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
 
    white-space: -pre-wrap; /* Opera 4-6 */
 
    white-space: -o-pre-wrap; /* Opera 7 */
 
    word-wrap: break-word; /* Internet Explorer 5.5+ */
 
}
 
/* 页面底部导航框(2011年8月16日引自中文维基)(所谓大家族模板) */
 
table.navbox {
 
    clear: both;
 
    margin: auto;
 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
 
    padding: 1px;
 
    text-align: center;
 
    width: 100%;
 
    font-size: 101%!important;
 
    line-height: 1.8;
 
}
 
table.navbox+table.navbox {
 
    margin-top: -1px;
 
}
 
.navbox-title,
 
.navbox-abovebelow,
 
table.navbox th {
 
    padding-left: 1em;
 
    padding-right: 1em;
 
    text-align: center;
 
}
 
.navbox-group {
 
    font-weight: 700;
 
    padding-left: 1em;
 
    padding-right: 1em;
 
    white-space: nowrap;
 
}
 
.navbox,
 
.navbox-subgroup {
 
    background: none repeat scroll 0 0 #fdfdfd;
 
}
 
.navbox-list {
 
    border-color: #fdfdfd;
 
}
 
.navbox-title,
 
table.navbox th {
 
    background: none repeat scroll 0 0 #a5e4a5;
 
}
 
.navbox-abovebelow,
 
.navbox-group,
 
.navbox-subgroup .navbox-title {
 
    background: none repeat scroll 0 0 #c0ecc0;
 
}
 
.navbox-subgroup .navbox-group,
 
.navbox-subgroup .navbox-abovebelow {
 
    background: none repeat scroll 0 0 #e6f6e6;
 
}
 
.navbox-even {
 
    background: none repeat scroll 0 0 #f5fcf5;
 
}
 
.navbox-odd {
 
    background: none repeat scroll 0 0 transparent;
 
}
 
.collapseButton {
 
    float: right;
 
    font-weight: 400;
 
    text-align: right;
 
    width: auto;
 
}
 
.navbox .collapseButton {
 
    width: 6em;
 
}
 
/* Fix by case : Rev 1327309 ([[Special:Permalink/1327309]])
 
    Address alignment issue of nested tabs in Navbox */
 
.navbox .TabLabel {
 
    text-align: left;
 
}
 
/* Tabs */
 
.tab .TabLabelText {
 
    border-top: 3px solid transparent;
 
    padding: 1px;
 
    background: #fff;
 
    border-left: 1px solid transparent;
 
    border-right: 1px solid transparent;
 
    cursor: pointer;
 
    flex: none;
 
}
 
.tab .TabLabel {
 
    z-index: 2;
 
    position: relative;
 
    -webkit-user-select: none;
 
    -moz-user-select: none;
 
    -ms-user-select: none;
 
    -o-user-select: none;
 
    user-select: none;
 
    display: flex;
 
    flex-wrap: wrap;
 
}
 
.tab .TabLabelText.selected {
 
    border-top: 3px solid green;
 
    padding: 1px;
 
    background: white;
 
    border-left: 1px solid #aaa;
 
    border-right: 1px solid #aaa;
 
}
 
.tab .TabContent {
 
    background: white;
 
    padding: 20px 30px;
 
    position: relative;
 
    z-index: 1;
 
    border: 1px solid #aaa;
 
}
 
.tab .TabContentText {
 
    display: none;
 
}
 
.tab .TabContentText.selected {
 
    display: block;
 
}
 
.Tabs .Tab {
 
    border-bottom: 1px solid #aaa;
 
}
 
.Tabs .Tab:first-child {
 
    border-top: 1px solid #aaa;
 
}
 
.Tabs .Tab .TabLabelText {
 
    padding: 7px;
 
}
 
.Tabs .Tab .TabContentText {
 
    padding: 3px;
 
}
 
/* 表格宽度 */
 
.wikitable {
 
    max-width: 100%;
 
}
 
/* 缩略图居中*/
 
.thumb.tcenter {
 
    float: none;
 
    clear: both;
 
    display: block;
 
    margin: 0 auto;
 
}
 
/* 图片外框圆角化 */
 
.thumbinner {
 
  box-shadow: #666 0 0.4px 1px!important;
 
  border-radius: 5px!important;
 
  overflow: hidden!important;
 
}
 
/* 图库样式 */
 
    .thumbimage {
 
        border: 0px !important;
 
    }
 
  
    .thumbcaption {
+
var xml = gp_xmlobjects[i].responseXML,
        margin: 7px 0px !important;
+
cat = gp_xmlobjects[i].category,
    }
+
ts = gp_xmlobjects[i].timestamp,
 +
out =
 +
'<div id="' + mw.html.escape(cat) + '" style="background-color:#FFFF7E; width:' + gp_maxw + 'px">'
 +
+ '<a href="' + mw.util.getUrl(mw.config.get('wgFormattedNamespaces')[14] + ':' + cat) + '"><b>' + mw.html.escape(cat) + '</b></a><br/>',
 +
pages = xml ? xml.getElementsByTagName( 'cm' ) : [],
 +
before = '00000000000000',
 +
after = '99999999999999',
 +
before_image = '',
 +
after_image = '';
  
    .thumbimage:hover {
+
for ( k = 0; k < pages.length; k++ ) {
        opacity: 0.9 !important;
+
var page = pages[k],
    }
+
its = page.getAttribute( 'timestamp' ),
 +
image = page.getAttribute( 'title' );
  
    .dablink {
+
if ( its === '' ) {
        margin: 14px 0px !important;
+
// No timestamp here
        font-weight: 300 !important;
+
continue;
        font-size: 18px !important;
+
}
    }
+
if ( its < ts && its > before ) {
 +
before = its; before_image = image;
 +
}
 +
if ( its > ts && its < after ) {
 +
after = its; after_image = image;
 +
}
 +
}
  
    .ambox,.tmbox,.Note,.informationbox {
+
out += '<table border="0" style="width: 100%;"><tr>';
        margin: 5px 0px !important;
+
out += gp_add_thumbnail( before_image );
        font-size: 18px !important;
+
out += gp_add_thumbnail( after_image );
        font-weight: 700 !important;
+
out += "<td style='color:#BBBBBB;background-color:white;text-align:center'><b>";
        line-height: 1.5 !important;
+
if ( pages.length === 500 ) {
        border: 1px dashed #aaa !important;
+
out += ">500";
        max-width: 550px !important;
+
} else {
        font-weight: 300 !important;
+
out += pages.length;
    }
+
}
 +
out += '</b><br/>files in category</td>';
 +
out += '</tr></table>';
  
    .ambox td,.tmbox td {
+
out += '</div>';
        padding: 10px !important;
+
gp_div.innerHTML += out;
    }
+
gp_check_done();
 +
}
 +
}
 +
gp_check_done();
 +
}
  
    .ambox-text-small,.mbox-text,.Note td {
+
function gallerypreview_callback() {
        font-size: 14px !important;
+
var i, k;
        font-weight: 300 !important;
+
for ( i = 0; i < gp_xmlobjects.length; i++ ) {
        color: #000 !important;
+
if ( gp_xmlobjects[i].readyState === 4 && gp_xmlobjects[i].running === true ) {
    }
 
  
    .ambox-image,.mbox-image {
+
gp_xmlobjects[i].running = false;
        display: none;
 
    }
 
  
    #request_for_deletion,.ambox-serious {
+
var pn = mw.config.get('wgPageName').split( '_' ).join( ' ' ),
        background: rgba(255,0,0,0.1) !important;
+
xml = gp_xmlobjects[i].responseXML,
        border: 1px dashed rgba(255,0,0,0.15) !important;
+
gal = gp_xmlobjects[i].gallery,
        color: #a00000 !important;
+
out =
    }
+
"<div id='" + mw.html.escape(gal) + "' style='background-color:#BCED91;width:" + gp_maxw + "px'>"
 +
+ '<a href="' + mw.util.getUrl(gal) + '"><b>' + mw.html.escape(gal) + '</b></a><br/>',
 +
pages = xml ? xml.getElementsByTagName( 'im' ) : [],
 +
before_image = '',
 +
after_image = '';
  
    .tmbox-notice,.tmbox-move,.Note {
+
for ( k = 0; k < pages.length; k++ ) {
        background: rgba(150,75,0,0.1) !important;
+
var page = pages[k],
        border: 1px dashed rgba(150,75,0,0.15) !important;
+
image = page.getAttribute( 'title' );
    }
 
  
    .informationbox {
+
if ( image > before_image && image < pn) {
        background: #fff !important;
+
before_image = image;
        padding: 10px !important;
+
}
        font-size: 14px !important;
+
if ( ( after_image === '' || image < after_image ) && image > pn) {
    }
+
after_image = image;
 +
}
 +
}
  
    .editOptions {
+
out += '<table border="0" style="width: 100%;"><tr>';
        background: #fff !important;
+
out += gp_add_thumbnail( before_image );
        border: 0px !important;
+
out += gp_add_thumbnail( after_image );
    }
+
out += '<td style="color:#BBBBBB; background-color:white; text-align:center;"><b>';
 +
if ( pages.length === 500 ) {
 +
out += '>500';
 +
} else {
 +
out += pages.length;
 +
}
 +
out += '</b><br/>files in gallery</td>';
 +
out += '</tr></table>';
  
    .image img:hover {
+
out += '</div>';
        opacity: 0.85 !important;
+
gp_div.innerHTML += out;
    }
+
gp_check_done();
/* 用户页没有分类! */
+
}
body.ns-2 #catlinks {
+
}
    display: none !important;
+
gp_check_done();
 
}
 
}
/* 仅手机版显示支持 */
+
 
.mobileonly {
+
// Prepares a new query and adds it to the list
    display: none !important;
+
function add_categorypreview_task( category, timestamp ) {
 +
// Remove the first part before the colon
 +
category = category.split( ':' );
 +
category.shift();
 +
category = category.join( ':' );
 +
 
 +
if ( timestamp === '' ) {
 +
// No timestamp, no point in looking further
 +
return;
 +
}
 +
 
 +
for ( var i = 0; i < gp_avoid_cats.length; i++ ) {
 +
var s = gp_avoid_cats[i];
 +
if ( category.substr( 0, s.length ) === s ) return;
 +
}
 +
 
 +
var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
 +
format: 'xml',
 +
action: 'query',
 +
list: 'categorymembers',
 +
cmlimit: 500,
 +
cmnamespace: 6,
 +
cmprop: 'ids|title|timestamp',
 +
cmtitle: 'Category:' + category
 +
});
 +
i = gp_xmlobjects.length;
 +
gp_left = gp_left + 1;
 +
gp_found = true;
 +
gp_xmlobjects.push( new XMLHttpRequest() );
 +
gp_xmlobjects[i].gallery = '';
 +
gp_xmlobjects[i].category = category;
 +
gp_xmlobjects[i].timestamp = timestamp;
 +
gp_xmlobjects[i].onreadystatechange = categorypreview_callback;
 +
gp_xmlobjects[i].running = true;
 +
gp_xmlobjects[i].open( 'GET', url, true );
 +
gp_xmlobjects[i].send( null );
 
}
 
}
/* 编辑请求 */
 
.editRequest {
 
    text-align: center;
 
    border: 1px solid #ddd;
 
    border-radius: 3px;
 
    margin:1em 2.5em;
 
    padding: 1em;
 
    background: white;
 
}
 
.editRequest .newComment {
 
    white-space: nowrap;
 
    background: #347bff;
 
    color: #fff;
 
    border: 1px solid #347bff;
 
    text-shadow: 0 1px rgba(0,0,0,0.1);
 
    font-family: inherit;
 
    font-size: 1em;
 
    min-width: 4em;
 
    max-width: 28.75em;
 
    padding: .5em 1em;
 
    margin: 0;
 
    border-radius: 2px;
 
    -webkit-box-sizing: border-box;
 
    -moz-box-sizing: border-box;
 
    box-sizing: border-box;
 
    -webkit-appearance: none;
 
    zoom: 1;
 
    vertical-align: middle;
 
    text-align: center;
 
    font-weight: bold;
 
    cursor: pointer;
 
}
 
/* 注释里的列表 */
 
.reference-text > ul.listInRef,
 
.reference-text > ol.listInRef {
 
    margin: -1.5em 0 0 2em;
 
}
 
/*
 
* Skeleton V2.0.4
 
* Copyright 2014, Dave Gamache
 
* www.getskeleton.com
 
* Free to use under the MIT license.
 
* http://www.opensource.org/licenses/mit-license.php
 
* 12/29/2014
 
*/
 
/* 以下内容已被萌百格式化,注释已被翻译 */
 
.container {
 
    position: relative;
 
    width: 100%;
 
    max-width: 960px;
 
    margin: 0 auto;
 
    padding: 0 20px;
 
    box-sizing: border-box;
 
}
 
.div,
 
.divs,
 
.column,
 
.columns {
 
    width: 100%;
 
    float: left;
 
    box-sizing: border-box;
 
}
 
/* 适用于屏幕像素宽度大于400px的设备 */
 
@media (min-width: 400px) {
 
    .container {
 
        width: 85%;
 
        padding: 0;
 
    }
 
}
 
/* 适用于屏幕像素宽度大于800px的设备 */
 
@media (min-width: 800px) {
 
    .container {
 
        width: 80%;
 
    }
 
    .div,
 
    .divs,
 
    .column,
 
    .columns {
 
        margin-left: .3%;
 
    }
 
    .div:first-child,
 
    .divs:first-child,
 
    .column:first-child,
 
    .columns:first-child {
 
        margin-left: 0;
 
    }
 
    .one.div,
 
    .one.divs {
 
        width: 100%;
 
        margin-left: 0;
 
    }
 
    .two.divs {
 
        width: 49.85%;
 
    }
 
    .three.divs {
 
        width: 33.1333333333%;
 
    }
 
    .four.divs {
 
        width: 24.775%;
 
    }
 
    .five.divs {
 
        width: 19.76%;
 
    }
 
    .six.divs {
 
        width: 16.4166666667%;
 
    }
 
    .seven.divs {
 
        width: 14.0285714286%;
 
    }
 
    .eight.divs {
 
        width: 12.2375%;
 
    }
 
    .nine.divs {
 
        width: 10.8444444444%;
 
    }
 
    .ten.divs {
 
        width: 9.73%;
 
    }
 
    .eleven.divs {
 
        width: 8.81818181818%;
 
    }
 
    .twelve.divs {
 
        width: 8.05833333333%;
 
    }
 
    .one.column,
 
    .one.columns {
 
        width: 8.05833333333%;
 
    }
 
    .two.columns {
 
        width: 16.4166666667%;
 
    }
 
    .three.columns {
 
        width: 24.775%;
 
    }
 
    .four.columns {
 
        width: 33.1333333333%;
 
    }
 
    .five.columns {
 
        width: 41.4916666667%;
 
    }
 
    .six.columns {
 
        width: 49.85%;
 
    }
 
    .seven.columns {
 
        width: 58.2083333333%;
 
    }
 
    .eight.columns {
 
        width: 66.5666666667%;
 
    }
 
    .nine.columns {
 
        width: 74.925%;
 
    }
 
    .ten.columns {
 
        width: 83.2833333333%;
 
    }
 
    .eleven.columns {
 
        width: 91.6416666667%;
 
    }
 
    .twelve.columns {
 
        width: 100%;
 
        margin-left: 0;
 
    }
 
    .one-third.column {
 
        width: 33.1333333333%;
 
    }
 
    .two-thirds.column {
 
        width: 66.5666666667%;
 
    }
 
    .one-half.column {
 
        width: 49.85%;
 
    }
 
    /* Offsets设置 */
 
    .offset-by-one.column,
 
    .offset-by-one.columns {
 
        margin-left: 8.66666666667%;
 
    }
 
    .offset-by-two.column,
 
    .offset-by-two.columns {
 
        margin-left: 17.3333333333%;
 
    }
 
    .offset-by-three.column,
 
    .offset-by-three.columns {
 
        margin-left: 26%;
 
    }
 
    .offset-by-four.column,
 
    .offset-by-four.columns {
 
        margin-left: 34.6666666667%;
 
    }
 
    .offset-by-five.column,
 
    .offset-by-five.columns {
 
        margin-left: 43.3333333333%;
 
    }
 
    .offset-by-six.column,
 
    .offset-by-six.columns {
 
        margin-left: 52%;
 
    }
 
    .offset-by-seven.column,
 
    .offset-by-seven.columns {
 
        margin-left: 60.6666666667%;
 
    }
 
    .offset-by-eight.column,
 
    .offset-by-eight.columns {
 
        margin-left: 69.3333333333%;
 
    }
 
    .offset-by-nine.column,
 
    .offset-by-nine.columns {
 
        margin-left: 78.0%;
 
    }
 
    .offset-by-ten.column,
 
    .offset-by-ten.columns {
 
        margin-left: 86.6666666667%;
 
    }
 
    .offset-by-eleven.column,
 
    .offset-by-eleven.columns {
 
        margin-left: 95.3333333333%;
 
    }
 
    .offset-by-one-third.column,
 
    .offset-by-one-third.columns {
 
        margin-left: 34.6666666667%;
 
    }
 
    .offset-by-two-thirds.column,
 
    .offset-by-two-thirds.columns {
 
        margin-left: 69.3333333333%;
 
    }
 
    .offset-by-one-half.column,
 
    .offset-by-one-half.columns {
 
        margin-left: 52%;
 
    }
 
}
 
/*
 
* 感谢{{萌百|User:Great Brightstar}}的贡献,源码来自[[special:diff/834104]]
 
* 以下是原注释:
 
* 在这里使用 font-feature-settings 属性会让使用“lang”标签的元素强制使用 OpenType 技术显示本地化的变体字(通过激活 locl 标签,即便浏览器本身不直接激活)。
 
* 如果你使用思源黑体(非 CN、JP、KO、TW 版)、Noto Sans CJK 显示文字的话就有可能看到效果。
 
* 关于上述这个 CSS 属性的用法,参阅:https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings 注意:此文引用的 OpenType Feature Tags list 同样需要关注。
 
* 如有任何问题请即刻禁用之
 
* Nbdd0121: 将原来的[lang]改为span[lang],这样就不会影响非{{lang}}的[lang]了 (e.g. #mw-content-text)
 
*/
 
span[lang] {
 
    font-family: initial;
 
    font-feature-settings: "locl" on;
 
    -webkit-font-feature-settings: "locl" on;
 
}
 
[style*="font"] span[lang] {
 
    font-family: inherit;
 
}
 
/* wikitable 的 caption */
 
.wikitable.mw-collapsible caption {
 
    border: 1px solid rgba(170, 170, 170, 0.37);
 
    border-bottom-width: 0;
 
    background-color: rgb(249,249,249);
 
}
 
.wikitable.mw-collapsible.mw-collapsed caption {
 
    border-bottom-width: 1px;
 
}
 
/* vectorMenu 的排序 */
 
div.vectorMenu ul {
 
    display: flex;
 
    flex-flow: column;
 
}
 
/* 按钮样式 */
 
    .mw-ui-button,.mw-ui-progressive {
 
        border-radius: 4px !important;
 
        border: 1px solid #3366cc !important;
 
        color: #3366cc !important;
 
        background: #fff !important;
 
        text-shadow: 0px 0px 0px;
 
    }
 
  
    .mw-ui-button.mw-ui-progressive:hover,.mw-ui-button.mw-ui-progressive:focus,.mw-ui-button.mw-ui-progressive:active,.mw-ui-button:hover,.mw-ui-progressive:hover,.mw-ui-button:focus,.mw-ui-progressive:focus {
+
// Prepares a new query and adds it to the list
        box-shadow: 0px 0px 0px !important;
+
function add_gallerypreview_task( gallery ) {
        text-shadow: 0px 0px 0px !important;
+
 
        border: 1px solid #3366cc !important;
+
for ( var i = 0; i < gp_avoid_cats.length; i++ ) {
    }
+
var s = gp_avoid_cats[i];
 +
if ( gallery.substr( 0, s.length ) === s ) return;
 +
}
  
    #wpSave,#wpPreview,#wpDiff {
 
        border-radius: 4px !important;
 
        border: 1px solid #3366cc !important;
 
        color: #3366cc !important;
 
        background: #fff !important;
 
        text-shadow: 0px 0px 0px;
 
        padding: 0.5em 1em;
 
        cursor: pointer;
 
    }
 
  
    #wpSave:hover,#wpPreview:hover,#wpDiff:hover {
+
var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
        color: rgba(52,123,255,0.5) !important;
+
format: 'xml',
    }
+
action: 'query',
 +
prop: 'images',
 +
titles: gallery
 +
});
  
/* 分类页同开头的页面的列表不分段 */
+
i = gp_xmlobjects.length;
.mw-category-group {
+
gp_left = gp_left + 1;
    -webkit-column-break-inside: avoid;
+
gp_found2 = true;
    page-break-inside: avoid;
+
gp_xmlobjects.push( new XMLHttpRequest() );
    break-inside: avoid;
+
gp_xmlobjects[i].gallery = gallery;
 +
gp_xmlobjects[i].category = '';
 +
gp_xmlobjects[i].onreadystatechange = gallerypreview_callback;
 +
gp_xmlobjects[i].running = true;
 +
gp_xmlobjects[i].open( 'GET', url, true );
 +
gp_xmlobjects[i].send( null );
 
}
 
}
.mw-category-group:nth-child(1):nth-last-child(1),  /* 只有一个列表时 */
+
 
.mw-category-group:nth-child(1):nth-last-child(2)/* 只有两个列表时 */
+
function handle_category_list() {
.mw-category-group:nth-child(2):nth-last-child(1) { /* 只有两个列表时 */
+
if ( gp_cat_object.readyState === 4 ) {
    -webkit-column-break-inside: auto;
+
 
    page-break-inside: auto;
+
var xml = gp_cat_object.responseXML;
    break-inside: auto;
+
var cps = xml ? xml.getElementsByTagName('cl') : [];
 +
for ( var i = 0; i < cps.length; i++ ) {
 +
var il = cps[i];
 +
var ns = il.getAttribute('ns');
 +
if ( ns !== null && ns !== '14' ) continue; // Not a category. Strange.
 +
var ts = il.getAttribute('timestamp');
 +
var cat = il.getAttribute('title');
 +
add_categorypreview_task( cat, ts );
 +
}
 +
if ( gp_found === false ) gp_status.innerHTML += "<div style='color:CD0000'>No non-trivial categories found. <a href='//commons.wikimedia.org/wiki/Categories#Categorizing_your_uploads'>Please add some</a>.</div>";
 +
}
 
}
 
}
/* Ruby 模板 */
+
 
rb[data-id="template-ruby"]::before {
+
function handle_gallery_list() {
    content: "";
+
if ( gp_cat_object2.readyState === 4 ) {
 +
var xml = gp_cat_object2.responseXML;
 +
var ils = xml ? xml.getElementsByTagName('iu') : [];
 +
for ( var i = 0; i < ils.length; i++ ) {
 +
var il = ils[i];
 +
var ns = il.getAttribute('ns');
 +
if ( ns !== null && ns !== '0' ) continue; // Not gallery namespace
 +
var gallery = il.getAttribute('title');
 +
add_gallerypreview_task( gallery );
 +
}
 +
if ( gp_found2 === false ) gp_status.innerHTML += '<div style="color:#CD0000;">No galleries found.</div>';
 +
}
 
}
 
}
rb[data-id="template-ruby"]::before,
+
 
.template-ruby-hidden {
+
function gp_get_category_list( page ) {
    display: inline-block;
+
gp_cat_object = new XMLHttpRequest();
    width: 0;
+
var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
    font-size: 0;
+
format: 'xml',
 +
action: 'query',
 +
prop: 'categories',
 +
clprop: 'timestamp',
 +
titles: page
 +
});
 +
gp_cat_object.onreadystatechange = handle_category_list;
 +
gp_cat_object.open( 'GET', url, true );
 +
gp_cat_object.send( null );
 
}
 
}
/* R18模板 */
+
 
#x18 {
+
function gp_get_gallery_list( page ) {
    width: 100%;
+
gp_cat_object2 = new XMLHttpRequest();
    height: 100%;
+
var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
    position: fixed;
+
format: 'xml',
    top: 0;
+
action: 'query',
    background: rgba(0, 0, 0, 0.9);
+
list: 'imageusage',
    z-index: 999;
+
iutitle: page,
    opacity: 0;
+
iunamespace: 0 // Gallery namespace (NS_MAIN=0)
 +
});
 +
gp_cat_object2.onreadystatechange = handle_gallery_list;
 +
gp_cat_object2.open( 'GET', url, true );
 +
gp_cat_object2.send( null );
 
}
 
}
#x18Context {
+
 
    position: relative;
+
// Initializes the run of the script and prepares/starts the queries
    margin: 0 auto;
+
function run_gallerypreview() {
    margin-top: -40px;
+
gp_head = document.getElementById('gp_head');
    top: 50%;
+
gp_status = document.getElementById('gp_status');
    width: 240px;
+
gp_counter = 0;
    height: 80px;
+
gp_left = 0;
    background: #444;
+
gp_found = false;
    color: white;
+
gp_found2 = false;
    border: solid 1px rgb(118, 195, 255);
+
gp_div.style.width = '250px';
    border-radius: 4px;
+
gp_div.style.border = '1px solid #AAAAAA';
    box-shadow: 0 0 5px rgb(118, 195, 255);
+
gp_image_xml = [];
    padding: 12px;
+
// gp_head.innerHTML = '';
 +
gp_xmlobjects = [];
 +
gp_get_gallery_list( mw.config.get('wgPageName') );
 +
gp_get_category_list( mw.config.get('wgPageName') );
 
}
 
}
#x18Title {
+
 
    margin: 12px;
+
// Onload handler
}
+
// Adds div section with id gallerypreview
#x18Icon {
+
function init_gallery_preview() {
    position: relative;
+
gp_maxw = ( gp_size + 10 ) * 3;
    border: 8px solid transparent;
+
var file_div = document.getElementById('file');
    border-left: 12px solid #fff;
+
if( !file_div ) return;
    float: left;
+
var file_div_parent = file_div.parentNode;
    margin: 2px 0;
+
 
}
+
var dummy = document.createElement( 'div' );
.x18Button {
+
file_div_parent.insertBefore( dummy, file_div );
    text-align: center;
+
dummy.innerHTML = '<div id="gallerypreview_container" style="border:1px solid #AAAAAA; float:right; max-width:' + gp_maxw + 'px; width:' + gp_maxw + 'px">' +
}
+
'<div id="gp_head" style="background-color:#AAAAFF; padding:2px; border:1px solid #AAAAAA; display:block;"><span style="color:#FFFF99;">Loading…</span></div>' +
.x18Button div {
+
'<div id="gallerypreview" style="display:block; width:' + gp_maxw + 'px"></div>' +
    width: 72px;
+
'<div id="gp_status" style="border:1px solid #AAAAAA; padding:2px;"></div>' +
    height: 20px;
+
'</div>';
    border-radius: 4px;
+
 
    padding: 4px;
+
gp_div = document.getElementById( 'gallerypreview' );
    text-align: center;
+
while ( gp_div.firstChild ) gp_div.removeChild( gp_div.firstChild );
    font-size: 11pt;
+
gp_maxw -= 2;
    display: inline-block;
+
setTimeout( function() {  
    cursor: pointer;
+
run_gallerypreview();
    box-shadow: #777 0 0 22px inset;
+
}, 10 );
}
 
.x18Button div:nth-child(2) {
 
    margin-left: 26px;
 
}
 
#x18Yes {
 
    background: rgb(57, 238, 0);
 
}
 
#x18No {
 
    background: rgb(238, 48, 0);
 
 
}
 
}
 +
 +
$(document).ready( init_gallery_preview );
 +
 +
})(jQuery, mediaWiki);

2022年4月18日 (一) 14:12的最新版本

/**
 * JavaScript-based gallery preview using api.php
 * Version 0.2
 * (c) 2007 by Magnus Manske
 * Released under GPL
 * Maintainers: [[User:Magnus Manske]], [[User:Krinkle]]
**/

/*global mediaWiki:false, jQuery:false*/
/*jshint curly:false, laxbreak:true*/
(function( $, mw ) {
'use strict';


// Install onload handler, which will display the link to start the script
if ( mw.config.get('wgNamespaceNumber') !== 6 || mw.config.get('wgAction') !== 'view'  || mw.util.getParamValue('diff')) {
	return;
}

var	gp_div, gp_head, gp_status,
	gp_xmlobjects,
	gp_cat_object,
	gp_cat_object2,
	gp_image_xml,
	gp_counter,
	gp_left,
	gp_found,
	gp_found2,
	gp_size = 75,
	gp_maxw;

// Avoid license categories etc.
var gp_avoid_cats = [
	'CC-',
	'PD-',
	'PD ',
	'GPL',
	'Self',
	'GFDL',
	'Copyrighted free use',
	'Media with locations',
	'Deletion',
	'Incomplete deletion',
	'Flickr review needed',
	'Flickr images needing human review',
	'User-created GFDL images',
	'Images without source',
	'Images that should use vector graphics',
	'Uploaded with UploadWizard',
	'Author died more than',
	'License migration',
	'Images with annotations'
];


// Handler to toggle the listing of hits for a single language/project
window.toggle_id = function ( id ) {
	var e = document.getElementById( id );
	if ( e.style.display === 'none' ) e.style.display = 'block';
	else e.style.display = 'none';
};

function gp_check_done() {
	var i;
	for ( i = 0; i < gp_xmlobjects.length; i++ ) {
		if ( gp_xmlobjects[i].running ) return;
	}
	for ( i = 0; i < gp_image_xml.length; i++ ) {
		if ( gp_image_xml[i].running ) return;
	}
	gp_head.innerHTML = '<a href="#" style="float:right;" onClick="toggle_id(\'gallerypreview\');">Show/hide preview</a>Done.';
}


function get_thumbnail_url( url, width ) {
	url = url.replace( '/commons/', '/commons/thumb/' );
	var iname = url.split( '/' ).pop();
	url += '/' + width + 'px-' + iname;
	gp_check_done();
	return url;
}


function gp_image_callback() {
	for ( var i = 0; i < gp_image_xml.length; i++ ) {
		if (gp_image_xml[i].readyState === 4 && gp_image_xml[i].running === true ) {
			gp_image_xml[i].running = false;
			var xml = gp_image_xml[i].responseXML;
			var image = xml ? xml.getElementsByTagName( 'ii' )[0] : false;
         // Deleted/ hidden revision, ...
         if (!image) continue;
			var width = image.getAttribute( 'width' );
			var height = image.getAttribute( 'height' );

			var nw = gp_size;
			var nh = nw / width * height;
			var off = ' style="position:relative; overflow:hidden;';
			if ( nh < gp_size ) {
				nh = gp_size;
				nw = nh / height * width;
				var xoff = -( nw - gp_size )/2;
				off += 'left:' + Math.floor( xoff ) + 'px;';
			}
			if ( nh > gp_size ) {
				var yoff = -( nh - gp_size )/2;
				off += 'top:' + Math.floor( yoff ) + 'px;';
			}
			off += '" ';


			var url = get_thumbnail_url( image.getAttribute( 'url' ), Math.floor(nw) );

			var target = document.getElementById(gp_image_xml[i].myid);
			if(target) {
				target.innerHTML = "<div style='overflow:hidden;width:75px;height:75px'><a href=\"" + mw.util.getUrl(gp_image_xml[i].image) + "\"><img border='0' " + off + "src=\"" + url + "\"/></a></div>";
			}
			gp_check_done();
		}
	}
	gp_check_done();
}

function gp_add_thumbnail( image ) {
	var myid = 'gpid_' + gp_counter;
	gp_counter += 1;
	var ret = "<td id='" + myid + "' style='overflow:hidden;width:75px;height:75px;font-size:75%;text-align:left;color:white";
	if ( image === '' ) {
		ret += ";background-color:#BBBBBB'>";
		ret += 'No other files here';
	} else {
		ret += "'>";
	}
	ret += '</td>';

	if ( image === '' ) return ret;

	var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
		format: 'xml',
		action: 'query',
		prop: 'imageinfo',
		iiprop: 'url|size',
		titles: image
	});
	var i = gp_image_xml.length;
	gp_image_xml.push( new XMLHttpRequest() );
	gp_image_xml[i].image = image;
	gp_image_xml[i].myid = myid;
	gp_image_xml[i].running = true;
	gp_image_xml[i].onreadystatechange = gp_image_callback;
	gp_image_xml[i].open( 'GET', url, true );
	gp_image_xml[i].send( null );

	gp_check_done();
	return ret;
}

function categorypreview_callback() {
	var i, k;
	for ( i = 0; i < gp_xmlobjects.length; i++ ) {
		if ( gp_xmlobjects[i].readyState === 4 && gp_xmlobjects[i].running === true ) {

			gp_xmlobjects[i].running = false;

			var	xml = gp_xmlobjects[i].responseXML,
				cat = gp_xmlobjects[i].category,
				ts = gp_xmlobjects[i].timestamp,
				out = 
					'<div id="' + mw.html.escape(cat) + '" style="background-color:#FFFF7E; width:' + gp_maxw + 'px">'
					+ '<a href="' + mw.util.getUrl(mw.config.get('wgFormattedNamespaces')[14] + ':' + cat) + '"><b>' + mw.html.escape(cat) + '</b></a><br/>',
				pages = xml ? xml.getElementsByTagName( 'cm' ) : [],
				before = '00000000000000',
				after = '99999999999999',
				before_image = '',
				after_image = '';

			for ( k = 0; k < pages.length; k++ ) {
				var	page = pages[k],
					its = page.getAttribute( 'timestamp' ),
					image = page.getAttribute( 'title' );

				if ( its === '' ) {
					// No timestamp here
					continue;
				}
				if ( its < ts && its > before ) {
					before = its; before_image = image;
				}
				if ( its > ts && its < after ) {
					after = its; after_image = image;
				}
			}

			out += '<table border="0" style="width: 100%;"><tr>';
			out += gp_add_thumbnail( before_image );
			out += gp_add_thumbnail( after_image );
			out += "<td style='color:#BBBBBB;background-color:white;text-align:center'><b>";
			if ( pages.length === 500 ) {
				out += ">500";
			} else {
				out += pages.length;
			}
			out += '</b><br/>files in category</td>';
			out += '</tr></table>';

			out += '</div>';
			gp_div.innerHTML += out;
			gp_check_done();
		}
	}
	gp_check_done();
}

function gallerypreview_callback() {
	var i, k;
	for ( i = 0; i < gp_xmlobjects.length; i++ ) {
		if ( gp_xmlobjects[i].readyState === 4 && gp_xmlobjects[i].running === true ) {

			gp_xmlobjects[i].running = false;

			var	pn = mw.config.get('wgPageName').split( '_' ).join( ' ' ),
				xml = gp_xmlobjects[i].responseXML,
				gal = gp_xmlobjects[i].gallery,
				out =
					"<div id='" + mw.html.escape(gal) + "' style='background-color:#BCED91;width:" + gp_maxw + "px'>"
					+ '<a href="' + mw.util.getUrl(gal) + '"><b>' + mw.html.escape(gal) + '</b></a><br/>',
				pages = xml ? xml.getElementsByTagName( 'im' ) : [],
				before_image = '',
				after_image = '';

			for ( k = 0; k < pages.length; k++ ) {
				var	page = pages[k],
					image = page.getAttribute( 'title' );

				if ( image > before_image && image < pn) {
					before_image = image;
				}
				if ( ( after_image === '' || image < after_image ) && image > pn) {
					after_image = image;
				}
			}

			out += '<table border="0" style="width: 100%;"><tr>';
			out += gp_add_thumbnail( before_image );
			out += gp_add_thumbnail( after_image );
			out += '<td style="color:#BBBBBB; background-color:white; text-align:center;"><b>';
			if ( pages.length === 500 ) {
				out += '>500';
			} else {
				out += pages.length;
			}
			out += '</b><br/>files in gallery</td>';
			out += '</tr></table>';

			out += '</div>';
			gp_div.innerHTML += out;
			gp_check_done();
		}
	}
	gp_check_done();
}

// Prepares a new query and adds it to the list
function add_categorypreview_task( category, timestamp ) {
	// Remove the first part before the colon
	category = category.split( ':' );
	category.shift();
	category = category.join( ':' );

	if ( timestamp === '' ) {
		// No timestamp, no point in looking further
		return;
	}

	for ( var i = 0; i < gp_avoid_cats.length; i++ ) {
		var s = gp_avoid_cats[i];
		if ( category.substr( 0, s.length ) === s ) return;
	}

	var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
		format: 'xml',
		action: 'query',
		list: 'categorymembers',
		cmlimit: 500,
		cmnamespace: 6,
		cmprop: 'ids|title|timestamp',
		cmtitle: 'Category:' + category
	});
	i = gp_xmlobjects.length;
	gp_left = gp_left + 1;
	gp_found = true;
	gp_xmlobjects.push( new XMLHttpRequest() );
	gp_xmlobjects[i].gallery = '';
	gp_xmlobjects[i].category = category;
	gp_xmlobjects[i].timestamp = timestamp;
	gp_xmlobjects[i].onreadystatechange = categorypreview_callback;
	gp_xmlobjects[i].running = true;
	gp_xmlobjects[i].open( 'GET', url, true );
	gp_xmlobjects[i].send( null );
}

// Prepares a new query and adds it to the list
function add_gallerypreview_task( gallery ) {

	for ( var i = 0; i < gp_avoid_cats.length; i++ ) {
		var s = gp_avoid_cats[i];
		if ( gallery.substr( 0, s.length ) === s ) return;
	}


	var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
		format: 'xml',
		action: 'query',
		prop: 'images',
		titles: gallery
	});

	i = gp_xmlobjects.length;
	gp_left = gp_left + 1;
	gp_found2 = true;
	gp_xmlobjects.push( new XMLHttpRequest() );
	gp_xmlobjects[i].gallery = gallery;
	gp_xmlobjects[i].category = '';
	gp_xmlobjects[i].onreadystatechange = gallerypreview_callback;
	gp_xmlobjects[i].running = true;
	gp_xmlobjects[i].open( 'GET', url, true );
	gp_xmlobjects[i].send( null );
}

function handle_category_list() {
	if ( gp_cat_object.readyState === 4 ) {

		var xml = gp_cat_object.responseXML;
		var cps = xml ? xml.getElementsByTagName('cl') : [];
		for ( var i = 0; i < cps.length; i++ ) {
			var il = cps[i];
			var ns = il.getAttribute('ns');
			if ( ns !== null && ns !== '14' ) continue; // Not a category. Strange.
			var ts = il.getAttribute('timestamp');
			var cat = il.getAttribute('title');
			add_categorypreview_task( cat, ts );
		}
		if ( gp_found === false ) gp_status.innerHTML += "<div style='color:CD0000'>No non-trivial categories found. <a href='//commons.wikimedia.org/wiki/Categories#Categorizing_your_uploads'>Please add some</a>.</div>";
	}
}

function handle_gallery_list() {
	if ( gp_cat_object2.readyState === 4 ) {
		var xml = gp_cat_object2.responseXML;
		var ils = xml ? xml.getElementsByTagName('iu') : [];
		for ( var i = 0; i < ils.length; i++ ) {
			var il = ils[i];
			var ns = il.getAttribute('ns');
			if ( ns !== null && ns !== '0' ) continue; // Not gallery namespace
			var gallery = il.getAttribute('title');
			add_gallerypreview_task( gallery );
		}
		if ( gp_found2 === false ) gp_status.innerHTML += '<div style="color:#CD0000;">No galleries found.</div>';
	}
}

function gp_get_category_list( page ) {
	gp_cat_object = new XMLHttpRequest();
	var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
		format: 'xml',
		action: 'query',
		prop: 'categories',
		clprop: 'timestamp',
		titles: page
	});
	gp_cat_object.onreadystatechange = handle_category_list;
	gp_cat_object.open( 'GET', url, true );
	gp_cat_object.send( null );
}

function gp_get_gallery_list( page ) {
	gp_cat_object2 = new XMLHttpRequest();
	var url = mw.util.wikiScript( 'api' ) + '?' + $.param({
		format: 'xml',
		action: 'query',
		list: 'imageusage',
		iutitle: page,
		iunamespace: 0 // Gallery namespace (NS_MAIN=0)
	});
	gp_cat_object2.onreadystatechange = handle_gallery_list;
	gp_cat_object2.open( 'GET', url, true );
	gp_cat_object2.send( null );
}

// Initializes the run of the script and prepares/starts the queries
function run_gallerypreview() {
	gp_head = document.getElementById('gp_head');
	gp_status = document.getElementById('gp_status');
	gp_counter = 0;
	gp_left = 0;
	gp_found = false;
	gp_found2 = false;
	gp_div.style.width = '250px';
	gp_div.style.border = '1px solid #AAAAAA';
	gp_image_xml = [];
//	gp_head.innerHTML = '';
	gp_xmlobjects = [];
	gp_get_gallery_list( mw.config.get('wgPageName') );
	gp_get_category_list( mw.config.get('wgPageName') );
}

// Onload handler
// Adds div section with id gallerypreview
function init_gallery_preview() {
	gp_maxw = ( gp_size + 10 ) * 3;
	var file_div = document.getElementById('file');
	if( !file_div ) return;
	var file_div_parent = file_div.parentNode;

	var dummy = document.createElement( 'div' );
	file_div_parent.insertBefore( dummy, file_div );
	dummy.innerHTML = '<div id="gallerypreview_container" style="border:1px solid #AAAAAA; float:right; max-width:' + gp_maxw + 'px; width:' + gp_maxw + 'px">' +
	'<div id="gp_head" style="background-color:#AAAAFF; padding:2px; border:1px solid #AAAAAA; display:block;"><span style="color:#FFFF99;">Loading…</span></div>' +
	'<div id="gallerypreview" style="display:block; width:' + gp_maxw + 'px"></div>' +
	'<div id="gp_status" style="border:1px solid #AAAAAA; padding:2px;"></div>' +
	'</div>';

	gp_div = document.getElementById( 'gallerypreview' );
	while ( gp_div.firstChild ) gp_div.removeChild( gp_div.firstChild );
	gp_maxw -= 2;
	setTimeout( function() { 
		run_gallerypreview();
	}, 10 );
}

$(document).ready( init_gallery_preview );

})(jQuery, mediaWiki);