Image Molecule

Add an image.

Summary
Image Molecule
Preference Dialog
Properties
typestring, ( r )
pref.namestring, ( r )
pref.enableWhenstring, ( r, w )
pref.disableWhenstring, ( r, w )
pref.urlstring, ( r, w )
pref.imgWidthstring, ( r, w )
pref.imgHeightstring, ( r, w )
pref.borderstring, ( r, w )
pref.marginstring, ( r, w )
pref.paddingstring, ( r, w )
pref.floatstring, ( r, w )
pref.clearstring, ( r, w )
pref.flowstring, ( r, w )
Functions
attach
detach
delete
rename
show
hide
refresh
clone
serialize

Preference Dialog

Properties

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 function 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 a valid http URL or a private vault URL that begins with //.

pref.imgWidth

string, ( r, w )

Specifies the image width.

autoDefault.  The molecule calculates the actual width.
%Defines the width in % of the droplet’s width.
lengthDefines the width in px, cm, etc.

pref.imgHeight

string, ( r, w )

Specifies the image height.

autoDefault.  The molecule calculates the actual height.
%Defines the height in % of the droplet’s height.
lengthDefines the height in px, cm, etc.

pref.border

string, ( r, w )

Specifies the image border style.

Possible formats,

  • none
  • <border-width> <border-style> <border-color>
  • <top-border-width> <right-border-width> <bottom-border-width> <left-border-width>
  • <top-bottom-border-width> <left-right-border-width>
  • <border-width>
border-widththin, medium, thick, ~length~ (in pixel value).
border-colorrgb(255, 0, 0) or #ff0000.
border-stylenone, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset.

pref.margin

string, ( r, w )

Specifies the image margin.

Possible formats,

  • none
  • <margin-top> <margin-right> <margin-bottom> <margin-left>
  • <margins>

pref.padding

string, ( r, w )

Specifies the image padding.

Possible formats,

  • none
  • <padding-top> <padding-right> <padding-bottom> <padding-left>
  • <paddings>

pref.float

string, ( r, w )

Specifies how the image appears in the droplet.

leftThe image floats to the left of the droplet.
rightThe image floats to the right of the droplet.
noneDefault.  The image is 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.

leftNo floating elements allowed on the left side.
rightNo floating elements allowed on the right side.
bothNo floating elements allowed on either the left or the right side.
noneDefault.  Allows floating elements on both sides.

pref.flow

string, ( r, w )

Specifies the style of the image flow within the droplet.

inlineTakes up only as much width as the image needs, and does not force new lines.
blockTakes up the full width available, with a new line before and after.

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

rename

rename(name);

Rename this molecule.

Parameters

name(string) a new name.

Returns

N/A

show

show();

Shows the effects of this molecule.

Parameters

N/A

Returns

N/A

hide

hide();

Hides the effects of this molecule.

Parameters

N/A

Returns

N/A

refresh

refresh();

Forces molecule to redraw with the current set of preferences.

Parameters

N/A

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

Close