# Global

##

### Methods

#### AdjustPolygonButton()

This function is called when the user clicks 'Adjust Polygon' button

Source:
  - edit_event.js, line 132

#### CreatePopupBubble(left, top, innerhtml, dom_attach) → {string}

This function creates the popup bubble.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | float | xlocation of the bubble
`top` | float | ylocation of the bubble
`innerhtml` | string | extra html content for the bubble
`dom_attach` | string | id of the html element where it should be attached

Source:
  - bubble.js, line 15

##### Returns:

bubble_name - dom element name for the popup bubble

Type
  string

#### CreatePopupBubbleCloseButton(dom_bubble, close_button)

This function creates the close button at the top-right corner of the popup bubble

##### Parameters:

Name | Type | Description
--- | --- | ---
`dom_bubble` | string | dom_bubble name
`close_button` | function | function to run when the close button is pressed

Source:
  - bubble.js, line 56

#### DrawCanvasClosePolygon()

Handles when the user closes the polygon by right-clicking or clicking on the first control point. For video events the bubble is slightly different

Source:
  - draw_event.js, line 99

#### DrawCanvasMouseDown()

Handles when the user presses the mouse button down on the drawing canvas.

Source:
  - draw_event.js, line 63

#### FinishStartup()

Finish the startup process:

Source:
  - startup.js, line 215

#### getQueryVariable()

This function gets a variable from the URL (or the COOKIES)

Source:
  - browser.js, line 69

#### LMgetObjectField(xml, ind_object, name, frame)

Gets a field for an object from an xml. If frame value is provided, it gives the field at the given.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml` | string | The xml containing the annotations
`ind_object` | int | Index to the object to be displayed
`name` | string | name of the field to return.
`frame` | int | frame of interest

Source:
  - xml_accessors.js, line 10

#### LMnumberOfObjects()

Returns number of LabelMe objects.

Source:
  - xml_accessors.js, line 46

#### LoadAnnotation404()

Annotation file does not exist, so load template.

Source:
  - startup.js, line 179

#### LoadAnnotationSuccess(xml)

This function gets called if the annotation has been successfully loaded.

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml` | string | the xml regarding the current file

Source:
  - startup.js, line 59

#### LoadTemplate404()

Annotation template does not exist for this folder, so load default

Source:
  - startup.js, line 187

#### LoadTemplateSuccess(xml)

Actions after template load success

##### Parameters:

Name | Type | Description
--- | --- | ---
`xml` | string | the xml regarding the current file

Source:
  - startup.js, line 199

#### SetAllAnnotationsArray()

Sets AllAnnotations array from LM_xml

Source:
  - startup.js, line 95

#### StartDrawEvent()

This function is called with the draw event is started. It can be triggered when the user (1) clicks on the base canvas.

Source:
  - draw_event.js, line 8

#### StartEditEvent(anno_id)

This function is called with the edit event is started. It can be triggered when the user (1) clicks a polygon, (2) clicks the object in the object list, (3) deletes a verified polygon.

##### Parameters:

Name | Type | Description
--- | --- | ---
`anno_id` | int | the id of the annotation being edited

Source:
  - edit_event.js, line 14

#### StartEditVideoEvent(anno_id, polygon_id)

Mirror function of StartEditEvent for video It creates an aux annotation so that the code is compliant

##### Parameters:

Name | Type | Description
--- | --- | ---
`anno_id` | int | the id of the annotation being edited
`polygon_id` | string | the id of the html polygon element

Source:
  - edit_event.js, line 198

#### StartupLabelMe()

Main entry point for the annotation tool.

Source:
  - startup.js, line 4

#### StopDrawEvent()

This function is called when the draw event is finished. It can be triggered when the user (1) closes the polygon and only one option is valid in the drop-down list (2) erases the last control point.

Source:
  - draw_event.js, line 205

#### StopEditEvent()

This function is called when the edit event is finished. It can be triggered when the user (1) clicks the close edit bubble button, (2) zooms, (3) submits an object label in the popup bubble, (4) presses the delete button in the popup bubble, (5) clicks the object in the object list, (6) presses the ESC key.

Source:
  - edit_event.js, line 82

#### UndoCloseButton()

Handles when the user presses the undo close button in response to the "What is this object?" popup bubble.

Source:
  - draw_event.js, line 176