~sircmpwn/todo.sr.ht#100:
Ctrl + Enter should submit the comment/ticket

Status
RESOLVED IMPLEMENTED
Submitter
~grayhatter
Assigned to
No-one
Submitted
1 year, 6 months ago
Updated
7 months ago
Labels
No labels applied.

~benharri 9 months ago

Is there a way to do this without javascript? I've only been able to fine javascript solutions to this in my first searches.

~jehanne 9 months ago

Good question!

To my knowledge, without JavaScript, all you can do is to add an access key to an input submit.

Something like

<form ...>
<input type="submit" accesskey="S" value="Submit"/>
</form>

would submit the form by typing Alt+Shift+S.

Not exactly Ctrl+Enter, but something people can learn.

~sircmpwn 9 months ago

I'm okay with using JavaScript for little details like this. The site has to be useful and pleasant without JS, but we can use small amounts of JS to improve QoL here and there.

We can also set up that accesskey thing, seems neato.

~jehanne 9 months ago

Progressive enhancement is a forgotten art I was initiated to a more than a decade ago.

I would argue that with simple explanatory divs one could enhance the quality of life without invoking Balrogs that potentially threat the users security.

However since people using your services is already trusting you (and Let's Encrypt and everyone who has physical access to your servers), few lines of JavaScript shouldn't extend the attacks surface too much.

If I can give a suggestion though, I'd appreciate if you avoid any javascript framework, avoid CDNs, and possibly keep javascript constrained to what can fit the page source, in the script tag, without triggering further request to load further js or json.

It's not just a matter of security: the overall rendering will be faster and the experience better.

But above all, as a hack for hackers, it would be funny to see the mainstream wisdom that the world would collapse in fire if JavaScript were opt-in, challenged by a great service.

~ihabunek 7 months ago

This comment was submitted by pressing Ctrl+Enter.

~sircmpwn REPORTED IMPLEMENTED 7 months ago

~benharri 7 months ago

Woohoo!

Register here or Log in to comment, or comment via email.