jQuery.fn

jQuery.fn

Source:
See:

The jQuery plugin namespace.

Methods

(static) addAllEntitiesInCommunication(communication) → {external:jQuery_Object}

Source:

Add .entity and .entity_[UUID] classes to .token elements for all Entities with associated EntityMentions in the Communication.

Parameters:
Name Type Description
communication Communication
Returns:
Type
external:jQuery_Object

(static) addAllEntityMentionsInCommunication(communication) → {external:jQuery_Object}

Source:

Add .entity_mention and .entity_mention_[UUID] classes to .token elements for all EntityMentions associated with an Entity in the Communication.

Parameters:
Name Type Description
communication Communication
Returns:
Type
external:jQuery_Object

(static) addEntityMention(entityMention) → {external:jQuery_Object}

Source:

Add .entity_mention and .entity_mention_[UUID] classes to .token elements for entityMention

Parameters:
Name Type Description
entityMention EntityMention
Returns:
Type
external:jQuery_Object

(static) addEntityMentionSet(entityMentionSet) → {external:jQuery_Object}

Source:

Add .entity_mention and .entity_mention_[UUID] classes to .token elements for all EntityMentions in entityMentionSet.

Parameters:
Name Type Description
entityMentionSet EntityMentionSet
Returns:
Type
external:jQuery_Object

(static) communicationWidget(communication, options) → {external:jQuery_Object}

Source:

jQuery plugin wrapper for concrete.widget.createCommunicationDiv

Appends a div created by concrete.widget.createCommunicationDiv to the current jQuery object, returns the current jQuery object.

Parameters:
Name Type Description
communication Communication
options Object
Returns:
Type
external:jQuery_Object

(static) enableTokenClickCallbacks() → {external:jQuery_Object}

Source:

Enable "token click" callback functions that are registered through jQuery.fn.getTokenClickCallbacks

When the user clicks on a displayed tokens, all registered "token select" callback functions will be called and passed a list of TokenRefSequences containing the selected token.

Returns:
Type
external:jQuery_Object

(static) enableTokenSelectCallbacks() → {external:jQuery_Object}

Source:

Enable "token select" callback functions that are registered through jQuery.fn.getTokenSelectCallbacks

When the user selects a set of displayed tokens, all registered "token select" callback functions will be called and passed a list of TokenRefSequences containing the selected tokens.

Returns:
Type
external:jQuery_Object

(static) getEntityMentionElements(entityMention) → {external:jQuery_Object}

Source:

Returns a jQuery object for .token element(s) for entityMention

Parameters:
Name Type Description
entityMention EntityMention
Returns:
Type
external:jQuery_Object

(static) getManualTokenization() → {Tokenization}

Source:

Creates a Tokenization for a manualTokenizationWidget

The jQuery.fn.manualTokenizationWidget function creates a UI widget that allows a user to specify token boundaries between characters. This function creates a Tokenization object based on the token boundaries currently shown in the UI.

This function should be called on the same jQuery element that jQuery.fn.manualTokenizationWidget was called on.

Returns:
Type
Tokenization

(static) getSentenceElements(sentence) → {external:jQuery_Object}

Source:

Returns a jQuery object for .sentence element(s) specified by sentence

Parameters:
Name Type Description
sentence Sentence
Returns:
Type
external:jQuery_Object

(static) getTokenClickCallbacks() → {jQuery.Callbacks}

Source:

Returns the jQuery.Callbacks object for "token click" callback functions. If the jQuery.Callbacks object does not already exist, it will be created.

Returns:
Type
jQuery.Callbacks

(static) getTokenElements(tokenization) → {external:jQuery_Object}

Source:

Returns a jQuery object for all .token element(s) for the Tokenization object.

If you want the .tokenization element(s) for the Tokenization object, use jQuery.fn.getTokenizationElements

Parameters:
Name Type Description
tokenization Tokenization
Returns:
Type
external:jQuery_Object

(static) getTokenElementsWithIndex(tokenization, tokenIndex) → {external:jQuery_Object}

Source:

Returns a jQuery object for .token element(s) specified by tokenization+tokenIndex

Parameters:
Name Type Description
tokenization Tokenization
tokenIndex int
Returns:
  • jQuery Object for .token element(s) for tokenization+tokenIndex
Type
external:jQuery_Object

(static) getTokenElementsWithMatchingTag(tokenization, tokenTagging, matchFunction) → {external:jQuery_Object}

Source:

Returns a jQuery object for the DOM elements for the Tokens in a Tokenization, selecting only those Tokens whose TokenTagging tags satisfy the specified matchFunction.

Parameters:
Name Type Description
tokenization Tokenization
tokenTagging TokenTagging

The TokenTagging must be for the Tokenization specified as the first parameter.

matchFunction function

Function that takes as input a TaggedToken.tag string, and returns true or false based on whether or not the string "matches".

Returns:
  • jQuery Object for DOM elements for "matching" Tokens
Type
external:jQuery_Object

(static) getTokenizationElements(tokenization) → {external:jQuery_Object}

Source:

Returns a jQuery object for all .tokenization element(s) for the Tokenization object.

If you want the .token element(s) for the Tokenization object, use jQuery.fn.getTokenElements

Parameters:
Name Type Description
tokenization Tokenization
Returns:
Type
external:jQuery_Object

(static) getTokenPaddingElementsWithIndex(tokenization, tokenIndex) → {external:jQuery_Object}

Source:

