مكون سمة اقتباس سريع

:information_source: الملخص ببساطة: يغير سلوك أزرار “الرد على المنشور” (وليس الرد على الموضوع) لذكر منشور تلقائيًا بنقرة واحدة.
:hammer_and_wrench: رابط المستودع GitHub - merefield/discourse-quick-quote: A Theme component to change the behaviour of the Post Reply buttons to quote a Post automatically in a single click. · GitHub
:open_book: دليل التثبيت Installing a theme or theme component
:heart: الرعاية يُرجى النظر في أن تصبح راعيًا مستمرًا لأعمالي مفتوحة المصدر بمستوى يناسب مواردك أو موارد مؤسستك واحتياجاتها، لضمان حصول هذا المكون على الصيانة التي يستحقها ومواصلة عمله لموقعك في المستقبل.
هل تستمتع بهذا المكون الخاص بالقالب؟ يرجى :star: له على GitHub

ما الذي يفعله

ببساطة: يغير سلوك أزرار “الرد على المنشور” (وليس الرد على الموضوع) لذكر منشور تلقائيًا بنقرة واحدة.

توجد عدة إعدادات لتحديد ما يتم ذكره ومتى. يمكنك حتى تحديد التضمين المتداخل للمقتطفات للحصول على شعور “الأسلوب القديم”.

نظرًا لأن الاقتباس الآلي يُوجَّه إلى المحرر، يمكنك تعديله يدويًا من هناك إذا رغبت في ذلك (لكن هذا نوعًا ما يُفقد جزء “السرعة” :snail:).

لا يغير سلوك زر الرد على الموضوع في الأسفل، ولا أداة الاقتباس.

السبب

  • يشعر البعض أن عملية الاقتباس تتطلب نقرات كثيرة في التثبيت الأساسي. وتُعد هذه مشكلة أكبر على الأجهزة التي تعمل باللمس.

  • يُعد “الاقتباس التلقائي” مفيدًا بشكل خاص عندما يكون الرد على منشور قديم نسبيًا. يقوم هذا الإضافة بعد عدد المنشورات التي سبقت المنشور المرجعي، ويقوم تلقائيًا بإدراج اقتباس إذا كان المنشور قديمًا بما يكفي. وهذا يساعد الناس على فهم السياق بسرعة أكبر.

  • يعيد “الاقتباسات المتداخلة”! (مفعل افتراضيًا: غير مفعّل) قد يكون المكون جذابًا بشكل خاص لأولئك المعتادين على بعض منصات المنتديات “التي تعود إلى الأسلوب القديم” :space_invader:، وهو مسألة ذوق — إذا كنت تحب رؤية اقتباسات متداخلة، فستتمكن من ذلك الآن، ولكن انتبه لتأثيرها على المساحة!

لا تحتاجه إذا

كنت راضيًا تمامًا عن سلوك الرد على منشورات الموضوع كما هو عليه افتراضيًا. أنا كذلك، لكن من الرائع وجود خيارات، أليس كذلك؟

الإعدادات

quick_quote_post_location_threshold: “عدد المنشورات السابقة قبل تفعيل الاقتباس السريع.”

تحكم في مدى قِدم المنشور المطلوب قبل تفعيل الاقتباس التلقائي. يتجنب الاقتباس غير الضروري للمنشورات الحديثة.

quick_quote_remove_links: “إزالة جميع الروابط (بما في ذلك الصور) من الاقتباسات”

ينظف الأمور ويحسن استخدام المساحة.

quick_quote_remove_prior_quotes: “إزالة جميع الاقتباسات السابقة (المتداخلة)”

مفعل افتراضيًا. قم بإلغاء تفعيل هذا الإعداد للحصول على تجربة متداخلة كلاسيكية نهائية. (آسف جيف! :wink: )

quick_quote_remove_contiguous_new_lines: “إزالة أسطر جديدة غير ضرورية”

الأسطر الجديدة مبالغ في تقديرها.

quick_quote_character_limit: “حد أحرف الاقتباس (يستخدم آخر x حرف إذا تجاوز الطول الكلي)”

الاقتطاعات بسيطة جدًا :slight_smile: عد إلى أداة الاقتباس إذا كنت بحاجة إلى اقتباس أكثر دقة (والتي لا يتم تجاوزها بواسطة الإضافة).

القيود المعروفة

لا يدعم وضع النص الغني الجديد في المحرر. يبدو أن التحديثات الأساسية قد حلّت المشكلة؟

المكون الخاص بالقالب بسيط نسبيًا في طريقة تعامله مع تحضير الاقتباس. بعض الإعدادات تعمل معًا بشكل أفضل من غيرها، وعلى المسؤول تحديد ما يناسبه. تم تجنب بعض التعقيدات، مثل وجود حد لأحرف الاقتطاع الذي قد يقسم الكلمات إلى نصفين. يتم تبسيط التنسيق بإزالة الوسوم لتجنب خطر قطع الوسم والتسبب في تلف — مرة أخرى، هذا لتحقيق البساطة. يعتمد معالجة الاقتباس بشكل كبير على التعبيرات النمطية، وليست جميعها آمنة تمامًا، لكنها تعمل “بشكل كافٍ”. قد يتم تحسين هذه التعبيرات خلال عمر المكون الخاص بالقالب.

