-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add full page markdown editor widget #3621
Conversation
Refactor to clarify new type (full page widget, to be added)
Note: this breaks the inline widget, the linked resizing javascript is applied to both versions of the widget. In case of the inline widget, we don't want that.
To ensure it's only applied to "full page" editor widgets
Pre-commit hook was not installed yet, so had to run it manually.
Hi Bram, I started at the UvA on October 1st in the qurAI group (under Clarisa Sanchez). I'm also the newest member of the grand-challenge RSE group. Nice to meet you! |
Hi Thomas,
Nice to meet you! I found you on the qurai website. I always recommend to
put full names on github, so I can find who is who.
Best, Bram
…On Tue, Oct 15, 2024 at 9:49 AM Thomas ***@***.***> wrote:
Who is ‘Thomas’?
Hi Bram, I started at the UvA on October 1st in the qurAI group (under
Clarisa Sanchez). I'm also the newest member of the grand-challenge RSE
group. Nice to meet you!
—
Reply to this email directly, view it on GitHub
<#3621 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4A7LMFE4YR7GV7YWSAULZ3TCJVAVCNFSM6AAAAABP5FVJHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJTGE2DGOJTGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
app/grandchallenge/core/templates/markdownx/partials/textarea.html
Outdated
Show resolved
Hide resolved
app/grandchallenge/core/templates/markdownx/full_page_widget.html
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a partial review of only the js file here. I have a few small comments.
Also, did you try what happens when there are multiple markdown widgets on a single page? Looking at your code I suspect it will execute the js for each widget. So that means it will find all markdown widgets on the page and apply the resize observer to each of them. So multiple widgets on one page will duplicate all the resize observers for each widget. You can avoid this by replacing the .getElementsByClassName("markdownx");
call with a specific call that only finds the current widget using its unique id. You can pass that unique id to javascript using the json_script
jinja filter.
This comment was marked as off-topic.
This comment was marked as off-topic.
avoid use of jquery, fix variable name case and use for-loop instead of map function
Replace with bootstrap class. Abandoned setting initial height of editor; will pick it up later during implementation.
@koopmant - that last edit you did to Bram's message is rather confusing to me... it now looks like Bram is talking to himself... I think that was not the intention... may I suggest another edit? (Please undo my edit in case you wanted to achieve something else) Oh god... I now see what has happened: GitHub butchers editing an email reply. Good to know. And nvm: Note-to-self: never edit an emailed-in reply. |
Before we dive too deep into this, I'm probably removing this script to keep the solution simple. Nonetheless: I tested that. When there are multiple widgets, the javascript is still only included once. I suspect because Django handles this for me when it loads the form. |
Hi Paul, it was even more confusing than that. I wanted to test out the email reply function. So I replied by e-mailing back. However, that message was posted as if Bram had sent my email. So I then edited it to make it more clear the message came from me. |
In case both full page and inline widgets are included on the same page
That looks like a bug in GitHub, you should not be able to post comments as another user. I can't find anything on it after a quick search so please report it to them. The pre-commit checks are failing. @koopmant please install pre-commit and run |
@koopmant - I would be happy to report the issue, but you encountered the original bug where Bram's message was exchanged for yours. You would need to add the details about that. I think that this is the severe issue of the two. The half-baked non-markdown editing is probably just a missing feature in general. So could you take that on? I can independently report the horrible experience when trying to edit an email response. |
|
@jmsmkn I had to reinstall my system (I'll explain later...) and forgot to install pre-commit (again). Then ran into the same issue as @ammar257ammar. (biomejs/pre-commit#11 biomejs/pre-commit#13). I added a temporary fix in this PR. See |
Yes that's fine. You could also make another PR with the fix to have it on main. It's not in pyproject.toml as I've not thought of it as a development dependency (e.g. what do you need to run the tests). Looking at Django they also omit it. I'm not sure how it behaves when you have multiple installs as it installs environments globally, so like poetry it's something you install globally and use. |
Test email reply sent by koopmant for bug report to GitHub.
This comment is posted as if Bram is the author, even though this has been sent by someone else. Reported to GitHub. See Ticket 3060717<https://support.github.com/ticket/3060717>.
…________________________________
From: Thomas Koopman ***@***.***>
Sent: Tuesday, October 22, 2024 2:59 PM
To: comic/grand-challenge.org ***@***.***>
Subject: Re: [comic/grand-challenge.org] 3609 add full page markdown editor widget (PR #3621)
Test reply sent by koopmant for bug report to GitHub
________________________________
From: Thomas Koopman ***@***.***>
Sent: Tuesday, October 15, 2024 4:02 PM
To: Bram van Ginneken ***@***.***>; comic/grand-challenge.org ***@***.***>
Cc: comic/grand-challenge.org ***@***.***>; Comment ***@***.***>
Subject: Re: [comic/grand-challenge.org] 3609 add full page markdown editor widget (PR #3621)
Ahh, yes. I don't have a lot of info on GitHub yet. (Have been using GitLab the past couple of years.) Thanks for the tip!
________________________________
From: Bram van Ginneken ***@***.***>
Sent: Tuesday, October 15, 2024 12:21 PM
To: comic/grand-challenge.org ***@***.***>; Thomas Koopman ***@***.***>
Cc: comic/grand-challenge.org ***@***.***>; Comment ***@***.***>
Subject: Re: [comic/grand-challenge.org] 3609 add full page markdown editor widget (PR #3621)
Hi Thomas,
Nice to meet you! I found you on the qurai website. I always recommend to put full names on github, so I can find who is who.
Best, Bram
On Tue, Oct 15, 2024 at 9:49 AM Thomas ***@***.******@***.***>> wrote:
Who is ‘Thomas’?
Hi Bram, I started at the UvA on October 1st in the qurAI group (under Clarisa Sanchez). I'm also the newest member of the grand-challenge RSE group. Nice to meet you!
—
Reply to this email directly, view it on GitHub<#3621 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAN4A7LMFE4YR7GV7YWSAULZ3TCJVAVCNFSM6AAAAABP5FVJHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJTGE2DGOJTGI>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Ok, yes that makes sense. |
This adds a Markdown editor with side-by-side editor and preview panels.
Height of the panels is linked. Size of the panels can be adjusted by resizing the textarea using the handle.

See also:
https://github.com/DIAGNijmegen/rse-roadmap/issues/351
closes #3609