generic-skin 2.3.1 → 2.3.5

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.
@@ -1 +1 @@
1
- const FNR={execFn:function(e){document.addEventListener("forumReady",e,!1)},forum:{getColors:function(){return Object.values(forumColours).map(e=>({name:e.code,hex:e.hex}))},getLatest:function(e,t){return new Promise((n,i)=>{const a=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();r.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"))}})},o=i=>{$.get(i,function(i){$(i).find(".ipbform").find("tbody").find("tr").each(function(){r.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&a(this)}),r.length!==t&&$(i).find(".pagination")[0].children.length&&"b"!==$(i).find(".pagination").children().last()[0].localName?o($(i).find(".pagination").children().last().attr("href")):n(r)})};let r=[];o("/latest?change_version=invision")})},getMembers:function(e){return new Promise((t,n)=>{let i=[];const a=(e,t)=>({user:$(e).find(".avatar-mini a span strong").text(),id:$(e).find(".avatar-mini a").attr("href").split("?")[0],img:$(e).find(".avatar-mini a img").attr("src"),color:t}),o=t=>{let n=[];return $(t).find("#memberlist tbody tr").each(function(){const t=FNR.utility.getGroup($(this).find(".avatar-mini a span").attr("style").split("color:")[1]);e?n.push(a(this,t)):"unknown"!==t&&"narracion"!==t&&n.push(a(this,t))}),n},r=e=>{$.get(e,function(e){const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;i=i.concat(o(e)),n?r(n):t(i.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};r("/memberlist?change_version=phpbb2")})},getAffiliates:function(){return new Promise((e,t)=>{const n=forumConfig.affiliatesMax,i=Object.entries(forumAffiliates).map(e=>{let t="";e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'"/></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+'"/></a></li>';return t});e({normal:i[0],elite:i[1],directory:i[2],sister:i[3]})})}},content:{post:{getPost:function(e){return new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const i=$(n).find("#p"+e.split("#")[1]);t({author:{text:i.find(".author a").text(),color:i.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(i.find(".author a").attr("href"))},content:i.find(".post-entry > div").html(),date:i.find(".author").html().split("</a>")[1]})})})},getLast:function(e){return new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),e=>{const n=$(e).find(".pagination.topic-options").children().last().prev().attr("href")||!1,i=e,a=e=>{const t=e=>$(e).find(".post").parent().children().last().prev(),n=""!==t(e).find(".author a").text();return{author:{text:n?t(e).find(".author a").text():"Invitado",color:n?t(e).find(".author a span").css("color"):"#bdbdbd",url:n?t(e).find(".author a").attr("href").replace("?change_version=invision",""):"#"},locate:{text:$(e).find("#navstrip").find("li").last().text(),url:$(e).find("#navstrip").find("li").last().find("a").attr("href").replace("?change_version=invision","")},url:t(e).find(".postbody-head h3 a").attr("href").replace("?change_version=invision",""),content:t(e).find(".post-entry > div").html(),date:n?t(e).find(".author").html().split("</a>")[1].trim():t(e).find(".author").html().split("Invitado")[1].trim()}};n?$.get(n,e=>{t(a(e))}):t(a(i))})})}},topic:{genTopic:function(e,t,n){return new Promise((i,a)=>{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=(()=>{r.onload=(()=>{$("#forum-save").remove(),console.clear(),i(!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 > header").prepend(o);const r=document.getElementById("forum-save")})},isAutosave:function(){return void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t)}}},user:{changeAccount:function(e,t,n){return new Promise((i,a)=>{let o=document.createElement("iframe");o.id="forum-save",o.src=e,o.width=0,o.height=0,o.onload=(()=>{o.onload=(()=>{o.onload=(()=>{console.clear(),i(!0)}),$("#forum-save").contents().find('input[name="username"]').val(t),$("#forum-save").contents().find('input[name="password"]').val(n),$("#forum-save").contents().find('input[type="submit"][name="login"]').click()}),r.src="/login?change_version=invision"}),document.querySelector("body > header").prepend(o);const r=document.getElementById("forum-save")})},profile:{getUrl:function(e){let t=void 0!==e?encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"):_userdata.user_id;return"/profile?mode=viewprofile&u="+t},getData:function(e){return new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const i=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const a=n;let o=[];[].forEach.call(e,e=>{let t="",n=[];switch(e.type){case"input":t=$(i).find('dl:contains("'+e.name+'")').find("dd").find("input").val();break;case"textarea":t=$(i).find('dl:contains("'+e.name+'")').find("dd").find("textarea").val();break;case"select":t=$(i).find('dl:contains("'+e.name+'")').find("dd").find("select option:selected").attr("value"),$(i).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=$(a).find(".box-content img").attr("src")}if("select"===e.type&&void 0===t||"select"===e.type&&""===t)return;let r={type:e.type,name:e.name,value:t};e.validation&&(r.validation=e.validation),n.length&&(r.options=n),o.push(r)}),t(o)})})})},setData:function(e){return new Promise((t,n)=>{const i=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let a=document.createElement("iframe");a.id="forum-save",a.src="/profile?change_version=invision&mode=editprofile",a.width=0,a.height=0,a.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=(()=>{i()}),$("#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"):i()}),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),document.querySelector("body > header").prepend(a);const o=document.getElementById("forum-save")})},getAll:function(e,t){const n=null!=e?FNR.user.profile.getUrl(e):FNR.user.profile.getUrl(),i=t||5,a=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 i={};i.name=$(t).find(".maintitle h1 span").text(),i.lastvisit=$(t).find('dt:contains("Última visita")').parent().find("dd").text(),i.colour=FNR.utility.getGroup($(t).find(".maintitle h1 span").css("color").replace("rgb(","rgb_").replace(/, /g,"_").replace(")","")),i.avatar=$(t).find(".real_avatar img").attr("src"),i.links={profile:"/u"+n.split("&u=")[1],mp:"/privmsg?mode=post&u="+n.split("&u=")[1]},i.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},i.fields={},$(t).find('dl[id^="field_id"]').each(function(){if(""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;i.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:a($(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;i.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:a($(this).find("dd"))}}}),i.fields.rango={name:"Rango",content:$(t).find('dt:contains("Rango:")').parent().find("dd").text()},e(i)})}),r=e=>{const t="userInfo"+e;return new Promise((e,n)=>{FNR.cache.useData(t,i).then(t=>{e(t)},n=>{o().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return r(e)},getDrafts:function(){return new Promise((e,t)=>{$.get("/search?search_id=draftsearch&change_version=invision",t=>{if(0!==parseFloat($(t).find(".maintitle > h3").text())){let n=[];$(t).find(".ipbform .ipbtable tbody > tr").each(function(){const e=$(this).find("td");n.push({topic:{name:e[1].textContent.trim(),url:Vue.filter("url-to-normal")(e[1].querySelector("a").href)},info:{location:e[2].textContent.trim(),date:e[3].textContent.trim()},modify:Vue.filter("url-to-normal")(e[4].querySelector("a").href)})}),e(n)}else e(!1)})})}}},cache:{setData:function(e,t,n){let i=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:i,content:t}))},getData:function(e){return null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content},delData:function(e){return null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e)},useData:function(e,t){return new Promise((n,i)=>{let a=localStorage.getItem(forumData.prefix+"_"+e),o=new Date,r=-1==t?"undefined":864e5*t;null!=a&&-1==t||null!=a&&parseInt(JSON.parse(a).cached_at)+r>o.getTime()?n(JSON.parse(a).content):i(!1)})}},utility:{genSlug:function(e,t){const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,i=t.length;n<i;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,"-")},i=t||"_";return n(e).replace(/-/g,i)},genArray:function(e){return JSON.parse(e.replace(/`/g,'"'))},genValidation:function(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:function(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:function(e,t,n){if(""===e||null==e)return;if(""===t||null==t)return;let i=document.createElement("div");i.id="forum-modal",document.body.appendChild(i);let a="";a+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',a+='<div class="modal-title">',a+="<h3>"+e+"</h3>",a+='<a onclick="document.getElementById(`forum-modal`).remove()">',a+='<i class="fas fa-times"></i>',a+="</a>",a+="</div>",a+='<div class="modal-content">',a+='<div class="is-content">',a+=t.replace(/\n/g,"<br>"),a+="</div>",""!==n&&null!=n&&(a+='<div class="modal-buttons">',a+=n,a+="</div>"),a+="</div>",a+="</div>",a+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=a},genPrompt:function(e,t,n,i){if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((a,o)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+i+'"></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;a(""!==e&&e),document.getElementById("forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{o(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{o(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{o(!1),document.getElementById("forum-modal").remove()})})},genNotification:function(e,t,n,i){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.getElementById("forum-notification").remove(),clearTimeout());let a=document.createElement("div");a.id="forum-notification",document.body.appendChild(a);let o="";o+=""===i||null==i?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+i+'" 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+=""===i||null==i?"</div>":"</a>",document.getElementById("forum-notification").innerHTML=o,setTimeout(()=>{document.getElementById("forum-notification").classList.add("notification-show")},500),setTimeout(()=>{document.getElementById("forum-notification").classList.remove("notification-show")},8e3),setTimeout(()=>{document.getElementById("forum-notification").remove()},1e4)}},behaviour:{genWiki:function(){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 i=e.parentElement.parentElement;n&&(i=i.parentElement.parentElement),i.classList.add("is-active"),i.classList.add("is-selected"),i.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(i,!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:function(){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"))})})}}};
1
+ const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:(e,t)=>new Promise((n,i)=>{const a=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();r.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"))}})},o=i=>{$.get(i,i=>{$(i).find(".ipbform").find("tbody").find("tr").each(function(){r.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&a(this)}),r.length!==t&&$(i).find(".pagination")[0].children.length&&"b"!==$(i).find(".pagination").children().last()[0].localName?o($(i).find(".pagination").children().last().attr("href")):n(r)})};let r=[];o("/latest?change_version=invision")}),getMembers:e=>new Promise((t,n)=>{let i=[];const a=(e,t)=>({user:$(e).find(".avatar-mini a span strong").text(),id:$(e).find(".avatar-mini a").attr("href").split("?")[0],img:$(e).find(".avatar-mini a img").attr("src"),color:t}),o=t=>{let n=[];return $(t).find("#memberlist tbody tr").each(function(){const t=FNR.utility.getGroup($(this).find(".avatar-mini a span").attr("style").split("color:")[1]);e?n.push(a(this,t)):"unknown"!==t&&t!==forumConfig.skinOptions.adminGroup&&n.push(a(this,t))}),n},r=e=>{$.get(e,e=>{const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;i=i.concat(o(e)),n?r(n):t(i.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};r("/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,i)=>{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,i=Object.entries(forumAffiliates).map(e=>{let t="";e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'"/></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+'"/></a></li>';return t});e({normal:i[0],elite:i[1],directory:i[2],sister:i[3]})})},content:{isAutosave:()=>void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t),getPost:e=>new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const i=$(n).find("#p"+e.split("#")[1]);t({author:{text:i.find(".author a").text(),color:i.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(i.find(".author a").attr("href"))},content:i.find(".post-entry > div").html(),date:i.find(".author").html().split("</a>")[1]})})}),genPost:(e,t)=>new Promise((n,i)=>{let a=document.createElement("iframe");a.id="forum-save",a.src="/post?t="+e+"&mode=reply&change_version=invision",a.width=0,a.height=0,a.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 > header").prepend(a);const o=document.getElementById("forum-save")}),genTopic:(e,t,n)=>new Promise((i,a)=>{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=(()=>{r.onload=(()=>{$("#forum-save").remove(),console.clear(),i(!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 > header").prepend(o);const r=document.getElementById("forum-save")})},user:{getUrl:e=>{let t=void 0!==e?encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"):_userdata.user_id;return"/profile?mode=viewprofile&u="+t},getLevel:()=>new Promise((e,t)=>{switch(_userdata.user_level){case 2:e("mod");case 1:e("admin");case 0:return-1==_userdata.user_id?e("guest"):e("user")}}),getGroup:()=>new Promise((e,t)=>{FNR.user.getLevel().then(t=>{"guest"===t?e("unknown"):FNR.user.getProfile(_userdata.user_id,.25).then(t=>{e(t.colour)})})}),getProfile:(e,t)=>{const n=null!=e?FNR.user.getUrl(e):FNR.user.getUrl(),i=t||5,a=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 i={};i.name=$(t).find(".maintitle h1 span").text(),i.lastvisit=$(t).find('dt:contains("Última visita")').parent().find("dd").text(),i.colour=FNR.utility.getGroup($(t).find(".maintitle h1 span").css("color").replace("rgb(","rgb_").replace(/, /g,"_").replace(")","")),i.avatar=$(t).find(".real_avatar img").attr("src"),i.links={profile:"/u"+n.split("&u=")[1],mp:"/privmsg?mode=post&u="+n.split("&u=")[1]},i.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},i.fields={},$(t).find('dl[id^="field_id"]').each(function(){if(""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;i.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:a($(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;i.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:a($(this).find("dd"))}}}),i.fields.rango={name:"Rango",content:$(t).find('dt:contains("Rango:")').parent().find("dd").text()},e(i)})}),r=e=>{const t="userInfo"+e;return new Promise((e,n)=>{FNR.cache.useData(t,i).then(t=>{e(t)},n=>{o().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return r(e)},changeAccount:(e,t,n)=>new Promise((i,a)=>{let o=document.createElement("iframe");o.id="forum-save",o.src=e,o.width=0,o.height=0,o.onload=(()=>{o.onload=(()=>{o.onload=(()=>{console.clear(),i(!0)}),$("#forum-save").contents().find('input[name="username"]').val(t),$("#forum-save").contents().find('input[name="password"]').val(n),$("#forum-save").contents().find('input[type="submit"][name="login"]').click()}),r.src="/login?change_version=invision"}),document.querySelector("body > header").prepend(o);const r=document.getElementById("forum-save")}),profile:{getData:e=>new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const i=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const a=n;let o=[];[].forEach.call(e,e=>{let t="",n=[];switch(e.type){case"input":t=$(i).find('dl:contains("'+e.name+'")').find("dd").find("input").val();break;case"textarea":t=$(i).find('dl:contains("'+e.name+'")').find("dd").find("textarea").val();break;case"select":t=$(i).find('dl:contains("'+e.name+'")').find("dd").find("select option:selected").attr("value"),$(i).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=$(a).find(".box-content img").attr("src")}if("select"===e.type&&void 0===t||"select"===e.type&&""===t)return;let r={type:e.type,name:e.name,value:t};e.validation&&(r.validation=e.validation),n.length&&(r.options=n),o.push(r)}),t(o)})})}),setData:e=>new Promise((t,n)=>{const i=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let a=document.createElement("iframe");a.id="forum-save",a.src="/profile?change_version=invision&mode=editprofile",a.width=0,a.height=0,a.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=(()=>{i()}),$("#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"):i()}),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),document.querySelector("body > header").prepend(a);const o=document.getElementById("forum-save")}),getDrafts:()=>new Promise((e,t)=>{$.get("/search?search_id=draftsearch&change_version=invision",t=>{if(0!==parseFloat($(t).find(".maintitle > h3").text())){let n=[];$(t).find(".ipbform .ipbtable tbody > tr").each(function(){const e=$(this).find("td");n.push({topic:{name:e[1].textContent.trim(),url:Vue.filter("url-to-normal")(e[1].querySelector("a").href)},info:{location:e[2].textContent.trim(),date:e[3].textContent.trim()},modify:Vue.filter("url-to-normal")(e[4].querySelector("a").href)})}),e(n)}else e(!1)})})}},cache:{getData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content,setData:(e,t,n)=>{let i=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:i,content:t}))},delData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e),useData:(e,t)=>new Promise((n,i)=>{let a=localStorage.getItem(forumData.prefix+"_"+e),o=new Date,r=-1==t?"undefined":864e5*t;null!=a&&-1==t||null!=a&&parseInt(JSON.parse(a).cached_at)+r>o.getTime()?n(JSON.parse(a).content):i(!1)})},utility:{genSlug:(e,t)=>{const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,i=t.length;n<i;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,"-")},i=t||"_";return n(e).replace(/-/g,i)},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 i=document.createElement("div");i.id="forum-modal",document.body.appendChild(i);let a="";a+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',a+='<div class="modal-title">',a+="<h3>"+e+"</h3>",a+='<a onclick="document.getElementById(`forum-modal`).remove()">',a+='<i class="fas fa-times"></i>',a+="</a>",a+="</div>",a+='<div class="modal-content">',a+='<div class="is-content">',a+=t.replace(/\n/g,"<br>"),a+="</div>",""!==n&&null!=n&&(a+='<div class="modal-buttons">',a+=n,a+="</div>"),a+="</div>",a+="</div>",a+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=a},genPrompt:(e,t,n,i)=>{if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((a,o)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+i+'"></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;a(""!==e&&e),document.getElementById("forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{o(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{o(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{o(!1),document.getElementById("forum-modal").remove()})})},genNotification:(e,t,n,i)=>{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.getElementById("forum-notification").remove(),clearTimeout());let a=document.createElement("div");a.id="forum-notification",document.body.appendChild(a);let o="";o+=""===i||null==i?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+i+'" 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+=""===i||null==i?"</div>":"</a>",document.getElementById("forum-notification").innerHTML=o,setTimeout(()=>{document.getElementById("forum-notification").classList.add("notification-show")},500),setTimeout(()=>{document.getElementById("forum-notification").classList.remove("notification-show")},8e3),setTimeout(()=>{document.getElementById("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 i=e.parentElement.parentElement;n&&(i=i.parentElement.parentElement),i.classList.add("is-active"),i.classList.add("is-selected"),i.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(i,!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"))})})}}};
package/general.js CHANGED
@@ -6,7 +6,11 @@ console.log('https://zatrapa-gaylien.tumblr.com/');
6
6
 
7
7
  /* GENERAL */
8
8
  document.addEventListener('DOMContentLoaded', () => {
9
- document.body.classList.add('is-' + H.userLevel());
9
+ Promise.all([FNR.user.getLevel(), FNR.user.getGroup()]).then((result) => {
10
+ document.body.classList.add('is-' + result[0]);
11
+ document.body.classList.add('is-' + result[1]);
12
+ document.body.classList.add('is-user' + _userdata.user_id);
13
+ });
10
14
  });
11
15
 
12
16
  /* BLOQUE DE FORO */
@@ -23,7 +27,7 @@ document.addEventListener('DOMContentLoaded', () => {
23
27
  separated = element.outerHTML.split(element.innerHTML);
24
28
  author = element.textContent;
25
29
 
26
- element.outerHTML = '<strong><a href="' + FNR.user.profile.getUrl(author) + '" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + author + '»">' + separated[0] + Vue.filter('just-name')(author) + separated[1] + '</a></strong>';
30
+ element.outerHTML = '<strong><a href="' + FNR.user.getUrl(author) + '" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + author + '»">' + separated[0] + Vue.filter('just-name')(author) + separated[1] + '</a></strong>';
27
31
 
28
32
  if (item.querySelector('.lastpost-link')) {
29
33
  item.querySelector('.lastpost-link').title += author;
@@ -111,7 +115,7 @@ document.addEventListener('DOMContentLoaded', () => {
111
115
  [].forEach.call(document.querySelectorAll('.topic-creator'), (item) => {
112
116
  if (item.querySelector('span')) {
113
117
  if (!item.querySelector('a')) {
114
- item.innerHTML = '<strong><a href="' + FNR.user.profile.getUrl(item.textContent) + '" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + item.textContent + '»">' + item.innerHTML + '</a></strong>';
118
+ item.innerHTML = '<strong><a href="' + FNR.user.getUrl(item.textContent) + '" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + item.textContent + '»">' + item.innerHTML + '</a></strong>';
115
119
  } else {
116
120
  item.querySelector('a').title = 'Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + item.textContent + '»';
117
121
  item.innerHTML = '<strong>' + item.innerHTML + '</strong>';
@@ -151,7 +155,7 @@ document.addEventListener('DOMContentLoaded', () => {
151
155
 
152
156
  if (item.querySelector('.topic-lastauthor')) {
153
157
  if (author.querySelector('span')) {
154
- author.innerHTML = '<strong><a href="' + FNR.user.profile.getUrl(author.textContent) + '" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + author.textContent + '»">' + author.querySelector('span').outerHTML + '</a></strong>';
158
+ author.innerHTML = '<strong><a href="' + FNR.user.getUrl(author.textContent) + '" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + author.textContent + '»">' + author.querySelector('span').outerHTML + '</a></strong>';
155
159
  author.querySelector('strong strong').textContent = Vue.filter('just-name')(author.querySelector('strong strong').textContent);
156
160
 
157
161
  item.querySelector('.topic-lastauthor').outerHTML = author.innerHTML;
@@ -208,7 +212,7 @@ document.addEventListener('DOMContentLoaded', () => {
208
212
  final += '<ul class="post-datafields post-profile profile-sticky">';
209
213
  final += '<li class="datafield-user">';
210
214
  final += '<div class="datafield-name">Usuario</div>';
211
- final += '<strong><a href="' + FNR.user.profile.getUrl(author) + '" target="_blank" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + author + '»">' + author + '</a></strong>';
215
+ final += '<strong><a href="' + FNR.user.getUrl(author) + '" target="_blank" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + author + '»">' + author + '</a></strong>';
212
216
  final += '</li>';
213
217
  final += '<li class="datafield-date">';
214
218
  final += '<div class="datafield-name">Fecha</div>';
@@ -230,7 +234,7 @@ document.addEventListener('DOMContentLoaded', () => {
230
234
  item.querySelector('.post-datafields .datafield-user a').target = '_blank';
231
235
 
232
236
  if (item.querySelector('.post-datafields .datafield-user a').href === '') {
233
- item.querySelector('.post-datafields .datafield-user a').href = FNR.user.profile.getUrl(item.querySelector('.post-datafields .datafield-user a').textContent);
237
+ item.querySelector('.post-datafields .datafield-user a').href = FNR.user.getUrl(item.querySelector('.post-datafields .datafield-user a').textContent);
234
238
  }
235
239
  } else if (item.querySelector('.post-datafields .datafield-check') && item.querySelector('.post-datafields .datafield-check').children && item.querySelector('.post-datafields .datafield-check').children.length === 1) {
236
240
  item.querySelector('.post-datafields .datafield-check').remove();
@@ -342,7 +346,7 @@ document.addEventListener('DOMContentLoaded', () => {
342
346
  [].forEach.call(document.querySelectorAll('.mp-from'), (item) => {
343
347
  const color = FNR.utility.getGroup(item.querySelector('span').style.color.replace(/, /g, '_').replace(/, /g, '_').replace(/\(/g, '_').replace(/\)/g, ''));
344
348
 
345
- item.innerHTML = '<a href="' + FNR.user.profile.getUrl(item.textContent) + '" target="_blank" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + item.textContent + '»">' + item.textContent + '</a>';
349
+ item.innerHTML = '<a href="' + FNR.user.getUrl(item.textContent) + '" target="_blank" title="Ir al ' + (forumConfig.profileOptions.profileName === undefined ? 'perfil' : forumConfig.profileOptions.profileName) + ' de «' + item.textContent + '»">' + item.textContent + '</a>';
346
350
 
347
351
  let element = item.parentElement;
348
352
 
@@ -368,7 +372,7 @@ document.addEventListener('DOMContentLoaded', () => {
368
372
  url = ((index + 1) === arr.length ? window.location.pathname + window.location.search : '#');
369
373
  special += ' class="is-hidden-touch' + ((index + 1) === arr.length ? '' : ' is-active') + '"';
370
374
  } else if (url.indexOf('#profile') > -1) {
371
- url = FNR.user.profile.getUrl(text);
375
+ url = FNR.user.getUrl(text);
372
376
  }
373
377
 
374
378
  document.querySelector('#forum-breadcrumb ul').innerHTML += '<li' + special + '><a href="' + url + '" title="Ir a «' + text + '»">' + text + '</a></li>';
package/general.min.js CHANGED
@@ -1 +1 @@
1
- console.log("%cSkin 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",()=>{document.body.classList.add("is-"+H.userLevel())}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.getElementsByClassName("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.profile.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.getElementsByClassName("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.getElementsByClassName("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(.not-status)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.not-status)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .topic-status").textContent;t.indexOf("unread")>-1?e.classList.add("is-unread"):e.classList.add("is-read"),t.indexOf("locked")>-1?e.classList.add("is-closed"):t.indexOf("sticky")>1?e.classList.add("is-sticky"):t.indexOf("global_announce")>1?e.classList.add("is-global-announcement"):t.indexOf("announce")>1&&e.classList.add("is-announcement")})}),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.profile.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;e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")&&(t.querySelector("span")?(t.innerHTML='<strong><a href="'+FNR.user.profile.getUrl(t.textContent)+'" 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),e.querySelector(".topic-lastauthor").outerHTML=t.innerHTML):e.querySelector(".topic-lastauthor").outerHTML="<strong>Invitado</strong>",e.querySelector(".topic-lastauthor").outerHTML=e.querySelector(".topic-lastauthor").innerHTML),e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r)})}),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.profile.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.profile.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-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'" class="post-button">',o+='<i class="'+r.icon+'"></i>',forumConfig.nameMinibuttons&&(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.getElementById("forum-realreply")&&""===document.getElementById("forum-realreply").innerHTML&&document.getElementById("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.profile.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.getElementById("breadcrumbs")&&document.getElementById("forum-breadcrumb")&&[].forEach.call(document.getElementById("breadcrumbs").children,(e,t,o)=>{let r=e.href,n=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.profile.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 e=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),t=document.querySelector(".pag-img .sprite-arrow_prosilver_right");e&&(e.parentElement.title="Ir a la página anterior",e.parentElement.classList.add("page-action"),e.parentElement.classList.remove("pag-img"),e.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),t&&(t.parentElement.title="Ir a la página siguiente",t.parentElement.classList.add("page-action"),t.parentElement.classList.remove("pag-img"),t.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>'),[].forEach.call(document.querySelectorAll("#pagination > span > a:not(.page-action)"),e=>{e.classList.add("page-link"),e.title="Ir a la página «"+e.textContent+"»"}),document.querySelector("#pagination > span > strong").title="Página actual";const o=document.querySelector("#pagination > span").innerHTML.trim().replace(/ ... /g,'<span class="page-spacer">…</span>');[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",o),e.parentElement.classList.contains("not-show")&&e.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.title.replace(/Ver el perfil :: /g,"")+"»"})}),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("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{document.dispatchEvent(forumReady)}),document.addEventListener("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{[].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[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[data-categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[data-categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genWiki()}),document.addEventListener("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{document.querySelector(".is-input")&&[].forEach.call(document.querySelectorAll(".is-input"),e=>{e.onclick=(t=>{e.querySelector('input[type="submit"]').click()})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genDropeable()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{[].forEach.call(document.getElementsByClassName("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("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
1
+ console.log("%cSkin 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",()=>{Promise.all([FNR.user.getLevel(),FNR.user.getGroup()]).then(e=>{document.body.classList.add("is-"+e[0]),document.body.classList.add("is-"+e[1]),document.body.classList.add("is-user"+_userdata.user_id)})}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.getElementsByClassName("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.getElementsByClassName("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.getElementsByClassName("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(.not-status)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.not-status)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .topic-status").textContent;t.indexOf("unread")>-1?e.classList.add("is-unread"):e.classList.add("is-read"),t.indexOf("locked")>-1?e.classList.add("is-closed"):t.indexOf("sticky")>1?e.classList.add("is-sticky"):t.indexOf("global_announce")>1?e.classList.add("is-global-announcement"):t.indexOf("announce")>1&&e.classList.add("is-announcement")})}),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;e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")&&(t.querySelector("span")?(t.innerHTML='<strong><a href="'+FNR.user.getUrl(t.textContent)+'" 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),e.querySelector(".topic-lastauthor").outerHTML=t.innerHTML):e.querySelector(".topic-lastauthor").outerHTML="<strong>Invitado</strong>",e.querySelector(".topic-lastauthor").outerHTML=e.querySelector(".topic-lastauthor").innerHTML),e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r)})}),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-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'" class="post-button">',o+='<i class="'+r.icon+'"></i>',forumConfig.nameMinibuttons&&(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.getElementById("forum-realreply")&&""===document.getElementById("forum-realreply").innerHTML&&document.getElementById("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.getElementById("breadcrumbs")&&document.getElementById("forum-breadcrumb")&&[].forEach.call(document.getElementById("breadcrumbs").children,(e,t,o)=>{let r=e.href,n=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 e=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),t=document.querySelector(".pag-img .sprite-arrow_prosilver_right");e&&(e.parentElement.title="Ir a la página anterior",e.parentElement.classList.add("page-action"),e.parentElement.classList.remove("pag-img"),e.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),t&&(t.parentElement.title="Ir a la página siguiente",t.parentElement.classList.add("page-action"),t.parentElement.classList.remove("pag-img"),t.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>'),[].forEach.call(document.querySelectorAll("#pagination > span > a:not(.page-action)"),e=>{e.classList.add("page-link"),e.title="Ir a la página «"+e.textContent+"»"}),document.querySelector("#pagination > span > strong").title="Página actual";const o=document.querySelector("#pagination > span").innerHTML.trim().replace(/ ... /g,'<span class="page-spacer">…</span>');[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",o),e.parentElement.classList.contains("not-show")&&e.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.title.replace(/Ver el perfil :: /g,"")+"»"})}),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("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{document.dispatchEvent(forumReady)}),document.addEventListener("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{[].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[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[data-categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[data-categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[data-categorybox="'+t+'"][data-categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genWiki()}),document.addEventListener("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{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("DOMContentLoaded",()=>{document.querySelector(".is-input")&&[].forEach.call(document.querySelectorAll(".is-input"),e=>{e.onclick=(t=>{e.querySelector('input[type="submit"]').click()})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genDropeable()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{[].forEach.call(document.getElementsByClassName("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("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generic-skin",
3
- "version": "2.3.1",
3
+ "version": "2.3.5",
4
4
  "description": "Generic Forum Skin for Forumotion created by Gaylien.",
5
5
  "main": "readme.md",
6
6
  "scripts": {
@@ -1,279 +0,0 @@
1
- /*! FM HELPER v0.1.8 | Flerex | flerex.dev */
2
- (function(a, b, c) {
3
- 'use strict';
4
- console.log('%cFM Helper by %cFlerex%c.blog', 'font-family: "Open Sans", Arial, sans-serif; font-size: 1.2em;', 'font-size: 1.5em; text-transform: uppercase; letter-spacing: -1px; font-weight: 800; color: #0d5ad5;', 'color: #e42e88; text-transform: none; font-size: 1.2em; font-style: italic;'), console.log('https://flerex.dev');
5
- const d = 'FMHELPER_';
6
- a.FLX = a.FLX || {}, a.FLX.helper = function() {
7
- function h(Q) {
8
- switch (Q.body.id) {
9
- case 'phpbb':
10
- return 'phpBB3';
11
- case 'modernbb':
12
- return 'ModernBB';
13
- }
14
- return Q.getElementById('ipbwrapper') ? 'Invision' : Q.querySelector('.pun') ? 'PunBB' : Q.body.hasAttribute('bgcolor') ? 'phpBB2' : c
15
- }
16
-
17
- function m(Q) {
18
- const R = '\xE0\xE1\xE4\xE2\xE8\xE9\xEB\xEA\xEC\xED\xEF\xEE\xF2\xF3\xF6\xF4\xF9\xFA\xFC\xFB\xF1\xE7\xB7/_,:;';
19
- Q = Q.trim().toLowerCase();
20
- for (var T = 0, U = R.length; T < U; T++) Q = Q.replace(new RegExp(R.charAt(T), 'g'), 'aaaaeeeeiiiioooouuuunc------'.charAt(T));
21
- return Q.replace(/[^a-z0-9 -]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-')
22
- }
23
-
24
- function n() {
25
- return -1 != O.id
26
- }
27
-
28
- function o() {
29
- switch (_userdata.user_level) {
30
- case 2:
31
- return 'mod';
32
- case 1:
33
- return 'admin';
34
- case 0:
35
- return -1 == _userdata.user_id ? 'guest' : 'user';
36
- }
37
- }
38
-
39
- function p() {
40
- return _userdata.avatar.split('"')[1]
41
- }
42
-
43
- function r(Q, R) {
44
- return Q = Q.getTime(), R = R.getTime(), Math.floor(Math.abs(Q - R) / 8.64e7)
45
- }
46
-
47
- function s(Q, R) {
48
- if (!localStorage) return !1;
49
- const S = d + Q,
50
- T = localStorage.getItem(S);
51
- if (!T) return null;
52
- const U = JSON.parse(T),
53
- V = new Date(U.cached_at);
54
- return r(V, new Date) >= R ? (localStorage.removeItem(S), null) : U.content
55
- }
56
-
57
- function t(Q, R) {
58
- if (!localStorage) return !1;
59
- const S = {
60
- cached_at: new Date().getTime(),
61
- content: R
62
- };
63
- localStorage.setItem(d + Q, JSON.stringify(S))
64
- }
65
-
66
- function u(Q, R) {
67
- let S, T = null,
68
- U = R.querySelector('.tooltip-title'),
69
- V = R.querySelector('.tooltip-subtitle');
70
- if (!U) return null;
71
- let W = U.querySelector('span[style]');
72
- return W && (W = W.style.color), U.firstElementChild && (S = U.firstElementChild.style.color), V && (T = V.innerHTML.match(/:\s(.*)/)[1]), new User(Q, U.textContent, c, R.getElementsByTagName('img')[0].src, T, +R.querySelector('.tooltip-counts').firstChild.firstElementChild.textContent, W)
73
- }
74
-
75
- function v(Q) {
76
- return Array.from(Q).map(R => new Group(R.href.match(/\/g(\d+)-/)[1], R.textContent, R.style.color))
77
- }
78
-
79
- function w(Q) {
80
- return Q + '?change_version=' + 'invision'
81
- }
82
-
83
- function x(Q) {
84
- return /^\w+\s*:\s+(?:\[\s.+\s\]\s*)+/.test(Q.textContent)
85
- }
86
-
87
- function y(Q) {
88
- const R = Array.from(Q.body.getElementsByTagName('*')).find(x);
89
- return R ? R.querySelectorAll('a[href^="/g"]') : null
90
- }
91
-
92
- function z(Q) {
93
- const R = Array.from(Q.querySelectorAll('#fo_stat div')).find(x);
94
- return R ? R.querySelectorAll('a[href^="/g"]') : null
95
- }
96
-
97
- function A(...Q) {
98
- const [R, S] = K(Q), T = 'groups', U = s(T, S);
99
- if (null !== U) return U.forEach(W => Object.setPrototypeOf(W, Group.prototype)), Promise.resolve(U);
100
- const V = D(w('/forum')).then(W => {
101
- let X = z(W) || y(W);
102
- if (!X) throw new Error('Could not get the forums legend. Please check if {LEGEND} is set on your index_body template.');
103
- if (!X.length) return c;
104
- const Y = v(X);
105
- return t(T, Y), Y
106
- });
107
- return R && V.then(W => {
108
- R.call(this, W)
109
- }), V
110
- }
111
-
112
- function B(Q, ...R) {
113
- if (Q === c) throw new Error('User ID missing');
114
- const [S, T] = K(R), U = 'u' + Q, V = s(U, T);
115
- if (null !== V) return Object.setPrototypeOf(V, User.prototype), Promise.resolve(V);
116
- const W = D('/ajax/index.php', {
117
- data: {
118
- f: 'm',
119
- user_id: Q
120
- }
121
- }).then(X => {
122
- let Y = u(Q, X);
123
- return t(U, Y), Y
124
- });
125
- return S && W.then(X => {
126
- S.call(this, X)
127
- }), W
128
- }
129
-
130
- function C(Q) {
131
- return '?' + Object.keys(Q).map(R => encodeURIComponent(R) + '=' + encodeURIComponent(Q[R])).join('&')
132
- }
133
-
134
- function D(Q, R = {}) {
135
- return R.hasOwnProperty('data') && (Q += C(R.data)), fetch(Q, Object.assign({
136
- method: 'GET',
137
- credentials: 'include'
138
- }, R)).then(S => S.text()).then(S => {
139
- return new DOMParser().parseFromString(S, 'text/html')
140
- })
141
- }
142
-
143
- function E(Q) {
144
- 'loading' == b.readyState ? b.addEventListener('DOMContentLoaded', Q) : Q()
145
- }
146
-
147
- function G(Q) {
148
- const R = Q.querySelector('div.pagination');
149
- return !!R && Array.from(R.children).filter(S => {
150
- return 'A' == S.tagName && +S.textContent
151
- })
152
- }
153
-
154
- function H(Q) {
155
- const R = Q.querySelector('div.pagination');
156
- return !!R && parseInt(R.firstElementChild.textContent.match(/start = \(start > \d+\) \? \d+ : start;\n {4}start = \(start - \d+\) \* (\d+);/)[1])
157
- }
158
-
159
- function I(Q, R) {
160
- const S = Q.querySelector('table.ipbtable tbody tr:nth-child(2)').childNodes[1].firstElementChild.firstElementChild;
161
- return !!S && S.style.color == R
162
- }
163
-
164
- function J(Q, R) {
165
- let S = 0;
166
- return I(Q, R.color) && S++, 1 != Q.querySelector('table.ipbtable tbody tr:last-child').childElementCount && (S += Q.querySelectorAll('table.ipbtable tbody tr').length - 3), S
167
- }
168
-
169
- function K(Q) {
170
- let R = [!1, 30];
171
- return 2 == Q.length ? R = Q : 'integer' == typeof Q[0] ? R[1] = Q[0] : R[0] = Q[0], R
172
- }
173
- class User {
174
- constructor(Q, R, S, T, U, V, W) {
175
- this.id = Q, this.username = R, this.level = S, this.avatar = T, this.rank = U, this.posts = V, this.color = W
176
- }
177
- getRankAsText() {
178
- if (!this.rank) return '';
179
- let Q = new DOMParser().parseFromString(this.rank, 'text/html');
180
- return Q.body.textContent.trim()
181
- }
182
- getURL() {
183
- return `/u${this.id}`
184
- }
185
- }
186
- class Group {
187
- constructor(Q, R, S) {
188
- this.id = Q, this.name = R, this.color = S
189
- }
190
- getURL() {
191
- return `/g${this.id}-${m(this.name)}`
192
- }
193
- }
194
- const O = new User(_userdata.user_id, _userdata.username, o(), p(), _lang.hasOwnProperty('rank_title') ? _lang.rank_title : c, _userdata.user_posts, c),
195
- P = {
196
- isLoggedIn: n,
197
- userLevel: o,
198
- getGroups: A,
199
- getUser: B,
200
- slugify: m,
201
- attachScriptToChat: function(Q) {
202
- function R(T, U) {
203
- 'complete' == T.contentDocument.readyState ? U() : T.addEventListener('load', U)
204
- }
205
- let S = b.createElement('script');
206
- S.type = 'text/javascript', S.textContent = `;(${Q.toString()})();`, E(function() {
207
- const T = b.querySelectorAll('object[data^="/chatbox/index.forum"], iframe[src^="/chatbox/index.forum"]');
208
- Array.from(T).foreach(U => {
209
- R(U, function() {
210
- U.contentDocument.getElementsByTagName('head')[0].appendChild(S.cloneNode(!0))
211
- })
212
- })
213
- })
214
- },
215
- getVersion: function() {
216
- return h(b)
217
- },
218
- enableDebugMode: function() {
219
- console.warn('%cATTENTION: Debug mode is enabled', 'color: red; font-weight: bold; font-size: 1.1em;'), console.warn('CSS files are not being cached by browsers');
220
- const Q = '?debug=' + +new Date;
221
- b.querySelectorAll('link[rel="stylesheet"]').forEach(R => {
222
- R.setAttribute('href', R.getAttribute('href') + Q)
223
- })
224
- },
225
- setCache: t,
226
- getCache: s,
227
- get: D
228
- };
229
- return n() && Object.assign(P, {
230
- currentUser: function(Q) {
231
- switch (Q) {
232
- case 'id':
233
- return O.id;
234
- case 'username':
235
- case 'name':
236
- return O.username;
237
- case 'avatar':
238
- return p();
239
- case 'level':
240
- return O.level;
241
- case 'rank':
242
- return O.rank;
243
- case 'posts':
244
- return O.posts;
245
- }
246
- throw new Error('Argument is not supported')
247
- },
248
- u: O,
249
- user: O
250
- }), User.prototype.getGroup = function() {
251
- return new Promise(Q => {
252
- A().then(R => {
253
- this.color === c ? B(this.id).then(S => {
254
- Q(R.find(T => T.color == S.color))
255
- }) : Q(R.find(S => S.color == this.color))
256
- })
257
- })
258
- }, Group.prototype.getMemberAmount = function(...Q) {
259
- const [R, S] = K(Q), T = 'gc' + this.id, U = s(T, S);
260
- if (null !== U) return Promise.resolve(U);
261
- const V = D(w(`/g${this.id}-`)).then(W => {
262
- const X = G(W);
263
- if (!X.length) {
264
- const Y = J(W, this);
265
- return t(T, Y), Y
266
- }
267
- return D(X.pop().href)
268
- }).then(W => {
269
- if ('number' == typeof W) return W;
270
- const X = G(W),
271
- Y = X.length * H(W) + J(W, this);
272
- return t(T, Y), Y
273
- });
274
- return R && V.then(W => {
275
- R.call(this, W)
276
- }), V
277
- }, P
278
- }(), 'undefined' == typeof a._ && (a._ = FLX.helper), 'undefined' == typeof a.H && (a.H = FLX.helper)
279
- })(this, document);
@@ -1 +0,0 @@
1
- (function(e,t,r){"use strict";console.log("%cFM Helper by %cFlerex%c.blog",'font-family: "Open Sans", Arial, sans-serif; font-size: 1.2em;',"font-size: 1.5em; text-transform: uppercase; letter-spacing: -1px; font-weight: 800; color: #0d5ad5;","color: #e42e88; text-transform: none; font-size: 1.2em; font-style: italic;"),console.log("https://flerex.dev");const n="FMHELPER_";e.FLX=e.FLX||{},e.FLX.helper=function(){function e(e){switch(e.body.id){case"phpbb":return"phpBB3";case"modernbb":return"ModernBB"}return e.getElementById("ipbwrapper")?"Invision":e.querySelector(".pun")?"PunBB":e.body.hasAttribute("bgcolor")?"phpBB2":r}function o(e){const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var r=0,n=t.length;r<n;r++)e=e.replace(new RegExp(t.charAt(r),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(r));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}function s(){return-1!=q.id}function i(){switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}}function l(){return _userdata.avatar.split('"')[1]}function a(e,t){return e=e.getTime(),t=t.getTime(),Math.floor(Math.abs(e-t)/864e5)}function c(e,t){if(!localStorage)return!1;const r=n+e,o=localStorage.getItem(r);if(!o)return null;const s=JSON.parse(o),i=new Date(s.cached_at);return a(i,new Date)>=t?(localStorage.removeItem(r),null):s.content}function u(e,t){if(!localStorage)return!1;const r={cached_at:(new Date).getTime(),content:t};localStorage.setItem(n+e,JSON.stringify(r))}function h(e,t){let n,o=null,s=t.querySelector(".tooltip-title"),i=t.querySelector(".tooltip-subtitle");if(!s)return null;let l=s.querySelector("span[style]");return l&&(l=l.style.color),s.firstElementChild&&(n=s.firstElementChild.style.color),i&&(o=i.innerHTML.match(/:\s(.*)/)[1]),new L(e,s.textContent,r,t.getElementsByTagName("img")[0].src,o,+t.querySelector(".tooltip-counts").firstChild.firstElementChild.textContent,l)}function f(e){return Array.from(e).map(e=>new O(e.href.match(/\/g(\d+)-/)[1],e.textContent,e.style.color))}function d(e){return e+"?change_version=invision"}function m(e){return/^\w+\s*:\s+(?:\[\s.+\s\]\s*)+/.test(e.textContent)}function g(e){const t=Array.from(e.body.getElementsByTagName("*")).find(m);return t?t.querySelectorAll('a[href^="/g"]'):null}function p(e){const t=Array.from(e.querySelectorAll("#fo_stat div")).find(m);return t?t.querySelectorAll('a[href^="/g"]'):null}function y(...e){const[t,n]=A(e),o="groups",s=c(o,n);if(null!==s)return s.forEach(e=>Object.setPrototypeOf(e,O.prototype)),Promise.resolve(s);const i=w(d("/forum")).then(e=>{let t=p(e)||g(e);if(!t)throw new Error("Could not get the forums legend. Please check if {LEGEND} is set on your index_body template.");if(!t.length)return r;const n=f(t);return u(o,n),n});return t&&i.then(e=>{t.call(this,e)}),i}function b(e,...t){if(e===r)throw new Error("User ID missing");const[n,o]=A(t),s="u"+e,i=c(s,o);if(null!==i)return Object.setPrototypeOf(i,L.prototype),Promise.resolve(i);const l=w("/ajax/index.php",{data:{f:"m",user_id:e}}).then(t=>{let r=h(e,t);return u(s,r),r});return n&&l.then(e=>{n.call(this,e)}),l}function S(e){return"?"+Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}function w(e,t={}){return t.hasOwnProperty("data")&&(e+=S(t.data)),fetch(e,Object.assign({method:"GET",credentials:"include"},t)).then(e=>e.text()).then(e=>(new DOMParser).parseFromString(e,"text/html"))}function x(e){"loading"==t.readyState?t.addEventListener("DOMContentLoaded",e):e()}function C(e){const t=e.querySelector("div.pagination");return!!t&&Array.from(t.children).filter(e=>"A"==e.tagName&&+e.textContent)}function E(e){const t=e.querySelector("div.pagination");return!!t&&parseInt(t.firstElementChild.textContent.match(/start = \(start > \d+\) \? \d+ : start;\n {4}start = \(start - \d+\) \* (\d+);/)[1])}function v(e,t){const r=e.querySelector("table.ipbtable tbody tr:nth-child(2)").childNodes[1].firstElementChild.firstElementChild;return!!r&&r.style.color==t}function _(e,t){let r=0;return v(e,t.color)&&r++,1!=e.querySelector("table.ipbtable tbody tr:last-child").childElementCount&&(r+=e.querySelectorAll("table.ipbtable tbody tr").length-3),r}function A(e){let t=[!1,30];return 2==e.length?t=e:"integer"==typeof e[0]?t[1]=e[0]:t[0]=e[0],t}class L{constructor(e,t,r,n,o,s,i){this.id=e,this.username=t,this.level=r,this.avatar=n,this.rank=o,this.posts=s,this.color=i}getRankAsText(){if(!this.rank)return"";let e=(new DOMParser).parseFromString(this.rank,"text/html");return e.body.textContent.trim()}getURL(){return`/u${this.id}`}}class O{constructor(e,t,r){this.id=e,this.name=t,this.color=r}getURL(){return`/g${this.id}-${o(this.name)}`}}const q=new L(_userdata.user_id,_userdata.username,i(),l(),_lang.hasOwnProperty("rank_title")?_lang.rank_title:r,_userdata.user_posts,r),D={isLoggedIn:s,userLevel:i,getGroups:y,getUser:b,slugify:o,attachScriptToChat:function(e){function r(e,t){"complete"==e.contentDocument.readyState?t():e.addEventListener("load",t)}let n=t.createElement("script");n.type="text/javascript",n.textContent=`;(${e.toString()})();`,x(function(){const e=t.querySelectorAll('object[data^="/chatbox/index.forum"], iframe[src^="/chatbox/index.forum"]');Array.from(e).foreach(e=>{r(e,function(){e.contentDocument.getElementsByTagName("head")[0].appendChild(n.cloneNode(!0))})})})},getVersion:function(){return e(t)},enableDebugMode:function(){console.warn("%cATTENTION: Debug mode is enabled","color: red; font-weight: bold; font-size: 1.1em;"),console.warn("CSS files are not being cached by browsers");const e="?debug="+ +new Date;t.querySelectorAll('link[rel="stylesheet"]').forEach(t=>{t.setAttribute("href",t.getAttribute("href")+e)})},setCache:u,getCache:c,get:w};return s()&&Object.assign(D,{currentUser:function(e){switch(e){case"id":return q.id;case"username":case"name":return q.username;case"avatar":return l();case"level":return q.level;case"rank":return q.rank;case"posts":return q.posts}throw new Error("Argument is not supported")},u:q,user:q}),L.prototype.getGroup=function(){return new Promise(e=>{y().then(t=>{this.color===r?b(this.id).then(r=>{e(t.find(e=>e.color==r.color))}):e(t.find(e=>e.color==this.color))})})},O.prototype.getMemberAmount=function(...e){const[t,r]=A(e),n="gc"+this.id,o=c(n,r);if(null!==o)return Promise.resolve(o);const s=w(d(`/g${this.id}-`)).then(e=>{const t=C(e);if(!t.length){const t=_(e,this);return u(n,t),t}return w(t.pop().href)}).then(e=>{if("number"==typeof e)return e;const t=C(e),r=t.length*E(e)+_(e,this);return u(n,r),r});return t&&s.then(e=>{t.call(this,e)}),s},D}(),void 0===e._&&(e._=FLX.helper),void 0===e.H&&(e.H=FLX.helper)})(this,document);