Verint | Telligent Community
Verint | Telligent Community
  • Site
  • User
  • Site
  • Search
  • User
Verint Community 12.x
  • Verint Community
Verint Community 12.x
API Documentation bookmark UI Component
  • 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
      • +JavaScript API Modules
      • +jQuery Events
      • +jQuery Plugins
      • -UI Components
        • bookmark UI Component
        • code UI Component
        • collapseexpand UI Component
        • feature UI Component
        • html UI Component
        • Idea Voting UI Component
        • like UI Component
        • links UI Component
        • loading UI Component
        • masonry UI Component
        • moderate UI Component
        • page UI Component
        • poll UI Component
        • previewhtml UI Component
        • rate UI Component
        • resizedimage UI Component
        • scheduledfile UI Component
        • searchresult UI Component
        • select UI Component
        • squeezetext UI Component
        • tag UI Component
        • theater UI Component
        • tip UI Component
        • tourtip UI Component
        • viewhtml UI Component
        • webpreview UI Component
    • +Dynamic Configuration
    • +LESS Functions
    • +Script API Types
    • +Script APIs

bookmark UI Component


jQuery.telligent.evolution.ui.components.bookmark

UI Component which handles presentation of bookmark behavior for content. Transforms the output from $core_v2_ui.Bookmark(), which is a <span class="ui-bookmark"></span> stub. The default implementation uses the evolutionBookmark plugin. Overrides can be provided at the theme level to present bookmarks differently.

Options

Data made available to instances of the component:

  • contenttypeid: (string) Content Type Id Guid
  • contentid: (string) Content Id Guid
  • bookmarktypeid: (string) Type Id Guid
  • value: (string) If the content is bookmarked or not by the accessing user (true or false)
  • contenttypename: (string) Type name for this content

Example

A barebones UI component override which would result in rendering a read-only message of 'Bookmarked? Yes/No' for a given call to $core_v2_ui.Bookmark().

$.telligent.evolution.ui.components.rate = {
    setup: function() {
    },
    add: function(elm, options) {
        $(elm).html('Bookmarked? ' + (options.value == 'true' ? 'Yes' : 'No'));

        console.log('ContentId: ' + options.contentid);
        console.log('ContentTypeId: ' + options.contenttypeid);
        console.log('TypeId: ' + options.bookmarktypeid);
        console.log('Value: ' + options.value);
        console.log('ContentTypeName: ' + options.contenttypename);
    }
}

Default Implementation

For reference purposes or as the basis for an override:

$.telligent.evolution.ui.components.bookmark = {
    setup: function() {
    },
    add: function(elm, options) {

        elm.empty();

        var config = {
            contentId: options.contentid,
            contentTypeId: options.contenttypeid,
            typeId: options.bookmarktypeid,
            initialState: options.value == 'true',
            contentTypeName: options.contenttypename,
            onBookmark: function(contentId, contentTypeId, typeId, complete) {
                $.telligent.evolution.post({
                    url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/bookmark.json?ContentId={ContentId}&ContentTypeId={ContentTypeId}' + (typeId ? '&TypeId=' + typeId : ''),
                    data: {
                        ContentId: contentId,
                        ContentTypeId: contentTypeId
                        },
                    dataType: 'json',
                    success: function(response) { complete(); }
                });
            },
            onUnbookmark: function(contentId, contentTypeId, typeId, complete) {
                $.telligent.evolution.del({
                    url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/bookmark.json?ContentId={ContentId}' + (typeId ? '&TypeId=' + typeId : ''),
                    data: {
                        ContentId: contentId
                        },
                    dataType: 'json',
                    success: function(response) { complete(); }
                });
            }
        };

        if (options.configuration.deleteBookmarkText) { config.deleteBookmarkText = options.configuration.deleteBookmarkText; }
        if (options.configuration.addBookmarkText) { config.addBookmarkText = options.configuration.addBookmarkText; }
        if (options.configuration.processingText) { config.processingText = options.configuration.processingText; }
        if (options.configuration.addBookmarkCssClass) { config.addBookmarkCssClass = options.configuration.addBookmarkCssClass; }
        if (options.configuration.deleteBookmarkCssClass) { config.deleteBookmarkCssClass = options.configuration.deleteBookmarkCssClass; }
        if (options.configuration.processingCssClass) { config.processingCssClass = options.configuration.processingCssClass; }

        $(elm).evolutionBookmark(config);
    }
};

  • 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