Author

Topic: [Script] BitcoinTalk User Notes (Read 864 times)

copper member
Activity: 588
Merit: 926
July 25, 2023, 01:45:53 AM
#36
Look for the problem on your side, friend. Because there's something wrong with your script installation. You probably have some kind of error. Because, for example, the script works fine for me and after clicking on this button the import/export notes window appears.

hero member
Activity: 1036
Merit: 933
Find your Digital Services at- cryptolibrary.pro
July 24, 2023, 03:54:07 PM
#35
Thanks for this script @TryNinja. I already have shared your this script on my local threadGrin
All things are good, Usernotes are perfectly working and displaying.
But I am seeing a button(USER NOTES) that on the menu left side of log out button. But Actually, I couldn't understand it's work because when I am clicking on it , it's shows about:blank#blocked. I mean it doesn't work. May I know the cause?
Sorry If I repeating anything  Roll Eyes




legendary
Activity: 2800
Merit: 2736
Farewell LEO: o_e_l_e_o
October 11, 2022, 04:21:22 PM
#34
[..]

As always, you can get the updated version in the OP.
I was not aware of this topic existence LOL. Code updated according to your update and it looks good now.

Before


After
legendary
Activity: 2212
Merit: 7064
October 11, 2022, 04:08:39 PM
#33
As always, you can get the updated version in the OP.
Thanks for update once again Wink
TryNinja what do you think about uploading the script on greasyfork.org or some other alternative website?
This would provide more exposure and I think script would be updated automatically from browser extension.
legendary
Activity: 2758
Merit: 6830
October 11, 2022, 12:05:45 PM
#32
Fixed a small issue where the script would run on an undesired page ("Show the last posts/topics of this person") and potentially insert the note in the middle of a post.



Look at the personal note which I was testing for my account just to check how it shows in my profile.
By the way check the post on my post history: https://bitcointalksearch.org/user/bitcoingirlclub-662330
Search for "Scam by YoYa for $50" on the browser.

So basically it is showing in a quoted message which has trust page linked of another user.

As always, you can get the updated version in the OP.
legendary
Activity: 2212
Merit: 7064
September 22, 2022, 09:31:00 AM
#31
One more good use case for BitcoinTalk User Notes script is tagging forum alt accounts.
Here is just a few of my recent examples of using this script for one DT abuser coward who is hiding behind his real account.
It's obviously the same person behind all this accounts and someone needs to stop this abuser witch hunting circus show.





staff
Activity: 3304
Merit: 4115
September 15, 2022, 07:37:14 AM
#30
I'm wondering if you could potentially add a new feature (demand dependant), which I imagine has a very niche use, but would be pretty handy for myself, a select few others. Would it be possible if you could add predefined notes? So, for example if I want to add a note to a user for being banned for bumping spam, could I just click something which brings me to a drop down menu, and I'd be able to select "Nuked: Bumping spam" or something like that?

I'm only suggesting this, as I can see this being used by others too. For example, if they want to label someone as a company representative etc (useful for gambling sites that have multiple employees interacting). Obviously, I don't want you to create the predefined messages, that's something the user could do.

So, while the usage might be a small group, I think it could add something which would make it a little more efficient. Obviously, from my side it's obvious why it would benefit.
legendary
Activity: 2758
Merit: 6830
September 09, 2022, 10:48:08 AM
#29
~
Thank you for the feedback. Smiley

- How do we export and import notes with Tampermonkey extension + BitcoinTalk User Notes?
There is an "User Notes" button next to the logout button. You can export and import there (a modal will show up).
legendary
Activity: 2212
Merit: 7064
September 09, 2022, 08:05:54 AM
#28
So, it's definitely made me a little more efficient, and hopefully that benefits the community. So, while I can see why this wouldn't be as useful or in demand for normal usage, this sort of niche area it works out pretty efficient.
It's very useful for me, and I think this should be something that exist by default in forum.
I don't have to use neutral trust feedback anymore in some situation when I have my personal opinion about some member, that is not directly related with trust.
What I like is that this notes are clearly visible even if member is ignored, so you can add explanation why exactly you are ignoring this specific member Smiley

One question for TryNinja:
- How do we export and import notes with Tampermonkey extension + BitcoinTalk User Notes?
staff
Activity: 3304
Merit: 4115
September 09, 2022, 06:12:23 AM
#27
Thanks TryNinja for this. I really appreciate the User Notes section, where you can see all the user notes you've got. Plus, the export/import feature is pretty damn handy. Definitely, an improvement on my implementation which was a little half arsed.

