Richtext

From PhiWiki
Jump to: navigation, search


Name richtext Richtext.png
WID: 41
Type: Display
Available since: v1.0.0
Brief description: Rich text item. More...
Basic functions
Positioning Animation Transformation Display
.x() .fadeIn() .rotateX() .cursor()
.y() .fadeOut() .rotateY() .disabled()
.left() .rotate() .rotateZ() .opacity()
.top() .moveBy() .rotateToX() .hide()
.width() .moveTo() .rotateToY() .show()
.height() .rotateIn() .rotateToZ() .visible()
.pos() .rotateOut() .scale() .toggle()
.zIndex() .slide() .scaleTo() .title()
.tabIndex() .stop() .$() .wid()
Basic event handler
Button Mouse Key Misc Custom
.click() .mouseover() .keydown() .focus() .on()
.dblclick() .mouseout() .keyup() .blur() .off()
.mousedown() .mousemove() .keypress() .drop() .one()
.mouseup() .trigger()
Additional functions / handlers
Function Brief description
.html() Content text (HTML subset)
.color() Default filling color
.bgColor() Default background color

Detailed description

Creates a rich text item using a HTML subset.

Note: The .color() and .bgColor() define the default text and background color. You still can change text colors using styles.

See also: Graphicrichtext, Label, Graphictext.

Additional functions

.html() .color() .bgColor()

.html()


Synopsis

.html([s])
Returns (read): String
Environment: ServerScriptOk.png JavaScriptOk.png
Available since: v2.0.0 v2.0.0
Brief description: Changes the text.
Attribute Type Default Note
s String Item (rich) text.

Overview

Description

Use rich text for this item. Phi supports a subset of the HTML standard.

Read: returns the current used html text for this item.

Write: sets the current text to s.

Note:

See also: Rich text reference.

Example

var t=$('id').html(); // read
$('id').html('<b>bold tags have an effect.</b>'); // write

.color()


Synopsis

.color(['col'])
Returns (read): 'rgba(r, g, b, a)'
Environment: ServerScriptOk.png JavaScriptOk.png
Available since: v2.0.0 v2.0.0
Brief description: Text or foreground color change.
Attribute Type Default Note
col String Possible values are: color name, #RRGGBB, rgb(r,g,b), rgba(r,g,b,a)

Overview

Description

Allowed values for r, g, b are 0-255 and for a 0-1.0 (0 is fully transparent and 1. is opaque).

Read: returns the current text or foreground color as 'rgba( r, g, b, a)' string.

Write: changes the text or foreground color to col.

Note: some older browser versions do not support rgba() - in this case the alpha component will be ignored.

See also: .bgColor().

Example

var c=$('id').color(); // read
$('id').color('red'); // write
$('id').color('#12BAF1'); // write
$('id').color('rgb(12,177,255)'); // write
$('id').color('rgba(12,177,255,0.5)'); // write

.bgColor()


Synopsis

.bgColor(['col'])
Returns (read): 'rgba(r, g, b, a)'
Environment: ServerScriptOk.png JavaScriptOk.png
Available since: v2.0.0 v2.0.0
Brief description: Background color change.
Attribute Type Default Note
col String Possible values are: color name, #RRGGBB, rgb(r,g,b), rgba(r,g,b,a)

Overview

Description

Read: returns the current background color.

Write: changes the background color to col.

Note: Some older browser versions do not support rgba() - in this case the alpha component will be ignored. Some browser will render input items differently if a background color is set.

See also: .color().

Example

var c=$('id').bgColor(); // read
$('id').bgColor('red'); // write
$('id').bgColor('#12BAF1'); // write
$('id').bgColor('rgb(12,177,255)'); // write
$('id').bgColor('rgba(12,177,255,0.5)'); // write