My-Little-Forum / mylittleforum

A simple PHP and MySQL based internet forum that displays the messages in classical threaded view (tree structure)
GNU General Public License v3.0
124 stars 48 forks source link

Partially rework of the entry form #741

Closed auge8472 closed 2 months ago

auge8472 commented 2 months ago

This PR introduces several changes in the fieldset #message of the posting form.

The button bar moves from the right side to top of the textarea and the buttons are displayed in horizontal rules, one for the formatting buttons and one for the smilies. Behind the scenes also the description lists with the instructions for BB-codes and smilies for the use without active JavaScript moves to above the textarea. The list items (dt, dd) got enclosed in a dedicated div, what made it necessary to adapt this change to the posting.js. For immediately jump to the textarea, the instruction block got a skip link (currently hardcoded in german language).

Additionally the list of additional buttons was reworked from a collection of links to a list of buttons, what made it necessary to change also the event code for inserting the smiley code into the textarea.

auge8472 commented 2 months ago

@loesler I would like to ask you specifically for a review of the changes in the Javascript source code. There are several styling fixes. The relevant functional changes was made in the functions BBCodeSingleSmilieButton and ButtonGroup as well as the anonyme functions for the variables convertInstructionsToButton, convertInstructionsToSmilies, initTextArea and removeIntroductionElements.

auge8472 commented 2 months ago

@loesler Thank you for your review.

auge8472 commented 2 months ago

The help notices (I found three items) moved to the label, like it's done for the tags input before. Additionally – not shown on the screenshot in this comment – the checkbox for managing a cookie to store the userdata in the browser[^1] – moved to the start of the line.

This is a screenshot of a part of the posting form. The help notices (like "optional") are now part of the input label

[^1]: I think, this has to be redone. Storing the userdata of unregistered visitors in a cookie, that is sent from the browser to the server with every request, is a big privacy issue. We can store it in the browser (localStorage) but this makes it working only in the specific browser on the specific device. If one uses the forum with different browsers on different devices, one has to save the data multiple times. Alternatively we can remove this featurette. This would be an incentive to sign up in a forum.

auge8472 commented 2 months ago

@loesler: I'm sorry for poking at you again. Can you please provide the YUM-compressed versions for js/main.js and js/posting.js in a separate PR? Thank you in advance.

loesler commented 2 months ago

Alternatively we can remove this featurette.

That is my favorite. In my forum, this option is disabled, i.e. remember_last_visit = 0 and remember_userdata = 0

Can you please provide the YUM-compressed versions for js/main.js and js/posting.js in a separate PR? Thank you in advance.

I will try to compress the Script, yes.

auge8472 commented 2 months ago

Alternatively we can remove this featurette.

That is my favorite.

Full ACK.