-
Notifications
You must be signed in to change notification settings - Fork 4
V.4. Classes
Note: Classes, that are used internally, are not described here.
Represents a popup message.

Constructor. text is either some text, raw HTML, or a DOM node, depending on the options.type value (by default it is treated as text). Possible options:
-
timeoutTimeout (in milliseconds) after which the popup will be hidden. Default:5000(5 seconds). -
typeType of thetextparameter. Possible values:html,node,critical,warning, or any other string. If the type iscriticalorwarning, thetextparameter is treated as text, but additional CSS class names are added to the popup. -
classNamesAstringcontaining additional CSS class names to be set for the popup. Does not override the default class names.
Shows the popup in the top right corner (CSS position is static). The hide timer is started.
Hides the popup even if the hide timer has not fired yet.
Resets the timeout (the hide timer is restarted).
Resets the popup content. The hide timer is not affected.
Note: It is recommended to use the lord.showPopup(text[, options]) function to show popups. This method creates the popup, calls it's show() method and returns the object.
Example:
var popup = lord.showPopup("<font color='red'>ALARMA!!!</font>", { type: "html", timeout: 10 * lord.Second });
setTimeout(function() {
popup.resetText("<font color='green'>False alert.</font>", { type: "html" });
}, 5 * lord.Second);
Warning: The API of this class has to be changed, because it is very "dirty". Planned for ololord.js v1.1.0.
Represents a movable overlay player. The player may show both static images (.jpg, .png, etc.) and audio/video content (using HTML audio and video elements).

Constructor. fileInfo must be an object, containing the following fields:
-
hrefThe URL of the content to be shown. -
mimeTpeMIME-type of the content (image/*,audio/*andvideo/*are supported). -
widthWidth of the content. Anumber. -
heightHeight of the content. Anumber.
Possible options:
-
imageZoomSensitivityZoom sensitivity (in percents). The value must be between1and100. The default is25. -
minimumContentWidthMinimum allowed content width (to prevent downscaling too much). -
minimumContentHeightMinimum allowed content height (to prevent downscaling too much). -
loopIf casts tobooleantrue, and the content is either audio or video, it will be played in a loop. -
playIf casts to anumbergreater than0, and the content is either audio or video, it will be played immediately after theplaymilliseconds have passed.
Installs an event handler handler for vents of type eventType. A handler is passed an object containing the following fields:
-
typeThe event type. Matches theeventTypethe handler was installed for. -
actionThe function that will be called if the event is not cancelled. -
cancelThe function that may be used inside thehandlerto cancel the event.
The available event types are:
-
requestCloseThe event that is triggered if a user clicks on the player content (not on it's controls). The event'sactionisthis.hide().
Appends the player to the page's DOM, making it visbile.
Removes the player from the page's DOM. If the content is either an audio or a video, it is paused.
Resets the size of the player and, if the content is either an audio or a video, it's currentTime. Implicitly called once the object is constructed.
Shows the popup, containing the player's size and scale (in percents) in the top right corner of the page for 1 second.