replace inlinePopup with Dialog.show

This commit is contained in:
Dawid Wysokiński 2021-01-14 17:51:10 +01:00
parent f65bd7697b
commit b422748176
19 changed files with 71 additions and 179 deletions

View File

@ -276,7 +276,7 @@ const translations = {
exportedVillages: 'Wyeksportowane wioski',
tribeChanges: 'Zmiany plemion',
action: {
linkToTWHelp: 'Akta gracza - TWHelp - nowa strona ze statystykami i narzędziami',
linkToTWHelp: 'Akta gracza (TWHelp)',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
exportVillages: 'Wyeksportuj wioski',
@ -306,7 +306,7 @@ const translations = {
exportedVillages: 'Exported villages',
tribeChanges: 'Tribe changes',
action: {
linkToTWHelp: 'User file (external link) - TWHelp - A new stat tracking website.',
linkToTWHelp: 'User file (TWHelp)',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
exportVillages: 'Export villages',
@ -417,43 +417,25 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.POPUP_SELECTOR = void 0;
const POPUP_WRAPPER_SELECTOR = '.popup_helper';
const POPUP_SELECTOR = '#inline_popup';
const POPUP_SELECTOR = '.popup_box';
exports.POPUP_SELECTOR = POPUP_SELECTOR;
var _default = function _default() {
const showPopup = function showPopup() {
let {
e,
title,
html,
id
id,
title
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
Dialog.show(id, "<h3>".concat(title, "</h3>") + html);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';
popupWrapper.style.position = 'fixed';
popupWrapper.style.zIndex = '50001';
}
};
var _default = showPopup;
exports.default = _default;
},{}],"tKRp":[function(require,module,exports) {
"use strict";
@ -1193,7 +1175,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
// @namespace https://github.com/tribalwarshelp/scripts
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @version 1.1.7
// @version 1.1.8
// @description Extended player profile
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player*
@ -1335,7 +1317,7 @@ const renderPlayerServers = player => {
otherElementContainer.prepend(playerServers);
}
playerServers.querySelector('td').innerHTML = player.servers.sort().map(server => "<a target=\"_blank\" rel=\"noopener noreferrer\" style=\"margin-right: 5px\" href=\"".concat(twhelputils.buildPlayerURL(VERSION, server, player.id), "\">").concat(server, "</a>")).join('');
playerServers.querySelector('td').innerHTML = player.servers.sort().map(server => "<a target=\"_blank\" style=\"margin-right: 5px\" href=\"".concat(twhelputils.buildPlayerURL(VERSION, server, player.id), "\">").concat(server, "</a>")).join('');
};
const renderPlayerOtherNames = player => {

View File

@ -466,7 +466,7 @@ const translations = {
dailyGrowth: 'Dzienny przyrost',
playerLinks: 'Linki',
action: {
linkToTWHelp: 'Akta plemienia - TWHelp - nowa strona ze statystykami i narzędziami',
linkToTWHelp: 'Akta plemienia (TWHelp)',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
showMembersGrowth: 'Pokaż rozwój graczy',
@ -503,7 +503,7 @@ const translations = {
dailyGrowth: 'Daily growth',
playerLinks: 'Player links',
action: {
linkToTWHelp: 'Tribal file (external link) - TWHelp - A new stat tracking website.',
linkToTWHelp: 'Tribal file (TWHelp)',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
showMembersGrowth: 'Show members growth',
@ -763,43 +763,25 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.POPUP_SELECTOR = void 0;
const POPUP_WRAPPER_SELECTOR = '.popup_helper';
const POPUP_SELECTOR = '#inline_popup';
const POPUP_SELECTOR = '.popup_box';
exports.POPUP_SELECTOR = POPUP_SELECTOR;
var _default = function _default() {
const showPopup = function showPopup() {
let {
e,
title,
html,
id
id,
title
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
Dialog.show(id, "<h3>".concat(title, "</h3>") + html);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';
popupWrapper.style.position = 'fixed';
popupWrapper.style.zIndex = '50001';
}
};
var _default = showPopup;
exports.default = _default;
},{}],"V6Mf":[function(require,module,exports) {
"use strict";
@ -1366,7 +1348,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @version 1.1.0
// @version 1.1.1
// @description Extended tribe profile
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_ally*
@ -1512,7 +1494,7 @@ const extendMembersData = players => {
link,
label
} = _ref2;
return "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"".concat(link, "\">").concat(label, "</a>");
return "<a target=\"_blank\" href=\"".concat(link, "\">").concat(label, "</a>");
}).join('<br>');
}
} else if (typeof data === 'number') {

View File

@ -176,7 +176,7 @@ const translations = {
ennobledAt: 'Podbita o',
never: 'Nigdy',
action: {
linkToTWHelp: 'Akta wioski - TWHelp - nowa strona ze statystykami i narzędziami',
linkToTWHelp: 'Akta wioski (TWHelp)',
showEnnoblements: 'Pokaż przejęcia',
countIncomingSupport: 'Policz nadchodzące wsparcie'
}
@ -191,7 +191,7 @@ const translations = {
never: 'Never',
ennobledAt: 'Ennobled at',
action: {
linkToTWHelp: 'Village file (external link) - TWHelp - A new stat tracking website.',
linkToTWHelp: 'Village file (TWHelp)',
showEnnoblements: 'Show ennoblements',
countIncomingSupport: 'Count incoming support'
}
@ -732,43 +732,25 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.POPUP_SELECTOR = void 0;
const POPUP_WRAPPER_SELECTOR = '.popup_helper';
const POPUP_SELECTOR = '#inline_popup';
const POPUP_SELECTOR = '.popup_box';
exports.POPUP_SELECTOR = POPUP_SELECTOR;
var _default = function _default() {
const showPopup = function showPopup() {
let {
e,
title,
html,
id
id,
title
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
Dialog.show(id, "<h3>".concat(title, "</h3>") + html);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';
popupWrapper.style.position = 'fixed';
popupWrapper.style.zIndex = '50001';
}
};
var _default = showPopup;
exports.default = _default;
},{}],"vNT1":[function(require,module,exports) {
"use strict";
@ -887,7 +869,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @version 0.7.3
// @version 0.7.4
// @description Extended village profile
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_village*

View File

@ -165,43 +165,25 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.POPUP_SELECTOR = void 0;
const POPUP_WRAPPER_SELECTOR = '.popup_helper';
const POPUP_SELECTOR = '#inline_popup';
const POPUP_SELECTOR = '.popup_box';
exports.POPUP_SELECTOR = POPUP_SELECTOR;
var _default = function _default() {
const showPopup = function showPopup() {
let {
e,
title,
html,
id
id,
title
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
Dialog.show(id, "<h3>".concat(title, "</h3>") + html);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';
popupWrapper.style.position = 'fixed';
popupWrapper.style.zIndex = '50001';
}
};
var _default = showPopup;
exports.default = _default;
},{}],"DMkL":[function(require,module,exports) {
"use strict";
@ -462,7 +444,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @version 1.0.6
// @version 1.0.7
// @description Show the latest ennoblements
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Ph2E":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.API_URI=void 0;const e="https://api.tribalwarshelp.com/graphql";exports.API_URI=e;var r=function(){let{query:r,variables:t={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fetch(e,{method:"POST",body:JSON.stringify({query:r,variables:t}),headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{let{data:r,errors:t}=e;if(t&&Array.isArray(t)&&t.length>0)throw new Error(t[0].message);return new Promise(e=>e(r))})};exports.default=r;
},{}],"LNef":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const o={pl_PL:{loaded:"Załadowano",pop:"Populacja",mySupport:"Moje wsparcie",allySupport:"Wsparcie plemienia",total:"Łącznie",possibleLoyalty:"Prawdopodobne poparcie",ennobledAt:"Podbita o",never:"Nigdy",action:{linkToTWHelp:"Akta wioski - TWHelp - nowa strona ze statystykami i narzędziami",showEnnoblements:"Pokaż przejęcia",countIncomingSupport:"Policz nadchodzące wsparcie"}},en_DK:{loaded:"Loaded",pop:"Pop",mySupport:"My support",allySupport:"Ally support",total:"Total",possibleLoyalty:"Possible loyalty",never:"Never",ennobledAt:"Ennobled at",action:{linkToTWHelp:"Village file (external link) - TWHelp - A new stat tracking website.",showEnnoblements:"Show ennoblements",countIncomingSupport:"Count incoming support"}}};var e=()=>o[window.game_data.locale]||o.en_DK;exports.default=e;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const o={pl_PL:{loaded:"Załadowano",pop:"Populacja",mySupport:"Moje wsparcie",allySupport:"Wsparcie plemienia",total:"Łącznie",possibleLoyalty:"Prawdopodobne poparcie",ennobledAt:"Podbita o",never:"Nigdy",action:{linkToTWHelp:"Akta wioski (TWHelp)",showEnnoblements:"Pokaż przejęcia",countIncomingSupport:"Policz nadchodzące wsparcie"}},en_DK:{loaded:"Loaded",pop:"Pop",mySupport:"My support",allySupport:"Ally support",total:"Total",possibleLoyalty:"Possible loyalty",never:"Never",ennobledAt:"Ennobled at",action:{linkToTWHelp:"Village file (TWHelp)",showEnnoblements:"Show ennoblements",countIncomingSupport:"Count incoming support"}}};var e=()=>o[window.game_data.locale]||o.en_DK;exports.default=e;
},{}],"fCHX":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generatePaginationItems=exports.calcNumberOfPages=exports.getPage=exports.setPage=exports.getContainerStyles=void 0;const e="data-page",t=()=>"display: flex; flex-direction: row; flex-wrap: wrap;";exports.getContainerStyles=t;const r=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t instanceof HTMLElement)throw new Error("Expected HTMLElement as the first argument");if("number"!=typeof(r=parseInt(r))||isNaN(r))throw new Error("Expected number or string as the second argument");t.setAttribute(e,r+"")};exports.setPage=r;const n=t=>!t instanceof HTMLElement?0:parseInt(t.getAttribute(e));exports.getPage=n;const o=(e,t)=>{if("number"!=typeof e)throw new Error("Expected number as the first argument");if("number"!=typeof t)throw new Error("Expected number as the second argument");return e>0?Math.ceil(e/t):1};exports.calcNumberOfPages=o;const a=function(){let{total:t,limit:r,marginRight:n=3,currentPage:a=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=o(t,r),c=[];for(let o=1;o<=s;o++)o===a?c.push('<strong style="margin-right: '.concat(n,'px">>').concat(o,"<</strong>")):c.push('<a style="margin-right: '.concat(n,'px" href="#" ').concat(e,'="').concat(o,'">').concat(o,"</a>"));return c};exports.generatePaginationItems=a;
},{}],"DMkL":[function(require,module,exports) {
@ -35,7 +35,7 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
},{}],"tKRp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;const e={pl_PL:{date:"Data",newOwner:"Nowy właściciel",oldOwner:"Poprzedni właściciel",village:"Wioska",title:"Przejęcia"},en_DK:{date:"Date",newOwner:"New owner",oldOwner:"Old owner",village:"Village",title:"Ennoblements"}};var l=()=>e[window.game_data.locale]||e.en_DK;exports.default=l;
},{}],"chDM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.POPUP_SELECTOR=void 0;const e=".popup_helper",t="#inline_popup";exports.POPUP_SELECTOR=t;var o=function(){let{e:e,title:o,html:n,id:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const p=document.querySelector(t);p&&(p.style.width="auto",p.style.maxWidth="1000px"),p.classList.contains("show")?(p.querySelector("#inline_popup_title").innerHTML=o,p.querySelector("#inline_popup_content").innerHTML=n):inlinePopup(e,l,null,{offset_x:0,offset_y:0},n,o);const i=document.querySelector(".popup_helper");i&&(i.style.width="auto",i.style.position="fixed",i.style.zIndex="50001")};exports.default=o;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.POPUP_SELECTOR=void 0;const t=".popup_box";exports.POPUP_SELECTOR=".popup_box";const o=function(){let{html:t,id:o,title:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dialog.show(o,"<h3>".concat(e,"</h3>")+t);const p=document.querySelector(".popup_box");p&&(p.style.width="auto",p.style.maxWidth="1000px")};var e=o;exports.default=e;
},{}],"vNT1":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("../i18n/showEnnoblementsPopup")),t=require("../utils/pagination"),n=l(require("../utils/showPopup")),r=l(require("../utils/formatDate")),a=i(require("../utils/tribalwars"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=r?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}function l(e){return e&&e.__esModule?e:{default:e}}const c="ennoblementsPagination",u=(0,e.default)(),d=(e,t)=>e?'<td><a href="'.concat(a.buildPlayerURL(e.id),'">').concat(e.name," (").concat(t?'<a href="'.concat(a.buildTribeURL(t.id),'">').concat(t.tag,"</a>"):"-",")</a></td>"):"<td>-</td>";var s=function(e,o){let{limit:i=0,currentPage:l=1,onPageChange:s=(()=>{})}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const f=(0,t.generatePaginationItems)({total:o.total,limit:i,currentPage:l}),p='\n <div style="'.concat((0,t.getContainerStyles)(),'" id="').concat(c,'">\n ').concat(f.join(""),'\n </div>\n <table class="vis" style="border-collapse: separate; border-spacing: 2px; width: 100%;">\n <tbody>\n <tr>\n <th>\n ').concat(u.date,"\n </th>\n <th>\n ").concat(u.village,"\n </th>\n <th>\n ").concat(u.newOwner,"\n </th>\n <th>\n ").concat(u.oldOwner,"\n </th>\n </tr>\n ").concat(o.items.map(e=>{let t="<tr>"+"<td>".concat((0,r.default)(e.ennobledAt),"</td>");return e.village?t+='<td><a href="'.concat(a.buildVillageURL(e.village.id),'">').concat(a.buildVillageName(e.village.name,e.village.x,e.village.y),"</a></td>"):t+="<td>-</td>",t+=d(e.newOwner,e.newOwnerTribe),(t+=d(e.oldOwner,e.oldOwnerTribe))+"</tr>"}).join(""),"\n </tbody>\n </table>\n ");(0,n.default)({e:e,title:u.title,id:"ennoblements",html:p}),document.querySelectorAll("#ennoblementsPagination a").forEach(e=>{e.addEventListener("click",s)})};exports.default=s;
},{"../i18n/showEnnoblementsPopup":"tKRp","../utils/pagination":"fCHX","../utils/showPopup":"chDM","../utils/formatDate":"V6Mf","../utils/tribalwars":"fHHP"}],"UdfQ":[function(require,module,exports) {

View File

@ -1,7 +1,7 @@
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Ph2E":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.API_URI=void 0;const e="https://api.tribalwarshelp.com/graphql";exports.API_URI=e;var r=function(){let{query:r,variables:t={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fetch(e,{method:"POST",body:JSON.stringify({query:r,variables:t}),headers:{"Content-Type":"application/json"}}).then(e=>e.json()).then(e=>{let{data:r,errors:t}=e;if(t&&Array.isArray(t)&&t.length>0)throw new Error(t[0].message);return new Promise(e=>e(r))})};exports.default=r;
},{}],"chDM":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.POPUP_SELECTOR=void 0;const e=".popup_helper",t="#inline_popup";exports.POPUP_SELECTOR=t;var o=function(){let{e:e,title:o,html:n,id:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const p=document.querySelector(t);p&&(p.style.width="auto",p.style.maxWidth="1000px"),p.classList.contains("show")?(p.querySelector("#inline_popup_title").innerHTML=o,p.querySelector("#inline_popup_content").innerHTML=n):inlinePopup(e,l,null,{offset_x:0,offset_y:0},n,o);const i=document.querySelector(".popup_helper");i&&(i.style.width="auto",i.style.position="fixed",i.style.zIndex="50001")};exports.default=o;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.POPUP_SELECTOR=void 0;const t=".popup_box";exports.POPUP_SELECTOR=".popup_box";const o=function(){let{html:t,id:o,title:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dialog.show(o,"<h3>".concat(e,"</h3>")+t);const p=document.querySelector(".popup_box");p&&(p.style.width="auto",p.style.maxWidth="1000px")};var e=o;exports.default=e;
},{}],"DMkL":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=()=>window.location.host.split(".")[0];exports.default=e;
},{}],"V6Mf":[function(require,module,exports) {

File diff suppressed because one or more lines are too long

View File

@ -289,43 +289,25 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.POPUP_SELECTOR = void 0;
const POPUP_WRAPPER_SELECTOR = '.popup_helper';
const POPUP_SELECTOR = '#inline_popup';
const POPUP_SELECTOR = '.popup_box';
exports.POPUP_SELECTOR = POPUP_SELECTOR;
var _default = function _default() {
const showPopup = function showPopup() {
let {
e,
title,
html,
id
id,
title
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
Dialog.show(id, "<h3>".concat(title, "</h3>") + html);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';
popupWrapper.style.position = 'fixed';
popupWrapper.style.zIndex = '50001';
}
};
var _default = showPopup;
exports.default = _default;
},{}],"H9GS":[function(require,module,exports) {
"use strict";
@ -353,7 +335,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @version 0.3.1
// @version 0.3.2
// @description War stats generator
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=ranking*mode=wars*

View File

@ -25,7 +25,7 @@ import { setItem, getItem } from './utils/localStorage';
// @namespace https://github.com/tribalwarshelp/scripts
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @version 1.1.7
// @version 1.1.8
// @description Extended player profile
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player*
@ -306,7 +306,7 @@ const renderPlayerServers = (player) => {
.sort()
.map(
(server) =>
`<a target="_blank" rel="noopener noreferrer" style="margin-right: 5px" href="${twhelputils.buildPlayerURL(
`<a target="_blank" style="margin-right: 5px" href="${twhelputils.buildPlayerURL(
VERSION,
server,
player.id

View File

@ -25,7 +25,7 @@ import * as twutils from './utils/tribalwars';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @version 1.1.0
// @version 1.1.1
// @description Extended tribe profile
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_ally*
@ -327,7 +327,7 @@ const extendMembersData = (players) => {
td.innerHTML = data
.map(
({ link, label }) =>
`<a target="_blank" rel="noopener noreferrer" href="${link}">${label}</a>`
`<a target="_blank" href="${link}">${label}</a>`
)
.join('<br>');
}

View File

@ -17,7 +17,7 @@ import showEnnoblementsPopup from './common/showEnnoblementsPopup';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @version 0.7.3
// @version 0.7.4
// @description Extended village profile
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_village*

View File

@ -22,8 +22,7 @@ const translations = {
exportedVillages: 'Wyeksportowane wioski',
tribeChanges: 'Zmiany plemion',
action: {
linkToTWHelp:
'Akta gracza - TWHelp - nowa strona ze statystykami i narzędziami',
linkToTWHelp: 'Akta gracza (TWHelp)',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
exportVillages: 'Wyeksportuj wioski',
@ -54,8 +53,7 @@ const translations = {
exportedVillages: 'Exported villages',
tribeChanges: 'Tribe changes',
action: {
linkToTWHelp:
'User file (external link) - TWHelp - A new stat tracking website.',
linkToTWHelp: 'User file (TWHelp)',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
exportVillages: 'Export villages',

View File

@ -27,8 +27,7 @@ const translations = {
dailyGrowth: 'Dzienny przyrost',
playerLinks: 'Linki',
action: {
linkToTWHelp:
'Akta plemienia - TWHelp - nowa strona ze statystykami i narzędziami',
linkToTWHelp: 'Akta plemienia (TWHelp)',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
showMembersGrowth: 'Pokaż rozwój graczy',
@ -65,8 +64,7 @@ const translations = {
dailyGrowth: 'Daily growth',
playerLinks: 'Player links',
action: {
linkToTWHelp:
'Tribal file (external link) - TWHelp - A new stat tracking website.',
linkToTWHelp: 'Tribal file (TWHelp)',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
showMembersGrowth: 'Show members growth',

View File

@ -9,8 +9,7 @@ const translations = {
ennobledAt: 'Podbita o',
never: 'Nigdy',
action: {
linkToTWHelp:
'Akta wioski - TWHelp - nowa strona ze statystykami i narzędziami',
linkToTWHelp: 'Akta wioski (TWHelp)',
showEnnoblements: 'Pokaż przejęcia',
countIncomingSupport: 'Policz nadchodzące wsparcie',
},
@ -25,8 +24,7 @@ const translations = {
never: 'Never',
ennobledAt: 'Ennobled at',
action: {
linkToTWHelp:
'Village file (external link) - TWHelp - A new stat tracking website.',
linkToTWHelp: 'Village file (TWHelp)',
showEnnoblements: 'Show ennoblements',
countIncomingSupport: 'Count incoming support',
},

View File

@ -13,7 +13,7 @@ import loadTranslations from './i18n/latestEnnoblements';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @version 1.0.6
// @version 1.0.7
// @description Show the latest ennoblements
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*

View File

@ -1,24 +1,12 @@
const POPUP_WRAPPER_SELECTOR = '.popup_helper';
export const POPUP_SELECTOR = '#inline_popup';
export const POPUP_SELECTOR = '.popup_box';
export default ({ e, title, html, id } = {}) => {
const showPopup = ({ html, id, title } = {}) => {
Dialog.show(id, `<h3>${title}</h3>` + html);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, { offset_x: 0, offset_y: 0 }, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';
popupWrapper.style.position = 'fixed';
popupWrapper.style.zIndex = '50001';
}
};
export default showPopup;

View File

@ -10,7 +10,7 @@ import showPopup, { POPUP_SELECTOR } from './utils/showPopup';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @version 0.3.1
// @version 0.3.2
// @description War stats generator
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=ranking*mode=wars*