generic-skin 1.21.93 → 1.21.97
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/frameworks/FNRFramework.js +87 -7
- package/frameworks/FNRFramework.min.js +1 -1
- package/general.js +1 -1
- package/general.min.js +1 -1
- package/package.json +1 -1
- package/fnr.code-workspace +0 -25
- package/frameworks/FNHelper.js +0 -278
- package/frameworks/FNHelper.min.js +0 -1
|
@@ -536,16 +536,12 @@ const FNR = {
|
|
|
536
536
|
else return localStorage.removeItem(forumData.prefix + '_' + id);
|
|
537
537
|
},
|
|
538
538
|
useData: function(id, time) {
|
|
539
|
-
return new Promise(
|
|
539
|
+
return new Promise((resolve, reject) => {
|
|
540
540
|
let item = localStorage.getItem(forumData.prefix + '_' + id),
|
|
541
541
|
cur_date = new Date(),
|
|
542
542
|
timeMil = time == -1 ? 'undefined' : time * 86400000;
|
|
543
543
|
|
|
544
|
-
if (
|
|
545
|
-
(item != null && time == -1) ||
|
|
546
|
-
(item != null &&
|
|
547
|
-
parseInt(JSON.parse(item).cached_at) + timeMil > cur_date.getTime())
|
|
548
|
-
) {
|
|
544
|
+
if ((item != null && time == -1) || (item != null && parseInt(JSON.parse(item).cached_at) + timeMil > cur_date.getTime())) {
|
|
549
545
|
resolve(JSON.parse(item).content);
|
|
550
546
|
} else {
|
|
551
547
|
reject(false);
|
|
@@ -586,7 +582,17 @@ const FNR = {
|
|
|
586
582
|
});
|
|
587
583
|
|
|
588
584
|
return final;
|
|
589
|
-
},
|
|
585
|
+
},
|
|
586
|
+
getUserlevel: function() {
|
|
587
|
+
switch (_userdata.user_level) {
|
|
588
|
+
case 2:
|
|
589
|
+
return 'mod';
|
|
590
|
+
case 1:
|
|
591
|
+
return 'admin';
|
|
592
|
+
case 0:
|
|
593
|
+
return -1 == _userdata.user_id ? 'guest' : 'user'
|
|
594
|
+
}
|
|
595
|
+
},
|
|
590
596
|
getGroup: function(color) {
|
|
591
597
|
const returnHexVer = (code) => {
|
|
592
598
|
let status = 'unknown';
|
|
@@ -613,6 +619,32 @@ const FNR = {
|
|
|
613
619
|
else if (color.indexOf('id_') > -1) return returnIdVer(parseFloat(color.split('_')[1]));
|
|
614
620
|
else if (forumColours[color] === undefined) return 'unknown';
|
|
615
621
|
else return FNR.utility.genSlug(forumColours[color].code);
|
|
622
|
+
},
|
|
623
|
+
getForumgroups: function(time) {
|
|
624
|
+
const cacheTime = time || .5;
|
|
625
|
+
|
|
626
|
+
return new Promise((resolve, reject) => {
|
|
627
|
+
FNR.cache.useData('groups', cacheTime).then((result) => {
|
|
628
|
+
if (!result) {
|
|
629
|
+
$.get('/?change_version=invision', function(data) {
|
|
630
|
+
groups = [];
|
|
631
|
+
|
|
632
|
+
$(data).find('#fo_stat div:contains("Leyenda") b a').each(function() {
|
|
633
|
+
groups.push({
|
|
634
|
+
id: this.href.split('/g')[1].split('-')[0],
|
|
635
|
+
name: this.textContent,
|
|
636
|
+
color: this.style.color
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
FNR.cache.setData('groups', groups, cacheTime);
|
|
641
|
+
resolve(groups);
|
|
642
|
+
});
|
|
643
|
+
} else {
|
|
644
|
+
resolve(result);
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
});
|
|
616
648
|
}
|
|
617
649
|
},
|
|
618
650
|
html: {
|
|
@@ -649,6 +681,54 @@ const FNR = {
|
|
|
649
681
|
|
|
650
682
|
document.getElementById('forum-modal').innerHTML = final;
|
|
651
683
|
},
|
|
684
|
+
genPopup: function(title, content, icon, url) {
|
|
685
|
+
if (title === '' || title === undefined || title === null) return;
|
|
686
|
+
if (content === '' || content === undefined || content === null) return;
|
|
687
|
+
if (content.length > 35) return;
|
|
688
|
+
if (icon === '' || icon === undefined || icon === null) return;
|
|
689
|
+
|
|
690
|
+
if (document.getElementById('forum-popup')) {
|
|
691
|
+
document.getElementById('forum-popup').remove()
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
let popup = document.createElement('div');
|
|
695
|
+
|
|
696
|
+
popup.id = 'forum-popup';
|
|
697
|
+
|
|
698
|
+
document.body.appendChild(popup);
|
|
699
|
+
|
|
700
|
+
let final = '';
|
|
701
|
+
|
|
702
|
+
final += '<div id="' + FNR.utility.genSlug(title, '-') + '" class="popup-element">';
|
|
703
|
+
|
|
704
|
+
if (url === '' || url === undefined || url === null) {
|
|
705
|
+
final += '<div class="popup-main">';
|
|
706
|
+
} else {
|
|
707
|
+
final += '<a href="' + url + '" target="_blank" class="popup-main">';
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
final += '<div class="popup-icon">';
|
|
711
|
+
final += '<i class="' + icon + '"></i>';
|
|
712
|
+
final += '</div>';
|
|
713
|
+
final += '<div class="popup-content">';
|
|
714
|
+
final += '<h3>' + title + '</h3>';
|
|
715
|
+
final += '<p>' + content + '</p>';
|
|
716
|
+
final += '</div>';
|
|
717
|
+
|
|
718
|
+
if (url === '' || url === undefined || url === null) {
|
|
719
|
+
final += '</div>';
|
|
720
|
+
} else {
|
|
721
|
+
final += '</a>';
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
final += '<div class="popup-controls">';
|
|
725
|
+
final += '<i onclick="document.getElementById(`forum-popup`).remove()" class="fas fa-times"></i>';
|
|
726
|
+
final += '</div>';
|
|
727
|
+
|
|
728
|
+
final += '</div>';
|
|
729
|
+
|
|
730
|
+
document.getElementById('forum-popup').innerHTML = final;
|
|
731
|
+
},
|
|
652
732
|
genWiki: function() {
|
|
653
733
|
if (document.querySelector('.wiki-cascade')) {
|
|
654
734
|
[].forEach.call(document.getElementsByClassName('wiki-cascade'), (item) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const FNR={execFn:function(e){document.addEventListener("forumReady",e,!1)},forum:{getColors:function(){return Object.values(forumColours).map(e=>({name:e.code,hex:e.hex}))},getLatest:function(e,t){return new Promise((n,i)=>{const a=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();o.push({name:t.text().trim(),url:Vue.filter("url-to-normal")(t.attr("href")),lastpost:{url:Vue.filter("url-to-normal")(n.children().last().attr("href")),date:n.text().split("por")[0].trim(),who:{name:n.find("strong a").length?n.find("strong a").text().trim():"Invitado",url:Vue.filter("url-to-normal")(n.find("strong a").length?n.find("strong a").attr("href"):"/"),color:n.find("strong a").length?n.find("strong a span").attr("style").split("color:")[1]:"initial"}},forum:{name:$(e).find(".row2 + .row2:not(.centered) a").text().trim(),url:Vue.filter("url-to-normal")($(e).find(".row2 + .row2:not(.centered) a").attr("href"))}})},r=i=>{$.get(i,function(i){$(i).find(".ipbform").find("tbody").find("tr").each(function(){o.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&a(this)}),o.length!==t&&$(i).find(".pagination")[0].children.length&&"b"!==$(i).find(".pagination").children().last()[0].localName?r($(i).find(".pagination").children().last().attr("href")):n(o)})};let o=[];r("/latest?change_version=invision")})},getMembers:function(e){return new Promise((t,n)=>{let i=[];const a=(e,t)=>({user:$(e).find(".avatar-mini a span strong").text(),id:$(e).find(".avatar-mini a").attr("href").split("?")[0],img:$(e).find(".avatar-mini a img").attr("src"),color:t}),r=t=>{let n=[];return $(t).find("#memberlist tbody tr").each(function(){const t=FNR.utility.getGroup($(this).find(".avatar-mini a span").attr("style").split("color:")[1]);e?n.push(a(this,t)):"unknown"!==t&&"narracion"!==t&&n.push(a(this,t))}),n},o=e=>{$.get(e,function(e){const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;i=i.concat(r(e)),n?o(n):t(i.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};o("/memberlist?change_version=phpbb2")})},getAffiliates:function(){return new Promise((e,t)=>{const n=forumConfig.affiliatesMax,i=Object.entries(forumAffiliates).map(e=>{let t="";e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'"/></a></li>'});for(let i=0;i<n[e[0]]-e[1].length;i++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'"/></a></li>';return t});e({normal:i[0],elite:i[1],directory:i[2],sister:i[3]})})}},content:{post:{getPost:function(e){return new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const i=$(n).find("#p"+e.split("#")[1]);t({author:{text:i.find(".author a").text(),color:i.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(i.find(".author a").attr("href"))},content:i.find(".post-entry > div").html(),date:i.find(".author").html().split("</a>")[1]})})})},getLast:function(e){return new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),e=>{const n=$(e).find(".pagination.topic-options").children().last().prev().attr("href")||!1,i=e,a=e=>{const t=e=>$(e).find(".post").parent().children().last().prev(),n=""!==t(e).find(".author a").text();return{author:{text:n?t(e).find(".author a").text():"Invitado",color:n?t(e).find(".author a span").css("color"):"#bdbdbd",url:n?t(e).find(".author a").attr("href").replace("?change_version=invision",""):"#"},locate:{text:$(e).find("#navstrip").find("li").last().text(),url:$(e).find("#navstrip").find("li").last().find("a").attr("href").replace("?change_version=invision","")},url:t(e).find(".postbody-head h3 a").attr("href").replace("?change_version=invision",""),content:t(e).find(".post-entry > div").html(),date:n?t(e).find(".author").html().split("</a>")[1].trim():t(e).find(".author").html().split("Invitado")[1].trim()}};n?$.get(n,e=>{t(a(e))}):t(a(i))})})}},topic:{genTopic:function(e,t,n){return new Promise((i,a)=>{let r=document.createElement("iframe");r.id="forum-save",r.src="/post?f="+e+"&mode=newtopic&change_version=invision",r.width=0,r.height=0,r.onload=(()=>{o.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(r);const o=document.getElementById("forum-save")})}}},user:{changeAccount:function(e,t,n){return new Promise((i,a)=>{let r=document.createElement("iframe");r.id="forum-save",r.src=e,r.width=0,r.height=0,r.onload=(()=>{r.onload=(()=>{r.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()}),o.src="/login?change_version=invision"}),document.querySelector("body > header").prepend(r);const o=document.getElementById("forum-save")})},profile:{getUrl:function(e){let t=void 0!==e?encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"):_userdata.user_id;return"/profile?mode=viewprofile&u="+t},getData:function(e){return new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const i=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const a=n;let r=[];[].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 o={type:e.type,name:e.name,value:t};e.validation&&(o.validation=e.validation),n.length&&(o.options=n),r.push(o)}),t(r)})})})},setData:function(e){return new Promise((t,n)=>{const i=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let a=document.createElement("iframe");a.id="forum-save",a.src="/profile?change_version=invision&mode=editprofile",a.width=0,a.height=0,a.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),r.onload=(()=>{t?(r.onload=(()=>{r.onload=(()=>{i()}),$("#forum-save").contents().find('input[name="avatarremoteurl"]').val(t),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),r.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 r=document.getElementById("forum-save")})},getAll:function(e,t){const n=null!=e?FNR.user.profile.getUrl(e):FNR.user.profile.getUrl(),i=t||5,a=e=>e.find("a").length?Vue.filter("url-to-normal")(e.find("a").attr("href")):e.find("table").length?e.find("table").html():e.find("img").length?e.find("img").attr("src"):e.find("textarea").length?e.find("textarea").val():e.find("span").length?e.find("span").text().trim():"-"===e.text().trim()?"":e.text(),r=()=>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)})}),o=e=>{const t="userInfo"+e;return new Promise((e,n)=>{FNR.cache.useData(t,i).then(t=>{e(t)},n=>{r().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return o(e)},getDrafts:function(){return new Promise((e,t)=>{$.get("/search?search_id=draftsearch&change_version=invision",t=>{if(0!==parseFloat($(t).find(".maintitle > h3").text())){let n=[];$(t).find(".ipbform .ipbtable tbody > tr").each(function(){const e=$(this).find("td");n.push({topic:{name:e[1].textContent.trim(),url:Vue.filter("url-to-normal")(e[1].querySelector("a").href)},info:{location:e[2].textContent.trim(),date:e[3].textContent.trim()},modify:Vue.filter("url-to-normal")(e[4].querySelector("a").href)})}),e(n)}else e(!1)})})}}},cache:{setData:function(e,t,n){let i=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:i,content:t}))},getData:function(e){return null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content},delData:function(e){return null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e)},useData:function(e,t){return new Promise(function(n,i){let a=localStorage.getItem(forumData.prefix+"_"+e),r=new Date,o=-1==t?"undefined":864e5*t;null!=a&&-1==t||null!=a&&parseInt(JSON.parse(a).cached_at)+o>r.getTime()?n(JSON.parse(a).content):i(!1)})}},utility:{genSlug:function(e,t){const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},i=t||"_";return n(e).replace(/-/g,i)},genValidation:function(e){let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getGroup:function(e){const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)}},html:{genArray:function(e){return JSON.parse(e.replace(/`/g,'"'))},genModal:function(e,t){if(""===e||null==e)return;if(""===t||null==t)return;let n=document.createElement("div");n.id="forum-modal",document.body.appendChild(n);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>",i+="</div>",i+="</div>",i+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=i},genWiki:function(){document.querySelector(".wiki-cascade")&&[].forEach.call(document.getElementsByClassName("wiki-cascade"),e=>{e.onclick=(()=>{const t=e.parentElement.parentElement;t.classList.contains("is-active")?t.classList.remove("is-active"):t.classList.add("is-active")})}),document.querySelector(".wiki-controls .router-link-active")&&[].forEach.call(document.querySelectorAll(".wiki-controls .router-link-active"),e=>{if(!e.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains("wiki-index")){const t=(e,n)=>{let i=e.parentElement.parentElement;n&&(i=i.parentElement.parentElement),i.classList.add("is-active"),i.classList.add("is-selected"),i.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(i,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:function(){document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})}}};
|
|
1
|
+
const FNR={execFn:function(e){document.addEventListener("forumReady",e,!1)},forum:{getColors:function(){return Object.values(forumColours).map(e=>({name:e.code,hex:e.hex}))},getLatest:function(e,t){return new Promise((n,i)=>{const a=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();o.push({name:t.text().trim(),url:Vue.filter("url-to-normal")(t.attr("href")),lastpost:{url:Vue.filter("url-to-normal")(n.children().last().attr("href")),date:n.text().split("por")[0].trim(),who:{name:n.find("strong a").length?n.find("strong a").text().trim():"Invitado",url:Vue.filter("url-to-normal")(n.find("strong a").length?n.find("strong a").attr("href"):"/"),color:n.find("strong a").length?n.find("strong a span").attr("style").split("color:")[1]:"initial"}},forum:{name:$(e).find(".row2 + .row2:not(.centered) a").text().trim(),url:Vue.filter("url-to-normal")($(e).find(".row2 + .row2:not(.centered) a").attr("href"))}})},r=i=>{$.get(i,function(i){$(i).find(".ipbform").find("tbody").find("tr").each(function(){o.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&a(this)}),o.length!==t&&$(i).find(".pagination")[0].children.length&&"b"!==$(i).find(".pagination").children().last()[0].localName?r($(i).find(".pagination").children().last().attr("href")):n(o)})};let o=[];r("/latest?change_version=invision")})},getMembers:function(e){return new Promise((t,n)=>{let i=[];const a=(e,t)=>({user:$(e).find(".avatar-mini a span strong").text(),id:$(e).find(".avatar-mini a").attr("href").split("?")[0],img:$(e).find(".avatar-mini a img").attr("src"),color:t}),r=t=>{let n=[];return $(t).find("#memberlist tbody tr").each(function(){const t=FNR.utility.getGroup($(this).find(".avatar-mini a span").attr("style").split("color:")[1]);e?n.push(a(this,t)):"unknown"!==t&&"narracion"!==t&&n.push(a(this,t))}),n},o=e=>{$.get(e,function(e){const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;i=i.concat(r(e)),n?o(n):t(i.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};o("/memberlist?change_version=phpbb2")})},getAffiliates:function(){return new Promise((e,t)=>{const n=forumConfig.affiliatesMax,i=Object.entries(forumAffiliates).map(e=>{let t="";e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'"/></a></li>'});for(let i=0;i<n[e[0]]-e[1].length;i++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'"/></a></li>';return t});e({normal:i[0],elite:i[1],directory:i[2],sister:i[3]})})}},content:{post:{getPost:function(e){return new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const i=$(n).find("#p"+e.split("#")[1]);t({author:{text:i.find(".author a").text(),color:i.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(i.find(".author a").attr("href"))},content:i.find(".post-entry > div").html(),date:i.find(".author").html().split("</a>")[1]})})})},getLast:function(e){return new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),e=>{const n=$(e).find(".pagination.topic-options").children().last().prev().attr("href")||!1,i=e,a=e=>{const t=e=>$(e).find(".post").parent().children().last().prev(),n=""!==t(e).find(".author a").text();return{author:{text:n?t(e).find(".author a").text():"Invitado",color:n?t(e).find(".author a span").css("color"):"#bdbdbd",url:n?t(e).find(".author a").attr("href").replace("?change_version=invision",""):"#"},locate:{text:$(e).find("#navstrip").find("li").last().text(),url:$(e).find("#navstrip").find("li").last().find("a").attr("href").replace("?change_version=invision","")},url:t(e).find(".postbody-head h3 a").attr("href").replace("?change_version=invision",""),content:t(e).find(".post-entry > div").html(),date:n?t(e).find(".author").html().split("</a>")[1].trim():t(e).find(".author").html().split("Invitado")[1].trim()}};n?$.get(n,e=>{t(a(e))}):t(a(i))})})}},topic:{genTopic:function(e,t,n){return new Promise((i,a)=>{let r=document.createElement("iframe");r.id="forum-save",r.src="/post?f="+e+"&mode=newtopic&change_version=invision",r.width=0,r.height=0,r.onload=(()=>{o.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(r);const o=document.getElementById("forum-save")})}}},user:{changeAccount:function(e,t,n){return new Promise((i,a)=>{let r=document.createElement("iframe");r.id="forum-save",r.src=e,r.width=0,r.height=0,r.onload=(()=>{r.onload=(()=>{r.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()}),o.src="/login?change_version=invision"}),document.querySelector("body > header").prepend(r);const o=document.getElementById("forum-save")})},profile:{getUrl:function(e){let t=void 0!==e?encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"):_userdata.user_id;return"/profile?mode=viewprofile&u="+t},getData:function(e){return new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const i=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const a=n;let r=[];[].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 o={type:e.type,name:e.name,value:t};e.validation&&(o.validation=e.validation),n.length&&(o.options=n),r.push(o)}),t(r)})})})},setData:function(e){return new Promise((t,n)=>{const i=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let a=document.createElement("iframe");a.id="forum-save",a.src="/profile?change_version=invision&mode=editprofile",a.width=0,a.height=0,a.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),r.onload=(()=>{t?(r.onload=(()=>{r.onload=(()=>{i()}),$("#forum-save").contents().find('input[name="avatarremoteurl"]').val(t),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),r.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 r=document.getElementById("forum-save")})},getAll:function(e,t){const n=null!=e?FNR.user.profile.getUrl(e):FNR.user.profile.getUrl(),i=t||5,a=e=>e.find("a").length?Vue.filter("url-to-normal")(e.find("a").attr("href")):e.find("table").length?e.find("table").html():e.find("img").length?e.find("img").attr("src"):e.find("textarea").length?e.find("textarea").val():e.find("span").length?e.find("span").text().trim():"-"===e.text().trim()?"":e.text(),r=()=>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)})}),o=e=>{const t="userInfo"+e;return new Promise((e,n)=>{FNR.cache.useData(t,i).then(t=>{e(t)},n=>{r().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return o(e)},getDrafts:function(){return new Promise((e,t)=>{$.get("/search?search_id=draftsearch&change_version=invision",t=>{if(0!==parseFloat($(t).find(".maintitle > h3").text())){let n=[];$(t).find(".ipbform .ipbtable tbody > tr").each(function(){const e=$(this).find("td");n.push({topic:{name:e[1].textContent.trim(),url:Vue.filter("url-to-normal")(e[1].querySelector("a").href)},info:{location:e[2].textContent.trim(),date:e[3].textContent.trim()},modify:Vue.filter("url-to-normal")(e[4].querySelector("a").href)})}),e(n)}else e(!1)})})}}},cache:{setData:function(e,t,n){let i=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:i,content:t}))},getData:function(e){return null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content},delData:function(e){return null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e)},useData:function(e,t){return new Promise((n,i)=>{let a=localStorage.getItem(forumData.prefix+"_"+e),r=new Date,o=-1==t?"undefined":864e5*t;null!=a&&-1==t||null!=a&&parseInt(JSON.parse(a).cached_at)+o>r.getTime()?n(JSON.parse(a).content):i(!1)})}},utility:{genSlug:function(e,t){const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},i=t||"_";return n(e).replace(/-/g,i)},genValidation:function(e){let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getUserlevel:function(){switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}},getGroup:function(e){const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)},getForumgroups:function(e){const t=e||.5;return new Promise((e,n)=>{FNR.cache.useData("groups",t).then(n=>{n?e(n):$.get("/?change_version=invision",function(n){groups=[],$(n).find('#fo_stat div:contains("Leyenda") b a').each(function(){groups.push({id:this.href.split("/g")[1].split("-")[0],name:this.textContent,color:this.style.color})}),FNR.cache.setData("groups",groups,t),e(groups)})})})}},html:{genArray:function(e){return JSON.parse(e.replace(/`/g,'"'))},genModal:function(e,t){if(""===e||null==e)return;if(""===t||null==t)return;let n=document.createElement("div");n.id="forum-modal",document.body.appendChild(n);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>",i+="</div>",i+="</div>",i+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=i},genPopup:function(e,t,n,i){if(""===e||null==e)return;if(""===t||null==t)return;if(t.length>35)return;if(""===n||null==n)return;document.getElementById("forum-popup")&&document.getElementById("forum-popup").remove();let a=document.createElement("div");a.id="forum-popup",document.body.appendChild(a);let r="";r+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="popup-element">',r+=""===i||null==i?'<div class="popup-main">':'<a href="'+i+'" target="_blank" class="popup-main">',r+='<div class="popup-icon">',r+='<i class="'+n+'"></i>',r+="</div>",r+='<div class="popup-content">',r+="<h3>"+e+"</h3>",r+="<p>"+t+"</p>",r+="</div>",r+=""===i||null==i?"</div>":"</a>",r+='<div class="popup-controls">',r+='<i onclick="document.getElementById(`forum-popup`).remove()" class="fas fa-times"></i>',r+="</div>",r+="</div>",document.getElementById("forum-popup").innerHTML=r},genWiki:function(){document.querySelector(".wiki-cascade")&&[].forEach.call(document.getElementsByClassName("wiki-cascade"),e=>{e.onclick=(()=>{const t=e.parentElement.parentElement;t.classList.contains("is-active")?t.classList.remove("is-active"):t.classList.add("is-active")})}),document.querySelector(".wiki-controls .router-link-active")&&[].forEach.call(document.querySelectorAll(".wiki-controls .router-link-active"),e=>{if(!e.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains("wiki-index")){const t=(e,n)=>{let i=e.parentElement.parentElement;n&&(i=i.parentElement.parentElement),i.classList.add("is-active"),i.classList.add("is-selected"),i.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(i,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:function(){document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})}}};
|
package/general.js
CHANGED
|
@@ -6,7 +6,7 @@ console.log('https://zatrapa-gaylien.tumblr.com/');
|
|
|
6
6
|
|
|
7
7
|
/* GENERAL */
|
|
8
8
|
document.addEventListener('DOMContentLoaded', () => {
|
|
9
|
-
document.body.classList.add('is-' +
|
|
9
|
+
document.body.classList.add('is-' + FNR.utility.getUserlevel());
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
/* BLOQUE DE FORO */
|
package/general.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
console.log("%cSkin por %cGaylien 🏳️🌈","font-family: sans-serif; font-size: 1.5em","font-size: 1.5em; text-transform: uppercase; font-weight: 800; color: #c381b9;"),console.log("https://zatrapa-gaylien.tumblr.com/"),document.addEventListener("DOMContentLoaded",()=>{document.body.classList.add("is-"+H.userLevel())}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t,o,r;e.querySelector(".color-groups")?(t=e.querySelector(".color-groups"),o=t.outerHTML.split(t.innerHTML),r=t.textContent,t.outerHTML='<strong><a href="'+FNR.user.profile.getUrl(r)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+r+'»">'+o[0]+Vue.filter("just-name")(r)+o[1]+"</a></strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=r)):(e.querySelector(".forum-last-author").innerHTML="<strong>Invitado</strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado")),e.querySelector(".forum-last-author").outerHTML=e.querySelector(".forum-last-author > strong").outerHTML}):-1!==_userdata.user_id&&document.querySelector(".lastpost-content")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t="<strong>Invitado</strong>";e.querySelector(".forum-last-author > strong")?(t=e.querySelector(".forum-last-author > strong > a"),t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+"»",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=t.textContent),t.querySelector("span").textContent=Vue.filter("just-name")(t.textContent),t="<strong>"+t.outerHTML+"</strong>",t.textContent=Vue.filter("just-name")(t.textContent)):e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado"),e.querySelector(".forum-last-author").outerHTML=t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-last-date")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{const t=e.querySelector(".forum-last-date").textContent;e.querySelector(".lastpost-link").title+=", "+t,e.querySelector(".forum-last-date").outerHTML=t,e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.not-status)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.not-status)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .topic-status").textContent;t.indexOf("unread")>-1?e.classList.add("is-unread"):e.classList.add("is-read"),t.indexOf("locked")>-1?e.classList.add("is-closed"):t.indexOf("sticky")>1?e.classList.add("is-sticky"):t.indexOf("global_announce")>1?e.classList.add("is-global-announcement"):t.indexOf("announce")>1&&e.classList.add("is-announcement")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.profile.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")&&(t.querySelector("span")?(t.innerHTML='<strong><a href="'+FNR.user.profile.getUrl(t.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">'+t.querySelector("span").outerHTML+"</a></strong>",t.querySelector("strong strong").textContent=Vue.filter("just-name")(t.querySelector("strong strong").textContent),e.querySelector(".topic-lastauthor").outerHTML=t.innerHTML):e.querySelector(".topic-lastauthor").outerHTML="<strong>Invitado</strong>",e.querySelector(".topic-lastauthor").outerHTML=e.querySelector(".topic-lastauthor").innerHTML),e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#moderation")&&document.querySelector("#moderation a")?document.querySelector('a[href="#gestionar"]').href=document.querySelector("#moderation a").href:document.querySelector("#moderation")&&document.querySelector('a[href="#gestionar"]').parentElement.remove()}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".prev-post")){let e=document.querySelector("#forum-preview");""!==document.querySelectorAll(".prev-post")[0].innerHTML&&(e.querySelector(".post-content").innerHTML='<div class="is-content">'+document.querySelectorAll(".prev-post")[0].innerHTML+"</div>",e.classList.remove("to-process"))}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-otherposts")&&document.querySelector(".forum-otherposts").children.length){let e="";[].forEach.call(document.querySelector(".forum-otherposts").querySelectorAll(".post"),t=>{if(document.querySelector(".mp-main")&&document.querySelector("#forum-reply")){let o=t.querySelector(".mp-from").textContent,r=FNR.utility.getGroup("rgb_"+t.querySelector(".mp-from > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_")),n=t.querySelector(".mp-date").textContent,l=t.querySelector(".is-content").innerHTML;e+='<li class="post post-mp">',e+='<section class="postlist-post usergroup-'+r+'">',e+='<ul class="post-datafields post-profile profile-sticky">',e+='<li class="datafield-user">',e+='<div class="datafield-name">Usuario</div>',e+='<strong><a href="'+FNR.user.profile.getUrl(o)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+o+'»">'+o+"</a></strong>",e+="</li>",e+='<li class="datafield-date">',e+='<div class="datafield-name">Fecha</div>',e+=n.indexOf("el")>-1?n.split("el ")[1]:n,e+="</li>",e+="</ul>",e+='<div class="post-content no-links">',e+='<div class="is-content">',e+=l,e+="</div>",e+="</div>",e+="</section>",e+="</li>"}else document.querySelector("#mp-body")||(t.querySelector(".post-datafields .datafield-user a > span")?(t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("rgb_"+t.querySelector(".post-datafields .datafield-user a > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_"))),t.querySelector(".post-datafields .datafield-user a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.querySelector(".post-datafields .datafield-user a").textContent+"»",t.querySelector(".post-datafields .datafield-user a").target="_blank",""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").href=FNR.user.profile.getUrl(t.querySelector(".post-datafields .datafield-user a").textContent))):t.querySelector(".post-datafields .datafield-check")&&t.querySelector(".post-datafields .datafield-check").children&&1===t.querySelector(".post-datafields .datafield-check").children.length?t.querySelector(".post-datafields .datafield-check").remove():t.querySelector(".post-datafields .datafield-user a")&&""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").outerHTML="<strong>"+t.querySelector(".post-datafields .datafield-user a").innerHTML+"</strong>",t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null"))),"UsuarioAnonymous"===t.querySelector(".post-datafields .datafield-user").textContent&&t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null")))}),document.querySelector(".mp-main")&&document.querySelector("#forum-reply")&&(document.querySelector(".forum-otherposts").innerHTML=e)}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-postlist .post:not(.panel)")){const e={responder_citando:{icon:"fas fa-quote-right",title:"Citar"},editar_borrar_este_mensaje:{icon:"fas fa-pencil-alt",title:"Editar"},borrar_este_mensaje:{icon:"fas fa-trash-alt",title:"Borrar"},ver_la_direccion_ip_del_autor:{icon:"fas fa-map-marker-alt",title:"Ver IP"},permalink:{icon:"fas fa-tag",title:"Enlace permanente"}};[].forEach.call(document.querySelectorAll(".forum-postlist .post"),t=>{if(t.children.length>1){let o="";[].forEach.call(t.querySelectorAll(".to-process .post-icons li a"),t=>{const r=e[FNR.utility.genSlug(t.querySelector("img").title)];o+='<li class="post-button-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'" class="post-button">',o+='<i class="'+r.icon+'"></i>',forumConfig.nameMinibuttons&&(o+="<span>"+("Enlace permanente"===r.title?"Permalink":r.title)+"</span>"),o+="</a>",o+="</li>"}),t.querySelector(".post-buttons").innerHTML=o}else t.remove()})}}),document.addEventListener("DOMContentLoaded",()=>{null!==document.getElementById("forum-realreply")&&""===document.getElementById("forum-realreply").innerHTML&&document.getElementById("quickreply-section").remove()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector('img[title="Citar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Citar mensaje"]'),e=>{let t=e.parentElement;t.title="Citar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Citar el Mensaje"}),document.querySelector('img[title="Editar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Editar mensaje"]'),e=>{let t=e.parentElement;t.title="Editar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Editar el Mensaje"})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mp-from")&&[].forEach.call(document.querySelectorAll(".mp-from"),e=>{const t=FNR.utility.getGroup(e.querySelector("span").style.color.replace(/, /g,"_").replace(/, /g,"_").replace(/\(/g,"_").replace(/\)/g,""));e.innerHTML='<a href="'+FNR.user.profile.getUrl(e.textContent)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.textContent+"</a>";let o=e.parentElement;for(;!o.classList.contains("mp-main");)o=o.parentElement;o.classList.add("usergroup-"+t)})}),document.addEventListener("DOMContentLoaded",()=>{document.getElementById("breadcrumbs")&&document.getElementById("forum-breadcrumb")&&[].forEach.call(document.getElementById("breadcrumbs").children,(e,t,o)=>{let r=e.href,n=e.text,l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.profile.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const e=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),t=document.querySelector(".pag-img .sprite-arrow_prosilver_right");e&&(e.parentElement.title="Ir a la página anterior",e.parentElement.classList.add("page-action"),e.parentElement.classList.remove("pag-img"),e.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),t&&(t.parentElement.title="Ir a la página siguiente",t.parentElement.classList.add("page-action"),t.parentElement.classList.remove("pag-img"),t.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>'),[].forEach.call(document.querySelectorAll("#pagination > span > a:not(.page-action)"),e=>{e.classList.add("page-link"),e.title="Ir a la página «"+e.textContent+"»"}),document.querySelector("#pagination > span > strong").title="Página actual";const o=document.querySelector("#pagination > span").innerHTML.trim().replace(/ ... /g,'<span class="page-spacer">…</span>');[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",o),e.parentElement.classList.contains("not-show")&&e.parentElement.classList.remove("not-show")})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{1!==e.classList.length&&e.classList.remove("codebox")}),document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{const t=e.querySelector("code").innerHTML.trim();e.querySelector("dt").innerHTML='Código <em>-</em> <span class="is-pointer">Seleccionar</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=(()=>{if(document.selection){const t=document.body.createTextRange();t.moveToElementText(e.querySelector("code")),t.select()}else if(window.getSelection){const t=document.createRange();t.selectNode(e.querySelector("code")),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}})})}),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.html.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.html.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",()=>{document.body.classList.add("is-"+FNR.utility.getUserlevel())}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t,o,r;e.querySelector(".color-groups")?(t=e.querySelector(".color-groups"),o=t.outerHTML.split(t.innerHTML),r=t.textContent,t.outerHTML='<strong><a href="'+FNR.user.profile.getUrl(r)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+r+'»">'+o[0]+Vue.filter("just-name")(r)+o[1]+"</a></strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=r)):(e.querySelector(".forum-last-author").innerHTML="<strong>Invitado</strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado")),e.querySelector(".forum-last-author").outerHTML=e.querySelector(".forum-last-author > strong").outerHTML}):-1!==_userdata.user_id&&document.querySelector(".lastpost-content")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t="<strong>Invitado</strong>";e.querySelector(".forum-last-author > strong")?(t=e.querySelector(".forum-last-author > strong > a"),t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+"»",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=t.textContent),t.querySelector("span").textContent=Vue.filter("just-name")(t.textContent),t="<strong>"+t.outerHTML+"</strong>",t.textContent=Vue.filter("just-name")(t.textContent)):e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado"),e.querySelector(".forum-last-author").outerHTML=t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-last-date")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{const t=e.querySelector(".forum-last-date").textContent;e.querySelector(".lastpost-link").title+=", "+t,e.querySelector(".forum-last-date").outerHTML=t,e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.not-status)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.not-status)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .topic-status").textContent;t.indexOf("unread")>-1?e.classList.add("is-unread"):e.classList.add("is-read"),t.indexOf("locked")>-1?e.classList.add("is-closed"):t.indexOf("sticky")>1?e.classList.add("is-sticky"):t.indexOf("global_announce")>1?e.classList.add("is-global-announcement"):t.indexOf("announce")>1&&e.classList.add("is-announcement")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.profile.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")&&(t.querySelector("span")?(t.innerHTML='<strong><a href="'+FNR.user.profile.getUrl(t.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">'+t.querySelector("span").outerHTML+"</a></strong>",t.querySelector("strong strong").textContent=Vue.filter("just-name")(t.querySelector("strong strong").textContent),e.querySelector(".topic-lastauthor").outerHTML=t.innerHTML):e.querySelector(".topic-lastauthor").outerHTML="<strong>Invitado</strong>",e.querySelector(".topic-lastauthor").outerHTML=e.querySelector(".topic-lastauthor").innerHTML),e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#moderation")&&document.querySelector("#moderation a")?document.querySelector('a[href="#gestionar"]').href=document.querySelector("#moderation a").href:document.querySelector("#moderation")&&document.querySelector('a[href="#gestionar"]').parentElement.remove()}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".prev-post")){let e=document.querySelector("#forum-preview");""!==document.querySelectorAll(".prev-post")[0].innerHTML&&(e.querySelector(".post-content").innerHTML='<div class="is-content">'+document.querySelectorAll(".prev-post")[0].innerHTML+"</div>",e.classList.remove("to-process"))}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-otherposts")&&document.querySelector(".forum-otherposts").children.length){let e="";[].forEach.call(document.querySelector(".forum-otherposts").querySelectorAll(".post"),t=>{if(document.querySelector(".mp-main")&&document.querySelector("#forum-reply")){let o=t.querySelector(".mp-from").textContent,r=FNR.utility.getGroup("rgb_"+t.querySelector(".mp-from > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_")),n=t.querySelector(".mp-date").textContent,l=t.querySelector(".is-content").innerHTML;e+='<li class="post post-mp">',e+='<section class="postlist-post usergroup-'+r+'">',e+='<ul class="post-datafields post-profile profile-sticky">',e+='<li class="datafield-user">',e+='<div class="datafield-name">Usuario</div>',e+='<strong><a href="'+FNR.user.profile.getUrl(o)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+o+'»">'+o+"</a></strong>",e+="</li>",e+='<li class="datafield-date">',e+='<div class="datafield-name">Fecha</div>',e+=n.indexOf("el")>-1?n.split("el ")[1]:n,e+="</li>",e+="</ul>",e+='<div class="post-content no-links">',e+='<div class="is-content">',e+=l,e+="</div>",e+="</div>",e+="</section>",e+="</li>"}else document.querySelector("#mp-body")||(t.querySelector(".post-datafields .datafield-user a > span")?(t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("rgb_"+t.querySelector(".post-datafields .datafield-user a > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_"))),t.querySelector(".post-datafields .datafield-user a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.querySelector(".post-datafields .datafield-user a").textContent+"»",t.querySelector(".post-datafields .datafield-user a").target="_blank",""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").href=FNR.user.profile.getUrl(t.querySelector(".post-datafields .datafield-user a").textContent))):t.querySelector(".post-datafields .datafield-check")&&t.querySelector(".post-datafields .datafield-check").children&&1===t.querySelector(".post-datafields .datafield-check").children.length?t.querySelector(".post-datafields .datafield-check").remove():t.querySelector(".post-datafields .datafield-user a")&&""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").outerHTML="<strong>"+t.querySelector(".post-datafields .datafield-user a").innerHTML+"</strong>",t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null"))),"UsuarioAnonymous"===t.querySelector(".post-datafields .datafield-user").textContent&&t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null")))}),document.querySelector(".mp-main")&&document.querySelector("#forum-reply")&&(document.querySelector(".forum-otherposts").innerHTML=e)}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-postlist .post:not(.panel)")){const e={responder_citando:{icon:"fas fa-quote-right",title:"Citar"},editar_borrar_este_mensaje:{icon:"fas fa-pencil-alt",title:"Editar"},borrar_este_mensaje:{icon:"fas fa-trash-alt",title:"Borrar"},ver_la_direccion_ip_del_autor:{icon:"fas fa-map-marker-alt",title:"Ver IP"},permalink:{icon:"fas fa-tag",title:"Enlace permanente"}};[].forEach.call(document.querySelectorAll(".forum-postlist .post"),t=>{if(t.children.length>1){let o="";[].forEach.call(t.querySelectorAll(".to-process .post-icons li a"),t=>{const r=e[FNR.utility.genSlug(t.querySelector("img").title)];o+='<li class="post-button-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'" class="post-button">',o+='<i class="'+r.icon+'"></i>',forumConfig.nameMinibuttons&&(o+="<span>"+("Enlace permanente"===r.title?"Permalink":r.title)+"</span>"),o+="</a>",o+="</li>"}),t.querySelector(".post-buttons").innerHTML=o}else t.remove()})}}),document.addEventListener("DOMContentLoaded",()=>{null!==document.getElementById("forum-realreply")&&""===document.getElementById("forum-realreply").innerHTML&&document.getElementById("quickreply-section").remove()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector('img[title="Citar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Citar mensaje"]'),e=>{let t=e.parentElement;t.title="Citar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Citar el Mensaje"}),document.querySelector('img[title="Editar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Editar mensaje"]'),e=>{let t=e.parentElement;t.title="Editar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Editar el Mensaje"})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mp-from")&&[].forEach.call(document.querySelectorAll(".mp-from"),e=>{const t=FNR.utility.getGroup(e.querySelector("span").style.color.replace(/, /g,"_").replace(/, /g,"_").replace(/\(/g,"_").replace(/\)/g,""));e.innerHTML='<a href="'+FNR.user.profile.getUrl(e.textContent)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.textContent+"</a>";let o=e.parentElement;for(;!o.classList.contains("mp-main");)o=o.parentElement;o.classList.add("usergroup-"+t)})}),document.addEventListener("DOMContentLoaded",()=>{document.getElementById("breadcrumbs")&&document.getElementById("forum-breadcrumb")&&[].forEach.call(document.getElementById("breadcrumbs").children,(e,t,o)=>{let r=e.href,n=e.text,l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.profile.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const e=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),t=document.querySelector(".pag-img .sprite-arrow_prosilver_right");e&&(e.parentElement.title="Ir a la página anterior",e.parentElement.classList.add("page-action"),e.parentElement.classList.remove("pag-img"),e.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),t&&(t.parentElement.title="Ir a la página siguiente",t.parentElement.classList.add("page-action"),t.parentElement.classList.remove("pag-img"),t.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>'),[].forEach.call(document.querySelectorAll("#pagination > span > a:not(.page-action)"),e=>{e.classList.add("page-link"),e.title="Ir a la página «"+e.textContent+"»"}),document.querySelector("#pagination > span > strong").title="Página actual";const o=document.querySelector("#pagination > span").innerHTML.trim().replace(/ ... /g,'<span class="page-spacer">…</span>');[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",o),e.parentElement.classList.contains("not-show")&&e.parentElement.classList.remove("not-show")})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{1!==e.classList.length&&e.classList.remove("codebox")}),document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{const t=e.querySelector("code").innerHTML.trim();e.querySelector("dt").innerHTML='Código <em>-</em> <span class="is-pointer">Seleccionar</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=(()=>{if(document.selection){const t=document.body.createTextRange();t.moveToElementText(e.querySelector("code")),t.select()}else if(window.getSelection){const t=document.createRange();t.selectNode(e.querySelector("code")),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}})})}),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.html.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.html.genDropeable()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{[].forEach.call(document.getElementsByClassName("is-tweakeable"),e=>{const t=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).paddingLeft)-parseFloat(window.getComputedStyle(e,null).paddingRight)-parseFloat(window.getComputedStyle(e,null).borderLeftWidth)-parseFloat(window.getComputedStyle(e,null).borderRightWidth);if(t>0&&e.querySelector(".is-measurable").offsetWidth>0){let o=parseFloat(window.getComputedStyle(e,null).fontSize);for(;t<e.querySelector(".is-measurable").offsetWidth;)e.style.fontSize=o+"px",o--}})})}),document.addEventListener("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
|
package/package.json
CHANGED
package/fnr.code-workspace
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"folders": [
|
|
3
|
-
{
|
|
4
|
-
"name": "Generic Skin",
|
|
5
|
-
"path": "."
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"name": "Age of Heroes",
|
|
9
|
-
"path": "../Age of Heroes"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"name": "City of Night",
|
|
13
|
-
"path": "../City of Night"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Something Darker",
|
|
17
|
-
"path": "../Something Darker"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"name": "Fall and Rise",
|
|
21
|
-
"path": "../Fall and Rise"
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"settings": {}
|
|
25
|
-
}
|
package/frameworks/FNHelper.js
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
(function (a, b, c) {
|
|
2
|
-
'use strict';
|
|
3
|
-
console.log('%cFM Helper by %cFlerex%c.blog', 'font-family: "Open Sans", Arial, sans-serif; font-size: 1.2em;', 'font-size: 1.5em; text-transform: uppercase; letter-spacing: -1px; font-weight: 800; color: #0d5ad5;', 'color: #e42e88; text-transform: none; font-size: 1.2em; font-style: italic;'), console.log('https://flerex.dev');
|
|
4
|
-
const d = 'FMHELPER_';
|
|
5
|
-
a.FLX = a.FLX || {}, a.FLX.helper = function () {
|
|
6
|
-
function h(Q) {
|
|
7
|
-
switch (Q.body.id) {
|
|
8
|
-
case 'phpbb':
|
|
9
|
-
return 'phpBB3';
|
|
10
|
-
case 'modernbb':
|
|
11
|
-
return 'ModernBB'
|
|
12
|
-
}
|
|
13
|
-
return Q.getElementById('ipbwrapper') ? 'Invision' : Q.querySelector('.pun') ? 'PunBB' : Q.body.hasAttribute('bgcolor') ? 'phpBB2' : c
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function m(Q) {
|
|
17
|
-
const R = '\xE0\xE1\xE4\xE2\xE8\xE9\xEB\xEA\xEC\xED\xEF\xEE\xF2\xF3\xF6\xF4\xF9\xFA\xFC\xFB\xF1\xE7\xB7/_,:;';
|
|
18
|
-
Q = Q.trim().toLowerCase();
|
|
19
|
-
for (var T = 0, U = R.length; T < U; T++) Q = Q.replace(new RegExp(R.charAt(T), 'g'), 'aaaaeeeeiiiioooouuuunc------'.charAt(T));
|
|
20
|
-
return Q.replace(/[^a-z0-9 -]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-')
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function n() {
|
|
24
|
-
return -1 != O.id
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function o() {
|
|
28
|
-
switch (_userdata.user_level) {
|
|
29
|
-
case 2:
|
|
30
|
-
return 'mod';
|
|
31
|
-
case 1:
|
|
32
|
-
return 'admin';
|
|
33
|
-
case 0:
|
|
34
|
-
return -1 == _userdata.user_id ? 'guest' : 'user'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function p() {
|
|
39
|
-
return _userdata.avatar.split('"')[1]
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function r(Q, R) {
|
|
43
|
-
return Q = Q.getTime(), R = R.getTime(), Math.floor(Math.abs(Q - R) / 8.64e7)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function s(Q, R) {
|
|
47
|
-
if (!localStorage) return !1;
|
|
48
|
-
const S = d + Q,
|
|
49
|
-
T = localStorage.getItem(S);
|
|
50
|
-
if (!T) return null;
|
|
51
|
-
const U = JSON.parse(T),
|
|
52
|
-
V = new Date(U.cached_at);
|
|
53
|
-
return r(V, new Date) >= R ? (localStorage.removeItem(S), null) : U.content
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function t(Q, R) {
|
|
57
|
-
if (!localStorage) return !1;
|
|
58
|
-
const S = {
|
|
59
|
-
cached_at: new Date().getTime(),
|
|
60
|
-
content: R
|
|
61
|
-
};
|
|
62
|
-
localStorage.setItem(d + Q, JSON.stringify(S))
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function u(Q, R) {
|
|
66
|
-
let S, T = null,
|
|
67
|
-
U = R.querySelector('.tooltip-title'),
|
|
68
|
-
V = R.querySelector('.tooltip-subtitle');
|
|
69
|
-
if (!U) return null;
|
|
70
|
-
let W = U.querySelector('span[style]');
|
|
71
|
-
return W && (W = W.style.color), U.firstElementChild && (S = U.firstElementChild.style.color), V && (T = V.innerHTML.match(/:\s(.*)/)[1]), new User(Q, U.textContent, c, R.getElementsByTagName('img')[0].src, T, +R.querySelector('.tooltip-counts').firstChild.firstElementChild.textContent, W)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function v(Q) {
|
|
75
|
-
return Array.from(Q).map(R => new Group(R.href.match(/\/g(\d+)-/)[1], R.textContent, R.style.color))
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function w(Q) {
|
|
79
|
-
return Q + '?change_version=' + 'invision'
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function x(Q) {
|
|
83
|
-
return /^\w+\s*:\s+(?:\[\s.+\s\]\s*)+/.test(Q.textContent)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function y(Q) {
|
|
87
|
-
const R = Array.from(Q.body.getElementsByTagName('*')).find(x);
|
|
88
|
-
return R ? R.querySelectorAll('a[href^="/g"]') : null
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function z(Q) {
|
|
92
|
-
const R = Array.from(Q.querySelectorAll('#fo_stat div')).find(x);
|
|
93
|
-
return R ? R.querySelectorAll('a[href^="/g"]') : null
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function A(...Q) {
|
|
97
|
-
const [R, S] = K(Q), T = 'groups', U = s(T, S);
|
|
98
|
-
if (null !== U) return U.forEach(W => Object.setPrototypeOf(W, Group.prototype)), Promise.resolve(U);
|
|
99
|
-
const V = D(w('/forum')).then(W => {
|
|
100
|
-
let X = z(W) || y(W);
|
|
101
|
-
if (!X) throw new Error('Could not get the forums legend. Please check if {LEGEND} is set on your index_body template.');
|
|
102
|
-
if (!X.length) return c;
|
|
103
|
-
const Y = v(X);
|
|
104
|
-
return t(T, Y), Y
|
|
105
|
-
});
|
|
106
|
-
return R && V.then(W => {
|
|
107
|
-
R.call(this, W)
|
|
108
|
-
}), V
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function B(Q, ...R) {
|
|
112
|
-
if (Q === c) throw new Error('User ID missing');
|
|
113
|
-
const [S, T] = K(R), U = 'u' + Q, V = s(U, T);
|
|
114
|
-
if (null !== V) return Object.setPrototypeOf(V, User.prototype), Promise.resolve(V);
|
|
115
|
-
const W = D('/ajax/index.php', {
|
|
116
|
-
data: {
|
|
117
|
-
f: 'm',
|
|
118
|
-
user_id: Q
|
|
119
|
-
}
|
|
120
|
-
}).then(X => {
|
|
121
|
-
let Y = u(Q, X);
|
|
122
|
-
return t(U, Y), Y
|
|
123
|
-
});
|
|
124
|
-
return S && W.then(X => {
|
|
125
|
-
S.call(this, X)
|
|
126
|
-
}), W
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function C(Q) {
|
|
130
|
-
return '?' + Object.keys(Q).map(R => encodeURIComponent(R) + '=' + encodeURIComponent(Q[R])).join('&')
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function D(Q, R = {}) {
|
|
134
|
-
return R.hasOwnProperty('data') && (Q += C(R.data)), fetch(Q, Object.assign({
|
|
135
|
-
method: 'GET',
|
|
136
|
-
credentials: 'include'
|
|
137
|
-
}, R)).then(S => S.text()).then(S => {
|
|
138
|
-
return new DOMParser().parseFromString(S, 'text/html')
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function E(Q) {
|
|
143
|
-
'loading' == b.readyState ? b.addEventListener('DOMContentLoaded', Q) : Q()
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function G(Q) {
|
|
147
|
-
const R = Q.querySelector('div.pagination');
|
|
148
|
-
return !!R && Array.from(R.children).filter(S => {
|
|
149
|
-
return 'A' == S.tagName && +S.textContent
|
|
150
|
-
})
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function H(Q) {
|
|
154
|
-
const R = Q.querySelector('div.pagination');
|
|
155
|
-
return !!R && parseInt(R.firstElementChild.textContent.match(/start = \(start > \d+\) \? \d+ : start;\n {4}start = \(start - \d+\) \* (\d+);/)[1])
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function I(Q, R) {
|
|
159
|
-
const S = Q.querySelector('table.ipbtable tbody tr:nth-child(2)').childNodes[1].firstElementChild.firstElementChild;
|
|
160
|
-
return !!S && S.style.color == R
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function J(Q, R) {
|
|
164
|
-
let S = 0;
|
|
165
|
-
return I(Q, R.color) && S++, 1 != Q.querySelector('table.ipbtable tbody tr:last-child').childElementCount && (S += Q.querySelectorAll('table.ipbtable tbody tr').length - 3), S
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function K(Q) {
|
|
169
|
-
let R = [!1, 30];
|
|
170
|
-
return 2 == Q.length ? R = Q : 'integer' == typeof Q[0] ? R[1] = Q[0] : R[0] = Q[0], R
|
|
171
|
-
}
|
|
172
|
-
class User {
|
|
173
|
-
constructor(Q, R, S, T, U, V, W) {
|
|
174
|
-
this.id = Q, this.username = R, this.level = S, this.avatar = T, this.rank = U, this.posts = V, this.color = W
|
|
175
|
-
}
|
|
176
|
-
getRankAsText() {
|
|
177
|
-
if (!this.rank) return '';
|
|
178
|
-
let Q = new DOMParser().parseFromString(this.rank, 'text/html');
|
|
179
|
-
return Q.body.textContent.trim()
|
|
180
|
-
}
|
|
181
|
-
getURL() {
|
|
182
|
-
return `/u${this.id}`
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
class Group {
|
|
186
|
-
constructor(Q, R, S) {
|
|
187
|
-
this.id = Q, this.name = R, this.color = S
|
|
188
|
-
}
|
|
189
|
-
getURL() {
|
|
190
|
-
return `/g${this.id}-${m(this.name)}`
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
const O = new User(_userdata.user_id, _userdata.username, o(), p(), _lang.hasOwnProperty('rank_title') ? _lang.rank_title : c, _userdata.user_posts, c),
|
|
194
|
-
P = {
|
|
195
|
-
isLoggedIn: n,
|
|
196
|
-
userLevel: o,
|
|
197
|
-
getGroups: A,
|
|
198
|
-
getUser: B,
|
|
199
|
-
slugify: m,
|
|
200
|
-
attachScriptToChat: function (Q) {
|
|
201
|
-
function R(T, U) {
|
|
202
|
-
'complete' == T.contentDocument.readyState ? U() : T.addEventListener('load', U)
|
|
203
|
-
}
|
|
204
|
-
let S = b.createElement('script');
|
|
205
|
-
S.type = 'text/javascript', S.textContent = `;(${Q.toString()})();`, E(function () {
|
|
206
|
-
const T = b.querySelectorAll('object[data^="/chatbox/index.forum"], iframe[src^="/chatbox/index.forum"]');
|
|
207
|
-
Array.from(T).foreach(U => {
|
|
208
|
-
R(U, function () {
|
|
209
|
-
U.contentDocument.getElementsByTagName('head')[0].appendChild(S.cloneNode(!0))
|
|
210
|
-
})
|
|
211
|
-
})
|
|
212
|
-
})
|
|
213
|
-
},
|
|
214
|
-
getVersion: function () {
|
|
215
|
-
return h(b)
|
|
216
|
-
},
|
|
217
|
-
enableDebugMode: function () {
|
|
218
|
-
console.warn('%cATTENTION: Debug mode is enabled', 'color: red; font-weight: bold; font-size: 1.1em;'), console.warn('CSS files are not being cached by browsers');
|
|
219
|
-
const Q = '?debug=' + +new Date;
|
|
220
|
-
b.querySelectorAll('link[rel="stylesheet"]').forEach(R => {
|
|
221
|
-
R.setAttribute('href', R.getAttribute('href') + Q)
|
|
222
|
-
})
|
|
223
|
-
},
|
|
224
|
-
setCache: t,
|
|
225
|
-
getCache: s,
|
|
226
|
-
get: D
|
|
227
|
-
};
|
|
228
|
-
return n() && Object.assign(P, {
|
|
229
|
-
currentUser: function (Q) {
|
|
230
|
-
switch (Q) {
|
|
231
|
-
case 'id':
|
|
232
|
-
return O.id;
|
|
233
|
-
case 'username':
|
|
234
|
-
case 'name':
|
|
235
|
-
return O.username;
|
|
236
|
-
case 'avatar':
|
|
237
|
-
return p();
|
|
238
|
-
case 'level':
|
|
239
|
-
return O.level;
|
|
240
|
-
case 'rank':
|
|
241
|
-
return O.rank;
|
|
242
|
-
case 'posts':
|
|
243
|
-
return O.posts
|
|
244
|
-
}
|
|
245
|
-
throw new Error('Argument is not supported')
|
|
246
|
-
},
|
|
247
|
-
u: O,
|
|
248
|
-
user: O
|
|
249
|
-
}), User.prototype.getGroup = function () {
|
|
250
|
-
return new Promise(Q => {
|
|
251
|
-
A().then(R => {
|
|
252
|
-
this.color === c ? B(this.id).then(S => {
|
|
253
|
-
Q(R.find(T => T.color == S.color))
|
|
254
|
-
}) : Q(R.find(S => S.color == this.color))
|
|
255
|
-
})
|
|
256
|
-
})
|
|
257
|
-
}, Group.prototype.getMemberAmount = function (...Q) {
|
|
258
|
-
const [R, S] = K(Q), T = 'gc' + this.id, U = s(T, S);
|
|
259
|
-
if (null !== U) return Promise.resolve(U);
|
|
260
|
-
const V = D(w(`/g${this.id}-`)).then(W => {
|
|
261
|
-
const X = G(W);
|
|
262
|
-
if (!X.length) {
|
|
263
|
-
const Y = J(W, this);
|
|
264
|
-
return t(T, Y), Y
|
|
265
|
-
}
|
|
266
|
-
return D(X.pop().href)
|
|
267
|
-
}).then(W => {
|
|
268
|
-
if ('number' == typeof W) return W;
|
|
269
|
-
const X = G(W),
|
|
270
|
-
Y = X.length * H(W) + J(W, this);
|
|
271
|
-
return t(T, Y), Y
|
|
272
|
-
});
|
|
273
|
-
return R && V.then(W => {
|
|
274
|
-
R.call(this, W)
|
|
275
|
-
}), V
|
|
276
|
-
}, P
|
|
277
|
-
}(), 'undefined' == typeof a._ && (a._ = FLX.helper), 'undefined' == typeof a.H && (a.H = FLX.helper)
|
|
278
|
-
})(this, document);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t,r){"use strict";console.log("%cFM Helper by %cFlerex%c.blog",'font-family: "Open Sans", Arial, sans-serif; font-size: 1.2em;',"font-size: 1.5em; text-transform: uppercase; letter-spacing: -1px; font-weight: 800; color: #0d5ad5;","color: #e42e88; text-transform: none; font-size: 1.2em; font-style: italic;"),console.log("https://flerex.dev");const n="FMHELPER_";e.FLX=e.FLX||{},e.FLX.helper=function(){function e(e){switch(e.body.id){case"phpbb":return"phpBB3";case"modernbb":return"ModernBB"}return e.getElementById("ipbwrapper")?"Invision":e.querySelector(".pun")?"PunBB":e.body.hasAttribute("bgcolor")?"phpBB2":r}function o(e){const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var r=0,n=t.length;r<n;r++)e=e.replace(new RegExp(t.charAt(r),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(r));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}function s(){return-1!=q.id}function i(){switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}}function l(){return _userdata.avatar.split('"')[1]}function a(e,t){return e=e.getTime(),t=t.getTime(),Math.floor(Math.abs(e-t)/864e5)}function c(e,t){if(!localStorage)return!1;const r=n+e,o=localStorage.getItem(r);if(!o)return null;const s=JSON.parse(o),i=new Date(s.cached_at);return a(i,new Date)>=t?(localStorage.removeItem(r),null):s.content}function u(e,t){if(!localStorage)return!1;const r={cached_at:(new Date).getTime(),content:t};localStorage.setItem(n+e,JSON.stringify(r))}function h(e,t){let n,o=null,s=t.querySelector(".tooltip-title"),i=t.querySelector(".tooltip-subtitle");if(!s)return null;let l=s.querySelector("span[style]");return l&&(l=l.style.color),s.firstElementChild&&(n=s.firstElementChild.style.color),i&&(o=i.innerHTML.match(/:\s(.*)/)[1]),new L(e,s.textContent,r,t.getElementsByTagName("img")[0].src,o,+t.querySelector(".tooltip-counts").firstChild.firstElementChild.textContent,l)}function f(e){return Array.from(e).map(e=>new O(e.href.match(/\/g(\d+)-/)[1],e.textContent,e.style.color))}function d(e){return e+"?change_version=invision"}function m(e){return/^\w+\s*:\s+(?:\[\s.+\s\]\s*)+/.test(e.textContent)}function g(e){const t=Array.from(e.body.getElementsByTagName("*")).find(m);return t?t.querySelectorAll('a[href^="/g"]'):null}function p(e){const t=Array.from(e.querySelectorAll("#fo_stat div")).find(m);return t?t.querySelectorAll('a[href^="/g"]'):null}function y(...e){const[t,n]=A(e),o="groups",s=c(o,n);if(null!==s)return s.forEach(e=>Object.setPrototypeOf(e,O.prototype)),Promise.resolve(s);const i=w(d("/forum")).then(e=>{let t=p(e)||g(e);if(!t)throw new Error("Could not get the forums legend. Please check if {LEGEND} is set on your index_body template.");if(!t.length)return r;const n=f(t);return u(o,n),n});return t&&i.then(e=>{t.call(this,e)}),i}function b(e,...t){if(e===r)throw new Error("User ID missing");const[n,o]=A(t),s="u"+e,i=c(s,o);if(null!==i)return Object.setPrototypeOf(i,L.prototype),Promise.resolve(i);const l=w("/ajax/index.php",{data:{f:"m",user_id:e}}).then(t=>{let r=h(e,t);return u(s,r),r});return n&&l.then(e=>{n.call(this,e)}),l}function S(e){return"?"+Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}function w(e,t={}){return t.hasOwnProperty("data")&&(e+=S(t.data)),fetch(e,Object.assign({method:"GET",credentials:"include"},t)).then(e=>e.text()).then(e=>(new DOMParser).parseFromString(e,"text/html"))}function x(e){"loading"==t.readyState?t.addEventListener("DOMContentLoaded",e):e()}function C(e){const t=e.querySelector("div.pagination");return!!t&&Array.from(t.children).filter(e=>"A"==e.tagName&&+e.textContent)}function E(e){const t=e.querySelector("div.pagination");return!!t&&parseInt(t.firstElementChild.textContent.match(/start = \(start > \d+\) \? \d+ : start;\n {4}start = \(start - \d+\) \* (\d+);/)[1])}function v(e,t){const r=e.querySelector("table.ipbtable tbody tr:nth-child(2)").childNodes[1].firstElementChild.firstElementChild;return!!r&&r.style.color==t}function _(e,t){let r=0;return v(e,t.color)&&r++,1!=e.querySelector("table.ipbtable tbody tr:last-child").childElementCount&&(r+=e.querySelectorAll("table.ipbtable tbody tr").length-3),r}function A(e){let t=[!1,30];return 2==e.length?t=e:"integer"==typeof e[0]?t[1]=e[0]:t[0]=e[0],t}class L{constructor(e,t,r,n,o,s,i){this.id=e,this.username=t,this.level=r,this.avatar=n,this.rank=o,this.posts=s,this.color=i}getRankAsText(){if(!this.rank)return"";let e=(new DOMParser).parseFromString(this.rank,"text/html");return e.body.textContent.trim()}getURL(){return`/u${this.id}`}}class O{constructor(e,t,r){this.id=e,this.name=t,this.color=r}getURL(){return`/g${this.id}-${o(this.name)}`}}const q=new L(_userdata.user_id,_userdata.username,i(),l(),_lang.hasOwnProperty("rank_title")?_lang.rank_title:r,_userdata.user_posts,r),D={isLoggedIn:s,userLevel:i,getGroups:y,getUser:b,slugify:o,attachScriptToChat:function(e){function r(e,t){"complete"==e.contentDocument.readyState?t():e.addEventListener("load",t)}let n=t.createElement("script");n.type="text/javascript",n.textContent=`;(${e.toString()})();`,x(function(){const e=t.querySelectorAll('object[data^="/chatbox/index.forum"], iframe[src^="/chatbox/index.forum"]');Array.from(e).foreach(e=>{r(e,function(){e.contentDocument.getElementsByTagName("head")[0].appendChild(n.cloneNode(!0))})})})},getVersion:function(){return e(t)},enableDebugMode:function(){console.warn("%cATTENTION: Debug mode is enabled","color: red; font-weight: bold; font-size: 1.1em;"),console.warn("CSS files are not being cached by browsers");const e="?debug="+ +new Date;t.querySelectorAll('link[rel="stylesheet"]').forEach(t=>{t.setAttribute("href",t.getAttribute("href")+e)})},setCache:u,getCache:c,get:w};return s()&&Object.assign(D,{currentUser:function(e){switch(e){case"id":return q.id;case"username":case"name":return q.username;case"avatar":return l();case"level":return q.level;case"rank":return q.rank;case"posts":return q.posts}throw new Error("Argument is not supported")},u:q,user:q}),L.prototype.getGroup=function(){return new Promise(e=>{y().then(t=>{this.color===r?b(this.id).then(r=>{e(t.find(e=>e.color==r.color))}):e(t.find(e=>e.color==this.color))})})},O.prototype.getMemberAmount=function(...e){const[t,r]=A(e),n="gc"+this.id,o=c(n,r);if(null!==o)return Promise.resolve(o);const s=w(d(`/g${this.id}-`)).then(e=>{const t=C(e);if(!t.length){const t=_(e,this);return u(n,t),t}return w(t.pop().href)}).then(e=>{if("number"==typeof e)return e;const t=C(e),r=t.length*E(e)+_(e,this);return u(n,r),r});return t&&s.then(e=>{t.call(this,e)}),s},D}(),void 0===e._&&(e._=FLX.helper),void 0===e.H&&(e.H=FLX.helper)})(this,document);
|