Pages:
Author

Topic: [Script] BitcoinTalk User Notes - page 2. (Read 864 times)

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: 3500
Merit: 6981
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 = `
               
Pages:
Jump to: