imported>=海豚= |
imported>Irukaza |
(未显示2个用户的368个中间版本) |
第1行: |
第1行: |
| if (mw.config.get("wgAction") === "view"&& !document.querySelector("#noteTA-lang")) {
| | |
| var url = new mw.Uri();
| |
| var wgUserVariant = mw.config.get("wgUserVariant");
| |
| $("body").append('<div id="noteTA-lang" style="background: #3366CC; color: white; text-align: center; padding: .5rem; position: fixed; top: 0; left: 0; right: 0; z-index: 9999;"><p>我们推荐您登陆<b>内容</b>你可以署名自己的贡献(<a class="p4js-conversion-link" href="www.baidu.com">点击</a>|<span id="noteTA-lang-disable" class="p4js-conversion-link mw-ui-destructive">不再提示</span></div>)');
| |
| }
| |
| $(".noteTA-lang-changer").on("click", function(e) {
| |
| var uri = new mw.Uri();
| |
| var path = uri.path;
| |
| Object.keys(map).forEach(function(s) {
| |
| path = path.replace(new RegExp("^/" + s + "/"), "/");
| |
| });
| |
| uri.path = "/" + e.target.dataset.lang + "/" + path.replace(/^\//, "");
| |
| location.replace(uri);
| |
| $("#noteTA-lang").remove();
| |
| }).filter('[data-lang="' + wgUserVariant + '"]').addClass("mw-ui-progressive");
| |
| $("#noteTA-lang-explainer").on("click", function() {
| |
| //open(mw.config.get("wgServer") + mw.config.get("wgScriptPath") +,"_blank");
| |
| }).hide();
| |
| $("#noteTA-lang-disable").on("click", function() {
| |
| $("#noteTA-lang").remove();
| |
| localStorage.setItem("AnnTools-noteTA-alert", "true");
| |
| });
| |