com.alecdorrington.annotatedtextformat.dom

Members list

Type members

Classlikes

final case class Box(left: Double, top: Double, width: Double, height: Double)

A box in the window, as the DOM measures an element: its left, top, width and height, in pixels.

A box in the window, as the DOM measures an element: its left, top, width and height, in pixels.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Box

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Box.type
object Colour

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Colour.type
final class Decoration[A]

The annotations of annotated, put in the page in a passage, which may be hidden and shown again, each read as the page's own text while hidden, and taken out of it. Each annotation is known by its index in annotated.

The annotations of annotated, put in the page in a passage, which may be hidden and shown again, each read as the page's own text while hidden, and taken out of it. Each annotation is known by its index in annotated.

Attributes

Supertypes
class Object
trait Matchable
class Any
object Decorator

Puts annotations into the page itself, in the text of a Passage, as a page that is not one's own must be: splitting its text nodes and wrapping their parts, never building the passage anew, and leaving each text node of the page where it was, so that Decoration.restore gives the page back exactly as it was, its own text nodes whole.

Puts annotations into the page itself, in the text of a Passage, as a page that is not one's own must be: splitting its text nodes and wrapping their parts, never building the passage anew, and leaving each text node of the page where it was, so that Decoration.restore gives the page back exactly as it was, its own text nodes whole.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Decorator.type
enum Focus[-A]

Which annotations of each decoration that a Hovering covers take the focus, as by Tab, showing their tooltip, and how. An annotation within what takes the focus itself, as a link, never does, as the page's own keys reach it there.

Which annotations of each decoration that a Hovering covers take the focus, as by Tab, showing their tooltip, and how. An annotation within what takes the focus itself, as a link, never does, as the page's own keys reach it there.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Each[A]
class Roving[A]
final case class Hovered[A](decoration: Decoration[A], annotations: List[Int])

The annotations, by their indices in decoration, that a tooltip is shown for, as those in the highlighted element under the pointer.

The annotations, by their indices in decoration, that a tooltip is shown for, as those in the highlighted element under the pointer.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class Hovering[A]

Shows tooltip with what content gives for the annotations under the pointer, of whichever decoration it covers, as they are added and removed, for the line of the element under it, within the page's open shadow roots too. content is given the showing that it is for, by which it may replace what it gave, as with an answer that comes later, which is dropped if the tooltip has since closed or moved on. The tooltip stays open while the pointer is within the smallest convex shape holding both that line and it, as it crosses from one to the other, straight or slanting, so that its content may be scrolled or used. If it is interactive, and the mouse opened it, it covers that shape but the line, so that nothing highlighted beneath, on the line beyond or beside the element on its own, takes its place, and keeps to the side of the line it opened on as it grows, scrolling within the room there, lest it move across the line and leave the pointer over the next one instead. It closes as the pointer moves elsewhere, leaves the window, or the page moves the line beneath it, and on Escape, which goes on to the page unless the focus opened the tooltip or is within it, as the page may close its own menus by it. While it is open, the element it is for is described by it.

Shows tooltip with what content gives for the annotations under the pointer, of whichever decoration it covers, as they are added and removed, for the line of the element under it, within the page's open shadow roots too. content is given the showing that it is for, by which it may replace what it gave, as with an answer that comes later, which is dropped if the tooltip has since closed or moved on. The tooltip stays open while the pointer is within the smallest convex shape holding both that line and it, as it crosses from one to the other, straight or slanting, so that its content may be scrolled or used. If it is interactive, and the mouse opened it, it covers that shape but the line, so that nothing highlighted beneath, on the line beyond or beside the element on its own, takes its place, and keeps to the side of the line it opened on as it grows, scrolling within the room there, lest it move across the line and leave the pointer over the next one instead. It closes as the pointer moves elsewhere, leaves the window, or the page moves the line beneath it, and on Escape, which goes on to the page unless the focus opened the tooltip or is within it, as the page may close its own menus by it. While it is open, the element it is for is described by it.

A touch or a pen, which has no pointer to hover, shows it by a tap, whose click goes no further, as to a link the element is in; and a tap on the element again, or elsewhere, closes it. The annotations that focusing gives take the focus, as by Tab, at the first of their elements that holds any text, showing the tooltip for its first line, which follows the line as the page moves: Tab moves the focus on into the tooltip, if anything there takes it, and on from its last part back to the element, and so on beyond it; Shift and Tab moves from its first part back to the element; and Escape closes it, giving the focus back to the element. Hidden annotations take the focus too, but show nothing.

If trusted, it heeds only what the user does, not events that the page's scripts make.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Hovering

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Hovering.type
object Layout

How an annotated text is laid out to be drawn.

How an annotated text is laid out to be drawn.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Layout.type
object Look

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Look.type
trait Look[-A]

How annotations whose values are of type A look in a page.

How annotations whose values are of type A look in a page.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
final case class Mark[+A](annotation: Int, part: Int, lane: Int, value: A)

A part of an annotation lying over a Segment: the annotation, by its index, the part, by the index of its span, the annotation's lane, and its value.

