خذ استراحة! مكون السمة

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، يمكن وضع زرين: أحدهما لمنصة تواصل اجتماعي مثل YouTube يمكن للمستخدم تغييرها، والآخر يحتوي على عبارة مثل “أنا بخير” أو ما شابه، ويمكن للمسؤول تعديلها.

لكن هل من الممكن إضافة HTML إلى النص؟ سيكون ذلك رائعًا جدًا إذا كان الأمر كذلك. (وربما في هذه الحالة خيار إضافي للتردد… مثل إظهار النص كل “n” يوم فقط).

يمكنك بالتأكيد تعديل الكود المصدري وتغيير HTML ليتناسب مع احتياجاتك.

أنا أستخدم بالفعل إضافة الإعلانات الرسمية. هل من الممكن إظهار إعلانات منبثقة عند تحميل الموقع تمامًا كما في الرابط أدناه؟ هل تعمل بكود Google AdSense؟

https://www.edaboard.com

بشكل افتراضي، يُقصد به عرض النص العادي فقط. إذا قمت بالغوص في كود المصدر وتغييره، يمكنك بالتأكيد عرض إعلان.

إعجاب واحد (1)

@Pravi، إذا رغبت، يمكنك إنشاء نسخة من المستودع والاطلاع على ملف head-tag.html داخل المكوّن (وهو المكان الذي تُنفَّذ فيه النوافذ المنبثقة وغيرها من الأمور) وتعديله ليتناسب مع تفضيلاتك. يُستدعى showModal هنا. ربما ترغب في تجربة الكود بنفسك :slight_smile:

إعجاب واحد (1)


المكون معطل حاليًا

4 إعجابات

لقد قدمت طلب السحب :+1:


لقد تم دمجه، شكرًا Chaboi! :clap:

لاحظ أن هذا تحديث بسيط.

لقد رأيت اقتراحات/ميزات مثيرة للاهتمام قد تستحق التنفيذ:

  • مراقبة السياق لتجنب ظهور النافذة المنبثقة في وقت غير مناسب (مثل الكتابة)
  • خيار التكرار
  • نقل النص من الإعدادات إلى اللغة المحلية
6 إعجابات