打开/关闭搜索
搜索
打开/关闭菜单
23
245
1
6498
DOL ShipMaker Wiki
首页
首页
世界地图
特殊页面
上传文件
游戏资料
游戏介绍
国家介绍
人物介绍
历代版本
EP1 Original
EP2 La Frontera
EP3 Cruz del Sur
EP4 El Oriente
EP5 Tierra Americana
EP6 2nd Age
EP7 Gran Atlas
EP8 Atlantis
EP9 Age of Revolution
EP10 Order of the Prince
EP11 Lost Memories
EP12 Seven Wonders
EP12 Extra Polars
冒险专区
发现物
冒险任务
书库地图
遗迹地下城
沉船打捞
睿智之书
传说任务
学术论战
商人专区
交易品
商业任务
特产品
南蛮贸易
大投资战
稀少交易品
学术论战
打开/关闭外观设置菜单
notifications
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁MediaWiki:Common.js”︁的源代码
MediaWiki界面页面
查看
阅读
查看源代码
查看历史
associated-pages
系统消息
讨论
更多操作
←
MediaWiki:Common.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
管理员
、editor
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。 如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
( function () { 'use strict'; var MAIN_SITE = 'https://www.dolshipmaker.vip'; var WIKI_BASE = 'https://wiki.dolshipmaker.vip'; var LOGOUT_URL = WIKI_BASE + '/wiki/首页?sso_action=logout'; // 尽早替换退出链接,在 DOM ready 之前 function replaceLogoutLinks() { document.querySelectorAll( 'a' ).forEach( function( a ) { if ( a.href && ( a.href.includes('action=logout') || a.href.includes('UserLogout') ) ) { a.href = LOGOUT_URL; a.removeAttribute('data-mw'); // 移除所有已绑定的事件 var newA = a.cloneNode( true ); a.parentNode.replaceChild( newA, a ); } } ); } // 用 MutationObserver 监控 DOM 变化,实时替换 var observer = new MutationObserver( function() { replaceLogoutLinks(); } ); observer.observe( document.documentElement, { childList: true, subtree: true } ); // 立即执行一次 replaceLogoutLinks(); function syncLoginState() { if ( mw.config.get( 'wgUserId' ) !== 0 ) return; fetch( MAIN_SITE + '/api/auth/verify', { method: 'POST', credentials: 'include' } ) .then( function(r) { return r.json(); } ) .then( function(d) { if ( d.valid && d.user && !window.location.search.includes('sso_refresh') ) { window.location.href = window.location.href + ( window.location.search ? '&' : '?' ) + 'sso_refresh=1'; } } ).catch(function(){}); } function interceptLoginButton() { $( document ).on( 'click', 'a[href*="Special:UserLogin"], a[href*="action=login"]', function(e) { e.preventDefault(); window.location.href = MAIN_SITE + '/login.html?redirect=' + encodeURIComponent( window.location.href ); } ); } function interceptRegisterButton() { $( document ).on( 'click', 'a[href*="Special:CreateAccount"], a[href*="action=createaccount"]', function(e) { e.preventDefault(); window.location.href = MAIN_SITE + '/register.html?redirect=' + encodeURIComponent( window.location.href ); } ); } function interceptEditForAnon() { if ( mw.config.get( 'wgUserId' ) !== 0 ) return; $( document ).on( 'click', 'a[href*="action=edit"], a[href*="veaction=edit"]', function(e) { e.preventDefault(); window.location.href = MAIN_SITE + '/login.html?redirect=' + encodeURIComponent( window.location.href ); } ); } mw.loader.using( 'mediawiki.util' ).done( function() { $( document ).ready( function() { syncLoginState(); replaceLogoutLinks(); interceptLoginButton(); interceptRegisterButton(); interceptEditForAnon(); } ); } ); }() );
返回
MediaWiki:Common.js
。
查看“︁MediaWiki:Common.js”︁的源代码
MediaWiki界面页面