I'm actually making the most of that feature, and it's aiding my moderation quite well. I know a lot of users complain about repeat offenders, so now I make personal notes, but also specify the reasons I've taken a certain action (usually major ones). For example, when nuking someone. That way, if anyone ever has an appeal, and I'm asked the question I might be able to remember rather than not.

Also, the import/export means when making so many entries it becomes a little hard to view, either because of view-ability or due to the fact that it slows down the more you add, I can just export it to libre office. I'll probably edit some of the code specific to this to make the workflow a little easier, however it works as is for the time being.

So, it's definitely made me a little more efficient, and hopefully that benefits the community. So, while I can see why this wouldn't be as useful or in demand for normal usage, this sort of niche area it works out pretty efficient.
legendary
Activity: 2212
Merit: 7064
September 05, 2022, 10:56:05 AM
#26
Totally forgot about it until now, but Violentmonkey is an open source alternative to Tampermonkey and Greasemonkey.
This extension is also not updated since May 2021, similar case like with Greasemonkey.
I tried testing your script with one more up to date open source extension called Firemonkey, but it works only partially with bitcointalk forum.
You need to open member profile to add and view personal notes, so I think it needs small modification to be fully compatible.
https://addons.mozilla.org/en-GB/firefox/addon/firemonkey/

PS
One suggestion to add BitcoinTalk User Notes script to Greasyfork website:
https://greasyfork.org/
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
September 04, 2022, 04:45:36 AM
#25
Totally forgot about it until now, but Violentmonkey is an open source alternative to Tampermonkey and Greasemonkey.

https://violentmonkey.github.io

Take note Greasemonkey is also open source[1]. But looks like it's solid alternative for Greasemonkey since it's actively developed and support more Browser.

[1] https://github.com/greasemonkey/greasemonkey
legendary
Activity: 2758
Merit: 6830
September 03, 2022, 08:04:13 PM
#24
Totally forgot about it until now, but Violentmonkey is an open source alternative to Tampermonkey and Greasemonkey.

https://violentmonkey.github.io
legendary
Activity: 2534
Merit: 1713
Top Crypto Casino
September 03, 2022, 03:14:10 PM
#23
The read/write permission that are part and parcel of virtually all add-ons regardless of where they are downloaded from, they are the Achilles heel when it comes adding any extension to your browser.

As a precaution, I hardly use browser extensions because of the data that they can accumulate over substantial periods of time. I am not saying that is what it going on here but it does not give confidence when you allow 3rd parties the capabilities to capture data that passes through the services they provide.

Edit:

Aw, man.



Does anyone have any soothing words of comfort and/or reassurance that those aren't too many permissions to give an add-on like this?
legendary
Activity: 2212
Merit: 7064
September 03, 2022, 02:53:15 PM
#22
Here's the answer: BitcoinTalk user notes isn't exactly the extension. Tampermonkey is. In order for TryNinja's add-on to detect bitcointalk.org, Tampermonkey has to run on every page. At least, that's how they justify it at their FAQ
There is easy solution for this in Chromium based browsers (Chrome, Brave, etc).
Right click on Tampermonkey icon and select Manage extension.
Than look for settings names Site access, and select On specific sites - than just add bitcointalk.org website.



Sadly, for Firefox browser this option is not available for Tampermonkey extension, but maybe there are some other method I am not aware off.
Maybe this can be somehow tweaked and modified inside Tampermonkey advanced settings.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
September 02, 2022, 01:52:45 PM
#21
Access data for all websites: can't that be limited to only Bitcointalk.org?
Seriously!  I just don't get it.  Do any of you get it?
Here's the answer: BitcoinTalk user notes isn't exactly the extension. Tampermonkey is. In order for TryNinja's add-on to detect bitcointalk.org, Tampermonkey has to run on every page. At least, that's how they justify it at their FAQ:
Q300: Tampermonkey can access every page that I visit! Is TM evil?
A300:
...like any other chrome extension that has https and http access!
This includes extensions like AdBlock, ScriptSafe, Avast Online Security and due to the fact that it is not displayed explicitly when they are downloaded, any userscript that is installed as native Chrome extension.

If you're interested in this, you can find the access information a the right column of every extension at the Chrome store by searching for "This extension can access".
Tampermonkey needs to be able to run at every page, because it doesn't know at what pages your userscripts will run and therefore needs to be able to inject them into every page.

