Class: Text

WIND. Text

Creates an object of the Text class to be displayed on the web page.

new Text(iddiv, options)

Creates an object of the Text class.
Parameters:
Name Type Description
iddiv string The ID of the Text object.
options JSON string in JSON format to set options for the Text objet.
Text options:
Name Type Description
top integer Adjust the distance in px between the top border of the Text and the top border of its containing element.( 10px by default ).
left integer Adjust the distance in px between the left border of the Text and the left border of its containing element.( 10px by default ).
height integer Define the height in px of the Text( 400px by default ).
width integer Define the width in px of the Text( 600px by default ).
color string Define the color of the header if it exists( #3366CC by default ).
border string Define the color, the thickness and the type of the border. By default "#3366CC 2px solid". See more here CSS Border.
name string Define the Text's name( "Text Displayer" by default ).
icon string Define the Text's icon in the form of an URL.
draggable boolean If true, enables the Text to be dragged on its containing element. Dragging is disabled by default.
resizable boolean If false, prevents the Text from being resized. Resizing is disabled by default.
header boolean Says whether the header is enabled or not. The header is disabled by default. If the options draggable, removable, configurable or boxStyle is true then header will be set to true. Else header may be true or false.
removable boolean If false, prevents the Text from being removed. Removing is disabled by default.
configurable boolean If true, enables to configure the Text from a menu. This options is exclusively used in WINDMash. Configurable is disabled by default.
boxStyle boolean If true, enables to configure the Text from a menu. boxStyle is disabled by default.
parentEl string The ID of the parent element of the Text. By default the parent element is the HTML body element ("document.body" object).
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});

Classes

MagicButton
Paragraph
Part

Methods

<static> tokenizer(content) → {string[]}

Allows cutting contetns in an array of tokens.
Parameters:
Name Type Description
content string The contents that we want to cut.
Returns:
returns Array of string tokens.
Type
string[]
Example
var tab = WIND.Text.tokenizer("Je vais de Bayonne à Pau.");

addAnnotation(annotation)

Adds an annotation objet to the text.
Parameters:
Name Type Description
annotation Annotation Annotation objet to add.
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
t.addAnnotation(annotation);

addTool(outil)

Add a tool to text object.
Parameters:
Name Type Description
outil WIND.Text.MagicButton The tool object we will add.
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
var button = new WIND.Text.MagicButton("Lieux", "Choisir des lieux dans le texte", "bottom", "place", "red");
t.addTool(button);

addToolBar()

Add a toolbar of text editing tools.
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
t.addToolBar();

createAnnotation(type, entity, paragraph, idtokendebut, idtokenfin, options) → {Annotation}

Creates ana Annotaion objet on the text.
Parameters:
Name Type Argument Description
type string Represents the type of the Annotation objet to add. Its value can be anything.
entity string Name of the annotated entity.
paragraph integer The index of the paragraph we want to add an annotation.
idtokendebut integer The index of the first token of the annotation.
idtokenfin integer The index of the last token of the annotation.
options JSON <optional>
Options for the Annotation object. It contains the style of the annotationand and may contain: 'color', 'background-color', 'font-weight', 'font-style', 'font-size', 'text-decoration', 'cursor', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left' and 'padding'.
Returns:
returns Annotation object.
Type
Annotation
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
t.createAnnotation("ville", "Mauléon-Licharre", 1, 4, 4,{"style":"color:red,font-size:20"});

createParagraph(options) → {WIND.Text.Paragraph}

Creates a paragraph object and add it to the text.
Parameters:
Name Type Argument Description
options string <optional>
The options of the paragraph nad it contains: "display".
Returns:
returns WIND.Text.Paragraph object.
Type
WIND.Text.Paragraph
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
var p = t.createParagraph("display:true");

destroy()

Destroys the text and remove it from the page.
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
t.destroy();

removeToolBar()

Remove the toolbar from the text.
Example
var t = new WIND.Text('text', {'name':'LIUPPA','header':true,'color':'crimson','border':'coral 8px inset','width':800,'height':200,'left':100,'top':100});
t.addToolBar();
t.removeToolBar();