IFrame Molecule

Add an iframe.

Summary
IFrame Molecule
Preference Dialog
Properties
typestring, ( r )
pref.namestring, ( r )
pref.enableWhenstring, ( r, w )
pref.disableWhenstring, ( r, w )
pref.urlstring, ( r, w )
pref.widthstring, ( r, w )
pref.heightstring, ( r, w )
pref.borderstring, ( r, w )
pref.marginstring, ( r, w )
pref.paddingstring, ( r, w )
pref.overflowstring, ( r, w )
pref.floatstring, ( r, w )
pref.clearstring, ( r, w )
pref.sandboxstring, ( r, w )
pref.ignoreEventsbool, ( r, w )
contentWindowobject, ( r )
contentDocumentobject, ( r )
historyobject, ( r )
srcstring, ( r, w )
Functions
attach
detach
delete
rename
show
hide
refresh
clone
serialize
dispatchEventWithData
loadEngine
loadDroplet
loadFormation
clear

Preference Dialog

Properties

type

string, ( r )

Type of this molecule, iframe.

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 of source document of this iframe.  This can be a valid http URL or a private vault URL that begins with //.

pref.width

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.height

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.overflow

string, ( r, w )

Specifies the style of the scrollbars when content overflows the iframe.

autoDefault.  If content is clipped, a scroll-bar should be added to see the rest of the content.
visibleThe overflow is not clipped.  It renders outside the element’s box.
hiddenThe overflow is clipped, and the rest of the content will be invisible.
scrollThe overflow is clipped, but a scroll-bar is added to see the rest of the content.

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.sandbox

string, ( r, w )

Specifies the embeded iframe content policy.  The value can either be an empty string (all the restrictions is applied), or a space-separated list of pre-defined values that will REMOVE particular restrictions.

allow-same-originallows the document to maintain its origin; pages loaded from https://example.com/ will retain access to that origin’s data.
allow-top-navigationallows the document to break out of the frame by navigating the top-level window.
allow-formsallows form submission.
allow-scriptsallows JavaScript execution.

pref.ignoreEvents

bool, ( r, w )

Forces iframe to ignore mouse events.

contentWindow

object, ( r )

Returns the iframe’s contentWindow object.

contentDocument

object, ( r )

Returns the iframe’s contentDocument object.

history

object, ( r )

Returns the iframe’s contentWindow.history object.

src

string, ( r, w )

Gets/Sets the iframe’s URL.

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.

dispatchEventWithData

dispatchEventWithData(event_name, obj_name, obj);

Dispatches a custom DOM event with the given event name and a data object with the given name to iframe’s document.  The receiver of the event can use params[obj_name] to access passed data in a script molecule.

Parameters

event_name(string) event name.
obj_name(string) data object name.
obj(object) data object.

Returns

N/A

loadEngine

loadEngine();

Loads oTakhi CloudFormation Engine into the iframe.

Parameters

N/A

Returns

N/A

loadDroplet

loadDroplet(json, x, y, b);

Loads a droplet in its serialized JSON format into iframe’s document at location (x, y) and set its hideonload attribute to b.

Parameters

json(string) json representation of a droplet.
x(int) x-coordinate of the document.
y(int) y-coordinate of the document.
b(bool) specifies if droplet is hidden on load.

Returns

N/A

loadFormation

loadFormation(json, b);

Loads a formation (multiple droplets) in its serialized JSON format into iframe’s document and set all of its droplets’ hideonload attribute as b.

Parameters

json(string) json representation of a formation.
b(bool) specifies if droplets are hidden on load.

Returns

N/A

clear

clear();

Removes all droplets and formations previously loaded into the iframe.

Parameters

N/A

Returns

N/A

Close