Returns a jQuery object for .token_padding element(s) specified by tokenization+tokenIndex

Parameters:
Name Type Description
tokenization Tokenization
tokenIndex int
Returns:
  • jQuery Object for .token_padding element(s) for tokenization+tokenIndex
Type
external:jQuery_Object

(static) getTokenRefSequenceElements(tokenRefSequence) → {external:jQuery_Object}

Source:

Returns a jQuery object for .token element(s) specified by tokenRefSequence

Parameters:
Name Type Description
tokenRefSequence TokenRefSequence
Returns:
Type
external:jQuery_Object

(static) getTokenRefSequenceForTokensMatchingSelector(selector) → {TokenRefSequence}

Source:
Parameters:
Name Type Description
selector String

CSS selector string, e.g. '.selected_token'

Returns:
Type
TokenRefSequence

(static) getTokenSelectCallbacks() → {jQuery.Callbacks}

Source:

Returns the jQuery.Callbacks object for "token select" callback functions. If the jQuery.Callbacks object does not already exist, it will be created. For details about jQuery.Callbacks, see:

http://api.jquery.com/category/callbacks-object/

The "token select" callback functions will not be called unless the user has also called jQuery.fn.enableTokenSelectCallbacks. Once jQuery.fn.enableTokenSelectCallbacks has been called, when the user selects a set of displayed tokens, all registered "token select" callback functions will be called and passed a list of TokenRefSequences containing the selected tokens.

Returns:
Type
jQuery.Callbacks

(static) manualTokenizationWidget(sentence, options) → {external:jQuery_Object}

Source:

UI widget for manual tokenization of a Concrete Sentence

Takes a Sentence, creates DOM structure for characters in Sentence, attaches event handlers for keyboard input and navigation. When the widget is first created, each character is treated as a separate token. The 'x' key can be used to connect/disconnect characters, and the arrow keys used to navigate between characters.

Use jQuery.fn.getManualTokenization to get a Tokenization object reflecting the current token boundaries shown in the UI.

This function attaches a div to the jQuery element with the structure:

<div class="manual_tokenization">
  <span class="concrete_character">A</span>
  <span class="concrete_character_gap">  </span>
  <span class="concrete_character">B</span>
  <span class="concrete_character_gap">  </span>
  <span class="concrete_character">C</span>
  <span class="concrete_character_gap">  </span>
  ...
  <span class="concrete_character">Z</span>
</div>

When the user uses the UI to "connect" two characters into a single token, the .concrete_connected_character_class will be added to the .concrete_character spans for the two characters and the .concrete_character_gap span between the character spans.

Using the DOM structure shown above, if the character spans for 'A' and 'B' were connected, the new DOM structure would be:

<div class="manual_tokenization">
  <span class="concrete_character connected_concrete_characters">A</span>
  <span class="concrete_character_gap connected_concrete_characters">  </span>
  <span class="concrete_character connected_concrete_characters">B</span>
  <span class="concrete_character_gap">  </span>
  <span class="concrete_character">C</span>
  <span class="concrete_character_gap">  </span>
  ...
  <span class="concrete_character">Z</span>
</div>

This function does not set any CSS properties on the elements it creates. Here is some suggested CSS styling:

  .concrete_character {
    display: inline-block;
    border-bottom: 10px solid #F4F4F4;
  }
  .concrete_character_gap {
    cursor: pointer;
    display: inline-block;
    min-width: 1em;
  }
  .connected_concrete_characters {
    background-color: yellow;
    border-bottom: 10px solid #CCCCCC;
  }

Parameters for options object:

  • charactersInitiallyConnected (Boolean): Flag for whether all characters in an untokenized Sentence should be connected. If the Sentence already has a Tokenization, then this flag will be ignored. Default value: true
  • toggleConnectionKey (String): Key used to toggle the connection between characters. The string should be a valid KeyboardEvent.key value. Please note that Safari/WebKit does not currently support the KeyboardEvent.key field, so you need to set the toggleConnectionKeyCode option for these browsers. Default value: 'x'
  • toggleConnectionKeyCode (Number): KeyCode used to toggle the connection between characters. Please note that KeyCode values are system and implementation dependent. Default value: 88 (KeyCode for 'x')
Parameters:
Name Type Description
sentence Sentence
options Object
Returns:
  • this jQuery object
Type
external:jQuery_Object

(static) sectionWidget(section, options) → {external:jQuery_Object}

Source:

jQuery plugin wrapper for concrete.widget.createSectionDiv

Appends a div created by concrete.widget.createSectionDiv to the current jQuery object, returns the current jQuery object.

Parameters:
Name Type Description
section Section
options Object
Returns:
Type
external:jQuery_Object

(static) sentenceWidget(sentence, options) → {external:jQuery_Object}

Source:

jQuery plugin wrapper for concrete.widget.createSentenceDiv

Appends a div created by concrete.widget.createSentenceDiv to the current jQuery object, returns the current jQuery object.

Parameters:
Name Type Description
sentence Sentence
options Object
Returns:
Type
external:jQuery_Object

(static) tokenizationWidget(tokenization, options) → {external:jQuery_Object}

Source:

jQuery plugin wrapper for concrete.widget.createTokenizationDiv

Appends a div created by concrete.widget.createTokenizationDiv to the current jQuery object, returns the current jQuery object.

Parameters:
Name Type Description
tokenization Tokenization
options Object
Returns:
Type
external:jQuery_Object