Fai una pausa! Componente del tema

What is it?

After a discussion about moderators about spending an extended amount of time on the screen, I decided it’ll be best to remind staff members(and non-staff!) to frequently take a break from the forums after looking at it for a long time. New update: It also works on non-staff and can be toggled on and off via theme settings.

What does it do?

This theme component shows an alert message after the member is on the forums for x amount of seconds. So 30 minutes would be 1800 seconds until the message is shown. This component has 4 main settings that let you customize your message and change the time until the message is shown.

Why?

It’s PROVEN to help you if you take a break from the screen. This is especially for moderators and admins who sometimes spend the night doing staff work! This component is a great reminder to take a break if you’re moderating or looking at the forums for too long. This component also helps for those who can’t stop replying, posting, etc. It’s always good to take a break!

Preview

Here’s a quick preview video(Sorry the webpage took so long to load)

Since changing the settings in theme creator is currently broken, you can download this component on your instance and try changing the message and the time!

36 Mi Piace

Should I change something? Critical feedbacks are welcome!

2 Mi Piace

Maybe there should be an option to show it to users, too (not only staff). As a regular user I would be fascinated to see that the forum admins care about users’ health :slight_smile:

2 Mi Piace

Hi @Chaboi_3000,

neat idea, we talked of something similar with @sam recently.

My main criticism is the code, it should be vastly improved, I can provide guidance if you are willing to improve it.

Few ways to improve it:

Let me know if you need more help, happy to review more.


I’m a little bit concerned we can’t disable it on per user basis, as I would never use this. But we don’t have per user setting in theme components ATM. So I don’t see any good/easy solution here.

Maybe a good solution would be to have a pair of groups/message, that would make it slightly more configurable.

10 Mi Piace

Added an option for normal users. (Default is off for normal users)

Fixed. Sorry about that.

I haven’t checked discourse for a while. I’ll go over it tomorrow. I’ll also check on the other ones too. I’ll message you if I have trouble with any on them. Thanks :slight_smile:

10 Mi Piace

Is it reasonable to migrate this theme component to the new javascript files? If so, is there a guide on how to do this?

2 Mi Piace

Fixed. I’m still wondering about the differences between javascript files and the standard html, css, and js.

2 Mi Piace

Grazie. Cercherò di aggiungere alcune funzionalità QOL quando avrò un po’ di tempo :slight_smile:

3 Mi Piace

Impressionante! Non sapevo nemmeno io che potesse essere modificato per diversi utilizzi! È fantastico sapere che sta aiutando. Rispondere ai thread senza risposta è sicuramente qualcosa che viene sempre incoraggiato ovunque, indipendentemente dall’uso del forum. Grazie per aver condiviso! :slight_smile:

3 Mi Piace

Interrompe gli utenti mentre creano un nuovo post?
È possibile pubblicare annunci tramite questo componente?

Non l’ho impostato per evitare che appaia mentre un utente sta scrivendo :pensive: (anche se non chiuderà l’editor). Puoi certamente usare questo componente per gli annunci, ma ti consiglio questa soluzione in quanto è più ottimizzata per la pubblicità:

1 Mi Piace

Scusa per il ripescaggio, ma ho alcune suggerimenti: rendilo configurabile dall’utente nelle impostazioni, permettendo di cambiare il colore e, invece di una semplice X, inserisci due pulsanti: uno con un’icona di una piattaforma social come YouTube (che l’utente può modificare) e l’altro con la scritta “Sto bene” o qualcosa di simile, modificabile dall’amministratore.

Ma è possibile aggiungere HTML al testo? Sarebbe davvero bello se lo fosse. (e magari in quel caso un’opzione extra per la frequenza… come mostrare solo ogni “n-esimo” giorno).

Puoi sicuramente modificare il codice sorgente e cambiare l’HTML per adattarlo alle tue esigenze.

Sto già utilizzando il plugin pubblicitario ufficiale. Chiedo se è possibile far apparire annunci a comparsa quando il sito viene caricato, proprio come nel link sottostante. Esegue codice Google AdSense?

https://www.edaboard.com

Di default è previsto solo per visualizzare testo normale. Se scavate nel codice sorgente e lo modificate, potete certamente visualizzare un annuncio.

1 Mi Piace

@Pravi, se vuoi, puoi fare un fork del repository e dare un’occhiata al file head-tag.html nel componente (qui vengono gestiti i popup e tutto il resto) e personalizzarlo in base alle tue preferenze. showModal viene chiamato qui. Probabilmente vorrai fare qualche esperimento con il codice :slight_smile:

1 Mi Piace


Il componente è attualmente rotto

4 Mi Piace

Ho fatto la PR :+1:


È stata unita, grazie Chaboi! :clap:

Nota che questo è un semplice aggiornamento.

Ho visto suggerimenti/funzionalità interessanti che potrebbero valere la pena implementare:

  • Osservare il contesto per non far apparire il modale al momento sbagliato (come durante la scrittura)
  • Opzione di frequenza
  • Spostare il testo dalle impostazioni alla localizzazione
6 Mi Piace