跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
分类索引
最近更改
随便看看
灵兰秘典
沙盒
捐助本站
帮助
帮助
方针指引
联系我们
关于本站
MediaWiki帮助
USER-SIDEBAR
GROUP-SIDEBAR
CATEGORY-SIDEBAR
中医百科
搜索
搜索
外观
登录
个人工具
登录
查看“︁MediaWiki:Gadget-ding.js”︁的源代码
系统消息
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
外观
移至侧栏
隐藏
←
MediaWiki:Gadget-ding.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
"use strict"; /* ding ("message here should be safe html, beacuse you can write <button>Buttons</button>", "info" | "warning" | "success" | "default", "long" | 10000 <-- expiry time in ms ) */ window.bldkDingExposedInterface = (function () { /** * * @param {string} message message here should be safe html, beacuse you can write <button>Buttons</button> in this * @param {string} type "info": dark blue/black, "warning": red/white, "success": green/white, "default": light blue/black (background/text) * @param {number|"long"} ttl number of microseconds before ding element disappears, "long" if the ding should not disappear after a timeout * @param {boolean} history does nothing currently * @param {boolean} persist If the element should go away when user clicks anywhere on it. If persist= true && ttl= long, make sure to include a button to allow the user to remove the banner */ function ding(message, type, ttl, history, persist) { if (type === void 0) { type = "info"; } if (ttl === void 0) { ttl = 3500; } if (history === void 0) { history = true; } if (persist === void 0) { persist = false; } if (!document.getElementById("bluedeck_ding")) { document.body.insertAdjacentHTML("afterbegin", "<style>#bluedeck_ding button{margin: 0 0.2em; background:transparent; border:0.2em solid white; border-radius: 9em; padding: 0 0.7em; box-sizing: border-box; color: inherit; font-weight: inherit;}#bluedeck_ding button:active{background:rgba(255,255,255,0.6)}</style>"); document.body.insertAdjacentHTML("afterbegin", "<div id='bluedeck_ding'></div>"); } if (!document.getElementById("bluedeck_ding_history")) { document.body.insertAdjacentHTML("afterbegin", "<div id='bluedeck_ding_history'></div>"); } var dingEle = document.getElementById("bluedeck_ding"); var dingHistEle = document.getElementById("bluedeck_ding_history"); var previousMessage = dingEle.lastChild; if (previousMessage) { previousMessage.style.transform = "translateY(130%)"; setTimeout(function () { previousMessage.remove(); }, 500); } var color_sets = { warning: { text: "rgba(255, 255, 255, 1)", background: "rgba(221, 51, 51, 1)" }, info: { text: "rgba(255, 255, 255, 1)", background: "rgba(51, 102, 204, 1)" }, success: { text: "rgba(255, 255, 255, 1)", background: "rgba(0, 175, 137, 1)" }, confusion: { text: "rgba(0, 0, 0, 1)", background: "rgba(234, 236, 240, 1)" }, "default": { text: "rgba(0, 0, 0, 1)", background: "rgba(234, 236, 240, 1)" } }; var retractant = persist ? "" : "onclick='this.style.transform = \"translateY(130%)\";setTimeout(function(){this.remove()}.bind(this), 500);' "; dingEle.insertAdjacentHTML("beforeend", "<div " + retractant + "style='" + "position:fixed; bottom:0; left:0; right:0; margin: 0 0 auto 0; height: auto; line-height: 1.4em; " + "padding: 0.6em 2em; opacity: 1; text-align: center; z-index: 9999; font-size: 86%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); " + "font-weight: bold; transform: translateY(130%); transition: all 0.2s;" + "background: " + color_sets[type].background + "; color:" + color_sets[type].text + "; ' " + ">" + message + "</div>"); var noticeEle = dingEle.lastChild; setTimeout(function () { noticeEle.style.transform = "translateY(0%)"; }, 10); if (ttl !== "long") { setTimeout(function () { noticeEle.style.transform = "translateY(130%)"; }, ttl + 10); setTimeout(function () { noticeEle.remove(); }, ttl + 510); } } return ding; })();
返回
MediaWiki:Gadget-ding.js
。
搜索
搜索
查看“︁MediaWiki:Gadget-ding.js”︁的源代码
添加话题