generic-skin 3.8.7 → 3.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/vueDefault.js +1 -1
- package/apps/vueDefault.min.js +1 -1
- package/frameworks/FNRFramework.js +82 -56
- package/frameworks/FNRFramework.min.js +1 -1
- package/general.js +4 -15
- package/general.min.js +1 -1
- package/package.json +1 -1
package/apps/vueDefault.js
CHANGED
|
@@ -294,7 +294,7 @@ Vue.component('lista-seguidos', {
|
|
|
294
294
|
</li>
|
|
295
295
|
</template>
|
|
296
296
|
<template v-else>
|
|
297
|
-
<li class="row is-not-topic is-not-lastpost" v-for="topic in followed.content" :key="topic.id">
|
|
297
|
+
<li :class="'row is-not-topic is-not-lastpost ' + topic.type" v-for="topic in followed.content" :key="topic.id">
|
|
298
298
|
<temas-foro type="followed" mode="" :url="topic.url" :replies="topic.replies + ' respuestas'" :views="topic.views + ' visitas'">
|
|
299
299
|
<template slot="title">{{ topic.name }}</template>
|
|
300
300
|
<template slot="radio">
|
package/apps/vueDefault.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Vue.component("panel-control",{props:["elements"],data:()=>({userId:_userdata.user_id,state:{page:0},content:{original:[],current:[]}}),computed:{validationPanel(){return FNR.utility.genValidation(this.content.current)},toSave(){let e=[];return[].forEach.call(this.content.current,(t,o)=>{t.value!==this.content.original[o].value&&e.push({name:t.name,type:t.type,value:t.value})}),e}},methods:{updateProfile(){this.toSave.length&&""===this.validationPanel&&(this.state.page=2,FNR.user.profile.setData(this.toSave).then(e=>{if(e){let e=!1;this.toSave.map(t=>{t.name.toLowerCase().indexOf("tema")>-1&&(e=!0)}),e?(FNR.html.genNotification("Atención","Información actualizada sin inconvenientes.","fas fa-check"),FNR.user.setTheme(!0)):(FNR.html.genNotification("Atención","Información actualizada sin inconvenientes.","fas fa-check"),setTimeout(()=>{window.location.reload()},2e3))}else FNR.html.genNotification("Atención","Hubo un problema al actualizar. Dale otro intento.","fas fa-exclamation")}))}},created(){FNR.user.profile.getData(JSON.parse(this.elements.replace(/'/g,'"'))).then(e=>{this.content.original=JSON.parse(JSON.stringify(e)),this.content.current=e,this.state.page=1})},template:'\n <section id="forum-cp" class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Editar perfil</h2>\n <hr />\n <p>En esta página podrás editar tu perfil de usuario. En caso de que quieras editar tu contraseña, por favor dirígete a <a target="_blank" title="Ir a «Cambiar contraseña»" :href="\'/profile?change_password=Cambiar+tu+contraseña&mode=editprofile&page_profil=informations&user_id=\' + userId">este enlace</a>.</p>\n <p>Si estás experimentando problemas con el foro, pulsa <a title="Reiniciar cache" onclick="localStorage.clear(); window.location.replace(\'/\')">este otro</a>. Puede que los solucione.</p>\n <p>Ante cualquier duda o problema, contacta con la administración.</p>\n </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <aviso-foro v-show="validationPanel !== \'\'">\n <ul v-html="validationPanel"></ul>\n </aviso-foro>\n <ul class="forum-fieldlist no-style">\n <li v-for="item in content.current">\n <campo-foro :name="item.name">\n <input v-model="item.value" v-if="item.type === \'input\' || item.type === \'avatar\'" type="text"/>\n <textarea v-model="item.value" v-else-if="item.type === \'textarea\'"></textarea>\n <div v-else-if="item.type === \'select\'" class="select-container">\n <select v-model="item.value">\n <option :value="option.value" v-for="option in item.options">{{ option.name }}</option>\n </select>\n </div>\n </campo-foro>\n </li>\n </ul>\n <div id="usereply-comand">\n <button class="button1 btn-main" @click="updateProfile()" title="Actualizar perfil">Actualizar</button>\n </div>\n </template>\n <template v-if="state.page === 2">\n <cargando-foro text="Actualizando información…"></cargando-foro>\n </template>\n </section>\n '}),Vue.component("lista-bosquejos",{data:()=>({state:{page:0},drafts:{}}),created(){FNR.user.drafts.getDrafts().then(e=>{this.state.page=1,this.drafts=e})},template:'\n <section class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Lista de Bosquejos</h2>\n <hr />\n <p>En esta página tienes tu lista de Bosquejos dividida entre mensajes y temas.</p>\n <p>No es una lista completa, tan solo muestra la primera página. Si deseas ver más bosquejos, aligera la lista publicándolos.</p>\n <p>Ante cualquier duda o problema, contacta con la administración.</p>\n </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <section id="forum-drafts" class="forum-topiclist">\n <div class="is-content mb-4">\n <h4>Mensajes</h4>\n </div>\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!drafts.msgDrafts.length ? \' no-results\': \'\')">\n <template v-if="!drafts.msgDrafts.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes bosquejos guardados</h6>\n </li>\n </template>\n <template v-else>\n <li class="row is-not-topic is-not-lastpost" v-for="draft in drafts.msgDrafts">\n <temas-foro type="draft" mode="" :url="draft.topic.url" :replies="draft.info.location" :views="draft.info.date" :quick="draft.modify">\n <template slot="title">{{ draft.topic.name }}</template>\n </temas-foro>\n </li>\n </template>\n </ul>\n <div class="is-content mt-5 mb-4">\n <h4>Temas</h4>\n </div>\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!drafts.topicDrafts.length ? \' no-results\': \'\')">\n <template v-if="!drafts.topicDrafts.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes bosquejos guardados</h6>\n </li>\n </template>\n <template v-else>\n <li class="row is-not-topic is-not-lastpost" v-for="draft in drafts.topicDrafts">\n <temas-foro type="draft" mode="" :url="draft.topic.url" :replies="draft.info.location" :views="draft.info.date" :quick="draft.modify">\n <template slot="title">{{ draft.topic.name }}</template>\n </temas-foro>\n </li>\n </template>\n </ul>\n </section>\n </template>\n </section>\n '}),Vue.component("lista-seguidos",{data:()=>({state:{page:0,selected:[]},followed:{page:0,loading:0,pages:[],content:[]}}),computed:{sortedPages(){return FNR.behaviour.genPagelist(this.followed.pages,this.followed.page)}},methods:{getPage(e){this.followed.loading=0,FNR.user.followed.getFollowed(e).then(e=>{this.followed.content=e,this.followed.loading=1,this.state.page=1})},setPage(e){this.followed.page=e,this.getPage(this.followed.pages[this.followed.page])},setTopic(e){const t=this.state.selected.indexOf(e);-1===t?this.state.selected.push(e):this.state.selected.splice(t,1)},delTopics(){FNR.user.followed.delFollowed(this.state.selected).then(e=>{e?window.location.reload():FNR.html.genNotification("Atención","Hubo un problema al retirar. Inténtalo de nuevo.","fas fa-exclamation")})}},created(){FNR.user.followed.getPages().then(e=>{0!==e.items&&(this.followed.pages=e.pages,this.getPage(this.followed.pages[this.followed.page]))})},template:'\n <section class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Lista de Temas Supervisados</h2>\n <hr />\n <p>En esta página tienes tu lista de Temas Supervisados.</p>\n <p>Ante cualquier duda o problema, contacta con la administración.</p>\n </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <mando-foro id="upper-controls" app="true">\n <template slot="pagination" v-if="followed.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="followed.page > 0" @click="setPage(followed.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedPages">\n <strong v-if="followed.pages.indexOf(page) === followed.page">{{ followed.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (followed.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPage(followed.pages.indexOf(page))">{{ followed.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(followed.page + 1) < followed.pages.length" @click="setPage(followed.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n <template slot="controls">\n <li @click="delTopics()">\n <boton-foro url="javascript:{}" name="Retirar" icon="fas fa-minus"></boton-foro>\n </li>\n </template>\n </mando-foro>\n <section id="forum-followed" class="forum-topiclist">\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!followed.content.length || followed.loading === 0 ? \' no-results\': \'\')">\n <template v-if="!followed.content.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes temas supervisados</h6>\n </li>\n </template>\n <template v-else-if="followed.loading === 0">\n <li class="is-not-topic is-not-lastpost">\n <cargando-foro text="Cargando temas…"></cargando-foro>\n </li>\n </template>\n <template v-else>\n <li class="row is-not-topic is-not-lastpost" v-for="topic in followed.content" :key="topic.id">\n <temas-foro type="followed" mode="" :url="topic.url" :replies="topic.replies + \' respuestas\'" :views="topic.views + \' visitas\'">\n <template slot="title">{{ topic.name }}</template>\n <template slot="radio">\n <div :class="\'forum-checkbox\' + (state.selected.indexOf(topic.id) === -1 ? \'\' : \' is-active\')">\n <div class="checkbox-content" @click="setTopic(topic.id)">\n <div class="checkbox-click">\n <i class="fas fa-check"></i>\n </div>\n </div>\n </div>\n </template>\n </temas-foro>\n </li>\n </template>\n </ul>\n </section>\n <mando-foro id="lower-controls" app="true">\n <template slot="pagination" v-if="followed.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="followed.page > 0" @click="setPage(followed.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedPages">\n <strong v-if="followed.pages.indexOf(page) === followed.page">{{ followed.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (followed.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPage(followed.pages.indexOf(page))">{{ followed.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(followed.page + 1) < followed.pages.length" @click="setPage(followed.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n <template slot="controls">\n <li @click="delTopics()">\n <boton-foro url="javascript:{}" name="Retirar" icon="fas fa-minus"></boton-foro>\n </li>\n </template>\n </mando-foro>\n </template>\n </section>\n '}),Vue.component("editor-foro",{data:()=>({state:{page:0,editor:"none",admin:1===_userdata.user_level,guest:0===_userdata.session_logged_in,dice:document.querySelectorAll("#list_dice").length,draft:document.querySelectorAll('input[name="draft"]').length},colors:FNR.forum.getColors(),content:{username:"",subject:"",msg:"",type:-1,options:[]},users:{current:"",options:[],selected:[],selector:!0},groups:{type:-1,options:[]},dice:{options:[],current:[]}}),computed:{msgCheck(){let e="";return this.state.guest&&(this.content.username.trim().length<1||this.content.username.trim().length>60)&&(e+="<li>Escribe un nombre de usuario de tamaño adecuado.</li>"),"post"===this.state.editor&&0===this.users.selected.length&&-1===this.groups.type&&(e+="<li>Selecciona al menos un usuario.</li>"),this.state.admin&&"post"===this.state.editor&&0===this.users.selected.length&&-1===this.groups.type&&(e+="<li>Selecciona un grupo.</li>"),"newtopic"!==this.state.editor&&"post"!==this.state.editor&&"edittopicdraft"!==this.state.editor||(this.content.subject.trim().length<4||this.content.subject.trim().length>100)&&(e+="<li>Escribe un titulo de tamaño adecuado (4 a 100 carácteres).</li>"),this.content.msg.trim().length<10&&(e+="<li>Escribe un mensaje lo suficientemente largo.</li>"),e},sortedCharacters(){return Object.keys(this.users.options).length?this.users.options.map(e=>e.user).filter(e=>-1===this.users.selected.indexOf(e)).filter(e=>e.toLowerCase().indexOf(this.users.current.toLowerCase())>-1).sort((e,t)=>e<t?-1:e>t?1:0):[]},sortedEditCharacters(){return this.users.selected.sort((e,t)=>e<t?-1:e>t?1:0)}},methods:{insertSomething(e,t){const o=document.getElementById("usereply-editor"),n=e.replace(/-jump-/g,"\n"),i=t.replace(/-jump-/g,"\n");if(document.selection)o.focus(),document.selection.createRange().text=n+document.selection.createRange().text+i;else if(o.selectionStart||"0"==o.selectionStart){const e=o.selectionStart,t=o.selectionEnd,s=t+n.length;o.value=o.value.substring(0,e)+n+o.value.substring(e,t)+i+o.value.substring(t,o.value.length),o.setSelectionRange(s,s)}this.content.msg=o.value},newDice(){this.dice.current.push({dice:-1,number:0})},addCharacter(e){this.users.selected.push(e),this.users.selector=!1,this.users.current="",setTimeout(()=>{this.users.selector=!0},250)},deleteCharacter(e){this.users.current="",this.users.selected.splice(e,1)},changeGroup(){this.users.selected=[],this.users.current=""},insertUrl(){const e=document.getElementById("usereply-editor"),t=e.selectionStart,o=e.selectionEnd;FNR.html.genPrompt("Insertar enlace","Introduce el título del enlace. Por defecto, ponemos la este como título.","Título del enlace","").then(n=>{!1!==n?this.insertSomething("[url=","]"+n+"[/url]"):this.insertSomething("[url=","]"+e.value.substring(t,o)+"[/url]")})},insertImg(){FNR.html.genPrompt("Insertar imagen","Introduce las medidas de la imagen en píxeles pero sin la medida (por ejemplo 100x100). <u>En caso de dejarlo en blanco, se insertará con la medida inicial</u>.","Medidas de la imagen","").then(e=>{!1!==e?this.insertSomething("[img="+e+"]","[/img]"):this.insertSomething("[img]","[/img]")})},insertSpoiler(){FNR.html.genPrompt("Insertar spoiler","Introduce el título del spoiler. <u>En caso de dejarlo en blanco, se insertará sin él.</u>.","Título del spoiler","").then(e=>{!1!==e?this.insertSomething("[spoiler="+e+"]","[/spoiler]"):this.insertSomething("[spoiler]","[/spoiler]")})},insertQuote(){FNR.html.genPrompt("Insertar cita","Introduce el destinatario de la cita. <u>En caso de dejarlo en blanco, se insertará sin él.</u>.","Destinatario de la cita","").then(e=>{!1!==e?this.insertSomething("[quote="+e+"]","[/quote]"):this.insertSomething("[quote]","[/quote]")})},parseMsg(){window.forumParsing=!0,document.querySelector("#forum-realreply > form .sceditor-container > textarea")?document.querySelector("#forum-realreply > form .sceditor-container > textarea").value=this.content.msg.replace(/#per/g,this.colors[this.colors.length-1].hex):document.querySelector("#forum-realreply > form textarea#text_editor_textarea").value=this.content.msg.replace(/#per/g,this.colors[this.colors.length-1].hex),this.state.guest&&(this.content.subject.trim().length>4||this.content.subject.trim().length<60)&&(document.querySelector('#forum-realreply > form input[name="username"]').value=this.content.username),"post"===this.state.editor&&this.users.selected.length>0&&-1===this.groups.type&&this.users.selected.forEach(e=>{document.querySelector("#forum-realreply > form #add_username").click(),document.querySelectorAll('#forum-realreply > form input[name="username[]"]')[document.querySelectorAll('#forum-realreply > form input[name="username[]"]').length-2].value=e}),this.state.admin&&("post"===this.state.editor?0===this.users.selected.length&&-1!==this.groups.type&&(document.querySelector('#forum-realreply > form select[name="usergroup"]').value=this.groups.type):"newtopic"===this.state.editor&&-1!==this.content.type&&(document.querySelector('#forum-realreply > form input[type="radio"][name="topictype"][value="'+this.content.type+'"]').checked=!0)),"newtopic"!==this.state.editor&&"post"!==this.state.editor&&"edittopicdraft"!==this.state.editor||(this.content.subject.trim().length>4||this.content.subject.trim().length<100)&&(document.querySelector('#forum-realreply > form input[name="subject"]').value=this.content.subject.trim()),"reply"===this.state.editor&&FNR.content.isAutosave()&&!1!==FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)&&-1!==_userdata.user_id&&FNR.cache.delData("post"+document.post.t.value+"-"+_userdata.user_id),!this.state.dice||"reply"!==this.state.editor&&"newtopic"!==this.state.editor&&"editpostdraft"!==this.state.editor&&"edittopicdraft"!==this.state.editor||([].forEach.call(document.querySelectorAll("#forum-realreply > form #list_dice tr"),(e,t)=>{0!==t&&e.remove()}),document.querySelector("#forum-realreply > form #list_dice tr td").insertAdjacentHTML("beforeend",'<span id="dice_to_del"></span>'),this.dice.current.filter(e=>-1!==e.dice).filter(e=>0!==parseFloat(e.number)&&!isNaN(parseFloat(e.number))).forEach(e=>{add_dice(document.querySelectorAll("#list_dice tr").length,e.dice,e.number)}))},draftMsg(){this.msgCheck.length||(this.parseMsg(),document.querySelector('#forum-realreply > form input[value="Bosquejo"], #forum-realreply input[value="Modificar"], #forum-realreply input[value="Registrar"]').click())},delMsg(){const e=new URLSearchParams(window.location.search);let t="topicdraft",o="t";"editpostdraft"===e.get("mode")&&(t="draft",o="p"),FNR.user.drafts.delDrafts(t,[e.get(o)]).then(e=>{e?window.location.replace(`${window.location.protocol}//${window.location.host}${forumConfig.usableDirections.ucp}#/bosquejos`):FNR.html.genNotification("Atención","Hubo un problema al eliminar. Inténtalo de nuevo.","fas fa-exclamation")})},sendMsg(){this.msgCheck.length||(this.parseMsg(),document.querySelector('#forum-realreply > form input[value="Enviar"], #forum-realreply input[value="Publicar"]').click())},prevMsg(){this.msgCheck.length||(this.parseMsg(),document.querySelector('#forum-realreply > form input[value="Previsualización"], #forum-realreply input[value="Previsualizar"]').click())}},created(){const e=()=>{if(document.querySelector('#forum-realreply > form input[name="username"]')&&(this.content.username=document.querySelector('#forum-realreply > form input[name="username"]').value),document.querySelector("#forum-realreply > form #text_editor_textarea")){let e=document.querySelector("#forum-realreply > form #text_editor_textarea").value;this.content.msg=e}if(document.querySelector('#forum-realreply > form input[name="subject"]')){let e=document.querySelector('#forum-realreply input[name="subject"]').value;document.querySelector('#forum-realreply select[name="usergroup"]')&&""!==document.querySelector('#forum-realreply select[name="usergroup"]').value?this.groups.type=document.querySelector('#forum-realreply select[name="usergroup"]').value:document.querySelector('#forum-realreply input[name="username[]"]')&&[].forEach.call(document.querySelectorAll('#forum-realreply input[name="username[]"]'),e=>{""!==e.value&&this.users.selected.push(e.value)}),this.content.subject=e}document.querySelector("#forum-realreply > form #list_dice")&&([].forEach.call(document.querySelectorAll("#forum-realreply > form #list_dice #post_dice option"),e=>{""!==e.value&&this.dice.options.push({value:e.value,content:e.textContent})}),1===document.querySelectorAll("#forum-realreply > form #list_dice tr").length?this.dice.current.push({dice:-1,number:0}):[].forEach.call(document.querySelectorAll("#forum-realreply > form #list_dice tr"),e=>{""!==e.querySelector("select").value&&this.dice.current.push({dice:parseFloat(e.querySelector("select").value),number:parseFloat(e.querySelector("input").value)})})),4===document.querySelectorAll('#forum-realreply > form .panel.row3 input[type="radio"]').length&&[].forEach.call(document.querySelectorAll('#forum-realreply > form .panel.row3 input[type="radio"]'),e=>{this.content.options.push({value:e.value,name:e.parentElement.textContent.trim()}),e.checked&&(this.content.type=e.value)}),document.querySelector('#forum-realreply > form select[name="usergroup"]')&&[].forEach.call(document.querySelectorAll('#forum-realreply > form select[name="usergroup"] option'),e=>{""!==e.value&&this.groups.options.push({value:e.value,name:e.textContent})}),FNR.content.isAutosave()&&""===this.content.msg&&!1!==FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)&&-1!==_userdata.user_id&&(this.content.msg=FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)),this.state.page=1,document.onkeydown=(e=>{const t=document.getElementById("usereply-editor");document.activeElement===t&&(e.ctrlKey&&"b"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b]","[/b]")):e.ctrlKey&&"i"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[i]","[/i]")):e.ctrlKey&&"s"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[strike]","[/strike]")):e.ctrlKey&&"u"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[u]","[/u]")):e.ctrlKey&&","===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[left]","[/left]")):e.ctrlKey&&"."===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[center]","[/center]")):e.ctrlKey&&"-"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[right]","[/right]")):e.ctrlKey&&"o"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertUrl()):e.ctrlKey&&"p"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertImg()):e.ctrlKey&&"`"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSpoiler()):e.ctrlKey&&"+"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[code]","[/code]")):e.ctrlKey&&"l"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertQuote()):e.ctrlKey&&"ñ"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[hide]","[/hide]")):e.ctrlKey&&"´"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[youtube]","[/youtube]")):"Home"===e.key?(e.preventDefault(),e.stopPropagation(),t.setSelectionRange(0,0)):"End"===e.key?(e.preventDefault(),e.stopPropagation(),t.setSelectionRange(t.value.length,t.value.length)):e.ctrlKey&&"1"===e.key&&"undefined"!==this.colors[0]&&this.colors.length-1!=0?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[0].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"!"===e.key&&"undefined"!==this.colors[0]&&this.colors.length-1!=0?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[0].hex+"]","[/color][/b]")):e.ctrlKey&&"2"===e.key&&"undefined"!==this.colors[1]&&this.colors.length-1!=1?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[1].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&'"'===e.key&&"undefined"!==this.colors[1]&&this.colors.length-1!=1?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[1].hex+"]","[/color][/b]")):e.ctrlKey&&"3"===e.key&&"undefined"!==this.colors[2]&&this.colors.length-1!=2?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[2].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"·"===e.key&&"undefined"!==this.colors[2]&&this.colors.length-1!=2?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[2].hex+"]","[/color][/b]")):e.ctrlKey&&"4"===e.key&&"undefined"!==this.colors[3]&&this.colors.length-1!=3?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[3].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"$"===e.key&&"undefined"!==this.colors[3]&&this.colors.length-1!=3?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[3].hex+"]","[/color][/b]")):e.ctrlKey&&"5"===e.key&&"undefined"!==this.colors[4]&&this.colors.length-1!=4?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[4].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"%"===e.key&&"undefined"!==this.colors[4]&&this.colors.length-1!=4?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[4].hex+"]","[/color][/b]")):e.ctrlKey&&"6"===e.key&&"undefined"!==this.colors[5]&&this.colors.length-1!=5?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[5].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"&"===e.key&&"undefined"!==this.colors[5]&&this.colors.length-1!=5?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[5].hex+"]","[/color][/b]")):e.ctrlKey&&"7"===e.key&&"undefined"!==this.colors[6]&&this.colors.length-1!=6?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[6].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"/"===e.key&&"undefined"!==this.colors[6]&&this.colors.length-1!=6?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[6].hex+"]","[/color][/b]")):e.ctrlKey&&"8"===e.key&&"undefined"!==this.colors[7]&&this.colors.length-1!=7?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[7].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"("===e.key&&"undefined"!==this.colors[7]&&this.colors.length-1!=7?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[7].hex+"]","[/color][/b]")):e.ctrlKey&&"9"===e.key&&"undefined"!==this.colors[8]&&this.colors.length-1!=8?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[8].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&")"===e.key&&"undefined"!==this.colors[8]&&this.colors.length-1!=8?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[8].hex+"]","[/color][/b]")):e.ctrlKey&&"º"===e.key&&void 0!==forumConfig.skinOptions.customColour?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color=#per]","[/color]")):e.ctrlKey&&e.shiftKey&&"ª"===e.key&&void 0!==forumConfig.skinOptions.customColour?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color=#per]","[/color][/b]")):e.ctrlKey&&e.shiftKey&&"Enter"===e.key&&!this.msgCheck.length?(e.preventDefault(),e.stopPropagation(),this.prevMsg()):e.ctrlKey&&e.altKey&&"Enter"===e.key&&"reply"===this.state.editor&&this.state.dice&&!this.msgCheck.length?(e.preventDefault(),e.stopPropagation(),this.draftMsg()):e.ctrlKey&&"Enter"===e.key&&!this.msgCheck.length&&(e.preventDefault(),e.stopPropagation(),this.sendMsg()))}),setTimeout(()=>{FNR.behaviour.genDropeable()},250)},t=()=>{"post"===this.state.editor?FNR.forum.getMembers(!0).then(t=>{this.users.options=t,e()}):e()};void 0!==document.post&&("editpost"===document.post.mode.value?void 0!==document.post.modif_topic_title?this.state.editor="newtopic":this.state.editor="reply":"edit"===document.post.mode.value?this.state.editor="post":this.state.editor=document.post.mode.value),this.state.guest?setTimeout(()=>{e()},2e3):void 0===forumConfig.skinOptions.customColour?t():FNR.user.profile.getData([{name:forumConfig.skinOptions.customColour,type:"input"}]).then(e=>{this.colors.push({hex:e[0].value,name:"Personal"}),t()}),this.state.replies=document.querySelectorAll(".forum-otherposts > *").length||document.querySelector('input[type="submit"][value="Modificar"]')?"Varios":""},mounted(){insertIntoEditor=(e=>{try{this.insertSomething(" "+e+" ","")}catch(e){console&&console.error(e)}}),$("#quickEmojInternal").on("load",function(){$("#quickEmojInternal").contents().find("head").append("<style>body{padding: 1rem!important}</style>")});let e="";document.querySelector('p[style="color: red;"]')&&(e=document.querySelector('p[style="color: red;"]').textContent,"preview"===document.querySelector('p[style="color: red;"]').parentElement.parentElement.id?document.querySelector('p[style="color: red;"]').parentElement.parentElement.remove():document.querySelector('p[style="color: red;"]').remove()),window.forumParsing=!1,""!==e&&FNR.html.genNotification("Atención","Hubo un problema al enviar. Inténtalo de nuevo.","fas fa-exclamation"),FNR.content.isAutosave()&&window.addEventListener("beforeunload",()=>{!1===forumParsing&&(""===document.querySelector("#usereply-editor").value&&!1!==FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)||""!==document.querySelector("#usereply-editor").value)&&FNR.cache.setData("post"+document.post.t.value+"-"+_userdata.user_id,document.querySelector("#usereply-editor").value,-1)},!1)},
|
|
1
|
+
Vue.component("panel-control",{props:["elements"],data:()=>({userId:_userdata.user_id,state:{page:0},content:{original:[],current:[]}}),computed:{validationPanel(){return FNR.utility.genValidation(this.content.current)},toSave(){let e=[];return[].forEach.call(this.content.current,(t,o)=>{t.value!==this.content.original[o].value&&e.push({name:t.name,type:t.type,value:t.value})}),e}},methods:{updateProfile(){this.toSave.length&&""===this.validationPanel&&(this.state.page=2,FNR.user.profile.setData(this.toSave).then(e=>{if(e){let e=!1;this.toSave.map(t=>{t.name.toLowerCase().indexOf("tema")>-1&&(e=!0)}),e?(FNR.html.genNotification("Atención","Información actualizada sin inconvenientes.","fas fa-check"),FNR.user.setTheme(!0)):(FNR.html.genNotification("Atención","Información actualizada sin inconvenientes.","fas fa-check"),setTimeout(()=>{window.location.reload()},2e3))}else FNR.html.genNotification("Atención","Hubo un problema al actualizar. Dale otro intento.","fas fa-exclamation")}))}},created(){FNR.user.profile.getData(JSON.parse(this.elements.replace(/'/g,'"'))).then(e=>{this.content.original=JSON.parse(JSON.stringify(e)),this.content.current=e,this.state.page=1})},template:'\n <section id="forum-cp" class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Editar perfil</h2>\n <hr />\n <p>En esta página podrás editar tu perfil de usuario. En caso de que quieras editar tu contraseña, por favor dirígete a <a target="_blank" title="Ir a «Cambiar contraseña»" :href="\'/profile?change_password=Cambiar+tu+contraseña&mode=editprofile&page_profil=informations&user_id=\' + userId">este enlace</a>.</p>\n <p>Si estás experimentando problemas con el foro, pulsa <a title="Reiniciar cache" onclick="localStorage.clear(); window.location.replace(\'/\')">este otro</a>. Puede que los solucione.</p>\n <p>Ante cualquier duda o problema, contacta con la administración.</p>\n </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <aviso-foro v-show="validationPanel !== \'\'">\n <ul v-html="validationPanel"></ul>\n </aviso-foro>\n <ul class="forum-fieldlist no-style">\n <li v-for="item in content.current">\n <campo-foro :name="item.name">\n <input v-model="item.value" v-if="item.type === \'input\' || item.type === \'avatar\'" type="text"/>\n <textarea v-model="item.value" v-else-if="item.type === \'textarea\'"></textarea>\n <div v-else-if="item.type === \'select\'" class="select-container">\n <select v-model="item.value">\n <option :value="option.value" v-for="option in item.options">{{ option.name }}</option>\n </select>\n </div>\n </campo-foro>\n </li>\n </ul>\n <div id="usereply-comand">\n <button class="button1 btn-main" @click="updateProfile()" title="Actualizar perfil">Actualizar</button>\n </div>\n </template>\n <template v-if="state.page === 2">\n <cargando-foro text="Actualizando información…"></cargando-foro>\n </template>\n </section>\n '}),Vue.component("lista-bosquejos",{data:()=>({state:{page:0},drafts:{}}),created(){FNR.user.drafts.getDrafts().then(e=>{this.state.page=1,this.drafts=e})},template:'\n <section class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Lista de Bosquejos</h2>\n <hr />\n <p>En esta página tienes tu lista de Bosquejos dividida entre mensajes y temas.</p>\n <p>No es una lista completa, tan solo muestra la primera página. Si deseas ver más bosquejos, aligera la lista publicándolos.</p>\n <p>Ante cualquier duda o problema, contacta con la administración.</p>\n </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <section id="forum-drafts" class="forum-topiclist">\n <div class="is-content mb-4">\n <h4>Mensajes</h4>\n </div>\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!drafts.msgDrafts.length ? \' no-results\': \'\')">\n <template v-if="!drafts.msgDrafts.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes bosquejos guardados</h6>\n </li>\n </template>\n <template v-else>\n <li class="row is-not-topic is-not-lastpost" v-for="draft in drafts.msgDrafts">\n <temas-foro type="draft" mode="" :url="draft.topic.url" :replies="draft.info.location" :views="draft.info.date" :quick="draft.modify">\n <template slot="title">{{ draft.topic.name }}</template>\n </temas-foro>\n </li>\n </template>\n </ul>\n <div class="is-content mt-5 mb-4">\n <h4>Temas</h4>\n </div>\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!drafts.topicDrafts.length ? \' no-results\': \'\')">\n <template v-if="!drafts.topicDrafts.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes bosquejos guardados</h6>\n </li>\n </template>\n <template v-else>\n <li class="row is-not-topic is-not-lastpost" v-for="draft in drafts.topicDrafts">\n <temas-foro type="draft" mode="" :url="draft.topic.url" :replies="draft.info.location" :views="draft.info.date" :quick="draft.modify">\n <template slot="title">{{ draft.topic.name }}</template>\n </temas-foro>\n </li>\n </template>\n </ul>\n </section>\n </template>\n </section>\n '}),Vue.component("lista-seguidos",{data:()=>({state:{page:0,selected:[]},followed:{page:0,loading:0,pages:[],content:[]}}),computed:{sortedPages(){return FNR.behaviour.genPagelist(this.followed.pages,this.followed.page)}},methods:{getPage(e){this.followed.loading=0,FNR.user.followed.getFollowed(e).then(e=>{this.followed.content=e,this.followed.loading=1,this.state.page=1})},setPage(e){this.followed.page=e,this.getPage(this.followed.pages[this.followed.page])},setTopic(e){const t=this.state.selected.indexOf(e);-1===t?this.state.selected.push(e):this.state.selected.splice(t,1)},delTopics(){FNR.user.followed.delFollowed(this.state.selected).then(e=>{e?window.location.reload():FNR.html.genNotification("Atención","Hubo un problema al retirar. Inténtalo de nuevo.","fas fa-exclamation")})}},created(){FNR.user.followed.getPages().then(e=>{0!==e.items&&(this.followed.pages=e.pages,this.getPage(this.followed.pages[this.followed.page]))})},template:'\n <section class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Lista de Temas Supervisados</h2>\n <hr />\n <p>En esta página tienes tu lista de Temas Supervisados.</p>\n <p>Ante cualquier duda o problema, contacta con la administración.</p>\n </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <mando-foro id="upper-controls" app="true">\n <template slot="pagination" v-if="followed.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="followed.page > 0" @click="setPage(followed.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedPages">\n <strong v-if="followed.pages.indexOf(page) === followed.page">{{ followed.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (followed.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPage(followed.pages.indexOf(page))">{{ followed.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(followed.page + 1) < followed.pages.length" @click="setPage(followed.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n <template slot="controls">\n <li @click="delTopics()">\n <boton-foro url="javascript:{}" name="Retirar" icon="fas fa-minus"></boton-foro>\n </li>\n </template>\n </mando-foro>\n <section id="forum-followed" class="forum-topiclist">\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!followed.content.length || followed.loading === 0 ? \' no-results\': \'\')">\n <template v-if="!followed.content.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes temas supervisados</h6>\n </li>\n </template>\n <template v-else-if="followed.loading === 0">\n <li class="is-not-topic is-not-lastpost">\n <cargando-foro text="Cargando temas…"></cargando-foro>\n </li>\n </template>\n <template v-else>\n <li :class="\'row is-not-topic is-not-lastpost \' + topic.type" v-for="topic in followed.content" :key="topic.id">\n <temas-foro type="followed" mode="" :url="topic.url" :replies="topic.replies + \' respuestas\'" :views="topic.views + \' visitas\'">\n <template slot="title">{{ topic.name }}</template>\n <template slot="radio">\n <div :class="\'forum-checkbox\' + (state.selected.indexOf(topic.id) === -1 ? \'\' : \' is-active\')">\n <div class="checkbox-content" @click="setTopic(topic.id)">\n <div class="checkbox-click">\n <i class="fas fa-check"></i>\n </div>\n </div>\n </div>\n </template>\n </temas-foro>\n </li>\n </template>\n </ul>\n </section>\n <mando-foro id="lower-controls" app="true">\n <template slot="pagination" v-if="followed.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="followed.page > 0" @click="setPage(followed.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedPages">\n <strong v-if="followed.pages.indexOf(page) === followed.page">{{ followed.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (followed.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPage(followed.pages.indexOf(page))">{{ followed.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(followed.page + 1) < followed.pages.length" @click="setPage(followed.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n <template slot="controls">\n <li @click="delTopics()">\n <boton-foro url="javascript:{}" name="Retirar" icon="fas fa-minus"></boton-foro>\n </li>\n </template>\n </mando-foro>\n </template>\n </section>\n '}),Vue.component("editor-foro",{data:()=>({state:{page:0,editor:"none",admin:1===_userdata.user_level,guest:0===_userdata.session_logged_in,dice:document.querySelectorAll("#list_dice").length,draft:document.querySelectorAll('input[name="draft"]').length},colors:FNR.forum.getColors(),content:{username:"",subject:"",msg:"",type:-1,options:[]},users:{current:"",options:[],selected:[],selector:!0},groups:{type:-1,options:[]},dice:{options:[],current:[]}}),computed:{msgCheck(){let e="";return this.state.guest&&(this.content.username.trim().length<1||this.content.username.trim().length>60)&&(e+="<li>Escribe un nombre de usuario de tamaño adecuado.</li>"),"post"===this.state.editor&&0===this.users.selected.length&&-1===this.groups.type&&(e+="<li>Selecciona al menos un usuario.</li>"),this.state.admin&&"post"===this.state.editor&&0===this.users.selected.length&&-1===this.groups.type&&(e+="<li>Selecciona un grupo.</li>"),"newtopic"!==this.state.editor&&"post"!==this.state.editor&&"edittopicdraft"!==this.state.editor||(this.content.subject.trim().length<4||this.content.subject.trim().length>100)&&(e+="<li>Escribe un titulo de tamaño adecuado (4 a 100 carácteres).</li>"),this.content.msg.trim().length<10&&(e+="<li>Escribe un mensaje lo suficientemente largo.</li>"),e},sortedCharacters(){return Object.keys(this.users.options).length?this.users.options.map(e=>e.user).filter(e=>-1===this.users.selected.indexOf(e)).filter(e=>e.toLowerCase().indexOf(this.users.current.toLowerCase())>-1).sort((e,t)=>e<t?-1:e>t?1:0):[]},sortedEditCharacters(){return this.users.selected.sort((e,t)=>e<t?-1:e>t?1:0)}},methods:{insertSomething(e,t){const o=document.getElementById("usereply-editor"),n=e.replace(/-jump-/g,"\n"),i=t.replace(/-jump-/g,"\n");if(document.selection)o.focus(),document.selection.createRange().text=n+document.selection.createRange().text+i;else if(o.selectionStart||"0"==o.selectionStart){const e=o.selectionStart,t=o.selectionEnd,s=t+n.length;o.value=o.value.substring(0,e)+n+o.value.substring(e,t)+i+o.value.substring(t,o.value.length),o.setSelectionRange(s,s)}this.content.msg=o.value},newDice(){this.dice.current.push({dice:-1,number:0})},addCharacter(e){this.users.selected.push(e),this.users.selector=!1,this.users.current="",setTimeout(()=>{this.users.selector=!0},250)},deleteCharacter(e){this.users.current="",this.users.selected.splice(e,1)},changeGroup(){this.users.selected=[],this.users.current=""},insertUrl(){const e=document.getElementById("usereply-editor"),t=e.selectionStart,o=e.selectionEnd;FNR.html.genPrompt("Insertar enlace","Introduce el título del enlace. Por defecto, ponemos la este como título.","Título del enlace","").then(n=>{!1!==n?this.insertSomething("[url=","]"+n+"[/url]"):this.insertSomething("[url=","]"+e.value.substring(t,o)+"[/url]")})},insertImg(){FNR.html.genPrompt("Insertar imagen","Introduce las medidas de la imagen en píxeles pero sin la medida (por ejemplo 100x100). <u>En caso de dejarlo en blanco, se insertará con la medida inicial</u>.","Medidas de la imagen","").then(e=>{!1!==e?this.insertSomething("[img="+e+"]","[/img]"):this.insertSomething("[img]","[/img]")})},insertSpoiler(){FNR.html.genPrompt("Insertar spoiler","Introduce el título del spoiler. <u>En caso de dejarlo en blanco, se insertará sin él.</u>.","Título del spoiler","").then(e=>{!1!==e?this.insertSomething("[spoiler="+e+"]","[/spoiler]"):this.insertSomething("[spoiler]","[/spoiler]")})},insertQuote(){FNR.html.genPrompt("Insertar cita","Introduce el destinatario de la cita. <u>En caso de dejarlo en blanco, se insertará sin él.</u>.","Destinatario de la cita","").then(e=>{!1!==e?this.insertSomething("[quote="+e+"]","[/quote]"):this.insertSomething("[quote]","[/quote]")})},parseMsg(){window.forumParsing=!0,document.querySelector("#forum-realreply > form .sceditor-container > textarea")?document.querySelector("#forum-realreply > form .sceditor-container > textarea").value=this.content.msg.replace(/#per/g,this.colors[this.colors.length-1].hex):document.querySelector("#forum-realreply > form textarea#text_editor_textarea").value=this.content.msg.replace(/#per/g,this.colors[this.colors.length-1].hex),this.state.guest&&(this.content.subject.trim().length>4||this.content.subject.trim().length<60)&&(document.querySelector('#forum-realreply > form input[name="username"]').value=this.content.username),"post"===this.state.editor&&this.users.selected.length>0&&-1===this.groups.type&&this.users.selected.forEach(e=>{document.querySelector("#forum-realreply > form #add_username").click(),document.querySelectorAll('#forum-realreply > form input[name="username[]"]')[document.querySelectorAll('#forum-realreply > form input[name="username[]"]').length-2].value=e}),this.state.admin&&("post"===this.state.editor?0===this.users.selected.length&&-1!==this.groups.type&&(document.querySelector('#forum-realreply > form select[name="usergroup"]').value=this.groups.type):"newtopic"===this.state.editor&&-1!==this.content.type&&(document.querySelector('#forum-realreply > form input[type="radio"][name="topictype"][value="'+this.content.type+'"]').checked=!0)),"newtopic"!==this.state.editor&&"post"!==this.state.editor&&"edittopicdraft"!==this.state.editor||(this.content.subject.trim().length>4||this.content.subject.trim().length<100)&&(document.querySelector('#forum-realreply > form input[name="subject"]').value=this.content.subject.trim()),"reply"===this.state.editor&&FNR.content.isAutosave()&&!1!==FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)&&-1!==_userdata.user_id&&FNR.cache.delData("post"+document.post.t.value+"-"+_userdata.user_id),!this.state.dice||"reply"!==this.state.editor&&"newtopic"!==this.state.editor&&"editpostdraft"!==this.state.editor&&"edittopicdraft"!==this.state.editor||([].forEach.call(document.querySelectorAll("#forum-realreply > form #list_dice tr"),(e,t)=>{0!==t&&e.remove()}),document.querySelector("#forum-realreply > form #list_dice tr td").insertAdjacentHTML("beforeend",'<span id="dice_to_del"></span>'),this.dice.current.filter(e=>-1!==e.dice).filter(e=>0!==parseFloat(e.number)&&!isNaN(parseFloat(e.number))).forEach(e=>{add_dice(document.querySelectorAll("#list_dice tr").length,e.dice,e.number)}))},draftMsg(){this.msgCheck.length||(this.parseMsg(),document.querySelector('#forum-realreply > form input[value="Bosquejo"], #forum-realreply input[value="Modificar"], #forum-realreply input[value="Registrar"]').click())},delMsg(){const e=new URLSearchParams(window.location.search);let t="topicdraft",o="t";"editpostdraft"===e.get("mode")&&(t="draft",o="p"),FNR.user.drafts.delDrafts(t,[e.get(o)]).then(e=>{e?window.location.replace(`${window.location.protocol}//${window.location.host}${forumConfig.usableDirections.ucp}#/bosquejos`):FNR.html.genNotification("Atención","Hubo un problema al eliminar. Inténtalo de nuevo.","fas fa-exclamation")})},sendMsg(){this.msgCheck.length||(this.parseMsg(),document.querySelector('#forum-realreply > form input[value="Enviar"], #forum-realreply input[value="Publicar"]').click())},prevMsg(){this.msgCheck.length||(this.parseMsg(),document.querySelector('#forum-realreply > form input[value="Previsualización"], #forum-realreply input[value="Previsualizar"]').click())}},created(){const e=()=>{if(document.querySelector('#forum-realreply > form input[name="username"]')&&(this.content.username=document.querySelector('#forum-realreply > form input[name="username"]').value),document.querySelector("#forum-realreply > form #text_editor_textarea")){let e=document.querySelector("#forum-realreply > form #text_editor_textarea").value;this.content.msg=e}if(document.querySelector('#forum-realreply > form input[name="subject"]')){let e=document.querySelector('#forum-realreply input[name="subject"]').value;document.querySelector('#forum-realreply select[name="usergroup"]')&&""!==document.querySelector('#forum-realreply select[name="usergroup"]').value?this.groups.type=document.querySelector('#forum-realreply select[name="usergroup"]').value:document.querySelector('#forum-realreply input[name="username[]"]')&&[].forEach.call(document.querySelectorAll('#forum-realreply input[name="username[]"]'),e=>{""!==e.value&&this.users.selected.push(e.value)}),this.content.subject=e}document.querySelector("#forum-realreply > form #list_dice")&&([].forEach.call(document.querySelectorAll("#forum-realreply > form #list_dice #post_dice option"),e=>{""!==e.value&&this.dice.options.push({value:e.value,content:e.textContent})}),1===document.querySelectorAll("#forum-realreply > form #list_dice tr").length?this.dice.current.push({dice:-1,number:0}):[].forEach.call(document.querySelectorAll("#forum-realreply > form #list_dice tr"),e=>{""!==e.querySelector("select").value&&this.dice.current.push({dice:parseFloat(e.querySelector("select").value),number:parseFloat(e.querySelector("input").value)})})),4===document.querySelectorAll('#forum-realreply > form .panel.row3 input[type="radio"]').length&&[].forEach.call(document.querySelectorAll('#forum-realreply > form .panel.row3 input[type="radio"]'),e=>{this.content.options.push({value:e.value,name:e.parentElement.textContent.trim()}),e.checked&&(this.content.type=e.value)}),document.querySelector('#forum-realreply > form select[name="usergroup"]')&&[].forEach.call(document.querySelectorAll('#forum-realreply > form select[name="usergroup"] option'),e=>{""!==e.value&&this.groups.options.push({value:e.value,name:e.textContent})}),FNR.content.isAutosave()&&""===this.content.msg&&!1!==FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)&&-1!==_userdata.user_id&&(this.content.msg=FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)),this.state.page=1,document.onkeydown=(e=>{const t=document.getElementById("usereply-editor");document.activeElement===t&&(e.ctrlKey&&"b"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b]","[/b]")):e.ctrlKey&&"i"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[i]","[/i]")):e.ctrlKey&&"s"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[strike]","[/strike]")):e.ctrlKey&&"u"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[u]","[/u]")):e.ctrlKey&&","===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[left]","[/left]")):e.ctrlKey&&"."===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[center]","[/center]")):e.ctrlKey&&"-"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[right]","[/right]")):e.ctrlKey&&"o"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertUrl()):e.ctrlKey&&"p"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertImg()):e.ctrlKey&&"`"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSpoiler()):e.ctrlKey&&"+"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[code]","[/code]")):e.ctrlKey&&"l"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertQuote()):e.ctrlKey&&"ñ"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[hide]","[/hide]")):e.ctrlKey&&"´"===e.key?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[youtube]","[/youtube]")):"Home"===e.key?(e.preventDefault(),e.stopPropagation(),t.setSelectionRange(0,0)):"End"===e.key?(e.preventDefault(),e.stopPropagation(),t.setSelectionRange(t.value.length,t.value.length)):e.ctrlKey&&"1"===e.key&&"undefined"!==this.colors[0]&&this.colors.length-1!=0?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[0].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"!"===e.key&&"undefined"!==this.colors[0]&&this.colors.length-1!=0?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[0].hex+"]","[/color][/b]")):e.ctrlKey&&"2"===e.key&&"undefined"!==this.colors[1]&&this.colors.length-1!=1?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[1].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&'"'===e.key&&"undefined"!==this.colors[1]&&this.colors.length-1!=1?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[1].hex+"]","[/color][/b]")):e.ctrlKey&&"3"===e.key&&"undefined"!==this.colors[2]&&this.colors.length-1!=2?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[2].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"·"===e.key&&"undefined"!==this.colors[2]&&this.colors.length-1!=2?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[2].hex+"]","[/color][/b]")):e.ctrlKey&&"4"===e.key&&"undefined"!==this.colors[3]&&this.colors.length-1!=3?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[3].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"$"===e.key&&"undefined"!==this.colors[3]&&this.colors.length-1!=3?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[3].hex+"]","[/color][/b]")):e.ctrlKey&&"5"===e.key&&"undefined"!==this.colors[4]&&this.colors.length-1!=4?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[4].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"%"===e.key&&"undefined"!==this.colors[4]&&this.colors.length-1!=4?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[4].hex+"]","[/color][/b]")):e.ctrlKey&&"6"===e.key&&"undefined"!==this.colors[5]&&this.colors.length-1!=5?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[5].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"&"===e.key&&"undefined"!==this.colors[5]&&this.colors.length-1!=5?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[5].hex+"]","[/color][/b]")):e.ctrlKey&&"7"===e.key&&"undefined"!==this.colors[6]&&this.colors.length-1!=6?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[6].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"/"===e.key&&"undefined"!==this.colors[6]&&this.colors.length-1!=6?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[6].hex+"]","[/color][/b]")):e.ctrlKey&&"8"===e.key&&"undefined"!==this.colors[7]&&this.colors.length-1!=7?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[7].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&"("===e.key&&"undefined"!==this.colors[7]&&this.colors.length-1!=7?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[7].hex+"]","[/color][/b]")):e.ctrlKey&&"9"===e.key&&"undefined"!==this.colors[8]&&this.colors.length-1!=8?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color="+this.colors[8].hex+"]","[/color]")):e.ctrlKey&&e.shiftKey&&")"===e.key&&"undefined"!==this.colors[8]&&this.colors.length-1!=8?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color="+this.colors[8].hex+"]","[/color][/b]")):e.ctrlKey&&"º"===e.key&&void 0!==forumConfig.skinOptions.customColour?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[color=#per]","[/color]")):e.ctrlKey&&e.shiftKey&&"ª"===e.key&&void 0!==forumConfig.skinOptions.customColour?(e.preventDefault(),e.stopPropagation(),this.insertSomething("[b][color=#per]","[/color][/b]")):e.ctrlKey&&e.shiftKey&&"Enter"===e.key&&!this.msgCheck.length?(e.preventDefault(),e.stopPropagation(),this.prevMsg()):e.ctrlKey&&e.altKey&&"Enter"===e.key&&"reply"===this.state.editor&&this.state.dice&&!this.msgCheck.length?(e.preventDefault(),e.stopPropagation(),this.draftMsg()):e.ctrlKey&&"Enter"===e.key&&!this.msgCheck.length&&(e.preventDefault(),e.stopPropagation(),this.sendMsg()))}),setTimeout(()=>{FNR.behaviour.genDropeable()},250)},t=()=>{"post"===this.state.editor?FNR.forum.getMembers(!0).then(t=>{this.users.options=t,e()}):e()};void 0!==document.post&&("editpost"===document.post.mode.value?void 0!==document.post.modif_topic_title?this.state.editor="newtopic":this.state.editor="reply":"edit"===document.post.mode.value?this.state.editor="post":this.state.editor=document.post.mode.value),this.state.guest?setTimeout(()=>{e()},2e3):void 0===forumConfig.skinOptions.customColour?t():FNR.user.profile.getData([{name:forumConfig.skinOptions.customColour,type:"input"}]).then(e=>{this.colors.push({hex:e[0].value,name:"Personal"}),t()}),this.state.replies=document.querySelectorAll(".forum-otherposts > *").length||document.querySelector('input[type="submit"][value="Modificar"]')?"Varios":""},mounted(){insertIntoEditor=(e=>{try{this.insertSomething(" "+e+" ","")}catch(e){console&&console.error(e)}}),$("#quickEmojInternal").on("load",function(){$("#quickEmojInternal").contents().find("head").append("<style>body{padding: 1rem!important}</style>")});let e="";document.querySelector('p[style="color: red;"]')&&(e=document.querySelector('p[style="color: red;"]').textContent,"preview"===document.querySelector('p[style="color: red;"]').parentElement.parentElement.id?document.querySelector('p[style="color: red;"]').parentElement.parentElement.remove():document.querySelector('p[style="color: red;"]').remove()),window.forumParsing=!1,""!==e&&FNR.html.genNotification("Atención","Hubo un problema al enviar. Inténtalo de nuevo.","fas fa-exclamation"),FNR.content.isAutosave()&&window.addEventListener("beforeunload",()=>{!1===forumParsing&&(""===document.querySelector("#usereply-editor").value&&!1!==FNR.cache.getData("post"+document.post.t.value+"-"+_userdata.user_id)||""!==document.querySelector("#usereply-editor").value)&&FNR.cache.setData("post"+document.post.t.value+"-"+_userdata.user_id,document.querySelector("#usereply-editor").value,-1)},!1)},
|
|
2
2
|
template:'\n <div id="forum-usereply">\n <template v-if="state.page === 0">\n <cargando-foro text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <aviso-foro v-show="msgCheck.length">\n <ul v-html="msgCheck"></ul>\n </aviso-foro>\n <ul id="usereply-extra" class="forum-fieldlist no-style" v-if="state.editor !== \'reply\'">\n <template v-if="state.guest">\n <li>\n <campo-foro name="Nombre de usuario">\n <input type="text" v-model="content.username" placeholder="Escribe tu nombre de usuario." />\n </campo-foro>\n </li>\n </template>\n <template v-if="state.editor === \'post\'">\n <li>\n <campo-foro name="Usuarios">\n <div class="character-selector">\n <input type="text" v-model="users.current" placeholder="Escribe el nombre de un usuario." :disabled="groups.type !== -1" />\n <ul class="no-style selector-list" v-if="users.selector && sortedCharacters.length > 0">\n <li v-for="(character, index) in sortedCharacters" @click="addCharacter(character)" :title="\'Seleccionar \' + character">{{ character }}<i class="fas fa-plus"></i></li>\n </ul>\n </div>\n <ul v-if="sortedEditCharacters.length" class="no-style character-list">\n <li v-for="(character, index) in sortedEditCharacters" @click="deleteCharacter(index)" :title="\'Quitar \' + character"><i class="fas fa-times"></i> {{ character }}</li>\n </ul>\n </campo-foro>\n </li>\n </template>\n <template v-if="state.admin">\n <template v-if="state.editor === \'post\'">\n <li>\n <campo-foro name="Grupo">\n <div class="select-container">\n <select v-model="groups.type" @change="changeGroup()" :disabled="users.selected.length !== 0">\n <option value="-1" hidden>Selecciona un grupo.</option>\n <option v-for="option in groups.options" :value="option.value">{{ option.name }}</option>\n </select>\n </div>\n </campo-foro>\n </li>\n </template>\n <template v-else-if="content.type !== -1 && (state.editor === \'newtopic\' || state.editor === \'edittopicdraft\')">\n <li>\n <campo-foro name="Tipo de tema">\n <div class="select-container">\n <select v-model="content.type">\n <option value="-1" hidden>Selecciona una opción.</option>\n <option v-for="option in content.options" :value="option.value">{{ option.name }}</option>\n </select>\n </div>\n </campo-foro>\n </li>\n </template>\n </template>\n <template v-if="state.editor === \'newtopic\' || state.editor === \'post\' || state.editor === \'edittopicdraft\'">\n <li>\n <campo-foro name="Título">\n <input type="text" v-model="content.subject" placeholder="Escribe el título." />\n </campo-foro>\n </li>\n </template>\n </ul>\n <div id="usereply-top" class="usereply-header">\n <h3>Editor de texto<small>Ver guía de <a href="https://www.bbcode.org/reference.php" target="_blank">BBCode</a>.</small></h3>\n <div id="usereply-buttons">\n <ul class="is-hidden-mobile">\n <li id="bold-button">\n <button class="usereply-button" @click="insertSomething(\'[b]\', \'[/b]\')" title="Negrita">\n <i class="fas fa-bold"></i>\n </button>\n </li>\n <li id="italic-button">\n <button class="usereply-button" @click="insertSomething(\'[i]\', \'[/i]\')" title="Cursiva">\n <i class="fas fa-italic"></i>\n </button>\n </li>\n <li id="underline-button">\n <button class="usereply-button" @click="insertSomething(\'[u]\', \'[/u]\')" title="Subrayado">\n <i class="fas fa-underline"></i>\n </button>\n </li>\n <li id="strike-button">\n <button class="usereply-button" @click="insertSomething(\'[strike]\', \'[/strike]\')" title="Tachado">\n <i class="fas fa-strikethrough"></i>\n </button>\n </li>\n </ul>\n <ul>\n <li id="colour-button">\n <div class="dropdown upper-controls is-dropeable is-right">\n <div class="dropdown-trigger">\n <button class="usereply-button" title="Color">\n <i class="fas fa-palette"></i>\n </button>\n </div>\n <div class="dropdown-menu" role="menu">\n <div id="colour-list" class="dropdown-content">\n <div v-for="color in colors" class="usereply-option" :style="\'color:\' + color.hex" @click="insertSomething(\'[color=\' + color.hex + \']\', \'[/color]\')">{{ color.name }}</div>\n </div>\n </div>\n </div>\n </li>\n <li id="emoji-button">\n <div class="dropdown upper-controls is-dropeable is-right">\n <div class="dropdown-trigger">\n <button class="usereply-button" title="Emoticono">\n <i class="fas fa-smile"></i>\n </button>\n </div>\n <div class="dropdown-menu" role="menu">\n <div id="emoji-list" class="dropdown-content">\n <iframe id="quickEmojInternal" marginheight="0" marginwidth="0" name="smilies" scrolling="auto" src="/smilies?mode=smilies_frame"></iframe>\n </div>\n </div>\n </div>\n </li>\n <li id="align-button">\n <div class="dropdown upper-controls is-dropeable is-right">\n <div class="dropdown-trigger">\n <button class="usereply-button" title="Alinear">\n <i class="fas fa-align-justify"></i>\n </button>\n </div>\n <div class="dropdown-menu" role="menu">\n <div id="align-list" class="dropdown-content">\n <div class="usereply-option" @click="insertSomething(\'[left]\', \'[/left]\')">Izquierda</div>\n <div class="usereply-option" @click="insertSomething(\'[center]\', \'[/center]\')">Centro</div>\n <div class="usereply-option" @click="insertSomething(\'[right]\', \'[/right]\')">Derecha</div>\n </div>\n </div>\n </div>\n </li>\n <li id="toolbox-button">\n <div class="dropdown upper-controls is-dropeable is-right">\n <div class="dropdown-trigger">\n <button class="usereply-button" title="Otros">\n <i class="fas fa-toolbox"></i>\n </button>\n </div>\n <div class="dropdown-menu" role="menu">\n <div id="toolbox-list" class="dropdown-content">\n <div class="usereply-option" @click="insertUrl()">Enlace</div>\n <div class="usereply-option" @click="insertImg()">Imagen</div>\n <div class="usereply-option" @click="insertSpoiler()">Spoiler</div>\n <div class="usereply-option" @click="insertSomething(\'[code]\', \'[/code]\')">Code</div>\n <div class="usereply-option" @click="insertQuote()">Cita</div>\n <div class="usereply-option" @click="insertSomething(\'[hide]\', \'[/hide]\')">Ocultar</div>\n <div class="usereply-option" @click="insertSomething(\'[youtube]\', \'[/youtube]\')">Youtube</div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n </div>\n </div>\n <textarea id="usereply-editor" contenteditable="true" v-model="content.msg"></textarea>\n <div id="usereply-comand">\n <button class="button1 btn-main" @click="sendMsg()">Enviar</button>\n <button class="button1" @click="draftMsg()" v-if="state.editor === \'editpostdraft\' || state.editor === \'edittopicdraft\'">Modificar</button>\n <button class="button1" @click="draftMsg()" v-else-if="state.draft && (state.editor === \'reply\' || state.editor === \'newtopic\')">Bosquejo</button>\n <button class="button1" @click="prevMsg()">Previsualizar</button>\n <button class="button1" @click="delMsg()" v-if="state.editor === \'editpostdraft\' || state.editor === \'edittopicdraft\'">Eliminar</button>\n </div>\n <div v-if="state.dice && (state.editor === \'reply\' || state.editor === \'newtopic\' || state.editor === \'editpostdraft\' || state.editor === \'edittopicdraft\')" id="usereply-dice">\n <div class="usereply-header">\n <h3>Tirar dados</h3>\n </div>\n <ul>\n <li v-for="(item, index) in dice.current">\n <div class="select-container">\n <select v-model="item.dice" @change="item.number = 1">\n <option value="-1" selected hidden>Selec. un dado</option>\n <option v-for="option in dice.options" :value="option.value">{{ option.content }}</option>\n </select>\n </div>\n <input type="number" v-model="item.number" />\n <button @click="newDice()" v-if="(index + 1) === dice.current.length" class="dice-more">\n <i class="fas fa-plus"></i>\n </button>\n <div v-else class="dice-more"></div>\n </li>\n </ul>\n </div>\n </template>\n </div>\n '});
|
|
@@ -182,75 +182,100 @@ const FNR = {
|
|
|
182
182
|
if (document.post === undefined) return false;
|
|
183
183
|
else return _userdata.user_id !== -1 && document.post.mode.value === 'reply' && document.post.t !== undefined
|
|
184
184
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
185
|
+
post: {
|
|
186
|
+
getPost: (url) => {
|
|
187
|
+
return new Promise((resolve, reject) => {
|
|
188
|
+
$.get(Vue.filter('url-to-invision')(url), (data) => {
|
|
189
|
+
const post = $(data).find("#p" + url.split("#")[1]);
|
|
190
|
+
|
|
191
|
+
resolve({
|
|
192
|
+
author: {
|
|
193
|
+
text: post.find(".author a").text(),
|
|
194
|
+
color: post.find(".author a span").css("color"),
|
|
195
|
+
url: Vue.filter('url-to-normal')(post.find(".author a").attr("href")),
|
|
196
|
+
},
|
|
197
|
+
content: post.find(".post-entry > div").html(),
|
|
198
|
+
date: post.find(".author").html().split("</a>")[1],
|
|
199
|
+
});
|
|
198
200
|
});
|
|
199
201
|
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
let save = document.createElement('iframe');
|
|
205
|
-
|
|
206
|
-
save.id = 'forum-save';
|
|
207
|
-
save.src = '/post?t=' + id + '&mode=reply&change_version=invision';
|
|
208
|
-
save.width = 0;
|
|
209
|
-
save.height = 0;
|
|
210
|
-
save.onload = () => {
|
|
211
|
-
saveDOM.onload = () => {
|
|
212
|
-
$('#forum-save').remove();
|
|
202
|
+
},
|
|
203
|
+
genPost: (id, content) => {
|
|
204
|
+
return new Promise((resolve, reject) => {
|
|
205
|
+
let save = document.createElement('iframe');
|
|
213
206
|
|
|
214
|
-
|
|
207
|
+
save.id = 'forum-save';
|
|
208
|
+
save.src = '/post?t=' + id + '&mode=reply&change_version=invision';
|
|
209
|
+
save.width = 0;
|
|
210
|
+
save.height = 0;
|
|
211
|
+
save.onload = () => {
|
|
212
|
+
saveDOM.onload = () => {
|
|
213
|
+
$('#forum-save').remove();
|
|
215
214
|
|
|
216
|
-
|
|
215
|
+
console.clear();
|
|
216
|
+
|
|
217
|
+
resolve(true);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
$('#forum-save').contents().find('.subtitle:contains("Mensaje")').next().find('textarea').val(content);
|
|
221
|
+
$('#forum-save').contents().find('.formbuttonrow.center input[value="Enviar"]').click();
|
|
217
222
|
};
|
|
218
223
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
document.querySelector('body > header').prepend(save);
|
|
225
|
+
|
|
226
|
+
const saveDOM = document.getElementById('forum-save');
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
topic: {
|
|
231
|
+
getType: (src) => {
|
|
232
|
+
const classes = [];
|
|
233
|
+
|
|
234
|
+
if (src.indexOf('unread') > -1) {
|
|
235
|
+
classes.push('is-unread');
|
|
236
|
+
} else {
|
|
237
|
+
classes.push('is-read');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (src.indexOf('locked') > -1) {
|
|
241
|
+
classes.push('is-closed');
|
|
242
|
+
} else if (src.indexOf('sticky') > 1) {
|
|
243
|
+
classes.push('is-sticky');
|
|
244
|
+
} else if (src.indexOf('global_announce') > 1) {
|
|
245
|
+
classes.push('is-global-announcement');
|
|
246
|
+
} else if (src.indexOf('announce') > 1) {
|
|
247
|
+
classes.push('is-announcement');
|
|
248
|
+
}
|
|
222
249
|
|
|
223
|
-
|
|
250
|
+
return classes;
|
|
251
|
+
},
|
|
252
|
+
genTopic: (id, name, content) => {
|
|
253
|
+
return new Promise((resolve, reject) => {
|
|
254
|
+
let save = document.createElement('iframe');
|
|
224
255
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
save.id = 'forum-save';
|
|
233
|
-
save.src = '/post?f=' + id + '&mode=newtopic&change_version=invision';
|
|
234
|
-
save.width = 0;
|
|
235
|
-
save.height = 0;
|
|
236
|
-
save.onload = () => {
|
|
237
|
-
saveDOM.onload = () => {
|
|
238
|
-
$('#forum-save').remove();
|
|
256
|
+
save.id = 'forum-save';
|
|
257
|
+
save.src = '/post?f=' + id + '&mode=newtopic&change_version=invision';
|
|
258
|
+
save.width = 0;
|
|
259
|
+
save.height = 0;
|
|
260
|
+
save.onload = () => {
|
|
261
|
+
saveDOM.onload = () => {
|
|
262
|
+
$('#forum-save').remove();
|
|
239
263
|
|
|
240
|
-
|
|
264
|
+
console.clear();
|
|
241
265
|
|
|
242
|
-
|
|
243
|
-
|
|
266
|
+
resolve(true);
|
|
267
|
+
};
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
269
|
+
$('#forum-save').contents().find('dl dt:contains("Título del tema")').parent().find('input').val(name);
|
|
270
|
+
$('#forum-save').contents().find('.subtitle:contains("Mensaje")').next().find('textarea').val(content);
|
|
271
|
+
$('#forum-save').contents().find('.formbuttonrow.center input[value="Enviar"]').click();
|
|
272
|
+
};
|
|
249
273
|
|
|
250
|
-
|
|
274
|
+
document.querySelector('body > header').prepend(save);
|
|
251
275
|
|
|
252
|
-
|
|
253
|
-
|
|
276
|
+
const saveDOM = document.getElementById('forum-save');
|
|
277
|
+
});
|
|
278
|
+
},
|
|
254
279
|
}
|
|
255
280
|
},
|
|
256
281
|
user: {
|
|
@@ -443,6 +468,7 @@ const FNR = {
|
|
|
443
468
|
url: Vue.filter('url-to-normal')(cells[1].querySelector('.topictitle').href),
|
|
444
469
|
views: parseInt(cells[5].textContent),
|
|
445
470
|
replies: parseInt(cells[3].textContent),
|
|
471
|
+
type: FNR.content.topic.getType(cells[0].querySelector('img').src).join(' '),
|
|
446
472
|
}
|
|
447
473
|
});
|
|
448
474
|
} catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:async(e,t)=>{const n=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();i.push({name:t.text().trim(),url:Vue.filter("url-to-normal")(t.attr("href")),lastpost:{url:Vue.filter("url-to-normal")(n.children().last().attr("href")),date:n.text().split("por")[0].trim(),who:{name:n.find("strong a").length?n.find("strong a").text().trim():"Invitado",url:Vue.filter("url-to-normal")(n.find("strong a").length?n.find("strong a").attr("href"):"/"),color:n.find("strong a").length?n.find("strong a span").attr("style").split("color:")[1]:"initial"}},forum:{name:$(e).find(".row2 + .row2:not(.centered) a").text().trim(),url:Vue.filter("url-to-normal")($(e).find(".row2 + .row2:not(.centered) a").attr("href"))}})},a=async r=>{$.get(r,r=>($(r).find(".ipbform").find("tbody").find("tr").each(function(){i.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&n(this)}),i.length!==t&&$(r).find(".pagination")[0].children.length&&"b"!==$(r).find(".pagination").children().last()[0].localName?a($(r).find(".pagination").children().last().attr("href")):i))};await a("/latest?change_version=invision");let i=[];return i},getMembers:e=>new Promise((t,n)=>{let a=[];const i=(e,t)=>({user:$(e).find(".membername span").text().trim(),id:$(e).find(".popupmenu .popupmenu-item a").attr("href").split("?")[0],img:$(e).find(".mini-avatar img").attr("src"),color:t}),r=t=>{let n=[];return $(t).find(".member-list .member").each(function(){const t=FNR.utility.getGroup($(this).find(".membername span").attr("style").split("color:")[1]);e?n.push(i(this,t)):"unknown"!==t&&t!==forumConfig.skinOptions.adminGroup&&n.push(i(this,t))}),n},o=e=>{$.get(e,e=>{const n=$(e).find('.pagination img[alt="Siguiente"]').parent().attr("href")||!1;a=a.concat(r(e)),n?o(n):t(a.sort((e,t)=>e.user<t.user?-1:e.user>t.user?1:0))})};o("/memberlist?change_version=invision")}),getGroups:e=>{const t=()=>new Promise((e,t)=>{$.get("/groups?change_version=invision",t=>{let n=[];$(t).find(".group_list > li").each(function(){n.push({id:parseInt($(this).find("a").attr("href").split("/g")[1].split("-")[0]),name:$(this).find("a").text().trim(),color:$(this).find("a").css("color"),url:Vue.filter("url-to-normal")($(this).find("a").attr("href")),count:parseInt($(this).find("div > span").text())-1})}),e(n)})}),n=()=>new Promise((n,a)=>{FNR.cache.useData("groups",e).then(e=>{n(e)},e=>{t().then(e=>{FNR.cache.setData("groups",e),n(e)})})});return n()},getAffiliates:()=>new Promise((e,t)=>{const n=forumConfig.affiliatesMax,a=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 a=0;a<n[e[0]]-e[1].length;a++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'"/></a></li>';return t});e({normal:a[0],elite:a[1],directory:a[2],sister:a[3]})})},content:{isAutosave:()=>void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t),getPost:e=>new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const a=$(n).find("#p"+e.split("#")[1]);t({author:{text:a.find(".author a").text(),color:a.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(a.find(".author a").attr("href"))},content:a.find(".post-entry > div").html(),date:a.find(".author").html().split("</a>")[1]})})}),genPost:(e,t)=>new Promise((n,a)=>{let i=document.createElement("iframe");i.id="forum-save",i.src="/post?t="+e+"&mode=reply&change_version=invision",i.width=0,i.height=0,i.onload=(()=>{r.onload=(()=>{$("#forum-save").remove(),console.clear(),n(!0)}),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(t),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body > header").prepend(i);const r=document.getElementById("forum-save")}),genTopic:(e,t,n)=>new Promise((a,i)=>{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(),a(!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:{getUrl:e=>{let t=void 0!==e?encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"):_userdata.user_id;return"/profile?mode=viewprofile&u="+t},getLevel:async()=>{switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}},getGroup:async()=>{const e=await FNR.user.getLevel();if("guest"===e)return"unknown";const{colour:t}=await FNR.user.getProfile(_userdata.user_id,.25);return t},getProfile:(e,t)=>{const n=null!=e?FNR.user.getUrl(e):FNR.user.getUrl(),a=t||5,i=e=>e.find("a").length?Vue.filter("url-to-normal")(e.find("a").attr("href")):e.find("table").length?e.find("table").html():e.find("img").length?e.find("img").attr("src"):e.find("textarea").length?e.find("textarea").val():e.find("span").length?e.find("span").text().trim():"-"===e.text().trim()?"":e.text(),r=()=>new Promise((e,t)=>{$.get(n+"&change_version=invision",t=>{let a={};a.name=$(t).find(".maintitle h1 span").text(),a.lastvisit=$(t).find('dt:contains("Última visita")').parent().find("dd").text(),a.colour=FNR.utility.getGroup($(t).find(".maintitle h1 span").css("color").replace("rgb(","rgb_").replace(/, /g,"_").replace(")","")),a.avatar=$(t).find(".real_avatar img").attr("src"),a.links={profile:"/u"+n.split("&u=")[1],mp:"/privmsg?mode=post&u="+n.split("&u=")[1]},a.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},a.fields={},$(t).find('dl[id^="field_id"]').each(function(){if(""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;a.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:i($(this).find("dd .field_uneditable"))}}}),$(t).find(".ipbform2 > dl").each(function(){if($(this).find("dt span").length&&""!==$(this).find("dt span").text()){if("Mensajes"===$(this).find("dt span").text())return;a.fields[FNR.utility.genSlug($(this).find("dt span").text())]={name:$(this).find("dt span").text(),content:i($(this).find("dd"))}}}),a.fields.rango={name:"Rango",content:$(t).find('dt:contains("Rango:")').parent().find("dd").text()},e(a)})}),o=e=>{const t=`userInfo${e}`;return new Promise((e,n)=>{FNR.cache.useData(t,a).then(t=>{e(t)},n=>{r().then(n=>{FNR.cache.setData(t,n),e(n)})})})};return o(e)},changeAccount:async(e,t,n)=>{try{return await fetch(e),await fetch("/login",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`username=${encodeURIComponent(t)}&password=${encodeURIComponent(n)}&autologin=1&login=1`}),!0}catch(e){return console.error("Error inesperado",e),!1}},followed:{getPages:async()=>{try{const e=await fetch("/search?search_id=watchsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const a=n.querySelectorAll(".pagination a");let i=[];if(a.length){const e=a[a.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],r=parseInt(n.join(""))||0,o=a[1],l=o.href.split(o.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===r?0:r/c;i=Array(d).fill(null).map((e,t)=>`/search?search_id=watchsearch&start=${c*(t+1)}&change_version=invision`)}return{items:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=watchsearch&change_version=invision",...i]}}catch(e){return console.error("Error inesperado",e),!1}},getFollowed:async e=>{try{const t=await fetch(e),n=await t.text(),a=document.createElement("html");return a.innerHTML=n,Array.from(a.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{id:parseInt(t[7].children[0].value),name:t[1].querySelector(".topictitle").textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector(".topictitle").href),views:parseInt(t[5].textContent),replies:parseInt(t[3].textContent)}})}catch(e){return console.error("Error inesperado",e),!1}},delFollowed:async e=>{try{return await fetch("/search?search_id=watchsearch",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${e.map(e=>`&mark${encodeURIComponent("[]")}2=${e}`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},drafts:{getDrafts:async()=>{const e=(e,t)=>(final=[],e.querySelectorAll(".maintitle > h3").length&&0!==parseInt(e.querySelectorAll(".maintitle > h3")[0].textContent)&&[].forEach.call(e.querySelectorAll(".ipbform .ipbtable tbody > tr"),e=>{const n=e.querySelectorAll("td");final.push({topic:{name:n[t+1].textContent.trim(),url:Vue.filter("url-to-normal")(n[t+1].querySelector("a").href)},info:{location:n[t+2].textContent.trim(),date:n[t+3].textContent.trim()},modify:Vue.filter("url-to-normal")(n[t+4].querySelector("a").href)})}),final);try{const t=await fetch("/search?search_id=draftsearch&change_version=invision"),n=await fetch("/search?search_id=topicdraftsearch&change_version=invision"),a=await t.text(),i=await n.text(),r=document.createElement("html"),o=document.createElement("html");return r.innerHTML=a,o.innerHTML=i,{msgDrafts:e(r,0),topicDrafts:e(o,-1)}}catch(e){return!1}},delDrafts:async(e,t)=>{try{const n="draft"===e?"draft":"topic_draft";return await fetch(`/search?search_id=${e}search`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${t.map(e=>`&delete_${n}${encodeURIComponent(`[${e}]`)}=on`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},profile:{getData:e=>new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const a=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const i=n;let r=[];[].forEach.call(e,e=>{let t="",n=[];switch(e.type){case"input":t=$(a).find('dl:contains("'+e.name+'")').find("dd").find("input").val();break;case"textarea":t=$(a).find('dl:contains("'+e.name+'")').find("dd").find("textarea").val();break;case"select":t=$(a).find('dl:contains("'+e.name+'")').find("dd").find("select option:selected").attr("value"),$(a).find('dl:contains("'+e.name+'")').find("dd").find("select option").each(function(){""!==$(this).attr("value")&&n.push({name:$(this).text(),value:$(this).attr("value")})});break;case"avatar":t=$(i).find(".box-content img").attr("src")}if("select"===e.type&&void 0===t||"select"===e.type&&""===t)return;let o={type:e.type,name:e.name,value:t};e.validation&&(o.validation=e.validation),n.length&&(o.options=n),r.push(o)}),t(r)})})}),setData:e=>new Promise((t,n)=>{const a=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let i=document.createElement("iframe");i.id="forum-save",i.src="/profile?change_version=invision&mode=editprofile",i.width=0,i.height=0,i.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),r.onload=(()=>{t?(r.onload=(()=>{r.onload=(()=>{a()}),$("#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"):a()}),$("#forum-save").contents().find('input[type="submit"][value="Registrar"]').click()}),document.querySelector("body > header").prepend(i);const r=document.getElementById("forum-save")})}},cache:{getData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content,setData:(e,t,n)=>{let a=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:a,content:t}))},delData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e),useData:async(e,t)=>{const n=localStorage.getItem(forumData.prefix+"_"+e),a=new Date,i=-1==t?"undefined":864e5*t;return null!=n&&-1==t||null!=n&&parseInt(JSON.parse(n).cached_at)+i>a.getTime()?JSON.parse(n).content:Promise.reject(!1)}},utility:{genSlug:(e,t)=>{const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,a=t.length;n<a;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,"-")},a=t||"_";return n(e).replace(/-/g,a)},genArray:e=>JSON.parse(e.replace(/`/g,'"')),genValidation:e=>{let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getGroup:e=>{const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)}},html:{genModal:(e,t,n)=>{if(""===e||null==e)return;if(""===t||null==t)return;let a=document.createElement("div");a.id="forum-modal",document.body.appendChild(a);let i="";i+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',i+='<div class="modal-title">',i+="<h3>"+e+"</h3>",i+='<a onclick="document.getElementById(`forum-modal`).remove()">',i+='<i class="fas fa-times"></i>',i+="</a>",i+="</div>",i+='<div class="modal-content">',i+='<div class="is-content">',i+=t.replace(/\n/g,"<br>"),i+="</div>",""!==n&&null!=n&&(i+='<div class="modal-buttons">',i+=n,i+="</div>"),i+="</div>",i+="</div>",i+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=i},genPrompt:(e,t,n,a)=>{if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((i,r)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+a+'"></p>','<button id="modal-button-enter" class="button1 btn-main">Confirmar</button><button id="modal-button-cancel" class="button1">Cancelar</button>'),document.querySelector("#modal-button-enter").onclick=(()=>{const e=document.querySelector("#modal-prompt").value;i(""!==e&&e),document.getElementById("forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{r(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{r(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{r(!1),document.getElementById("forum-modal").remove()})})},genNotification:(e,t,n,a)=>{if(""===e||null==e)return;if(""===t||null==t)return;if(t.length>50)return;if(""===n||null==n)return;document.querySelectorAll("forum-notification").length&&(document.getElementById("forum-notification").remove(),clearTimeout());let i=document.createElement("div");i.id="forum-notification",document.body.appendChild(i);let r="";r+=""===a||null==a?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+a+'" target="_blank" id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >',r+='<div class="notification-icon">',r+='<i class="'+n+'"></i>',r+="</div>",r+='<div class="notification-content">',r+="<h3>"+e+"</h3>",r+="<p>"+t+"</p>",r+="</div>",r+='<div class="notification-controls">',r+='<i class="fas fa-times"></i>',r+="</div>",r+=""===a||null==a?"</div>":"</a>",document.getElementById("forum-notification").innerHTML=r,setTimeout(()=>{document.getElementById("forum-notification").classList.add("notification-show")},250),setTimeout(()=>{document.getElementById("forum-notification").classList.remove("notification-show")},8e3),setTimeout(()=>{document.getElementById("forum-notification").remove()},1e4)}},behaviour:{genWiki:()=>{document.querySelector(".wiki-cascade")&&[].forEach.call(document.getElementsByClassName("wiki-cascade"),e=>{e.onclick=(()=>{const t=e.parentElement.parentElement;t.classList.contains("is-active")?t.classList.remove("is-active"):t.classList.add("is-active")})}),document.querySelector(".wiki-controls .router-link-active")&&[].forEach.call(document.querySelectorAll(".wiki-controls .router-link-active"),e=>{if(!e.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains("wiki-index")){const t=(e,n)=>{let a=e.parentElement.parentElement;n&&(a=a.parentElement.parentElement),a.classList.add("is-active"),a.classList.add("is-selected"),a.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(a,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:()=>{document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})},genPagelist:(e,t)=>{if(e.length<5)return e;switch(t){case 0:return[e[t],e[t+1],e[t+2],e[t+3],e[t+4]];case 1:return[e[t-1],e[t],e[t+1],e[t+2],e[t+3]];case t.length-1:return[e[t-4],e[t-3],e[t-2],e[t-1],e[t]];case t.length-2:return[e[t-3],e[t-2],e[t-1],e[t],e[t+1]];default:return[e[t-2],e[t-1],e[t],e[t+1],e[t+2]]}}}};
|
|
1
|
+
const FNR={execFn:e=>{document.addEventListener("forumReady",e,!1)},forum:{getColors:()=>Object.values(forumColours).map(e=>({name:e.code,hex:e.hex})),getTopics:async(e,t)=>{const n=e=>{const t=$(e).find(".topictitle"),n=$(e).children().last();a.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"))}})},i=async r=>{$.get(r,r=>($(r).find(".ipbform").find("tbody").find("tr").each(function(){a.length<t&&-1===e.indexOf(parseInt($(this).find(".row2 + .row2:not(.centered) a").attr("href").split("/f")[1].split("-")[0]))&&n(this)}),a.length!==t&&$(r).find(".pagination")[0].children.length&&"b"!==$(r).find(".pagination").children().last()[0].localName?i($(r).find(".pagination").children().last().attr("href")):a))};await i("/latest?change_version=invision");let a=[];return a},getMembers:e=>new Promise((t,n)=>{let i=[];const a=(e,t)=>({user:$(e).find(".membername span").text().trim(),id:$(e).find(".popupmenu .popupmenu-item a").attr("href").split("?")[0],img:$(e).find(".mini-avatar img").attr("src"),color:t}),r=t=>{let n=[];return $(t).find(".member-list .member").each(function(){const t=FNR.utility.getGroup($(this).find(".membername span").attr("style").split("color:")[1]);e?n.push(a(this,t)):"unknown"!==t&&t!==forumConfig.skinOptions.adminGroup&&n.push(a(this,t))}),n},o=e=>{$.get(e,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=invision")}),getGroups:e=>{const t=()=>new Promise((e,t)=>{$.get("/groups?change_version=invision",t=>{let n=[];$(t).find(".group_list > li").each(function(){n.push({id:parseInt($(this).find("a").attr("href").split("/g")[1].split("-")[0]),name:$(this).find("a").text().trim(),color:$(this).find("a").css("color"),url:Vue.filter("url-to-normal")($(this).find("a").attr("href")),count:parseInt($(this).find("div > span").text())-1})}),e(n)})}),n=()=>new Promise((n,i)=>{FNR.cache.useData("groups",e).then(e=>{n(e)},e=>{t().then(e=>{FNR.cache.setData("groups",e),n(e)})})});return n()},getAffiliates:()=>new Promise((e,t)=>{const n=forumConfig.affiliatesMax,i=Object.entries(forumAffiliates).map(e=>{let t="";e[1].forEach(e=>{t+='<li><a href="'+e.url+'" title="'+e.title+'" target="_blank"><img src="'+e.img+'" alt="'+e.title+'"/></a></li>'});for(let i=0;i<n[e[0]]-e[1].length;i++)t+='<li><a href="/" title="'+forumData.name+'"><img src="'+forumDefaults.affiliates[e[0]]+'" alt="'+forumData.name+'"/></a></li>';return t});e({normal:i[0],elite:i[1],directory:i[2],sister:i[3]})})},content:{isAutosave:()=>void 0!==document.post&&(-1!==_userdata.user_id&&"reply"===document.post.mode.value&&void 0!==document.post.t),post:{getPost:e=>new Promise((t,n)=>{$.get(Vue.filter("url-to-invision")(e),n=>{const i=$(n).find("#p"+e.split("#")[1]);t({author:{text:i.find(".author a").text(),color:i.find(".author a span").css("color"),url:Vue.filter("url-to-normal")(i.find(".author a").attr("href"))},content:i.find(".post-entry > div").html(),date:i.find(".author").html().split("</a>")[1]})})}),genPost:(e,t)=>new Promise((n,i)=>{let a=document.createElement("iframe");a.id="forum-save",a.src="/post?t="+e+"&mode=reply&change_version=invision",a.width=0,a.height=0,a.onload=(()=>{r.onload=(()=>{$("#forum-save").remove(),console.clear(),n(!0)}),$("#forum-save").contents().find('.subtitle:contains("Mensaje")').next().find("textarea").val(t),$("#forum-save").contents().find('.formbuttonrow.center input[value="Enviar"]').click()}),document.querySelector("body > header").prepend(a);const r=document.getElementById("forum-save")})},topic:{getType:e=>{const t=[];return e.indexOf("unread")>-1?t.push("is-unread"):t.push("is-read"),e.indexOf("locked")>-1?t.push("is-closed"):e.indexOf("sticky")>1?t.push("is-sticky"):e.indexOf("global_announce")>1?t.push("is-global-announcement"):e.indexOf("announce")>1&&t.push("is-announcement"),t},genTopic:(e,t,n)=>new Promise((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:{getUrl:e=>{let t=void 0!==e?encodeURIComponent(e).replace(/[!'()]/g,escape).replace(/\*/g,"%2A"):_userdata.user_id;return"/profile?mode=viewprofile&u="+t},getLevel:async()=>{switch(_userdata.user_level){case 2:return"mod";case 1:return"admin";case 0:return-1==_userdata.user_id?"guest":"user"}},getGroup:async()=>{const e=await FNR.user.getLevel();if("guest"===e)return"unknown";const{colour:t}=await FNR.user.getProfile(_userdata.user_id,.25);return t},getProfile:(e,t)=>{const n=null!=e?FNR.user.getUrl(e):FNR.user.getUrl(),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)},changeAccount:async(e,t,n)=>{try{return await fetch(e),await fetch("/login",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`username=${encodeURIComponent(t)}&password=${encodeURIComponent(n)}&autologin=1&login=1`}),!0}catch(e){return console.error("Error inesperado",e),!1}},followed:{getPages:async()=>{try{const e=await fetch("/search?search_id=watchsearch&change_version=invision"),t=await e.text(),n=document.createElement("html");n.innerHTML=t;const i=n.querySelectorAll(".pagination a");let a=[];if(i.length){const e=i[i.length-2],t=e.href.split(e.origin)[1],n=t.match(/[0-9]/g)||[],r=parseInt(n.join(""))||0,o=i[1],l=o.href.split(o.origin)[1],s=l.match(/[0-9]/g)||[],c=parseInt(s.join(""))||0,d=void 0===r?0:r/c;a=Array(d).fill(null).map((e,t)=>`/search?search_id=watchsearch&start=${c*(t+1)}&change_version=invision`)}return{items:n.querySelectorAll(".ipbtable tbody tr").length,pages:["/search?search_id=watchsearch&change_version=invision",...a]}}catch(e){return console.error("Error inesperado",e),!1}},getFollowed:async e=>{try{const t=await fetch(e),n=await t.text(),i=document.createElement("html");return i.innerHTML=n,Array.from(i.querySelectorAll(".ipbtable tbody tr")).map(e=>{const t=e.children;return{id:parseInt(t[7].children[0].value),name:t[1].querySelector(".topictitle").textContent.trim(),url:Vue.filter("url-to-normal")(t[1].querySelector(".topictitle").href),views:parseInt(t[5].textContent),replies:parseInt(t[3].textContent),type:FNR.content.topic.getType(t[0].querySelector("img").src).join(" ")}})}catch(e){return console.error("Error inesperado",e),!1}},delFollowed:async e=>{try{return await fetch("/search?search_id=watchsearch",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${e.map(e=>`&mark${encodeURIComponent("[]")}2=${e}`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},drafts:{getDrafts:async()=>{const e=(e,t)=>(final=[],e.querySelectorAll(".maintitle > h3").length&&0!==parseInt(e.querySelectorAll(".maintitle > h3")[0].textContent)&&[].forEach.call(e.querySelectorAll(".ipbform .ipbtable tbody > tr"),e=>{const n=e.querySelectorAll("td");final.push({topic:{name:n[t+1].textContent.trim(),url:Vue.filter("url-to-normal")(n[t+1].querySelector("a").href)},info:{location:n[t+2].textContent.trim(),date:n[t+3].textContent.trim()},modify:Vue.filter("url-to-normal")(n[t+4].querySelector("a").href)})}),final);try{const t=await fetch("/search?search_id=draftsearch&change_version=invision"),n=await fetch("/search?search_id=topicdraftsearch&change_version=invision"),i=await t.text(),a=await n.text(),r=document.createElement("html"),o=document.createElement("html");return r.innerHTML=i,o.innerHTML=a,{msgDrafts:e(r,0),topicDrafts:e(o,-1)}}catch(e){return!1}},delDrafts:async(e,t)=>{try{const n="draft"===e?"draft":"topic_draft";return await fetch(`/search?search_id=${e}search`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`confirm=confirm${t.map(e=>`&delete_${n}${encodeURIComponent(`[${e}]`)}=on`)}`}),!0}catch(e){return console.error("Error inesperado",e),!1}}},profile:{getData:e=>new Promise((t,n)=>{$.get("/profile?change_version=invision&mode=editprofile",n=>{const i=n;$.get("/profile?change_version=invision&mode=editprofile&page_profil=avatars",n=>{const a=n;let 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:e=>new Promise((t,n)=>{const i=()=>{$("#forum-save").remove(),console.clear(),t(!0)};let a=document.createElement("iframe");a.id="forum-save",a.src="/profile?change_version=invision&mode=editprofile",a.width=0,a.height=0,a.onload=(()=>{let t=!1;[].forEach.call(e,e=>{switch(e.type){case"input":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("input").first().val(e.value);break;case"textarea":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find("textarea").val(e.value);break;case"select":$("#forum-save").contents().find('dl:contains("'+e.name+'")').find("dd").find('select option[value="'+e.value+'"]').attr("selected","selected");break;case"avatar":t=e.value}}),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")})}},cache:{getData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&JSON.parse(localStorage.getItem(forumData.prefix+"_"+e)).content,setData:(e,t,n)=>{let i=-1===n?"undefined":(new Date).getTime();localStorage.setItem(forumData.prefix+"_"+e,JSON.stringify({cached_at:i,content:t}))},delData:e=>null!==localStorage.getItem(forumData.prefix+"_"+e)&&localStorage.removeItem(forumData.prefix+"_"+e),useData:async(e,t)=>{const n=localStorage.getItem(forumData.prefix+"_"+e),i=new Date,a=-1==t?"undefined":864e5*t;return null!=n&&-1==t||null!=n&&parseInt(JSON.parse(n).cached_at)+a>i.getTime()?JSON.parse(n).content:Promise.reject(!1)}},utility:{genSlug:(e,t)=>{const n=e=>{const t="àáäâèéëêìíïîòóöôùúüûñç·/_,:;";e=e.trim().toLowerCase();for(var n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuunc------".charAt(n));return e.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},i=t||"_";return n(e).replace(/-/g,i)},genArray:e=>JSON.parse(e.replace(/`/g,'"')),genValidation:e=>{let t="";return[].forEach.call(e,e=>{switch(e.validation){case"hex":e.value.match(/^#[a-f0-9]{6}$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe incluir un código de color hexadecimal.</li>");break;case"img":e.value.match(/(jpg|jpeg|png)$/i)||(t+="<li>El campo de "+e.name.toLowerCase()+" debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>")}}),t},getGroup:e=>{const t=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.hex===e.toLowerCase()&&(t=FNR.utility.genSlug(n.code))}),t},n=e=>{let t="unknown";return Object.values(forumColours).map(n=>{n.id===e&&(t=FNR.utility.genSlug(n.code))}),t};return void 0===e?"unknown":e.indexOf("#")>-1?t(e):e.indexOf("id_")>-1?n(parseFloat(e.split("_")[1])):void 0===forumColours[e]?"unknown":FNR.utility.genSlug(forumColours[e].code)}},html:{genModal:(e,t,n)=>{if(""===e||null==e)return;if(""===t||null==t)return;let i=document.createElement("div");i.id="forum-modal",document.body.appendChild(i);let a="";a+='<div id="'+FNR.utility.genSlug(e,"-")+'" class="modal-element">',a+='<div class="modal-title">',a+="<h3>"+e+"</h3>",a+='<a onclick="document.getElementById(`forum-modal`).remove()">',a+='<i class="fas fa-times"></i>',a+="</a>",a+="</div>",a+='<div class="modal-content">',a+='<div class="is-content">',a+=t.replace(/\n/g,"<br>"),a+="</div>",""!==n&&null!=n&&(a+='<div class="modal-buttons">',a+=n,a+="</div>"),a+="</div>",a+="</div>",a+='<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>',document.getElementById("forum-modal").innerHTML=a},genPrompt:(e,t,n,i)=>{if(""!==e&&null!=e&&""!==t&&null!=t)return new Promise((a,r)=>{FNR.html.genModal(e,"<p>"+t+'</p><p><input id="modal-prompt" type="text" placeholder="'+n+'" value="'+i+'"></p>','<button id="modal-button-enter" class="button1 btn-main">Confirmar</button><button id="modal-button-cancel" class="button1">Cancelar</button>'),document.querySelector("#modal-button-enter").onclick=(()=>{const e=document.querySelector("#modal-prompt").value;a(""!==e&&e),document.getElementById("forum-modal").remove()}),document.querySelector("#modal-button-cancel").onclick=(()=>{r(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".modal-title a").onclick=(()=>{r(!1),document.getElementById("forum-modal").remove()}),document.querySelector(".is-bgmodal.bg-active").onclick=(()=>{r(!1),document.getElementById("forum-modal").remove()})})},genNotification:(e,t,n,i)=>{if(""===e||null==e)return;if(""===t||null==t)return;if(t.length>50)return;if(""===n||null==n)return;document.querySelectorAll("forum-notification").length&&(document.getElementById("forum-notification").remove(),clearTimeout());let a=document.createElement("div");a.id="forum-notification",document.body.appendChild(a);let r="";r+=""===i||null==i?'<div id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >':'<a href="'+i+'" target="_blank" id="'+FNR.utility.genSlug(e,"-")+'" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >',r+='<div class="notification-icon">',r+='<i class="'+n+'"></i>',r+="</div>",r+='<div class="notification-content">',r+="<h3>"+e+"</h3>",r+="<p>"+t+"</p>",r+="</div>",r+='<div class="notification-controls">',r+='<i class="fas fa-times"></i>',r+="</div>",r+=""===i||null==i?"</div>":"</a>",document.getElementById("forum-notification").innerHTML=r,setTimeout(()=>{document.getElementById("forum-notification").classList.add("notification-show")},250),setTimeout(()=>{document.getElementById("forum-notification").classList.remove("notification-show")},8e3),setTimeout(()=>{document.getElementById("forum-notification").remove()},1e4)}},behaviour:{genWiki:()=>{document.querySelector(".wiki-cascade")&&[].forEach.call(document.getElementsByClassName("wiki-cascade"),e=>{e.onclick=(()=>{const t=e.parentElement.parentElement;t.classList.contains("is-active")?t.classList.remove("is-active"):t.classList.add("is-active")})}),document.querySelector(".wiki-controls .router-link-active")&&[].forEach.call(document.querySelectorAll(".wiki-controls .router-link-active"),e=>{if(!e.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains("wiki-index")){const t=(e,n)=>{let i=e.parentElement.parentElement;n&&(i=i.parentElement.parentElement),i.classList.add("is-active"),i.classList.add("is-selected"),i.parentElement.parentElement.parentElement.classList.contains("wiki-index")||t(i,!1)};t(e,!0)}}),document.querySelector("aside.wiki-index > .select-container > select")&&(document.querySelector("aside.wiki-index > .select-container > select").onchange=(()=>{router.push(document.querySelector("aside.wiki-index > .select-container > select").value)}))},genDropeable:()=>{document.querySelector(".is-dropeable")&&[].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.onclick=(()=>{e.classList.contains("is-active")?e.classList.remove("is-active"):([].forEach.call(document.getElementsByClassName("is-dropeable"),e=>{e.classList.remove("is-active")}),e.classList.add("is-active"))})})},genPagelist:(e,t)=>{if(e.length<5)return e;switch(t){case 0:return[e[t],e[t+1],e[t+2],e[t+3],e[t+4]];case 1:return[e[t-1],e[t],e[t+1],e[t+2],e[t+3]];case t.length-1:return[e[t-4],e[t-3],e[t-2],e[t-1],e[t]];case t.length-2:return[e[t-3],e[t-2],e[t-1],e[t],e[t+1]];default:return[e[t-2],e[t-1],e[t],e[t+1],e[t+2]]}}}};
|
package/general.js
CHANGED
|
@@ -92,22 +92,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
92
92
|
if (document.querySelector('.topiclist-topics li:not(.is-not-topic)')) {
|
|
93
93
|
[].forEach.call(document.querySelectorAll('.topiclist-topics li:not(.is-not-topic)'), (item) => {
|
|
94
94
|
const element = item.querySelector('.topiclist-topic .to-process .topic-status').textContent;
|
|
95
|
+
console.log(item.querySelector('.topiclist-topic .to-process .topic-status').textContent, FNR.content.topic.getType(element));
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
item.classList.add(
|
|
98
|
-
}
|
|
99
|
-
item.classList.add('is-read');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (element.indexOf('locked') > -1) {
|
|
103
|
-
item.classList.add('is-closed');
|
|
104
|
-
} else if (element.indexOf('sticky') > 1) {
|
|
105
|
-
item.classList.add('is-sticky');
|
|
106
|
-
} else if (element.indexOf('global_announce') > 1) {
|
|
107
|
-
item.classList.add('is-global-announcement');
|
|
108
|
-
} else if (element.indexOf('announce') > 1) {
|
|
109
|
-
item.classList.add('is-announcement');
|
|
110
|
-
}
|
|
97
|
+
[].forEach.call(FNR.content.topic.getType(element), (item) => {
|
|
98
|
+
item.classList.add(item);
|
|
99
|
+
});
|
|
111
100
|
});
|
|
112
101
|
}
|
|
113
102
|
});
|
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",async()=>{const[e,t]=await Promise.all([FNR.user.getLevel(),FNR.user.getGroup()]);document.body.classList.add(`is-${e}`),document.body.classList.add(`is-${t}`),"guest"!==e&&document.body.classList.add(`is-user${_userdata.user_id}`)}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t,o,r;e.querySelector(".color-groups")?(t=e.querySelector(".color-groups"),o=t.outerHTML.split(t.innerHTML),r=t.textContent,t.outerHTML='<strong><a href="'+FNR.user.getUrl(r)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+r+'»">'+o[0]+Vue.filter("just-name")(r)+o[1]+"</a></strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=r)):(e.querySelector(".forum-last-author").innerHTML="<strong>Invitado</strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado")),e.querySelector(".forum-last-author").outerHTML=e.querySelector(".forum-last-author > strong").outerHTML}):-1!==_userdata.user_id&&document.querySelector(".lastpost-content")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t="<strong>Invitado</strong>";e.querySelector(".forum-last-author > strong")?(t=e.querySelector(".forum-last-author > strong > a"),t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+"»",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=t.textContent),t.querySelector("span").textContent=Vue.filter("just-name")(t.textContent),t="<strong>"+t.outerHTML+"</strong>",t.textContent=Vue.filter("just-name")(t.textContent)):e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado"),e.querySelector(".forum-last-author").outerHTML=t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-last-date")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{const t=e.querySelector(".forum-last-date").textContent;e.querySelector(".lastpost-link").title+=", "+t,e.querySelector(".forum-last-date").outerHTML=t,e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-topic)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-topic)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .topic-status").textContent;t.indexOf("unread")>-1?e.classList.add("is-unread"):e.classList.add("is-read"),t.indexOf("locked")>-1?e.classList.add("is-closed"):t.indexOf("sticky")>1?e.classList.add("is-sticky"):t.indexOf("global_announce")>1?e.classList.add("is-global-announcement"):t.indexOf("announce")>1&&e.classList.add("is-announcement")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")&&(t.querySelector("span")?(t.innerHTML='<strong><a href="'+FNR.user.getUrl(t.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">'+t.querySelector("span").outerHTML+"</a></strong>",t.querySelector("strong strong").textContent=Vue.filter("just-name")(t.querySelector("strong strong").textContent),e.querySelector(".topic-lastauthor").outerHTML=t.innerHTML):e.querySelector(".topic-lastauthor").outerHTML="<strong>Invitado</strong>",e.querySelector(".topic-lastauthor").outerHTML=e.querySelector(".topic-lastauthor").innerHTML),e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#moderation")&&document.querySelector("#moderation a")?document.querySelector('a[href="#gestionar"]').href=document.querySelector("#moderation a").href:document.querySelector("#moderation")&&document.querySelector('a[href="#gestionar"]').parentElement.remove()}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".prev-post")){let e=document.querySelector("#forum-preview");""!==document.querySelectorAll(".prev-post")[0].innerHTML&&(e.querySelector(".post-content").innerHTML='<div class="is-content">'+document.querySelectorAll(".prev-post")[0].innerHTML+"</div>",e.classList.remove("to-process"))}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-otherposts")&&document.querySelector(".forum-otherposts").children.length){let e="";[].forEach.call(document.querySelector(".forum-otherposts").querySelectorAll(".post"),t=>{if(document.querySelector(".mp-main")&&document.querySelector("#forum-reply")){let o=t.querySelector(".mp-from").textContent,r=FNR.utility.getGroup("rgb_"+t.querySelector(".mp-from > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_")),n=t.querySelector(".mp-date").textContent,l=t.querySelector(".is-content").innerHTML;e+='<li class="post post-mp">',e+='<section class="postlist-post usergroup-'+r+'">',e+='<ul class="post-datafields post-profile profile-sticky">',e+='<li class="datafield-user">',e+='<div class="datafield-name">Usuario</div>',e+='<strong><a href="'+FNR.user.getUrl(o)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+o+'»">'+o+"</a></strong>",e+="</li>",e+='<li class="datafield-date">',e+='<div class="datafield-name">Fecha</div>',e+=n.indexOf("el")>-1?n.split("el ")[1]:n,e+="</li>",e+="</ul>",e+='<div class="post-content no-links">',e+='<div class="is-content">',e+=l,e+="</div>",e+="</div>",e+="</section>",e+="</li>"}else document.querySelector("#mp-body")||(t.querySelector(".post-datafields .datafield-user a > span")?(t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("rgb_"+t.querySelector(".post-datafields .datafield-user a > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_"))),t.querySelector(".post-datafields .datafield-user a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.querySelector(".post-datafields .datafield-user a").textContent+"»",t.querySelector(".post-datafields .datafield-user a").target="_blank",""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").href=FNR.user.getUrl(t.querySelector(".post-datafields .datafield-user a").textContent))):t.querySelector(".post-datafields .datafield-check")&&t.querySelector(".post-datafields .datafield-check").children&&1===t.querySelector(".post-datafields .datafield-check").children.length?t.querySelector(".post-datafields .datafield-check").remove():t.querySelector(".post-datafields .datafield-user a")&&""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").outerHTML="<strong>"+t.querySelector(".post-datafields .datafield-user a").innerHTML+"</strong>",t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null"))),"UsuarioAnonymous"===t.querySelector(".post-datafields .datafield-user").textContent&&t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null")))}),document.querySelector(".mp-main")&&document.querySelector("#forum-reply")&&(document.querySelector(".forum-otherposts").innerHTML=e)}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-postlist .post:not(.panel)")){const e={responder_citando:{icon:"fas fa-quote-right",title:"Citar"},editar_borrar_este_mensaje:{icon:"fas fa-pencil-alt",title:"Editar"},borrar_este_mensaje:{icon:"fas fa-trash-alt",title:"Borrar"},ver_la_direccion_ip_del_autor:{icon:"fas fa-map-marker-alt",title:"Ver IP"},permalink:{icon:"fas fa-tag",title:"Enlace permanente"}};[].forEach.call(document.querySelectorAll(".forum-postlist .post"),t=>{if(t.children.length>1){let o="";[].forEach.call(t.querySelectorAll(".to-process .post-icons li a"),t=>{const r=e[FNR.utility.genSlug(t.querySelector("img").title)];o+='<li class="post-button-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'" class="post-button">',o+='<i class="'+r.icon+'"></i>',forumConfig.nameMinibuttons&&(o+="<span>"+("Enlace permanente"===r.title?"Permalink":r.title)+"</span>"),o+="</a>",o+="</li>"}),t.querySelector(".post-buttons").innerHTML=o}else t.remove()})}}),document.addEventListener("DOMContentLoaded",()=>{null!==document.getElementById("forum-realreply")&&""===document.getElementById("forum-realreply").innerHTML&&document.getElementById("quickreply-section").remove()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector('img[title="Citar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Citar mensaje"]'),e=>{let t=e.parentElement;t.title="Citar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Citar el Mensaje"}),document.querySelector('img[title="Editar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Editar mensaje"]'),e=>{let t=e.parentElement;t.title="Editar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Editar el Mensaje"})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mp-from")&&[].forEach.call(document.querySelectorAll(".mp-from"),e=>{const t=FNR.utility.getGroup(e.querySelector("span").style.color.replace(/, /g,"_").replace(/, /g,"_").replace(/\(/g,"_").replace(/\)/g,""));e.innerHTML='<a href="'+FNR.user.getUrl(e.textContent)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.textContent+"</a>";let o=e.parentElement;for(;!o.classList.contains("mp-main");)o=o.parentElement;o.classList.add("usergroup-"+t)})}),document.addEventListener("DOMContentLoaded",()=>{document.getElementById("breadcrumbs")&&document.getElementById("forum-breadcrumb")&&[].forEach.call(document.getElementById("breadcrumbs").children,(e,t,o)=>{let r=e.href,n=Vue.filter("mini-sanitize")(e.text),l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const e=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),t=document.querySelector(".pag-img .sprite-arrow_prosilver_right");e&&(e.parentElement.title="Ir a la página anterior",e.parentElement.classList.add("page-action"),e.parentElement.classList.remove("pag-img"),e.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),t&&(t.parentElement.title="Ir a la página siguiente",t.parentElement.classList.add("page-action"),t.parentElement.classList.remove("pag-img"),t.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>'),[].forEach.call(document.querySelectorAll("#pagination > span > a:not(.page-action)"),e=>{e.classList.add("page-link"),e.title="Ir a la página «"+e.textContent+"»"}),document.querySelector("#pagination > span > strong").title="Página actual";const o=document.querySelector("#pagination > span").innerHTML.trim().replace(/ ... /g,'<span class="page-spacer">…</span>');[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",o),e.parentElement.classList.contains("not-show")&&e.parentElement.classList.remove("not-show")})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{1!==e.classList.length&&e.classList.remove("codebox")}),document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{const t=e.querySelector("code").innerHTML.trim();e.querySelector("dt").innerHTML='Código <em>-</em> <span class="is-pointer">Copiar</span>',e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-code"></i></div>'),e.querySelector("code").remove(),e.insertAdjacentHTML("beforeend","<code>"+t+"</code>")}),document.querySelector(".spoiler")&&[].forEach.call(document.querySelectorAll(".spoiler"),e=>{e.querySelector("dt").innerHTML=e.querySelector("dt").innerHTML.slice(0,-1),e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-archive"></i></div>')}),document.querySelector(".hidecode")&&[].forEach.call(document.querySelectorAll(".hidecode"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-eye-slash"></i></div>')}),document.querySelector("blockquote")&&([].forEach.call(document.querySelectorAll("blockquote cite"),e=>{if(e.innerHTML=e.innerHTML.replace(/escribió:/g,""),e.querySelector("a")){const t=e.querySelector("a");t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.title.replace(/Ver el perfil :: /g,"")+"»"}e=e.innerHTML}),[].forEach.call(document.querySelectorAll("blockquote"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-quote-right"></i></div>')}))}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#is-form")&&document.querySelector(".msg-element")){const e=document.querySelector("#is-form").innerHTML,t={method:document.querySelector(".basic-element form").method,action:document.querySelector(".basic-element form").action,name:document.querySelector(".basic-element form").name};document.querySelector("#message-section").outerHTML='<form method="'+t.method+'" action="'+t.action+'" name="'+t.name+'" id="message-section" class="basic-element">'+document.querySelector("#message-section").innerHTML+"</form>",document.querySelector("#message-section .msg-element").insertAdjacentHTML("afterend",'<div id="usereply-comand">'+e+"</div>"),document.querySelector("#is-form").remove()}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-content .post-content")&&[].forEach.call(document.querySelectorAll(".is-content .post-content"),e=>{e.classList.remove("post-content")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".has-anchor")&&[].forEach.call(document.querySelectorAll(".has-anchor"),e=>{e.insertAdjacentHTML("afterbegin",`<a id="anchor-${e.id}" class="page-anchor"></a>`)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mentiontag")&&[].forEach.call(document.querySelectorAll(".mentiontag"),e=>{e.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.title.replace(/Ver el perfil :: /g,"")+"»"})}),document.addEventListener("DOMContentLoaded",()=>{[].forEach.call(document.querySelectorAll(".to-process"),e=>{e.remove()})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#forum-rules")&&(document.querySelector("#forum-rules").innerHTML=document.querySelector("#forum-rules").innerHTML.replace(/</g,"<").replace(/>/g,">"))}),document.addEventListener("DOMContentLoaded",()=>{if(forumConfig.skinOptions.allowCustomStyles&&document.querySelector("#forum-content .forum-custom-styles")){let e="";[].forEach.call(document.querySelectorAll("#forum-content .forum-custom-styles"),t=>{e+=t.innerHTML,t.remove()}),document.head.insertAdjacentHTML("beforeend",`<style>${e}</style>`)}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-controls")&&[].forEach.call(document.querySelectorAll(".forum-controls"),e=>{let t=0;[].forEach.call(e.children,e=>{"none"!==window.getComputedStyle(e,null).display&&(t+=e.children.length)}),0===t&&!1===e.classList.contains("not-show")&&e.classList.add("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{document.dispatchEvent(forumReady)}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{e.querySelector("dt span").onclick=(()=>{navigator.clipboard.writeText(e.querySelector("code").innerText),FNR.html.genNotification("¡Copiado!","Recuerda engancharlo en algún lugar.","fas fa-copy")})})}),document.addEventListener("DOMContentLoaded",()=>{[].forEach.call(document.querySelectorAll(".is-clickbox"),e=>{const t=e.dataset.categorybox,o=e.dataset.categoryid;e.classList.contains("is-toggle")?e.onclick=(()=>{document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genWiki()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".checkbox-click:not(.is-radio)")&&[].forEach.call(document.querySelectorAll(".checkbox-click:not(.is-radio)"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".checkbox-click.is-radio")&&[].forEach.call(document.querySelectorAll(".checkbox-click.is-radio"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{[].forEach.call(document.querySelectorAll('input[type="radio"][name="'+o.name+'"]'),e=>{const t=e.parentElement.parentElement.classList;t.contains("is-active")&&t.remove("is-active")}),t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-input")&&[].forEach.call(document.querySelectorAll(".is-input"),e=>{e.onclick=(t=>{e.querySelector('input[type="submit"]').click()})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genDropeable()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{[].forEach.call(document.getElementsByClassName("is-tweakeable"),e=>{const t=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).paddingLeft)-parseFloat(window.getComputedStyle(e,null).paddingRight)-parseFloat(window.getComputedStyle(e,null).borderLeftWidth)-parseFloat(window.getComputedStyle(e,null).borderRightWidth);if(t>0&&e.querySelector(".is-measurable").offsetWidth>0){let o=parseFloat(window.getComputedStyle(e,null).fontSize);for(;t<e.querySelector(".is-measurable").offsetWidth;)e.style.fontSize=o+"px",o--}})})}),document.addEventListener("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
|
|
1
|
+
console.log("%cSkin por %cGaylien 🏳️🌈","font-family: sans-serif; font-size: 1.5em","font-size: 1.5em; text-transform: uppercase; font-weight: 800; color: #c381b9;"),console.log("https://zatrapa-gaylien.tumblr.com/"),document.addEventListener("DOMContentLoaded",async()=>{const[e,t]=await Promise.all([FNR.user.getLevel(),FNR.user.getGroup()]);document.body.classList.add(`is-${e}`),document.body.classList.add(`is-${t}`),"guest"!==e&&document.body.classList.add(`is-user${_userdata.user_id}`)}),document.addEventListener("DOMContentLoaded",()=>{-1===_userdata.user_id&&document.querySelector(".lastpost-content")?[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t,o,r;e.querySelector(".color-groups")?(t=e.querySelector(".color-groups"),o=t.outerHTML.split(t.innerHTML),r=t.textContent,t.outerHTML='<strong><a href="'+FNR.user.getUrl(r)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+r+'»">'+o[0]+Vue.filter("just-name")(r)+o[1]+"</a></strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=r)):(e.querySelector(".forum-last-author").innerHTML="<strong>Invitado</strong>",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado")),e.querySelector(".forum-last-author").outerHTML=e.querySelector(".forum-last-author > strong").outerHTML}):-1!==_userdata.user_id&&document.querySelector(".lastpost-content")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{let t="<strong>Invitado</strong>";e.querySelector(".forum-last-author > strong")?(t=e.querySelector(".forum-last-author > strong > a"),t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+"»",e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+=t.textContent),t.querySelector("span").textContent=Vue.filter("just-name")(t.textContent),t="<strong>"+t.outerHTML+"</strong>",t.textContent=Vue.filter("just-name")(t.textContent)):e.querySelector(".lastpost-link")&&(e.querySelector(".lastpost-link").title+="Invitado"),e.querySelector(".forum-last-author").outerHTML=t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-last-date")&&[].forEach.call(document.getElementsByClassName("lastpost-content"),e=>{const t=e.querySelector(".forum-last-date").textContent;e.querySelector(".lastpost-link").title+=", "+t,e.querySelector(".forum-last-date").outerHTML=t,e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-topic)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-topic)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .topic-status").textContent;console.log(e.querySelector(".topiclist-topic .to-process .topic-status").textContent,FNR.content.topic.getType(t)),[].forEach.call(FNR.content.topic.getType(t),e=>{e.classList.add(e)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-creator")&&[].forEach.call(document.querySelectorAll(".topic-creator"),e=>{e.querySelector("span")?(e.querySelector("a")?(e.querySelector("a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+"»",e.innerHTML="<strong>"+e.innerHTML+"</strong>"):e.innerHTML='<strong><a href="'+FNR.user.getUrl(e.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.innerHTML+"</a></strong>",e.querySelector("span").innerHTML=Vue.filter("just-name")(e.textContent)):e.innerHTML="<strong>Invitado</strong>",e.outerHTML=e.innerHTML})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topic-pagination")&&[].forEach.call(document.querySelectorAll(".topic-pagination"),e=>{e.querySelector("strong")&&e.classList.remove("to-process")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".topiclist-topics li:not(.is-not-lastpost)")&&[].forEach.call(document.querySelectorAll(".topiclist-topics li:not(.is-not-lastpost)"),e=>{const t=e.querySelector(".topiclist-topic .to-process .lastpost-author"),o=e.querySelector(".topiclist-topic .to-process .lastpost-link a").href,r=e.querySelector(".topiclist-topic .to-process .lastpost-date").textContent;e.querySelector(".topic-lastpost").href=o,e.querySelector(".topic-lastpost").title="Último mensaje por "+t.textContent.trim()+", "+r,e.querySelector(".topic-lastauthor")&&(t.querySelector("span")?(t.innerHTML='<strong><a href="'+FNR.user.getUrl(t.textContent)+'" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.textContent+'»">'+t.querySelector("span").outerHTML+"</a></strong>",t.querySelector("strong strong").textContent=Vue.filter("just-name")(t.querySelector("strong strong").textContent),e.querySelector(".topic-lastauthor").outerHTML=t.innerHTML):e.querySelector(".topic-lastauthor").outerHTML="<strong>Invitado</strong>",e.querySelector(".topic-lastauthor").outerHTML=e.querySelector(".topic-lastauthor").innerHTML),e.querySelector(".topic-lastdate")&&(e.querySelector(".topic-lastdate").outerHTML=r)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#moderation")&&document.querySelector("#moderation a")?document.querySelector('a[href="#gestionar"]').href=document.querySelector("#moderation a").href:document.querySelector("#moderation")&&document.querySelector('a[href="#gestionar"]').parentElement.remove()}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".prev-post")){let e=document.querySelector("#forum-preview");""!==document.querySelectorAll(".prev-post")[0].innerHTML&&(e.querySelector(".post-content").innerHTML='<div class="is-content">'+document.querySelectorAll(".prev-post")[0].innerHTML+"</div>",e.classList.remove("to-process"))}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-otherposts")&&document.querySelector(".forum-otherposts").children.length){let e="";[].forEach.call(document.querySelector(".forum-otherposts").querySelectorAll(".post"),t=>{if(document.querySelector(".mp-main")&&document.querySelector("#forum-reply")){let o=t.querySelector(".mp-from").textContent,r=FNR.utility.getGroup("rgb_"+t.querySelector(".mp-from > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_")),n=t.querySelector(".mp-date").textContent,l=t.querySelector(".is-content").innerHTML;e+='<li class="post post-mp">',e+='<section class="postlist-post usergroup-'+r+'">',e+='<ul class="post-datafields post-profile profile-sticky">',e+='<li class="datafield-user">',e+='<div class="datafield-name">Usuario</div>',e+='<strong><a href="'+FNR.user.getUrl(o)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+o+'»">'+o+"</a></strong>",e+="</li>",e+='<li class="datafield-date">',e+='<div class="datafield-name">Fecha</div>',e+=n.indexOf("el")>-1?n.split("el ")[1]:n,e+="</li>",e+="</ul>",e+='<div class="post-content no-links">',e+='<div class="is-content">',e+=l,e+="</div>",e+="</div>",e+="</section>",e+="</li>"}else document.querySelector("#mp-body")||(t.querySelector(".post-datafields .datafield-user a > span")?(t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("rgb_"+t.querySelector(".post-datafields .datafield-user a > span").style.color.split("rgb(")[1].split(")")[0].replace(/, /g,"_"))),t.querySelector(".post-datafields .datafield-user a").title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.querySelector(".post-datafields .datafield-user a").textContent+"»",t.querySelector(".post-datafields .datafield-user a").target="_blank",""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").href=FNR.user.getUrl(t.querySelector(".post-datafields .datafield-user a").textContent))):t.querySelector(".post-datafields .datafield-check")&&t.querySelector(".post-datafields .datafield-check").children&&1===t.querySelector(".post-datafields .datafield-check").children.length?t.querySelector(".post-datafields .datafield-check").remove():t.querySelector(".post-datafields .datafield-user a")&&""===t.querySelector(".post-datafields .datafield-user a").href&&(t.querySelector(".post-datafields .datafield-user a").outerHTML="<strong>"+t.querySelector(".post-datafields .datafield-user a").innerHTML+"</strong>",t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null"))),"UsuarioAnonymous"===t.querySelector(".post-datafields .datafield-user").textContent&&t.querySelector(".postlist-post").classList.add("usergroup-"+FNR.utility.getGroup("null")))}),document.querySelector(".mp-main")&&document.querySelector("#forum-reply")&&(document.querySelector(".forum-otherposts").innerHTML=e)}}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector(".forum-postlist .post:not(.panel)")){const e={responder_citando:{icon:"fas fa-quote-right",title:"Citar"},editar_borrar_este_mensaje:{icon:"fas fa-pencil-alt",title:"Editar"},borrar_este_mensaje:{icon:"fas fa-trash-alt",title:"Borrar"},ver_la_direccion_ip_del_autor:{icon:"fas fa-map-marker-alt",title:"Ver IP"},permalink:{icon:"fas fa-tag",title:"Enlace permanente"}};[].forEach.call(document.querySelectorAll(".forum-postlist .post"),t=>{if(t.children.length>1){let o="";[].forEach.call(t.querySelectorAll(".to-process .post-icons li a"),t=>{const r=e[FNR.utility.genSlug(t.querySelector("img").title)];o+='<li class="post-button-'+FNR.utility.genSlug(r.title,"-")+'">',o+='<a title="'+r.title+'" href="'+t.href+'" class="post-button">',o+='<i class="'+r.icon+'"></i>',forumConfig.nameMinibuttons&&(o+="<span>"+("Enlace permanente"===r.title?"Permalink":r.title)+"</span>"),o+="</a>",o+="</li>"}),t.querySelector(".post-buttons").innerHTML=o}else t.remove()})}}),document.addEventListener("DOMContentLoaded",()=>{null!==document.getElementById("forum-realreply")&&""===document.getElementById("forum-realreply").innerHTML&&document.getElementById("quickreply-section").remove()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector('img[title="Citar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Citar mensaje"]'),e=>{let t=e.parentElement;t.title="Citar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Citar el Mensaje"}),document.querySelector('img[title="Editar mensaje"]')&&[].forEach.call(document.querySelectorAll('img[title="Editar mensaje"]'),e=>{let t=e.parentElement;t.title="Editar el Mensaje",t.classList.add("dropdown-item"),t.textContent="Editar el Mensaje"})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mp-from")&&[].forEach.call(document.querySelectorAll(".mp-from"),e=>{const t=FNR.utility.getGroup(e.querySelector("span").style.color.replace(/, /g,"_").replace(/, /g,"_").replace(/\(/g,"_").replace(/\)/g,""));e.innerHTML='<a href="'+FNR.user.getUrl(e.textContent)+'" target="_blank" title="Ir al '+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.textContent+'»">'+e.textContent+"</a>";let o=e.parentElement;for(;!o.classList.contains("mp-main");)o=o.parentElement;o.classList.add("usergroup-"+t)})}),document.addEventListener("DOMContentLoaded",()=>{document.getElementById("breadcrumbs")&&document.getElementById("forum-breadcrumb")&&[].forEach.call(document.getElementById("breadcrumbs").children,(e,t,o)=>{let r=e.href,n=Vue.filter("mini-sanitize")(e.text),l="";r.match(/c(\d+)-/)||t+1===o.length?(r=t+1===o.length?window.location.pathname+window.location.search:"#",l+=' class="is-hidden-touch'+(t+1===o.length?"":" is-active")+'"'):r.indexOf("#profile")>-1&&(r=FNR.user.getUrl(n)),document.querySelector("#forum-breadcrumb ul").innerHTML+="<li"+l+'><a href="'+r+'" title="Ir a «'+n+'»">'+n+"</a></li>"})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#buttons");e&&e.children.length&&[].forEach.call(document.querySelectorAll(".page-buttons"),t=>{t.insertAdjacentHTML("afterbegin",e.innerHTML),t.parentElement.classList.contains("not-show")&&t.parentElement.classList.remove("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#pagination")&&document.querySelector("#pagination").children.length){const e=document.querySelector(".pag-img .sprite-arrow_prosilver_left"),t=document.querySelector(".pag-img .sprite-arrow_prosilver_right");e&&(e.parentElement.title="Ir a la página anterior",e.parentElement.classList.add("page-action"),e.parentElement.classList.remove("pag-img"),e.parentElement.innerHTML='<i class="fas fa-chevron-left"></i>'),t&&(t.parentElement.title="Ir a la página siguiente",t.parentElement.classList.add("page-action"),t.parentElement.classList.remove("pag-img"),t.parentElement.innerHTML='<i class="fas fa-chevron-right"></i>'),[].forEach.call(document.querySelectorAll("#pagination > span > a:not(.page-action)"),e=>{e.classList.add("page-link"),e.title="Ir a la página «"+e.textContent+"»"}),document.querySelector("#pagination > span > strong").title="Página actual";const o=document.querySelector("#pagination > span").innerHTML.trim().replace(/ ... /g,'<span class="page-spacer">…</span>');[].forEach.call(document.querySelectorAll(".page-pagination"),e=>{e.insertAdjacentHTML("afterbegin",o),e.parentElement.classList.contains("not-show")&&e.parentElement.classList.remove("not-show")})}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{1!==e.classList.length&&e.classList.remove("codebox")}),document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{const t=e.querySelector("code").innerHTML.trim();e.querySelector("dt").innerHTML='Código <em>-</em> <span class="is-pointer">Copiar</span>',e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-code"></i></div>'),e.querySelector("code").remove(),e.insertAdjacentHTML("beforeend","<code>"+t+"</code>")}),document.querySelector(".spoiler")&&[].forEach.call(document.querySelectorAll(".spoiler"),e=>{e.querySelector("dt").innerHTML=e.querySelector("dt").innerHTML.slice(0,-1),e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-archive"></i></div>')}),document.querySelector(".hidecode")&&[].forEach.call(document.querySelectorAll(".hidecode"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-eye-slash"></i></div>')}),document.querySelector("blockquote")&&([].forEach.call(document.querySelectorAll("blockquote cite"),e=>{if(e.innerHTML=e.innerHTML.replace(/escribió:/g,""),e.querySelector("a")){const t=e.querySelector("a");t.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+t.title.replace(/Ver el perfil :: /g,"")+"»"}e=e.innerHTML}),[].forEach.call(document.querySelectorAll("blockquote"),e=>{e.insertAdjacentHTML("afterbegin",'<div class="adminbox-icon"><i class="fas fa-quote-right"></i></div>')}))}),document.addEventListener("DOMContentLoaded",()=>{if(document.querySelector("#is-form")&&document.querySelector(".msg-element")){const e=document.querySelector("#is-form").innerHTML,t={method:document.querySelector(".basic-element form").method,action:document.querySelector(".basic-element form").action,name:document.querySelector(".basic-element form").name};document.querySelector("#message-section").outerHTML='<form method="'+t.method+'" action="'+t.action+'" name="'+t.name+'" id="message-section" class="basic-element">'+document.querySelector("#message-section").innerHTML+"</form>",document.querySelector("#message-section .msg-element").insertAdjacentHTML("afterend",'<div id="usereply-comand">'+e+"</div>"),document.querySelector("#is-form").remove()}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-content .post-content")&&[].forEach.call(document.querySelectorAll(".is-content .post-content"),e=>{e.classList.remove("post-content")})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".has-anchor")&&[].forEach.call(document.querySelectorAll(".has-anchor"),e=>{e.insertAdjacentHTML("afterbegin",`<a id="anchor-${e.id}" class="page-anchor"></a>`)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".mentiontag")&&[].forEach.call(document.querySelectorAll(".mentiontag"),e=>{e.title="Ir al "+(void 0===forumConfig.profileOptions.profileName?"perfil":forumConfig.profileOptions.profileName)+" de «"+e.title.replace(/Ver el perfil :: /g,"")+"»"})}),document.addEventListener("DOMContentLoaded",()=>{[].forEach.call(document.querySelectorAll(".to-process"),e=>{e.remove()})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector("#forum-rules")&&(document.querySelector("#forum-rules").innerHTML=document.querySelector("#forum-rules").innerHTML.replace(/</g,"<").replace(/>/g,">"))}),document.addEventListener("DOMContentLoaded",()=>{if(forumConfig.skinOptions.allowCustomStyles&&document.querySelector("#forum-content .forum-custom-styles")){let e="";[].forEach.call(document.querySelectorAll("#forum-content .forum-custom-styles"),t=>{e+=t.innerHTML,t.remove()}),document.head.insertAdjacentHTML("beforeend",`<style>${e}</style>`)}}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".forum-controls")&&[].forEach.call(document.querySelectorAll(".forum-controls"),e=>{let t=0;[].forEach.call(e.children,e=>{"none"!==window.getComputedStyle(e,null).display&&(t+=e.children.length)}),0===t&&!1===e.classList.contains("not-show")&&e.classList.add("not-show")})}),document.addEventListener("DOMContentLoaded",()=>{document.dispatchEvent(forumReady)}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".codebox")&&[].forEach.call(document.querySelectorAll(".codebox"),e=>{e.querySelector("dt span").onclick=(()=>{navigator.clipboard.writeText(e.querySelector("code").innerText),FNR.html.genNotification("¡Copiado!","Recuerda engancharlo en algún lugar.","fas fa-copy")})})}),document.addEventListener("DOMContentLoaded",()=>{[].forEach.call(document.querySelectorAll(".is-clickbox"),e=>{const t=e.dataset.categorybox,o=e.dataset.categoryid;e.classList.contains("is-toggle")?e.onclick=(()=>{document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.toggle("is-active")}):e.onclick=(()=>{document.querySelector('.is-clickbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-clickbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active"),document.querySelector('.is-selectbox.is-active[categorybox="'+t+'"]').classList.remove("is-active"),document.querySelector('.is-selectbox[categorybox="'+t+'"][categoryid="'+o+'"]').classList.add("is-active")})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genWiki()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".checkbox-click:not(.is-radio)")&&[].forEach.call(document.querySelectorAll(".checkbox-click:not(.is-radio)"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".checkbox-click.is-radio")&&[].forEach.call(document.querySelectorAll(".checkbox-click.is-radio"),e=>{const t=e.parentElement.parentElement,o=t.querySelector(".checkbox-real input");o.checked&&t.classList.add("is-active"),e.parentElement.onclick=(()=>{[].forEach.call(document.querySelectorAll('input[type="radio"][name="'+o.name+'"]'),e=>{const t=e.parentElement.parentElement.classList;t.contains("is-active")&&t.remove("is-active")}),t.classList.contains("is-active")?(t.classList.remove("is-active"),o.checked=!1):(t.classList.add("is-active"),o.checked=!0)})})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-input")&&[].forEach.call(document.querySelectorAll(".is-input"),e=>{e.onclick=(t=>{e.querySelector('input[type="submit"]').click()})})}),document.addEventListener("DOMContentLoaded",()=>{FNR.behaviour.genDropeable()}),document.addEventListener("DOMContentLoaded",()=>{document.querySelector(".is-tweakeable")&&document.fonts.ready.then(()=>{[].forEach.call(document.getElementsByClassName("is-tweakeable"),e=>{const t=e.offsetWidth-parseFloat(window.getComputedStyle(e,null).paddingLeft)-parseFloat(window.getComputedStyle(e,null).paddingRight)-parseFloat(window.getComputedStyle(e,null).borderLeftWidth)-parseFloat(window.getComputedStyle(e,null).borderRightWidth);if(t>0&&e.querySelector(".is-measurable").offsetWidth>0){let o=parseFloat(window.getComputedStyle(e,null).fontSize);for(;t<e.querySelector(".is-measurable").offsetWidth;)e.style.fontSize=o+"px",o--}})})}),document.addEventListener("DOMContentLoaded",()=>{document.fonts.ready.then(()=>{document.querySelector("#forum-body > .main-body").classList.remove("is-invisible")})});
|