Verint | Telligent Community
Verint | Telligent Community
  • Site
  • User
  • Site
  • Search
  • User
Verint Community 11.x
  • Verint Community
Verint Community 11.x
API Documentation mentions Composer Plugin
  • User Documentation
  • Ask the Community
  • API Documentation
  • Manager Training
  • Developer Training
  • Tags
  • More
  • Cancel
  • New
  • API Documentation
  • +In-Process API Documentation
  • +Plugin API Documentation
  • +REST API Documentation
  • -Widget, Theme, and Automation APIs
    • +Automation Events
    • -Client-side APIs
      • +Client Messages
      • -Composer Plugins
        • autocomplete Composer Plugin
        • hashtags Composer Plugin
        • mentions Composer Plugin
        • urlhighlight Composer Plugin
      • +JavaScript API Modules
      • +jQuery Events
      • +jQuery Plugins
      • +UI Components
    • +Dynamic Configuration
    • +LESS Functions
    • +Script API Types
    • +Script APIs

mentions Composer Plugin


Mention Composer Plugin

Composer plugin which adds @mention support.

Usage

Like other Composer plugins, it can be declared in the list of plugins when instantiating a composer

$('textarea.selector').evolutionComposer({
    plugins: ['mentions']
    // extra options supported by the mentions plugin
});

Options

  • onMentionableList: function which is called to asynchronously provide suggested type-ahead results during @mention composition
    • parameters:
      • query: string query
      • complete: function to be called to pass the results back to the composer. Should be passed an array of objects with name and token keys on each.
    • default: ** This is automatically supplied globally by Evolution, but can be overridden**
  • onListContent: function which is called to transform a set of contentId and contentTypeIds to their HTML Names
    • parameters:
      • contentIdsAndTypes: array of objects, each containing a contentId and contentTypeId string
      • complete: function to be called to pass the results back to the composer. Should be passed an array of objects with contentId, contentTypeId, and htmlName.
  • highlightClass: class name to apply to the @mention to differentiate it from surrounding text.
    • default: 'composer-mentionable-mention-highlight'

Default onMentionableList implementation:

This is automatically supplied globally by Evolution, but can be overridden:

onListContent: function(contentIdsAndTypes, complete) {
    // gets a set of HtmlNames for a given set of content ids/type ids for the purpose
    // of re-showing a pre-exisitng mention token in text
    $.telligent.evolution.batch(function(){
        $.each(contentIdsAndTypes, function(i, content) {
            $.telligent.evolution.get({
                url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/genericcontent/{contentId}/{contentTypeId}.json',
                data: {
                    contentId: content.contentId,
                    contentTypeId: content.contentTypeId
                }
            }).then(function(r){
                content.name = r.Content.HtmlName;
            });
        });
    }).then(function(){
        complete(contentIdsAndTypes);
    });
},
onMentionableList: function(query, complete) {
    $.telligent.evolution.get({
        url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/mentionables.json?IncludeFields=Token,PreviewHtml',
        data: {
            QueryText: query,
            PageSize: 20
        },
        cache: false,
        dataType: 'json',
        success: function(response) {
            if(response.Mentionables && response.Mentionables.length > 0) {
                var results = $.map(response.Mentionables, function(mentionable) {
                    return { name: mentionable.PreviewHtml, token: mentionable.Token };
                });
                complete(results);
            } else {
                complete(null);
            }
        }
    });
}

  • Share
  • History
  • More
  • Cancel
Related
Recommended
  • Telligent
  • Professional Services
  • Submit a Support Ticket
  • Become a Partner
  • Request a Demo
  • Contact Us

About
Privacy Policy
Terms of use
Copyright 2024 Verint, Inc.
Powered by Verint Community