But you're right, userscripts and extensions can harm your privacy and your computer. Nevertheless I think more evil is that Chrome does not display at what pages a userscript wants to run on when install it is installed as native extension. From this point of view TM even can bring you some security back, at least if you believe me, that I'm not interested in any of your data. If not, you can open the console (Ctrl-Shift-J) and choose the network tab to investigate what network communication is done. Smiley

I don't think it's a concern, though. Tampermonkey is open-source: https://github.com/Tampermonkey/tampermonkey. It leaves little to no room for shadiness.
staff
Activity: 3304
Merit: 4115
September 02, 2022, 05:58:59 AM
#20
Does anyone have any soothing words of comfort and/or reassurance that those aren't too many permissions to give an add-on like this?
There's open source alternatives so you could potentially review the code, it would still require these permissions though, as mentioned above since it needs to cover a very broad spectrum of scripts.

However, it's worth mentioning that the open source alternatives aren't as popular, and therefore haven't had as much development put into them, and therefore they're either lacking the UX/UI or they're missing some functionality that other closed sourced alternatives have.

Generally, most addons/extensions are terribly invasive with the permissions they require, even more so for a script manager that needs to cover a whole lot of angles for the maximum amount of compatibility with userscripts.
hero member
Activity: 510
Merit: 4005
September 01, 2022, 08:30:57 PM
#19
Clipboard access: can't that be disabled?
Modify browser's download history: is that necessary?
Display notifications: that's the point Smiley
Access tabs: that's the point Smiley
Store unlimited client-side data: makes sense, it stores anything you type.
Access browser activity: I guess that's necessary to show the notifications
Access data for all websites: can't that be limited to only Bitcointalk.org?
As I understand it, TryNinja's hands are tied on this issue. The script host (Greasemonkey/Tampermonkey) needs broad enough permissions to cover any conceivable user script.
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
September 01, 2022, 04:27:41 AM
#18
Access data for all websites: can't that be limited to only Bitcointalk.org?
Seriously!  I just don't get it.  Do any of you get it?

Of these requested permissions, I think the worst is access to the clipboard. And look, I'm not that "paranoid" about these issues.

But yes it is possible to limit the add-on only to Bitcointalk.

In chrome, follow the instructions here:
Quote
Manage your extensions
On your computer, open Chrome.
At the top right, click More More and then More tools and then Extensions.
Make your changes:
Turn on/off: Turn the extension on or off.
Allow incognito: On the extension, click Details. Turn on Allow in incognito.
Fix corruptions: Find a corrupted extension and click Repair. Confirm by clicking Repair extension.
Allow site access: On the extension, click Details. Next to “Allow this extension to read and change all your data on websites you visit,” change the extension’s site access to On click, On specific sites, or On all sites.
https://support.google.com/chrome_webstore/answer/2664769?hl=en
legendary
Activity: 3528
Merit: 7005
Top Crypto Casino
September 01, 2022, 03:53:53 AM
#17
No soothing words here, I'm paranoid when it comes to these things Tongue
You might be as or more paranoid than I am about stuff like this, but at least you know about it; I'm a complete nincompoop when presented with a menu of possible ways I can be fucked and it's written in a language I can't read.

But this is why I rely on the experts here.  Sometimes I'm not sure if I'm just being an idiot or if that feeling in my gut is telling me something.

Access data for all websites: can't that be limited to only Bitcointalk.org?
Seriously!  I just don't get it.  Do any of you get it?
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
September 01, 2022, 03:04:27 AM
#16

Does anyone have any soothing words of comfort
No soothing words here, I'm paranoid when it comes to these things Tongue

Clipboard access: can't that be disabled?
Modify browser's download history: is that necessary?
Display notifications: that's the point Smiley
Access tabs: that's the point Smiley
Store unlimited client-side data: makes sense, it stores anything you type.
Access browser activity: I guess that's necessary to show the notifications
Access data for all websites: can't that be limited to only Bitcointalk.org?
legendary
Activity: 3528
Merit: 7005
Top Crypto Casino
September 01, 2022, 02:23:34 AM
#15
Oh wow, this is the first I'm seeing this thread and I absolutely love this!  There are so many members here that I'd love to stick a note tag to, right on their forehead if it were in real life, to remind me that they're a potential cheat, a total bastard, lack ears, etc.

Now I'm just going to have to see if I can deal with all that code within my browser.  I know you all are on the ball when it comes to what must seem like simple crap like this, but I have a bad feeling that I could seriously screw something up and leave myself vulnerable to a home invasion, possibly with me being made to do degrading things with or to some hacker.  Those fuckers are crazy.

