Faça uma pausa! Componente de 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 curtidas

Should I change something? Critical feedbacks are welcome!

2 curtidas

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 curtidas

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 curtidas

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 curtidas

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 curtidas

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

2 curtidas

Obrigado. Vou tentar adicionar alguns recursos de QOL quando tiver um tempo :slight_smile:

3 curtidas

Impressionante! Eu nunca sabia que poderia ser alterado para diferentes usos! É incrível saber que está ajudando. Responder tópicos sem resposta é definitivamente algo que sempre é incentivado em qualquer lugar, independentemente do que o fórum é usado para. Obrigado por compartilhar! :slight_smile:

3 curtidas

Isso interrompe os usuários enquanto eles criam uma nova publicação?
É possível exibir anúncios por meio deste componente?

Eu não configurei para evitar que ele apareça quando um usuário está digitando :pensive: (Embora ele não feche o editor). Você certamente pode usar este componente para anúncios, mas recomendo esta solução, pois é mais otimizada para publicidade:

1 curtida

Desculpe pelo bump, mas tenho algumas sugestões: talvez tornar isso configurável pelo usuário nas configurações, permitir mudar a cor e, em vez de um X, ter dois botões: um com uma plataforma de mídia social, como o YouTube, que o usuário possa alterar, e outro dizendo ‘Estou bem’ ou algo assim, que possa ser alterado pelo administrador.

Mas é realmente possível adicionar HTML ao texto? Seria muito legal se fosse. (e talvez, nesse caso, uma opção extra para frequência… como mostrar apenas a cada “n” dias).

Você pode editar o código-fonte e alterar o HTML para atender às suas necessidades.

Já estou usando o plugin oficial de anúncios. Estou perguntando se é possível exibir anúncios em pop-up quando o site carrega, assim como no link abaixo. Ele executa o código do Google AdSense?

https://www.edaboard.com

Por padrão, ele é destinado apenas a exibir texto normal. Se você mergulhar no código-fonte e alterá-lo, definitivamente poderá exibir um anúncio.

1 curtida

@Pravi, se quiser, você pode fazer um fork do repositório e dar uma olhada no arquivo head-tag.html no componente (é aqui que os pop-ups e tudo mais são feitos) e personalizá-lo conforme suas preferências. A showModal é chamada aqui. Você provavelmente vai querer brincar com o código :slight_smile:

1 curtida


O componente está quebrado no momento

4 curtidas

Eu fiz o PR :+1:


Foi mesclado, obrigado Chaboi! :clap:

Note que esta é uma atualização simples.

Eu vi sugestões/funcionalidades interessantes que podem valer a pena implementar:

  • Observar o contexto para não exibir o modal na hora errada (como ao escrever)
  • Opção de frequência
  • Mover o texto das configurações para o locale
6 curtidas