kriptopter/app.html

128 lines
4.6 KiB
HTML

<title eo>Kriptopter</title>
<title en>Cryptopter</title>
<title fr>Cryptoptère</title>
<meta charset="utf8"/>
<style lang="eo,en,fr">
[_lang_] { display: none; }
:root[lang=_lang_] [_lang_] { display: inherit; }
:root[lang=_lang_] [_lang_\:title]:hover::after { display: inherit }
/* [_lang_\:title]:after {
display: none;
position: absolute;
background: grey;
border: 1px solid black;
color: white;
padding: .1em .3em;
margin-left: -5%;
}
:root[lang=_lang_] [_lang_\:title]:after { content: attr(_lang_\:title) } */
</style>
<link rel="stylesheet" href="./layout.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/solid.css" integrity="sha384-TbilV5Lbhlwdyc4RuIV/JhD8NR+BfMrvz4BL5QFa2we1hQu6wvREr3v6XSRfCTRp" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/regular.css" integrity="sha384-avJt9MoJH2rB4PKRsJRHZv7yiFZn8LrnXuzvmZoD3fh1aL6aM6s0BBcnCvBe6XSD" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/fontawesome.css" integrity="sha384-ozJwkrqb90Oa3ZNb+yKFW2lToAWYdTiF1vt8JiH5ptTGHTGcN7qdoR1F95e0kYyG" crossorigin="anonymous">
<menu>
<button select-get title="Get selected text on the page"
onclick="$text.value = CC.bin2buffer(getParentSelection())">
<i class="fas fa-align-left"></i>
<i class="fas fa-caret-down"></i>
</button>
<!-- <button point title="Point the element in the page (not available yet)"
disabled onclick="">
<i class="fas fa-mouse-pointer"></i>
</button> -->
<button page title="Load the whole page content"
onclick="$text.value = opener.document.body.textContent">
<i class="far fa-file"></i>
<i class="fas fa-caret-down"></i>
</button>
<button open title="Load a file from disk"
onclick="$`[type=file]`.click()">
<i class="far fa-folder-open"></i>
<input type="file" onchange="read(this.files[0]).then( a=> $text.value = a ); $filename.value = this.files[0].name"/>
</button>
<input filename type="text" eo:placeHolder="Filo nami" en:placeHolder="File name" fr:placeHolder="Nom du fichier"/>
<button save en:title="Save to disk" fr:title="Enregistrer sur le disque" eo:title="Sovargi al disko"
onclick="save($text.value,$filename.value||'krypta.krr').catch(bubbleOn(this))">
<i class="far fa-save"></i>
</button>
<button select-set en:title="Replace selected text on the page" fr:title="Remplacer la séléction" eo:title="Sovargi al disko"
onclick="setParentSelection( buffer2bin($text.value) )">
<i class="fas fa-align-left"></i>
<i class="fas fa-caret-up"></i>
</button>
</menu>
<ui-data bin></ui-data>
<button encrypt onclick="encrypt3($text.value).then(res=>$text.value=res,bubbleOn(this))">
<i class="far fa-file crypted" style="font-size: 1.5em">
<i class="fas fa-key" style=""></i>
</i>
<lang eo>cifri</lang>
<lang en>encrypt</lang>
<lang fr>chiffrer</lang>
</button>
<!-- <button sign onclick="sign($text.value).then(res=>$text.value=res,bubbleOn(this))"> -->
<!-- <i class="fas fa-file-contract"></i></button> -->
<pass>
<input type="text" placeholder="Enter a password"/>
<i class="far fa-eye-slash" onmouseover="$pass.classList.add('clear');this.classList.remove('fa-eye-slash');this.classList.add('fa-eye')"
onmouseout="$pass.classList.remove('clear');this.classList.add('fa-eye-slash');this.classList.remove('fa-eye')"></i>
</pass>
<button decrypt onclick="decrypt3($text.value).then(res=>$text.value=res,bubbleOn(this))">
<i class="fas fa-file crypted" style="font-size: 1.5em">
<i class="fas fa-key" style=""></i>
</i>
<lang eo>decifri</lang>
<lang en>decrypt</lang>
<lang fr>déchiffrer</lang>
</button>
<template ui-data>
<style>
textarea {
width: 100%;
height: 100%;
resize: none;
padding-bottom: 2em;
}
iframe {
width: 100%;
height: 100%;
border: 1px solid darkgrey;
display: none;
position: absolute;
top: 0;
box-sizing: border-box;
background: white;
}
:host-context([frame]) iframe { display: block; }
button {
position: relative;
top: -1.6em;
margin-right: -1px;
}
:host-context([bin]) [bin] { color: rebeccapurple }
:host-context([uint]) [uint] { color: rebeccapurple }
:host-context([utf8]) [utf8] { color: rebeccapurple }
:host-context([base64]) [base64] { color: rebeccapurple }
:host-context([frame]) [frame] { color: rebeccapurple }
</style>
<textarea></textarea>
<iframe></iframe>
</template>
<script ui src="./ui.js"></script>
<script lang src="./lang.js" lang="eo,en,fr"></script>
<script app src="./app.js"></script>