diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2fc4492..5750a31 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,10 @@ +#----v23.10.2----# +-Local notes are now also encrypted +-Better key management +-Improve shared notes +-Improve UI/UX +-Bug fixes + #----v23.10.1----# -Add public notes -Bug fixes for self-hosting diff --git a/README.md b/README.md index 81076fd..a24194d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

Bloc-notes

-Bloc-notes is a free, open source and encrypted notebook. Bloc-notes aims for security and privacy. +Bloc-notes is a free, open source and encrypted notebook.

@@ -25,30 +25,28 @@ * [For developers](#for-developers) ## Why? -When I was looking for a note-taking application, I faced several difficulties: Google Keep and OneNote don't respect privacy, Standard Notes and Obsidian can be light without having to pay (no Markdown or no Sync). So I decided to create my own notebook that respects users' privacy and GDPR. +When I was looking for a note-taking application, I faced several difficulties: Google Keep and OneNote don't respect privacy, Standard Notes and Obsidian can be light without having to pay (no Markdown or no Sync). So I decided to create my own notebook that respects users' privacy and easy to use. ## Features -The user can save and edit notes locally in JSON, change notes color, copy notes and use [Markdown](https://github.com/seguinleo/Bloc-notes/wiki/Markdown) to create titles, lists, links, todos or import images from another website. +All notes are encrypted with ``AES-256-GCM``. -The user can also sign in to sync all notes between their devices or browsers and encrypt content with ``AES-256-GCM`` in a database. The user can also hide the content of their notes. A button allows the user to make a note public and share it via a random URL. +The user can save and edit notes, change color, copy, export and use [Markdown](https://github.com/seguinleo/Bloc-notes/wiki/Markdown). -This website is a PWA (Progressive Web App), the user can install it as an application. Service Worker has automatic updates. Be sure to change the language before installing the application. +The user can also sign in to sync all notes between their devices or browsers in a database. The user can also make a note public and share it via a random URL. No email is required, only a username and a strong password. + +This website is a PWA (Progressive Web App), the user can install it as an application. Service Worker has automatic updates. ## Design -The website is fully responsible for mobile devices and UI/UX inspired by [Material Design v3](https://m3.material.io/). The icons come from [Fontawesome](https://github.com/FortAwesome/Font-Awesome). The website is also accessible for people with disabilities thanks to high-contrast colors, ARIA modules and focusable elements. A light/dark mode is also available with local storage. +The website is fully responsible for mobile devices. The icons come from [Fontawesome](https://github.com/FortAwesome/Font-Awesome). The website is also accessible for people with disabilities thanks to high-contrast colors, ARIA modules and focusable elements. A light/dark mode is also available. ## Security and Privacy -The user's connection is maintained by a secure cookie with a shelf life of 1 week. - -The website is hosted in France by OVHcloud on my personal server. The website is always up to date with the latest security patches. - -Passwords are hashed with bcrypt before being sent to the database. +The user's connection for online sync is maintained by a secure cookie with a shelf life of 1 week. The website is hosted in France by OVHcloud on my personal server. The website is always up to date with the latest security patches. -Each user has their own randomly generated 32-byte encryption key that uses SHA256 as the hash function and the randomly generated salt. Once logged in, the user can change their password or delete their account. Security measures are in place against XSS, CSRF and SQL injections. +Passwords are hashed with the latest algorithms before being sent to the database. -Bloc-notes stores the username, hashed password, and encrypted notes in a secure database until the user deletes this data themselves. Only the user has access to the content of their encrypted notes via their unique keys. The website editor disclaims any responsibility for the content of user notes. +Each user has their own randomly generated 32-byte encryption key and salt. Once logged in, the user can change their password or delete their account according to the GDPR. Security measures are in place against XSS, CSRF and SQL injections. -[Legal notice / Privacy policy](https://leoseguin.fr/mentionslegales/) +Bloc-notes stores the username, hashed password, and encrypted notes in a secure database until the user deletes this data themselves. Only the user has access to the content of their encrypted notes. The website editor disclaims any responsibility for the content of user notes. > [!WARNING] > Never store passwords or too personal data in your notes regardless of the service. @@ -57,9 +55,11 @@ Bloc-notes stores the username, hashed password, and encrypted notes in a secure 🇫🇷French, 🇬🇧English, 🇩🇪German ## Todo -- [x] Share notes with a random link +- [x] Share notes with a random link - [x] Export notes in text file -- [ ] Spanish translation +- [ ] Pin notes +- [ ] Spanish translation +- [ ] ... ## Community If you find [issues](https://github.com/seguinleo/Bloc-notes/issues), [vulnerabilities](https://github.com/seguinleo/Bloc-notes/security) or if you have any suggestions to improve this project, feel free to [discuss](https://github.com/seguinleo/Bloc-notes/discussions)! @@ -67,7 +67,7 @@ If you find [issues](https://github.com/seguinleo/Bloc-notes/issues), [vulnerabi ## For developers Documentation: [W3C](https://www.w3.org/), [MDN Web Docs](https://developer.mozilla.org/en-US/), [OWASP](https://cheatsheetseries.owasp.org/), [PHP Delusions](https://phpdelusions.net/) -Technologies: JavaScript, PHP PDO and MySQL +Technologies: JavaScript, PHP and MySQL Dependencies: ESLint, PHP_CodeSniffer, Sass and [Showdownjs](https://github.com/showdownjs/showdown) (modified) diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 58964f7..c8549a6 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -1 +1 @@ -@keyframes slide-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}html{scroll-behavior:smooth;-webkit-tap-highlight-color:rgba(0,0,0,0);scrollbar-width:thin;scrollbar-color:rgba(100,100,100,.5) rgba(0,0,0,0)}html ::-webkit-scrollbar-thumb{background:rgba(100,100,100,.5)}*{font-family:Arial,sans-serif;margin:0;box-sizing:border-box}::-webkit-scrollbar{width:5px;height:5px}h1{font-size:1.4rem}h2{font-size:1.2rem}h3{font-size:1.1rem}a{text-decoration:none;display:inline;word-wrap:break-word;font-weight:700}kbd{border-radius:5px;margin:0 2px;font-size:.8rem;font-weight:700;padding:2px 4px}header{padding:1rem}header .fa-xmark{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;transition:.1s}pre,code{background:#383a59;color:#8be9fd;border-radius:5px;padding:2px 5px;white-space:pre-wrap}li{margin-left:-1rem}img{max-width:100%;border-radius:1rem}nav{top:0;left:0;right:0;text-align:center;position:fixed;z-index:2;-webkit-user-select:none;user-select:none}nav h1{display:inline-block}nav div{margin:10px 2rem;display:inline-block;vertical-align:middle}nav button{width:200px}nav .search-input{width:300px;height:50px;border-radius:24px;display:inline-block}nav .search-input:focus-within{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.2)}nav .search-input ::placeholder{opacity:1}nav .search-input i{font-size:1rem;margin:0 5px}nav .search-input input{font-size:1rem;height:50px;width:180px;border:none;border-radius:24px;margin-right:5px;padding:0 10px}nav .search-input input:focus{outline:none}nav .search-input .gestionCompte,nav .search-input .seconnecter,nav .search-input .fa-bars{display:none;cursor:pointer}nav .lastSync{font-size:.8rem}nav .lastSync i{font-size:1rem;margin:0 5px;cursor:pointer}main{max-width:100vw;margin:6rem auto 2rem;padding:0 2rem 0 414px;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:2rem}.sideBar{position:fixed;-webkit-user-select:none;user-select:none;background:#272727;left:0;top:0;bottom:0;width:382px;padding:100px 1rem 1rem}.sideBar .listNotes{max-height:65vh;overflow-y:scroll}.sideBar header{display:none}.sideBar button{margin:1rem auto}.sideBar p{border-radius:5px;margin:10px 0;padding:4px;font-size:.8rem;cursor:pointer}.sideBar p .titleList{max-width:200px;overflow:hidden;display:inline-block;white-space:nowrap;font-weight:700}.sideBar p .dateList{display:inline;float:right}label{vertical-align:middle}input,textarea,select{height:50px;width:100%;font-size:1rem;padding:0 1rem}select,option{font-family:Arial,sans-serif}textarea{height:250px;min-height:200px;max-height:450px;resize:vertical;padding:10px}button{cursor:pointer;width:100%;height:50px;border:none;padding:0 1rem;font-size:1rem;border-radius:5px;transition:.1s}button:disabled{cursor:not-allowed}form{margin:1rem 0}p.welcome{font-size:1.2rem}p.welcome .nomUser{font-weight:700;font-style:italic}.note{position:relative;display:flex;flex-direction:column;justify-content:space-between;border-radius:1rem;clip-path:polygon(25px 0, 100% 0, 100% 100%, 0 100%, 0 25px);transition:clip-path .4s;width:400px;max-height:460px;line-height:2;padding:30px 20px 10px}.note:hover,.note:focus{clip-path:polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0)}.note:hover .bottom-content,.note:focus .bottom-content{visibility:visible;opacity:1}.note:after{position:absolute;content:"";top:0;left:0;width:25px;height:25px;border-radius:0 0 1rem;transition:transform .4s}.note:hover:after,.note:focus:after{transform:translate(-100%, -100%)}.note:focus-within .bottom-content{visibility:visible;opacity:1}.note .title{font-size:1.4rem;text-align:right;font-weight:700;margin:4px 10px 1rem}.note a{text-decoration:underline}.note a:hover{text-decoration:none}.note .details{max-height:400px;overflow-y:auto;overflow-wrap:break-word;overflow-x:hidden;padding-right:5px}.note .bottom-content{-webkit-user-select:none;user-select:none;margin-top:5px;text-align:center;opacity:0;visibility:hidden;transition:opacity .1s}.note .bottom-content:focus-within{opacity:1;visibility:visible}.note .bottom-content i{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin:0 4px;width:30px;height:30px;border-radius:50%;transition:.1s}.note .bottom-content span{font-size:.7rem;transition:.1s}.linkp{cursor:pointer;font-weight:700}.fullscreen{position:fixed;z-index:3;width:80vw;min-height:80vh;top:10%;left:0;right:0;margin:auto}.fullscreen .details{min-height:70vh}.noscroll{overflow:hidden}.darken{display:none;position:fixed;top:0;left:0;z-index:3;height:100%;width:100%;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.darken.show{display:block}.popup,header{display:flex;align-items:center;justify-content:space-between}.popup .content,input,textarea,select{border-radius:5px}.couleurs{display:flex;justify-content:center;min-height:30px}.couleurs span{width:20px;height:20px;margin:0 10px;border-radius:50%;cursor:pointer;transition:.1s}.couleurs span.selectionne{width:26px;height:26px}.connect-box,.connect-popup-box,.creer-box,.gestion-popup-box,.public-note-popup-box,.private-note-popup-box,.popup-box{display:none;pointer-events:none;position:fixed;top:0;left:0;z-index:2;height:100vh;width:100vw;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.connect-box .popup,.connect-popup-box .popup,.creer-box .popup,.gestion-popup-box .popup,.public-note-popup-box .popup,.private-note-popup-box .popup,.popup-box .popup{-webkit-user-select:none;user-select:none;position:absolute;top:50%;left:50%;z-index:3;overflow-y:auto;justify-content:center;transform:translate(-50%, -50%)}.connect-box.show,.connect-popup-box.show,.creer-box.show,.gestion-popup-box.show,.popup-box.show,.public-note-popup-box.show,.private-note-popup-box.show{display:flex;pointer-events:auto}.connect-box.show .popup,.connect-popup-box.show .popup,.creer-box.show .popup,.gestion-popup-box.show .popup,.popup-box.show .popup,.public-note-popup-box.show .popup,.private-note-popup-box.show .popup{display:flex;pointer-events:auto;max-height:100vh;transform:translate(-50%, -50%)}.content{width:600px;padding:5px 1rem}.row{margin-bottom:1rem}.switch{position:relative;margin-top:8px;display:inline-block;width:60px;height:2rem}.switch input{opacity:0;width:0;height:0}.switch input:checked+.slider:before{transform:translateX(26px)}.switch .slider{position:absolute;cursor:pointer;border-radius:2rem;inset:0}.switch .slider:before{position:absolute;content:"";border-radius:50%;height:26px;width:26px;left:4px;top:3px;box-shadow:1px 1px 3px rgba(0,0,0,.2);transition:.3s ease-in-out}.version{font-size:.8rem;margin:0 5px}.divLanguage .language{width:50px;padding:0}.copyright{position:absolute;bottom:1rem;font-size:.8rem}.gestion-popup-box.show .version{text-align:right}.check{position:relative;margin-left:-40px;width:32px;height:25px;vertical-align:middle;opacity:0}.check:checked+label svg g path{stroke-dashoffset:0}.path1{stroke-dasharray:400;stroke-dashoffset:400}#errorNotification{position:fixed;top:1rem;right:2rem;text-align:center;font-weight:700;max-width:300px;padding:10px;border-radius:5px;background:#a93b3b;color:#fff;display:none;z-index:999}#copyNotification{position:fixed;top:1rem;right:2rem;text-align:center;font-weight:700;max-width:125px;padding:10px;border-radius:5px;display:none;z-index:999}#copyNotification.show{display:block}#copyNoteLink{margin:auto;border-radius:20px;text-align:center;padding:10px;font-weight:700;cursor:pointer}#btnTheme{font-size:1.2rem;width:36px;height:36px;border-radius:48px;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:.1s}#btnTheme:focus{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.2)}.task-list-item{list-style-type:none;margin-left:-2rem}.task-list-item *{vertical-align:middle}@media(min-width: 901px){.iconFloat,.iconConnectFloat{display:none}}@media(max-width: 900px){body{min-height:100vh}nav{position:fixed;margin:0;background:none;box-shadow:none}nav div{margin:10px 0;display:block}nav button.seconnecter,nav .welcome{display:none}nav .icon,nav .iconConnect{position:absolute}nav .search-input{width:75%}nav .search-input input{width:60%;vertical-align:middle;padding:5px;margin:0 10px}nav .search-input .linkp{margin:0}nav .search-input .gestionCompte,nav .search-input .seconnecter,nav .search-input .fa-bars,nav .search-input .resync{display:inline;vertical-align:middle;cursor:pointer}nav .search-input i{font-size:1.1rem}nav .search-input .gestionCompte i,nav .search-input .seconnecter i{font-size:1.8rem;vertical-align:middle}nav .search-input .fa-magnifying-glass{display:none}nav .lastSync{display:none}main{padding:0 5px 5rem;gap:10px}.iconFloat,.iconConnectFloat{position:fixed;bottom:2rem;right:2rem;z-index:2}#iconButtonFloat,#iconButtonConnectFloat{width:60px;height:60px;font-size:1.4rem;border-radius:48px;display:flex;justify-content:center;align-items:center}kbd{display:none}.sideBar{display:none;width:90vw;padding:1rem;z-index:3}.sideBar .listNotes{margin-top:1rem}.sideBar header{display:flex}.sideBar button{display:none}.sideBar .titleList{max-width:140px}.sideBar.show{display:block;animation:slide-left .3s ease-in-out}textarea{height:30vh}.note{width:98%;max-height:300px}.note .details{overflow-y:hidden;max-height:75vh}.fullscreen{min-height:calc(100vh - 5rem);top:1rem}.fullscreen .details{overflow-y:auto}.couleurs span{margin:0 4px}.popup{max-width:98vw}.bottom-content i{margin:0 2px}.lastSync{display:inline-flex}.divTheme{display:inline;vertical-align:middle;margin-left:10px}.divTheme #btnTheme{display:inline-flex}#copyNotification.show{display:none}}html.dark{background:#171717;color:#c6c6c6;accent-color:#8ab4f8}html.dark a{color:#8ab4f8}html.dark kbd{background:#272727}html.dark header .fa-xmark:hover{background:rgba(255,255,255,.1)}html.dark nav{background:#272727}html.dark nav .search-input{background:#424242}html.dark nav .search-input ::placeholder{color:#c6c6c6}html.dark nav .search-input input{background:#424242}html.dark nav .search-input input:focus{outline:none}html.dark .sideBar{background:#272727}html.dark .sideBar p:hover,html.dark .sideBar p:focus{background:#424242}html.dark input,html.dark textarea,html.dark select{border:2px solid #424242}html.dark input:focus,html.dark textarea:focus,html.dark select:focus{outline:#8ab4f8 solid 2px}html.dark button{color:#171717;background:#8ab4f8}html.dark button:hover{background:#9ec3ff}html.dark button:disabled{background:#c6c6c6}html.dark .linkp{color:#8ab4f8}html.dark .popup .content,html.dark input,html.dark textarea,html.dark select{background:#272727;color:#c6c6c6}html.dark .couleurs span{border:1px solid #424242}html.dark .Blanc a,html.dark .Rouge a,html.dark .Orange a,html.dark .Jaune a,html.dark .Vert a,html.dark .Cyan a,html.dark .BleuCiel a,html.dark .Bleu a,html.dark .Violet a,html.dark .Rose a{color:#171717}html.dark .Noir a{color:#8ab4f8}html.dark .switch input:checked+.slider{background:#8ab4f8}html.dark .switch .slider{background:#424242}html.dark .switch .slider:before{background:#fff}html.dark .connect-box,html.dark .connect-popup-box,html.dark .creer-box,html.dark .gestion-popup-box,html.dark .popup-box,html.dark .private-note-popup-box,html.dark .public-note-popup-box,html.dark .darken{background:rgba(0,0,0,.5)}html.dark .supprimerCompte{color:#fe7575}html.dark #btnTheme{background:#424242;color:#c6c6c6}html.dark .divLanguage .language{border:none;background:#272727}html.dark #copyNotification{background:#424242;color:#c6c6c6}html.dark #copyNoteLink{background-color:#171717}html.dark #copyNoteLink:hover{background-color:#424242}@media(max-width: 900px){html.dark #iconButtonFloat,html.dark #iconButtonConnectFloat{box-shadow:1px 1px 6px rgba(0,0,0,.2)}html.dark .sideBar{background:#272727}html.dark .sideBar p:hover,html.dark .sideBar p:focus{background:#424242}}html.light{background:#fff;color:#272727;accent-color:#2b5790}html.light a{color:#2b5790}html.light kbd{background:#eee}html.light header .fa-xmark:hover{background:rgba(0,0,0,.2)}html.light input,html.light textarea,html.light select{border:2px solid #c6c6c6}html.light input:focus,html.light textarea:focus,html.light select:focus{outline:#2b5790 solid 2px}html.light nav{background:#eee}html.light nav .search-input{background:#fff}html.light nav .search-input ::placeholder{color:#272727}html.light nav .search-input input{background:#fff;border:none}html.light nav .search-input input:focus{outline:none}html.light .sideBar{background:#eee}html.light .sideBar p:hover,html.light .sideBar p:focus{background:#c6c6c6}html.light button{color:#fff;background:#2b5790}html.light button:hover{background:#34629f}html.light button:disabled{background:#c6c6c6;color:#171717}html.light .linkp{color:#2b5790}html.light .popup .content,html.light input,html.light textarea,html.light select{background:#fff;color:#272727}html.light .couleurs span{border:1px solid #c6c6c6}html.light .Blanc a,html.light .Rouge a,html.light .Orange a,html.light .Jaune a,html.light .Vert a,html.light .Cyan a,html.light .BleuCiel a,html.light .Bleu a,html.light .Violet a,html.light .Rose a{color:#171717}html.light .Noir{color:#c6c6c6}html.light .Noir a{color:#8ab4f8}html.light .switch input:checked+.slider{background:#2b5790}html.light .switch .slider{background:#c6c6c6}html.light .switch .slider:before{background:#fff}html.light .connect-box,html.light .connect-popup-box,html.light .creer-box,html.light .gestion-popup-box,html.light .popup-box,html.light .darken{background:rgba(200,200,200,.4)}html.light .supprimerCompte{color:#a93b3b}html.light #copyNotification{background:#c6c6c6;color:#272727}html.light #copyNoteLink{background-color:#eee}html.light #copyNoteLink:hover{background-color:#c6c6c6}html.light #btnTheme{background:#fff;color:#272727}html.light .divLanguage .language{border:none;background:none}@media(max-width: 900px){html.light #iconButtonFloat,html.light #iconButtonConnectFloat{box-shadow:1px 1px 6px rgba(0,0,0,.2)}html.light .sideBar{background:#eee}html.light .sideBar p:hover,html.light .sideBar p:focus{background:#c6c6c6}}.note{background:#272727}.note:after{box-shadow:2px 2px 2px rgba(0,0,0,.2)}.Noir{background:#272727}.Blanc{background:#eee}.Rouge{background:#ff7b7b}.Orange{background:#ff9b4f}.Jaune{background:#ffea64}.Vert{background:#89f17e}.Cyan{background:#7cffe7}.BleuCiel{background:#a0deff}.Bleu{background:#72a5e9}.Violet{background:#a99aff}.Rose{background:#ffa2ff}.Blanc,.Rouge,.Orange,.Jaune,.Vert,.Cyan,.BleuCiel,.Bleu,.Violet,.Rose{color:#171717}.Blanc ::selection,.Rouge ::selection,.Orange ::selection,.Jaune ::selection,.Vert ::selection,.Cyan ::selection,.BleuCiel ::selection,.Bleu ::selection,.Violet ::selection,.Rose ::selection{background:rgba(0,0,0,.2)}.Blanc .bottom-content i:hover,.Rouge .bottom-content i:hover,.Orange .bottom-content i:hover,.Jaune .bottom-content i:hover,.Vert .bottom-content i:hover,.Cyan .bottom-content i:hover,.BleuCiel .bottom-content i:hover,.Bleu .bottom-content i:hover,.Violet .bottom-content i:hover,.Rose .bottom-content i:hover{background:rgba(0,0,0,.1)}.Blanc .bottom-content i:active,.Rouge .bottom-content i:active,.Orange .bottom-content i:active,.Jaune .bottom-content i:active,.Vert .bottom-content i:active,.Cyan .bottom-content i:active,.BleuCiel .bottom-content i:active,.Bleu .bottom-content i:active,.Violet .bottom-content i:active,.Rose .bottom-content i:active{background:rgba(0,0,0,.2)}.Noir ::selection{background:rgba(255,255,255,.2)}.Noir .bottom-content span{color:#c6c6c6}.Noir .bottom-content i{color:#c6c6c6}.Noir .bottom-content i:hover{background:rgba(255,255,255,.1)}.Noir .bottom-content i:active{background:rgba(255,255,255,.2)}/*# sourceMappingURL=style.css.map */ +@keyframes slide-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}html{scroll-behavior:smooth;-webkit-tap-highlight-color:rgba(0,0,0,0);scrollbar-width:thin;scrollbar-color:rgba(100,100,100,.5) rgba(0,0,0,0);font-family:Arial,sans-serif}html ::-webkit-scrollbar-thumb{background:rgba(100,100,100,.5)}*{margin:0;box-sizing:border-box}::-webkit-scrollbar{width:5px;height:5px}h1{font-size:1.4rem}h2{font-size:1.2rem}h3{font-size:1.1rem}a{text-decoration:none;display:inline;word-wrap:break-word;font-weight:700}kbd{border-radius:5px;margin:0 2px;font-size:.8rem;font-weight:700;padding:2px 4px}header{padding:1rem}header .fa-xmark{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;transition:.1s}pre,code{background:#383a59;color:#8be9fd;border-radius:5px;padding:2px 5px;white-space:pre-wrap}li{margin-left:-1rem;word-break:break-word}img{max-width:100%;border-radius:1rem}nav{top:0;left:0;right:0;text-align:center;position:fixed;z-index:2;-webkit-user-select:none;user-select:none}nav h1{display:inline-block}nav h1 i{font-size:2rem}nav div{margin:10px 2rem;display:inline-block;vertical-align:middle}nav button{width:200px}nav .search-input{width:300px;height:50px;border-radius:24px;display:inline-block}nav .search-input:focus-within{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.2)}nav .search-input ::placeholder{opacity:1}nav .search-input i{font-size:1rem;margin:0 5px}nav .search-input input{width:180px;border:none;border-radius:24px;margin-right:5px;padding:0 10px}nav .search-input input:focus{outline:none}nav .search-input .gestionCompte,nav .search-input .seconnecter,nav .search-input .fa-bars{display:none;cursor:pointer}nav .lastSync{font-size:.8rem}nav .lastSync i{font-size:1rem;margin:0 5px;cursor:pointer}main{max-width:100vw;margin:6rem auto 2rem;padding:0 2rem 0 414px;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:2rem}.sideBar{position:fixed;-webkit-user-select:none;user-select:none;background:#272727;left:0;top:0;bottom:0;width:382px;padding:100px 1rem 1rem}.sideBar .listNotes{max-height:65vh;overflow-y:scroll}.sideBar header{display:none}.sideBar button{margin:1rem auto}.sideBar p{border-radius:5px;margin:10px 0;padding:4px;font-size:.8rem;cursor:pointer}.sideBar p .titleList{max-width:200px;overflow:hidden;display:inline-block;white-space:nowrap;font-weight:700;vertical-align:bottom;margin-right:5px}.sideBar p .dateList{display:inline;float:right}input{font-family:OpenSans,sans-serif}input[type=checkbox]{width:20px;height:20px;margin:0 5px}input,select{height:50px;width:100%;font-size:1rem;padding:0 1rem}select,option{font-family:Arial,sans-serif}textarea{font-family:OpenSans,sans-serif;font-size:1rem;height:250px;width:100%;min-height:200px;max-height:450px;resize:vertical;padding:10px}button{font-family:OpenSans,sans-serif;font-size:1rem;cursor:pointer;width:100%;height:50px;border:none;padding:0 1rem;border-radius:5px;transition:.1s}button:disabled{cursor:not-allowed}form{margin:10px 0}p.welcome{font-size:1.2rem}p.welcome .nomUser{font-weight:700;font-style:italic}.note{position:relative;display:flex;flex-direction:column;justify-content:space-between;border-radius:10px;clip-path:polygon(25px 0, 100% 0, 100% 100%, 0 100%, 0 25px);transition:clip-path .4s;width:400px;max-height:460px;line-height:2;padding:15px 15px 10px}.note:hover,.note:focus{clip-path:polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0)}.note:hover .bottom-content,.note:focus .bottom-content{visibility:visible;opacity:1}.note:after{position:absolute;content:"";top:0;left:0;width:25px;height:25px;border-radius:0 0 1rem;transition:transform .4s}.note:hover:after,.note:focus:after{transform:translate(-100%, -100%)}.note:focus-within .bottom-content{visibility:visible;opacity:1}.note .title{font-size:1.4rem;text-align:right;font-weight:700;margin:4px 10px 1rem}.note a{text-decoration:underline}.note a:hover{text-decoration:none}.note .details{max-height:400px;overflow-y:auto;overflow-wrap:break-word;overflow-x:hidden;padding-right:5px}.note .bottom-content{-webkit-user-select:none;user-select:none;margin-top:5px;text-align:center;opacity:0;visibility:hidden;transition:opacity .1s}.note .bottom-content:focus-within{opacity:1;visibility:visible}.note .bottom-content i{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;width:30px;height:30px;border-radius:50%;transition:.1s}.linkp{cursor:pointer;font-weight:700}.fullscreen{position:fixed;z-index:3;width:80vw;min-height:80vh;margin:auto;inset:0}.fullscreen .details{max-height:100%}.noscroll{overflow:hidden}.popup,header{display:flex;align-items:center;justify-content:space-between}.popup .content,input,textarea,select{border-radius:5px}.couleurs{display:flex;justify-content:center;min-height:30px}.couleurs span{width:20px;height:20px;margin:0 10px;border-radius:50%;cursor:pointer;transition:.1s}.couleurs span.selectionne{width:26px;height:26px}.connect-box,.creer-box,.gestion-popup-box,.public-note-popup-box,.private-note-popup-box,.note-popup-box{display:none;pointer-events:none;position:fixed;top:0;left:0;z-index:2;height:100vh;width:100vw;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.connect-box .popup,.creer-box .popup,.gestion-popup-box .popup,.public-note-popup-box .popup,.private-note-popup-box .popup,.note-popup-box .popup{-webkit-user-select:none;user-select:none;position:absolute;top:50%;left:50%;z-index:3;overflow-y:auto;justify-content:center;transform:translate(-50%, -50%)}.connect-box.show,.creer-box.show,.gestion-popup-box.show,.note-popup-box.show,.public-note-popup-box.show,.private-note-popup-box.show{display:flex;pointer-events:auto}.connect-box.show .popup,.creer-box.show .popup,.gestion-popup-box.show .popup,.note-popup-box.show .popup,.public-note-popup-box.show .popup,.private-note-popup-box.show .popup{display:flex;pointer-events:auto;max-height:100vh;transform:translate(-50%, -50%)}.content{width:600px;padding:5px 1rem}.row{margin-bottom:1rem}.switch{position:relative;margin-top:8px;display:inline-block;width:60px;height:2rem}.switch input{opacity:0;width:0;height:0}.switch input:checked+.slider:before{transform:translateX(26px)}.switch .slider{position:absolute;cursor:pointer;border-radius:2rem;inset:0}.switch .slider:before{position:absolute;content:"";border-radius:50%;height:26px;width:26px;left:4px;top:3px;box-shadow:1px 1px 3px rgba(0,0,0,.2);transition:.3s ease-in-out}.version{font-size:.8rem;margin:0 5px}#language{width:50px;padding:0}.copyright{position:absolute;bottom:1rem;font-size:.8rem}.gestion-popup-box.show .version{text-align:right}#errorNotification{position:fixed;top:1rem;right:2rem;text-align:center;font-weight:700;max-width:300px;padding:10px;border-radius:5px;background:#a93b3b;color:#fff;display:none;z-index:999}#copyNotification{position:fixed;top:1rem;right:2rem;text-align:center;font-weight:700;max-width:125px;padding:10px;border-radius:5px;display:none;z-index:999}#copyNotification.show{display:block}#copyNoteLink{margin:auto;border-radius:20px;text-align:center;padding:10px;font-weight:700;cursor:pointer}#btnTheme{font-size:1.2rem;width:36px;height:36px;border-radius:48px;border:none;display:flex;justify-content:center;align-items:center;cursor:pointer;transition:.1s}#btnTheme:focus{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 2px 6px 0 rgba(0,0,0,.2)}.task-list-item{list-style-type:none;margin-left:-2rem}@media(min-width: 901px){.iconFloat,.iconConnectFloat{display:none}}@media(max-width: 900px){body{min-height:100vh}nav{position:fixed;margin:0;background:none;box-shadow:none}nav div{margin:10px 0;display:block}nav button.seconnecter,nav .welcome{display:none}nav .icon,nav .iconConnect{position:absolute}nav .search-input{width:75%}nav .search-input input{width:60%;padding:5px}nav .search-input .linkp{margin:0}nav .search-input .gestionCompte,nav .search-input .seconnecter,nav .search-input .fa-bars{display:inline;cursor:pointer}nav .search-input i{vertical-align:middle;font-size:1.8rem}nav .search-input .fa-bars{font-size:1.2rem}nav .search-input .fa-magnifying-glass{display:none}nav .lastSync{display:none}main{padding:0 0 5rem;gap:10px}.iconFloat,.iconConnectFloat{position:fixed;bottom:2rem;right:2rem;z-index:2}#iconButtonFloat,#iconButtonConnectFloat{width:60px;height:60px;font-size:1.4rem;border-radius:48px;display:flex;justify-content:center;align-items:center}kbd{display:none}.sideBar{display:none;width:90vw;padding:1rem;z-index:3}.sideBar .listNotes{margin-top:1rem}.sideBar header{display:flex}.sideBar button{display:none}.sideBar .titleList{max-width:140px}.sideBar.show{display:block;animation:slide-left .3s ease-in-out}textarea{height:30vh}.note{width:100%;max-height:300px;margin:0 10px}.note .bottom-content{visibility:visible;opacity:1}.note .title{font-size:1.1rem}.note .details{overflow:hidden;font-size:.9rem}.fullscreen{min-height:100dvh;inset:auto;top:0}.fullscreen .details{overflow:auto}.couleurs span{margin:0 4px}.popup{max-width:98vw}.bottom-content i{margin:0 2px}.lastSync{display:inline-flex}.divTheme{display:inline;vertical-align:middle;margin-left:10px}.divTheme #btnTheme{display:inline-flex}#copyNotification.show{display:none}}html.dark{background:#171717;color:#c6c6c6;accent-color:#8ab4f8}html.dark a{color:#8ab4f8}html.dark kbd{background:#272727}html.dark header .fa-xmark:hover{background:rgba(255,255,255,.1)}html.dark nav{background:#272727}html.dark nav .search-input{background:#171717}html.dark nav .search-input ::placeholder{color:#c6c6c6}html.dark nav .search-input input{background:#171717;border:none}html.dark nav .search-input input:focus{outline:none}html.dark .sideBar{background:#272727}html.dark .sideBar p:hover,html.dark .sideBar p:focus{background:#424242}html.dark input,html.dark textarea,html.dark select{border:2px solid #424242}html.dark input:focus,html.dark textarea:focus,html.dark select:focus{outline:#8ab4f8 solid 2px}html.dark button{color:#171717;background:#8ab4f8}html.dark button:hover{background:#9ec3ff}html.dark button:disabled{background:#c6c6c6}html.dark .linkp{color:#8ab4f8}html.dark .popup .content,html.dark input,html.dark textarea,html.dark select{background:#272727;color:#c6c6c6}html.dark .couleurs span{border:1px solid #424242}html.dark .Blanc a,html.dark .Rouge a,html.dark .Orange a,html.dark .Jaune a,html.dark .Vert a,html.dark .Cyan a,html.dark .BleuCiel a,html.dark .Bleu a,html.dark .Violet a,html.dark .Rose a{color:#171717}html.dark .Noir a{color:#8ab4f8}html.dark .switch input:checked+.slider{background:#8ab4f8}html.dark .switch .slider{background:#424242}html.dark .switch .slider:before{background:#fff}html.dark .note-popup-box,html.dark .creer-box,html.dark .gestion-popup-box,html.dark .popup-box,html.dark .private-note-popup-box,html.dark .public-note-popup-box{background:rgba(0,0,0,.5)}html.dark .supprimerCompte{color:#fe7575}html.dark #btnTheme{background:#171717;color:#c6c6c6}html.dark #language{border:none;background:#272727}html.dark #copyNotification{background:#424242;color:#c6c6c6}html.dark #copyNoteLink{background-color:#171717}html.dark #copyNoteLink:hover{background-color:#424242}@media(max-width: 900px){html.dark #iconButtonFloat,html.dark #iconButtonConnectFloat{box-shadow:1px 1px 6px rgba(0,0,0,.2)}html.dark .sideBar{background:#272727}html.dark .sideBar p:hover,html.dark .sideBar p:focus{background:#424242}}html.light{background:#fff;color:#272727;accent-color:#2b5790}html.light a{color:#2b5790}html.light kbd{background:#eee}html.light header .fa-xmark:hover{background:rgba(0,0,0,.2)}html.light input,html.light textarea,html.light select{border:2px solid #c6c6c6}html.light input:focus,html.light textarea:focus,html.light select:focus{outline:#2b5790 solid 2px}html.light nav{background:#eee}html.light nav .search-input{background:#fff}html.light nav .search-input ::placeholder{color:#272727}html.light nav .search-input input{background:#fff;border:none}html.light nav .search-input input:focus{outline:none}html.light .sideBar{background:#eee}html.light .sideBar p:hover,html.light .sideBar p:focus{background:#c6c6c6}html.light button{color:#fff;background:#2b5790}html.light button:hover{background:#34629f}html.light button:disabled{background:#c6c6c6;color:#171717}html.light .linkp{color:#2b5790}html.light .popup .content,html.light input,html.light textarea,html.light select{background:#fff;color:#272727}html.light .couleurs span{border:1px solid #c6c6c6}html.light .Blanc a,html.light .Rouge a,html.light .Orange a,html.light .Jaune a,html.light .Vert a,html.light .Cyan a,html.light .BleuCiel a,html.light .Bleu a,html.light .Violet a,html.light .Rose a{color:#171717}html.light .Noir{color:#c6c6c6}html.light .Noir a{color:#8ab4f8}html.light .switch input:checked+.slider{background:#2b5790}html.light .switch .slider{background:#c6c6c6}html.light .switch .slider:before{background:#fff}html.light .note-popup-box,html.light .creer-box,html.light .gestion-popup-box,html.light .popup-box,html.light .private-note-popup-box,html.light .public-note-popup-box{background:rgba(200,200,200,.4)}html.light .supprimerCompte{color:#a93b3b}html.light #copyNotification{background:#c6c6c6;color:#272727}html.light #copyNoteLink{background-color:#eee}html.light #copyNoteLink:hover{background-color:#c6c6c6}html.light #btnTheme{background:#fff;color:#272727}html.light #language{border:none;background:none}@media(max-width: 900px){html.light #iconButtonFloat,html.light #iconButtonConnectFloat{box-shadow:1px 1px 6px rgba(0,0,0,.2)}html.light .sideBar{background:#eee}html.light .sideBar p:hover,html.light .sideBar p:focus{background:#c6c6c6}}.note{background:#272727}.note:after{box-shadow:2px 2px 2px rgba(0,0,0,.2)}.Noir{background:#272727}.Blanc{background:#eee}.Rouge{background:#ff7b7b}.Orange{background:#ff9b4f}.Jaune{background:#ffea64}.Vert{background:#89f17e}.Cyan{background:#7cffe7}.BleuCiel{background:#a0deff}.Bleu{background:#72a5e9}.Violet{background:#a99aff}.Rose{background:#ffa2ff}.Blanc,.Rouge,.Orange,.Jaune,.Vert,.Cyan,.BleuCiel,.Bleu,.Violet,.Rose{color:#171717}.Blanc ::selection,.Rouge ::selection,.Orange ::selection,.Jaune ::selection,.Vert ::selection,.Cyan ::selection,.BleuCiel ::selection,.Bleu ::selection,.Violet ::selection,.Rose ::selection{background:rgba(0,0,0,.2)}.Blanc .bottom-content i:hover,.Rouge .bottom-content i:hover,.Orange .bottom-content i:hover,.Jaune .bottom-content i:hover,.Vert .bottom-content i:hover,.Cyan .bottom-content i:hover,.BleuCiel .bottom-content i:hover,.Bleu .bottom-content i:hover,.Violet .bottom-content i:hover,.Rose .bottom-content i:hover{background:rgba(0,0,0,.1)}.Blanc .bottom-content i:active,.Rouge .bottom-content i:active,.Orange .bottom-content i:active,.Jaune .bottom-content i:active,.Vert .bottom-content i:active,.Cyan .bottom-content i:active,.BleuCiel .bottom-content i:active,.Bleu .bottom-content i:active,.Violet .bottom-content i:active,.Rose .bottom-content i:active{background:rgba(0,0,0,.2)}.Noir ::selection{background:rgba(255,255,255,.2)}.Noir .bottom-content span{color:#c6c6c6}.Noir .bottom-content i{color:#c6c6c6}.Noir .bottom-content i:hover{background:rgba(255,255,255,.1)}.Noir .bottom-content i:active{background:rgba(255,255,255,.2)}/*# sourceMappingURL=style.css.map */ diff --git a/src/assets/css/style.css.map b/src/assets/css/style.css.map index f85f4f4..1348106 100644 --- a/src/assets/css/style.css.map +++ b/src/assets/css/style.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../sass/style.scss"],"names":[],"mappings":"AAWA,sBACE,GACE,4BAGF,KACE,yBAIJ,KACE,uBACA,0CACA,qBACA,mDAEA,+BACE,gCAIJ,EACE,6BACA,SACA,sBAGF,oBACE,UACA,WAGF,GACE,iBAGF,GACE,iBAGF,GACE,iBAGF,EACE,qBACA,eACA,qBACA,gBAGF,IACE,kBACA,aACA,gBACA,gBACA,gBAGF,OACE,aAEA,iBACE,eACA,oBACA,mBACA,uBACA,WACA,YACA,kBACA,eAIJ,SAEE,mBACA,cACA,kBACA,gBACA,qBAGF,GACE,kBAGF,IACE,eACA,mBAGF,IACE,MACA,OACA,QACA,kBACA,eACA,UACA,yBACA,iBAEA,OACE,qBAGF,QACE,iBACA,qBACA,sBAGF,WACE,YAGF,kBACE,YACA,YACA,mBACA,qBAEA,+BACE,iEAGF,gCACE,UAGF,oBACE,eACA,aAGF,wBACE,eACA,YACA,YACA,YACA,mBACA,iBACA,eAEA,8BACE,aAIJ,2FAGE,aACA,eAIJ,cACE,gBAEA,gBACE,eACA,aACA,eAKN,KACE,gBACA,sBACA,uBACA,aACA,uBACA,mBACA,eACA,SAGF,SACE,eACA,yBACA,iBACA,WAjMO,QAkMP,OACA,MACA,SACA,YACA,wBAEA,oBACE,gBACA,kBAGF,gBACE,aAGF,gBACE,iBAGF,WACE,kBACA,cACA,YACA,gBACA,eAEA,sBACE,gBACA,gBACA,qBACA,mBACA,gBAGF,qBACE,eACA,YAKN,MACE,sBAGF,sBAGE,YACA,WACA,eACA,eAGF,cAEE,6BAGF,SACE,aACA,iBACA,iBACA,gBACA,aAGF,OACE,eACA,WACA,YACA,YACA,eACA,eACA,kBACA,eAEA,gBACE,mBAIJ,KACE,cAGF,UACE,iBAEA,mBACE,gBACA,kBAIJ,MACE,kBACA,aACA,sBACA,8BACA,mBACA,6DACA,yBACA,YACA,iBACA,cACA,uBAEA,wBAEE,uDAEA,wDACE,mBACA,UAIJ,YACE,kBACA,WACA,MACA,OACA,WACA,YACA,uBACA,yBAGF,oCAEE,kCAIA,mCACE,mBACA,UAIJ,aACE,iBACA,iBACA,gBACA,qBAGF,QACE,0BAEA,cACE,qBAIJ,eACE,iBACA,gBACA,yBACA,kBACA,kBAGF,sBACE,yBACA,iBACA,eACA,kBACA,UACA,kBACA,uBAEA,mCACE,UACA,mBAGF,wBACE,oBACA,mBACA,uBACA,eACA,aACA,WACA,YACA,kBACA,eAGF,2BACE,gBACA,eAKN,OACE,eACA,gBAGF,YACE,eACA,UACA,WACA,gBACA,QACA,OACA,QACA,YAEA,qBACE,gBAIJ,UACE,gBAGF,QACE,aACA,eACA,MACA,OACA,UACA,YACA,WACA,mCACA,2BAEA,aACE,cAIJ,cAEE,aACA,mBACA,8BAGF,sCAIE,kBAGF,UACE,aACA,uBACA,gBAEA,eACE,WACA,YACA,cACA,kBACA,eACA,eAGF,2BACE,WACA,YAIJ,wHAOE,aACA,oBACA,eACA,MACA,OACA,UACA,aACA,YACA,mCACA,2BAEA,yKACE,yBACA,iBACA,kBACA,QACA,SACA,UACA,gBACA,uBACA,gCAIJ,2JAOE,aACA,oBAGF,4MAOE,aACA,oBACA,iBACA,gCAGF,SACE,YACA,iBAGF,KACE,mBAGF,QACE,kBACA,eACA,qBACA,WACA,YAEA,cACE,UACA,QACA,SAGE,qCACE,2BAKN,gBACE,kBACA,eACA,mBACA,QAEA,uBACE,kBACA,WACA,kBACA,YACA,WACA,SACA,QACA,sCACA,2BAKN,SACE,gBACA,aAIA,uBACE,WACA,UAIJ,WACE,kBACA,YACA,gBAGF,iCACE,iBAGF,OACE,kBACA,kBACA,WACA,YACA,sBACA,UAEA,gCACE,oBAIJ,OACE,qBACA,sBAGF,mBACE,eACA,SACA,WACA,kBACA,gBACA,gBACA,aACA,kBACA,mBACA,MAnmBO,KAomBP,aACA,YAGF,kBACE,eACA,SACA,WACA,kBACA,gBACA,gBACA,aACA,kBACA,aACA,YAEA,uBACE,cAIJ,cACE,YACA,mBACA,kBACA,aACA,gBACA,eAGF,UACE,iBACA,WACA,YACA,mBACA,YACA,aACA,uBACA,mBACA,eACA,eAEA,gBACE,iEAIJ,gBACE,qBACA,kBAEA,kBACE,sBAIJ,yBAEE,6BAEE,cAIJ,yBACE,KACE,iBAGF,IACE,eACA,SACA,gBACA,gBAEA,QACE,cACA,cAGF,oCAEE,aAGF,2BAEE,kBAGF,kBACE,UAEA,wBACE,UACA,sBACA,YACA,cAGF,yBACE,SAGF,qHAIE,eACA,sBACA,eAGF,oBACE,iBAGF,oEAEE,iBACA,sBAGF,uCACE,aAIJ,cACE,aAIJ,KACE,mBACA,SAGF,6BAEE,eACA,YACA,WACA,UAGF,yCAEE,WACA,YACA,iBACA,mBACA,aACA,uBACA,mBAGF,IACE,aAGF,SACE,aACA,WACA,aACA,UAEA,oBACE,gBAGF,gBACE,aAGF,gBACE,aAGF,oBACE,gBAIJ,cACE,cACA,qCAGF,SACE,YAGF,MACE,UACA,iBAEA,eACE,kBACA,gBAIJ,YACE,8BACA,SAEA,qBACE,gBAIJ,eACE,aAGF,OACE,eAGF,kBACE,aAGF,UACE,oBAGF,UACE,eACA,sBACA,iBAEA,oBACE,oBAIJ,uBACE,cAIJ,UACE,WAh2BO,QAi2BP,MA91BO,QA+1BP,aA91BO,QAg2BP,YACE,MAj2BK,QAo2BP,cACE,WAx2BK,QA22BP,iCACE,gCAGF,cACE,WAh3BK,QAk3BL,4BACE,WAl3BG,QAo3BH,0CACE,MAp3BC,QAu3BH,kCACE,WAz3BC,QA23BD,wCACE,aAMR,mBACE,WAp4BK,QAw4BH,sDAEE,WAz4BC,QA84BP,oDAGE,yBAEA,sEACE,0BAIJ,iBACE,MA35BK,QA45BL,WAx5BK,QA05BL,uBACE,WA15BG,QA65BL,0BACE,WAh6BG,QAo6BP,iBACE,MAp6BK,QAu6BP,8EAIE,WA96BK,QA+6BL,MA76BK,QAg7BP,yBACE,yBAaA,+LACE,MAl8BG,QAs8BP,kBACE,MAn8BK,QAy8BH,wCACE,WA18BC,QA88BL,0BACE,WAj9BG,QAm9BH,iCACE,WA98BC,KAm9BP,gNAQE,0BAGF,2BACE,cAGF,oBACE,WAz+BK,QA0+BL,MAz+BK,QA4+BP,iCACE,YACA,WAh/BK,QAm/BP,4BACE,WAn/BK,QAo/BL,MAn/BK,QAs/BP,wBACE,iBA1/BK,QA4/BL,8BACE,iBA3/BG,QA+/BP,yBAEE,6DAEE,sCAGF,mBACE,WAxgCG,QA4gCD,sDAEE,WA7gCD,SAohCT,WACE,WA/gCO,KAghCP,MAvhCO,QAwhCP,aAnhCO,QAqhCP,aACE,MAthCK,QAyhCP,eACE,WAvhCM,KA0hCR,kCACE,0BAGF,uDAGE,yBAEA,yEACE,0BAIJ,eACE,WAziCM,KA2iCN,6BACE,WA7iCG,KA+iCH,2CACE,MAvjCC,QA0jCH,mCACE,WApjCC,KAqjCD,YAEA,yCACE,aAMR,oBACE,WA9jCM,KAkkCJ,wDAEE,WA1kCC,QA+kCP,kBACE,MA3kCK,KA4kCL,WA9kCK,QAglCL,wBACE,WAhlCG,QAmlCL,2BACE,WAxlCG,QAylCH,MA5lCG,QAgmCP,kBACE,MA3lCK,QA8lCP,kFAIE,WAhmCK,KAimCL,MAxmCK,QA2mCP,0BACE,yBAaA,yMACE,MA3nCG,QA+nCP,iBACE,MA7nCK,QA+nCL,mBACE,MA/nCG,QAsoCH,yCACE,WAroCC,QAyoCL,2BACE,WA7oCG,QA+oCH,kCACE,WA3oCC,KAgpCP,mJAME,gCAGF,4BACE,cAGF,6BACE,WAnqCK,QAoqCL,MAtqCK,QAyqCP,yBACE,iBAlqCM,KAoqCN,+BACE,iBA3qCG,QA+qCP,qBACE,WA3qCK,KA4qCL,MAnrCK,QAsrCP,kCACE,YACA,gBAGF,yBAEE,+DAEE,sCAGF,oBACE,WA3rCI,KA+rCF,wDAEE,WAvsCD,SA8sCT,MACE,WAjtCO,QAmtCP,YACE,sCAIJ,MACE,WAztCO,QA4tCT,OACE,WArtCQ,KAwtCV,OACE,mBAGF,QACE,mBAGF,OACE,mBAGF,MACE,mBAGF,MACE,mBAGF,UACE,mBAGF,MACE,mBAGF,QACE,mBAGF,MACE,mBAGF,uEAUE,MA/wCO,QAixCP,+LACE,0BAIA,uTACE,0BAGF,iUACE,0BAOJ,kBACE,gCAIA,2BACE,MAryCG,QAwyCL,wBACE,MAzyCG,QA2yCH,8BACE,gCAGF,+BACE","file":"style.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../sass/style.scss"],"names":[],"mappings":"AAWA,sBACE,GACE,4BAGF,KACE,yBAIJ,KACE,uBACA,0CACA,qBACA,mDACA,6BAEA,+BACE,gCAIJ,EACE,SACA,sBAGF,oBACE,UACA,WAGF,GACE,iBAGF,GACE,iBAGF,GACE,iBAGF,EACE,qBACA,eACA,qBACA,gBAGF,IACE,kBACA,aACA,gBACA,gBACA,gBAGF,OACE,aAEA,iBACE,eACA,oBACA,mBACA,uBACA,WACA,YACA,kBACA,eAIJ,SAEE,mBACA,cACA,kBACA,gBACA,qBAGF,GACE,kBACA,sBAGF,IACE,eACA,mBAGF,IACE,MACA,OACA,QACA,kBACA,eACA,UACA,yBACA,iBAEA,OACE,qBAEA,SACE,eAIJ,QACE,iBACA,qBACA,sBAGF,WACE,YAGF,kBACE,YACA,YACA,mBACA,qBAEA,+BACE,iEAGF,gCACE,UAGF,oBACE,eACA,aAGF,wBACE,YACA,YACA,mBACA,iBACA,eAEA,8BACE,aAIJ,2FAGE,aACA,eAIJ,cACE,gBAEA,gBACE,eACA,aACA,eAKN,KACE,gBACA,sBACA,uBACA,aACA,uBACA,mBACA,eACA,SAGF,SACE,eACA,yBACA,iBACA,WApMO,QAqMP,OACA,MACA,SACA,YACA,wBAEA,oBACE,gBACA,kBAGF,gBACE,aAGF,gBACE,iBAGF,WACE,kBACA,cACA,YACA,gBACA,eAEA,sBACE,gBACA,gBACA,qBACA,mBACA,gBACA,sBACA,iBAGF,qBACE,eACA,YAKN,MACE,gCAGF,qBACE,WACA,YACA,aAGF,aAEE,YACA,WACA,eACA,eAGF,cAEE,6BAGF,SACE,gCACA,eACA,aACA,WACA,iBACA,iBACA,gBACA,aAGF,OACE,gCACA,eACA,eACA,WACA,YACA,YACA,eACA,kBACA,eAEA,gBACE,mBAIJ,KACE,cAGF,UACE,iBAEA,mBACE,gBACA,kBAIJ,MACE,kBACA,aACA,sBACA,8BACA,mBACA,6DACA,yBACA,YACA,iBACA,cACA,uBAEA,wBAEE,uDAEA,wDACE,mBACA,UAIJ,YACE,kBACA,WACA,MACA,OACA,WACA,YACA,uBACA,yBAGF,oCAEE,kCAIA,mCACE,mBACA,UAIJ,aACE,iBACA,iBACA,gBACA,qBAGF,QACE,0BAEA,cACE,qBAIJ,eACE,iBACA,gBACA,yBACA,kBACA,kBAGF,sBACE,yBACA,iBACA,eACA,kBACA,UACA,kBACA,uBAEA,mCACE,UACA,mBAGF,wBACE,oBACA,mBACA,uBACA,eACA,aACA,WACA,YACA,kBACA,eAKN,OACE,eACA,gBAGF,YACE,eACA,UACA,WACA,gBACA,YACA,QAEA,qBACE,gBAIJ,UACE,gBAGF,cAEE,aACA,mBACA,8BAGF,sCAIE,kBAGF,UACE,aACA,uBACA,gBAEA,eACE,WACA,YACA,cACA,kBACA,eACA,eAGF,2BACE,WACA,YAIJ,0GAME,aACA,oBACA,eACA,MACA,OACA,UACA,aACA,YACA,mCACA,2BAEA,oJACE,yBACA,iBACA,kBACA,QACA,SACA,UACA,gBACA,uBACA,gCAIJ,wIAME,aACA,oBAGF,kLAME,aACA,oBACA,iBACA,gCAGF,SACE,YACA,iBAGF,KACE,mBAGF,QACE,kBACA,eACA,qBACA,WACA,YAEA,cACE,UACA,QACA,SAGE,qCACE,2BAKN,gBACE,kBACA,eACA,mBACA,QAEA,uBACE,kBACA,WACA,kBACA,YACA,WACA,SACA,QACA,sCACA,2BAKN,SACE,gBACA,aAGF,UACE,WACA,UAGF,WACE,kBACA,YACA,gBAGF,iCACE,iBAGF,mBACE,eACA,SACA,WACA,kBACA,gBACA,gBACA,aACA,kBACA,mBACA,MAnkBO,KAokBP,aACA,YAGF,kBACE,eACA,SACA,WACA,kBACA,gBACA,gBACA,aACA,kBACA,aACA,YAEA,uBACE,cAIJ,cACE,YACA,mBACA,kBACA,aACA,gBACA,eAGF,UACE,iBACA,WACA,YACA,mBACA,YACA,aACA,uBACA,mBACA,eACA,eAEA,gBACE,iEAIJ,gBACE,qBACA,kBAGF,yBAEE,6BAEE,cAIJ,yBACE,KACE,iBAGF,IACE,eACA,SACA,gBACA,gBAEA,QACE,cACA,cAGF,oCAEE,aAGF,2BAEE,kBAGF,kBACE,UAEA,wBACE,UACA,YAGF,yBACE,SAGF,2FAGE,eACA,eAGF,oBACE,sBACA,iBAGF,2BACE,iBAGF,uCACE,aAIJ,cACE,aAIJ,KACE,iBACA,SAGF,6BAEE,eACA,YACA,WACA,UAGF,yCAEE,WACA,YACA,iBACA,mBACA,aACA,uBACA,mBAGF,IACE,aAGF,SACE,aACA,WACA,aACA,UAEA,oBACE,gBAGF,gBACE,aAGF,gBACE,aAGF,oBACE,gBAIJ,cACE,cACA,qCAGF,SACE,YAGF,MACE,WACA,iBACA,cAEA,sBACE,mBACA,UAGF,aACE,iBAGF,eACE,gBACA,gBAIJ,YACE,kBACA,WACA,MAEA,qBACE,cAIJ,eACE,aAGF,OACE,eAGF,kBACE,aAGF,UACE,oBAGF,UACE,eACA,sBACA,iBAEA,oBACE,oBAIJ,uBACE,cAIJ,UACE,WAl0BO,QAm0BP,MAh0BO,QAi0BP,aAh0BO,QAk0BP,YACE,MAn0BK,QAs0BP,cACE,WA10BK,QA60BP,iCACE,gCAGF,cACE,WAl1BK,QAo1BL,4BACE,WAt1BG,QAw1BH,0CACE,MAt1BC,QAy1BH,kCACE,WA71BC,QA81BD,YAEA,wCACE,aAMR,mBACE,WAv2BK,QA22BH,sDAEE,WA52BC,QAi3BP,oDAGE,yBAEA,sEACE,0BAIJ,iBACE,MA93BK,QA+3BL,WA33BK,QA63BL,uBACE,WA73BG,QAg4BL,0BACE,WAn4BG,QAu4BP,iBACE,MAv4BK,QA04BP,8EAIE,WAj5BK,QAk5BL,MAh5BK,QAm5BP,yBACE,yBAaA,+LACE,MAr6BG,QAy6BP,kBACE,MAt6BK,QA46BH,wCACE,WA76BC,QAi7BL,0BACE,WAp7BG,QAs7BH,iCACE,WAj7BC,KAs7BP,oKAME,0BAGF,2BACE,cAGF,oBACE,WA58BK,QA68BL,MA18BK,QA68BP,oBACE,YACA,WAj9BK,QAo9BP,4BACE,WAp9BK,QAq9BL,MAp9BK,QAu9BP,wBACE,iBA39BK,QA69BL,8BACE,iBA59BG,QAg+BP,yBAEE,6DAEE,sCAGF,mBACE,WAz+BG,QA6+BD,sDAEE,WA9+BD,SAq/BT,WACE,WAh/BO,KAi/BP,MAx/BO,QAy/BP,aAp/BO,QAs/BP,aACE,MAv/BK,QA0/BP,eACE,WAx/BM,KA2/BR,kCACE,0BAGF,uDAGE,yBAEA,yEACE,0BAIJ,eACE,WA1gCM,KA4gCN,6BACE,WA9gCG,KAghCH,2CACE,MAxhCC,QA2hCH,mCACE,WArhCC,KAshCD,YAEA,yCACE,aAMR,oBACE,WA/hCM,KAmiCJ,wDAEE,WA3iCC,QAgjCP,kBACE,MA5iCK,KA6iCL,WA/iCK,QAijCL,wBACE,WAjjCG,QAojCL,2BACE,WAzjCG,QA0jCH,MA7jCG,QAikCP,kBACE,MA5jCK,QA+jCP,kFAIE,WAjkCK,KAkkCL,MAzkCK,QA4kCP,0BACE,yBAaA,yMACE,MA5lCG,QAgmCP,iBACE,MA9lCK,QAgmCL,mBACE,MAhmCG,QAumCH,yCACE,WAtmCC,QA0mCL,2BACE,WA9mCG,QAgnCH,kCACE,WA5mCC,KAinCP,0KAME,gCAGF,4BACE,cAGF,6BACE,WApoCK,QAqoCL,MAvoCK,QA0oCP,yBACE,iBAnoCM,KAqoCN,+BACE,iBA5oCG,QAgpCP,qBACE,WA5oCK,KA6oCL,MAppCK,QAupCP,qBACE,YACA,gBAGF,yBAEE,+DAEE,sCAGF,oBACE,WA5pCI,KAgqCF,wDAEE,WAxqCD,SA+qCT,MACE,WAlrCO,QAorCP,YACE,sCAIJ,MACE,WA1rCO,QA6rCT,OACE,WAtrCQ,KAyrCV,OACE,mBAGF,QACE,mBAGF,OACE,mBAGF,MACE,mBAGF,MACE,mBAGF,UACE,mBAGF,MACE,mBAGF,QACE,mBAGF,MACE,mBAGF,uEAUE,MAhvCO,QAkvCP,+LACE,0BAIA,uTACE,0BAGF,iUACE,0BAOJ,kBACE,gCAIA,2BACE,MAtwCG,QAywCL,wBACE,MA1wCG,QA4wCH,8BACE,gCAGF,+BACE","file":"style.css"} \ No newline at end of file diff --git a/src/assets/js/script.js b/src/assets/js/script.js index 47b668f..7bb4538 100644 --- a/src/assets/js/script.js +++ b/src/assets/js/script.js @@ -5,13 +5,12 @@ let touchEnd = 0; let timeoutCopy = null; let timeoutError = null; const notesContainer = document.querySelector('main'); -const popupBox = document.querySelector('.popup-box'); +const noteBox = document.querySelector('.note-popup-box'); const connectBox = document.querySelector('.connect-box'); const creerBox = document.querySelector('.creer-box'); -const titleTag = popupBox.querySelector('#title'); -const descTag = popupBox.querySelector('#content'); +const titleNote = noteBox.querySelector('#title'); +const contentNote = noteBox.querySelector('#content'); const couleurs = document.querySelectorAll('.couleurs span'); -const darken = document.querySelector('.darken'); const switchElement = document.querySelector('.switch'); const forms = document.querySelectorAll('form'); const sideBar = document.querySelector('.sideBar'); @@ -69,6 +68,77 @@ const converter = new showdown.Converter({ extensions: [taskListEnablerExtension], }); +function arrayBufferToBase64(buffer) { + const binary = []; + const bytes = new Uint8Array(buffer); + for (let i = 0; i < bytes.byteLength; i += 1) { + binary.push(String.fromCharCode(bytes[i])); + } + return btoa(binary.join('')); +} + +function base64ToArrayBuffer(base64) { + const binaryString = atob(base64); + const byteArray = new Uint8Array(binaryString.length); + for (let i = 0; i < binaryString.length; i += 1) { + byteArray[i] = binaryString.charCodeAt(i); + } + return byteArray.buffer; +} + +async function openIndexedDB(dbName, objectStoreName) { + return new Promise((resolve, reject) => { + const request = indexedDB.open(dbName, 1); + + request.onupgradeneeded = (event) => { + const db = event.target.result; + if (!db.objectStoreNames.contains(objectStoreName)) { + db.createObjectStore(objectStoreName); + } + }; + + request.onsuccess = (event) => { + resolve(event.target.result); + }; + + request.onerror = (event) => { + reject(event.target.error); + }; + }); +} + +async function getKeyFromDB(db, objectStoreName) { + return new Promise((resolve, reject) => { + const transaction = db.transaction(objectStoreName, 'readonly'); + const objectStore = transaction.objectStore(objectStoreName); + const request = objectStore.get('encryptionKey'); + + request.onsuccess = (event) => { + resolve(event.target.result); + }; + + request.onerror = (event) => { + reject(event.target.error); + }; + }); +} + +async function storeKeyInDB(db, objectStoreName, key) { + return new Promise((resolve, reject) => { + const transaction = db.transaction(objectStoreName, 'readwrite'); + const objectStore = transaction.objectStore(objectStoreName); + objectStore.put(key, 'encryptionKey'); + + transaction.oncomplete = () => { + resolve(); + }; + + transaction.onerror = (event) => { + reject(event.target.error); + }; + }); +} + const showNotes = async () => { document.querySelector('.sideBar .listNotes').textContent = ''; document.querySelectorAll('.note').forEach((note) => note.remove()); @@ -79,17 +149,38 @@ const showNotes = async () => { return; } + const dbName = 'notes_db'; + const objectStoreName = 'key'; + const db = await openIndexedDB(dbName, objectStoreName); + const key = await getKeyFromDB(db, objectStoreName); + db.close(); + notesJSON .sort((a, b) => new Date(b.date) - new Date(a.date)) - .forEach((row, id) => { + .forEach(async (row, id) => { const { - title, desc, couleur, date, hidden, + title, content, couleur, date, hidden, } = row; if (!title) return; - const descEnd = replaceAllEnd(desc); - const descHtml = converter.makeHtml(desc); + const deTitle = await window.crypto.subtle.decrypt( + { name: 'AES-GCM', iv: new Uint8Array(12) }, + key, + base64ToArrayBuffer(title), + ); + + const deContent = await window.crypto.subtle.decrypt( + { name: 'AES-GCM', iv: new Uint8Array(12) }, + key, + base64ToArrayBuffer(content), + ); + + const deTitleString = JSON.parse(new TextDecoder().decode(new Uint8Array(deTitle))); + const deContentString = JSON.parse(new TextDecoder().decode(new Uint8Array(deContent))); + + const descEnd = replaceAllEnd(deContentString); + const descHtml = converter.makeHtml(deContentString); const noteElement = document.createElement('div'); noteElement.id = `note${id}`; noteElement.classList.add('note', couleur); @@ -98,7 +189,7 @@ const showNotes = async () => { detailsElement.classList.add('details'); const titleElement = document.createElement('h2'); titleElement.classList.add('title'); - titleElement.textContent = title; + titleElement.textContent = deTitleString; const descElement = document.createElement('span'); if (hidden === false) { @@ -111,13 +202,11 @@ const showNotes = async () => { detailsElement.appendChild(descElement); const bottomContentElement = document.createElement('div'); bottomContentElement.classList.add('bottom-content'); - const dateElement = document.createElement('span'); - dateElement.textContent = date; const editIconElement = document.createElement('i'); editIconElement.classList.add('fa-solid', 'fa-pen', 'note-action'); editIconElement.tabIndex = 0; editIconElement.setAttribute('data-note-id', id); - editIconElement.setAttribute('data-note-title', title); + editIconElement.setAttribute('data-note-title', deTitleString); editIconElement.setAttribute('data-note-desc', descEnd); editIconElement.setAttribute('data-note-color', couleur); editIconElement.setAttribute('data-note-hidden', hidden); @@ -127,7 +216,6 @@ const showNotes = async () => { trashIconElement.tabIndex = 0; trashIconElement.setAttribute('data-note-id', id); trashIconElement.setAttribute('role', 'button'); - bottomContentElement.appendChild(dateElement); bottomContentElement.appendChild(editIconElement); bottomContentElement.appendChild(trashIconElement); @@ -143,7 +231,7 @@ const showNotes = async () => { downloadIconElement.classList.add('fa-solid', 'fa-download', 'note-action'); downloadIconElement.tabIndex = 0; downloadIconElement.setAttribute('data-note-id', id); - downloadIconElement.setAttribute('data-note-title', title); + downloadIconElement.setAttribute('data-note-title', deTitleString); downloadIconElement.setAttribute('data-note-desc', descEnd); downloadIconElement.setAttribute('role', 'button'); bottomContentElement.appendChild(downloadIconElement); @@ -164,7 +252,7 @@ const showNotes = async () => { paragraph.setAttribute('role', 'button'); const titleSpan = document.createElement('span'); titleSpan.classList.add('titleList'); - titleSpan.textContent = title; + titleSpan.textContent = deTitleString; const dateSpan = document.createElement('span'); dateSpan.classList.add('dateList'); dateSpan.textContent = date; @@ -179,7 +267,6 @@ const showNotes = async () => { const toggleFullscreen = (id) => { const note = document.querySelector(`#note${id}`); note.classList.toggle('fullscreen'); - darken.classList.toggle('show'); document.body.classList.toggle('noscroll'); }; @@ -188,13 +275,12 @@ const updateNote = (id, title, desc, couleur, hidden) => { document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); - darken.classList.remove('show'); document.body.classList.add('noscroll'); document.querySelector('#idNoteInput').value = id; isUpdate = true; document.querySelector('.icon').click(); - titleTag.value = title; - descTag.value = s; + titleNote.value = title; + contentNote.value = s; couleurs.forEach((couleurSpan) => { if (couleurSpan.classList.contains(couleur)) { couleurSpan.classList.add('selectionne'); @@ -203,7 +289,7 @@ const updateNote = (id, title, desc, couleur, hidden) => { } }); if (hidden === 'true') { document.querySelector('#checkHidden').checked = true; } - descTag.focus(); + contentNote.focus(); }; const downloadNote = (e, t) => { @@ -235,7 +321,6 @@ const deleteNote = (e) => { if (window.confirm('Voulez-vous vraiment supprimer cette note ?')) { notesJSON.splice(e, 1); localStorage.setItem('local_notes', JSON.stringify(notesJSON)); - darken.classList.remove('show'); showNotes(); } }; @@ -305,7 +390,6 @@ document.querySelectorAll('.creercompte').forEach((element) => { element.addEventListener('click', () => { connectBox.classList.remove('show'); creerBox.classList.add('show'); - document.body.classList.add('noscroll'); document.querySelector('#nomCreer').focus(); }); element.addEventListener('keydown', (event) => { @@ -400,7 +484,7 @@ document.querySelector('#submitSeConnecter').addEventListener('click', async () document.querySelectorAll('.icon, .iconFloat').forEach((element) => { element.addEventListener('click', () => { - popupBox.classList.add('show'); + noteBox.classList.add('show'); document.body.classList.add('noscroll'); document.querySelector('#title').focus(); }); @@ -422,28 +506,58 @@ couleurs.forEach((span, index) => { if (index === 0) span.classList.add('selectionne'); }); -document.querySelector('#submitNote').addEventListener('click', () => { +document.querySelector('#submitNote').addEventListener('click', async () => { const couleurSpan = document.querySelector('.couleurs span.selectionne'); - const v = couleurSpan.classList[0]; - const e = titleTag.value.trim(); - const t = descTag.value.trim().replaceAll(//g, '>'); - const g = document.querySelector('#checkHidden').checked; - if (!e || e.length > 30 || t.length > 5000) return; - const c = { - title: e, - desc: t, - couleur: v, + const couleur = couleurSpan.classList[0]; + const title = titleNote.value.trim(); + const content = contentNote.value.trim().replaceAll(//g, '>'); + const hidden = document.querySelector('#checkHidden').checked; + + if (!title || title.length > 30 || content.length > 5000) return; + + const dbName = 'notes_db'; + const objectStoreName = 'key'; + const db = await openIndexedDB(dbName, objectStoreName); + let key = await getKeyFromDB(db, objectStoreName); + + if (!key) { + key = await window.crypto.subtle.generateKey( + { name: 'AES-GCM', length: 256 }, + true, + ['encrypt', 'decrypt'], + ); + await storeKeyInDB(db, objectStoreName, key); + } + + const enTitle = await window.crypto.subtle.encrypt( + { name: 'AES-GCM', iv: new Uint8Array(12) }, + key, + new TextEncoder().encode(JSON.stringify(title)), + ); + + const enContent = await window.crypto.subtle.encrypt( + { name: 'AES-GCM', iv: new Uint8Array(12) }, + key, + new TextEncoder().encode(JSON.stringify(content)), + ); + + const note = { + title: arrayBufferToBase64(enTitle), + content: arrayBufferToBase64(enContent), + couleur, date: new Date().toISOString().slice(0, 19).replace('T', ' '), - hidden: g, + hidden, }; + if (isUpdate) { isUpdate = false; - notesJSON[document.querySelector('#idNoteInput').value] = c; + notesJSON[document.querySelector('#idNoteInput').value] = note; } else { - notesJSON.push(c); + notesJSON.push(note); } + localStorage.setItem('local_notes', JSON.stringify(notesJSON)); - popupBox.classList.remove('show'); + noteBox.classList.remove('show'); document.body.classList.remove('noscroll'); showNotes(); }); @@ -451,7 +565,6 @@ document.querySelector('#submitNote').addEventListener('click', () => { document.querySelectorAll('#menuIcon').forEach((element) => { element.addEventListener('click', () => { document.querySelector('.sideBar').classList.add('show'); - darken.classList.toggle('show'); }); element.addEventListener('keydown', (event) => { if (event.key === 'Enter') { @@ -471,16 +584,14 @@ document.body.addEventListener('touchmove', (e) => { document.body.addEventListener('touchend', () => { const swipeDistance = touchEnd - touchStart; - if (swipeDistance > 50 && !sideBar.classList.contains('show')) { + if (swipeDistance > 100 && !sideBar.classList.contains('show')) { sideBar.classList.add('show'); - darken.classList.add('show'); document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); document.body.classList.add('noscroll'); - } else if (swipeDistance < -50 && sideBar.classList.contains('show')) { + } else if (swipeDistance < -100 && sideBar.classList.contains('show')) { sideBar.classList.remove('show'); - darken.classList.remove('show'); document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); @@ -504,10 +615,9 @@ document.querySelectorAll('header i').forEach((element) => { element.addEventListener('click', () => { isUpdate = false; forms.forEach((form) => form.reset()); - popupBox.classList.remove('show'); + noteBox.classList.remove('show'); connectBox.classList.remove('show'); creerBox.classList.remove('show'); - darken.classList.remove('show'); document.body.classList.remove('noscroll'); document.querySelector('.sideBar').classList.remove('show'); }); @@ -543,15 +653,13 @@ document.querySelector('#btnTheme').addEventListener('click', () => { } }); -document.querySelector('.language').addEventListener('change', () => { - const e = document.querySelector('.language').value; +document.querySelector('#language').addEventListener('change', () => { + const e = document.querySelector('#language').value; if (e === 'fr') { window.location.href = './'; - } - else if (e === 'en') { + } else if (e === 'en') { window.location.href = 'en/'; - } - else if (e === 'de') { + } else if (e === 'de') { window.location.href = 'de/'; } }); diff --git a/src/assets/js/scriptConnect.js b/src/assets/js/scriptConnect.js index 2e2621d..ebeccdd 100644 --- a/src/assets/js/scriptConnect.js +++ b/src/assets/js/scriptConnect.js @@ -5,13 +5,12 @@ let touchEnd = 0; let timeoutCopy = null; let timeoutError = null; const notesContainer = document.querySelector('main'); -const popupBoxConnect = document.querySelector('.connect-popup-box'); +const noteBox = document.querySelector('.note-popup-box'); const popupBoxGestion = document.querySelector('.gestion-popup-box'); const privateNote = document.querySelector('.private-note-popup-box'); const publicNote = document.querySelector('.public-note-popup-box'); -const titleTagConnect = popupBoxConnect.querySelector('#titleConnect'); -const descTagConnect = popupBoxConnect.querySelector('textarea'); -const darken = document.querySelector('.darken'); +const titleNote = noteBox.querySelector('#title'); +const contentNote = noteBox.querySelector('#content'); const switchElement = document.querySelector('.switch'); const couleurs = document.querySelectorAll('.couleurs span'); const forms = document.querySelectorAll('form'); @@ -120,8 +119,6 @@ const showNotesConnect = async () => { detailsElement.appendChild(descElement); const bottomContentElement = document.createElement('div'); bottomContentElement.classList.add('bottom-content'); - const dateElement = document.createElement('span'); - dateElement.textContent = date; const editIconElement = document.createElement('i'); editIconElement.classList.add('fa-solid', 'fa-pen', 'note-action'); editIconElement.tabIndex = 0; @@ -132,7 +129,6 @@ const showNotesConnect = async () => { editIconElement.setAttribute('data-note-hidden', hidden); editIconElement.setAttribute('data-note-link', link); editIconElement.setAttribute('role', 'button'); - bottomContentElement.appendChild(dateElement); bottomContentElement.appendChild(editIconElement); if (link === '') { @@ -172,8 +168,6 @@ const showNotesConnect = async () => { linkIconElement.classList.add('fa-solid', 'fa-link', 'note-action'); linkIconElement.tabIndex = 0; linkIconElement.setAttribute('data-note-id', id); - linkIconElement.setAttribute('data-note-title', title); - linkIconElement.setAttribute('data-note-desc', descEnd); linkIconElement.setAttribute('data-note-link', link); linkIconElement.setAttribute('role', 'button'); bottomContentElement.appendChild(linkIconElement); @@ -192,6 +186,11 @@ const showNotesConnect = async () => { dateSpan.classList.add('dateList'); dateSpan.textContent = date; paragraph.appendChild(titleSpan); + if (link !== '') { + const iconLink = document.createElement('i'); + iconLink.classList.add('fa-solid', 'fa-link'); + paragraph.appendChild(iconLink); + } paragraph.appendChild(dateSpan); document.querySelector('.sideBar .listNotes').appendChild(paragraph); }); @@ -200,7 +199,6 @@ const showNotesConnect = async () => { }; const fetchDelete = async (e) => { - darken.classList.remove('show'); document.body.classList.remove('noscroll'); try { await fetch('assets/php/deleteNote.php', { @@ -251,7 +249,6 @@ const fetchLogout = async () => { const toggleFullscreen = (id) => { const note = document.querySelector(`#note${id}`); note.classList.toggle('fullscreen'); - darken.classList.toggle('show'); document.body.classList.toggle('noscroll'); }; @@ -259,14 +256,13 @@ const updateNoteConnect = (id, title, desc, couleur, hidden, link) => { document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); - darken.classList.remove('show'); document.body.classList.add('noscroll'); isUpdate = true; document.querySelector('.iconConnect').click(); - document.querySelector('#idNoteInputConnect').value = id; + document.querySelector('#idNoteInput').value = id; document.querySelector('#checkLink').value = link; - titleTagConnect.value = title; - descTagConnect.value = replaceAllStart(desc); + titleNote.value = title; + contentNote.value = replaceAllStart(desc); couleurs.forEach((couleurSpan) => { if (couleurSpan.classList.contains(couleur)) { couleurSpan.classList.add('selectionne'); @@ -280,7 +276,7 @@ const updateNoteConnect = (id, title, desc, couleur, hidden, link) => { } else { document.querySelector('#checkHidden').disabled = true; } - descTagConnect.focus(); + contentNote.focus(); }; const downloadNote = (e, t) => { @@ -314,17 +310,14 @@ const deleteNoteConnect = (e) => { } }; -const noteAccess = (id, link, title, desc) => { +const noteAccess = (id, link) => { document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); - darken.classList.remove('show'); document.body.classList.add('noscroll'); if (link === '') { privateNote.classList.add('show'); document.querySelector('#idNoteInputPublic').value = id; - document.querySelector('#titleNoteInputPublic').value = title; - document.querySelector('#descNoteInputPublic').value = desc; } else { publicNote.classList.add('show'); document.querySelector('#idNoteInputPrivate').value = id; @@ -389,9 +382,9 @@ switchElement.addEventListener('keydown', (event) => { document.querySelectorAll('.iconConnect, .iconConnectFloat').forEach((element) => { element.addEventListener('click', () => { - popupBoxConnect.classList.add('show'); + noteBox.classList.add('show'); document.body.classList.add('noscroll'); - titleTagConnect.focus(); + titleNote.focus(); }); element.addEventListener('keydown', (event) => { if (event.key === 'Enter') element.click(); @@ -432,7 +425,6 @@ document.querySelectorAll('.supprimerCompte').forEach((element) => { document.querySelectorAll('#menuIcon').forEach((element) => { element.addEventListener('click', () => { sideBar.classList.add('show'); - darken.classList.toggle('show'); }); element.addEventListener('keydown', (event) => { if (event.key === 'Enter') { @@ -452,16 +444,14 @@ document.body.addEventListener('touchmove', (e) => { document.body.addEventListener('touchend', () => { const swipeDistance = touchEnd - touchStart; - if (swipeDistance > 50 && !sideBar.classList.contains('show')) { + if (swipeDistance > 100 && !sideBar.classList.contains('show')) { sideBar.classList.add('show'); - darken.classList.add('show'); document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); document.body.classList.remove('noscroll'); - } else if (swipeDistance < -50 && sideBar.classList.contains('show')) { + } else if (swipeDistance < -100 && sideBar.classList.contains('show')) { sideBar.classList.remove('show'); - darken.classList.remove('show'); document.querySelectorAll('.note').forEach((note) => { note.classList.remove('fullscreen'); }); @@ -485,11 +475,10 @@ document.querySelectorAll('header i').forEach((element) => { element.addEventListener('click', () => { isUpdate = false; forms.forEach((form) => form.reset()); - popupBoxConnect.classList.remove('show'); + noteBox.classList.remove('show'); popupBoxGestion.classList.remove('show'); publicNote.classList.remove('show'); privateNote.classList.remove('show'); - darken.classList.remove('show'); document.body.classList.remove('noscroll'); sideBar.classList.remove('show'); }); @@ -525,15 +514,13 @@ document.querySelector('#btnTheme').addEventListener('click', () => { } }); -document.querySelector('.language').addEventListener('change', () => { - const e = document.querySelector('.language').value; +document.querySelector('#language').addEventListener('change', () => { + const e = document.querySelector('#language').value; if (e === 'fr') { window.location.href = './'; - } - else if (e === 'en') { + } else if (e === 'en') { window.location.href = 'en/'; - } - else if (e === 'de') { + } else if (e === 'de') { window.location.href = 'de/'; } }); @@ -566,11 +553,11 @@ couleurs.forEach((span, index) => { if (index === 0) span.classList.add('selectionne'); }); -document.querySelector('#submitNoteConnect').addEventListener('click', async () => { +document.querySelector('#submitNote').addEventListener('click', async () => { try { - const idNote = document.querySelector('#idNoteInputConnect').value; - const titreBrut = document.querySelector('#titleConnect').value.trim(); - const contentBrut = document.querySelector('#descConnect').value.trim(); + const idNote = document.querySelector('#idNoteInput').value; + const titreBrut = titleNote.value.trim(); + const contentBrut = contentNote.value.trim(); if (!titreBrut || titreBrut.length > 30 || contentBrut.length > 5000) return; const titre = encodeURIComponent(titreBrut); const content = encodeURIComponent(contentBrut.replaceAll(//g, '>')); @@ -579,7 +566,7 @@ document.querySelector('#submitNoteConnect').addEventListener('click', async () const date = new Date().toISOString().slice(0, 19).replace('T', ' '); const checkBox = document.querySelector('#checkHidden'); const link = encodeURIComponent(document.querySelector('#checkLink').value); - const hidden = checkBox.checked ? 1 : 0; + const hidden = checkBox.checked ? '1' : '0'; const url = isUpdate ? 'assets/php/updateNote.php' : 'assets/php/addNote.php'; const data = isUpdate ? `noteId=${idNote}&title=${titre}&desc=${content}&couleur=${couleur}&date=${date}&hidden=${hidden}&link=${link}&csrf_token_note=${document.querySelector('#csrf_token_note').value}` : `title=${titre}&desc=${content}&couleur=${couleur}&date=${date}&hidden=${hidden}&csrf_token_note=${document.querySelector('#csrf_token_note').value}`; const response = await fetch(url, { @@ -590,11 +577,11 @@ document.querySelector('#submitNoteConnect').addEventListener('click', async () body: data, }); if (response.status !== 200) { - showError('Une erreur est survenue lors de l\'ajout de la note...'); + showError('La connexion a expiré, veuillez recharger la page...'); return; } isUpdate = false; - popupBoxConnect.classList.remove('show'); + noteBox.classList.remove('show'); document.body.classList.remove('noscroll'); await showNotesConnect(); } catch (error) { @@ -656,15 +643,13 @@ document.querySelector('#submitRendrePrivee').addEventListener('click', async () document.querySelector('#submitRendrePublique').addEventListener('click', async () => { const id = document.querySelector('#idNoteInputPublic').value; const link = Math.random().toString(36).substring(2, 15); - const title = document.querySelector('#titleNoteInputPublic').value; - const desc = replaceAllStart(document.querySelector('#descNoteInputPublic').value); try { await fetch('assets/php/publicNote.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, - body: `noteId=${encodeURIComponent(id)}&title=${encodeURIComponent(title)}&desc=${encodeURIComponent(desc)}¬eLink=${link}`, + body: `noteId=${encodeURIComponent(id)}¬eLink=${link}`, }); privateNote.classList.remove('show'); document.body.classList.remove('noscroll'); diff --git a/src/assets/js/showdown.min.js b/src/assets/js/showdown.min.js index 9030b8a..aef7bb5 100644 --- a/src/assets/js/showdown.min.js +++ b/src/assets/js/showdown.min.js @@ -1 +1 @@ -!function(){function a(e){"use strict";var r={omitExtraWLInCodeBlocks:{defaultValue:!1,type:"boolean"},noHeaderId:{defaultValue:!1,type:"boolean"},prefixHeaderId:{defaultValue:!1,type:"string"},rawPrefixHeaderId:{defaultValue:!1,type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,type:"boolean"},rawHeaderId:{defaultValue:!1,type:"boolean"},headerLevelStart:{defaultValue:!1,type:"integer"},parseImgDimensions:{defaultValue:!1,type:"boolean"},simplifiedAutoLink:{defaultValue:!1,type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,type:"boolean"},strikethrough:{defaultValue:!1,type:"boolean"},tables:{defaultValue:!1,type:"boolean"},tablesHeaderId:{defaultValue:!1,type:"boolean"},ghCodeBlocks:{defaultValue:!0,type:"boolean"},tasklists:{defaultValue:!1,type:"boolean"},smoothLivePreview:{defaultValue:!1,type:"boolean"},smartIndentationFix:{defaultValue:!1,type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,type:"boolean"},simpleLineBreaks:{defaultValue:!1,type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,type:"boolean"},ghMentions:{defaultValue:!1,type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",type:"string"},encodeEmails:{defaultValue:!0,type:"boolean"},openLinksInNewWindow:{defaultValue:!1,type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,type:"boolean"},emoji:{defaultValue:!1,type:"boolean"},underline:{defaultValue:!1,type:"boolean"},ellipsis:{defaultValue:!0,type:"boolean"},completeHTMLDocument:{defaultValue:!1,type:"boolean"},metadata:{defaultValue:!1,type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(r));var t,a={};for(t in r)r.hasOwnProperty(t)&&(a[t]=r[t].defaultValue);return a}var x={},t={},d={},p=a(!0),h="vanilla",_={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:a(!0),allOn:function(){"use strict";var e,r=a(!0),t={};for(e in r)r.hasOwnProperty(e)&&(t[e]=!0);return t}()};function g(e,r){"use strict";var t=r?"Error in "+r+" extension->":"Error in unnamed extension",a={valid:!0,error:""};x.helper.isArray(e)||(e=[e]);for(var n=0;n").replace(/&/g,"&")};function u(e,r,t,a){"use strict";var n,s,o,i=-1<(a=a||"").indexOf("g"),l=new RegExp(r+"|"+t,"g"+a.replace(/g/g,"")),c=new RegExp(r,a.replace(/g/g,"")),u=[];do{for(n=0;p=l.exec(e);)if(c.test(p[0]))n++||(o=(s=l.lastIndex)-p[0].length);else if(n&&!--n){var d=p.index+p[0].length,p={left:{start:o,end:s},match:{start:s,end:p.index},right:{start:p.index,end:d},wholeMatch:{start:o,end:d}};if(u.push(p),!i)return u}}while(n&&(l.lastIndex=s));return u}function s(u){"use strict";return function(e,r,t,a,n,s,o){var i=t=t.replace(x.helper.regexes.asteriskDashAndColon,x.helper.escapeCharactersCallback),l="",c="",r=r||"",o=o||"";return/^www\./i.test(t)&&(t=t.replace(/^www\./i,"https://www.")),u.excludeTrailingPunctuationFromURLs&&s&&(l=s),r+'"+i+""+l+o}}function o(n,s){"use strict";return function(e,r,t){var a="mailto:";return r=r||"",t=x.subParser("unescapeSpecialChars")(t,n,s),n.encodeEmails?(a=x.helper.encodeEmailAddress(a+t),t=x.helper.encodeEmailAddress(t)):a+=t,r+''+t+""}}x.helper.matchRecursiveRegExp=function(e,r,t,a){"use strict";for(var n=u(e,r,t,a),s=[],o=0;o>=0,t=String(t||" "),e.length>r?String(e):((r-=e.length)>t.length&&(t+=t.repeat(r/t.length)),String(e)+t.slice(0,r))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),x.helper.regexes={asteriskDashAndColon:/([*_:~])/g},x.Converter=function(e){"use strict";var r,t,n={},i=[],l=[],o={},a=h,s={parsed:{},raw:"",format:""};for(r in e=e||{},p)p.hasOwnProperty(r)&&(n[r]=p[r]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);function c(e,r){if(r=r||null,x.helper.isString(e)){if(r=e=x.helper.stdExtName(e),x.extensions[e]){console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!");var t=x.extensions[e],a=e;if("function"==typeof t&&(t=t(new x.Converter)),x.helper.isArray(t)||(t=[t]),!(a=g(t,a)).valid)throw Error(a.error);for(var n=0;n[ \t]+¨NBSP;<"),!r){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");r=window.document}for(var r=r.createElement("div"),t=(r.innerHTML=e,{preList:function(e){for(var r=e.querySelectorAll("pre"),t=[],a=0;a'}else t.push(r[a].innerHTML),r[a].innerHTML="",r[a].setAttribute("prenum",a.toString());return t}(r)}),a=(!function e(r){for(var t=0;t? ?(['"].*['"])?\)$/m))a="";else if(!a){if(a="#"+(t=t||r.toLowerCase().replace(/ ?\n/g," ")),x.helper.isUndefined(l.gUrls[t]))return e;a=l.gUrls[t],x.helper.isUndefined(l.gTitles[t])||(o=l.gTitles[t])}return e=''+""}return e=(e=(e=(e=(e=l.converter._dispatch("anchors.before",e,i,l)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),i.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,function(e,r,t,a,n){if("\\"===t)return r+a;if(!x.helper.isString(i.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");t="";return r+'"+a+""})),e=l.converter._dispatch("anchors.after",e,i,l)});var i=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,l=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,c=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,m=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,f=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi;x.subParser("autoLinks",function(e,r,t){"use strict";return e=(e=(e=t.converter._dispatch("autoLinks.before",e,r,t)).replace(c,s(r))).replace(f,o(r,t)),e=t.converter._dispatch("autoLinks.after",e,r,t)}),x.subParser("simplifiedAutoLinks",function(e,r,t){"use strict";return r.simplifiedAutoLink?(e=t.converter._dispatch("simplifiedAutoLinks.before",e,r,t),e=(e=r.excludeTrailingPunctuationFromURLs?e.replace(l,s(r)):e.replace(i,s(r))).replace(m,o(r,t)),t.converter._dispatch("simplifiedAutoLinks.after",e,r,t)):e}),x.subParser("blockGamut",function(e,r,t){"use strict";return e=t.converter._dispatch("blockGamut.before",e,r,t),e=x.subParser("blockQuotes")(e,r,t),e=x.subParser("headers")(e,r,t),e=x.subParser("horizontalRule")(e,r,t),e=x.subParser("lists")(e,r,t),e=x.subParser("codeBlocks")(e,r,t),e=x.subParser("tables")(e,r,t),e=x.subParser("hashHTMLBlocks")(e,r,t),e=x.subParser("paragraphs")(e,r,t),e=t.converter._dispatch("blockGamut.after",e,r,t)}),x.subParser("blockQuotes",function(e,r,t){"use strict";e=t.converter._dispatch("blockQuotes.before",e,r,t);var a=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return r.splitAdjacentBlockquotes&&(a=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=(e+="\n\n").replace(a,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=x.subParser("githubCodeBlocks")(e,r,t),e=(e=(e=x.subParser("blockGamut")(e,r,t)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*

[^\r]+?<\/pre>)/gm,function(e,r){return r.replace(/^  /gm,"¨0").replace(/¨0/g,"")}),x.subParser("hashBlock")("
"+e+"\n
",r,t)}),e=t.converter._dispatch("blockQuotes.after",e,r,t)}),x.subParser("codeBlocks",function(e,n,s){"use strict";e=s.converter._dispatch("codeBlocks.before",e,n,s);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,r,t){var a="\n",r=x.subParser("outdent")(r,n,s);return r=x.subParser("encodeCode")(r,n,s),r="
"+(r=(r=(r=x.subParser("detab")(r,n,s)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+(a=n.omitExtraWLInCodeBlocks?"":a)+"
",x.subParser("hashBlock")(r,n,s)+t})).replace(/¨0/,""),e=s.converter._dispatch("codeBlocks.after",e,n,s)}),x.subParser("codeSpans",function(e,n,s){"use strict";return e=(e=void 0===(e=s.converter._dispatch("codeSpans.before",e,n,s))?"":e).replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,r,t,a){return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=r+""+(a=x.subParser("encodeCode")(a,n,s))+"",a=x.subParser("hashHTMLSpans")(a,n,s)}),e=s.converter._dispatch("codeSpans.after",e,n,s)}),x.subParser("completeHTMLDocument",function(e,r,t){"use strict";if(!r.completeHTMLDocument)return e;e=t.converter._dispatch("completeHTMLDocument.before",e,r,t);var a,n="html",s="",o="",i='',l="",c="";for(a in void 0!==t.metadata.parsed.doctype&&(s="","html"!==(n=t.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='')),t.metadata.parsed)if(t.metadata.parsed.hasOwnProperty(a))switch(a.toLowerCase()){case"doctype":break;case"title":o=""+t.metadata.parsed.title+"";break;case"charset":i="html"===n||"html5"===n?'':'';break;case"language":case"lang":l=' lang="'+t.metadata.parsed[a]+'"',c+='';break;default:c+=''}return e=s+""+o+i+c+""+e.trim()+"\n",e=t.converter._dispatch("completeHTMLDocument.after",e,r,t)}),x.subParser("detab",function(e,r,t){"use strict";return e=(e=(e=(e=(e=(e=t.converter._dispatch("detab.before",e,r,t)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,function(e,r){for(var t=r,a=4-t.length%4,n=0;n/g,">"),e=t.converter._dispatch("encodeAmpsAndAngles.after",e,r,t)}),x.subParser("encodeBackslashEscapes",function(e,r,t){"use strict";return e=(e=(e=t.converter._dispatch("encodeBackslashEscapes.before",e,r,t)).replace(/\\(\\)/g,x.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,x.helper.escapeCharactersCallback),e=t.converter._dispatch("encodeBackslashEscapes.after",e,r,t)}),x.subParser("encodeCode",function(e,r,t){"use strict";return e=(e=t.converter._dispatch("encodeCode.before",e,r,t)).replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,x.helper.escapeCharactersCallback),e=t.converter._dispatch("encodeCode.after",e,r,t)}),x.subParser("escapeSpecialCharsWithinTagAttributes",function(e,r,t){"use strict";return e=(e=(e=t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,r,t)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,x.helper.escapeCharactersCallback)})).replace(/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,x.helper.escapeCharactersCallback)}),e=t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,r,t)}),x.subParser("githubCodeBlocks",function(e,s,o){"use strict";return s.ghCodeBlocks?(e=o.converter._dispatch("githubCodeBlocks.before",e,s,o),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,r,t,a){var n=s.omitExtraWLInCodeBlocks?"":"\n";return a=x.subParser("encodeCode")(a,s,o),a="
"+(a=(a=(a=x.subParser("detab")(a,s,o)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+n+"
",a=x.subParser("hashBlock")(a,s,o),"\n\n¨G"+(o.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"})).replace(/¨0/,""),o.converter._dispatch("githubCodeBlocks.after",e,s,o)):e}),x.subParser("hashBlock",function(e,r,t){"use strict";return e=(e=t.converter._dispatch("hashBlock.before",e,r,t)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(t.gHtmlBlocks.push(e)-1)+"K\n\n",e=t.converter._dispatch("hashBlock.after",e,r,t)}),x.subParser("hashCodeTags",function(e,n,s){"use strict";e=s.converter._dispatch("hashCodeTags.before",e,n,s);return e=x.helper.replaceRecursiveRegExp(e,function(e,r,t,a){t=t+x.subParser("encodeCode")(r,n,s)+a;return"¨C"+(s.gHtmlSpans.push(t)-1)+"C"},"]*>","","gim"),e=s.converter._dispatch("hashCodeTags.after",e,n,s)}),x.subParser("hashElement",function(e,r,t){"use strict";return function(e,r){return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),r="\n\n¨K"+(t.gHtmlBlocks.push(r)-1)+"K\n\n"}}),x.subParser("hashHTMLBlocks",function(e,r,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,r,n);function t(e,r,t,a){return-1!==t.search(/\bmarkdown\b/)&&(e=t+n.converter.makeHtml(r)+a),"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"}var a=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"];r.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,r){return"<"+r+">"}));for(var s=0;s]*>)","im"),i="<"+a[s]+"\\b[^>]*>",l="";-1!==(c=x.helper.regexIndexOf(e,o));){var c=x.helper.splitAtIndex(e,c),u=x.helper.replaceRecursiveRegExp(c[1],t,i,l,"im");if(u===c[1])break;e=c[0].concat(u)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,x.subParser("hashElement")(e,r,n)),e=(e=x.helper.replaceRecursiveRegExp(e,function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,x.subParser("hashElement")(e,r,n)),e=n.converter._dispatch("hashHTMLBlocks.after",e,r,n)}),x.subParser("hashHTMLSpans",function(e,r,t){"use strict";function a(e){return"¨C"+(t.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=t.converter._dispatch("hashHTMLSpans.before",e,r,t)).replace(/<[^>]+?\/>/gi,a)).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,a)).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,a)).replace(/<[^>]+?>/gi,a),e=t.converter._dispatch("hashHTMLSpans.after",e,r,t)}),x.subParser("unhashHTMLSpans",function(e,r,t){"use strict";e=t.converter._dispatch("unhashHTMLSpans.before",e,r,t);for(var a=0;a]*>\\s*]*>","^ {0,3}\\s*
","gim"),e=s.converter._dispatch("hashPreCodeTags.after",e,n,s)}),x.subParser("headers",function(e,n,s){"use strict";e=s.converter._dispatch("headers.before",e,n,s);var o=isNaN(parseInt(n.headerLevelStart))?1:parseInt(n.headerLevelStart),r=n.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,t=n.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm,r=(e=(e=e.replace(r,function(e,r){var t=x.subParser("spanGamut")(r,n,s),r=n.noHeaderId?"":' id="'+i(r)+'"',r=""+t+"";return x.subParser("hashBlock")(r,n,s)})).replace(t,function(e,r){var t=x.subParser("spanGamut")(r,n,s),r=n.noHeaderId?"":' id="'+i(r)+'"',a=o+1,r=""+t+"";return x.subParser("hashBlock")(r,n,s)}),n.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm);function i(e){var r=e=n.customizedHeaderId&&(r=e.match(/\{([^{]+?)}\s*$/))&&r[1]?r[1]:e,e=x.helper.isString(n.prefixHeaderId)?n.prefixHeaderId:!0===n.prefixHeaderId?"section-":"";return n.rawPrefixHeaderId||(r=e+r),r=(n.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,""):n.rawHeaderId?r.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-"):r.replace(/[^\w]/g,"")).toLowerCase(),n.rawPrefixHeaderId&&(r=e+r),s.hashLinkCounts[r]?r=r+"-"+s.hashLinkCounts[r]++:s.hashLinkCounts[r]=1,r}return e=e.replace(r,function(e,r,t){var a=t,a=(n.customizedHeaderId&&(a=t.replace(/\s?\{([^{]+?)}\s*$/,"")),x.subParser("spanGamut")(a,n,s)),t=n.noHeaderId?"":' id="'+i(t)+'"',r=o-1+r.length,t=""+a+"";return x.subParser("hashBlock")(t,n,s)}),e=s.converter._dispatch("headers.after",e,n,s)}),x.subParser("horizontalRule",function(e,r,t){"use strict";e=t.converter._dispatch("horizontalRule.before",e,r,t);var a=x.subParser("hashBlock")("
",r,t);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,a)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,a)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,a),e=t.converter._dispatch("horizontalRule.after",e,r,t)}),x.subParser("images",function(e,r,d){"use strict";function l(e,r,t,a,n,s,o,i){var l=d.gUrls,c=d.gTitles,u=d.gDimensions;if(t=t.toLowerCase(),i=i||"",-1? ?(['"].*['"])?\)$/m))a="";else if(""===a||null===a){if(a="#"+(t=""!==t&&null!==t?t:r.toLowerCase().replace(/ ?\n/g," ")),x.helper.isUndefined(l[t]))return e;a=l[t],x.helper.isUndefined(c[t])||(i=c[t]),x.helper.isUndefined(u[t])||(n=u[t].width,s=u[t].height)}r=r.replace(/"/g,""").replace(x.helper.regexes.asteriskDashAndColon,x.helper.escapeCharactersCallback);e='"}return e=(e=(e=(e=(e=(e=d.converter._dispatch("images.before",e,r,d)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,l)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(e,r,t,a,n,s,o,i){return l(e,r,t,a=a.replace(/\s/g,""),n,s,0,i)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,l)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,l)).replace(/!\[([^\[\]]+)]()()()()()/g,l),e=d.converter._dispatch("images.after",e,r,d)}),x.subParser("italicsAndBold",function(e,r,t){"use strict";return e=t.converter._dispatch("italicsAndBold.before",e,r,t),e=r.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,r){return""+r+""})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,r){return""+r+""})).replace(/\b_(\S[\s\S]*?)_ \b/g,function(e,r){return""+r+""}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/__(\S[\s\S]*?)__/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/_([^\s_][\s\S]*?)_ /g,function(e,r){return/\S$/.test(r)?""+r+"":e}),e=r.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(e,r,t){return r+""+t+""})).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(e,r,t){return r+""+t+""})).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(e,r,t){return r+""+t+""}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,r){return/\S$/.test(r)?""+r+"":e}),e=t.converter._dispatch("italicsAndBold.after",e,r,t)}),x.subParser("lists",function(e,d,c){"use strict";function p(e,r){c.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var t=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,l=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return d.disableForced4SpacesIndentedSublists&&(t=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(t,function(e,r,t,a,n,s,o){o=o&&""!==o.trim();var n=x.subParser("outdent")(n,d,c),i="";return s&&d.tasklists&&(i=' class="task-list-item"',n=n.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e=''})),n=n.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(e){return"¨A"+e}),n=""+(n=(n=r||-1"})).replace(/¨0/g,""),c.gListLevel--,e=r?e.replace(/\s+$/,""):e}function h(e,r){if("ol"===r){r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function n(n,s,o){var e,i=d.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,l=d.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===s?i:l,u="";return-1!==n.search(c)?function e(r){var t=r.search(c),a=h(n,s);-1!==t?(u+="\n\n<"+s+a+">"+p(r.slice(0,t),!!o)+"",c="ul"===(s="ul"===s?"ol":"ul")?i:l,e(r.slice(t))):u+="\n\n<"+s+a+">"+p(r,!!o)+""}(n):(e=h(n,s),u="\n\n<"+s+e+">"+p(n,!!o)+""),u}return e=c.converter._dispatch("lists.before",e,d,c),e+="¨0",e=(e=c.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,r,t){return n(r,-1"),i+="

",n.push(i))}for(s=n.length,o=0;o]*>\s*]*>/.test(c)&&(u=!0)}n[o]=c}return e=(e=(e=n.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.converter._dispatch("paragraphs.after",e,r,t)}),x.subParser("runExtension",function(e,r,t,a){"use strict";return e.filter?r=e.filter(r,a.converter,t):e.regex&&((a=e.regex)instanceof RegExp||(a=new RegExp(a,"g")),r=r.replace(a,e.replace)),r}),x.subParser("spanGamut",function(e,r,t){"use strict";return e=t.converter._dispatch("spanGamut.before",e,r,t),e=x.subParser("codeSpans")(e,r,t),e=x.subParser("escapeSpecialCharsWithinTagAttributes")(e,r,t),e=x.subParser("encodeBackslashEscapes")(e,r,t),e=x.subParser("images")(e,r,t),e=x.subParser("anchors")(e,r,t),e=x.subParser("autoLinks")(e,r,t),e=x.subParser("simplifiedAutoLinks")(e,r,t),e=x.subParser("emoji")(e,r,t),e=x.subParser("underline")(e,r,t),e=x.subParser("italicsAndBold")(e,r,t),e=x.subParser("strikethrough")(e,r,t),e=x.subParser("ellipsis")(e,r,t),e=x.subParser("hashHTMLSpans")(e,r,t),e=x.subParser("encodeAmpsAndAngles")(e,r,t),r.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
")):e=e.replace(/ +\n/g,"
"),e=t.converter._dispatch("spanGamut.after",e,r,t)}),x.subParser("strikethrough",function(e,t,a){"use strict";return t.strikethrough&&(e=(e=a.converter._dispatch("strikethrough.before",e,t,a)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,r){return r=r,""+(r=t.simplifiedAutoLink?x.subParser("simplifiedAutoLinks")(r,t,a):r)+""}),e=a.converter._dispatch("strikethrough.after",e,t,a)),e}),x.subParser("stripLinkDefinitions",function(i,l,c){"use strict";function e(e,r,t,a,n,s,o){return r=r.toLowerCase(),i.toLowerCase().split(r).length-1<2?e:(t.match(/^data:.+?\/.+?;base64,/)?c.gUrls[r]=t.replace(/\s/g,""):c.gUrls[r]=x.subParser("encodeAmpsAndAngles")(t,l,c),s?s+o:(o&&(c.gTitles[r]=o.replace(/"|'/g,""")),l.parseImgDimensions&&a&&n&&(c.gDimensions[r]={width:a,height:n}),""))}return i=(i=(i=(i+="¨0").replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,e)).replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,e)).replace(/¨0/,"")}),x.subParser("tables",function(e,y,P){"use strict";if(!y.tables)return e;function r(e){for(var r=e.split("\n"),t=0;t"+(n=x.subParser("spanGamut")(n,y,P))+""));for(t=0;t"+x.subParser("spanGamut")(i,y,P)+""));h.push(_)}for(var m=d,f=h,b="",w=m.length,k=0;k",k=0;k";for(var v=0;v"}return b+="
"}return e=(e=(e=(e=P.converter._dispatch("tables.before",e,y,P)).replace(/\\(\|)/g,x.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,r)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,r),e=P.converter._dispatch("tables.after",e,y,P)}),x.subParser("underline",function(e,r,t){"use strict";return r.underline?(e=t.converter._dispatch("underline.before",e,r,t),e=(e=r.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,r){return""+r+""})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,r){return""+r+""}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/__(\S[\s\S]*?)__/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/(_)/g,x.helper.escapeCharactersCallback),t.converter._dispatch("underline.after",e,r,t)):e}),x.subParser("unescapeSpecialChars",function(e,r,t){"use strict";return e=(e=t.converter._dispatch("unescapeSpecialChars.before",e,r,t)).replace(/¨E(\d+)E/g,function(e,r){r=parseInt(r);return String.fromCharCode(r)}),e=t.converter._dispatch("unescapeSpecialChars.after",e,r,t)}),x.subParser("makeMarkdown.blockquote",function(e,r){"use strict";var t="";if(e.hasChildNodes())for(var a=e.childNodes,n=a.length,s=0;s ")}),x.subParser("makeMarkdown.codeBlock",function(e,r){"use strict";var t=e.getAttribute("language"),e=e.getAttribute("precodenum");return"```"+t+"\n"+r.preList[e]+"\n```"}),x.subParser("makeMarkdown.codeSpan",function(e){"use strict";return"`"+e.innerHTML+"`"}),x.subParser("makeMarkdown.emphasis",function(e,r){"use strict";var t="";if(e.hasChildNodes()){t+="*";for(var a=e.childNodes,n=a.length,s=0;s",e.hasAttribute("width")&&e.hasAttribute("height")&&(r+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"),r}),x.subParser("makeMarkdown.links",function(e,r){"use strict";var t="";if(e.hasChildNodes()&&e.hasAttribute("href")){for(var a=e.childNodes,n=a.length,t="[",s=0;s"),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"}return t}),x.subParser("makeMarkdown.list",function(e,r,t){"use strict";var a="";if(!e.hasChildNodes())return"";for(var n=e.childNodes,s=n.length,o=e.getAttribute("start")||1,i=0;i"+r.preList[e]+""}),x.subParser("makeMarkdown.strikethrough",function(e,r){"use strict";var t="";if(e.hasChildNodes()){t+="~~";for(var a=e.childNodes,n=a.length,s=0;str>th"),s=e.querySelectorAll("tbody>tr"),o=0;o/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")});"function"==typeof define&&define.amd?define(function(){"use strict";return x}):"undefined"!=typeof module&&module.exports?module.exports=x:this.showdown=x}.call(this); +!function(){function a(e){"use strict";var r={omitExtraWLInCodeBlocks:{defaultValue:!1,type:"boolean"},noHeaderId:{defaultValue:!1,type:"boolean"},prefixHeaderId:{defaultValue:!1,type:"string"},rawPrefixHeaderId:{defaultValue:!1,type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,type:"boolean"},rawHeaderId:{defaultValue:!1,type:"boolean"},headerLevelStart:{defaultValue:!1,type:"integer"},parseImgDimensions:{defaultValue:!1,type:"boolean"},simplifiedAutoLink:{defaultValue:!1,type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,type:"boolean"},strikethrough:{defaultValue:!1,type:"boolean"},tables:{defaultValue:!1,type:"boolean"},tablesHeaderId:{defaultValue:!1,type:"boolean"},ghCodeBlocks:{defaultValue:!0,type:"boolean"},tasklists:{defaultValue:!1,type:"boolean"},smoothLivePreview:{defaultValue:!1,type:"boolean"},smartIndentationFix:{defaultValue:!1,type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,type:"boolean"},simpleLineBreaks:{defaultValue:!1,type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,type:"boolean"},ghMentions:{defaultValue:!1,type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",type:"string"},encodeEmails:{defaultValue:!0,type:"boolean"},openLinksInNewWindow:{defaultValue:!1,type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,type:"boolean"},emoji:{defaultValue:!1,type:"boolean"},underline:{defaultValue:!1,type:"boolean"},ellipsis:{defaultValue:!0,type:"boolean"},completeHTMLDocument:{defaultValue:!1,type:"boolean"},metadata:{defaultValue:!1,type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(r));var t,a={};for(t in r)r.hasOwnProperty(t)&&(a[t]=r[t].defaultValue);return a}var x={},t={},d={},p=a(!0),h="vanilla",_={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:a(!0),allOn:function(){"use strict";var e,r=a(!0),t={};for(e in r)r.hasOwnProperty(e)&&(t[e]=!0);return t}()};function g(e,r){"use strict";var t=r?"Error in "+r+" extension->":"Error in unnamed extension",a={valid:!0,error:""};x.helper.isArray(e)||(e=[e]);for(var n=0;n").replace(/&/g,"&")};function u(e,r,t,a){"use strict";var n,s,o,i=-1<(a=a||"").indexOf("g"),l=new RegExp(r+"|"+t,"g"+a.replace(/g/g,"")),c=new RegExp(r,a.replace(/g/g,"")),u=[];do{for(n=0;p=l.exec(e);)if(c.test(p[0]))n++||(o=(s=l.lastIndex)-p[0].length);else if(n&&!--n){var d=p.index+p[0].length,p={left:{start:o,end:s},match:{start:s,end:p.index},right:{start:p.index,end:d},wholeMatch:{start:o,end:d}};if(u.push(p),!i)return u}}while(n&&(l.lastIndex=s));return u}function s(u){"use strict";return function(e,r,t,a,n,s,o){var i=t=t.replace(x.helper.regexes.asteriskDashAndColon,x.helper.escapeCharactersCallback),l="",c="",r=r||"",o=o||"";return/^www\./i.test(t)&&(t=t.replace(/^www\./i,"https://www.")),u.excludeTrailingPunctuationFromURLs&&s&&(l=s),r+'"+i+""+l+o}}function o(n,s){"use strict";return function(e,r,t){var a="mailto:";return r=r||"",t=x.subParser("unescapeSpecialChars")(t,n,s),n.encodeEmails?(a=x.helper.encodeEmailAddress(a+t),t=x.helper.encodeEmailAddress(t)):a+=t,r+''+t+""}}x.helper.matchRecursiveRegExp=function(e,r,t,a){"use strict";for(var n=u(e,r,t,a),s=[],o=0;o>=0,t=String(t||" "),e.length>r?String(e):((r-=e.length)>t.length&&(t+=t.repeat(r/t.length)),String(e)+t.slice(0,r))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),x.helper.regexes={asteriskDashAndColon:/([*_:~])/g},x.Converter=function(e){"use strict";var r,t,n={},i=[],l=[],o={},a=h,s={parsed:{},raw:"",format:""};for(r in e=e||{},p)p.hasOwnProperty(r)&&(n[r]=p[r]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);function c(e,r){if(r=r||null,x.helper.isString(e)){if(r=e=x.helper.stdExtName(e),x.extensions[e]){console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!");var t=x.extensions[e],a=e;if("function"==typeof t&&(t=t(new x.Converter)),x.helper.isArray(t)||(t=[t]),!(a=g(t,a)).valid)throw Error(a.error);for(var n=0;n[ \t]+¨NBSP;<"),!r){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");r=window.document}for(var r=r.createElement("div"),t=(r.innerHTML=e,{preList:function(e){for(var r=e.querySelectorAll("pre"),t=[],a=0;a'}else t.push(r[a].innerHTML),r[a].innerHTML="",r[a].setAttribute("prenum",a.toString());return t}(r)}),a=(!function e(r){for(var t=0;t? ?(['"].*['"])?\)$/m))a="";else if(!a){if(a="#"+(t=t||r.toLowerCase().replace(/ ?\n/g," ")),x.helper.isUndefined(l.gUrls[t]))return e;a=l.gUrls[t],x.helper.isUndefined(l.gTitles[t])||(o=l.gTitles[t])}return e=''+""}return e=(e=(e=(e=(e=l.converter._dispatch("anchors.before",e,i,l)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),i.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,function(e,r,t,a,n){if("\\"===t)return r+a;if(!x.helper.isString(i.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");t="";return r+'"+a+""})),e=l.converter._dispatch("anchors.after",e,i,l)});var i=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,l=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,c=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,m=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,f=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi;x.subParser("autoLinks",function(e,r,t){"use strict";return e=(e=(e=t.converter._dispatch("autoLinks.before",e,r,t)).replace(c,s(r))).replace(f,o(r,t)),e=t.converter._dispatch("autoLinks.after",e,r,t)}),x.subParser("simplifiedAutoLinks",function(e,r,t){"use strict";return r.simplifiedAutoLink?(e=t.converter._dispatch("simplifiedAutoLinks.before",e,r,t),e=(e=r.excludeTrailingPunctuationFromURLs?e.replace(l,s(r)):e.replace(i,s(r))).replace(m,o(r,t)),t.converter._dispatch("simplifiedAutoLinks.after",e,r,t)):e}),x.subParser("blockGamut",function(e,r,t){"use strict";return e=t.converter._dispatch("blockGamut.before",e,r,t),e=x.subParser("blockQuotes")(e,r,t),e=x.subParser("headers")(e,r,t),e=x.subParser("horizontalRule")(e,r,t),e=x.subParser("lists")(e,r,t),e=x.subParser("codeBlocks")(e,r,t),e=x.subParser("tables")(e,r,t),e=x.subParser("hashHTMLBlocks")(e,r,t),e=x.subParser("paragraphs")(e,r,t),e=t.converter._dispatch("blockGamut.after",e,r,t)}),x.subParser("blockQuotes",function(e,r,t){"use strict";e=t.converter._dispatch("blockQuotes.before",e,r,t);var a=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return r.splitAdjacentBlockquotes&&(a=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=(e+="\n\n").replace(a,function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=x.subParser("githubCodeBlocks")(e,r,t),e=(e=(e=x.subParser("blockGamut")(e,r,t)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*
[^\r]+?<\/pre>)/gm,function(e,r){return r.replace(/^  /gm,"¨0").replace(/¨0/g,"")}),x.subParser("hashBlock")("
"+e+"\n
",r,t)}),e=t.converter._dispatch("blockQuotes.after",e,r,t)}),x.subParser("codeBlocks",function(e,n,s){"use strict";e=s.converter._dispatch("codeBlocks.before",e,n,s);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,function(e,r,t){var a="\n",r=x.subParser("outdent")(r,n,s);return r=x.subParser("encodeCode")(r,n,s),r="
"+(r=(r=(r=x.subParser("detab")(r,n,s)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+(a=n.omitExtraWLInCodeBlocks?"":a)+"
",x.subParser("hashBlock")(r,n,s)+t})).replace(/¨0/,""),e=s.converter._dispatch("codeBlocks.after",e,n,s)}),x.subParser("codeSpans",function(e,n,s){"use strict";return e=(e=void 0===(e=s.converter._dispatch("codeSpans.before",e,n,s))?"":e).replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,r,t,a){return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=r+""+(a=x.subParser("encodeCode")(a,n,s))+"",a=x.subParser("hashHTMLSpans")(a,n,s)}),e=s.converter._dispatch("codeSpans.after",e,n,s)}),x.subParser("completeHTMLDocument",function(e,r,t){"use strict";if(!r.completeHTMLDocument)return e;e=t.converter._dispatch("completeHTMLDocument.before",e,r,t);var a,n="html",s="",o="",i='',l="",c="";for(a in void 0!==t.metadata.parsed.doctype&&(s="","html"!==(n=t.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='')),t.metadata.parsed)if(t.metadata.parsed.hasOwnProperty(a))switch(a.toLowerCase()){case"doctype":break;case"title":o=""+t.metadata.parsed.title+"";break;case"charset":i="html"===n||"html5"===n?'':'';break;case"language":case"lang":l=' lang="'+t.metadata.parsed[a]+'"',c+='';break;default:c+=''}return e=s+""+o+i+c+""+e.trim()+"\n",e=t.converter._dispatch("completeHTMLDocument.after",e,r,t)}),x.subParser("detab",function(e,r,t){"use strict";return e=(e=(e=(e=(e=(e=t.converter._dispatch("detab.before",e,r,t)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,function(e,r){for(var t=r,a=4-t.length%4,n=0;n/g,">"),e=t.converter._dispatch("encodeAmpsAndAngles.after",e,r,t)}),x.subParser("encodeBackslashEscapes",function(e,r,t){"use strict";return e=(e=(e=t.converter._dispatch("encodeBackslashEscapes.before",e,r,t)).replace(/\\(\\)/g,x.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,x.helper.escapeCharactersCallback),e=t.converter._dispatch("encodeBackslashEscapes.after",e,r,t)}),x.subParser("encodeCode",function(e,r,t){"use strict";return e=(e=t.converter._dispatch("encodeCode.before",e,r,t)).replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,x.helper.escapeCharactersCallback),e=t.converter._dispatch("encodeCode.after",e,r,t)}),x.subParser("escapeSpecialCharsWithinTagAttributes",function(e,r,t){"use strict";return e=(e=(e=t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,r,t)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,x.helper.escapeCharactersCallback)})).replace(/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,function(e){return e.replace(/([\\`*_~=|])/g,x.helper.escapeCharactersCallback)}),e=t.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,r,t)}),x.subParser("githubCodeBlocks",function(e,s,o){"use strict";return s.ghCodeBlocks?(e=o.converter._dispatch("githubCodeBlocks.before",e,s,o),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(e,r,t,a){var n=s.omitExtraWLInCodeBlocks?"":"\n";return a=x.subParser("encodeCode")(a,s,o),a="
"+(a=(a=(a=x.subParser("detab")(a,s,o)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+n+"
",a=x.subParser("hashBlock")(a,s,o),"\n\n¨G"+(o.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"})).replace(/¨0/,""),o.converter._dispatch("githubCodeBlocks.after",e,s,o)):e}),x.subParser("hashBlock",function(e,r,t){"use strict";return e=(e=t.converter._dispatch("hashBlock.before",e,r,t)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(t.gHtmlBlocks.push(e)-1)+"K\n\n",e=t.converter._dispatch("hashBlock.after",e,r,t)}),x.subParser("hashCodeTags",function(e,n,s){"use strict";e=s.converter._dispatch("hashCodeTags.before",e,n,s);return e=x.helper.replaceRecursiveRegExp(e,function(e,r,t,a){t=t+x.subParser("encodeCode")(r,n,s)+a;return"¨C"+(s.gHtmlSpans.push(t)-1)+"C"},"]*>","","gim"),e=s.converter._dispatch("hashCodeTags.after",e,n,s)}),x.subParser("hashElement",function(e,r,t){"use strict";return function(e,r){return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),r="\n\n¨K"+(t.gHtmlBlocks.push(r)-1)+"K\n\n"}}),x.subParser("hashHTMLBlocks",function(e,r,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,r,n);function t(e,r,t,a){return-1!==t.search(/\bmarkdown\b/)&&(e=t+n.converter.makeHtml(r)+a),"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"}var a=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"];r.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,function(e,r){return"<"+r+">"}));for(var s=0;s]*>)","im"),i="<"+a[s]+"\\b[^>]*>",l="";-1!==(c=x.helper.regexIndexOf(e,o));){var c=x.helper.splitAtIndex(e,c),u=x.helper.replaceRecursiveRegExp(c[1],t,i,l,"im");if(u===c[1])break;e=c[0].concat(u)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,x.subParser("hashElement")(e,r,n)),e=(e=x.helper.replaceRecursiveRegExp(e,function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"},"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,x.subParser("hashElement")(e,r,n)),e=n.converter._dispatch("hashHTMLBlocks.after",e,r,n)}),x.subParser("hashHTMLSpans",function(e,r,t){"use strict";function a(e){return"¨C"+(t.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=t.converter._dispatch("hashHTMLSpans.before",e,r,t)).replace(/<[^>]+?\/>/gi,a)).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,a)).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,a)).replace(/<[^>]+?>/gi,a),e=t.converter._dispatch("hashHTMLSpans.after",e,r,t)}),x.subParser("unhashHTMLSpans",function(e,r,t){"use strict";e=t.converter._dispatch("unhashHTMLSpans.before",e,r,t);for(var a=0;a]*>\\s*]*>","^ {0,3}\\s*
","gim"),e=s.converter._dispatch("hashPreCodeTags.after",e,n,s)}),x.subParser("headers",function(e,n,s){"use strict";e=s.converter._dispatch("headers.before",e,n,s);var o=isNaN(parseInt(n.headerLevelStart))?1:parseInt(n.headerLevelStart),r=n.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,t=n.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm,r=(e=(e=e.replace(r,function(e,r){var t=x.subParser("spanGamut")(r,n,s),r=n.noHeaderId?"":' id="'+i(r)+'"',r=""+t+"";return x.subParser("hashBlock")(r,n,s)})).replace(t,function(e,r){var t=x.subParser("spanGamut")(r,n,s),r=n.noHeaderId?"":' id="'+i(r)+'"',a=o+1,r=""+t+"";return x.subParser("hashBlock")(r,n,s)}),n.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm);function i(e){var r=e=n.customizedHeaderId&&(r=e.match(/\{([^{]+?)}\s*$/))&&r[1]?r[1]:e,e=x.helper.isString(n.prefixHeaderId)?n.prefixHeaderId:!0===n.prefixHeaderId?"section-":"";return n.rawPrefixHeaderId||(r=e+r),r=(n.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,""):n.rawHeaderId?r.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-"):r.replace(/[^\w]/g,"")).toLowerCase(),n.rawPrefixHeaderId&&(r=e+r),s.hashLinkCounts[r]?r=r+"-"+s.hashLinkCounts[r]++:s.hashLinkCounts[r]=1,r}return e=e.replace(r,function(e,r,t){var a=t,a=(n.customizedHeaderId&&(a=t.replace(/\s?\{([^{]+?)}\s*$/,"")),x.subParser("spanGamut")(a,n,s)),t=n.noHeaderId?"":' id="'+i(t)+'"',r=o-1+r.length,t=""+a+"";return x.subParser("hashBlock")(t,n,s)}),e=s.converter._dispatch("headers.after",e,n,s)}),x.subParser("horizontalRule",function(e,r,t){"use strict";e=t.converter._dispatch("horizontalRule.before",e,r,t);var a=x.subParser("hashBlock")("
",r,t);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,a)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,a)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,a),e=t.converter._dispatch("horizontalRule.after",e,r,t)}),x.subParser("images",function(e,r,d){"use strict";function l(e,r,t,a,n,s,o,i){var l=d.gUrls,c=d.gTitles,u=d.gDimensions;if(t=t.toLowerCase(),i=i||"",-1? ?(['"].*['"])?\)$/m))a="";else if(""===a||null===a){if(a="#"+(t=""!==t&&null!==t?t:r.toLowerCase().replace(/ ?\n/g," ")),x.helper.isUndefined(l[t]))return e;a=l[t],x.helper.isUndefined(c[t])||(i=c[t]),x.helper.isUndefined(u[t])||(n=u[t].width,s=u[t].height)}r=r.replace(/"/g,""").replace(x.helper.regexes.asteriskDashAndColon,x.helper.escapeCharactersCallback);e='"}return e=(e=(e=(e=(e=(e=d.converter._dispatch("images.before",e,r,d)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,l)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,function(e,r,t,a,n,s,o,i){return l(e,r,t,a=a.replace(/\s/g,""),n,s,0,i)})).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,l)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,l)).replace(/!\[([^\[\]]+)]()()()()()/g,l),e=d.converter._dispatch("images.after",e,r,d)}),x.subParser("italicsAndBold",function(e,r,t){"use strict";return e=t.converter._dispatch("italicsAndBold.before",e,r,t),e=r.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,r){return""+r+""})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,r){return""+r+""})).replace(/\b_(\S[\s\S]*?)_ \b/g,function(e,r){return""+r+""}):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/__(\S[\s\S]*?)__/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/_([^\s_][\s\S]*?)_ /g,function(e,r){return/\S$/.test(r)?""+r+"":e}),e=r.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(e,r,t){return r+""+t+""})).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(e,r,t){return r+""+t+""})).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(e,r,t){return r+""+t+""}):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/\*\*(\S[\s\S]*?)\*\*/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/\*([^\s*][\s\S]*?)\*/g,function(e,r){return/\S$/.test(r)?""+r+"":e}),e=t.converter._dispatch("italicsAndBold.after",e,r,t)}),x.subParser("lists",function(e,d,c){"use strict";function p(e,r){c.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var t=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,l=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return d.disableForced4SpacesIndentedSublists&&(t=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(t,function(e,r,t,a,n,s,o){o=o&&""!==o.trim();var n=x.subParser("outdent")(n,d,c),i="";return s&&d.tasklists&&(i=' class="task-list-item"',n=n.replace(/^[ \t]*\[(x|X| )?]/m,function(){var e='"+(n=(n=r||-1"})).replace(/¨0/g,""),c.gListLevel--,e=r?e.replace(/\s+$/,""):e}function h(e,r){if("ol"===r){r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function n(n,s,o){var e,i=d.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,l=d.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===s?i:l,u="";return-1!==n.search(c)?function e(r){var t=r.search(c),a=h(n,s);-1!==t?(u+="\n\n<"+s+a+">"+p(r.slice(0,t),!!o)+"",c="ul"===(s="ul"===s?"ol":"ul")?i:l,e(r.slice(t))):u+="\n\n<"+s+a+">"+p(r,!!o)+""}(n):(e=h(n,s),u="\n\n<"+s+e+">"+p(n,!!o)+""),u}return e=c.converter._dispatch("lists.before",e,d,c),e+="¨0",e=(e=c.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(e,r,t){return n(r,-1"),i+="

",n.push(i))}for(s=n.length,o=0;o]*>\s*]*>/.test(c)&&(u=!0)}n[o]=c}return e=(e=(e=n.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.converter._dispatch("paragraphs.after",e,r,t)}),x.subParser("runExtension",function(e,r,t,a){"use strict";return e.filter?r=e.filter(r,a.converter,t):e.regex&&((a=e.regex)instanceof RegExp||(a=new RegExp(a,"g")),r=r.replace(a,e.replace)),r}),x.subParser("spanGamut",function(e,r,t){"use strict";return e=t.converter._dispatch("spanGamut.before",e,r,t),e=x.subParser("codeSpans")(e,r,t),e=x.subParser("escapeSpecialCharsWithinTagAttributes")(e,r,t),e=x.subParser("encodeBackslashEscapes")(e,r,t),e=x.subParser("images")(e,r,t),e=x.subParser("anchors")(e,r,t),e=x.subParser("autoLinks")(e,r,t),e=x.subParser("simplifiedAutoLinks")(e,r,t),e=x.subParser("emoji")(e,r,t),e=x.subParser("underline")(e,r,t),e=x.subParser("italicsAndBold")(e,r,t),e=x.subParser("strikethrough")(e,r,t),e=x.subParser("ellipsis")(e,r,t),e=x.subParser("hashHTMLSpans")(e,r,t),e=x.subParser("encodeAmpsAndAngles")(e,r,t),r.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"
")):e=e.replace(/ +\n/g,"
"),e=t.converter._dispatch("spanGamut.after",e,r,t)}),x.subParser("strikethrough",function(e,t,a){"use strict";return t.strikethrough&&(e=(e=a.converter._dispatch("strikethrough.before",e,t,a)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(e,r){return r=r,""+(r=t.simplifiedAutoLink?x.subParser("simplifiedAutoLinks")(r,t,a):r)+""}),e=a.converter._dispatch("strikethrough.after",e,t,a)),e}),x.subParser("stripLinkDefinitions",function(i,l,c){"use strict";function e(e,r,t,a,n,s,o){return r=r.toLowerCase(),i.toLowerCase().split(r).length-1<2?e:(t.match(/^data:.+?\/.+?;base64,/)?c.gUrls[r]=t.replace(/\s/g,""):c.gUrls[r]=x.subParser("encodeAmpsAndAngles")(t,l,c),s?s+o:(o&&(c.gTitles[r]=o.replace(/"|'/g,""")),l.parseImgDimensions&&a&&n&&(c.gDimensions[r]={width:a,height:n}),""))}return i=(i=(i=(i+="¨0").replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,e)).replace(/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,e)).replace(/¨0/,"")}),x.subParser("tables",function(e,y,P){"use strict";if(!y.tables)return e;function r(e){for(var r=e.split("\n"),t=0;t"+(n=x.subParser("spanGamut")(n,y,P))+""));for(t=0;t"+x.subParser("spanGamut")(i,y,P)+""));h.push(_)}for(var m=d,f=h,b="",w=m.length,k=0;k",k=0;k";for(var v=0;v"}return b+="
"}return e=(e=(e=(e=P.converter._dispatch("tables.before",e,y,P)).replace(/\\(\|)/g,x.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,r)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,r),e=P.converter._dispatch("tables.after",e,y,P)}),x.subParser("underline",function(e,r,t){"use strict";return r.underline?(e=t.converter._dispatch("underline.before",e,r,t),e=(e=r.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,function(e,r){return""+r+""})).replace(/\b__(\S[\s\S]*?)__\b/g,function(e,r){return""+r+""}):(e=e.replace(/___(\S[\s\S]*?)___/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/__(\S[\s\S]*?)__/g,function(e,r){return/\S$/.test(r)?""+r+"":e})).replace(/(_)/g,x.helper.escapeCharactersCallback),t.converter._dispatch("underline.after",e,r,t)):e}),x.subParser("unescapeSpecialChars",function(e,r,t){"use strict";return e=(e=t.converter._dispatch("unescapeSpecialChars.before",e,r,t)).replace(/¨E(\d+)E/g,function(e,r){r=parseInt(r);return String.fromCharCode(r)}),e=t.converter._dispatch("unescapeSpecialChars.after",e,r,t)}),x.subParser("makeMarkdown.blockquote",function(e,r){"use strict";var t="";if(e.hasChildNodes())for(var a=e.childNodes,n=a.length,s=0;s ")}),x.subParser("makeMarkdown.codeBlock",function(e,r){"use strict";var t=e.getAttribute("language"),e=e.getAttribute("precodenum");return"```"+t+"\n"+r.preList[e]+"\n```"}),x.subParser("makeMarkdown.codeSpan",function(e){"use strict";return"`"+e.innerHTML+"`"}),x.subParser("makeMarkdown.emphasis",function(e,r){"use strict";var t="";if(e.hasChildNodes()){t+="*";for(var a=e.childNodes,n=a.length,s=0;s",e.hasAttribute("width")&&e.hasAttribute("height")&&(r+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"),r}),x.subParser("makeMarkdown.links",function(e,r){"use strict";var t="";if(e.hasChildNodes()&&e.hasAttribute("href")){for(var a=e.childNodes,n=a.length,t="[",s=0;s"),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"}return t}),x.subParser("makeMarkdown.list",function(e,r,t){"use strict";var a="";if(!e.hasChildNodes())return"";for(var n=e.childNodes,s=n.length,o=e.getAttribute("start")||1,i=0;i"+r.preList[e]+""}),x.subParser("makeMarkdown.strikethrough",function(e,r){"use strict";var t="";if(e.hasChildNodes()){t+="~~";for(var a=e.childNodes,n=a.length,s=0;str>th"),s=e.querySelectorAll("tbody>tr"),o=0;o/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")});"function"==typeof define&&define.amd?define(function(){"use strict";return x}):"undefined"!=typeof module&&module.exports?module.exports=x:this.showdown=x}.call(this); diff --git a/src/assets/php/addNote.php b/src/assets/php/addNote.php index 89fa9ec..8b70468 100644 --- a/src/assets/php/addNote.php +++ b/src/assets/php/addNote.php @@ -10,7 +10,7 @@ http_response_code(403); return; } -if (isset($_SESSION['nom'], $_SESSION['key'], $_SESSION['userId'], $_POST['title'], $_POST['desc'], $_POST['date'], $_POST['couleur'], $_POST['hidden']) === false) { +if (isset($_SESSION['nom'], $_POST['title'], $_POST['desc'], $_POST['date'], $_POST['couleur'], $_POST['hidden']) === false) { http_response_code(403); return; } @@ -19,20 +19,16 @@ return; } -require_once __DIR__ . '/config/config.php'; +require_once __DIR__ . '/getKey.php'; require_once __DIR__ . '/class/Encryption.php'; $encryption = new Encryption\Encryption(); -$key = $_SESSION['key']; -$desc = $_POST['desc']; -$desc = $encryption->encryptData($desc, $key); $title = $_POST['title']; -$title = $encryption->encryptData($title, $key); +$desc = $_POST['desc']; $couleur = $_POST['couleur']; $dateNote = $_POST['date']; $hidden = $_POST['hidden']; -$nom = $_SESSION['nom']; $couleursAutorisees = [ "Noir", "Blanc", @@ -52,15 +48,15 @@ } try { - $query = $PDO->prepare("INSERT INTO notes (titre,content,dateNote,couleur,user,hiddenNote) VALUES (:Title,:Descr,:DateNote,:Couleur,:User,:HiddenNote)"); + $query = $PDO->prepare("INSERT INTO notes (titre,content,dateNote,couleur,user,hiddenNote) VALUES (:Titre,:Content,:DateNote,:Couleur,:User,:HiddenNote)"); $query->execute( [ - ':Title' => $title, - ':Descr' => $desc, - ':DateNote' => $dateNote, - ':Couleur' => $couleur, - ':User' => $nom, - ':HiddenNote' => $hidden + ':Titre' => $encryption->encryptData($title, $key), + ':Content' => $encryption->encryptData($desc, $key), + ':DateNote' => $dateNote, + ':Couleur' => $couleur, + ':User' => $nom, + ':HiddenNote' => $hidden ] ); } catch (Exception $e) { diff --git a/src/assets/php/config/config.php b/src/assets/php/config/config.php index d109e58..50ab312 100644 --- a/src/assets/php/config/config.php +++ b/src/assets/php/config/config.php @@ -2,20 +2,20 @@ // THIS IS NOT THE REAL CONFIG FILE, THIS IS JUST AN EXAMPLE FOR SELF-HOSTING -$server = 'localhost'; -$database = 'notes'; -$user = 'root'; -$password = ''; -$port = "3306"; -$charset = 'utf8mb4'; -$options = [ +$host = 'localhost'; +$db = 'notes'; +$user = 'root'; +$pass = ''; +$port = "3306"; +$charset = 'utf8mb4'; +$options = [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, \PDO::ATTR_EMULATE_PREPARES => false, ]; -$dsn = "mysql:host=$server;dbname=$database;charset=$charset;port=$port"; +$dsn = "mysql:host=$host;dbname=$db;charset=$charset;port=$port"; try { - $PDO = new \PDO($dsn, $user, $password, $options); + $PDO = new \PDO($dsn, $user, $pass, $options); } catch (\PDOException $e) { throw new \PDOException($e->getMessage(), (int)$e->getCode()); } diff --git a/src/assets/php/connectUser.php b/src/assets/php/connectUser.php index c53e6c3..4691ff9 100644 --- a/src/assets/php/connectUser.php +++ b/src/assets/php/connectUser.php @@ -29,7 +29,7 @@ $mdpConnect = $_POST['mdpConnect']; try { - $query = $PDO->prepare("SELECT id,nom,mdp,tri,one_key FROM users WHERE nom=:NomConnect LIMIT 1"); + $query = $PDO->prepare("SELECT id,nom,mdp,tri FROM users WHERE nom=:NomConnect LIMIT 1"); $query->execute([':NomConnect' => $nomConnect]); $row = $query->fetch(PDO::FETCH_ASSOC); } catch (Exception $e) { @@ -61,4 +61,3 @@ $_SESSION['nom'] = $row['nom']; $_SESSION['userId'] = $row['id']; $_SESSION['tri'] = $row['tri']; -$_SESSION['key'] = $row['one_key']; diff --git a/src/assets/php/getKey.php b/src/assets/php/getKey.php new file mode 100644 index 0000000..f8f3580 --- /dev/null +++ b/src/assets/php/getKey.php @@ -0,0 +1,43 @@ +prepare("SELECT one_key FROM users WHERE nom=:CurrentUser AND id=:UserId LIMIT 1"); + $query->execute( + [ + ':CurrentUser' => $nom, + ':UserId' => $userId + ] + ); +} catch (Exception $e) { + http_response_code(500); + return; +} + +$key = $query->fetch(PDO::FETCH_ASSOC)['one_key']; +$query->closeCursor(); diff --git a/src/assets/php/getNotes.php b/src/assets/php/getNotes.php index 82441ba..095e85c 100644 --- a/src/assets/php/getNotes.php +++ b/src/assets/php/getNotes.php @@ -1,25 +1,9 @@ prepare("SELECT clearTitre, clearContent, dateNote, couleur, link FROM notes WHERE link=:NoteLink"); + $query = $PDO->prepare("SELECT users.one_key FROM users,notes WHERE notes.link=:NoteLink"); + $query->execute([':NoteLink' => $noteLink]); + $key = $query->fetch(PDO::FETCH_ASSOC)['one_key']; +} catch (Exception $e) { + http_response_code(404); + return; +} + +$query->closeCursor(); + +require_once __DIR__ . '/class/Encryption.php'; + +$encryption = new Encryption\Encryption(); + +try { + $query = $PDO->prepare("SELECT titre,content,dateNote,couleur FROM notes WHERE link=:NoteLink"); $query->execute([':NoteLink' => $noteLink]); $items = []; while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $items[] = [ - 'title' => $row['clearTitre'], - 'desc' => $row['clearContent'], + 'title' => $encryption->decryptData($row['titre'], $key), + 'desc' => $encryption->decryptData($row['content'], $key), 'date' => $row['dateNote'], 'couleur' => $row['couleur'] ]; diff --git a/src/assets/php/privateNote.php b/src/assets/php/privateNote.php index 5438742..50eda31 100644 --- a/src/assets/php/privateNote.php +++ b/src/assets/php/privateNote.php @@ -1,52 +1,60 @@ -prepare("UPDATE notes SET link = NULL, clearTitre = NULL, clearContent = NULL WHERE id=:NoteId AND user=:CurrentUser AND link=:NoteLink"); - $query->execute( - [ - ':NoteLink' => $noteLink, - ':NoteId' => $noteId, - ':CurrentUser' => $nom - ] - ); - $query->closeCursor(); - $PDO = null; -} catch (Exception $e) { - http_response_code(500); - return; -} - -$directoryPath = '../../share/' . $noteLink; -if (is_dir($directoryPath)) { - $files = glob($directoryPath . '/*.*'); - foreach ($files as $file) { - unlink($file); - } - if (rmdir($directoryPath)) { - http_response_code(200); - return; - } else { - http_response_code(403); - return; - } -} else { - http_response_code(404); - return; -} +prepare("UPDATE notes SET link = NULL WHERE id=:NoteId AND user=:CurrentUser AND link=:NoteLink"); + $query->execute( + [ + ':NoteLink' => $noteLink, + ':NoteId' => $noteId, + ':CurrentUser' => $nom + ] + ); + $query->closeCursor(); + $PDO = null; +} catch (Exception $e) { + http_response_code(500); + return; +} + +$directoryPath = '../../share/' . htmlspecialchars($noteLink); +if (is_dir($directoryPath)) { + $files = glob($directoryPath . '/*.*'); + foreach ($files as $file) { + unlink($file); + } + if (rmdir($directoryPath)) { + http_response_code(200); + return; + } else { + http_response_code(403); + return; + } +} else { + http_response_code(404); + return; +} diff --git a/src/assets/php/publicNote.php b/src/assets/php/publicNote.php index c899735..5a9b3fb 100644 --- a/src/assets/php/publicNote.php +++ b/src/assets/php/publicNote.php @@ -1,83 +1,87 @@ -prepare("UPDATE notes SET link=:NoteLink, clearTitre=:ClearTitle, clearContent=:ClearContent WHERE id=:NoteId AND user=:CurrentUser AND link IS NULL"); - $query->execute( - [ - ':NoteLink' => $noteLink, - ':NoteId' => $noteId, - ':CurrentUser' => $nom, - ':ClearTitle' => $title, - ':ClearContent' => $desc - ] - ); - $query->closeCursor(); - $PDO = null; -} catch (Exception $e) { - http_response_code(500); - return; -} - -$directoryPath = '../../share/' . $noteLink; -if (is_dir($directoryPath) === false) { - if (mkdir($directoryPath)) { - $index = fopen($directoryPath . '/index.php', 'w'); - $indexContent = - << - - - - - Bloc-notes – Léo SEGUIN - - - - - - - - - -
- - - - - - EOT; - $indexContent = sprintf($indexContent, $noteLink); - fwrite($index, $indexContent); - fclose($index); - } else { - http_response_code(403); - return; - } -} else { - http_response_code(500); - return; -} +prepare("UPDATE notes SET link=:NoteLink WHERE id=:NoteId AND user=:CurrentUser AND link IS NULL"); + $query->execute( + [ + ':NoteLink' => $noteLink, + ':NoteId' => $noteId, + ':CurrentUser' => $nom, + ] + ); + $query->closeCursor(); + $PDO = null; +} catch (Exception $e) { + http_response_code(500); + return; +} + +$directoryPath = '../../share/' . htmlspecialchars($noteLink); +if (is_dir($directoryPath) === false) { + if (mkdir($directoryPath, 0755, true)) { + $index = fopen($directoryPath . '/index.php', 'w'); + $indexContent = + << + + + + + Bloc-notes – Léo SEGUIN + + + + + + + + + +
+ + + + + + EOT; + $indexContent = sprintf($indexContent, $noteLink); + fwrite($index, $indexContent); + fclose($index); + } else { + http_response_code(403); + return; + } +} else { + http_response_code(500); + return; +} diff --git a/src/assets/php/updateNote.php b/src/assets/php/updateNote.php index ca3fa20..5dadbd2 100644 --- a/src/assets/php/updateNote.php +++ b/src/assets/php/updateNote.php @@ -10,7 +10,7 @@ http_response_code(403); return; } -if (isset($_SESSION['nom'], $_SESSION['key'], $_POST['noteId'], $_POST['title'], $_POST['desc'], $_POST['date'], $_POST['couleur'], $_POST['hidden'], $_POST['link']) === false) { +if (isset($_SESSION['nom'], $_POST['noteId'], $_POST['title'], $_POST['desc'], $_POST['date'], $_POST['couleur'], $_POST['hidden'], $_POST['link']) === false) { http_response_code(403); return; } @@ -26,13 +26,16 @@ http_response_code(403); return; } +if ($_POST['link'] !== '' && $_POST['hidden'] === '1') { + http_response_code(403); + return; +} -require_once __DIR__ . '/config/config.php'; +require_once __DIR__ . '/getKey.php'; require_once __DIR__ . '/class/Encryption.php'; $encryption = new Encryption\Encryption(); -$key = $_SESSION['key']; $desc = $_POST['desc']; $descEncrypted = $encryption->encryptData($desc, $key); $title = $_POST['title']; @@ -62,35 +65,18 @@ } try { - if ($link === '') { - $query = $PDO->prepare("UPDATE notes SET titre=:Title,content=:Descr,dateNote=:DateNote,couleur=:Couleur,hiddenNote=:HiddenNote WHERE id=:NoteId AND user=:User"); - $query->execute( - [ - ':Title' => $titleEncrypted, - ':Descr' => $descEncrypted, - ':Couleur' => $couleur, - ':NoteId' => $noteId, - ':DateNote' => $dateNote, - ':User' => $nom, - ':HiddenNote' => $hidden - ] - ); - } else { - $query = $PDO->prepare("UPDATE notes SET titre=:Title,content=:Descr,dateNote=:DateNote,couleur=:Couleur,hiddenNote=:HiddenNote,clearTitre=:ClearTitle,clearContent=:ClearContent WHERE id=:NoteId AND user=:User"); - $query->execute( - [ - ':Title' => $titleEncrypted, - ':Descr' => $descEncrypted, - ':Couleur' => $couleur, - ':NoteId' => $noteId, - ':DateNote' => $dateNote, - ':User' => $nom, - ':HiddenNote' => $hidden, - ':ClearTitle' => $title, - ':ClearContent' => $desc - ] - ); - } + $query = $PDO->prepare("UPDATE notes SET titre=:Title,content=:Descr,dateNote=:DateNote,couleur=:Couleur,hiddenNote=:HiddenNote WHERE id=:NoteId AND user=:User"); + $query->execute( + [ + ':Title' => $titleEncrypted, + ':Descr' => $descEncrypted, + ':Couleur' => $couleur, + ':NoteId' => $noteId, + ':DateNote' => $dateNote, + ':User' => $nom, + ':HiddenNote' => $hidden + ] + ); } catch (Exception $e) { http_response_code(500); return; diff --git a/src/assets/sass/style.scss b/src/assets/sass/style.scss index 298b190..bbab561 100644 --- a/src/assets/sass/style.scss +++ b/src/assets/sass/style.scss @@ -24,6 +24,7 @@ html { -webkit-tap-highlight-color: transparent; scrollbar-width: thin; scrollbar-color: rgba(100, 100, 100, 50%) rgba(0, 0, 0, 0); + font-family: Arial, sans-serif; ::-webkit-scrollbar-thumb { background: rgba(100, 100, 100, 50%); @@ -31,7 +32,6 @@ html { } * { - font-family: Arial, sans-serif; margin: 0; box-sizing: border-box; } @@ -94,6 +94,7 @@ code { li { margin-left: -1rem; + word-break: break-word; } img { @@ -113,6 +114,10 @@ nav { h1 { display: inline-block; + + i { + font-size: 2rem; + } } div { @@ -145,8 +150,6 @@ nav { } input { - font-size: 1rem; - height: 50px; width: 180px; border: none; border-radius: 24px; @@ -225,6 +228,8 @@ main { display: inline-block; white-space: nowrap; font-weight: 700; + vertical-align: bottom; + margin-right: 5px; } .dateList { @@ -234,12 +239,17 @@ main { } } -label { - vertical-align: middle; +input { + font-family: OpenSans, sans-serif; +} + +input[type="checkbox"] { + width: 20px; + height: 20px; + margin: 0 5px; } input, -textarea, select { height: 50px; width: 100%; @@ -253,7 +263,10 @@ option { } textarea { + font-family: OpenSans, sans-serif; + font-size: 1rem; height: 250px; + width: 100%; min-height: 200px; max-height: 450px; resize: vertical; @@ -261,12 +274,13 @@ textarea { } button { + font-family: OpenSans, sans-serif; + font-size: 1rem; cursor: pointer; width: 100%; height: 50px; border: none; padding: 0 1rem; - font-size: 1rem; border-radius: 5px; transition: .1s; @@ -276,7 +290,7 @@ button { } form { - margin: 1rem 0; + margin: 10px 0; } p.welcome { @@ -293,13 +307,13 @@ p.welcome { display: flex; flex-direction: column; justify-content: space-between; - border-radius: 1rem; + border-radius: 10px; clip-path: polygon(25px 0, 100% 0, 100% 100%, 0 100%, 0 25px); transition: clip-path .4s; width: 400px; max-height: 460px; line-height: 2; - padding: 30px 20px 10px; + padding: 15px 15px 10px; &:hover, &:focus { @@ -376,17 +390,12 @@ p.welcome { align-items: center; justify-content: center; cursor: pointer; - margin: 0 4px; + margin: 0 5px; width: 30px; height: 30px; border-radius: 50%; transition: .1s; } - - span { - font-size: .7rem; - transition: .1s; - } } } @@ -400,13 +409,11 @@ p.welcome { z-index: 3; width: 80vw; min-height: 80vh; - top: 10%; - left: 0; - right: 0; margin: auto; + inset: 0; .details { - min-height: 70vh; + max-height: 100%; } } @@ -414,22 +421,6 @@ p.welcome { overflow: hidden; } -.darken { - display: none; - position: fixed; - top: 0; - left: 0; - z-index: 3; - height: 100%; - width: 100%; - -webkit-backdrop-filter: blur(10px); - backdrop-filter: blur(10px); - - &.show { - display: block; - } -} - .popup, header { display: flex; @@ -465,12 +456,11 @@ select { } .connect-box, -.connect-popup-box, .creer-box, .gestion-popup-box, .public-note-popup-box, .private-note-popup-box, -.popup-box { +.note-popup-box { display: none; pointer-events: none; position: fixed; @@ -496,10 +486,9 @@ select { } .connect-box.show, -.connect-popup-box.show, .creer-box.show, .gestion-popup-box.show, -.popup-box.show, +.note-popup-box.show, .public-note-popup-box.show, .private-note-popup-box.show { display: flex; @@ -507,10 +496,9 @@ select { } .connect-box.show .popup, -.connect-popup-box.show .popup, .creer-box.show .popup, .gestion-popup-box.show .popup, -.popup-box.show .popup, +.note-popup-box.show .popup, .public-note-popup-box.show .popup, .private-note-popup-box.show .popup { display: flex; @@ -572,11 +560,9 @@ select { margin: 0 5px; } -.divLanguage { - .language { - width: 50px; - padding: 0; - } +#language { + width: 50px; + padding: 0; } .copyright { @@ -589,24 +575,6 @@ select { text-align: right; } -.check { - position: relative; - margin-left: -40px; - width: 32px; - height: 25px; - vertical-align: middle; - opacity: 0; - - &:checked+label svg g path { - stroke-dashoffset: 0; - } -} - -.path1 { - stroke-dasharray: 400; - stroke-dashoffset: 400; -} - #errorNotification { position: fixed; top: 1rem; @@ -668,10 +636,6 @@ select { .task-list-item { list-style-type: none; margin-left: -2rem; - - * { - vertical-align: middle; - } } @media (min-width: 901px) { @@ -713,9 +677,7 @@ select { input { width: 60%; - vertical-align: middle; padding: 5px; - margin: 0 10px; } .linkp { @@ -724,21 +686,18 @@ select { .gestionCompte, .seconnecter, - .fa-bars, - .resync { + .fa-bars { display: inline; - vertical-align: middle; cursor: pointer; } i { - font-size: 1.1rem; + vertical-align: middle; + font-size: 1.8rem; } - .gestionCompte i, - .seconnecter i { - font-size: 1.8rem; - vertical-align: middle; + .fa-bars { + font-size: 1.2rem; } .fa-magnifying-glass { @@ -752,7 +711,7 @@ select { } main { - padding: 0 5px 5rem; + padding: 0 0 5rem; gap: 10px; } @@ -812,21 +771,32 @@ select { } .note { - width: 98%; + width: 100%; max-height: 300px; + margin: 0 10px; + + .bottom-content { + visibility: visible; + opacity: 1; + } + + .title { + font-size: 1.1rem; + } .details { - overflow-y: hidden; - max-height: 75vh; + overflow: hidden; + font-size: .9rem; } } .fullscreen { - min-height: calc(100vh - 5rem); - top: 1rem; + min-height: 100dvh; + inset: auto; + top: 0; .details { - overflow-y: auto; + overflow: auto; } } @@ -882,14 +852,15 @@ html.dark { background: $color2; .search-input { - background: $color3; + background: $color1; ::placeholder { color: $color4; } input { - background: $color3; + background: $color1; + border: none; &:focus { outline: none; @@ -985,14 +956,12 @@ html.dark { } } - .connect-box, - .connect-popup-box, + .note-popup-box, .creer-box, .gestion-popup-box, .popup-box, .private-note-popup-box, - .public-note-popup-box, - .darken { + .public-note-popup-box { background: rgba(0, 0, 0, 50%); } @@ -1001,11 +970,11 @@ html.dark { } #btnTheme { - background: $color3; + background: $color1; color: $color4; } - .divLanguage .language { + #language { border: none; background: $color2; } @@ -1174,12 +1143,12 @@ html.light { } } - .connect-box, - .connect-popup-box, + .note-popup-box, .creer-box, .gestion-popup-box, .popup-box, - .darken { + .private-note-popup-box, + .public-note-popup-box { background: rgba(200, 200, 200, 40%); } @@ -1205,7 +1174,7 @@ html.light { color: $color2; } - .divLanguage .language { + #language { border: none; background: none; } diff --git a/src/database.sql b/src/database.sql index db85def..0f72882 100644 --- a/src/database.sql +++ b/src/database.sql @@ -32,9 +32,7 @@ CREATE TABLE `notes` ( `user` varchar(255) NOT NULL, `couleur` varchar(255) NOT NULL, `hiddenNote` tinyint NOT NULL, - `link` varchar(255) DEFAULT NULL, - `clearTitre` text, - `clearContent` longtext + `link` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -------------------------------------------------------- diff --git a/src/de/index.php b/src/de/index.php index 308a27a..294734b 100644 --- a/src/de/index.php +++ b/src/de/index.php @@ -26,7 +26,6 @@ ?> - Bloc-notes – Léo SEGUIN @@ -35,40 +34,19 @@ - - - - - - -