تم نقل هذا مؤخرًا من الإضافة المماثلة الخاصة بي، ولكن قد تكون هناك أخطاء ظهرت أثناء هذه العملية. يُرجى إعلامي إذا واجهت أيًا منها.

راعيتي والإلهام وراء هذا المكون

يرجى شكر @Merlls_Rizzini على رعاية هذا العمل. الوظيفة هي مزيج من أفكارنا معًا، وهي مستوحاة جزئيًا من هذا المنشور من @eesty.

ملاحظة: كان هذا مبنيًا على إضافة “السرعة في الاقتباس” الخاصة بي، لكنه انتقل إلى تنسيق مكون القالب لمنح مديري المواقع المزيد من الوصول إذا كانوا مستضافين من طرف ثالث. اقترح @sam تحويله إلى مكون قالب لأنه لا يحتوي على مكون خلفي، وقدم @sully الدفعة النهائية لنقله بعد أن أنشأ نسخة قالب خاصة به.

كل التعليقات موضع ترحيب.

37 إعجابًا

If I’d of not skip read that I’d of spent less time trying to figure out the value,

I like it :+1:

3 إعجابات

Would be cool if you could use this by category, would love to have it in our AMA category, but otherwise it would be kinda messy.

3 إعجابات

A recent Git commit to topic.js seems to have broken this theme component:

Quote.build() no longer exists; they seem to be importing and using the buildQuote() function instead. A quick substitution didn’t do the trick; will have to ponder this a bit more.

إعجابَين (2)

My bad! The quick quote plugin wasn’t on the all-the-plugins list so I missed it when looking for regressions. I’ll add it and I’ve opened a PR with a fix to the plugin:

(plus a small fix to settings: FIX: Setting descriptions were swapped by cvx · Pull Request #2 · merefield/discourse-quick-quote · GitHub)

5 إعجابات

Awesome, thanks Jarek (and thanks for reporting @sully!) , merged! (and thanks for the bug fix!)

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

I am running this theme, did the update yesterday and getting complaints today

upon creating a post to reply and explain I found if I’m replying to a post and I go up to another and
want to reply in whole I can not, the reply remains on the post I started with,

previously it would toggle, the quick quote still works though

For my full comprehension, would you mind breaking that down a bit more … can you explain it in finer steps and where you believe it goes wrong?

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

Yeah its being discussed now and the inability to hit reply any further up than 3 posts is likely going to be one of those haunting, need to explain over and over problems

Quick quote is great, but can the reply function be restored?

I’m still not following you. Can you please go into greater detail and more steps?

I’ve retested the Component locally and it seems to be behaving fine?

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

No problem, and maybe I’m misinterpreting function or some other oversight

but right now as it stands if I go up in a thread 4 posts in a thread the reply button is disabled,

this was only mentioned today and yesterday I did the update

So I believe its related, maybe there’s a setting involved?

Can you show me your Theme settings?

Can you also confirm you are on the latest discourse version and latest version of the Theme Component?

Also, can you please let me know if you see any Javascript errors on the console?

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

in a random thread

this site doesn’t show version like my self hosted

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

Thanks.

OK so I’ve set my settings the same and cannot replicate. The Reply button 4 posts back is working fine.

That’s highly suspicious though given your settings. (The ‘3’ jumps out!)

I’m on the latest version of Discourse and the TC. Make sure you are fully updated on both.

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

view source says Discourse 2.5.0.beta2

and TC is theme component?

image

changing 3 to 5 allows me to reply up to the 5th post

so do I do a 9999 and does that short any other function?

OK so I’ve replicated your issue on a Production site …

v2.5.0.beta2 +459

Those changes that Jarek submitted were very specfically targetting the latest version of Discourse.

Is it possible you are on a Discourse commit prior to his changes? If so, it will not work with the latest TC. You need to upgrade both or neither.

Moreover, I’ve just upgraded that site (to latest-release +495) and all is well again.

So yeah, you need to upgrade your Discourse past his commit.

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

Can you provide any css I can use to roll back?

then I’ll remove it after my site is updated?

Thank you :slightly_smiling_face:

or

@team is my site do for an update soon?

Ah, good idea, except I don’t think you can access the javascript folder contents from the UI (someone please correct me if I’m wrong!).

Unfortunately I don’t believe you can install a specific commit of a Theme Component either (ditto!).

So my suggestion is, yeah, change that 3 to 9999 and wait until your Discourse is more up-to-date.

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

Can do, no worries and thanks for the cooperation, its greatly appreciated :+1:

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

Hey all you Quick Quoting hip-shooting Discoursers … I’ve released a fix to make Quick Quote work again with latest Discourse.

I’m tracking tests-passed so do not update if you are not on that branch.

3 إعجابات