generic-skin 2.5.3 → 2.9.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,2 @@
1
- Vue.component("panel-control", { props: ["dataElements"], data: function () { return { userId: _userdata.user_id, state: { page: 0 }, content: { original: [], current: [] } } }, computed: { validationPanel: function () { return FNR.utility.genValidation(this.content.current) }, toSave: function () { 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: function () { 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.dataElements.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 </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro data-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 :data-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" v-if="toSave.length && validationPanel === \'\'">\n <button class="button1 btn-main" v-on:click="updateProfile()" title="Actualizar perfil">Actualizar</button>\n </div>\n </template>\n <template v-if="state.page === 2">\n <cargando-foro data-text="Actualizando información…"></cargando-foro>\n </template>\n </section>\n ' }), Vue.component("lista-bosquejos", { data: function () { return { state: { page: 0 }, content: { drafts: [] } } }, created() { FNR.user.profile.getDrafts().then(e => { this.state.page = 1, this.content.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 tus bosquejos. 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 </div>\n <separador-foro />\n <template v-if="state.page === 0">\n <cargando-foro data-text="Cargando utilidad…"></cargando-foro>\n </template>\n <template v-else-if="state.page === 1">\n <section id="forum-drafts" class="forum-topiclist">\n <lista-temas-cabecera data-elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul class="topiclist-topics no-style">\n <template v-if="content.drafts === false">\n <li class="is-not-lastpost not-status">\n <h6>No tienes bosquejos guardados</h6>\n </li>\n </template>\n <template v-else>\n <li class="row is-not-lastpost not-status" v-for="draft in content.drafts">\n <temas-foro data-type="draft" data-mode="" :data-url="draft.topic.url" :data-title="draft.topic.name" :data-replies="draft.info.location" :data-views="draft.info.date" :data-quick="draft.modify" />\n </li>\n </template>\n </ul>\n </section>\n </template>\n </section>\n ' }), Vue.component("editor-foro", {
2
- data: function () { return { state: { page: 0, editor: "none", admin: 1 === _userdata.user_level, guest: 0 === _userdata.session_logged_in, dice: document.querySelectorAll("#list_dice").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: function () { let e = ""; return this.state.guest && (this.content.username.trim().length < 4 || 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 || (this.content.subject.trim().length < 4 || this.content.subject.trim().length > 60) && (e += "<li>Escribe un titulo de tamaño adecuado.</li>"), this.content.msg.trim().length < 10 && (e += "<li>Escribe un mensaje lo suficientemente largo.</li>"), e }, sortedCharacters: function () { 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: function () { return this.users.selected.sort((e, t) => e < t ? -1 : e > t ? 1 : 0) } }, methods: { insertSomething: function (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, r = t + n.length + i.length; o.value = o.value.substring(0, e) + n + o.value.substring(e, t) + i + o.value.substring(t, o.value.length), o.setSelectionRange(r, r) } this.content.msg = o.value }, newDice: function () { this.dice.current.push({ dice: -1, number: 0 }) }, addCharacter: function (e) { this.users.selected.push(e), this.users.selector = !1, this.users.current = "", setTimeout(() => { this.users.selector = !0 }, 250) }, deleteCharacter: function (e) { this.users.current = "", this.users.selected.splice(e, 1) }, changeGroup: function () { this.users.selected = [], this.users.current = "" }, insertUrl: function () { 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: function () { 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: function () { 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: function () { 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: function () { 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), "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 && ([].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) }))), 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 || (this.content.subject.trim().length > 4 || this.content.subject.trim().length < 60) && (document.querySelector('#forum-realreply > form input[name="subject"]').value = this.content.subject.trim()) }, draftMsg: function () { this.parseMsg(), document.querySelector('#forum-realreply > form input[value="Bosquejo"], #forum-realreply input[value="Modificar"]').click() }, sendMsg: function () { this.parseMsg(), document.querySelector('#forum-realreply > form input[value="Enviar"], #forum-realreply input[value="Publicar"]').click() }, prevMsg: function () { 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) },
3
- template: '\n <div id="forum-usereply">\n <template v-if="state.page === 0">\n <cargando-foro data-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 data-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 data-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" v-on: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" v-on: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 data-name="Grupo">\n <div class="select-container">\n <select v-model="groups.type" v-on: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="state.editor === \'newtopic\' && content.type !== -1">\n <li>\n <campo-foro data-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\'">\n <li>\n <campo-foro data-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" v-on: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" v-on: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" v-on: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" v-on: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" v-on: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" v-on:click="insertSomething(\'[left]\', \'[/left]\')">Izquierda</div>\n <div class="usereply-option" v-on:click="insertSomething(\'[center]\', \'[/center]\')">Centro</div>\n <div class="usereply-option" v-on: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" v-on:click="insertUrl()">Enlace</div>\n <div class="usereply-option" v-on:click="insertImg()">Imagen</div>\n <div class="usereply-option" v-on:click="insertSpoiler()">Spoiler</div>\n <div class="usereply-option" v-on:click="insertSomething(\'[code]\', \'[/code]\')">Code</div>\n <div class="usereply-option" v-on:click="insertQuote()">Cita</div>\n <div class="usereply-option" v-on:click="insertSomething(\'[hide]\', \'[/hide]\')">Ocultar</div>\n <div class="usereply-option" v-on: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" v-if="!msgCheck.length">\n <button class="button1 btn-main" v-on:click="sendMsg()">Enviar</button>\n <button class="button1" v-on:click="draftMsg()" v-if="state.editor === \'editpostdraft\'">Modificar</button>\n <button class="button1" v-on:click="draftMsg()" v-else-if="state.editor === \'reply\' && state.dice">Bosquejo</button>\n <button class="button1" v-on:click="prevMsg()">Previsualizar</button>\n </div>\n <div v-if="state.editor === \'reply\' && state.dice" 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">\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 v-on: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 '
4
- });
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,s)=>{t.value!==this.content.original[s].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>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:{messages:{page:0,loading:0,pages:[],content:[]},topics:{page:0,loading:0,pages:[],content:[]}}}),computed:{sortedMessagesPages(){return FNR.behaviour.genPagelist(this.drafts.messages.pages,this.drafts.messages.page)},sortedTopicsPages(){return FNR.behaviour.genPagelist(this.drafts.topics.pages,this.drafts.topics.page)}},methods:{getPageMessages(e){this.drafts.messages.loading=0,FNR.user.drafts.messages.getDrafts(e).then(e=>{this.drafts.messages.content=e,this.drafts.messages.loading=1,this.state.page=1})},getPageTopics(e){this.drafts.topics.loading=0,FNR.user.drafts.topics.getDrafts(e).then(e=>{this.drafts.topics.content=e,this.drafts.topics.loading=1,this.state.page=1})},setPageMessages(e){this.drafts.messages.page=e,this.getPageMessages(this.drafts.messages.pages[this.drafts.messages.page])},setPageTopics(e){this.drafts.topics.page=e,this.getPageMessages(this.drafts.topics.pages[this.drafts.topics.page])}},created(){Promise.all([FNR.user.drafts.messages.getPages(),FNR.user.drafts.topics.getPages()]).then(e=>{0!==e[0].items&&(this.drafts.messages.pages=e[0].pages,this.getPageMessages(this.drafts.messages.pages[this.drafts.messages.page])),0!==e[1].items&&(this.drafts.topics.pages=e[1].pages,this.getPageTopics(this.drafts.topics.pages[this.drafts.topics.page])),e[0].items+e[1].items===0&&(this.state.page=1)})},updated(){FNR.behaviour.genControls()},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>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 <div class="is-content mb-4">\n <h4>Mensajes</h4>\n </div>\n <mando-foro id="upper-controls" app="true">\n <template slot="pagination" v-if="drafts.messages.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="drafts.messages.page > 0" @click="setPageMessages(drafts.messages.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedMessagesPages">\n <strong v-if="drafts.messages.pages.indexOf(page) === drafts.messages.page">{{ drafts.messages.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (drafts.messages.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPageMessages(drafts.messages.pages.indexOf(page))">{{ drafts.messages.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(drafts.messages.page + 1) < drafts.messages.pages.length" @click="setPageMessages(drafts.messages.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n </mando-foro>\n <section id="forum-drafts-messages" class="forum-topiclist">\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!drafts.messages.content.length || drafts.messages.loading === 0 ? \' no-results\': \'\')">\n <template v-if="!drafts.messages.content.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes bosquejos</h6>\n </li>\n </template>\n <template v-else-if="drafts.messages.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="draft in drafts.messages.content">\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 <mando-foro id="lower-controls" app="true">\n <template slot="pagination" v-if="drafts.messages.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="drafts.messages.page > 0" @click="setPageMessages(drafts.messages.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedMessagesPages">\n <strong v-if="drafts.messages.pages.indexOf(page) === drafts.messages.page">{{ drafts.messages.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (drafts.messages.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPageMessages(drafts.messages.pages.indexOf(page))">{{ drafts.messages.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(drafts.messages.page + 1) < drafts.messages.pages.length" @click="setPageMessages(drafts.messages.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n </mando-foro>\n \t <separador-foro></separador-foro>\n <div class="is-content mb-4">\n <h4>Temas</h4>\n </div>\n <mando-foro id="upper-controls" app="true">\n <template slot="pagination" v-if="drafts.topics.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="drafts.topics.page > 0" @click="setPageTopics(drafts.topics.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedTopicsPages">\n <strong v-if="drafts.topics.pages.indexOf(page) === drafts.topics.page">{{ drafts.topics.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (drafts.topics.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPageTopics(drafts.topics.pages.indexOf(page))">{{ drafts.topics.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(drafts.topics.page + 1) < drafts.topics.pages.length" @click="setPageTopics(drafts.topics.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n </mando-foro>\n <section id="forum-drafts-messages" class="forum-topiclist">\n <lista-temas-cabecera elements="[\'Tema\', \'Información\']"></lista-temas-cabecera>\n <ul :class="\'topiclist-topics no-style\' + (!drafts.topics.content.length || drafts.topics.loading === 0 ? \' no-results\': \'\')">\n <template v-if="!drafts.topics.content.length">\n <li class="is-not-topic is-not-lastpost">\n <h6>No tienes bosquejos</h6>\n </li>\n </template>\n <template v-else-if="drafts.topics.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="draft in drafts.topics.content">\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 <mando-foro id="lower-controls" app="true">\n <template slot="pagination" v-if="drafts.topics.pages.length > 1">\n <a class="page-action" title="Ir a la página anterior" v-if="drafts.topics.page > 0" @click="setPageTopics(drafts.topics.page -= 1)">\n <i class="fas fa-chevron-left"></i>\n </a>\n <template v-for="page in sortedTopicsPages">\n <strong v-if="drafts.topics.pages.indexOf(page) === drafts.topics.page">{{ drafts.topics.pages.indexOf(page) + 1 }}</strong>\n <a class="page-link" :title="\'Ir a la página «\' + (drafts.topics.pages.indexOf(page) + 1) + \'»\'" v-else @click="setPageTopics(drafts.topics.pages.indexOf(page))">{{ drafts.topics.pages.indexOf(page) + 1 }}</a>\n </template>\n <a class="page-action" title="Ir a la página siguiente" v-if="(drafts.topics.page + 1) < drafts.topics.pages.length" @click="setPageTopics(drafts.topics.page += 1)">\n <i class="fas fa-chevron-right"></i>\n </a>\n </template>\n </mando-foro>\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])):this.state.page=1})},updated(){FNR.behaviour.genControls()},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 v-if="followed.content.length" @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 v-if="followed.content.length" @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 s=document.getElementById("usereply-editor"),o=e.replace(/-jump-/g,"\n"),a=t.replace(/-jump-/g,"\n");if(document.selection)s.focus(),document.selection.createRange().text=o+document.selection.createRange().text+a;else if(s.selectionStart||"0"==s.selectionStart){const e=s.selectionStart,t=s.selectionEnd,n=t+o.length;s.value=s.value.substring(0,e)+o+s.value.substring(e,t)+a+s.value.substring(t,s.value.length),s.setSelectionRange(n,n)}this.content.msg=s.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,s=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(o=>{!1!==o?this.insertSomething("[url=","]"+o+"[/url]"):this.insertSomething("[url=","]"+e.value.substring(t,s)+"[/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",s="t";"editpostdraft"===e.get("mode")&&(t="draft",s="p"),FNR.user.drafts.delDrafts(t,[e.get(s)]).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(),
2
+ 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)},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 '});
package/apps/vueMulti.js CHANGED
@@ -1,22 +1,22 @@
1
1
  Vue.component('modal-multicuentas', {
2
- props: ['dataElement', 'dataType'],
3
- data: function () {
2
+ props: ['element', 'type'],
3
+ data() {
4
4
  return {
5
5
  state: {
6
6
  modal: false
7
7
  },
8
8
  content: {
9
- edit: JSON.parse(JSON.stringify(this.dataElement)),
10
- current: this.dataElement
9
+ edit: JSON.parse(JSON.stringify(this.element)),
10
+ current: this.element
11
11
  }
12
12
  }
13
13
  },
14
14
  computed: {
15
- modalTitle: function () {
16
- if (this.dataType === 'new') return 'Nuevo usuario';
17
- else if (this.dataType === 'edit') return 'Editar usuario';
15
+ modalTitle() {
16
+ if (this.type === 'new') return 'Nuevo usuario';
17
+ else if (this.type === 'edit') return 'Editar usuario';
18
18
  },
19
- oneCheck: function () {
19
+ oneCheck() {
20
20
  let final = '';
21
21
 
22
22
  if (this.content.edit.name.length < 4) {
@@ -29,18 +29,27 @@ Vue.component('modal-multicuentas', {
29
29
 
30
30
  return final;
31
31
  },
32
- finalCheck: function () {
33
- return JSON.stringify(this.content.current) !== JSON.stringify(this.content.edit);
32
+ finalCheck() {
33
+ const {
34
+ name: curName,
35
+ password: curPass
36
+ } = this.content.current;
37
+ const {
38
+ name: editName,
39
+ password: editPass
40
+ } = this.content.edit;
41
+
42
+ return curName !== editName || curPass !== editPass;
34
43
  }
35
44
  },
36
45
  methods: {
37
- modalClose: function () {
46
+ modalClose() {
38
47
  this.$parent.modal.type = 'new';
39
48
  this.$parent.modal.status = false;
40
49
  this.$parent.setEntry();
41
50
  this.$parent.forceRerender();
42
51
  },
43
- pushElement: function () {
52
+ pushElement() {
44
53
  if (this.$parent.modal.type === 'edit') {
45
54
  let id = this.$parent.content.accounts.edit.map((item) => {
46
55
  return item.id;
@@ -60,22 +69,22 @@ Vue.component('modal-multicuentas', {
60
69
  }
61
70
  },
62
71
  template: `
63
- <modal-foro :data-title="modalTitle" v-on:modal-close="modalClose()">
72
+ <modal-foro :title="modalTitle" @modal-close="modalClose()">
64
73
  <template slot="content">
65
74
  <aviso-foro v-show="oneCheck.length">
66
75
  <ul v-html="oneCheck"></ul>
67
76
  </aviso-foro>
68
77
  <ul class="forum-fieldlist no-style">
69
78
  <li>
70
- <campo-foro data-name="Nombre">
79
+ <campo-foro name="Nombre">
71
80
  <input type="text" v-model="content.edit.name" placeholder="Escribe el nombre de la cuenta." />
72
81
  </campo-foro>
73
82
  </li>
74
83
  <li>
75
- <campo-foro data-name="Contraseña">
84
+ <campo-foro name="Contraseña">
76
85
  <div class="character-selector">
77
86
  <input :type="content.edit.type" v-model="content.edit.password" placeholder="Escribe la contraseña de la cuenta." />
78
- <a class="character-custom" v-on:click="content.edit.type === 'text' ? content.edit.type = 'password' : content.edit.type = 'text'" title="Cambiar modo">
87
+ <a class="character-custom" @click="content.edit.type === 'text' ? content.edit.type = 'password' : content.edit.type = 'text'" title="Cambiar modo">
79
88
  <template v-if="content.edit.type === 'text'">
80
89
  <i class="fas fa-eye-slash"></i>
81
90
  </template>
@@ -90,7 +99,7 @@ Vue.component('modal-multicuentas', {
90
99
  </template>
91
100
  <template slot="controls">
92
101
  <controles-modal v-if="!oneCheck.length && finalCheck">
93
- <button class="button1 btn-main" v-on:click="pushElement()" title="Guardar entrada">Guardar</button>
102
+ <button class="button1 btn-main" @click="pushElement()" title="Guardar entrada">Guardar</button>
94
103
  </controles-modal>
95
104
  </template>
96
105
  </modal-foro>
@@ -98,7 +107,7 @@ Vue.component('modal-multicuentas', {
98
107
  });
99
108
 
100
109
  Vue.component('gestor-multicuentas', {
101
- data: function () {
110
+ data() {
102
111
  return {
103
112
  render: 0,
104
113
  modal: {
@@ -127,7 +136,7 @@ Vue.component('gestor-multicuentas', {
127
136
  }
128
137
  },
129
138
  computed: {
130
- msgCheck: function () {
139
+ msgCheck() {
131
140
  let final = '';
132
141
 
133
142
  if (this.content.password.value.length < 5) {
@@ -136,10 +145,10 @@ Vue.component('gestor-multicuentas', {
136
145
 
137
146
  return final;
138
147
  },
139
- finalCheck: function () {
148
+ finalCheck() {
140
149
  return JSON.stringify(this.content.accounts.current) !== JSON.stringify(this.content.accounts.edit);
141
150
  },
142
- sortedCharacters: function () {
151
+ sortedCharacters() {
143
152
  return this.content.accounts.edit.sort((a, b) => {
144
153
  if (a.name < b.name) return -1;
145
154
  else if (a.name > b.name) return 1;
@@ -148,16 +157,16 @@ Vue.component('gestor-multicuentas', {
148
157
  }
149
158
  },
150
159
  methods: {
151
- modalClose: function () {
160
+ modalClose() {
152
161
  this.state.page = 3;
153
162
  setTimeout(() => {
154
163
  window.location.reload();
155
164
  }, 2500);
156
165
  },
157
- forceRerender: function () {
166
+ forceRerender() {
158
167
  this.render += 1;
159
168
  },
160
- setEntry: function () {
169
+ setEntry() {
161
170
  this.entry = {
162
171
  name: '',
163
172
  id: '',
@@ -165,20 +174,20 @@ Vue.component('gestor-multicuentas', {
165
174
  password: ''
166
175
  };
167
176
  },
168
- addEntry: function (e) {
177
+ addEntry(e) {
169
178
  e.preventDefault();
170
179
 
171
180
  this.modal.status = true;
172
181
  },
173
- save: function (e) {
182
+ save(e) {
174
183
  e.preventDefault();
175
184
 
176
185
  this.updateData();
177
186
  },
178
- updateLocal: function () {
187
+ updateLocal() {
179
188
  this.updateData();
180
189
  },
181
- updateForum: function () {
190
+ updateForum() {
182
191
  this.content.accounts.edit = FNR.cache.getData('usermultiaccounts').map((item) => {
183
192
  return {
184
193
  name: item.name,
@@ -187,7 +196,7 @@ Vue.component('gestor-multicuentas', {
187
196
  });
188
197
  this.updateData();
189
198
  },
190
- setData: function () {
199
+ setData() {
191
200
  this.state.page = 3;
192
201
 
193
202
  FNR.cache.setData('userpassword', this.content.password.value, -1);
@@ -196,7 +205,7 @@ Vue.component('gestor-multicuentas', {
196
205
  window.location.reload();
197
206
  }, 2500);
198
207
  },
199
- updateData: function () {
208
+ updateData() {
200
209
  this.state.page = 3;
201
210
 
202
211
  const data = this.content.accounts.edit.map((item) => {
@@ -308,11 +317,12 @@ Vue.component('gestor-multicuentas', {
308
317
  <div class="is-content">
309
318
  <h2>Multicuentas</h2>
310
319
  <hr />
311
- <p>En esta página podrás configurar tu cambio de cuenta rápido. Experimenta con su funcionamiento, es bastante intuitivo.</p>
320
+ <p>En esta página podrás configurar tu cambio de cuenta rápido.</p>
321
+ <p>Ante cualquier duda o problema, contacta con la administración.</p>
312
322
  </div>
313
323
  <separador-foro />
314
324
  <template v-if="state.page === 0">
315
- <cargando-foro data-text="Cargando utilidad…"></cargando-foro>
325
+ <cargando-foro text="Cargando utilidad…"></cargando-foro>
316
326
  </template>
317
327
  <template v-else-if="state.page === 1">
318
328
  <aviso-foro v-show="msgCheck.length">
@@ -320,10 +330,10 @@ Vue.component('gestor-multicuentas', {
320
330
  </aviso-foro>
321
331
  <ul class="forum-fieldlist no-style">
322
332
  <li>
323
- <campo-foro data-name="Contraseña maestra">
333
+ <campo-foro name="Contraseña maestra">
324
334
  <div class="character-selector">
325
335
  <input :type="content.password.type" v-model="content.password.value" />
326
- <a class="character-custom" v-on:click="content.password.type === 'text' ? content.password.type = 'password' : content.password.type = 'text'" title="Cambiar modo">
336
+ <a class="character-custom" @click="content.password.type === 'text' ? content.password.type = 'password' : content.password.type = 'text'" title="Cambiar modo">
327
337
  <template v-if="content.password.type === 'text'">
328
338
  <i class="fas fa-eye-slash"></i>
329
339
  </template>
@@ -336,74 +346,74 @@ Vue.component('gestor-multicuentas', {
336
346
  </li>
337
347
  </ul>
338
348
  <div id="usereply-comand" v-if="!msgCheck.length">
339
- <button class="button1 btn-main" v-on:click="setData()">Guardar</button>
349
+ <button class="button1 btn-main" @click="setData()">Guardar</button>
340
350
  </div>
341
351
  </template>
342
352
  <template v-else-if="state.page === 2">
343
- <modal-multicuentas v-if="modal.status" :data-type="modal.type" :data-element="entry"></modal-multicuentas>
344
- <modal-foro v-if="modal.bonus" data-title="Atención" v-on:modal-close="modalClose()">
353
+ <modal-multicuentas v-if="modal.status" :type="modal.type" :element="entry"></modal-multicuentas>
354
+ <modal-foro v-if="modal.bonus" title="Atención" @modal-close="modalClose()">
345
355
  <template slot="content">
346
356
  <p>Hemos detectado que tienes dos versiones de tu base de datos de cuentas asociadas diferentes. Por favor, elige o actualizar la del dispositivo o la del foro.</p>
347
357
  </template>
348
358
  <template slot="controls">
349
359
  <controles-modal>
350
- <button class="button1 btn-main" v-on:click="updateForum()" title="Actualizar versión foro">Actualizar foro</button>
351
- <button class="button1" v-on:click="updateLocal()" title="Actualizar versión local">Actualizar local</button>
360
+ <button class="button1 btn-main" @click="updateForum()" title="Actualizar versión foro">Actualizar foro</button>
361
+ <button class="button1" @click="updateLocal()" title="Actualizar versión local">Actualizar local</button>
352
362
  </controles-modal>
353
363
  </template>
354
364
  </modal-foro>
355
- <mando-foro data-id="upper-controls" data-app="true">
365
+ <mando-foro id="upper-controls" app="true">
356
366
  <template slot="controls">
357
- <li v-on:click="addEntry($event)">
358
- <boton-foro data-url="#" data-name="Añadir" data-icon="fas fa-plus"></boton-foro>
367
+ <li @click="addEntry($event)">
368
+ <boton-foro url="#" name="Añadir" icon="fas fa-plus"></boton-foro>
359
369
  </li>
360
- <li v-if="finalCheck" v-on:click="save($event)">
361
- <boton-foro data-url="#" data-name="Guardar" data-icon="fas fa-save" data-type="no-name"></boton-foro>
370
+ <li v-if="finalCheck" @click="save($event)">
371
+ <boton-foro url="#" name="Guardar" icon="fas fa-save" type="no-name"></boton-foro>
362
372
  </li>
363
373
  </template>
364
374
  </mando-foro>
365
- <ul class="no-style" :key="render">
375
+ <ul :class="'no-style' + (!sortedCharacters.length ? ' no-results': '')" :key="render">
366
376
  <template v-if="!sortedCharacters.length">
367
- <li class="is-not-lastpost not-status">
377
+ <li class="is-not-topic is-not-lastpost">
368
378
  <h6>No hay cuentas configuradas</h6>
369
379
  </li>
370
380
  </template>
371
381
  <template v-else v-for="(item, index) in sortedCharacters">
372
- <elemento-multicuentas :data-element="item" :data-id="index" :key="index"></elemento-multicuentas>
382
+ <elemento-multicuentas :element="item" :id="index" :key="index"></elemento-multicuentas>
373
383
  </template>
374
384
  </ul>
375
- <mando-foro data-id="lower-controls" data-app="true">
385
+ <mando-foro id="lower-controls" app="true">
376
386
  <template slot="controls">
377
- <li v-on:click="addEntry($event)">
378
- <boton-foro data-url="#" data-name="Añadir" data-icon="fas fa-plus"></boton-foro>
387
+ <li @click="addEntry($event)">
388
+ <boton-foro url="#" name="Añadir" icon="fas fa-plus"></boton-foro>
379
389
  </li>
380
- <li v-if="finalCheck" v-on:click="save($event)">
381
- <boton-foro data-url="#" data-name="Guardar" data-icon="fas fa-save" data-type="no-name"></boton-foro>
390
+ <li v-if="finalCheck" @click="save($event)">
391
+ <boton-foro url="#" name="Guardar" icon="fas fa-save" type="no-name"></boton-foro>
382
392
  </li>
383
393
  </template>
384
394
  </mando-foro>
385
395
  </template>
386
396
  <template v-else-if="state.page === 3">
387
- <cargando-foro data-text="Actualizando información…"></cargando-foro>
397
+ <cargando-foro text="Actualizando información…"></cargando-foro>
388
398
  </template>
389
399
  </section>
390
400
  `
391
401
  });
392
402
 
393
403
  Vue.component('elemento-multicuentas', {
394
- props: ['dataElement', 'dataId'],
395
- data: function () {
404
+ props: ['element', 'id'],
405
+ data() {
396
406
  return {
397
- content: this.dataElement
407
+ content: this.element
398
408
  }
399
409
  },
400
410
  methods: {
401
- deleteElement: function () {
402
- this.$parent.content.accounts.edit.splice(this.dataId, 1);
411
+ deleteElement() {
412
+ this.$parent.content.accounts.edit.splice(this.id, 1);
403
413
 
404
414
  this.$parent.forceRerender();
405
415
  },
406
- editElement: function () {
416
+ editElement() {
407
417
  this.$parent.modal.type = 'edit';
408
418
  this.$parent.entry = this.content;
409
419
  this.$parent.modal.status = true;
@@ -411,11 +421,11 @@ Vue.component('elemento-multicuentas', {
411
421
  },
412
422
  template: `
413
423
  <li>
414
- <campo-foro :data-name="content.name">
424
+ <campo-foro :name="content.name">
415
425
  <div class="character-selector">
416
426
  <input :type="content.type" v-model="content.password" disabled/>
417
427
  <span class="character-custom rp-controls">
418
- <span v-on:click="editElement()" title="Editar entrada">Editar</span> / <span v-on:click="deleteElement()" title="Eliminar entrada">Eliminar</span>
428
+ <span @click="editElement()" title="Editar entrada">Editar</span> / <span @click="deleteElement()" title="Eliminar entrada">Eliminar</span>
419
429
  </span>
420
430
  </div>
421
431
  </campo-foro>