休憩しましょう!テーマコンポーネント

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

Should I change something? Critical feedbacks are welcome!

「いいね!」 2

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

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

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

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

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

「いいね!」 2

Thanks. I’ll try adding some QOL features when I get some time :slight_smile:

「いいね!」 3

すごい!自分でも用途に応じて変更できるなんて知りませんでした!それが役に立っているなんて素晴らしいですね。答えられていないスレッドに回答することは、フォーラムの用途に関わらず、どこでも常に推奨されることです。共有ありがとうございます!:slight_smile:

「いいね!」 3

新しい投稿を作成している最中にユーザーを中断させることはありますか?
このコンポーネントを通じて広告を提供することは可能ですか?

ユーザーが入力している際にポップアップが表示されないように設定していません :pensive:(ただし、エディタは閉じられません)。このコンポーネントを広告に使用することも可能ですが、広告に最適化された以下のソリューションを推奨します:

「いいね!」 1

スレッドを再度浮き上がらせてすみませんが、いくつか提案があります。ユーザーが設定でカスタマイズできるようにし、色を変更できるようにする。また、現在の「X」の代わりに2つのボタンを配置する。1つはYouTubeのようなソーシャルメディアプラットフォームで、ユーザーが変更可能にし、もう1つは「大丈夫です」などの文言で、管理者が変更できるようにする。

しかし、テキストに HTML を追加することは可能でしょうか?もし可能なら、とても助かります。(その場合、頻度に関する追加オプションがあるとよいですね…例えば、「n 日ごと」にのみ表示する、といった具合に。)

ソースコードを編集して、HTML をニーズに合わせて変更することももちろん可能です。

すでに公式の広告プラグインを使用しています。以下のリンクのように、サイトが読み込まれた際に広告をポップアップ表示することは可能でしょうか。Google AdSense のコードを実行するのでしょうか。

https://www.edaboard.com

デフォルトでは、通常のテキストの表示のみを想定しています。ソースコードを掘り下げて変更すれば、広告を表示することも可能です。

「いいね!」 1

@Pravi さん、ご希望であれば、リポジトリ をフォークして、コンポーネント内の head-tag.html ファイル をご覧になることをお勧めします(ポップアップなどの処理はここで行われています)。ご自身の好みに合わせてカスタマイズしてください。showModalこちら で呼び出されています。コードをいろいろいじってみるのも面白いと思います :slight_smile:

「いいね!」 1


コンポーネントが現在壊れています

「いいね!」 4

PRを作成しました :+1:


マージされました、Chaboiさんありがとう! :clap:

これは簡単なアップデートです。

実装する価値のある興味深い提案/機能を見ました:

  • コンテキストを監視して、間違ったタイミング(執筆中など)でモーダルが表示されないようにする
  • 頻度オプション
  • 設定のテキストをロケールに移動する
「いいね!」 6