generic-skin 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/vueChrono.js +10 -10
- package/apps/vueChrono.min.js +1 -1
- package/apps/vueDefault.js +26 -26
- package/apps/vueDefault.min.js +4 -2
- package/apps/vueMulti.js +12 -12
- package/apps/vueMulti.min.js +1 -1
- package/apps/vueRela.js +15 -15
- package/apps/vueRela.min.js +1 -1
- package/config/vueComponents.js +93 -89
- package/config/vueComponents.min.js +4 -2
- package/options/noManagers.js +5 -5
- package/options/noManagers.min.js +1 -1
- package/package.json +1 -1
package/apps/vueDefault.min.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
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»" v-bind: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 v-bind: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 v-bind: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="" v-bind:data-url="draft.topic.url" v-bind:data-title="draft.topic.name" v-bind:data-replies="draft.info.location" v-bind:data-views="draft.info.date" v-bind:data-quick="draft.modify" />\n </li>\n </template>\n </ul>\n </section>\n </template>\n </section>\n '}),Vue.component("editor-foro",{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)},
|
|
2
|
-
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." v-bind: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)" v-bind: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)" v-bind: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()" v-bind:disabled="users.selected.length !== 0">\n <option value="-1" hidden>Selecciona un grupo.</option>\n <option v-for="option in groups.options" v-bind: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" v-bind: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" v-bind: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" v-bind: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 '});
|
|
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
|
+
});
|
package/apps/vueMulti.js
CHANGED
|
@@ -37,7 +37,7 @@ Vue.component('modal-multicuentas', {
|
|
|
37
37
|
modalClose: function () {
|
|
38
38
|
this.$parent.modal.type = 'new';
|
|
39
39
|
this.$parent.modal.status = false;
|
|
40
|
-
this.$parent.setEntry();
|
|
40
|
+
this.$parent.setEntry();
|
|
41
41
|
this.$parent.forceRerender();
|
|
42
42
|
},
|
|
43
43
|
pushElement: function () {
|
|
@@ -60,7 +60,7 @@ Vue.component('modal-multicuentas', {
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
template: `
|
|
63
|
-
<modal-foro
|
|
63
|
+
<modal-foro :data-title="modalTitle" v-on:modal-close="modalClose()">
|
|
64
64
|
<template slot="content">
|
|
65
65
|
<aviso-foro v-show="oneCheck.length">
|
|
66
66
|
<ul v-html="oneCheck"></ul>
|
|
@@ -74,7 +74,7 @@ Vue.component('modal-multicuentas', {
|
|
|
74
74
|
<li>
|
|
75
75
|
<campo-foro data-name="Contraseña">
|
|
76
76
|
<div class="character-selector">
|
|
77
|
-
<input
|
|
77
|
+
<input :type="content.edit.type" v-model="content.edit.password" placeholder="Escribe la contraseña de la cuenta." />
|
|
78
78
|
<a class="character-custom" v-on:click="content.edit.type === 'text' ? content.edit.type = 'password' : content.edit.type = 'text'" title="Cambiar modo">
|
|
79
79
|
<template v-if="content.edit.type === 'text'">
|
|
80
80
|
<i class="fas fa-eye-slash"></i>
|
|
@@ -217,7 +217,7 @@ Vue.component('gestor-multicuentas', {
|
|
|
217
217
|
accounts: data
|
|
218
218
|
}]).replace(/"/g, '`')
|
|
219
219
|
}]).then((r) => {
|
|
220
|
-
if (r) {
|
|
220
|
+
if (r) {
|
|
221
221
|
FNR.html.genNotification('Atención', 'Información actualizada sin inconvenientes.', 'fas fa-check');
|
|
222
222
|
|
|
223
223
|
setTimeout(() => {
|
|
@@ -254,7 +254,7 @@ Vue.component('gestor-multicuentas', {
|
|
|
254
254
|
if (!this.state.error) {
|
|
255
255
|
if (this.state.new && FNR.cache.getData('usermultiaccounts').length > 0) {
|
|
256
256
|
this.state.page = 3;
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
FNR.user.profile.setData([{
|
|
259
259
|
name: forumConfig.profileUser.accountsField,
|
|
260
260
|
type: 'textarea',
|
|
@@ -288,7 +288,7 @@ Vue.component('gestor-multicuentas', {
|
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
|
|
291
|
+
|
|
292
292
|
this.setEntry();
|
|
293
293
|
this.content.accounts.edit = data;
|
|
294
294
|
this.content.accounts.current = JSON.parse(JSON.stringify(data));
|
|
@@ -322,7 +322,7 @@ Vue.component('gestor-multicuentas', {
|
|
|
322
322
|
<li>
|
|
323
323
|
<campo-foro data-name="Contraseña maestra">
|
|
324
324
|
<div class="character-selector">
|
|
325
|
-
<input
|
|
325
|
+
<input :type="content.password.type" v-model="content.password.value" />
|
|
326
326
|
<a class="character-custom" v-on:click="content.password.type === 'text' ? content.password.type = 'password' : content.password.type = 'text'" title="Cambiar modo">
|
|
327
327
|
<template v-if="content.password.type === 'text'">
|
|
328
328
|
<i class="fas fa-eye-slash"></i>
|
|
@@ -340,7 +340,7 @@ Vue.component('gestor-multicuentas', {
|
|
|
340
340
|
</div>
|
|
341
341
|
</template>
|
|
342
342
|
<template v-else-if="state.page === 2">
|
|
343
|
-
<modal-multicuentas v-if="modal.status"
|
|
343
|
+
<modal-multicuentas v-if="modal.status" :data-type="modal.type" :data-element="entry"></modal-multicuentas>
|
|
344
344
|
<modal-foro v-if="modal.bonus" data-title="Atención" v-on:modal-close="modalClose()">
|
|
345
345
|
<template slot="content">
|
|
346
346
|
<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>
|
|
@@ -362,14 +362,14 @@ Vue.component('gestor-multicuentas', {
|
|
|
362
362
|
</li>
|
|
363
363
|
</template>
|
|
364
364
|
</mando-foro>
|
|
365
|
-
<ul class="no-style"
|
|
365
|
+
<ul class="no-style" :key="render">
|
|
366
366
|
<template v-if="!sortedCharacters.length">
|
|
367
367
|
<li class="is-not-lastpost not-status">
|
|
368
368
|
<h6>No hay cuentas configuradas</h6>
|
|
369
369
|
</li>
|
|
370
370
|
</template>
|
|
371
371
|
<template v-else v-for="(item, index) in sortedCharacters">
|
|
372
|
-
<elemento-multicuentas
|
|
372
|
+
<elemento-multicuentas :data-element="item" :data-id="index" :key="index"></elemento-multicuentas>
|
|
373
373
|
</template>
|
|
374
374
|
</ul>
|
|
375
375
|
<mando-foro data-id="lower-controls" data-app="true">
|
|
@@ -411,9 +411,9 @@ Vue.component('elemento-multicuentas', {
|
|
|
411
411
|
},
|
|
412
412
|
template: `
|
|
413
413
|
<li>
|
|
414
|
-
<campo-foro
|
|
414
|
+
<campo-foro :data-name="content.name">
|
|
415
415
|
<div class="character-selector">
|
|
416
|
-
<input
|
|
416
|
+
<input :type="content.type" v-model="content.password" disabled/>
|
|
417
417
|
<span class="character-custom rp-controls">
|
|
418
418
|
<span v-on:click="editElement()" title="Editar entrada">Editar</span> / <span v-on:click="deleteElement()" title="Eliminar entrada">Eliminar</span>
|
|
419
419
|
</span>
|
package/apps/vueMulti.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Vue.component("modal-multicuentas",{props:["dataElement","dataType"],data:function(){return{state:{modal:!1},content:{edit:JSON.parse(JSON.stringify(this.dataElement)),current:this.dataElement}}},computed:{modalTitle:function(){return"new"===this.dataType?"Nuevo usuario":"edit"===this.dataType?"Editar usuario":void 0},oneCheck:function(){let t="";return this.content.edit.name.length<4&&(t+="<li>Escribe el nombre de la cuenta.</li>"),this.content.edit.password.length<4&&(t+="<li>Escribe la contraseña de la cuenta.</li>"),t},finalCheck:function(){return JSON.stringify(this.content.current)!==JSON.stringify(this.content.edit)}},methods:{modalClose:function(){this.$parent.modal.type="new",this.$parent.modal.status=!1,this.$parent.setEntry(),this.$parent.forceRerender()},pushElement:function(){if("edit"===this.$parent.modal.type){let t=this.$parent.content.accounts.edit.map(t=>t.id).indexOf(this.content.current.id);this.$parent.content.accounts.edit.splice(t,1)}this.$parent.content.accounts.edit.push({name:this.content.edit.name,type:"password",id:FNR.utility.genSlug(this.content.edit.name),password:this.content.edit.password}),this.modalClose()}},template:'\n <modal-foro v-bind:data-title="modalTitle" v-on:modal-close="modalClose()">\n <template slot="content">\n <aviso-foro v-show="oneCheck.length">\n <ul v-html="oneCheck"></ul>\n </aviso-foro>\n <ul class="forum-fieldlist no-style">\n <li>\n <campo-foro data-name="Nombre">\n <input type="text" v-model="content.edit.name" placeholder="Escribe el nombre de la cuenta." />\n </campo-foro>\n </li>\n <li>\n <campo-foro data-name="Contraseña">\n <div class="character-selector">\n <input v-bind:type="content.edit.type" v-model="content.edit.password" placeholder="Escribe la contraseña de la cuenta." />\n <a class="character-custom" v-on:click="content.edit.type === \'text\' ? content.edit.type = \'password\' : content.edit.type = \'text\'" title="Cambiar modo">\n <template v-if="content.edit.type === \'text\'">\n <i class="fas fa-eye-slash"></i>\n </template>\n <template v-else-if="content.edit.type === \'password\'">\n <i class="fas fa-eye"></i>\n </template>\n </a>\n </div>\n </campo-foro>\n </li>\n </ul>\n </template>\n <template slot="controls">\n <controles-modal v-if="!oneCheck.length && finalCheck">\n <button class="button1 btn-main" v-on:click="pushElement()" title="Guardar entrada">Guardar</button>\n </controles-modal>\n </template>\n </modal-foro>\n '}),Vue.component("gestor-multicuentas",{data:function(){return{render:0,modal:{type:"new",status:!1,bonus:!1},state:{new:!1,error:!1,page:0,pagination:0},entry:{},content:{encrypted:{},password:{type:"password",value:""},accounts:{current:[],edit:[]}}}},computed:{msgCheck:function(){let t="";return this.content.password.value.length<5&&(t+="<li>Escribe la contraseña maestra.</li>"),t},finalCheck:function(){return JSON.stringify(this.content.accounts.current)!==JSON.stringify(this.content.accounts.edit)},sortedCharacters:function(){return this.content.accounts.edit.sort((t,e)=>t.name<e.name?-1:t.name>e.name?1:0)}},methods:{modalClose:function(){this.state.page=3,setTimeout(()=>{window.location.reload()},2500)},forceRerender:function(){this.render+=1},setEntry:function(){this.entry={name:"",id:"",type:"password",password:""}},addEntry:function(t){t.preventDefault(),this.modal.status=!0},save:function(t){t.preventDefault(),this.updateData()},updateLocal:function(){this.updateData()},updateForum:function(){this.content.accounts.edit=FNR.cache.getData("usermultiaccounts").map(t=>({name:t.name,password:sjcl.decrypt(this.content.password.value,t.password)})),this.updateData()},setData:function(){this.state.page=3,FNR.cache.setData("userpassword",this.content.password.value,-1),setTimeout(()=>{window.location.reload()},2500)},updateData:function(){this.state.page=3;const t=this.content.accounts.edit.map(t=>({name:t.name,password:sjcl.encrypt(this.content.password.value,t.password)}));FNR.cache.setData("userpassword",this.content.password.value,-1),FNR.cache.setData("usermultiaccounts",t,-1),FNR.user.profile.setData([{name:forumConfig.profileUser.accountsField,type:"textarea",value:JSON.stringify([{password:this.state.new?sjcl.encrypt(this.content.password.value,"gaylien_masterpass"):this.content.encrypted.password,accounts:t}]).replace(/"/g,"`")}]).then(t=>{t?(FNR.html.genNotification("Atención","Información actualizada sin inconvenientes.","fas fa-check"),setTimeout(()=>{window.location.reload()},2500)):FNR.html.genNotification("Atención","Hubo un problema al actualizar. Dale otro intento.","fas fa-exclamation")})}},created(){FNR.user.profile.getData([{name:forumConfig.profileUser.accountsField,type:"textarea"}]).then(t=>{if(this.content.encrypted=FNR.utility.genArray(t[0].value)[0],this.state.new=0===Object.keys(this.content.encrypted).length,FNR.cache.getData("userpassword"))try{sjcl.decrypt(FNR.cache.getData("userpassword"),this.content.encrypted.password)}catch(t){"ccm: tag doesn't match"===t.message&&(this.state.error=!0,FNR.cache.delData("userpassword"),setTimeout(()=>{window.location.reload()},2500))}finally{if(!this.state.error)if(this.state.new&&FNR.cache.getData("usermultiaccounts").length>0)this.state.page=3,FNR.user.profile.setData([{name:forumConfig.profileUser.accountsField,type:"textarea",value:JSON.stringify([{password:sjcl.encrypt(FNR.cache.getData("userpassword"),"gaylien_masterpass"),accounts:FNR.cache.getData("usermultiaccounts")}]).replace(/"/g,"`")}]).then(t=>{t?(FNR.html.genNotification("Atención","Información actualizada sin inconvenientes.","fas fa-check"),setTimeout(()=>{window.location.reload()},2500)):FNR.html.genNotification("Atención","Hubo un problema al actualizar. Dale otro intento.","fas fa-exclamation")});else{let t=[];this.content.password.value=FNR.cache.getData("userpassword"),this.state.new||(t=JSON.parse(JSON.stringify(this.content.encrypted)).accounts.map(t=>({name:t.name,type:"password",id:FNR.utility.genSlug(t.name),password:sjcl.decrypt(this.content.password.value,t.password)}))),this.setEntry(),this.content.accounts.edit=t,this.content.accounts.current=JSON.parse(JSON.stringify(t)),this.state.page=2,this.state.new||JSON.stringify(FNR.cache.getData("usermultiaccounts"))===JSON.stringify(this.content.encrypted.accounts)||(this.modal.bonus=!0)}}else this.state.page=1})},template:'\n <section id="forum-multiaccount" class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Multicuentas</h2>\n <hr />\n <p>En esta página podrás configurar tu cambio de cuenta rápido. Experimenta con su funcionamiento, es bastante intuitivo.</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="msgCheck.length">\n <ul v-html="msgCheck"></ul>\n </aviso-foro>\n <ul class="forum-fieldlist no-style">\n <li>\n <campo-foro data-name="Contraseña maestra">\n <div class="character-selector">\n <input v-bind:type="content.password.type" v-model="content.password.value" />\n <a class="character-custom" v-on:click="content.password.type === \'text\' ? content.password.type = \'password\' : content.password.type = \'text\'" title="Cambiar modo">\n <template v-if="content.password.type === \'text\'">\n <i class="fas fa-eye-slash"></i>\n </template>\n <template v-else-if="content.password.type === \'password\'">\n <i class="fas fa-eye"></i>\n </template>\n </a>\n </div>\n </campo-foro>\n </li>\n </ul>\n <div id="usereply-comand" v-if="!msgCheck.length">\n <button class="button1 btn-main" v-on:click="setData()">Guardar</button>\n </div>\n </template>\n <template v-else-if="state.page === 2">\n <modal-multicuentas v-if="modal.status" v-bind:data-type="modal.type" v-bind:data-element="entry"></modal-multicuentas>\n <modal-foro v-if="modal.bonus" data-title="Atención" v-on:modal-close="modalClose()">\n <template slot="content">\n <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>\n </template>\n <template slot="controls">\n <controles-modal>\n <button class="button1 btn-main" v-on:click="updateForum()" title="Actualizar versión foro">Actualizar foro</button>\n <button class="button1" v-on:click="updateLocal()" title="Actualizar versión local">Actualizar local</button>\n </controles-modal>\n </template>\n </modal-foro>\n <mando-foro data-id="upper-controls" data-app="true">\n <template slot="controls">\n <li v-on:click="addEntry($event)">\n <boton-foro data-url="#" data-name="Añadir" data-icon="fas fa-plus"></boton-foro>\n </li>\n <li v-if="finalCheck" v-on:click="save($event)">\n <boton-foro data-url="#" data-name="Guardar" data-icon="fas fa-save" data-type="no-name"></boton-foro>\n </li>\n </template>\n </mando-foro>\n <ul class="no-style" v-bind:key="render">\n <template v-if="!sortedCharacters.length">\n <li class="is-not-lastpost not-status">\n <h6>No hay cuentas configuradas</h6>\n </li>\n </template>\n <template v-else v-for="(item, index) in sortedCharacters">\n <elemento-multicuentas v-bind:data-element="item" v-bind:data-id="index" v-bind:key="index"></elemento-multicuentas>\n </template>\n </ul>\n <mando-foro data-id="lower-controls" data-app="true">\n <template slot="controls">\n <li v-on:click="addEntry($event)">\n <boton-foro data-url="#" data-name="Añadir" data-icon="fas fa-plus"></boton-foro>\n </li>\n <li v-if="finalCheck" v-on:click="save($event)">\n <boton-foro data-url="#" data-name="Guardar" data-icon="fas fa-save" data-type="no-name"></boton-foro>\n </li>\n </template>\n </mando-foro>\n </template>\n <template v-else-if="state.page === 3">\n <cargando-foro data-text="Actualizando información…"></cargando-foro>\n </template>\n </section>\n '}),Vue.component("elemento-multicuentas",{props:["dataElement","dataId"],data:function(){return{content:this.dataElement}},methods:{deleteElement:function(){this.$parent.content.accounts.edit.splice(this.dataId,1),this.$parent.forceRerender()},editElement:function(){this.$parent.modal.type="edit",this.$parent.entry=this.content,this.$parent.modal.status=!0}},template:'\n <li>\n <campo-foro v-bind:data-name="content.name">\n <div class="character-selector">\n <input v-bind:type="content.type" v-model="content.password" disabled/>\n <span class="character-custom rp-controls">\n <span v-on:click="editElement()" title="Editar entrada">Editar</span> / <span v-on:click="deleteElement()" title="Eliminar entrada">Eliminar</span>\n </span>\n </div>\n </campo-foro>\n </li>\n '});
|
|
1
|
+
Vue.component("modal-multicuentas", { props: ["dataElement", "dataType"], data: function () { return { state: { modal: !1 }, content: { edit: JSON.parse(JSON.stringify(this.dataElement)), current: this.dataElement } } }, computed: { modalTitle: function () { return "new" === this.dataType ? "Nuevo usuario" : "edit" === this.dataType ? "Editar usuario" : void 0 }, oneCheck: function () { let t = ""; return this.content.edit.name.length < 4 && (t += "<li>Escribe el nombre de la cuenta.</li>"), this.content.edit.password.length < 4 && (t += "<li>Escribe la contraseña de la cuenta.</li>"), t }, finalCheck: function () { return JSON.stringify(this.content.current) !== JSON.stringify(this.content.edit) } }, methods: { modalClose: function () { this.$parent.modal.type = "new", this.$parent.modal.status = !1, this.$parent.setEntry(), this.$parent.forceRerender() }, pushElement: function () { if ("edit" === this.$parent.modal.type) { let t = this.$parent.content.accounts.edit.map(t => t.id).indexOf(this.content.current.id); this.$parent.content.accounts.edit.splice(t, 1) } this.$parent.content.accounts.edit.push({ name: this.content.edit.name, type: "password", id: FNR.utility.genSlug(this.content.edit.name), password: this.content.edit.password }), this.modalClose() } }, template: '\n <modal-foro :data-title="modalTitle" v-on:modal-close="modalClose()">\n <template slot="content">\n <aviso-foro v-show="oneCheck.length">\n <ul v-html="oneCheck"></ul>\n </aviso-foro>\n <ul class="forum-fieldlist no-style">\n <li>\n <campo-foro data-name="Nombre">\n <input type="text" v-model="content.edit.name" placeholder="Escribe el nombre de la cuenta." />\n </campo-foro>\n </li>\n <li>\n <campo-foro data-name="Contraseña">\n <div class="character-selector">\n <input :type="content.edit.type" v-model="content.edit.password" placeholder="Escribe la contraseña de la cuenta." />\n <a class="character-custom" v-on:click="content.edit.type === \'text\' ? content.edit.type = \'password\' : content.edit.type = \'text\'" title="Cambiar modo">\n <template v-if="content.edit.type === \'text\'">\n <i class="fas fa-eye-slash"></i>\n </template>\n <template v-else-if="content.edit.type === \'password\'">\n <i class="fas fa-eye"></i>\n </template>\n </a>\n </div>\n </campo-foro>\n </li>\n </ul>\n </template>\n <template slot="controls">\n <controles-modal v-if="!oneCheck.length && finalCheck">\n <button class="button1 btn-main" v-on:click="pushElement()" title="Guardar entrada">Guardar</button>\n </controles-modal>\n </template>\n </modal-foro>\n ' }), Vue.component("gestor-multicuentas", { data: function () { return { render: 0, modal: { type: "new", status: !1, bonus: !1 }, state: { new: !1, error: !1, page: 0, pagination: 0 }, entry: {}, content: { encrypted: {}, password: { type: "password", value: "" }, accounts: { current: [], edit: [] } } } }, computed: { msgCheck: function () { let t = ""; return this.content.password.value.length < 5 && (t += "<li>Escribe la contraseña maestra.</li>"), t }, finalCheck: function () { return JSON.stringify(this.content.accounts.current) !== JSON.stringify(this.content.accounts.edit) }, sortedCharacters: function () { return this.content.accounts.edit.sort((t, e) => t.name < e.name ? -1 : t.name > e.name ? 1 : 0) } }, methods: { modalClose: function () { this.state.page = 3, setTimeout(() => { window.location.reload() }, 2500) }, forceRerender: function () { this.render += 1 }, setEntry: function () { this.entry = { name: "", id: "", type: "password", password: "" } }, addEntry: function (t) { t.preventDefault(), this.modal.status = !0 }, save: function (t) { t.preventDefault(), this.updateData() }, updateLocal: function () { this.updateData() }, updateForum: function () { this.content.accounts.edit = FNR.cache.getData("usermultiaccounts").map(t => ({ name: t.name, password: sjcl.decrypt(this.content.password.value, t.password) })), this.updateData() }, setData: function () { this.state.page = 3, FNR.cache.setData("userpassword", this.content.password.value, -1), setTimeout(() => { window.location.reload() }, 2500) }, updateData: function () { this.state.page = 3; const t = this.content.accounts.edit.map(t => ({ name: t.name, password: sjcl.encrypt(this.content.password.value, t.password) })); FNR.cache.setData("userpassword", this.content.password.value, -1), FNR.cache.setData("usermultiaccounts", t, -1), FNR.user.profile.setData([{ name: forumConfig.profileUser.accountsField, type: "textarea", value: JSON.stringify([{ password: this.state.new ? sjcl.encrypt(this.content.password.value, "gaylien_masterpass") : this.content.encrypted.password, accounts: t }]).replace(/"/g, "`") }]).then(t => { t ? (FNR.html.genNotification("Atención", "Información actualizada sin inconvenientes.", "fas fa-check"), setTimeout(() => { window.location.reload() }, 2500)) : FNR.html.genNotification("Atención", "Hubo un problema al actualizar. Dale otro intento.", "fas fa-exclamation") }) } }, created() { FNR.user.profile.getData([{ name: forumConfig.profileUser.accountsField, type: "textarea" }]).then(t => { if (this.content.encrypted = FNR.utility.genArray(t[0].value)[0], this.state.new = 0 === Object.keys(this.content.encrypted).length, FNR.cache.getData("userpassword")) try { sjcl.decrypt(FNR.cache.getData("userpassword"), this.content.encrypted.password) } catch (t) { "ccm: tag doesn't match" === t.message && (this.state.error = !0, FNR.cache.delData("userpassword"), setTimeout(() => { window.location.reload() }, 2500)) } finally { if (!this.state.error) if (this.state.new && FNR.cache.getData("usermultiaccounts").length > 0) this.state.page = 3, FNR.user.profile.setData([{ name: forumConfig.profileUser.accountsField, type: "textarea", value: JSON.stringify([{ password: sjcl.encrypt(FNR.cache.getData("userpassword"), "gaylien_masterpass"), accounts: FNR.cache.getData("usermultiaccounts") }]).replace(/"/g, "`") }]).then(t => { t ? (FNR.html.genNotification("Atención", "Información actualizada sin inconvenientes.", "fas fa-check"), setTimeout(() => { window.location.reload() }, 2500)) : FNR.html.genNotification("Atención", "Hubo un problema al actualizar. Dale otro intento.", "fas fa-exclamation") }); else { let t = []; this.content.password.value = FNR.cache.getData("userpassword"), this.state.new || (t = JSON.parse(JSON.stringify(this.content.encrypted)).accounts.map(t => ({ name: t.name, type: "password", id: FNR.utility.genSlug(t.name), password: sjcl.decrypt(this.content.password.value, t.password) }))), this.setEntry(), this.content.accounts.edit = t, this.content.accounts.current = JSON.parse(JSON.stringify(t)), this.state.page = 2, this.state.new || JSON.stringify(FNR.cache.getData("usermultiaccounts")) === JSON.stringify(this.content.encrypted.accounts) || (this.modal.bonus = !0) } } else this.state.page = 1 }) }, template: '\n <section id="forum-multiaccount" class="wiki-content is-dramatic">\n <div class="is-content">\n <h2>Multicuentas</h2>\n <hr />\n <p>En esta página podrás configurar tu cambio de cuenta rápido. Experimenta con su funcionamiento, es bastante intuitivo.</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="msgCheck.length">\n <ul v-html="msgCheck"></ul>\n </aviso-foro>\n <ul class="forum-fieldlist no-style">\n <li>\n <campo-foro data-name="Contraseña maestra">\n <div class="character-selector">\n <input :type="content.password.type" v-model="content.password.value" />\n <a class="character-custom" v-on:click="content.password.type === \'text\' ? content.password.type = \'password\' : content.password.type = \'text\'" title="Cambiar modo">\n <template v-if="content.password.type === \'text\'">\n <i class="fas fa-eye-slash"></i>\n </template>\n <template v-else-if="content.password.type === \'password\'">\n <i class="fas fa-eye"></i>\n </template>\n </a>\n </div>\n </campo-foro>\n </li>\n </ul>\n <div id="usereply-comand" v-if="!msgCheck.length">\n <button class="button1 btn-main" v-on:click="setData()">Guardar</button>\n </div>\n </template>\n <template v-else-if="state.page === 2">\n <modal-multicuentas v-if="modal.status" :data-type="modal.type" :data-element="entry"></modal-multicuentas>\n <modal-foro v-if="modal.bonus" data-title="Atención" v-on:modal-close="modalClose()">\n <template slot="content">\n <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>\n </template>\n <template slot="controls">\n <controles-modal>\n <button class="button1 btn-main" v-on:click="updateForum()" title="Actualizar versión foro">Actualizar foro</button>\n <button class="button1" v-on:click="updateLocal()" title="Actualizar versión local">Actualizar local</button>\n </controles-modal>\n </template>\n </modal-foro>\n <mando-foro data-id="upper-controls" data-app="true">\n <template slot="controls">\n <li v-on:click="addEntry($event)">\n <boton-foro data-url="#" data-name="Añadir" data-icon="fas fa-plus"></boton-foro>\n </li>\n <li v-if="finalCheck" v-on:click="save($event)">\n <boton-foro data-url="#" data-name="Guardar" data-icon="fas fa-save" data-type="no-name"></boton-foro>\n </li>\n </template>\n </mando-foro>\n <ul class="no-style" :key="render">\n <template v-if="!sortedCharacters.length">\n <li class="is-not-lastpost not-status">\n <h6>No hay cuentas configuradas</h6>\n </li>\n </template>\n <template v-else v-for="(item, index) in sortedCharacters">\n <elemento-multicuentas :data-element="item" :data-id="index" :key="index"></elemento-multicuentas>\n </template>\n </ul>\n <mando-foro data-id="lower-controls" data-app="true">\n <template slot="controls">\n <li v-on:click="addEntry($event)">\n <boton-foro data-url="#" data-name="Añadir" data-icon="fas fa-plus"></boton-foro>\n </li>\n <li v-if="finalCheck" v-on:click="save($event)">\n <boton-foro data-url="#" data-name="Guardar" data-icon="fas fa-save" data-type="no-name"></boton-foro>\n </li>\n </template>\n </mando-foro>\n </template>\n <template v-else-if="state.page === 3">\n <cargando-foro data-text="Actualizando información…"></cargando-foro>\n </template>\n </section>\n ' }), Vue.component("elemento-multicuentas", { props: ["dataElement", "dataId"], data: function () { return { content: this.dataElement } }, methods: { deleteElement: function () { this.$parent.content.accounts.edit.splice(this.dataId, 1), this.$parent.forceRerender() }, editElement: function () { this.$parent.modal.type = "edit", this.$parent.entry = this.content, this.$parent.modal.status = !0 } }, template: '\n <li>\n <campo-foro :data-name="content.name">\n <div class="character-selector">\n <input :type="content.type" v-model="content.password" disabled/>\n <span class="character-custom rp-controls">\n <span v-on:click="editElement()" title="Editar entrada">Editar</span> / <span v-on:click="deleteElement()" title="Eliminar entrada">Eliminar</span>\n </span>\n </div>\n </campo-foro>\n </li>\n ' });
|
package/apps/vueRela.js
CHANGED
|
@@ -89,7 +89,7 @@ Vue.component('modal-relaciones', {
|
|
|
89
89
|
}).indexOf(this.content.current.position), 1);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
let data = this.content.edit;
|
|
92
|
+
let data = this.content.edit;
|
|
93
93
|
|
|
94
94
|
if (this.$parent.modal.type === 'new') {
|
|
95
95
|
data.position = this.$parent.content.edit.length;
|
|
@@ -101,7 +101,7 @@ Vue.component('modal-relaciones', {
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
template: `
|
|
104
|
-
<modal-foro
|
|
104
|
+
<modal-foro :data-title="modalTitle" v-on:modal-close="modalClose()">
|
|
105
105
|
<template v-if="content.edit.type">
|
|
106
106
|
<template slot="content">
|
|
107
107
|
<aviso-foro v-show="oneCheck.length">
|
|
@@ -112,7 +112,7 @@ Vue.component('modal-relaciones', {
|
|
|
112
112
|
<campo-foro data-name="Nombre">
|
|
113
113
|
<div class="character-selector">
|
|
114
114
|
<input type="text" v-model="content.edit.name" placeholder="Escribe el nombre del personaje." disabled />
|
|
115
|
-
<a class="character-custom" v-on:click="updateData()"
|
|
115
|
+
<a class="character-custom" v-on:click="updateData()" :title="'Actualizar avatar de «' + content.current.name + '»'">
|
|
116
116
|
<i class="fas fa-redo-alt"></i>
|
|
117
117
|
</a>
|
|
118
118
|
</div>
|
|
@@ -145,7 +145,7 @@ Vue.component('modal-relaciones', {
|
|
|
145
145
|
<div class="character-selector">
|
|
146
146
|
<input type="text" v-model="content.edit.name" placeholder="Escribe el nombre del personaje." />
|
|
147
147
|
<ul class="no-style selector-list" v-if="sortedCharacters.length > 0">
|
|
148
|
-
<li v-for="(character, index) in sortedCharacters" v-on:click="addCharacter(character)"
|
|
148
|
+
<li v-for="(character, index) in sortedCharacters" v-on:click="addCharacter(character)" :title="'Seleccionar ' + character.user">{{ character.user }}<i class="fas fa-plus"></i></li>
|
|
149
149
|
</ul>
|
|
150
150
|
</div>
|
|
151
151
|
</campo-foro>
|
|
@@ -281,7 +281,7 @@ Vue.component('gestor-relaciones', {
|
|
|
281
281
|
type: 'textarea',
|
|
282
282
|
value: JSON.stringify(data).replace(/"/g, '`')
|
|
283
283
|
}]).then((r) => {
|
|
284
|
-
if (r) {
|
|
284
|
+
if (r) {
|
|
285
285
|
FNR.html.genNotification('Atención', 'Información actualizada sin inconvenientes.', 'fas fa-check');
|
|
286
286
|
|
|
287
287
|
setTimeout(() => {
|
|
@@ -328,7 +328,7 @@ Vue.component('gestor-relaciones', {
|
|
|
328
328
|
<cargando-foro data-text="Cargando utilidad…"></cargando-foro>
|
|
329
329
|
</template>
|
|
330
330
|
<template v-else-if="state.page === 1">
|
|
331
|
-
<modal-relaciones v-if="modal.status"
|
|
331
|
+
<modal-relaciones v-if="modal.status" :data-type="modal.type" :data-element="entry"></modal-relaciones>
|
|
332
332
|
<mando-foro data-id="upper-controls" data-app="true">
|
|
333
333
|
<template slot="pagination" v-if="paginationContent.pages.length > 1">
|
|
334
334
|
<a class="page-action" title="Ir a la página anterior" v-if="state.pagination > 0" v-on:click="state.pagination -= 1">
|
|
@@ -336,7 +336,7 @@ Vue.component('gestor-relaciones', {
|
|
|
336
336
|
</a>
|
|
337
337
|
<template v-for="page in paginationContent.pages">
|
|
338
338
|
<strong v-if="page === state.pagination">{{ page + 1 }}</strong>
|
|
339
|
-
<a class="page-link"
|
|
339
|
+
<a class="page-link" :title="'Ir a la página «' + (page + 1) + '»'" v-else v-on:click="state.pagination = page">{{ page + 1 }}</a>
|
|
340
340
|
</template>
|
|
341
341
|
<a class="page-action" title="Ir a la página siguiente" v-if="(state.pagination + 1) < paginationContent.pages.length" v-on:click="state.pagination += 1">
|
|
342
342
|
<i class="fas fa-chevron-right"></i>
|
|
@@ -351,14 +351,14 @@ Vue.component('gestor-relaciones', {
|
|
|
351
351
|
</li>
|
|
352
352
|
</template>
|
|
353
353
|
</mando-foro>
|
|
354
|
-
<ul id="forum-rplist" class="no-style"
|
|
354
|
+
<ul id="forum-rplist" class="no-style" :key="render">
|
|
355
355
|
<template v-if="!paginationContent.content.length">
|
|
356
356
|
<li class="is-not-lastpost not-status">
|
|
357
357
|
<h6>No hay entradas en tus relaciones</h6>
|
|
358
358
|
</li>
|
|
359
359
|
</template>
|
|
360
360
|
<template v-else v-for="character in paginationContent.content">
|
|
361
|
-
<elemento-relaciones
|
|
361
|
+
<elemento-relaciones :data-element="character" data-type="manager" :data-id="character.position" />
|
|
362
362
|
</template>
|
|
363
363
|
</ul>
|
|
364
364
|
<mando-foro data-id="lower-controls" data-app="true">
|
|
@@ -368,7 +368,7 @@ Vue.component('gestor-relaciones', {
|
|
|
368
368
|
</a>
|
|
369
369
|
<template v-for="page in paginationContent.pages">
|
|
370
370
|
<strong v-if="page === state.pagination">{{ page + 1 }}</strong>
|
|
371
|
-
<a class="page-link"
|
|
371
|
+
<a class="page-link" :title="'Ir a la página «' + (page + 1) + '»'" v-else v-on:click="state.pagination = page">{{ page + 1 }}</a>
|
|
372
372
|
</template>
|
|
373
373
|
<a class="page-action" title="Ir a la página siguiente" v-if="(state.pagination + 1) < paginationContent.pages.length" v-on:click="state.pagination += 1">
|
|
374
374
|
<i class="fas fa-chevron-right"></i>
|
|
@@ -423,10 +423,10 @@ Vue.component('elemento-relaciones', {
|
|
|
423
423
|
}
|
|
424
424
|
},
|
|
425
425
|
template: `
|
|
426
|
-
<li
|
|
426
|
+
<li :class="realClass">
|
|
427
427
|
<template v-if="dataType === 'manager'">
|
|
428
428
|
<a class="rela-element rela-manager">
|
|
429
|
-
<div class="rela-image"
|
|
429
|
+
<div class="rela-image" :style="'background-image: url(' + content.img + ')'"></div>
|
|
430
430
|
<div class="rela-content">
|
|
431
431
|
<div class="rela-title">
|
|
432
432
|
<h4>{{ content.name }}</h4>
|
|
@@ -438,8 +438,8 @@ Vue.component('elemento-relaciones', {
|
|
|
438
438
|
</template>
|
|
439
439
|
<template v-else-if="dataType === 'profile'">
|
|
440
440
|
<template v-if="content.type">
|
|
441
|
-
<a class="rela-element"
|
|
442
|
-
<div class="rela-image"
|
|
441
|
+
<a class="rela-element" :href="content.url" target="_blank" :title="'Ir al ' + profileName + ' de «' + content.name + '»'">
|
|
442
|
+
<div class="rela-image" :style="'background-image: url(' + content.img + ')'"></div>
|
|
443
443
|
<div class="rela-content">
|
|
444
444
|
<div class="rela-title">
|
|
445
445
|
<h4>{{ content.name }}</h4>
|
|
@@ -450,7 +450,7 @@ Vue.component('elemento-relaciones', {
|
|
|
450
450
|
</template>
|
|
451
451
|
<template v-else>
|
|
452
452
|
<a class="rela-element">
|
|
453
|
-
<div class="rela-image"
|
|
453
|
+
<div class="rela-image" :style="'background-image: url(' + content.img + ')'"></div>
|
|
454
454
|
<div class="rela-content">
|
|
455
455
|
<div class="rela-title">
|
|
456
456
|
<h4>{{ content.name }}</h4>
|