new HighlighterWaiter(app)
Waiter to handle events related to highlighting in CyberChef.
Parameters:
| Name | Type | Description |
|---|---|---|
app |
HTMLApp | The main view object for CyberChef. |
- Copyright:
-
- Crown Copyright 2016
- License:
-
- Apache-2.0
- Source:
Members
-
<static, readonly> INPUT
-
HighlighterWaiter data type enum for the input.
- Source:
-
<static, readonly> OUTPUT
-
HighlighterWaiter data type enum for the output.
- Source:
Methods
-
<private> _is_selection_backwards()
-
Determines if the current text selection is running backwards or forwards.
StackOverflow answer id: 12652116- Source:
Returns:
- Type
- boolean
-
<private> _get_output_html_offset(node, offset)
-
Calculates the text offset of a position in an HTML element, ignoring HTML tags.
Parameters:
Name Type Description nodeelement The parent HTML node.
offsetnumber The offset since the last HTML element.
- Source:
Returns:
- Type
- number
-
<private> _get_output_html_selection_offsets()
-
Gets the current selection offsets in the output HTML, ignoring HTML tags.
- Source:
Returns:
-
pos
- Type
- Object
-
pos.start
- Type
- number
-
pos.end
- Type
- number
-
input_scroll(e)
-
Handler for input scroll events.
Scrolls the highlighter pane to match the input textarea position.Parameters:
Name Type Description eevent - Source:
-
output_scroll(e)
-
Handler for output scroll events.
Scrolls the highlighter pane to match the output textarea position.Parameters:
Name Type Description eevent - Source:
-
input_mousedown(e)
-
Handler for input mousedown events.
Calculates the current selection info, and highlights the corresponding data in the output.Parameters:
Name Type Description eevent - Source:
-
output_mousedown(e)
-
Handler for output mousedown events.
Calculates the current selection info, and highlights the corresponding data in the input.Parameters:
Name Type Description eevent - Source:
-
output_html_mousedown(e)
-
Handler for output HTML mousedown events.
Calculates the current selection info.Parameters:
Name Type Description eevent - Source:
-
input_mouseup(e)
-
Handler for input mouseup events.
Parameters:
Name Type Description eevent - Source:
-
output_mouseup(e)
-
Handler for output mouseup events.
Parameters:
Name Type Description eevent - Source:
-
output_html_mouseup(e)
-
Handler for output HTML mouseup events.
Parameters:
Name Type Description eevent - Source:
-
input_mousemove(e)
-
Handler for input mousemove events.
Calculates the current selection info, and highlights the corresponding data in the output.Parameters:
Name Type Description eevent - Source:
-
output_mousemove(e)
-
Handler for output mousemove events.
Calculates the current selection info, and highlights the corresponding data in the input.Parameters:
Name Type Description eevent - Source:
-
output_html_mousemove(e)
-
Handler for output HTML mousemove events.
Calculates the current selection info.Parameters:
Name Type Description eevent - Source:
-
selection_info(start, end)
-
Given start and end offsets, writes the HTML for the selection info element with the correct
padding.Parameters:
Name Type Description startnumber The start offset.
endnumber The end offset.
- Source:
Returns:
- Type
- string
-
remove_highlights()
-
Removes highlighting and selection information.
- Source:
-
generate_highlight_list()
-
Generates a list of all the highlight functions assigned to operations in the recipe, if the
entire recipe supports highlighting.- Source:
Returns:
-
highlight_output(pos)
-
Highlights the given offsets in the output.
We will only highlight if:- input hasn't changed since last bake - last bake was a full bake - all operations in the recipe support highlightingParameters:
Name Type Description posObject The position object for the highlight.
Properties
Name Type Description startnumber The start offset.
endnumber The end offset.
- Source:
-
highlight_input(pos)
-
Highlights the given offsets in the input.
We will only highlight if:- input hasn't changed since last bake - last bake was a full bake - all operations in the recipe support highlightingParameters:
Name Type Description posObject The position object for the highlight.
Properties
Name Type Description startnumber The start offset.
endnumber The end offset.
- Source:
-
highlight(textarea, highlighter, pos)
-
Adds the relevant HTML to the specified highlight element such that highlighting appears
underneath the correct offset.Parameters:
Name Type Description textareaelement The input or output textarea.
highlighterelement The input or output highlighter element.
posObject The position object for the highlight.
Properties
Name Type Description startnumber The start offset.
endnumber The end offset.
- Source:
CyberChef