generic-skin 2.5.3 → 2.9.56
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.
- package/apps/vueChrono.js +70 -69
- package/apps/vueChrono.min.js +1 -1
- package/apps/vueDefault.js +462 -117
- package/apps/vueDefault.min.js +2 -4
- package/apps/vueMulti.js +71 -61
- package/apps/vueMulti.min.js +1 -1
- package/apps/vueRela.js +68 -67
- package/apps/vueRela.min.js +1 -1
- package/config/vueComponents.js +161 -194
- package/config/vueComponents.min.js +2 -2
- package/config/vueElements.js +1 -1
- package/config/vueElements.min.js +1 -1
- package/config/vueFilters.js +6 -0
- package/config/vueFilters.min.js +1 -1
- package/extensions/vueRouter.js +1 -1
- package/extensions/vueRouter.min.js +0 -0
- package/frameworks/FNRFramework.js +1145 -860
- package/frameworks/FNRFramework.min.js +1 -1
- package/general.js +95 -41
- package/general.min.js +1 -1
- package/options/noManagers.js +18 -18
- package/options/noManagers.min.js +1 -1
- package/package.json +1 -1
- package/pages/ucp.js +49 -13
- package/pages/ucp.min.js +1 -1
- package/plugins/sjcl.min.js +0 -0
- package/readme.md +0 -0
- package/stylesheet.css +58 -27
- package/stylesheet.min.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:(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(".membername span").text().trim(),id:$(e).find(".popupmenu .popupmenu-item a").attr("href").split("?")[0],img:$(e).find(".mini-avatar img").attr("src"),color:t}),o=t=>{let n=[];return $(t).find(".member-list .member").each(function(){const t=FNR.utility.getGroup($(this).find(".membername span").attr("style").split("color:")[1]);e?n.push(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"))})})}}};
|
|
1
|
+
const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:async(e,t)=>{const n=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();i.push({name:t.text().trim(),url:Vue.filter("url-to-normal")(t.attr("href")),lastpost:{url:Vue.filter("url-to-normal")(n.children().last().attr("href")),date:n.text().split("por")[0].trim(),who:{name:n.find("strong a").length?n.find("strong a").text().trim():"Invitado",url:Vue.filter("url-to-normal")(n.find("strong a").length?n.find("strong a").attr("href"):"/"),color:n.find("strong a").length?n.find("strong a span").attr("style").split("color:")[1]:"initial"}},forum:{name:$(e).find(".row2 + .row2:not(.centered) a").text().trim(),url:Vue.filter("url-to-normal")($(e).find(".row2 + .row2:not(.centered) a").attr("href"))}})},r=async a=>{$.get(a,a=>($(a).find(".ipbform").find("tbody").find("tr").each(function(){i.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&n(this)}),i.length!==t&&$(a).find(".pagination")[0].children.length&&"b"!==$(a).find(".pagination").children().last()[0].localName?r($(a).find(".pagination").children().last().attr("href")):i))};await r("/latest?change_version=invision");let i=[];return i},getMembers:e=>new Promise((t,n)=>{let r=[];const i=(e,t)=>({user:$(e).find(".membername span").text().trim(),id:$(e).find(".popupmenu .popupmenu-item a").attr("href").split("?")[0],img:$(e).find(".mini-avatar img").attr("src"),color:t}),a=t=>{let n=[];return $(t).find(".member-list .member").each(function(){const t=FNR.utility.getGroup($(this).find(".membername span").attr("style").split("color:")[1]);e?n.push(i(this,t)):"unknown"!==t&&t!==forumConfig.skinOptions.adminGroup&&n.push(i(this,t))}),n},o=e=>{$.get(e,e=>{const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;r=r.concat(a(e)),n?o(n):t(r.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};o("/memberlist?change_version=invision")}),getGroups:e=>{const t=()=>new Promise((e,t)=>{$.get("/groups?change_version=invision",t=>{let n=[];$(t).find(".group_list > li").each(function(){n.push({id:parseInt($(this).find("a").attr("href").split("/g")[1].split("-")[0]),name:$(this).find("a").text().trim(),color:$(this).find("a").css("color"),url:Vue.filter("url-to-normal")($(this).find("a").attr("href")),count:parseInt($(this).find("div > span").text())-1})}),e(n)})}),n=()=>new Promise((n,r)=>{FNR.cache.useData("groups",e).then(e=>{n(e)},e=>{t().then(e=>{FNR.cache.setData("groups",e),n(e)})})});return n()},getAffiliates:()=>new Promise((e,t)=>{const n=forumConfig.affiliatesMax,r=Object.entries(forumAffiliates).map(e=>{let t="";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 r=0;r<n[e[0]]-e[1].length;r++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'"/></a></li>';return t});e({normal:r[0],elite:r[1],directory:r[2],sister:r[3]})})},content:{isAutosave:()=>void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t),post:{getPost:e=>new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const r=$(n).find("#p"+e.split("#")[1]);t({author:{text:r.find(".author a").text(),color:r.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(r.find(".author a").attr("href"))},content:r.find(".post-entry > div").html(),date:r.find(".author").html().split("</a>")[1]})})}),genPost:(e,t)=>new Promise((n,r)=>{let i=document.createElement("iframe");i.id="forum-save",i.src="/post?t="+e+"&mode=reply&change_version=invision",i.width=0,i.height=0,i.onload=(()=>{a.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(i);const a=document.getElementById("forum-save")})},topic:{getType:e=>{const t=[];return e.indexOf("unread")>-1?t.push("is-unread"):t.push("is-read"),e.indexOf("locked")>-1?t.push("is-closed"):e.indexOf("sticky")>1?t.push("is-sticky"):e.indexOf("global_announce")>1?t.push("is-global-announcement"):e.indexOf("announce")>1&&t.push("is-announcement"),t},genTopic:(e,t,n)=>new Promise((r,i)=>{let a=document.createElement("iframe");a.id="forum-save",a.src="/post?f="+e+"&mode=newtopic&change_version=invision",a.width=0,a.height=0,a.onload=(()=>{o.onload=(()=>{$("#forum-save").remove(),console.clear(),r(!0)}),$("#forum-save").contents().find('dl dt:contains("Título del tema")').parent().find("input").val(t),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(n),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body > header").prepend(a);const o=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:async()=>{switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}},getGroup:async()=>{const e=await FNR.user.getLevel();if("guest"===e)return"unknown";const{colour:t}=await FNR.user.getProfile(_userdata.user_id,.25);return t},getProfile:(e,t)=>{const n=null!=e?FNR.user.getUrl(e):FNR.user.getUrl(),r=t||5,i=e=>e.find("a").length?Vue.filter("url-to-normal")(e.find("a").attr("href")):e.find("table").length?e.find("table").html():e.find("img").length?e.find("img").attr("src"):e.find("textarea").length?e.find("textarea").val():e.find("span").length?e.find("span").text().trim():"-"===e.text().trim()?"":e.text(),a=()=>new Promise((e,t)=>{$.get(n+"&change_version=invision",t=>{let r={};r.name=$(t).find(".maintitle h1 span").text(),r.lastvisit=$(t).find('dt:contains("Última visita")').parent().find("dd").text(),r.colour=FNR.utility.getGroup($(t).find(".maintitle h1 span").css("color").replace("rgb(","rgb_").replace(/, /g,"_").replace(")","")),r.avatar=$(t).find(".real_avatar img").attr("src"),r.links={profile:"/u"+n.split("&u=")[1],mp:"/privmsg?mode=post&u="+n.split("&u=")[1]},r.messages={public:parseInt($(t).find('span:contains("Mensajes")').parent().parent().find("dd > div").text())||0,private:parseInt($(t).find('dt:contains("Mensajes privados")').parent().find("dd").text())||0},r.fields={},$(t).find('dl[id^="field_id"]').each(function(){if(""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;r.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:i($(this).find("dd .field_uneditable"))}}}),$(t).find(".ipbform2 > dl").each(function(){if($(this).find("dt span").length&&""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;r.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:i($(this).find("dd"))}}}),r.fields.rango={name:"Rango",content:$(t).find('dt:contains("Rango:")').parent().find("dd").text()},e(r)})}),o=e=>{const t=`userInfo${e}`;return new Promise((e,n)=>{FNR.cache.useData(t,r).then(t=>{e(t)},n=>{a().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return o(e)},changeAccount:async(e,t,n)=>{try{return await fetch(e),await fetch("/login",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`username=${encodeURIComponent(t)}&password=${encodeURIComponent(n)}&autologin=1&login=1`}),!0}catch(e){return console.error("Error inesperado",e),!1}},followed:{getPages:async()=>{try{const e=await fetch("/search?search_id=watchsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let i=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],a=parseInt(n.join(""))||0,o=r[1],l=o.href.split(o.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===a?0:a/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=watchsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=watchsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getFollowed:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{id:parseInt(t[7].children[0].value),name:t[1].querySelector(".topictitle").textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector(".topictitle").href),views:parseInt(t[5].textContent),replies:parseInt(t[3].textContent),type:FNR.content.topic.getType(t[0].querySelector("img").src).join(" ")}})}catch(e){return console.error("Error inesperado",e),!1}},delFollowed:async e=>{try{return await fetch("/search?search_id=watchsearch",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${e.map(e=>`&mark${encodeURIComponent("[]")}2=${e}`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},drafts:{delDrafts:async(e,t)=>{try{const n="draft"===e?"draft":"topic_draft";return await fetch(`/search?search_id=${e}search`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${t.map(e=>`&delete_${n}${encodeURIComponent(`[${e}]`)}=on`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}},messages:{getPages:async()=>{try{const e=await fetch("/search?search_id=draftsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let i=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],a=parseInt(n.join(""))||0,o=r[1],l=o.href.split(o.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===a?0:a/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=draftsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=draftsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getDrafts:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{topic:{name:t[1].textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector("a").href)},info:{location:t[2].textContent.trim(),date:t[3].textContent.trim()},modify:Vue.filter("url-to-normal")(t[4].querySelector("a").href)}})}catch(e){return console.error("Error inesperado",e),!1}}},topics:{getPages:async()=>{try{const e=await fetch("/search?search_id=topicdraftsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const r=n.querySelectorAll(".pagination a");let i=[];if(r.length){const e=r[r.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],a=parseInt(n.join(""))||0,o=r[1],l=o.href.split(o.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===a?0:a/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=topicdraftsearch&start=${c*(t+1)}&change_version=invision`)}return{items:1===n.querySelectorAll(".ipbtable tbody tr td").length?0:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=topicdraftsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getDrafts:async e=>{try{const t=await fetch(e),n=await t.text(),r=document.createElement("html");return r.innerHTML=n,Array.from(r.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{topic:{name:t[0].textContent.trim(),url:Vue.filter("url-to-normal")(t[0].querySelector("a").href)},info:{location:t[1].textContent.trim(),date:t[2].textContent.trim()},modify:Vue.filter("url-to-normal")(t[3].querySelector("a").href)}})}catch(e){return console.error("Error inesperado",e),!1}}}},profile:{getData:e=>new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const r=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const i=n;let a=[];[].forEach.call(e,e=>{let t="",n=[];switch(e.type){case"input":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("input").val();break;case"textarea":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("textarea").val();break;case"select":t=$(r).find('dl:contains("'+e.name+'")').find("dd").find("select option:selected").attr("value"),$(r).find('dl:contains("'+e.name+'")').find("dd").find("select option").each(function(){""!==$(this).attr("value")&&n.push({name:$(this).text(),value:$(this).attr("value")})});break;case"avatar":t=$(i).find(".box-content img").attr("src")}if("select"===e.type&&void 0===t||"select"===e.type&&""===t)return;let o={type:e.type,name:e.name,value:t};e.validation&&(o.validation=e.validation),n.length&&(o.options=n),a.push(o)}),t(a)})})}),setData:e=>new Promise((t,n)=>{const r=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let i=document.createElement("iframe");i.id="forum-save",i.src="/profile?change_version=invision&mode=editprofile",i.width=0,i.height=0,i.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),a.onload=(()=>{t?(a.onload=(()=>{a.onload=(()=>{r()}),$("#forum-save").contents().find('input[name="avatarremoteurl"]').val(t),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),a.src="/profile?change_version=invision&mode=editprofile&page_profil=avatars"):r()}),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),document.querySelector("body > header").prepend(i);const a=document.getElementById("forum-save")})}},cache:{getData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content,setData:(e,t,n)=>{let r=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:r,content:t}))},delData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e),useData:async(e,t)=>{const n=localStorage.getItem(forumData.prefix+"_"+e),r=new Date,i=-1==t?"undefined":864e5*t;return null!=n&&-1==t||null!=n&&parseInt(JSON.parse(n).cached_at)+i>r.getTime()?JSON.parse(n).content:Promise.reject(!1)}},utility:{genSlug:(e,t)=>{const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,r=t.length;n<r;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},r=t||"_";return n(e).replace(/-/g,r)},genArray:e=>JSON.parse(e.replace(/`/g,'"')),genValidation:e=>{let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getGroup:e=>{const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)}},html:{genModal:(e,t,n)=>{if(""===e||null==e)return;if(""===t||null==t)return;let r=document.createElement("div");r.id="forum-modal",document.body.appendChild(r);let i="";i+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',i+='<div class="modal-title">',i+="<h3>"+e+"</h3>",i+='<a onclick="document.getElementById(`forum-modal`).remove()">',i+='<i class="fas fa-times"></i>',i+="</a>",i+="</div>",i+='<div class="modal-content">',i+='<div class="is-content">',i+=t.replace(/\n/g,"<br>"),i+="</div>",""!==n&&null!=n&&(i+='<div class="modal-buttons">',i+=n,i+="</div>"),i+="</div>",i+="</div>",i+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=i},genPrompt:(e,t,n,r)=>{if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((i,a)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+r+'"></p>','<button id="modal-button-enter" class="button1 btn-main">Confirmar</button><button id="modal-button-cancel" class="button1">Cancelar</button>'),document.querySelector("#modal-button-enter").onclick=(()=>{const e=document.querySelector("#modal-prompt").value;i(""!==e&&e),document.getElementById("forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{a(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{a(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{a(!1),document.getElementById("forum-modal").remove()})})},genNotification:(e,t,n,r)=>{if(""===e||null==e)return;if(""===t||null==t)return;if(t.length>50)return;if(""===n||null==n)return;document.querySelectorAll("forum-notification").length&&(document.getElementById("forum-notification").remove(),clearTimeout());let i=document.createElement("div");i.id="forum-notification",document.body.appendChild(i);let a="";a+=""===r||null==r?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+r+'" target="_blank" id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >',a+='<div class="notification-icon">',a+='<i class="'+n+'"></i>',a+="</div>",a+='<div class="notification-content">',a+="<h3>"+e+"</h3>",a+="<p>"+t+"</p>",a+="</div>",a+='<div class="notification-controls">',a+='<i class="fas fa-times"></i>',a+="</div>",a+=""===r||null==r?"</div>":"</a>",document.getElementById("forum-notification").innerHTML=a,setTimeout(()=>{document.getElementById("forum-notification").classList.add("notification-show")},250),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 r=e.parentElement.parentElement;n&&(r=r.parentElement.parentElement),r.classList.add("is-active"),r.classList.add("is-selected"),r.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(r,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:()=>{document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})},genControls:()=>{document.querySelector(".forum-controls")&&[].forEach.call(document.querySelectorAll(".forum-controls"),e=>{let t=0;[].forEach.call(e.children,e=>{"none"!==window.getComputedStyle(e,null).display&&(t+=e.children.length)}),0===t&&!1===e.classList.contains("not-show")&&e.classList.add("not-show")})},genPagelist:(e,t)=>{if(e.length<5)return e;switch(t){case 0:return[e[t],e[t+1],e[t+2],e[t+3],e[t+4]];case 1:return[e[t-1],e[t],e[t+1],e[t+2],e[t+3]];case t.length-1:return[e[t-4],e[t-3],e[t-2],e[t-1],e[t]];case t.length-2:return[e[t-3],e[t-2],e[t-1],e[t],e[t+1]];default:return[e[t-2],e[t-1],e[t],e[t+1],e[t+2]]}},genDebounce:(e,t=300)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}}};
|
package/general.js
CHANGED
|
@@ -5,12 +5,15 @@ console.log(
|
|
|
5
5
|
console.log('https://zatrapa-gaylien.tumblr.com/');
|
|
6
6
|
|
|
7
7
|
/* GENERAL */
|
|
8
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
9
|
-
Promise.all([FNR.user.getLevel(), FNR.user.getGroup()])
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
document.addEventListener('DOMContentLoaded', async () => {
|
|
9
|
+
const [level, group] = await Promise.all([FNR.user.getLevel(), FNR.user.getGroup()]);
|
|
10
|
+
|
|
11
|
+
document.body.classList.add(`is-${level}`);
|
|
12
|
+
document.body.classList.add(`is-${group}`);
|
|
13
|
+
|
|
14
|
+
if (level !== 'guest') {
|
|
15
|
+
document.body.classList.add(`is-user${_userdata.user_id}`);
|
|
16
|
+
}
|
|
14
17
|
});
|
|
15
18
|
|
|
16
19
|
/* BLOQUE DE FORO */
|
|
@@ -86,25 +89,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
86
89
|
/* BLOQUE DE LISTADO DE TEMAS */
|
|
87
90
|
/* Estado y tipo de tema */
|
|
88
91
|
document.addEventListener('DOMContentLoaded', () => {
|
|
89
|
-
if (document.querySelector('.topiclist-topics li:not(.not-
|
|
90
|
-
[].forEach.call(document.querySelectorAll('.topiclist-topics li:not(.not-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
item.classList.add('is-unread');
|
|
95
|
-
} else {
|
|
96
|
-
item.classList.add('is-read');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (element.indexOf('locked') > -1) {
|
|
100
|
-
item.classList.add('is-closed');
|
|
101
|
-
} else if (element.indexOf('sticky') > 1) {
|
|
102
|
-
item.classList.add('is-sticky');
|
|
103
|
-
} else if (element.indexOf('global_announce') > 1) {
|
|
104
|
-
item.classList.add('is-global-announcement');
|
|
105
|
-
} else if (element.indexOf('announce') > 1) {
|
|
106
|
-
item.classList.add('is-announcement');
|
|
107
|
-
}
|
|
92
|
+
if (document.querySelector('.topiclist-topics li:not(.is-not-topic)')) {
|
|
93
|
+
[].forEach.call(document.querySelectorAll('.topiclist-topics li:not(.is-not-topic)'), (item) => {
|
|
94
|
+
[].forEach.call(FNR.content.topic.getType(item.querySelector('.topiclist-topic .to-process .topic-status').textContent), (type) => {
|
|
95
|
+
item.classList.add(type);
|
|
96
|
+
});
|
|
108
97
|
});
|
|
109
98
|
}
|
|
110
99
|
});
|
|
@@ -365,7 +354,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
365
354
|
if (document.getElementById('breadcrumbs') && document.getElementById('forum-breadcrumb')) {
|
|
366
355
|
[].forEach.call(document.getElementById('breadcrumbs').children, (item, index, arr) => {
|
|
367
356
|
let url = item.href,
|
|
368
|
-
text = item.text,
|
|
357
|
+
text = Vue.filter('mini-sanitize')(item.text),
|
|
369
358
|
special = '';
|
|
370
359
|
|
|
371
360
|
if (url.match(/c(\d+)-/) || (index + 1) === arr.length) {
|
|
@@ -398,35 +387,95 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
398
387
|
/* Paginación */
|
|
399
388
|
document.addEventListener('DOMContentLoaded', () => {
|
|
400
389
|
if (document.querySelector('#pagination') && document.querySelector('#pagination').children.length) {
|
|
390
|
+
const getPageInfo = () => {
|
|
391
|
+
const pageLinks = Array.from(document.querySelectorAll('#pagination > span > *:not(.pag-img):not(.page-sep)'));
|
|
392
|
+
let pageStructure = [window.location.origin + window.location.pathname.split('-', 1), '']
|
|
393
|
+
|
|
394
|
+
if (window.location.href.match(/p[0-9]*-/) !== null) {
|
|
395
|
+
pageStructure = window.location.href.split(window.location.href.match(/p[0-9]*-/)[0]);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (!pageLinks.length) {
|
|
399
|
+
return {
|
|
400
|
+
currentPage: 1,
|
|
401
|
+
totalPages: 1,
|
|
402
|
+
pageStructure: {
|
|
403
|
+
start: pageStructure[0],
|
|
404
|
+
end: pageStructure[1]
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return {
|
|
410
|
+
currentPage: parseInt(document.querySelector('#pagination > span > strong').textContent),
|
|
411
|
+
totalPages: parseInt(pageLinks[pageLinks.length - 1].textContent),
|
|
412
|
+
pageStructure: {
|
|
413
|
+
start: pageStructure[0],
|
|
414
|
+
end: pageStructure[1]
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const pageData = getPageInfo();
|
|
401
420
|
const leftButton = document.querySelector('.pag-img .sprite-arrow_prosilver_left');
|
|
402
421
|
const rightButton = document.querySelector('.pag-img .sprite-arrow_prosilver_right');
|
|
403
422
|
|
|
404
423
|
if (leftButton) {
|
|
405
424
|
leftButton.parentElement.title = 'Ir a la página anterior';
|
|
406
|
-
leftButton.parentElement.classList.add('page-
|
|
425
|
+
leftButton.parentElement.classList.add('page-prev');
|
|
407
426
|
leftButton.parentElement.classList.remove('pag-img');
|
|
408
427
|
leftButton.parentElement.innerHTML = '<i class="fas fa-chevron-left"></i>';
|
|
409
428
|
}
|
|
410
429
|
|
|
411
430
|
if (rightButton) {
|
|
412
431
|
rightButton.parentElement.title = 'Ir a la página siguiente';
|
|
413
|
-
rightButton.parentElement.classList.add('page-
|
|
432
|
+
rightButton.parentElement.classList.add('page-next');
|
|
414
433
|
rightButton.parentElement.classList.remove('pag-img');
|
|
415
434
|
rightButton.parentElement.innerHTML = '<i class="fas fa-chevron-right"></i>';
|
|
416
435
|
}
|
|
417
436
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
item.title = 'Ir a la página «' + item.textContent + '»';
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
document.querySelector('#pagination > span > strong').title = 'Página actual';
|
|
437
|
+
const prevPage = document.querySelector('.page-prev');
|
|
438
|
+
const nextPage = document.querySelector('.page-next');
|
|
424
439
|
|
|
425
|
-
const pagination =
|
|
440
|
+
const pagination = `
|
|
441
|
+
${prevPage === null ? '' : `<div class="page-action">${prevPage.outerHTML}</div>`}
|
|
442
|
+
<span class="pagination-input"><input type="text" placeholder="${pageData.currentPage}" />de ${pageData.totalPages}</span>
|
|
443
|
+
${nextPage === null ? '' : `<div class="page-action">${nextPage.outerHTML}</div>`}
|
|
444
|
+
`;
|
|
426
445
|
|
|
427
446
|
[].forEach.call(document.querySelectorAll('.page-pagination'), (item) => {
|
|
428
447
|
item.insertAdjacentHTML('afterbegin', pagination);
|
|
429
448
|
|
|
449
|
+
const inputSelector = item.querySelector('.pagination-input input');
|
|
450
|
+
|
|
451
|
+
inputSelector.onkeydown = (event) => {
|
|
452
|
+
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight'];
|
|
453
|
+
|
|
454
|
+
if (event.key.match(/[0-9]/) === null && allowedKeys.indexOf(event.key) === -1) {
|
|
455
|
+
event.preventDefault();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
console.log(event.target.value);
|
|
459
|
+
|
|
460
|
+
if (parseInt(inputSelector.value) + parseInt(event.key) < 1 || parseInt(inputSelector.value) + parseInt(event.key) > pageData.totalPages) {
|
|
461
|
+
event.preventDefault();
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
inputSelector.onkeyup = FNR.behaviour.genDebounce((event) => {
|
|
466
|
+
|
|
467
|
+
console.log(event.target.value);
|
|
468
|
+
if (event.key.match(/[0-9]/) === null) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (parseInt(inputSelector.value) < 1 || parseInt(inputSelector.value) > pageData.totalPages) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
window.location.replace(`${pageData.pageStructure.start}p${(parseInt(inputSelector.value) - 1) * forumConfig.skinOptions.paginationDefault}-${pageData.pageStructure.end}`);
|
|
477
|
+
}, 750)
|
|
478
|
+
|
|
430
479
|
if (item.parentElement.classList.contains('not-show')) {
|
|
431
480
|
item.parentElement.classList.remove('not-show');
|
|
432
481
|
}
|
|
@@ -559,6 +608,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
559
608
|
}
|
|
560
609
|
});
|
|
561
610
|
|
|
611
|
+
/* Controles del foro */
|
|
612
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
613
|
+
FNR.behaviour.genControls();
|
|
614
|
+
});
|
|
615
|
+
|
|
562
616
|
/* Ejecutar evento */
|
|
563
617
|
document.addEventListener('DOMContentLoaded', () => {
|
|
564
618
|
document.dispatchEvent(forumReady);
|
|
@@ -585,16 +639,16 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
585
639
|
|
|
586
640
|
if (item.classList.contains('is-toggle')) {
|
|
587
641
|
item.onclick = () => {
|
|
588
|
-
document.querySelector('.is-clickbox[
|
|
589
|
-
document.querySelector('.is-selectbox[
|
|
642
|
+
document.querySelector('.is-clickbox[categorybox="' + category + '"][categoryid="' + id + '"]').classList.toggle('is-active');
|
|
643
|
+
document.querySelector('.is-selectbox[categorybox="' + category + '"][categoryid="' + id + '"]').classList.toggle('is-active');
|
|
590
644
|
};
|
|
591
645
|
} else {
|
|
592
646
|
item.onclick = () => {
|
|
593
|
-
document.querySelector('.is-clickbox.is-active[
|
|
594
|
-
document.querySelector('.is-clickbox[
|
|
647
|
+
document.querySelector('.is-clickbox.is-active[categorybox="' + category + '"]').classList.remove('is-active');
|
|
648
|
+
document.querySelector('.is-clickbox[categorybox="' + category + '"][categoryid="' + id + '"]').classList.add('is-active');
|
|
595
649
|
|
|
596
|
-
document.querySelector('.is-selectbox.is-active[
|
|
597
|
-
document.querySelector('.is-selectbox[
|
|
650
|
+
document.querySelector('.is-selectbox.is-active[categorybox="' + category + '"]').classList.remove('is-active');
|
|
651
|
+
document.querySelector('.is-selectbox[categorybox="' + category + '"][categoryid="' + id + '"]').classList.add('is-active');
|
|
598
652
|
};
|
|
599
653
|
}
|
|
600
654
|
});
|
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",()=>{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(/</g,"<").replace(/>/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",async()=>{const[e,t]=await Promise.all([FNR.user.getLevel(),FNR.user.getGroup()]);document.body.classList.add(`is-${e}`),document.body.classList.add(`is-${t}`),"guest"!==e&&document.body.classList.add(`is-user${_userdata.user_id}`)}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.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(.is-not-topic)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-topic)"),e=>{[].forEach.call(FNR.content.topic.getType(e.querySelector(".topiclist-topic .to-process .topic-status").textContent),t=>{e.classList.add(t)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;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=Vue.filter("mini-sanitize")(e.text),l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const e=()=>{const e=Array.from(document.querySelectorAll("#pagination > span > *:not(.pag-img):not(.page-sep)"));let t=[window.location.origin+window.location.pathname.split("-",1),""];return null!==window.location.href.match(/p[0-9]*-/)&&(t=window.location.href.split(window.location.href.match(/p[0-9]*-/)[0])),e.length?{currentPage:parseInt(document.querySelector("#pagination > span > strong").textContent),totalPages:parseInt(e[e.length-1].textContent),pageStructure:{start:t[0],end:t[1]}}:{currentPage:1,totalPages:1,pageStructure:{start:t[0],end:t[1]}}},t=e(),o=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),r=document.querySelector(".pag-img .sprite-arrow_prosilver_right");o&&(o.parentElement.title="Ir a la página anterior",o.parentElement.classList.add("page-prev"),o.parentElement.classList.remove("pag-img"),o.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),r&&(r.parentElement.title="Ir a la página siguiente",r.parentElement.classList.add("page-next"),r.parentElement.classList.remove("pag-img"),r.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>');const n=document.querySelector(".page-prev"),l=document.querySelector(".page-next"),a=`\n ${null===n?"":`<div class="page-action">${n.outerHTML}</div>`}\n <span class="pagination-input"><input type="text" placeholder="${t.currentPage}" />de ${t.totalPages}</span>\n ${null===l?"":`<div class="page-action">${l.outerHTML}</div>`}\n `;[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",a);const o=e.querySelector(".pagination-input input");o.onkeydown=(e=>{const r=["Backspace","Delete","Tab","ArrowLeft","ArrowRight"];null===e.key.match(/[0-9]/)&&-1===r.indexOf(e.key)&&e.preventDefault(),console.log(e.target.value),(parseInt(o.value)+parseInt(e.key)<1||parseInt(o.value)+parseInt(e.key)>t.totalPages)&&e.preventDefault()}),o.onkeyup=FNR.behaviour.genDebounce(e=>{console.log(e.target.value),null!==e.key.match(/[0-9]/)&&(parseInt(o.value)<1||parseInt(o.value)>t.totalPages||window.location.replace(`${t.pageStructure.start}p${(parseInt(o.value)-1)*forumConfig.skinOptions.paginationDefault}-${t.pageStructure.end}`))},750),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(/</g,"<").replace(/>/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",()=>{FNR.behaviour.genControls()}),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[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("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/options/noManagers.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
Vue.component('tema', {
|
|
2
|
-
props: ['
|
|
2
|
+
props: ['type', 'url', 'name', 'date'],
|
|
3
3
|
template: `
|
|
4
4
|
<div class="rp-list">
|
|
5
|
-
<a class="rp-element" :href="
|
|
5
|
+
<a class="rp-element" :href="url" target="_blank" :title="'Ir al tema «' + name + '»'">
|
|
6
6
|
<div class="rp-icon">
|
|
7
|
-
<template v-if="
|
|
7
|
+
<template v-if="type === 'abierto'">
|
|
8
8
|
<i class="fas fa-lock-open"></i>
|
|
9
9
|
</template>
|
|
10
|
-
<template v-else-if="
|
|
10
|
+
<template v-else-if="type === 'cerrado'">
|
|
11
11
|
<i class="fas fa-lock"></i>
|
|
12
12
|
</template>
|
|
13
|
-
<template v-else-if="
|
|
13
|
+
<template v-else-if="type === 'abandonado'">
|
|
14
14
|
<i class="fas fa-times"></i>
|
|
15
15
|
</template>
|
|
16
16
|
</div>
|
|
17
17
|
<div class="rp-content">
|
|
18
18
|
<div class="rp-name">
|
|
19
|
-
<span>{{
|
|
19
|
+
<span>{{ name }}</span>
|
|
20
20
|
<small>
|
|
21
|
-
{{
|
|
21
|
+
{{ date }} - <slot></slot>
|
|
22
22
|
</small>
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
@@ -28,28 +28,28 @@ Vue.component('tema', {
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
Vue.component('relacion', {
|
|
31
|
-
props: ['
|
|
32
|
-
data
|
|
31
|
+
props: ['id', 'name', 'img', 'color'],
|
|
32
|
+
data() {
|
|
33
33
|
return {
|
|
34
34
|
profileName: forumConfig.profileOptions.profileName || 'perfil'
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
computed: {
|
|
38
|
-
relaClass
|
|
39
|
-
return 'rela-list usergroup-' + this.
|
|
38
|
+
relaClass() {
|
|
39
|
+
return 'rela-list usergroup-' + this.color.toLowerCase();
|
|
40
40
|
},
|
|
41
|
-
relaType
|
|
42
|
-
return typeof this.
|
|
41
|
+
relaType() {
|
|
42
|
+
return typeof this.id !== 'undefined';
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
template: `
|
|
46
46
|
<div :class="relaClass">
|
|
47
47
|
<template v-if="relaType">
|
|
48
|
-
<a class="rela-element" :href="'/u' +
|
|
49
|
-
<div class="rela-image" :style="'background-image: url(' +
|
|
48
|
+
<a class="rela-element" :href="'/u' + id" target="_blank" :title="'Ir al ' + profileName + ' de «' + name + '»'">
|
|
49
|
+
<div class="rela-image" :style="'background-image: url(' + img + ')'"></div>
|
|
50
50
|
<div class="rela-content">
|
|
51
51
|
<div class="rela-title">
|
|
52
|
-
<h4>{{
|
|
52
|
+
<h4>{{ name }}</h4>
|
|
53
53
|
</div>
|
|
54
54
|
<div class="small-text is-content">
|
|
55
55
|
<slot></slot>
|
|
@@ -59,10 +59,10 @@ Vue.component('relacion', {
|
|
|
59
59
|
</template>
|
|
60
60
|
<template v-else>
|
|
61
61
|
<a class="rela-element">
|
|
62
|
-
<div class="rela-image" :style="'background-image: url(' +
|
|
62
|
+
<div class="rela-image" :style="'background-image: url(' + img + ')'"></div>
|
|
63
63
|
<div class="rela-content">
|
|
64
64
|
<div class="rela-title">
|
|
65
|
-
<h4>{{
|
|
65
|
+
<h4>{{ name }}</h4>
|
|
66
66
|
</div>
|
|
67
67
|
<div class="small-text is-content">
|
|
68
68
|
<slot></slot>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Vue.component("tema",
|
|
1
|
+
Vue.component("tema",{props:["type","url","name","date"],template:'\n <div class="rp-list">\n <a class="rp-element" :href="url" target="_blank" :title="\'Ir al tema «\' + name + \'»\'">\n <div class="rp-icon">\n <template v-if="type === \'abierto\'">\n <i class="fas fa-lock-open"></i>\n </template>\n <template v-else-if="type === \'cerrado\'">\n <i class="fas fa-lock"></i>\n </template>\n <template v-else-if="type === \'abandonado\'">\n <i class="fas fa-times"></i>\n </template>\n </div>\n <div class="rp-content">\n <div class="rp-name">\n <span>{{ name }}</span>\n <small>\n {{ date }} - <slot></slot>\n </small>\n </div>\n </div>\n </a>\n </div>\n '}),Vue.component("relacion",{props:["id","name","img","color"],data:()=>({profileName:forumConfig.profileOptions.profileName||"perfil"}),computed:{relaClass(){return"rela-list usergroup-"+this.color.toLowerCase()},relaType(){return void 0!==this.id}},template:'\n <div :class="relaClass">\n <template v-if="relaType">\n <a class="rela-element" :href="\'/u\' + id" target="_blank" :title="\'Ir al \' + profileName + \' de «\' + name + \'»\'">\n <div class="rela-image" :style="\'background-image: url(\' + img + \')\'"></div>\n <div class="rela-content">\n <div class="rela-title">\n <h4>{{ name }}</h4>\n </div>\n <div class="small-text is-content">\n <slot></slot>\n </div>\n </div>\n </a>\n </template>\n <template v-else>\n <a class="rela-element">\n <div class="rela-image" :style="\'background-image: url(\' + img + \')\'"></div>\n <div class="rela-content">\n <div class="rela-title">\n <h4>{{ name }}</h4>\n </div>\n <div class="small-text is-content">\n <slot></slot>\n </div>\n </div>\n </a>\n </template>\n </div>\n '});
|