WarningThis is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.

Developer Notes

Developer Notes for Annotations API version zero.

11-July-2018

This change introduces two new public methods to the Annotations API:

var textHighlightModule = annotationsApp.module('texthighlight'); 

// Turn on text highlight editing: 
textHighlightModule.enableEditing(); 

// Turn off text highlight editing: 
textHighlightModule.disableEditing();

By disabling text highlight editing, you can view highlights in read-only mode. This prevents the toolbar from appearing when selecting text or clicking an existing highlight. By default, text highlight editing is enabled, but it can be disabled either via the public method or the init option:

LearnosityAnnotations.init({ 
    "security": {...}, 
    "request": { 
        "modules": { 
            "texthighlight": { 
                "enable_editing": false 
            } 
        } 
    } 
});

When the Annotations API is loaded via the Items API, text highlight editing will be automatically disabled in "preview" and "review" activity states. This behaviour can overridden via the init options:

LearnosityItems.init({ 
    "security": {...}, 
    "request": { 
        ... 
        "config": { 
            "annotations": true, 
            "annotations_api_init_options": { 
                "modules": { 
                    "texthighlight": { 
                        "enable_editing": false 
                    } 
                } 
            } 
        } 
    } 
});