Despite my fear of losing my chastity I believe I'm going to give this a shot, because the benefits are well worth it.  Thanks, TryNinja!

Edit:

Aw, man.



Does anyone have any soothing words of comfort and/or reassurance that those aren't too many permissions to give an add-on like this?
legendary
Activity: 1722
Merit: 4711
**In BTC since 2013**
September 01, 2022, 01:51:31 AM
#14
Congratulations TryNinja for your excellent work, in the search to improve the experience of using the forum.

I believe that this script can be useful for many users.

Keep up the good work, thanks.
legendary
Activity: 2758
Merit: 6830
August 30, 2022, 10:31:22 PM
#13
Version 0.3

- I added an "User Notes" menu (next to the logout button).
- You can view, export and import your notes (WIP! needs more polishing and a better UI/UX).

You can disable the new menu by changing enableModal from 1 to 0 at the top of the script.

The updated code can be found in the OP.



Off topic: @TryNinja looking at your post history (last posts of the user) I noticed that you quoted a link of an image which is just ridiculously long line without a break.
It ruined the arrangement of the last posts, is there any solution for this issue?
Lol, this is an issue the forum css has with long strings inside the code tag. I had to "censor" the code to fix the page. Maybe a script for that? Tongue
legendary
Activity: 2240
Merit: 3150
₿uy / $ell ..oeleo ;(
August 30, 2022, 05:37:16 PM
#12
I remember asking for such tool some years ago, I should dig up my post maybe.
Thank you Smiley

Off topic: @TryNinja looking at your post history (last posts of the user) I noticed that you quoted a link of an image which is just ridiculously long line without a break.
It ruined the arrangement of the last posts, is there any solution for this issue?
legendary
Activity: 3472
Merit: 3507
Crypto Swap Exchange
August 30, 2022, 05:21:29 PM
#11
It adds a note field on each user's profile and posts. You can click the note itself to remove or change it.

P.S: Notes are only stored LOCALLY and will be lost if you uninstall the extension. Only you can see your notes.

Wow, this is a great thing, I am thinking about it for some time. Many times I asked for the possibility to have internal feedback for some users, but I didn't want to leave it public.
it would really be ideal if there was an export/import option because I use BTT on two devices.

following this thread.
staff
Activity: 3304
Merit: 4115
August 30, 2022, 05:09:41 PM
#10
Thanks for sharing. I actually made something like this a while ago for personal use, didn't think too many users would find a use for it, but it comes in handy with moderation, especially when it comes to repeat offenders. However, mine stopped working, and I never really sat down long enough to figure it out, and therefore just got rid of it.

Then please answer my question, Is it safe to use?

People seem inclined to like things from open source, but since Tampermonkey is from closed sources then security questions regarding privacy or such seem worth asking. Instead of blabbering, I'm just telling you I haven't tried it.

But I really appreciate your work @Tryninja.
It's used by a lot of people, but that doesn't mean it's safe. You shouldn't be relying on others when it comes to verifying the source or if you do, make sure it's someone that doesn't have any motives, and you trust.

Short answer is, it's trusted by thousands of others, but there's nothing stopping this from becoming malicious at any point, especially if you have auto updates enabled for extensions (browser specific).
legendary
Activity: 2212
Merit: 7064
August 30, 2022, 03:43:30 PM
#9
Then please answer my question, Is it safe to use?
I don't know, do your own research about this.
I prefer using open source as much as possible, but outdated software with any license can also be problematic sometimes.

Crazy idea: would it be possible to encrypt notes (from the browser) and upload it to your server?
Or simple export/import/backup feature in local files.
Any time you uninstall extension or use different browser, you just import backup files and it's all done, similar like with bookmarks.
No need for cloud (someone else's computer).
hero member
Activity: 798
Merit: 1045
Goodnight, ohh Leo!!! 🦅
August 30, 2022, 01:25:15 PM
#8
Wow,  Shocked
This is infact, a mind blowing brilliance!! I'd give alot of merit if I had Smerit. This will remind anyone of who a user is and whatever deals you both had Mmmm  Smiley, but I was thinkingthat it hasn't,in anyway gone contrary (rule-wise)

So I'll begin to know a handful of peeps and the deal we had just by looking at their profile; satisfactory I'd say Cheesy.
Maybe we'll have to save up some shit posters as shit-head or something??

Kudos @Tryninja
Sandra Kiss
legendary
Activity: 1064
Merit: 1228
Playgram - The Telegram Casino
August 30, 2022, 11:24:44 AM
#7
I have been using Tampermonkey for years. AFAIK, it is safe as long as you know which scripts you're importing. It's just easier than creating an extension for every script I use (I currently have 3 for the forum - enhanced merits, this one, and to quote posts on locked threads).
Unfortunately I'm not as familiar with technical stuff like coding and scripting as you're talking about, that's not my basic in the real world so I really have trouble with technical stuff like that. LOL

About of extensions, it looks like I've installed quite a few extensions at the moment like BPIP as well as a quick report to the mod. I haven't tried more, but it might be worth trying if in the future I need it. The extension has changed some of my current views when using forum. By the way, thanks for convincing me.
legendary
Activity: 2758
Merit: 6830
August 29, 2022, 08:05:49 PM
#6
Crazy idea: would it be possible to encrypt notes (from the browser) and upload it to your server?
Doable, I just need to find a way to encrypt them without the need to import an entire lib for that (i.e crypto-js). I want to keep the script as simple and clean as possible (no jquery, etc...). I'll probably add a local import/export as json soon.

Then please answer my question, Is it safe to use?
People seem inclined to like things from open source, but since Tampermonkey is from closed sources then security questions regarding privacy or such seem worth asking. Instead of blabbering, I'm just telling you I haven't tried it.
I have been using Tampermonkey for years. AFAIK, it is safe as long as you know which scripts you're importing. It's just easier than creating an extension for every script I use (I currently have 3 for the forum - enhanced merits, this one, and to quote posts on locked threads).
donator
Activity: 4760
Merit: 4323
Leading Crypto Sports Betting & Casino Platform
August 29, 2022, 03:05:57 PM
#5
This is a good idea.  Back when I was dealing with dozens of people per day it was impossible to try and keep personal relationships straight.  I often found myself forgetting information about people or deals we had made that were important to them.  Being able to note things on the site would have definitely been beneficial for me and probably would have made me seem much more friendly.  Would love to see this implemented beyond a user script.
legendary
Activity: 1064
Merit: 1228
Playgram - The Telegram Casino
August 29, 2022, 12:49:12 PM
#4
while Tampermonkey was updated few months ago, but I think it's closed source.
Then please answer my question, Is it safe to use?

People seem inclined to like things from open source, but since Tampermonkey is from closed sources then security questions regarding privacy or such seem worth asking. Instead of blabbering, I'm just telling you I haven't tried it.

But I really appreciate your work @Tryninja.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
August 29, 2022, 12:19:35 PM
#3
P.S: Notes are only stored LOCALLY and will be lost if you uninstall the extension.
Crazy idea: would it be possible to encrypt notes (from the browser) and upload it to your server?

If so, I can think of cool things to do:
  • You can give each user a unique ID
  • Each user can choose their own password
  • ID and password is enough to restore all Notes, also on multiple devices
  • Users could optionally tick a Note as "public" (those won't be encrypted)
  • Users can ignore other IDs if the ID sends spam
legendary
Activity: 2212
Merit: 7064
August 29, 2022, 09:56:03 AM
#2
Install Tampermonkey (Chrome, Brave...) or Greasymonkey (Firefox).
I can confirm that Tempermonkey extension is available for Firefox (and Librewolf) browser as well, and Bitcointalk UserNotes works just fine with that.
Greasemonkey was not updated for years and I am not sure if anyone works on it anymore, while Tampermonkey was updated few months ago, but I think it's closed source.
I have only one request if possible, can you somehow enable easy option to export and import notes with member usernames?
Thanks again for great work!
legendary
Activity: 2758
Merit: 6830
August 29, 2022, 07:46:51 AM
#1
This was originally posted here.

It adds a note field on each user's profile and posts. You can click the note itself to remove or change it.

P.S: Notes are only stored LOCALLY and will be lost if you uninstall the extension. Only you can see your notes. You can import/export your notes by clicking the "User Notes" button next to the forum's Logout button.






Installation

- Install Tampermonkey (Chrome, Brave...) or Greasemonkey (Firefox). Or even better, Violentmonkey (open source alternative)
- Add a new script and paste the code:

Code:
// ==UserScript==
// @name         BitcoinTalk User Notes
// @version      0.3.1
// @description  Adds an note field to each user on BitcoinTalk
// @author       TryNinja
// @match        https://bitcointalk.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bitcointalk.org
// @grant GM.setValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==

const enableModal = 1;

(async function() {
    'use strict';

    const addStyle = (css) => {
        const style = document.getElementById("GM_addStyleBy8626") || (() => {
        const style = document.createElement('style');
        style.id = "GM_addStyleBy8626";
        document.head.appendChild(style);
        return style;
        })();
        const sheet = style.sheet;
        sheet.insertRule(css, (sheet.rules || sheet.cssRules || []).length);
    }

    if (enableModal) {
        addStyle(`.modal {
            position: fixed;
            width: 100vw;
            height: 100vh;
            top: 0;
            left: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }`);

        addStyle(`.modal-bg {
            position: absolute;
            width: 100%;
            height: 100%;
        }`);

        addStyle(`.modal-container {
            min-width: 30vh;
            border-radius: 10px;
            background: #fff;
            position: relative;
            padding: 10px;
        }`);

        addStyle(`.modal-close {
            position: absolute;
            right: 15px;
            top: 15px;
            outline: none;
            appearance: none;
            color: red;
            background: none;
            border: 0px;
            font-weight: bold;
            cursor: pointer;
        }`);
    };

    const getValue = typeof GM_getValue === 'undefined' ? GM.getValue : GM_getValue;
    const setValue = typeof GM_setValue === 'undefined' ? GM.setValue : GM_setValue;

    const getParentNodeNth = (element, num) => {
        let parent = element;
        for (let i = 0; i < num; i++) {
            if (parent.parentNode) {
                parent = parent.parentNode;
            }
        }
        return parent;
    };

    const getNotes = async () => {
        let notes;
        try {
            notes = JSON.parse(await getValue('notes') ?? '{}');
        } catch (error) {
            notes = {};
        };
        return notes;
    };

    const setNotes = async notes => {
        if (typeof notes === 'string') {
            try {
                JSON.parse(notes);
                await setValue('notes', notes);
            } catch (error) {
                console.error('Notes value is an invalid JSON format')
            };
        } else if (typeof notes === 'object') {
            await setValue('notes', JSON.stringify(notes ?? {}));
        };
    };

    const getUserNote = async user => {
        const notes = await getNotes();
        if (!notes) {
            return null;
        }
        return notes[user];
    };

    const setUserNote = async (user, note) => {
        const notes = await getNotes();
        notes[user] = note;
        await setNotes(notes)
    };

    const texts = {
        addNote: '📜 Add Note',
        withNote: note => `📜 ${note}`
    };

    const addNote = async (user, element) => {
        const note = prompt('Input the note (empty to remove):');
        if (note) {
            element.innerHTML = texts.withNote(note);
            await setUserNote(user, note);
        } else if (note !== null) {
            element.innerHTML = texts.addNote;
            await setUserNote(user, note);
        }
    };

    const exportNotesToInput = async () => {
        const notesInput = document.querySelector('#notesInput');
        const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
        const doneImportButton = document.querySelector('#doneImportButton');
        const notes = await getNotes();
        const notesJsonString = JSON.stringify(Object.keys(notes)
            .filter(user => notes[user]).reduce((obj, user) => ({...obj, [user]: notes[user]}), {}));

        notesInput.value = notesJsonString;
        notesImportExportDiv.querySelector('span').innerText = 'Export (copy the code)';
        notesImportExportDiv.style.display = 'flex';
        doneImportButton.style.display = 'none';
    };

    const importNotesFromInput = async () => {
        const notesInput = document.querySelector('#notesInput');
        const notesImportExportDiv = document.querySelector('#notesImportExportDiv');
        const doneImportButton = document.querySelector('#doneImportButton');

        notesInput.value = '';
        notesImportExportDiv.querySelector('span').innerText = 'Import (paste the code)';
        notesImportExportDiv.style.display = 'flex';
        doneImportButton.style.display = 'inline-block';
    };

    const importNotesFromInputDone = async () => {
        const notesInput = document.querySelector('#notesInput');
        const confirmImport = confirm('Are you sure you want to override your local notes?');

        if (confirmImport && notesInput.value) {
            setNotes(notesInput.value);
            loadUserNotesList();
        }
    };

    const insertNotesModal = async () => {
        let notesModal = document.querySelector('#userNotesModal');

        if (!notesModal) {
            const moreMenuBtn = document.querySelector('body');
            notesModal = document.createElement('div');

            notesModal.innerHTML = `
               
Jump to: