This repository has been archived on 2023-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
scripts-old/dist/quickbar/latestEnnoblements.js

1 line
8.3 KiB
JavaScript
Raw Normal View History

!function(){const e="https://api.tribalwarshelp.com/graphql";const n=".popup_box",t=function(){let{html:e,id:t,title:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dialog.show(t,"<h3>".concat(o,"</h3>")+e);const r=document.querySelector(n);r&&(r.style.width="auto",r.style.maxWidth="1000px")};const o=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const t=localStorage.getItem(e);let o=n;return t&&(o=JSON.parse(t)),o},r=(e,n)=>{localStorage.setItem(e,JSON.stringify(n))},i="tribalwarshelp.com",a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"https://".concat(e,".").concat(i,"/server/").concat(n)};var l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.substr(0,2)};const c={pl_PL:{showLatestEnnoblements:"Pokaż najnowsze przejęcia",village:"Wioska",newOwner:"Nowy właściciel",newOwnerTribe:"Plemię nowego właściciela",oldOwner:"Poprzedni właściciel",oldOwnerTribe:"Plemię poprzedniego właściciela",date:"Data",filters:"Filtry",apply:"Zastosuj",ennoblements:"Przejęcia",devNote:"Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :)."},en_DK:{showLatestEnnoblements:"Show latest ennoblements",village:"Village",newOwner:"New owner",newOwnerTribe:"New owner tribe",oldOwner:"Old owner",oldOwnerTribe:"Old owner tribe",filters:"Filters",date:"Date",apply:"Apply",ennoblements:"Ennoblements",devNote:"Information from the author - I've just launched a new stat tracking website, don't forget to check it out :)."},de_DE:{showLatestEnnoblements:"Zeige letzten Adelungen",village:"Dorf",newOwner:"Neuer Besitzer",newOwnerTribe:"Neuer Stamm",oldOwner:"Alter Besitzer",oldOwnerTribe:"Alter Stamm",filters:"Filter",date:"Datum",apply:"Anwenden",ennoblements:"Adelungen",devNote:"Information vom Entwickler - Ich habe eine neue Statistik-Website gestartet, vergiss nicht diese zu testen :)."}};function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){w(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function w(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}const m=window.location.host.split(".")[0],b="le_form",u="le_table",h="kiszkowaty_show_latest_ennoblements_cache",g="kiszkowaty_show_latest_ennoblements_filter",p={newOwner:"",newOwnerTribe:"",oldOwner:"",oldOwnerTribe:""},y=c[window.game_data.locale]||c.en_DK,O=()=>function(){let{query:n,variables:t={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return fetch(e,{method:"POST",body:JSON.stringify({query:n,variables:t}),headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{let{data:n,errors:t}=e;if(t&&Array.isArray(t)&&t.length>0)throw new Error(t[0].message);return new Promise((e=>e(n)))}))}({query:"\n query ennoblements($server: String!, $sort: [String!], $limit: Int) {\n ennoblements(server: $server, sort: $sort, limit: $limit) {\n items {\n newOwner {\n id\n name\n tribe {\n id\n name\n tag\n }\n }\n oldOwner {\n id\n name\n tribe {\n id\n name\n tag\n }\n }\n ennobledAt\n village {\n id\n name\n x\n y\n }\n }\n }\n }\n ",variables:{server:m,limit:50,sort:["ennobledAt DESC"]}}).then((e=>(function(){r(h,arguments.le