Image Molecule

From oWiki

Jump to: navigation, search

Contents


Preference Dialog

File:Image_pref.png

Attributes

type

string  ( r )
Type of this molecule, 'image'.

pref.name

string  ( r )
The scriptable name for this molecule. This name can be set using rename method dynamically.

pref.enableWhen

string  ( r, w )
Specifies the event that activates this molecule. Default is 'load'.

pref.disableWhen

string  ( r, w )
Specifies the event that deactivates this molecule. Default is 'none'.

pref.url

string  ( r, w )
Specifies the URL of this image. This can be an absolute or relative path, under 'http(s)' or 'ccrx' protocol.

pref.imgWidth

string  ( r, w )
Specifies the image width.

Value Description
auto Default. The molecule calculates the actual width
% Defines the width in % of the droplet's width
length Defines the width in px, cm, etc. 

pref.imgHeight

string  ( r, w )
Specifies the image height.

Value Description
auto Default. The modifier calculates the actual height
% Defines the width in % of the container's height
length Defines the height in px, cm, etc. 

pref.border

string  ( r, w )
Specifies the image border style.

Possible formats:
(1) none
(2) <border-width> <border-style> <border-color>
(3) <top-border-width> <right-border-width> <bottom-border-width> <left-border-width>
(4) <top-bottom-border-width> <left-right-border-width>
(5) <border-width>

border-width thin
medium
thick
length (pixel value)
border-color rgb(255, 0, 0)
#ff0000
border-style none
hidden
dotted
dashed
solid
double
groove
ridge
inset
outset

pref.margin

string  ( r, w )
Specifies the image margin.

Possible formats (in pixels)
(1) none
(2) <margin-top> <margin-right> <margin-bottom> <margin-left>
(3) <margins>

pref.padding

string  ( r, w )
Specifies the size of image padding.

Possible formats (in pixels)
(1) none
(2) <padding-top> <padding-right> <padding-bottom> <padding-left>
(3) <paddings>

pref.float

string  ( r, w )
Specifies where the image will appear in the droplet.

Value Description
left The image moves to the left in the droplet
right The image moves to the right in the droplet
none Default. The image will be displayed just where it occurs in the text 

pref.clear

string  ( r, w )
Specifies the sides of the image where other floating elements are not allowed.

Value Description
left No floating elements allowed on the left side
right No floating elements allowed on the right side
both No floating elements allowed on either the left or the right side
none Default. Allows floating elements on both sides

pref.flow

string  ( r, w )
Specifies the style of the image flow within the droplet.

Value Description
in-line Takes up only as much width as the image needs, and does not force new lines.
block Takes up the full width available, with a new line before and after.


Methods

rename(n)

n: string

Rename this molecule.

show()

show the effects of this molecule.

hide()

hide the effects of this molecule.

refresh()

Force molecule to redraw with the current set of attributes.

clone()

Return: a molecule

Create a clone of this molecule.

attach(droplet)

droplet: a droplet object (e.g. app.box.droplet)

Attach this molecule to a droplet.

detach()

Remove this molecule from its droplet.

deleteMod()

Delete this molecule.

serialize()

Return: string

Serialize this molecule into its JSON representation.
Personal tools