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 {Function} [withSessionId] - קוראים לה עם כתובת URL של בקשה ופונקציית callback. מפעילה את ה-callback עם ה-URL ועליו מזהה הסשן של הצופה מצורף כאשר עוגיות צד שלישי נחסמות (אותו נתיב שבו משתמשות בקשות התגובה וההצבעה), או עם ה-URL ללא שינוי אחרת. כאשר אין מזהה סשן זמין בדרך זו, מצרפת את מזהה הסשן האנונימי האחרון שנמסר ל-rememberAnonSessionId, אם קיים. אינה בשימוש עבור SSO. * @property {Function} [rememberAnonSessionId] - קוראים לה עם ה-anonSessionId שהחזירה תשובה. השרת מחזיר מזהה כזה רק לאורח שבקשתו לא כללה עוגיית סשן, ולעולם לא עבור סשן מחובר. המזהה נשמר ב-localStorage (או בזיכרון כאשר האחסון אינו זמין) כך ש-withSessionId תשלח אותו בבקשות מאוחרות יותר והאורח ישמור על זהות אחת. * @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] - (מיושן) מחזיר HTML להוספה בראש אזור התגובה. * @property {FastCommentsUIExtensionWidgetTopCallback} [widgetTop] - (מיושן) מחזיר HTML להוספה בראש הווידג'ט. * @property {FastCommentsUIExtensionCommentTopCallback} [commentTop] - (מיושן) מחזיר HTML להוספה בראש אלמנט התגובה. * @property {FastCommentsUIExtensionCommentBottomCallback} [commentBottom] - (מיושן) מחזיר HTML להוספה בתחתית אלמנט התגובה. * @property {FastCommentsUIExtensionCommentBottomCallback} [commentContentBottom] - מחזיר HTML להוספה אחרי טקסט התגובה, בתוך אלמנט תוכן התגובה (בשימוש על ידי סקרים). * @property {Function} [replyAreaInputBottom] - מחזיר HTML להוספה בתוך מסגרת קלט התגובה, מתחת לשדה הטקסט (בשימוש על ידי סקרים עבור עורך הסקר המובנה). מקבל את מזהה תגובת האב, או null עבור תיבת התגובה הראשית. * @property {Function} [onPollUpdate] - נקראת עם האירוע החי כאשר מספרי ההצבעות של סקר בדף משתנים. * @property {Function} isSiteAdmin - מחזירה האם הצופה הוא מנהל או מנחה של הטננט. ידוע לאחר הבקשה הראשונה. * @property {FastCommentsUIExtensionMenuBottomCallback} [menuBottom] - (מיושן) מחזיר 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