Boards Comments Functions

Each of these functions require the <commentsbutton /> tag to be present on the view. The button does not have to be visible to the user but it must be present in the view HTML. See <commentsbutton> for details.

OpenDrawer

OpenDrawer Function

OpenDrawer
No parameters

Opens the comments drawer slide out panel for the current view.

This feature is available in WebEOC Nexus 10.18 and later.

Example

Copy Code
<script>
    BoardScript.Comments.OpenDrawer();
</script>

CloseDrawer

CloseDrawer Function

CloseDrawer
No parameters

Closes the comments drawer slide out UI for the current view.

This feature is available in WebEOC Nexus 10.18 and later.

Example

Copy Code
<script>
    BoardScript.Comments.CloseDrawer();
</script>

GetUnreadCount

GetUnreadCount Function
GetUnreadCount
callback #optional

Get the unread comment count for the current view/user. Result can be received via callback or async/await Promise return.

This feature is available in WebEOC Nexus 10.18 and later.

Example

Copy Code
<script>
  // callback
  BoardScript.Comments.GetUnreadCount(function (count) {                                                                                                                                                                                                                             
      console.log('Unread count is:', count);                                                                                                                                                                                                             
  });
 
  // async/await
  const count = await BoardScript.Comments.GetUnreadCount();
  console.log('Unread count is:', count);  
</script>

GetCountsByName

Get the comment counts for a user by specifying a board, view. or dataid.

GetCountsByName Function
GetCounts
args #optional

Single parameter arguments object for specifying board/view/dataid.

Copy Code

{
    "boardName": "My board", // empty for the current board
    "viewName": "My View",  // empty for the current view
    "dataId": 123 // optional. Do not provide if requesting for a list view.
}

This feature is available in WebEOC Nexus 10.19 and later.

callback #optional Result can be received via callback or async/await Promise return.

Example

Copy Code

<script>
    // callback
        BoardScript.Comments.GetCounts(function (countsObject) {                                     
            console.log('Unread count is:', countsObject.unreadCount);
            console.log('Total count is:', countsObject.totalCount);                                      
    });
 
    // async/await
    const countsObject = await BoardScript.Comments.GetCounts();
    console.log('Unread count is:', countsObject.unreadCount);
    console.log('Total count is:', countsObject.totalCount);  
</script>

GetCounts

GetCounts Function
GetCounts
callback #optional

Get the comment count for the current view/user. Result can be received via callback or async/await Promise return.

This feature is available in WebEOC Nexus 10.18 and later.

Example

Copy Code

            <script>
                // callback
                BoardScript.Comments.GetCounts(function (countsObject) {                                     
                console.log('Unread count is:', countsObject.unreadCount);
                console.log('Total count is:', countsObject.totalCount);                                      
                });
 
                // async/await
                const countsObject = await BoardScript.Comments.GetCounts();
                console.log('Unread count is:', countsObject.unreadCount);
                console.log('Total count is:', countsObject.totalCount);  
        </script>