generic-skin 5.0.10 → 5.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1095,5 +1095,19 @@ const FNR = {
1095
1095
  timer = setTimeout(() => { func.apply(this, args); }, timeout);
1096
1096
  };
1097
1097
  },
1098
+ genMeassure: () => {
1099
+ [].forEach.call(document.querySelectorAll('.is-tweakeable'), (item) => {
1100
+ const width = item.offsetWidth - parseFloat(window.getComputedStyle(item, null).paddingLeft) - parseFloat(window.getComputedStyle(item, null).paddingRight) - parseFloat(window.getComputedStyle(item, null).borderLeftWidth) - parseFloat(window.getComputedStyle(item, null).borderRightWidth);
1101
+
1102
+ if (width > 0 && item.querySelector('.is-measurable').offsetWidth > 0) {
1103
+ let size = parseFloat(window.getComputedStyle(item, null).fontSize);
1104
+
1105
+ while (width < item.querySelector('.is-measurable').offsetWidth) {
1106
+ item.style.fontSize = size + 'px';
1107
+ size--;
1108
+ }
1109
+ }
1110
+ });
1111
+ }
1098
1112
  }
1099
1113
  };
@@ -1 +1 @@
1
- const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:async(e,t)=>{const n=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();i.push({name:t.text().trim(),url:Vue.filter("url-to-normal")(t.attr("href")),lastpost:{url:Vue.filter("url-to-normal")(n.children().last().attr("href")),date:n.text().split("por")[0].trim(),who:{name:n.find("strong a").length?n.find("strong a").text().trim():"Invitado",url:Vue.filter("url-to-normal")(n.find("strong a").length?n.find("strong a").attr("href"):"/"),color:n.find("strong a").length?n.find("strong a span").attr("style").split("color:")[1]:"initial"}},forum:{name:$(e).find(".row2 + .row2:not(.centered) a").text().trim(),url:Vue.filter("url-to-normal")($(e).find(".row2 + .row2:not(.centered) a").attr("href"))}})},r=async o=>{$.get(o,o=>($(o).find(".ipbform").find("tbody").find("tr").each(function(){i.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&n(this)}),i.length!==t&&$(o).find(".pagination")[0].children.length&&"b"!==$(o).find(".pagination").children().last()[0].localName?r($(o).find(".pagination").children().last().attr("href")):i))};await r("/latest?change_version=invision");let i=[];return i},getMembers:e=>new Promise((t,n)=>{let r=[];const i=(e,t)=>({user:$(e).find(".membername span").text().trim(),id:$(e).find(".popupmenu .popupmenu-item a").attr("href").split("?")[0],img:$(e).find(".mini-avatar img").attr("src"),color:t}),o=t=>{let n=[];return $(t).find(".member-list .member").each(function(){const t=FNR.utility.getGroup($(this).find(".membername span").attr("style").split("color:")[1]);e?n.push(i(this,t)):"unknown"!==t&&t!==forumConfig.skinOptions.adminGroup&&n.push(i(this,t))}),n},a=e=>{$.get(e,e=>{const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;r=r.concat(o(e)),n?a(n):t(r.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};a("/memberlist?change_version=invision")}),getGroups:e=>{const t=()=>new Promise((e,t)=>{$.get("/groups?change_version=invision",t=>{let n=[];$(t).find(".group_list > li").each(function(){n.push({id:parseInt($(this).find("a").attr("href").split("/g")[1].split("-")[0]),name:$(this).find("a").text().trim(),color:$(this).find("a").css("color"),url:Vue.filter("url-to-normal")($(this).find("a").attr("href")),count:parseInt($(this).find("div > span").text())-1})}),e(n)})}),n=()=>new Promise((n,r)=>{FNR.cache.useData("groups",e).then(e=>{n(e)},e=>{t().then(e=>{FNR.cache.setData("groups",e),n(e)})})});return n()},getAffiliates:()=>new Promise((e,t)=>{const n=forumConfig.affiliatesMax,r=Object.entries(forumAffiliates).map(e=>{let t="";const r=forumConfig.affiliatesSizes[e[0]];e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'" width="'+r.width+'" height="'+r.height+'"/></a></li>'});for(let i=0;i<n[e[0]]-e[1].length;i++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'" width="'+r.width+'" height="'+r.height+'"/></a></li>';return t});e({normal:r[0],elite:r[1],directory:r[2],sister:r[3]})})},content:{isAutosave:()=>void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t),post:{getPost:e=>new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const r=$(n).find("#p"+e.split("#")[1]);t({author:{text:r.find(".author a").text(),color:r.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(r.find(".author a").attr("href"))},content:r.find(".post-entry > div").html(),date:r.find(".author").html().split("</a>")[1]})})}),genPost:(e,t)=>new Promise((n,r)=>{let i=document.createElement("iframe");i.id="forum-save",i.src="/post?t="+e+"&mode=reply&change_version=invision",i.width=0,i.height=0,i.onload=(()=>{o.onload=(()=>{$("#forum-save").remove(),console.clear(),n(!0)}),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(t),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body").prepend(i);const o=document.querySelector("#forum-save")})},topic:{getType:e=>{const t=[];return e.indexOf("unread")>-1?t.push("is-unread"):t.push("is-read"),e.indexOf("locked")>-1?t.push("is-closed"):e.indexOf("sticky")>1?t.push("is-sticky"):e.indexOf("global_announce")>1?t.push("is-global-announcement"):e.indexOf("announce")>1&&t.push("is-announcement"),t},genTopic:(e,t,n)=>new Promise((r,i)=>{let o=document.createElement("iframe");o.id="forum-save",o.src="/post?f="+e+"&mode=newtopic&change_version=invision",o.width=0,o.height=0,o.onload=(()=>{a.onload=(()=>{$("#forum-save").remove(),console.clear(),r(!0)}),$("#forum-save").contents().find('dl dt:contains("Título del tema")').parent().find("input").val(t),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(n),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body").prepend(o);const a=document.querySelector("#forum-save")})}},user:{getUrl:e=>{let t=void 0!==e?Object.keys(window.localStorage).filter(t=>t.indexOf("userInfo")>-1&&window.localStorage[t].indexOf(`"name":"${e}"`)>-1).join().replace(`${forumData.prefix}_userInfo`,""):_userdata.user_id;return 0===t.length&&(t=encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A")),"/profile?mode=viewprofile&u="+t},getLevel:async()=>{switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}},getGroup:async()=>{const e=await FNR.user.getLevel();if("guest"===e)return"unknown";const{colour:t}=await FNR.user.getProfile(_userdata.user_id,.25);return t},getProfile:(e,t)=>{const n=null!=e?FNR.user.getUrl(e):FNR.user.getUrl(),r=t||5,i=e=>e.find("a").length?Vue.filter("url-to-normal")(e.find("a").attr("href")):e.find("table").length?e.find("table").html():e.find("img").length?e.find("img").attr("src"):e.find("textarea").length?e.find("textarea").val():e.find("span").length?e.find("span").text().trim():"-"===e.text().trim()?"":e.text(),o=()=>new Promise((e,t)=>{$.get(n+"&change_version=invision",t=>{let r={};r.name=$(t).find(".maintitle h1 span").text(),r.lastvisit=$(t).find('dt:contains("Última visita")').parent().find("dd").text(),r.colour=FNR.utility.getGroup($(t).find(".maintitle h1 span").css("color").replace("rgb(","rgb_").replace(/, /g,"_").replace(")","")),r.avatar=$(t).find(".real_avatar img").attr("src"),r.links={profile:"/u"+n.split("&u=")[1],mp:"/privmsg?mode=post&u="+n.split("&u=")[1]},r.messages={public:parseInt($(t).find('span:contains("Mensajes")').parent().parent().find("dd > div").text())||0,private:parseInt($(t).find('dt:contains("Mensajes privados")').parent().find("dd").text())||0},r.fields={},$(t).find('dl[id^="field_id"]').each(function(){if(""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;r.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:i($(this).find("dd .field_uneditable"))}}}),$(t).find(".ipbform2 > dl").each(function(){if($(this).find("dt span").length&&""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;r.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:i($(this).find("dd"))}}}),r.fields.rango={name:"Rango",content:$(t).find('dt:contains("Rango:")').parent().find("dd").text()},e(r)})}),a=e=>{const t=`userInfo${e}`;return new Promise((e,n)=>{FNR.cache.useData(t,r).then(t=>{e(t)},n=>{o().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return a(e)},changeAccount:async(e,t,n)=>{try{return await fetch(e),await fetch("/login",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`username=${encodeURIComponent(t)}&password=${encodeURIComponent(n)}&autologin=1&login=1`}),!0}catch(e){return console.error("Error inesperado",e),!1}},followed:{getPages:async()=>{try{const e=await fetch("/search?search_id=watchsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let i=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],o=parseInt(n.join(""))||0,a=r[1],l=a.href.split(a.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===o?0:o/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=watchsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=watchsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getFollowed:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{id:parseInt(t[7].children[0].value),name:t[1].querySelector(".topictitle").textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector(".topictitle").href),views:parseInt(t[5].textContent),replies:parseInt(t[3].textContent),type:FNR.content.topic.getType(t[0].querySelector("img").src).join(" ")}})}catch(e){return console.error("Error inesperado",e),!1}},delFollowed:async e=>{try{return await fetch("/search?search_id=watchsearch",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${e.map(e=>`&mark${encodeURIComponent("[]")}2=${e}`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},drafts:{delDrafts:async(e,t)=>{try{const n="draft"===e?"draft":"topic_draft";return await fetch(`/search?search_id=${e}search`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${t.map(e=>`&delete_${n}${encodeURIComponent(`[${e}]`)}=on`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}},messages:{getPages:async()=>{try{const e=await fetch("/search?search_id=draftsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let i=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],o=parseInt(n.join(""))||0,a=r[1],l=a.href.split(a.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===o?0:o/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=draftsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=draftsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getDrafts:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{topic:{name:t[1].textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector("a").href)},info:{location:t[2].textContent.trim(),date:t[3].textContent.trim()},modify:Vue.filter("url-to-normal")(t[4].querySelector("a").href)}})}catch(e){return console.error("Error inesperado",e),!1}}},topics:{getPages:async()=>{try{const e=await fetch("/search?search_id=topicdraftsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let i=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],o=parseInt(n.join(""))||0,a=r[1],l=a.href.split(a.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===o?0:o/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=topicdraftsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=topicdraftsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getDrafts:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{topic:{name:t[0].textContent.trim(),url:Vue.filter("url-to-normal")(t[0].querySelector("a").href)},info:{location:t[1].textContent.trim(),date:t[2].textContent.trim()},modify:Vue.filter("url-to-normal")(t[3].querySelector("a").href)}})}catch(e){return console.error("Error inesperado",e),!1}}}},profile:{getData:e=>new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const r=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const i=n;let o=[];[].forEach.call(e,e=>{let t="",n=[];switch(e.type){case"input":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("input").val();break;case"textarea":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("textarea").val();break;case"select":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("select option:selected").attr("value"),$(r).find('dl:contains("'+e.name+'")').find("dd").find("select option").each(function(){""!==$(this).attr("value")&&n.push({name:$(this).text(),value:$(this).attr("value")})});break;case"avatar":t=$(i).find(".box-content img").attr("src")}if("select"===e.type&&void 0===t||"select"===e.type&&""===t)return;let a={type:e.type,name:e.name,value:t};e.validation&&(a.validation=e.validation),n.length&&(a.options=n),o.push(a)}),t(o)})})}),setData:e=>new Promise((t,n)=>{const r=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let i=document.createElement("iframe");i.id="forum-save",i.src="/profile?change_version=invision&mode=editprofile",i.width=0,i.height=0,i.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),o.onload=(()=>{t?(o.onload=(()=>{o.onload=(()=>{r()}),$("#forum-save").contents().find('input[name="avatarremoteurl"]').val(t),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),o.src="/profile?change_version=invision&mode=editprofile&page_profil=avatars"):r()}),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),document.querySelector("body").prepend(i);const o=document.querySelector("#forum-save")})}},cache:{getData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content,setData:(e,t,n)=>{let r=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:r,content:t}))},delData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e),useData:async(e,t)=>{const n=localStorage.getItem(forumData.prefix+"_"+e),r=new Date,i=-1==t?"undefined":864e5*t;return null!=n&&-1==t||null!=n&&parseInt(JSON.parse(n).cached_at)+i>r.getTime()?JSON.parse(n).content:Promise.reject(!1)}},utility:{genSlug:(e,t)=>{const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,r=t.length;n<r;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},r=t||"_";return n(e).replace(/-/g,r)},genArray:e=>JSON.parse(e.replace(/`/g,'"')),genValidation:e=>{let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getGroup:e=>{const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)}},html:{genModal:(e,t,n)=>{if(""===e||null==e)return;if(""===t||null==t)return;let r=document.createElement("div");r.id="forum-modal",document.body.appendChild(r);let i="";i+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',i+='<div class="modal-title">',i+="<h3>"+e+"</h3>",i+='<a onclick="document.querySelector(`#forum-modal`).remove()">',i+='<i class="fas fa-times"></i>',i+="</a>",i+="</div>",i+='<div class="modal-content">',i+='<div class="is-content">',i+=t.replace(/\n/g,"<br>"),i+="</div>",""!==n&&null!=n&&(i+='<div class="modal-buttons">',i+=n,i+="</div>"),i+="</div>",i+="</div>",i+='<div class="is-bgmodal bg-active" onclick="document.querySelector(`#forum-modal`).remove()"></div>',document.querySelector("#forum-modal").innerHTML=i},genPrompt:(e,t,n,r)=>{if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((i,o)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+r+'"></p>','<button id="modal-button-enter" class="button1 btn-main">Confirmar</button><button id="modal-button-cancel" class="button1">Cancelar</button>'),document.querySelector("#modal-button-enter").onclick=(()=>{const e=document.querySelector("#modal-prompt").value;i(""!==e&&e),document.querySelector("#forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{o(!1),document.querySelector("#forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{o(!1),document.querySelector("#forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{o(!1),document.querySelector("#forum-modal").remove()})})},genNotification:(e,t,n,r)=>{if(""===e||null==e)return;if(""===t||null==t)return;if(t.length>50)return;if(""===n||null==n)return;document.querySelectorAll("forum-notification").length&&(document.querySelector("#forum-notification").remove(),clearTimeout());let i=document.createElement("div");i.id="forum-notification",document.body.appendChild(i);let o="";o+=""===r||null==r?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+r+'" target="_blank" id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >',o+='<div class="notification-icon">',o+='<i class="'+n+'"></i>',o+="</div>",o+='<div class="notification-content">',o+="<h3>"+e+"</h3>",o+="<p>"+t+"</p>",o+="</div>",o+='<div class="notification-controls">',o+='<i class="fas fa-times"></i>',o+="</div>",o+=""===r||null==r?"</div>":"</a>",document.querySelector("#forum-notification").innerHTML=o,setTimeout(()=>{document.querySelector("#forum-notification").classList.add("notification-show")},250),setTimeout(()=>{document.querySelector("#forum-notification").classList.remove("notification-show")},8e3),setTimeout(()=>{document.querySelector("#forum-notification").remove()},1e4)}},behaviour:{genWiki:()=>{document.querySelector(".wiki-cascade")&&[].forEach.call(document.getElementsByClassName("wiki-cascade"),e=>{e.onclick=(()=>{const t=e.parentElement.parentElement;t.classList.contains("is-active")?t.classList.remove("is-active"):t.classList.add("is-active")})}),document.querySelector(".wiki-controls .router-link-active")&&[].forEach.call(document.querySelectorAll(".wiki-controls .router-link-active"),e=>{if(!e.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains("wiki-index")){const t=(e,n)=>{let r=e.parentElement.parentElement;n&&(r=r.parentElement.parentElement),r.classList.add("is-active"),r.classList.add("is-selected"),r.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(r,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:()=>{document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})},genControls:()=>{document.querySelector(".forum-controls")&&[].forEach.call(document.querySelectorAll(".forum-controls"),e=>{let t=0;[].forEach.call(e.children,e=>{"none"!==window.getComputedStyle(e,null).display&&(t+=e.children.length)}),0===t&&!1===e.classList.contains("not-show")&&e.classList.add("not-show")})},genDebounce:(e,t=750)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}}};
1
+ const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:async(e,t)=>{const n=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();o.push({name:t.text().trim(),url:Vue.filter("url-to-normal")(t.attr("href")),lastpost:{url:Vue.filter("url-to-normal")(n.children().last().attr("href")),date:n.text().split("por")[0].trim(),who:{name:n.find("strong a").length?n.find("strong a").text().trim():"Invitado",url:Vue.filter("url-to-normal")(n.find("strong a").length?n.find("strong a").attr("href"):"/"),color:n.find("strong a").length?n.find("strong a span").attr("style").split("color:")[1]:"initial"}},forum:{name:$(e).find(".row2 + .row2:not(.centered) a").text().trim(),url:Vue.filter("url-to-normal")($(e).find(".row2 + .row2:not(.centered) a").attr("href"))}})},r=async i=>{$.get(i,i=>($(i).find(".ipbform").find("tbody").find("tr").each(function(){o.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&n(this)}),o.length!==t&&$(i).find(".pagination")[0].children.length&&"b"!==$(i).find(".pagination").children().last()[0].localName?r($(i).find(".pagination").children().last().attr("href")):o))};await r("/latest?change_version=invision");let o=[];return o},getMembers:e=>new Promise((t,n)=>{let r=[];const o=(e,t)=>({user:$(e).find(".membername span").text().trim(),id:$(e).find(".popupmenu .popupmenu-item a").attr("href").split("?")[0],img:$(e).find(".mini-avatar img").attr("src"),color:t}),i=t=>{let n=[];return $(t).find(".member-list .member").each(function(){const t=FNR.utility.getGroup($(this).find(".membername span").attr("style").split("color:")[1]);e?n.push(o(this,t)):"unknown"!==t&&t!==forumConfig.skinOptions.adminGroup&&n.push(o(this,t))}),n},a=e=>{$.get(e,e=>{const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;r=r.concat(i(e)),n?a(n):t(r.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};a("/memberlist?change_version=invision")}),getGroups:e=>{const t=()=>new Promise((e,t)=>{$.get("/groups?change_version=invision",t=>{let n=[];$(t).find(".group_list > li").each(function(){n.push({id:parseInt($(this).find("a").attr("href").split("/g")[1].split("-")[0]),name:$(this).find("a").text().trim(),color:$(this).find("a").css("color"),url:Vue.filter("url-to-normal")($(this).find("a").attr("href")),count:parseInt($(this).find("div > span").text())-1})}),e(n)})}),n=()=>new Promise((n,r)=>{FNR.cache.useData("groups",e).then(e=>{n(e)},e=>{t().then(e=>{FNR.cache.setData("groups",e),n(e)})})});return n()},getAffiliates:()=>new Promise((e,t)=>{const n=forumConfig.affiliatesMax,r=Object.entries(forumAffiliates).map(e=>{let t="";const r=forumConfig.affiliatesSizes[e[0]];e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'" width="'+r.width+'" height="'+r.height+'"/></a></li>'});for(let o=0;o<n[e[0]]-e[1].length;o++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'" width="'+r.width+'" height="'+r.height+'"/></a></li>';return t});e({normal:r[0],elite:r[1],directory:r[2],sister:r[3]})})},content:{isAutosave:()=>void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t),post:{getPost:e=>new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const r=$(n).find("#p"+e.split("#")[1]);t({author:{text:r.find(".author a").text(),color:r.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(r.find(".author a").attr("href"))},content:r.find(".post-entry > div").html(),date:r.find(".author").html().split("</a>")[1]})})}),genPost:(e,t)=>new Promise((n,r)=>{let o=document.createElement("iframe");o.id="forum-save",o.src="/post?t="+e+"&mode=reply&change_version=invision",o.width=0,o.height=0,o.onload=(()=>{i.onload=(()=>{$("#forum-save").remove(),console.clear(),n(!0)}),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(t),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body").prepend(o);const i=document.querySelector("#forum-save")})},topic:{getType:e=>{const t=[];return e.indexOf("unread")>-1?t.push("is-unread"):t.push("is-read"),e.indexOf("locked")>-1?t.push("is-closed"):e.indexOf("sticky")>1?t.push("is-sticky"):e.indexOf("global_announce")>1?t.push("is-global-announcement"):e.indexOf("announce")>1&&t.push("is-announcement"),t},genTopic:(e,t,n)=>new Promise((r,o)=>{let i=document.createElement("iframe");i.id="forum-save",i.src="/post?f="+e+"&mode=newtopic&change_version=invision",i.width=0,i.height=0,i.onload=(()=>{a.onload=(()=>{$("#forum-save").remove(),console.clear(),r(!0)}),$("#forum-save").contents().find('dl dt:contains("Título del tema")').parent().find("input").val(t),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(n),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body").prepend(i);const a=document.querySelector("#forum-save")})}},user:{getUrl:e=>{let t=void 0!==e?Object.keys(window.localStorage).filter(t=>t.indexOf("userInfo")>-1&&window.localStorage[t].indexOf(`"name":"${e}"`)>-1).join().replace(`${forumData.prefix}_userInfo`,""):_userdata.user_id;return 0===t.length&&(t=encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A")),"/profile?mode=viewprofile&u="+t},getLevel:async()=>{switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}},getGroup:async()=>{const e=await FNR.user.getLevel();if("guest"===e)return"unknown";const{colour:t}=await FNR.user.getProfile(_userdata.user_id,.25);return t},getProfile:(e,t)=>{const n=null!=e?FNR.user.getUrl(e):FNR.user.getUrl(),r=t||5,o=e=>e.find("a").length?Vue.filter("url-to-normal")(e.find("a").attr("href")):e.find("table").length?e.find("table").html():e.find("img").length?e.find("img").attr("src"):e.find("textarea").length?e.find("textarea").val():e.find("span").length?e.find("span").text().trim():"-"===e.text().trim()?"":e.text(),i=()=>new Promise((e,t)=>{$.get(n+"&change_version=invision",t=>{let r={};r.name=$(t).find(".maintitle h1 span").text(),r.lastvisit=$(t).find('dt:contains("Última visita")').parent().find("dd").text(),r.colour=FNR.utility.getGroup($(t).find(".maintitle h1 span").css("color").replace("rgb(","rgb_").replace(/, /g,"_").replace(")","")),r.avatar=$(t).find(".real_avatar img").attr("src"),r.links={profile:"/u"+n.split("&u=")[1],mp:"/privmsg?mode=post&u="+n.split("&u=")[1]},r.messages={public:parseInt($(t).find('span:contains("Mensajes")').parent().parent().find("dd > div").text())||0,private:parseInt($(t).find('dt:contains("Mensajes privados")').parent().find("dd").text())||0},r.fields={},$(t).find('dl[id^="field_id"]').each(function(){if(""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;r.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:o($(this).find("dd .field_uneditable"))}}}),$(t).find(".ipbform2 > dl").each(function(){if($(this).find("dt span").length&&""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;r.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:o($(this).find("dd"))}}}),r.fields.rango={name:"Rango",content:$(t).find('dt:contains("Rango:")').parent().find("dd").text()},e(r)})}),a=e=>{const t=`userInfo${e}`;return new Promise((e,n)=>{FNR.cache.useData(t,r).then(t=>{e(t)},n=>{i().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return a(e)},changeAccount:async(e,t,n)=>{try{return await fetch(e),await fetch("/login",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`username=${encodeURIComponent(t)}&password=${encodeURIComponent(n)}&autologin=1&login=1`}),!0}catch(e){return console.error("Error inesperado",e),!1}},followed:{getPages:async()=>{try{const e=await fetch("/search?search_id=watchsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let o=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],i=parseInt(n.join(""))||0,a=r[1],l=a.href.split(a.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===i?0:i/c;o=Array(d).fill(null).map((e,t)=>`/search?search_id=watchsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=watchsearch&change_version=invision",...o]}}catch(e){return console.error("Error inesperado",e),!1}},getFollowed:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{id:parseInt(t[7].children[0].value),name:t[1].querySelector(".topictitle").textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector(".topictitle").href),views:parseInt(t[5].textContent),replies:parseInt(t[3].textContent),type:FNR.content.topic.getType(t[0].querySelector("img").src).join(" ")}})}catch(e){return console.error("Error inesperado",e),!1}},delFollowed:async e=>{try{return await fetch("/search?search_id=watchsearch",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${e.map(e=>`&mark${encodeURIComponent("[]")}2=${e}`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},drafts:{delDrafts:async(e,t)=>{try{const n="draft"===e?"draft":"topic_draft";return await fetch(`/search?search_id=${e}search`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${t.map(e=>`&delete_${n}${encodeURIComponent(`[${e}]`)}=on`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}},messages:{getPages:async()=>{try{const e=await fetch("/search?search_id=draftsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let o=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],i=parseInt(n.join(""))||0,a=r[1],l=a.href.split(a.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===i?0:i/c;o=Array(d).fill(null).map((e,t)=>`/search?search_id=draftsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=draftsearch&change_version=invision",...o]}}catch(e){return console.error("Error inesperado",e),!1}},getDrafts:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{topic:{name:t[1].textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector("a").href)},info:{location:t[2].textContent.trim(),date:t[3].textContent.trim()},modify:Vue.filter("url-to-normal")(t[4].querySelector("a").href)}})}catch(e){return console.error("Error inesperado",e),!1}}},topics:{getPages:async()=>{try{const e=await fetch("/search?search_id=topicdraftsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let o=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],i=parseInt(n.join(""))||0,a=r[1],l=a.href.split(a.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===i?0:i/c;o=Array(d).fill(null).map((e,t)=>`/search?search_id=topicdraftsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=topicdraftsearch&change_version=invision",...o]}}catch(e){return console.error("Error inesperado",e),!1}},getDrafts:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{topic:{name:t[0].textContent.trim(),url:Vue.filter("url-to-normal")(t[0].querySelector("a").href)},info:{location:t[1].textContent.trim(),date:t[2].textContent.trim()},modify:Vue.filter("url-to-normal")(t[3].querySelector("a").href)}})}catch(e){return console.error("Error inesperado",e),!1}}}},profile:{getData:e=>new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const r=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const o=n;let i=[];[].forEach.call(e,e=>{let t="",n=[];switch(e.type){case"input":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("input").val();break;case"textarea":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("textarea").val();break;case"select":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("select option:selected").attr("value"),$(r).find('dl:contains("'+e.name+'")').find("dd").find("select option").each(function(){""!==$(this).attr("value")&&n.push({name:$(this).text(),value:$(this).attr("value")})});break;case"avatar":t=$(o).find(".box-content img").attr("src")}if("select"===e.type&&void 0===t||"select"===e.type&&""===t)return;let a={type:e.type,name:e.name,value:t};e.validation&&(a.validation=e.validation),n.length&&(a.options=n),i.push(a)}),t(i)})})}),setData:e=>new Promise((t,n)=>{const r=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let o=document.createElement("iframe");o.id="forum-save",o.src="/profile?change_version=invision&mode=editprofile",o.width=0,o.height=0,o.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),i.onload=(()=>{t?(i.onload=(()=>{i.onload=(()=>{r()}),$("#forum-save").contents().find('input[name="avatarremoteurl"]').val(t),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),i.src="/profile?change_version=invision&mode=editprofile&page_profil=avatars"):r()}),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),document.querySelector("body").prepend(o);const i=document.querySelector("#forum-save")})}},cache:{getData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content,setData:(e,t,n)=>{let r=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:r,content:t}))},delData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e),useData:async(e,t)=>{const n=localStorage.getItem(forumData.prefix+"_"+e),r=new Date,o=-1==t?"undefined":864e5*t;return null!=n&&-1==t||null!=n&&parseInt(JSON.parse(n).cached_at)+o>r.getTime()?JSON.parse(n).content:Promise.reject(!1)}},utility:{genSlug:(e,t)=>{const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,r=t.length;n<r;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},r=t||"_";return n(e).replace(/-/g,r)},genArray:e=>JSON.parse(e.replace(/`/g,'"')),genValidation:e=>{let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getGroup:e=>{const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)}},html:{genModal:(e,t,n)=>{if(""===e||null==e)return;if(""===t||null==t)return;let r=document.createElement("div");r.id="forum-modal",document.body.appendChild(r);let o="";o+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',o+='<div class="modal-title">',o+="<h3>"+e+"</h3>",o+='<a onclick="document.querySelector(`#forum-modal`).remove()">',o+='<i class="fas fa-times"></i>',o+="</a>",o+="</div>",o+='<div class="modal-content">',o+='<div class="is-content">',o+=t.replace(/\n/g,"<br>"),o+="</div>",""!==n&&null!=n&&(o+='<div class="modal-buttons">',o+=n,o+="</div>"),o+="</div>",o+="</div>",o+='<div class="is-bgmodal bg-active" onclick="document.querySelector(`#forum-modal`).remove()"></div>',document.querySelector("#forum-modal").innerHTML=o},genPrompt:(e,t,n,r)=>{if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((o,i)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+r+'"></p>','<button id="modal-button-enter" class="button1 btn-main">Confirmar</button><button id="modal-button-cancel" class="button1">Cancelar</button>'),document.querySelector("#modal-button-enter").onclick=(()=>{const e=document.querySelector("#modal-prompt").value;o(""!==e&&e),document.querySelector("#forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{i(!1),document.querySelector("#forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{i(!1),document.querySelector("#forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{i(!1),document.querySelector("#forum-modal").remove()})})},genNotification:(e,t,n,r)=>{if(""===e||null==e)return;if(""===t||null==t)return;if(t.length>50)return;if(""===n||null==n)return;document.querySelectorAll("forum-notification").length&&(document.querySelector("#forum-notification").remove(),clearTimeout());let o=document.createElement("div");o.id="forum-notification",document.body.appendChild(o);let i="";i+=""===r||null==r?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+r+'" target="_blank" id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >',i+='<div class="notification-icon">',i+='<i class="'+n+'"></i>',i+="</div>",i+='<div class="notification-content">',i+="<h3>"+e+"</h3>",i+="<p>"+t+"</p>",i+="</div>",i+='<div class="notification-controls">',i+='<i class="fas fa-times"></i>',i+="</div>",i+=""===r||null==r?"</div>":"</a>",document.querySelector("#forum-notification").innerHTML=i,setTimeout(()=>{document.querySelector("#forum-notification").classList.add("notification-show")},250),setTimeout(()=>{document.querySelector("#forum-notification").classList.remove("notification-show")},8e3),setTimeout(()=>{document.querySelector("#forum-notification").remove()},1e4)}},behaviour:{genWiki:()=>{document.querySelector(".wiki-cascade")&&[].forEach.call(document.getElementsByClassName("wiki-cascade"),e=>{e.onclick=(()=>{const t=e.parentElement.parentElement;t.classList.contains("is-active")?t.classList.remove("is-active"):t.classList.add("is-active")})}),document.querySelector(".wiki-controls .router-link-active")&&[].forEach.call(document.querySelectorAll(".wiki-controls .router-link-active"),e=>{if(!e.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains("wiki-index")){const t=(e,n)=>{let r=e.parentElement.parentElement;n&&(r=r.parentElement.parentElement),r.classList.add("is-active"),r.classList.add("is-selected"),r.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(r,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:()=>{document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})},genControls:()=>{document.querySelector(".forum-controls")&&[].forEach.call(document.querySelectorAll(".forum-controls"),e=>{let t=0;[].forEach.call(e.children,e=>{"none"!==window.getComputedStyle(e,null).display&&(t+=e.children.length)}),0===t&&!1===e.classList.contains("not-show")&&e.classList.add("not-show")})},genDebounce:(e,t=750)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}},genMeassure:()=>{[].forEach.call(document.querySelectorAll(".is-tweakeable"),e=>{const t=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).paddingLeft)-parseFloat(window.getComputedStyle(e,null).paddingRight)-parseFloat(window.getComputedStyle(e,null).borderLeftWidth)-parseFloat(window.getComputedStyle(e,null).borderRightWidth);if(t>0&&e.querySelector(".is-measurable").offsetWidth>0){let n=parseFloat(window.getComputedStyle(e,null).fontSize);for(;t<e.querySelector(".is-measurable").offsetWidth;)e.style.fontSize=n+"px",n--}})}}};
package/general.js CHANGED
@@ -722,18 +722,7 @@ document.addEventListener('forumReady', () => {
722
722
  document.addEventListener('forumReady', () => {
723
723
  if (document.querySelector('.is-tweakeable')) {
724
724
  document.fonts.ready.then(() => {
725
- [].forEach.call(document.querySelectorAll('.is-tweakeable'), (item) => {
726
- const width = item.offsetWidth - parseFloat(window.getComputedStyle(item, null).paddingLeft) - parseFloat(window.getComputedStyle(item, null).paddingRight) - parseFloat(window.getComputedStyle(item, null).borderLeftWidth) - parseFloat(window.getComputedStyle(item, null).borderRightWidth);
727
-
728
- if (width > 0 && item.querySelector('.is-measurable').offsetWidth > 0) {
729
- let size = parseFloat(window.getComputedStyle(item, null).fontSize);
730
-
731
- while (width < item.querySelector('.is-measurable').offsetWidth) {
732
- item.style.fontSize = size + 'px';
733
- size--;
734
- }
735
- }
736
- });
725
+ FNR.behaviour.genMeassure();
737
726
  });
738
727
  }
739
728
  });
package/general.min.js CHANGED
@@ -1 +1 @@
1
- console.log("%cFNR Engine por %cGaylien 🏳️‍🌈","font-family: sans-serif; font-size: 1.5em","font-size: 1.5em; text-transform: uppercase; font-weight: 800; color: #c381b9;"),console.log("https://zatrapa-gaylien.tumblr.com/"),document.addEventListener("DOMContentLoaded",async()=>{const[e,t]=await Promise.all([FNR.user.getLevel(),FNR.user.getGroup()]),o=window.screen.width<=1023?"touch":"desktop";document.body.classList.add(`is-${o}`),document.body.classList.add(`is-${e}`),document.body.classList.add(`is-${t}`),"guest"!==e&&document.body.classList.add(`is-user${_userdata.user_id}`)}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.querySelectorAll(".lastpost-content"),e=>{let t,o,r;e.querySelector(".color-groups")?(t=e.querySelector(".color-groups"),o=t.outerHTML.split(t.innerHTML),r=t.textContent,t.outerHTML='<strong><a href="'+FNR.user.getUrl(r)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+r+'»">'+o[0]+Vue.filter("just-name")(r)+o[1]+"</a></strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=r)):(e.querySelector(".forum-last-author").innerHTML="<strong>Invitado</strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado")),e.querySelector(".forum-last-author").outerHTML=e.querySelector(".forum-last-author > strong").outerHTML}):-1!==_userdata.user_id&&document.querySelector(".lastpost-content")&&[].forEach.call(document.querySelectorAll(".lastpost-content"),e=>{let t="<strong>Invitado</strong>";e.querySelector(".forum-last-author > strong")?(t=e.querySelector(".forum-last-author > strong > a"),t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+"»",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=t.textContent),t.querySelector("span").textContent=Vue.filter("just-name")(t.textContent),t="<strong>"+t.outerHTML+"</strong>",t.textContent=Vue.filter("just-name")(t.textContent)):e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado"),e.querySelector(".forum-last-author").outerHTML=t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-last-date")&&[].forEach.call(document.querySelectorAll(".lastpost-content"),e=>{const t=e.querySelector(".forum-last-date").textContent;e.querySelector(".lastpost-link").title+=", "+t,e.querySelector(".forum-last-date").outerHTML=t,e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-topic)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-topic)"),e=>{[].forEach.call(FNR.content.topic.getType(e.querySelector(".topiclist-topic .to-process .topic-status").textContent),t=>{e.classList.add(t)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;let n=FNR.user.getUrl(t.textContent);if(t.querySelector(".gensmall")&&(n=t.querySelector(".gensmall").href),e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")){const o=e.querySelector(".topic-lastauthor");t.querySelector("span")?(t.innerHTML='<strong><a href="'+n+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">'+t.querySelector("span").outerHTML+"</a></strong>",t.querySelector("strong strong").textContent=Vue.filter("just-name")(t.querySelector("strong strong").textContent),t.querySelector(".color-groups").innerHTML=t.querySelector(".color-groups").textContent,o.outerHTML=t.innerHTML):o.outerHTML="<strong>Invitado</strong>",o.outerHTML=o.innerHTML}if(e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r),e.querySelector(".topic-lastavatar")){let o;o="",o+='<a class="topic-lastavatar" href="'+n+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">',o+=e.querySelector(".topic-lastavatar").innerHTML,o+="</a>",e.querySelector(".topic-lastavatar").outerHTML=o}})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#moderation")&&document.querySelector("#moderation a")?document.querySelector('a[href="#gestionar"]').href=document.querySelector("#moderation a").href:document.querySelector("#moderation")&&document.querySelector('a[href="#gestionar"]').parentElement.remove()}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".prev-post")){let e=document.querySelector("#forum-preview");""!==document.querySelectorAll(".prev-post")[0].innerHTML&&(e.querySelector(".post-content").innerHTML='<div class="is-content">'+document.querySelectorAll(".prev-post")[0].innerHTML+"</div>",e.classList.remove("to-process"))}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-otherposts")&&document.querySelector(".forum-otherposts").children.length){let e="";[].forEach.call(document.querySelector(".forum-otherposts").querySelectorAll(".post"),t=>{if(document.querySelector(".mp-main")&&document.querySelector("#forum-reply")){let o=t.querySelector(".mp-from").textContent,r=FNR.utility.getGroup("rgb_"+t.querySelector(".mp-from > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_")),n=t.querySelector(".mp-date").textContent,l=t.querySelector(".is-content").innerHTML;e+='<li class="post post-mp">',e+='<section class="postlist-post usergroup-'+r+'">',e+='<ul class="post-datafields post-profile profile-sticky">',e+='<li class="datafield-user">',e+='<div class="datafield-name">Usuario</div>',e+='<strong><a href="'+FNR.user.getUrl(o)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+o+'»">'+o+"</a></strong>",e+="</li>",e+='<li class="datafield-date">',e+='<div class="datafield-name">Fecha</div>',e+=n.indexOf("el")>-1?n.split("el ")[1]:n,e+="</li>",e+="</ul>",e+='<div class="post-content no-links">',e+='<div class="is-content">',e+=l,e+="</div>",e+="</div>",e+="</section>",e+="</li>"}else document.querySelector("#mp-body")||(t.querySelector(".post-datafields .datafield-user a > span")?(t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("rgb_"+t.querySelector(".post-datafields .datafield-user a > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_"))),t.querySelector(".post-datafields .datafield-user a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.querySelector(".post-datafields .datafield-user a").textContent+"»",t.querySelector(".post-datafields .datafield-user a").target="_blank",""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").href=FNR.user.getUrl(t.querySelector(".post-datafields .datafield-user a").textContent))):t.querySelector(".post-datafields .datafield-check")&&t.querySelector(".post-datafields .datafield-check").children&&1===t.querySelector(".post-datafields .datafield-check").children.length?t.querySelector(".post-datafields .datafield-check").remove():t.querySelector(".post-datafields .datafield-user a")&&""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").outerHTML="<strong>"+t.querySelector(".post-datafields .datafield-user a").innerHTML+"</strong>",t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null"))),"UsuarioAnonymous"===t.querySelector(".post-datafields .datafield-user").textContent&&t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null")))}),document.querySelector(".mp-main")&&document.querySelector("#forum-reply")&&(document.querySelector(".forum-otherposts").innerHTML=e)}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-postlist .post:not(.panel)")){const e={responder_citando:{icon:"fas fa-quote-right",title:"Citar"},editar_borrar_este_mensaje:{icon:"fas fa-pencil-alt",title:"Editar"},borrar_este_mensaje:{icon:"fas fa-trash-alt",title:"Borrar"},ver_la_direccion_ip_del_autor:{icon:"fas fa-map-marker-alt",title:"Ver IP"},permalink:{icon:"fas fa-tag",title:"Enlace permanente"}};[].forEach.call(document.querySelectorAll(".forum-postlist .post"),t=>{if(t.children.length>1){let o="";[].forEach.call(t.querySelectorAll(".to-process .post-icons li a"),t=>{const r=e[FNR.utility.genSlug(t.querySelector("img").title)];o+='<li class="post-button post-button-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'">',o+='<i class="'+r.icon+'"></i>',o+="<span>"+("Enlace permanente"===r.title?"Permalink":r.title)+"</span>",o+="</a>",o+="</li>"}),t.querySelector(".post-buttons").innerHTML=o}else t.remove()})}}),document.addEventListener("DOMContentLoaded",()=>{null!==document.querySelector("#forum-realreply")&&""===document.querySelector("#forum-realreply").innerHTML&&document.querySelector("#quickreply-section").remove()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector('img[title="Citar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Citar mensaje"]'),e=>{let t=e.parentElement;t.title="Citar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Citar el Mensaje"}),document.querySelector('img[title="Editar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Editar mensaje"]'),e=>{let t=e.parentElement;t.title="Editar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Editar el Mensaje"})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mp-from")&&[].forEach.call(document.querySelectorAll(".mp-from"),e=>{const t=FNR.utility.getGroup(e.querySelector("span").style.color.replace(/, /g,"_").replace(/, /g,"_").replace(/\(/g,"_").replace(/\)/g,""));e.innerHTML='<a href="'+FNR.user.getUrl(e.textContent)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.textContent+"</a>";let o=e.parentElement;for(;!o.classList.contains("mp-main");)o=o.parentElement;o.classList.add("usergroup-"+t)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#breadcrumbs")&&document.querySelector("#forum-breadcrumb")&&[].forEach.call(document.querySelector("#breadcrumbs").children,(e,t,o)=>{let r=e.href,n=Vue.filter("mini-sanitize")(e.text),l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const getPageInfo=()=>{const e=Array.from(document.querySelectorAll("#pagination > span > *:not(.pag-img):not(.page-sep)"));return e.length?{currentPage:parseInt(document.querySelector("#pagination > span > strong").textContent),totalPages:parseInt(e[e.length-1].textContent)}:{currentPage:1,totalPages:1}},pageData=getPageInfo(),leftButton=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),rightButton=document.querySelector(".pag-img .sprite-arrow_prosilver_right");leftButton&&(leftButton.parentElement.title="Ir a la página anterior",leftButton.parentElement.classList.add("page-prev"),leftButton.parentElement.classList.remove("pag-img"),leftButton.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),rightButton&&(rightButton.parentElement.title="Ir a la página siguiente",rightButton.parentElement.classList.add("page-next"),rightButton.parentElement.classList.remove("pag-img"),rightButton.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>');const nextPage=document.querySelector(".page-next"),prevPage=document.querySelector(".page-prev"),pagination=`\n <div class="pagination-manager">\n ${null===prevPage?"":`<div class="page-action">${prevPage.outerHTML}</div>`}\n <form class="pagination-input" name="go_page">\n <input type="text" placeholder="${pageData.currentPage}" />de ${pageData.totalPages}\n </form>\n ${null===nextPage?"":`<div class="page-action">${nextPage.outerHTML}</div>`}\n </div>\n `;[].forEach.call(document.querySelectorAll(".page-pagination"),item=>{item.insertAdjacentHTML("afterbegin",pagination);const formSelector=item.querySelector(".pagination-input"),inputSelector=item.querySelector(".pagination-input input");inputSelector.onkeyup=FNR.behaviour.genDebounce(()=>{null===inputSelector.value.match(/[a-zA-Z]+/g)&&""!==inputSelector.value.trim()&&eval(do_pagination_start.toString().replace("document.go_page.start.value","inputSelector.value").split("{")[1].split("}")[0])}),item.parentElement.classList.contains("not-show")&&item.parentElement.classList.remove("not-show")})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{1!==e.classList.length&&e.classList.remove("codebox")}),document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{const t=e.querySelector("code").innerHTML.trim();e.querySelector("dt").innerHTML='Código <em>-</em> <span class="is-pointer">Copiar</span>',e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-code"></i></div>'),e.querySelector("code").remove(),e.insertAdjacentHTML("beforeend","<code>"+t+"</code>")}),document.querySelector(".spoiler")&&[].forEach.call(document.querySelectorAll(".spoiler"),e=>{e.querySelector("dt").innerHTML=e.querySelector("dt").innerHTML.slice(0,-1),e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-archive"></i></div>')}),document.querySelector(".hidecode")&&[].forEach.call(document.querySelectorAll(".hidecode"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-eye-slash"></i></div>')}),document.querySelector("blockquote")&&([].forEach.call(document.querySelectorAll("blockquote cite"),e=>{if(e.innerHTML=e.innerHTML.replace(/escribió:/g,""),e.querySelector("a")){const t=e.querySelector("a");t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.title.replace(/Ver el perfil :: /g,"")+"»"}e=e.innerHTML}),[].forEach.call(document.querySelectorAll("blockquote"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-quote-right"></i></div>')}))}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#is-form")&&document.querySelector(".msg-element")){const e=document.querySelector("#is-form").innerHTML,t={method:document.querySelector(".basic-element form").method,action:document.querySelector(".basic-element form").action,name:document.querySelector(".basic-element form").name};document.querySelector("#message-section").outerHTML='<form method="'+t.method+'" action="'+t.action+'" name="'+t.name+'" id="message-section" class="basic-element">'+document.querySelector("#message-section").innerHTML+"</form>",document.querySelector("#message-section .msg-element").insertAdjacentHTML("afterend",'<div id="usereply-comand">'+e+"</div>"),document.querySelector("#is-form").remove()}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-content .post-content")&&[].forEach.call(document.querySelectorAll(".is-content .post-content"),e=>{e.classList.remove("post-content")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".has-anchor")&&[].forEach.call(document.querySelectorAll(".has-anchor"),e=>{e.insertAdjacentHTML("afterbegin",`<a id="anchor-${e.id}" class="page-anchor"></a>`)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mentiontag")&&[].forEach.call(document.querySelectorAll(".mentiontag"),e=>{e.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent.slice(1)+"»"})}),document.addEventListener("DOMContentLoaded",()=>{[].forEach.call(document.querySelectorAll(".to-process"),e=>{e.remove()})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#forum-rules")&&(document.querySelector("#forum-rules").innerHTML=document.querySelector("#forum-rules").innerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">"))}),document.addEventListener("forumReady",()=>{if(forumConfig.skinOptions.allowCustomStyles&&document.querySelector("#forum-content .forum-custom-styles")){let e="";[].forEach.call(document.querySelectorAll("#forum-content .forum-custom-styles"),t=>{e+=t.innerHTML,t.remove()}),document.head.insertAdjacentHTML("beforeend",`<style>${e}</style>`)}}),document.addEventListener("forumReady",()=>{FNR.behaviour.genControls()}),document.addEventListener("forumReady",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{e.querySelector("dt span").onclick=(()=>{navigator.clipboard.writeText(e.querySelector("code").innerText),FNR.html.genNotification("¡Copiado!","Recuerda engancharlo en algún lugar.","fas fa-copy")})})}),document.addEventListener("forumReady",()=>{[].forEach.call(document.querySelectorAll(".is-clickbox"),e=>{const t=e.dataset.categorybox,o=e.dataset.categoryid;e.classList.contains("is-toggle")?e.onclick=(()=>{document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("forumReady",()=>{FNR.behaviour.genWiki()}),document.addEventListener("forumReady",()=>{document.querySelector(".checkbox-click:not(.is-radio)")&&[].forEach.call(document.querySelectorAll(".checkbox-click:not(.is-radio)"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("forumReady",()=>{document.querySelector(".checkbox-click.is-radio")&&[].forEach.call(document.querySelectorAll(".checkbox-click.is-radio"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{[].forEach.call(document.querySelectorAll('input[type="radio"][name="'+o.name+'"]'),e=>{const t=e.parentElement.parentElement.classList;t.contains("is-active")&&t.remove("is-active")}),t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("forumReady",()=>{document.querySelector(".is-input")&&[].forEach.call(document.querySelectorAll(".is-input"),e=>{e.onclick=(t=>{e.querySelector('input[type="submit"]').click()})})}),document.addEventListener("forumReady",()=>{FNR.behaviour.genDropeable()}),document.addEventListener("forumReady",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{[].forEach.call(document.querySelectorAll(".is-tweakeable"),e=>{const t=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).paddingLeft)-parseFloat(window.getComputedStyle(e,null).paddingRight)-parseFloat(window.getComputedStyle(e,null).borderLeftWidth)-parseFloat(window.getComputedStyle(e,null).borderRightWidth);if(t>0&&e.querySelector(".is-measurable").offsetWidth>0){let o=parseFloat(window.getComputedStyle(e,null).fontSize);for(;t<e.querySelector(".is-measurable").offsetWidth;)e.style.fontSize=o+"px",o--}})})}),document.addEventListener("forumReady",()=>{document.querySelector(".forum-element .forum-links a")&&document.querySelectorAll(".forum-element .forum-links a").forEach(e=>e.title="Ir al tema «"+e.textContent+"»")}),document.addEventListener("forumReady",()=>{document.querySelector(".is-ordered")&&document.querySelectorAll(".is-ordered").forEach(e=>{const t=[];e.querySelectorAll(":scope > li").forEach(e=>t.push({original:e.outerHTML,order:e.textContent})),t.sort((e,t)=>e.order<t.order?-1:e.order>t.order?1:0),e.innerHTML=t.map(e=>e.original).join("")})}),document.addEventListener("DOMContentLoaded",()=>{const e=e=>[...e.matchAll(/\'\<strong\>(.*)\<\/strong\>\'/gi)][0][1],t=e=>e.split("<br><br>--------------------------------<br><br>").map(e=>{const t=-1===e.indexOf('<img src="'),[l,a]=e.replace("' :<br> ","' : ").split(" : ");return{rollName:o(l),rollResults:t?n(a):r(a)}}),o=e=>[...e.matchAll(/\'(.*)\'/gi)][0][1],r=e=>[...e.matchAll(/src\s*=\s*"(.+?)"/gi)].map(e=>e[1]),n=e=>e.replace(/\<strong\>/gi,"").replace(/\<\/strong\>/gi,"").split(", ").map(Number),l=({rollName:e,rollResults:t})=>{const o=FNR.utility.genSlug(e,"-");return`\n <li class="rolllist-roll rolllist-${o}">\n <h6>${e}</h6>\n <ul class="roll-results">\n ${t.map(t=>a(e,o,t)).join("")}\n </ul>\n </li>\n `},a=(e,t,o)=>`\n <li class="roll-result roll-${t}">\n ${"number"==typeof o?o:`<img src="${o}" alt='Resultado de la tirada del dado «${e}»' title='Resultado de la tirada del dado «${e}»' />`}\n </li>\n `;[...document.querySelectorAll(".postlist-post .is-content")].filter(e=>e.innerHTML.match("ha efectuado la acción siguiente: <strong>Tirada</strong>")).forEach(o=>{const[r,n]=o.innerHTML.split("<hr>"),a=e(r),i=t(n);o.closest(".postlist-post").classList.add("post-diceroll"),o.classList.add("content-dice"),o.innerHTML=`\n <blockquote>\n <div>¡<strong>${a}</strong> ha realizado <em>${1===i.length?"una tirada":"varias tiradas"}</em>!</div>\n </blockquote>\n <ul class="dice-rolllist">\n ${i.map(l).join("")}\n </ul>\n `})}),document.addEventListener("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.dispatchEvent(forumReady),document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
1
+ console.log("%cFNR Engine por %cGaylien 🏳️‍🌈","font-family: sans-serif; font-size: 1.5em","font-size: 1.5em; text-transform: uppercase; font-weight: 800; color: #c381b9;"),console.log("https://zatrapa-gaylien.tumblr.com/"),document.addEventListener("DOMContentLoaded",async()=>{const[e,t]=await Promise.all([FNR.user.getLevel(),FNR.user.getGroup()]),o=window.screen.width<=1023?"touch":"desktop";document.body.classList.add(`is-${o}`),document.body.classList.add(`is-${e}`),document.body.classList.add(`is-${t}`),"guest"!==e&&document.body.classList.add(`is-user${_userdata.user_id}`)}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.querySelectorAll(".lastpost-content"),e=>{let t,o,r;e.querySelector(".color-groups")?(t=e.querySelector(".color-groups"),o=t.outerHTML.split(t.innerHTML),r=t.textContent,t.outerHTML='<strong><a href="'+FNR.user.getUrl(r)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+r+'»">'+o[0]+Vue.filter("just-name")(r)+o[1]+"</a></strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=r)):(e.querySelector(".forum-last-author").innerHTML="<strong>Invitado</strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado")),e.querySelector(".forum-last-author").outerHTML=e.querySelector(".forum-last-author > strong").outerHTML}):-1!==_userdata.user_id&&document.querySelector(".lastpost-content")&&[].forEach.call(document.querySelectorAll(".lastpost-content"),e=>{let t="<strong>Invitado</strong>";e.querySelector(".forum-last-author > strong")?(t=e.querySelector(".forum-last-author > strong > a"),t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+"»",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=t.textContent),t.querySelector("span").textContent=Vue.filter("just-name")(t.textContent),t="<strong>"+t.outerHTML+"</strong>",t.textContent=Vue.filter("just-name")(t.textContent)):e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado"),e.querySelector(".forum-last-author").outerHTML=t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-last-date")&&[].forEach.call(document.querySelectorAll(".lastpost-content"),e=>{const t=e.querySelector(".forum-last-date").textContent;e.querySelector(".lastpost-link").title+=", "+t,e.querySelector(".forum-last-date").outerHTML=t,e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-topic)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-topic)"),e=>{[].forEach.call(FNR.content.topic.getType(e.querySelector(".topiclist-topic .to-process .topic-status").textContent),t=>{e.classList.add(t)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;let n=FNR.user.getUrl(t.textContent);if(t.querySelector(".gensmall")&&(n=t.querySelector(".gensmall").href),e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")){const o=e.querySelector(".topic-lastauthor");t.querySelector("span")?(t.innerHTML='<strong><a href="'+n+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">'+t.querySelector("span").outerHTML+"</a></strong>",t.querySelector("strong strong").textContent=Vue.filter("just-name")(t.querySelector("strong strong").textContent),t.querySelector(".color-groups").innerHTML=t.querySelector(".color-groups").textContent,o.outerHTML=t.innerHTML):o.outerHTML="<strong>Invitado</strong>",o.outerHTML=o.innerHTML}if(e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r),e.querySelector(".topic-lastavatar")){let o;o="",o+='<a class="topic-lastavatar" href="'+n+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">',o+=e.querySelector(".topic-lastavatar").innerHTML,o+="</a>",e.querySelector(".topic-lastavatar").outerHTML=o}})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#moderation")&&document.querySelector("#moderation a")?document.querySelector('a[href="#gestionar"]').href=document.querySelector("#moderation a").href:document.querySelector("#moderation")&&document.querySelector('a[href="#gestionar"]').parentElement.remove()}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".prev-post")){let e=document.querySelector("#forum-preview");""!==document.querySelectorAll(".prev-post")[0].innerHTML&&(e.querySelector(".post-content").innerHTML='<div class="is-content">'+document.querySelectorAll(".prev-post")[0].innerHTML+"</div>",e.classList.remove("to-process"))}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-otherposts")&&document.querySelector(".forum-otherposts").children.length){let e="";[].forEach.call(document.querySelector(".forum-otherposts").querySelectorAll(".post"),t=>{if(document.querySelector(".mp-main")&&document.querySelector("#forum-reply")){let o=t.querySelector(".mp-from").textContent,r=FNR.utility.getGroup("rgb_"+t.querySelector(".mp-from > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_")),n=t.querySelector(".mp-date").textContent,l=t.querySelector(".is-content").innerHTML;e+='<li class="post post-mp">',e+='<section class="postlist-post usergroup-'+r+'">',e+='<ul class="post-datafields post-profile profile-sticky">',e+='<li class="datafield-user">',e+='<div class="datafield-name">Usuario</div>',e+='<strong><a href="'+FNR.user.getUrl(o)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+o+'»">'+o+"</a></strong>",e+="</li>",e+='<li class="datafield-date">',e+='<div class="datafield-name">Fecha</div>',e+=n.indexOf("el")>-1?n.split("el ")[1]:n,e+="</li>",e+="</ul>",e+='<div class="post-content no-links">',e+='<div class="is-content">',e+=l,e+="</div>",e+="</div>",e+="</section>",e+="</li>"}else document.querySelector("#mp-body")||(t.querySelector(".post-datafields .datafield-user a > span")?(t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("rgb_"+t.querySelector(".post-datafields .datafield-user a > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_"))),t.querySelector(".post-datafields .datafield-user a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.querySelector(".post-datafields .datafield-user a").textContent+"»",t.querySelector(".post-datafields .datafield-user a").target="_blank",""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").href=FNR.user.getUrl(t.querySelector(".post-datafields .datafield-user a").textContent))):t.querySelector(".post-datafields .datafield-check")&&t.querySelector(".post-datafields .datafield-check").children&&1===t.querySelector(".post-datafields .datafield-check").children.length?t.querySelector(".post-datafields .datafield-check").remove():t.querySelector(".post-datafields .datafield-user a")&&""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").outerHTML="<strong>"+t.querySelector(".post-datafields .datafield-user a").innerHTML+"</strong>",t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null"))),"UsuarioAnonymous"===t.querySelector(".post-datafields .datafield-user").textContent&&t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null")))}),document.querySelector(".mp-main")&&document.querySelector("#forum-reply")&&(document.querySelector(".forum-otherposts").innerHTML=e)}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-postlist .post:not(.panel)")){const e={responder_citando:{icon:"fas fa-quote-right",title:"Citar"},editar_borrar_este_mensaje:{icon:"fas fa-pencil-alt",title:"Editar"},borrar_este_mensaje:{icon:"fas fa-trash-alt",title:"Borrar"},ver_la_direccion_ip_del_autor:{icon:"fas fa-map-marker-alt",title:"Ver IP"},permalink:{icon:"fas fa-tag",title:"Enlace permanente"}};[].forEach.call(document.querySelectorAll(".forum-postlist .post"),t=>{if(t.children.length>1){let o="";[].forEach.call(t.querySelectorAll(".to-process .post-icons li a"),t=>{const r=e[FNR.utility.genSlug(t.querySelector("img").title)];o+='<li class="post-button post-button-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'">',o+='<i class="'+r.icon+'"></i>',o+="<span>"+("Enlace permanente"===r.title?"Permalink":r.title)+"</span>",o+="</a>",o+="</li>"}),t.querySelector(".post-buttons").innerHTML=o}else t.remove()})}}),document.addEventListener("DOMContentLoaded",()=>{null!==document.querySelector("#forum-realreply")&&""===document.querySelector("#forum-realreply").innerHTML&&document.querySelector("#quickreply-section").remove()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector('img[title="Citar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Citar mensaje"]'),e=>{let t=e.parentElement;t.title="Citar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Citar el Mensaje"}),document.querySelector('img[title="Editar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Editar mensaje"]'),e=>{let t=e.parentElement;t.title="Editar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Editar el Mensaje"})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mp-from")&&[].forEach.call(document.querySelectorAll(".mp-from"),e=>{const t=FNR.utility.getGroup(e.querySelector("span").style.color.replace(/, /g,"_").replace(/, /g,"_").replace(/\(/g,"_").replace(/\)/g,""));e.innerHTML='<a href="'+FNR.user.getUrl(e.textContent)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.textContent+"</a>";let o=e.parentElement;for(;!o.classList.contains("mp-main");)o=o.parentElement;o.classList.add("usergroup-"+t)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#breadcrumbs")&&document.querySelector("#forum-breadcrumb")&&[].forEach.call(document.querySelector("#breadcrumbs").children,(e,t,o)=>{let r=e.href,n=Vue.filter("mini-sanitize")(e.text),l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const getPageInfo=()=>{const e=Array.from(document.querySelectorAll("#pagination > span > *:not(.pag-img):not(.page-sep)"));return e.length?{currentPage:parseInt(document.querySelector("#pagination > span > strong").textContent),totalPages:parseInt(e[e.length-1].textContent)}:{currentPage:1,totalPages:1}},pageData=getPageInfo(),leftButton=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),rightButton=document.querySelector(".pag-img .sprite-arrow_prosilver_right");leftButton&&(leftButton.parentElement.title="Ir a la página anterior",leftButton.parentElement.classList.add("page-prev"),leftButton.parentElement.classList.remove("pag-img"),leftButton.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),rightButton&&(rightButton.parentElement.title="Ir a la página siguiente",rightButton.parentElement.classList.add("page-next"),rightButton.parentElement.classList.remove("pag-img"),rightButton.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>');const nextPage=document.querySelector(".page-next"),prevPage=document.querySelector(".page-prev"),pagination=`\n <div class="pagination-manager">\n ${null===prevPage?"":`<div class="page-action">${prevPage.outerHTML}</div>`}\n <form class="pagination-input" name="go_page">\n <input type="text" placeholder="${pageData.currentPage}" />de ${pageData.totalPages}\n </form>\n ${null===nextPage?"":`<div class="page-action">${nextPage.outerHTML}</div>`}\n </div>\n `;[].forEach.call(document.querySelectorAll(".page-pagination"),item=>{item.insertAdjacentHTML("afterbegin",pagination);const formSelector=item.querySelector(".pagination-input"),inputSelector=item.querySelector(".pagination-input input");inputSelector.onkeyup=FNR.behaviour.genDebounce(()=>{null===inputSelector.value.match(/[a-zA-Z]+/g)&&""!==inputSelector.value.trim()&&eval(do_pagination_start.toString().replace("document.go_page.start.value","inputSelector.value").split("{")[1].split("}")[0])}),item.parentElement.classList.contains("not-show")&&item.parentElement.classList.remove("not-show")})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{1!==e.classList.length&&e.classList.remove("codebox")}),document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{const t=e.querySelector("code").innerHTML.trim();e.querySelector("dt").innerHTML='Código <em>-</em> <span class="is-pointer">Copiar</span>',e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-code"></i></div>'),e.querySelector("code").remove(),e.insertAdjacentHTML("beforeend","<code>"+t+"</code>")}),document.querySelector(".spoiler")&&[].forEach.call(document.querySelectorAll(".spoiler"),e=>{e.querySelector("dt").innerHTML=e.querySelector("dt").innerHTML.slice(0,-1),e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-archive"></i></div>')}),document.querySelector(".hidecode")&&[].forEach.call(document.querySelectorAll(".hidecode"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-eye-slash"></i></div>')}),document.querySelector("blockquote")&&([].forEach.call(document.querySelectorAll("blockquote cite"),e=>{if(e.innerHTML=e.innerHTML.replace(/escribió:/g,""),e.querySelector("a")){const t=e.querySelector("a");t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.title.replace(/Ver el perfil :: /g,"")+"»"}e=e.innerHTML}),[].forEach.call(document.querySelectorAll("blockquote"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-quote-right"></i></div>')}))}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#is-form")&&document.querySelector(".msg-element")){const e=document.querySelector("#is-form").innerHTML,t={method:document.querySelector(".basic-element form").method,action:document.querySelector(".basic-element form").action,name:document.querySelector(".basic-element form").name};document.querySelector("#message-section").outerHTML='<form method="'+t.method+'" action="'+t.action+'" name="'+t.name+'" id="message-section" class="basic-element">'+document.querySelector("#message-section").innerHTML+"</form>",document.querySelector("#message-section .msg-element").insertAdjacentHTML("afterend",'<div id="usereply-comand">'+e+"</div>"),document.querySelector("#is-form").remove()}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-content .post-content")&&[].forEach.call(document.querySelectorAll(".is-content .post-content"),e=>{e.classList.remove("post-content")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".has-anchor")&&[].forEach.call(document.querySelectorAll(".has-anchor"),e=>{e.insertAdjacentHTML("afterbegin",`<a id="anchor-${e.id}" class="page-anchor"></a>`)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mentiontag")&&[].forEach.call(document.querySelectorAll(".mentiontag"),e=>{e.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent.slice(1)+"»"})}),document.addEventListener("DOMContentLoaded",()=>{[].forEach.call(document.querySelectorAll(".to-process"),e=>{e.remove()})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#forum-rules")&&(document.querySelector("#forum-rules").innerHTML=document.querySelector("#forum-rules").innerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">"))}),document.addEventListener("forumReady",()=>{if(forumConfig.skinOptions.allowCustomStyles&&document.querySelector("#forum-content .forum-custom-styles")){let e="";[].forEach.call(document.querySelectorAll("#forum-content .forum-custom-styles"),t=>{e+=t.innerHTML,t.remove()}),document.head.insertAdjacentHTML("beforeend",`<style>${e}</style>`)}}),document.addEventListener("forumReady",()=>{FNR.behaviour.genControls()}),document.addEventListener("forumReady",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{e.querySelector("dt span").onclick=(()=>{navigator.clipboard.writeText(e.querySelector("code").innerText),FNR.html.genNotification("¡Copiado!","Recuerda engancharlo en algún lugar.","fas fa-copy")})})}),document.addEventListener("forumReady",()=>{[].forEach.call(document.querySelectorAll(".is-clickbox"),e=>{const t=e.dataset.categorybox,o=e.dataset.categoryid;e.classList.contains("is-toggle")?e.onclick=(()=>{document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("forumReady",()=>{FNR.behaviour.genWiki()}),document.addEventListener("forumReady",()=>{document.querySelector(".checkbox-click:not(.is-radio)")&&[].forEach.call(document.querySelectorAll(".checkbox-click:not(.is-radio)"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("forumReady",()=>{document.querySelector(".checkbox-click.is-radio")&&[].forEach.call(document.querySelectorAll(".checkbox-click.is-radio"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{[].forEach.call(document.querySelectorAll('input[type="radio"][name="'+o.name+'"]'),e=>{const t=e.parentElement.parentElement.classList;t.contains("is-active")&&t.remove("is-active")}),t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("forumReady",()=>{document.querySelector(".is-input")&&[].forEach.call(document.querySelectorAll(".is-input"),e=>{e.onclick=(t=>{e.querySelector('input[type="submit"]').click()})})}),document.addEventListener("forumReady",()=>{FNR.behaviour.genDropeable()}),document.addEventListener("forumReady",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{FNR.behaviour.genMeassure()})}),document.addEventListener("forumReady",()=>{document.querySelector(".forum-element .forum-links a")&&document.querySelectorAll(".forum-element .forum-links a").forEach(e=>e.title="Ir al tema «"+e.textContent+"»")}),document.addEventListener("forumReady",()=>{document.querySelector(".is-ordered")&&document.querySelectorAll(".is-ordered").forEach(e=>{const t=[];e.querySelectorAll(":scope > li").forEach(e=>t.push({original:e.outerHTML,order:e.textContent})),t.sort((e,t)=>e.order<t.order?-1:e.order>t.order?1:0),e.innerHTML=t.map(e=>e.original).join("")})}),document.addEventListener("DOMContentLoaded",()=>{const e=e=>[...e.matchAll(/\'\<strong\>(.*)\<\/strong\>\'/gi)][0][1],t=e=>e.split("<br><br>--------------------------------<br><br>").map(e=>{const t=-1===e.indexOf('<img src="'),[l,a]=e.replace("' :<br> ","' : ").split(" : ");return{rollName:o(l),rollResults:t?n(a):r(a)}}),o=e=>[...e.matchAll(/\'(.*)\'/gi)][0][1],r=e=>[...e.matchAll(/src\s*=\s*"(.+?)"/gi)].map(e=>e[1]),n=e=>e.replace(/\<strong\>/gi,"").replace(/\<\/strong\>/gi,"").split(", ").map(Number),l=({rollName:e,rollResults:t})=>{const o=FNR.utility.genSlug(e,"-");return`\n <li class="rolllist-roll rolllist-${o}">\n <h6>${e}</h6>\n <ul class="roll-results">\n ${t.map(t=>a(e,o,t)).join("")}\n </ul>\n </li>\n `},a=(e,t,o)=>`\n <li class="roll-result roll-${t}">\n ${"number"==typeof o?o:`<img src="${o}" alt='Resultado de la tirada del dado «${e}»' title='Resultado de la tirada del dado «${e}»' />`}\n </li>\n `;[...document.querySelectorAll(".postlist-post .is-content")].filter(e=>e.innerHTML.match("ha efectuado la acción siguiente: <strong>Tirada</strong>")).forEach(o=>{const[r,n]=o.innerHTML.split("<hr>"),a=e(r),i=t(n);o.closest(".postlist-post").classList.add("post-diceroll"),o.classList.add("content-dice"),o.innerHTML=`\n <blockquote>\n <div>¡<strong>${a}</strong> ha realizado <em>${1===i.length?"una tirada":"varias tiradas"}</em>!</div>\n </blockquote>\n <ul class="dice-rolllist">\n ${i.map(l).join("")}\n </ul>\n `})}),document.addEventListener("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.dispatchEvent(forumReady),document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
@@ -46,60 +46,64 @@ Vue.component('directorio-personajes', {
46
46
  created() {
47
47
  this.obtainCharacters();
48
48
  },
49
+ mounted() {
50
+ document.title = 'Directorio de Personajes';
51
+ },
52
+ updated() {
53
+ FNR.behaviour.genMeassure();
54
+ },
49
55
  template: `
50
56
  <section id="directory-section" class="basic-element">
51
- <section class="member-directory">
52
- <section v-if="!loading" class="generic-element">
53
- <cabespecial-foro>
54
- <template slot="title">Directorio de Personajes</template>
55
- </cabespecial-foro>
56
- <section id="memberlist-options" class="field-block">
57
- <ul class="forum-fieldlist no-style">
58
- <li class="field-element field-nombre">
59
- <div class="forum-field">
60
- <div class="field-name">Nombre</div>
61
- <div class="field-content">
62
- <input type="text" v-model="busqueda" placeholder="Buscar por nombre de personaje">
63
- </div>
57
+ <section v-if="!loading" class="generic-element">
58
+ <cabespecial-foro>
59
+ <template slot="title">Directorio de Personajes</template>
60
+ </cabespecial-foro>
61
+ <section id="memberlist-options" class="field-block">
62
+ <ul class="forum-fieldlist no-style">
63
+ <li class="field-element field-nombre">
64
+ <div class="forum-field">
65
+ <div class="field-name">Nombre</div>
66
+ <div class="field-content">
67
+ <input type="text" v-model="busqueda" placeholder="Buscar por nombre de personaje">
64
68
  </div>
69
+ </div>
70
+ </li>
71
+ </ul>
72
+ </section>
73
+ <separador-foro />
74
+ <cabecera-foro>
75
+ <template slot="title">Listado</template>
76
+ </cabecera-foro>
77
+ <section class="forum-memberlist">
78
+ <ul :class="'memberlist-members no-style' + (personajesFiltrados.length ? '' : ' no-results')">
79
+ <li v-if="!personajesFiltrados.length">
80
+ <h6>No hay personajes que coincidan con la búsqueda.</h6>
81
+ </li>
82
+ <li v-else v-for="personaje in personajesFiltrados" :key="personaje.name" class="row">
83
+ <a :href="personaje.links.profile" target="_blank" :title="'Ir al ' + config.profileOptions.profileName + ' de «' + personaje.name + '»'" :class="'memberitem-element usergroup-' + personaje.colour">
84
+ <div class="memberlist-name">
85
+ <h3 class="is-tweakeable">
86
+ <span class="is-measurable">{{ personaje.name }}</span>
87
+ </h3>
88
+ </div>
89
+ <img :src="personaje.avatar" :alt="'Avatar de «' + personaje.name + '»'" class="memberlist-avatar">
90
+ <ul class="memberlist-fields">
91
+ <li v-for="field in config.profileUser.directoryFields" :key="field" class="memberlist-field">
92
+ <strong>{{ personaje.fields[field].name }}:</strong> {{ personaje.fields[field].content }}
93
+ </li>
94
+ </ul>
95
+ </a>
65
96
  </li>
66
97
  </ul>
67
- </section>
68
- <separador-foro />
69
- <cabecera-foro>
70
- <template slot="title">Listado</template>
71
- </cabecera-foro>
72
- <section class="forum-memberlist">
73
- <ul :class="'memberlist-members no-style' + (personajesFiltrados.length ? '' : ' no-results')">
74
- <li v-if="!personajesFiltrados.length">
75
- <h6>No hay personajes que coincidan con la búsqueda.</h6>
76
- </li>
77
- <li v-else v-for="personaje in personajesFiltrados" :key="personaje.name" class="row">
78
- <a :href="personaje.links.profile" target="_blank" :title="'Ir al ' + config.profileOptions.profileName + ' de «' + personaje.name + '»'" :class="'memberitem-element usergroup-' + personaje.colour">
79
- <div class="memberlist-name">
80
- <h3 class="is-tweakeable">
81
- <span class="is-measurable">{{ personaje.name }}</span>
82
- </h3>
83
- </div>
84
- <img :src="personaje.avatar" :alt="'Avatar de «' + personaje.name + '»'" class="memberlist-avatar">
85
- <ul class="memberlist-fields">
86
- <li v-for="field in config.profileUser.directoryFields" :key="field" class="memberlist-field">
87
- <strong>{{ personaje.fields[field].name }}:</strong> {{ personaje.fields[field].content }}
88
- </li>
89
- </ul>
90
- </a>
91
- </li>
92
- </ul>
93
- </section>
94
- </section>
95
- <section v-else class="generic-element">
96
- <cabespecial-foro>
97
- <template slot="title">Directorio de Personajes</template>
98
- </cabespecial-foro>
99
- <separador-foro />
100
- <cargando-foro text="Cargando utilidad…"></cargando-foro>
101
98
  </section>
102
99
  </section>
100
+ <section v-else class="generic-element">
101
+ <cabespecial-foro>
102
+ <template slot="title">Directorio de Personajes</template>
103
+ </cabespecial-foro>
104
+ <separador-foro />
105
+ <cargando-foro text="Cargando utilidad…"></cargando-foro>
106
+ </section>
103
107
  </section>
104
108
  `
105
109
  });
@@ -1 +1 @@
1
- Vue.component("directorio-personajes",{data:()=>({loading:!0,config:forumConfig,busqueda:"",personajes:[]}),computed:{personajesFiltrados(){if(!this.busqueda)return this.personajes;const e=this.busqueda.toLowerCase();return this.personajes.filter(s=>s.name.toLowerCase().includes(e))}},methods:{async obtainCharacters(){let e;try{e=await FNR.cache.useData("members",.25)}catch(s){e=null}e||(e=await FNR.forum.getMembers(),FNR.cache.setData("members",e,.25));const s=await Promise.all(e.map(e=>FNR.user.getProfile(e.id.replace("/u",""),.25)));this.personajes=s,this.loading=!1}},created(){this.obtainCharacters()},template:'\n <section id="directory-section" class="basic-element">\n <section class="member-directory">\n <section v-if="!loading" class="generic-element">\n <cabespecial-foro>\n <template slot="title">Directorio de Personajes</template>\n </cabespecial-foro>\n <section id="memberlist-options" class="field-block">\n <ul class="forum-fieldlist no-style">\n <li class="field-element field-nombre">\n <div class="forum-field">\n <div class="field-name">Nombre</div>\n <div class="field-content">\n <input type="text" v-model="busqueda" placeholder="Buscar por nombre de personaje">\n </div>\n </div>\n </li>\n </ul>\n </section>\n <separador-foro />\n <cabecera-foro>\n <template slot="title">Listado</template>\n </cabecera-foro>\n <section class="forum-memberlist">\n <ul :class="\'memberlist-members no-style\' + (personajesFiltrados.length ? \'\' : \' no-results\')">\n <li v-if="!personajesFiltrados.length">\n <h6>No hay personajes que coincidan con la búsqueda.</h6>\n </li>\n <li v-else v-for="personaje in personajesFiltrados" :key="personaje.name" class="row">\n <a :href="personaje.links.profile" target="_blank" :title="\'Ir al \' + config.profileOptions.profileName + \' de «\' + personaje.name + \'»\'" :class="\'memberitem-element usergroup-\' + personaje.colour">\n <div class="memberlist-name">\n <h3 class="is-tweakeable">\n <span class="is-measurable">{{ personaje.name }}</span>\n </h3>\n </div>\n <img :src="personaje.avatar" :alt="\'Avatar de «\' + personaje.name + \'»\'" class="memberlist-avatar">\n <ul class="memberlist-fields">\n <li v-for="field in config.profileUser.directoryFields" :key="field" class="memberlist-field">\n <strong>{{ personaje.fields[field].name }}:</strong> {{ personaje.fields[field].content }}\n </li>\n </ul>\n </a>\n </li>\n </ul>\n </section>\n </section>\n <section v-else class="generic-element">\n <cabespecial-foro>\n <template slot="title">Directorio de Personajes</template>\n </cabespecial-foro>\n <separador-foro />\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </section>\n </section>\n </section>\n '});
1
+ Vue.component("directorio-personajes",{data:()=>({loading:!0,config:forumConfig,busqueda:"",personajes:[]}),computed:{personajesFiltrados(){if(!this.busqueda)return this.personajes;const e=this.busqueda.toLowerCase();return this.personajes.filter(s=>s.name.toLowerCase().includes(e))}},methods:{async obtainCharacters(){let e;try{e=await FNR.cache.useData("members",.25)}catch(s){e=null}e||(e=await FNR.forum.getMembers(),FNR.cache.setData("members",e,.25));const s=await Promise.all(e.map(e=>FNR.user.getProfile(e.id.replace("/u",""),.25)));this.personajes=s,this.loading=!1}},created(){this.obtainCharacters()},mounted(){document.title="Directorio de Personajes"},updated(){FNR.behaviour.genMeassure()},template:'\n <section id="directory-section" class="basic-element">\n <section v-if="!loading" class="generic-element">\n <cabespecial-foro>\n <template slot="title">Directorio de Personajes</template>\n </cabespecial-foro>\n <section id="memberlist-options" class="field-block">\n <ul class="forum-fieldlist no-style">\n <li class="field-element field-nombre">\n <div class="forum-field">\n <div class="field-name">Nombre</div>\n <div class="field-content">\n <input type="text" v-model="busqueda" placeholder="Buscar por nombre de personaje">\n </div>\n </div>\n </li>\n </ul>\n </section>\n <separador-foro />\n <cabecera-foro>\n <template slot="title">Listado</template>\n </cabecera-foro>\n <section class="forum-memberlist">\n <ul :class="\'memberlist-members no-style\' + (personajesFiltrados.length ? \'\' : \' no-results\')">\n <li v-if="!personajesFiltrados.length">\n <h6>No hay personajes que coincidan con la búsqueda.</h6>\n </li>\n <li v-else v-for="personaje in personajesFiltrados" :key="personaje.name" class="row">\n <a :href="personaje.links.profile" target="_blank" :title="\'Ir al \' + config.profileOptions.profileName + \' de «\' + personaje.name + \'»\'" :class="\'memberitem-element usergroup-\' + personaje.colour">\n <div class="memberlist-name">\n <h3 class="is-tweakeable">\n <span class="is-measurable">{{ personaje.name }}</span>\n </h3>\n </div>\n <img :src="personaje.avatar" :alt="\'Avatar de «\' + personaje.name + \'»\'" class="memberlist-avatar">\n <ul class="memberlist-fields">\n <li v-for="field in config.profileUser.directoryFields" :key="field" class="memberlist-field">\n <strong>{{ personaje.fields[field].name }}:</strong> {{ personaje.fields[field].content }}\n </li>\n </ul>\n </a>\n </li>\n </ul>\n </section>\n </section>\n <section v-else class="generic-element">\n <cabespecial-foro>\n <template slot="title">Directorio de Personajes</template>\n </cabespecial-foro>\n <separador-foro />\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </section>\n </section>\n '});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generic-skin",
3
- "version": "5.0.10",
3
+ "version": "5.0.12",
4
4
  "description": "Generic Forum Skin for Forumotion created by Gaylien.",
5
5
  "license": "ISC",
6
6
  "author": "Gaylien",