A part of an annotation lying over a Segment: the annotation, by its index, the part, by the index of its span, the annotation's lane, and its value.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Passage

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Passage.type
final class Passage

A stretch of a page, beneath root: its text nodes, and the elements within it that are not prose, as code, each of which stands in its text as one Passage.placeholder, so that the text on either side of it is not taken as side by side. An element that a decoration put there stands as the text it shows, as a translation, so that a page decorated a piece at a time reads as it is seen, though nothing within it may be annotated again. Each <br>, and each boundary between blocks within it, as paragraphs, stands in its text as a line break. Annotations of the passage are of its text.

A stretch of a page, beneath root: its text nodes, and the elements within it that are not prose, as code, each of which stands in its text as one Passage.placeholder, so that the text on either side of it is not taken as side by side. An element that a decoration put there stands as the text it shows, as a translation, so that a page decorated a piece at a time reads as it is seen, though nothing within it may be annotated again. Each <br>, and each boundary between blocks within it, as paragraphs, stands in its text as a line break. Annotations of the passage are of its text.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Placement

Where a tooltip goes, as the line it is for is placed in the window.

Where a tooltip goes, as the line it is for is placed in the window.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Placement.type
enum Refusal

Why annotations could not be put into a page.

Why annotations could not be put into a page.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Segment[+A](span: TextSpan, marks: List[Mark[A]])

A stretch of an annotated text over all of which the same parts of annotations lie, as marks; or a point, at which the parts that are points stand.

A stretch of an annotated text over all of which the same parts of annotations lie, as marks; or a point, at which the parts that are points stand.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum Side

Where a tooltip stands of what it is for.

Where a tooltip stands of what it is for.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Spacing

Where spaces go as annotations take text away or put it in.

Where spaces go as annotations take text away or put it in.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Spacing.type
object Style

How highlighted text is drawn, as layers of a background, in CSS.

How highlighted text is drawn, as layers of a background, in CSS.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Style.type
final class Tooltip

A tooltip in a page's top layer, where no part of the page can clip or cover it, holding any content in a shadow root, which the page's styles do not reach. It is kept within the window, and content too large for it scrolls within it. It opens on whichever side of the line it fits, keeping room there for it to grow to reserve tall, as when content to come will fill it. Once held, as the mouse that opened it holds it, if it is interactive, it keeps to that side as it grows, scrolling within the room there, rather than moving across the line from beneath the pointer crossing to it; and it covers the smallest convex shape holding both it and the line, though it shows nothing there, but the line itself, which takes the pointer as before, so that the pointer crossing to it, straight or slanting, is over it all the way, and never over what lies beneath, as a highlight on the line beyond or beside the word on its own, which would show a tooltip of its own. Each time it is shown is a Tooltip.Showing of its own, by which its content may be replaced while it lasts, as by an entry that arrives later, and it is placed again as its size changes.

A tooltip in a page's top layer, where no part of the page can clip or cover it, holding any content in a shadow root, which the page's styles do not reach. It is kept within the window, and content too large for it scrolls within it. It opens on whichever side of the line it fits, keeping room there for it to grow to reserve tall, as when content to come will fill it. Once held, as the mouse that opened it holds it, if it is interactive, it keeps to that side as it grows, scrolling within the room there, rather than moving across the line from beneath the pointer crossing to it; and it covers the smallest convex shape holding both it and the line, though it shows nothing there, but the line itself, which takes the pointer as before, so that the pointer crossing to it, straight or slanting, is over it all the way, and never over what lies beneath, as a highlight on the line beyond or beside the word on its own, which would show a tooltip of its own. Each time it is shown is a Tooltip.Showing of its own, by which its content may be replaced while it lasts, as by an entry that arrives later, and it is placed again as its size changes.

Its host is the element in the page, an atf-tooltip, which no rule of the page for its own elements matches, with an id of its own, by which what it is for is described, and the role of a dialog if it is interactive, or else of a tooltip. It takes the attribute data-side, above or below, as it stands of the line it is for. It goes at the root of the page, or in the modal dialog open, outside which all is inert.

Its content inherits nothing from the page, so its styles must set its font, its colours and its background.

The pointer's presses, clicks and moves within it, and keys typed in it, if it is interactive, go no further than it, so that the page does not act on them, and a press leaves the focus where it was, but in a field, so that its text cannot be selected by the pointer. The page's own listeners on its window or its document that capture events still hear of them first, as nothing within the page can stop them.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Tooltip

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Tooltip.type

Types

opaque type Colour

A colour in which annotations are highlighted: one of the forms of a colour in CSS, and nothing more, as it goes into styles, where anything else, such as a url(...), could make every viewer's browser fetch it, and a colour the browser does not know would drop the whole background it is a layer of.

A colour in which annotations are highlighted: one of the forms of a colour in CSS, and nothing more, as it goes into styles, where anything else, such as a url(...), could make every viewer's browser fetch it, and a colour the browser does not know would drop the whole background it is a layer of.

Attributes