FastComments.com
Here you can edit and run the code snippet from our documentation.
Example Code Snippet "אובייקט הרחבה JSDoc"
/** * אובייקט ההרחבה FastCommentsUI. משמש לטעינה עצלה של רכיבים מסוימים. לדוגמה, מערכת הסקירות אינה * משומשת על ידי כל הלקוחות, ולכן אנו טוענים את ההרחבה רק כאשר אנו רוצים זאת. * * @typedef {Object} FastCommentsUIExtension * @property {string} id * @property {Element} scriptNode * @property {Element} root - צומת השורש של הווידג'ט ב‑DOM. * @property {string} [css] * @property {Object} config - אובייקט התצורה של FastComments. * @property {Object} commentsById - הפנייה לאובייקט המכיל את כל ההערות לפי מזהה, המתעדכן באופן שוטף. * @property {Object} translations - הפנייה לכל התרגומים. * @property {Function} reRenderComment - הפנייה לפונקציה שניתן לקרוא לה כדי לעדכן מחדש תגובה. * @property {Function} removeCommentAndReRender - הפנייה לפונקציה שניתן לקרוא לה כדי להסיר תגובה מהזיכרון ולעדכן מחדש את החלק המתאים ב‑DOM. * @property {Function} newBroadcastId - הפנייה לפונקציה שניתן לקרוא לה כדי ליצור מזהה שידור חדש ולהוסיף אותו לרשימת מזהי השידור המקומית שיש להתעלם מהם. * @property {FastCommentsUIExtensionSetupEventHandlers} [setupEventHandlers] * @property {FastCommentsUIExtensionPrepareCommentForSavingCallback} [prepareCommentForSaving] - נקראת עם התגובה שעומדת להישלח. החזרת false מבטלת את השליחה (לדוגמה כאשר סקר מצורף אינו שלם). * @property {FastCommentsUIExtensionNewCommentCallback} [newComment] * @property {FastCommentsUIExtensionReplyAreaFilter} [replyAreaFilter] - מסנן HTML לאזור התגובה. * @property {FastCommentsUIExtensionWidgetFilter} [widgetFilter] - מסנן HTML לכל הווידג'ט בעת הרינדור. * @property {FastCommentsUIExtensionCommentTopFilter} [commentFilter] - מסנן HTML לכל תגובה לפני הרינדור. * @property {FastCommentsUIExtensionReplyAreaFilter} [commentMenuFilter] - מסנן HTML לכל תפריט תגובה לפני הרינדור. * @property {FastCommentsUIExtensionMenuFilter} [menuFilter] - מסנן HTML לכל הווידג'ט בעת הרינדור. * @property {FastCommentsUIExtensionReplyAreaTop} [replyAreaTop] - (LEGACY) מחזיר HTML להוספה לראש אזור התגובה. * @property {FastCommentsUIExtensionWidgetTopCallback} [widgetTop] - (LEGACY) מחזיר HTML להוספה לראש הווידג'ט. * @property {FastCommentsUIExtensionCommentTopCallback} [commentTop] - (LEGACY) מחזיר HTML להוספה לראש אלמנט התגובה. * @property {FastCommentsUIExtensionCommentBottomCallback} [commentBottom] - (LEGACY) מחזיר HTML להוספה לתחתית אלמנט התגובה. * @property {FastCommentsUIExtensionCommentBottomCallback} [commentContentBottom] - מחזיר HTML להוספה אחרי טקסט התגובה, בתוך אלמנט תוכן התגובה (משמש בסקרים). * @property {Function} [replyAreaInputBottom] - מחזיר HTML להוספה בתוך מסגרת קלט התגובה, מתחת לשדה הטקסט (משמש בסקרים לעורך הסקר במקום). מקבל את מזהה ההורה של התגובה, או null לתיבת השדה הראשית. * @property {Function} [onPollUpdate] - נקראת עם האירוע החי כאשר ספירות הקולות של סקר בעמוד משתנות. * @property {Function} isSiteAdmin - מחזירה האם הצופה הוא מנהל או מודרטור של השוכרת. ידוע לאחר הפנייה הראשונה. * @property {FastCommentsUIExtensionMenuBottomCallback} [menuBottom] - (LEGACY) מחזיר HTML להוספה לתחתית אלמנט התפריט עבור כל תגובה. * @property {FastCommentsUIExtensionRenderCallback} [onRender] * @property {FastCommentsUIExtensionConnectionStatusCallback} [onLiveConnectionStatusUpdate] * @property {FastCommentsUIExtensionInitialRenderCallback} [onInitialRenderComplete] * @property {FastCommentsUIExtensionPresenceUpdateCallback} [onPresenceUpdate] */ /** * @callback FastCommentsUIExtensionSetupEventHandlers * @param {Element} element - אלמנט השורש. * @param {Object.<string, Function>} clickListeners - מאפשי אירועי לחיצה, לפי שם מחלקה, שניתן לשנות בהתייחסות. * @returns void */ /** * @callback FastCommentsUIExtensionWidgetTopCallback * @param {Object} moduleData * @returns {string} */ /** * @callback FastCommentsUIExtensionWidgetFilter * @param {Object} moduleData * @param {Object} html * @returns {string} */ /** * @callback FastCommentsUIExtensionCommentTopCallback * @param {Object} comment * @returns {string} */ /** * @callback FastCommentsUIExtensionCommentTopFilter * @param {Object} comment * @param {string} html * @returns {string} */ /** * @callback FastCommentsUIExtensionCommentBottomCallback * @param {Object} comment * @returns {string} */ /** * @callback FastCommentsUIExtensionMenuBottomCallback * @param {Object} comment * @returns {string} */ /** * @callback FastCommentsUIExtensionMenuFilter * @param {Object} comment * @param {string} html * @returns {string} */ /** * @callback FastCommentsUIExtensionRenderCallback * @returns {string} */ /** * @callback FastCommentsUIExtensionConnectionStatusCallback * @param {boolean} isConnected * @returns {void} */ /** * @callback FastCommentsUIExtensionInitialRenderCallback * @returns {void} */ /** * @callback FastCommentsUIExtensionReplyAreaTop * @param {Object|null} currentUser * @param {boolean} isSaving * @param {boolean} isReplyOpen * @param {string|null} parentId * @returns {string} */ /** * @callback FastCommentsUIExtensionReplyAreaFilter * @param {Object|null} currentUser * @param {boolean} isSaving * @param {boolean} isReplyOpen * @param {string|null} parentId * @param {string|null} html * @returns {string} */ /** * @callback FastCommentsUIExtensionPrepareCommentForSavingCallback * @param {Object} comment * @param {string} parentId */ /** * @callback FastCommentsUIExtensionNewCommentCallback * @param {Object} comment */ /** * @callback FastCommentsUIExtensionPresenceUpdateCallback * @param {Object} update */
Result