generic-skin 3.4.7 → 3.4.8
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/vueMulti.js +10 -1
- package/apps/vueMulti.min.js +1 -1
- package/package.json +1 -1
package/apps/vueMulti.js
CHANGED
|
@@ -30,7 +30,16 @@ Vue.component('modal-multicuentas', {
|
|
|
30
30
|
return final;
|
|
31
31
|
},
|
|
32
32
|
finalCheck() {
|
|
33
|
-
|
|
33
|
+
const {
|
|
34
|
+
name: curName,
|
|
35
|
+
password: curPass
|
|
36
|
+
} = this.content.current;
|
|
37
|
+
const {
|
|
38
|
+
name: editName,
|
|
39
|
+
password: editPass
|
|
40
|
+
} = this.content.edit;
|
|
41
|
+
|
|
42
|
+
return curName !== editName || curPass !== editPass;
|
|
34
43
|
}
|
|
35
44
|
},
|
|
36
45
|
methods: {
|
package/apps/vueMulti.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Vue.component("modal-multicuentas", { props: ["dataElement", "dataType"], data() { return { state: { modal: !1 }, content: { edit: JSON.parse(JSON.stringify(this.dataElement)), current: this.dataElement } } }, computed: { modalTitle() { return "new" === this.dataType ? "Nuevo usuario" : "edit" === this.dataType ? "Editar usuario" : void 0 }, oneCheck() { 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() { return JSON.stringify(this.content.current) !== JSON.stringify(this.content.edit) } }, methods: { modalClose() { this.$parent.modal.type = "new", this.$parent.modal.status = !1, this.$parent.setEntry(), this.$parent.forceRerender() }, pushElement() { 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" @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" @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" @click="pushElement()" title="Guardar entrada">Guardar</button>\n </controles-modal>\n </template>\n </modal-foro>\n ' }), Vue.component("gestor-multicuentas", { data() { 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() { let t = ""; return this.content.password.value.length < 5 && (t += "<li>Escribe la contraseña maestra.</li>"), t }, finalCheck() { return JSON.stringify(this.content.accounts.current) !== JSON.stringify(this.content.accounts.edit) }, sortedCharacters() { return this.content.accounts.edit.sort((t, e) => t.name < e.name ? -1 : t.name > e.name ? 1 : 0) } }, methods: { modalClose() { this.state.page = 3, setTimeout(() => { window.location.reload() }, 2500) }, forceRerender() { this.render += 1 }, setEntry() { this.entry = { name: "", id: "", type: "password", password: "" } }, addEntry: function (t) { t.preventDefault(), this.modal.status = !0 }, save: function (t) { t.preventDefault(), this.updateData() }, updateLocal() { this.updateData() }, updateForum() { 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() { this.state.page = 3, FNR.cache.setData("userpassword", this.content.password.value, -1), setTimeout(() => { window.location.reload() }, 2500) }, updateData() { 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" @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" @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" @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" @click="updateForum()" title="Actualizar versión foro">Actualizar foro</button>\n <button class="button1" @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 @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" @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 @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" @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() { return { content: this.dataElement } }, methods: { deleteElement() { this.$parent.content.accounts.edit.splice(this.dataId, 1), this.$parent.forceRerender() }, editElement() { 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 @click="editElement()" title="Editar entrada">Editar</span> / <span @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(){return{state:{modal:!1},content:{edit:JSON.parse(JSON.stringify(this.dataElement)),current:this.dataElement}}},computed:{modalTitle(){return"new"===this.dataType?"Nuevo usuario":"edit"===this.dataType?"Editar usuario":void 0},oneCheck(){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(){const{name:t,password:e}=this.content.current,{name:a,password:n}=this.content.edit;return t!==a||e!==n}},methods:{modalClose(){this.$parent.modal.type="new",this.$parent.modal.status=!1,this.$parent.setEntry(),this.$parent.forceRerender()},pushElement(){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" @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" @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" @click="pushElement()" title="Guardar entrada">Guardar</button>\n </controles-modal>\n </template>\n </modal-foro>\n '}),Vue.component("gestor-multicuentas",{data:()=>({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(){let t="";return this.content.password.value.length<5&&(t+="<li>Escribe la contraseña maestra.</li>"),t},finalCheck(){return JSON.stringify(this.content.accounts.current)!==JSON.stringify(this.content.accounts.edit)},sortedCharacters(){return this.content.accounts.edit.sort((t,e)=>t.name<e.name?-1:t.name>e.name?1:0)}},methods:{modalClose(){this.state.page=3,setTimeout(()=>{window.location.reload()},2500)},forceRerender(){this.render+=1},setEntry(){this.entry={name:"",id:"",type:"password",password:""}},addEntry:function(t){t.preventDefault(),this.modal.status=!0},save:function(t){t.preventDefault(),this.updateData()},updateLocal(){this.updateData()},updateForum(){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(){this.state.page=3,FNR.cache.setData("userpassword",this.content.password.value,-1),setTimeout(()=>{window.location.reload()},2500)},updateData(){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" @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" @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" @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" @click="updateForum()" title="Actualizar versión foro">Actualizar foro</button>\n <button class="button1" @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 @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" @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 @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" @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(){return{content:this.dataElement}},methods:{deleteElement(){this.$parent.content.accounts.edit.splice(this.dataId,1),this.$parent.forceRerender()},editElement(){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 @click="editElement()" title="Editar entrada">Editar</span> / <span @click="deleteElement()" title="Eliminar entrada">Eliminar</span>\n </span>\n </div>\n </campo-foro>\n </li>\n '});
|