IFrame Molecule
From oWiki
Preference Dialog
Attributes
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 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 the source document of this iframe. This can be an absolute or relative path, under 'http(s)' or 'ccrx' protocol.
pref.imgWidth
string ( r, w )
Specifies the iframe 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 iframe 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.overflow
string ( r, w )
Specifies the style of the scrollbars when content overflows the iframe.
pref.border
string ( r, w )
Specifies the iframe 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 iframe 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 iframe 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 iframe 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 iframe 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 iframe 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. |
pref.ignoreEvents
bool ( r, w )
Tells iframe to ignore mouse events.
contentDocument
object ( r )
Returns the iframe's contentDocument object.
html
string ( r )
Returns the HTML loaded into the iframe.
directory
string ( r )
Returns the base URL of the document loaded inside the iframe.
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. |
canGoForward()
Return: bool
| Can iframe navigate forward. |
canGoBack()
Return: bool
| Can iframe navigate backward. |
goForward()
| Navigate forward. |
goBack()
| Navigate backward. |
getURL()
Return: string
| Returns the current URL of the iframe. |
setURL( url )
url: string
| Set the current iframe src attribute. |
loadHTML( html )
html: string
| Load the given raw html text into iframe. |
loadEngine()
| Loads oTakhi runtime engine into this iframe. |
loadDroplet(data, x, y, b)
data: string, serialized JSON representation of a droplet.
x: int (optional), x coordinate of the droplet's origin.
y: int (optional), y coordinate of the droplet's origin.
b: bool (optional), control the droplet's hideonload attribute.
| Loads a droplet into this iframe. The oTakhi's runtime engine must be preloaded for this to work. |
loadFormation(data, b)
data: string, serialized JSON representation of a formation.
b: bool (optional), control the droplets' hideonload attribute.
| Loads a formation (multiple droplets) into this iframe. The oTakhi's runtime engine must be preloaded for this to work. |
clearFormation()
| Clears all objects from the oTakhi runtime engine loaded inside this iframe. |
dispatchEventWithData( n, dn, d )
n: string, event name
dn: string, data name
d: object, data object
| Dispatch a custom DOM event with the given event name and a data object with the given name and value into this iframe. |

