Style the lock context menu.

This commit is contained in:
Mega-Mewthree 2018-08-11 10:11:56 -07:00
parent 0ea0acfaa5
commit c122457565
2 changed files with 33 additions and 8 deletions

View File

@ -9,7 +9,7 @@
*/ */
<template> <template>
<div class="bd-e2eeTaContainer" @contextmenu.prevent="location.pathname.match(/\/channels\/@me\/\d+/) && $refs.ee2eContextMenu.open()"> <div class="bd-e2eeTaContainer" @contextmenu.prevent="location.pathname.match(/\/channels\/@me\/\d+/) && $refs.ee2eLockContextMenu.open()">
<div v-if="error" class="bd-e2eeTaBtn bd-e2eeLock bd-error"> <div v-if="error" class="bd-e2eeTaBtn bd-e2eeLock bd-error">
<MiLock v-tooltip="error" /> <MiLock v-tooltip="error" />
</div> </div>
@ -24,9 +24,9 @@
</div> </div>
<div class="bd-taDivider"></div> <div class="bd-taDivider"></div>
<context-menu id="context-menu" ref="ee2eContextMenu" v-if="location.pathname.match(/\/channels\/@me\/\d+/)"> <context-menu id="bd-e2eeLockContextMenu" class="bd-e2eeLockContextMenu" ref="ee2eLockContextMenu" v-if="location.pathname.match(/\/channels\/@me\/\d+/)">
<li @click="generatePublicKey()">Generate Public Key</li> <li class="bd-e2eeLockContextMenuOption" @click="generatePublicKey()">Generate Public Key</li>
<li @click="computeSharedSecret()">Receive Public Key</li> <li class="bd-e2eeLockContextMenuOption" @click="computeSharedSecret()">Receive Public Key</li>
</context-menu> </context-menu>
</div> </div>
</template> </template>
@ -48,10 +48,12 @@
} }
function computeSharedSecret() { function computeSharedSecret() {
const userID = location.pathname.split("/")[3]; try {
const otherPublicKey = document.getElementsByClassName("da-textArea")[0].value; const userID = location.pathname.split("/")[3];
const secret = E2EE.computeSecret(userID, otherPublicKey); const otherPublicKey = document.getElementsByClassName("da-textArea")[0].value;
clipboard.writeText(secret); const secret = E2EE.computeSecret(userID, otherPublicKey);
clipboard.writeText(secret);
} catch (e) {}
} }
export default { export default {

View File

@ -39,6 +39,29 @@
height: 37px; height: 37px;
margin-top: 5px; margin-top: 5px;
} }
.bd-e2eeLockContextMenu {
border: none;
.ctx-menu {
background: #23272A;
border-radius: 4px;
box-shadow: none;
padding: 0;
.bd-e2eeLockContextMenuOption {
background: #23272A;
color: #99AAB5;
padding: 5px 5px;
cursor: default;
&:hover {
background: #000000;
}
}
}
}
} }
.bd-e2eeMdContainer { .bd-e2eeMdContainer {