KilaueaThe Global Kilauea Object Summary | The Global Kilauea Object | | | | An object with properties major, minor, revision, and status. | | | | An array of URLs for all loaded script files. | | The base URL of Kilauea’s script directory. | | An object that contains all plugin classes. | | Information about the status of all plugin classes. | | An object that contains the URLs from which the respective plugins (identified by their URI in the object keys) has been retrieved. | | An object of registered key events with key codes as object keys and Kilauea.Events as values. | | The info structure that is used in <Kilauea.Instance.help> and its dependents. | | A browser detection utility object. | | This object stores and manages everything related to localization. | | | | Initializes the global Kilauea object. | | | | | | Registers a keystroke mapping. | | Handles document.keydown events. | | | | | | Keeps all the language packages fetched so far. | | | | | | Updates all Kilauea.localization.parts, or only the parts with a given language / in a given instance -- depending on the (optional) parameter. | | | | Initializes <Kilauea.lang>. | | | | | | | | Takes a plugin ID token or an URI+URL and returns an ID object | | | | | | Returns true if the given element has a certain class attributed to it. | | Adds a class to a given element. | | Removes a class from a given element. | | Returns an element’s computed style for a given CSS property. | | Returns all child elements that exhibit a given class. | | | | Yields browser-independent information about the current window’s dimensions. | | | | Converts a value to integer, if possible. | | Converts a value to float, if possible. | | | | Compares to URIs without fragment identifiers. | | Retrieves an URL without fragment identifiers, URL parameters etc. | | Reloads the HTML page, thereby restarting all presentations. | | | | Adds a DOM event handler in a fairly browser-independent way. | | Removes a DOM event handler. | | | | | | | | A cross-browser utility method which returns a XMLHttpRequest object. | | | | | | | | Loads a script at runtime. | | Includes a script during page load. | | Includes a CSS file during page load. | | | | Handles the picking up in a drag’n’drop action. | | Performs the drop of a drag’n’drop. | | Updates the element’s position while dragging. | | | | Determines whether a string is an URI. | | Returns a plain-text version of a possibly HTML-formatted string. | | A Class for Kilauea Events | | | | The function to be used as callback | | The object to be used as this pointer when calling fn. | | | | | | A Utility Class for Panels | | | | A reference to the DOM element. | | The current status of the panel’s visibility. | | | | Sets the visibility of the panel. | | | | | | | | Temporarily hides the panel. | | | | | | | | The absolute x-coordinate of the canvas, in pixels. | | The absolute y-coordinate of the canvas, in pixels. | | The total width of the canvas, in pixels. | | The total height of the canvas, in pixels. | | | | Updates the canvas’ position and dimensions. | | | | | | A pointer to the slide’s DOM element, usually a div.slide. | | | | | | | | A fragment identifier for this slide (if present), or a self-assigned pseudo-identifier. | | A plain text slide title. | | | | An array which contains objects for each incremental part of the slide. | | | | | | | | Unveils incrementals up to a given position. | | Sets the slide’s visibility. | | | | | | | | A pointer to the backgounnd’s DOM element. | | | | | | Sets the backgound’s visibility. | | The x-coordinate of the computed position, in pixels. | | The y-coordinate of the computed position, in pixels. | | Adapts the scroll position to given coordinates. | | Resets the background’s position to the top left corner of the canvas. | | | | | | | | Adds a hyperlink to a given submenu. | | The Kilauea Instance Class | | | | | | true, if the presentation instance occupies the whole window. | | true, if the presentation is in embedded mode. | | A pointer to the top-level DOM element that contains all slides. | | | | Kilauea events that are fired on appropriate occasions. | | | | The array which contains all slides. | | The object which contains all backgrounds. | | The presentation’s title. | | An array where part and subpart information for each presentation is stored. | | | | | | Shows a given slide with the correct incrementals and notes unveiled. | | | | | | | | | | | | | | | | | | Adds a hyperlink to the instance’s toolbar menu. | | Replaces a hyperlink in the instance’s toolbar menu by another. | | | | | | Adds a hyperlink to a given submenu. | | Replaces a hyperlink in the instance’s toolbar menu by another. | | | | | | | | |
versionAn object with properties major, minor, revision, and status. A typical use case is alert('Current version: ' + Kilauea.version.major + '.' + Kilauea.version.minor)
scriptsAn array of URLs for all loaded script files.
pluginsAn object that contains all plugin classes. Plugin URIs are used as object keys. Note that while the plugin classes are stored in Kilauea.plugins, the actual plugin instances are stored in Kilauea.Instance.plugins.
pluginStatusInformation about the status of all plugin classes. Object keys are the plugin URIs; the value is one of (loading, ok, error, incompatible)
pluginLocationsAn object that contains the URLs from which the respective plugins (identified by their URI in the object keys) has been retrieved.
keysAn object of registered key events with key codes as object keys and Kilauea.Events as values.
keyInfoThe info structure that is used in <Kilauea.Instance.help> and its dependents. As for Kilauea.keys, the object keys are the respective key codes. The values are objects with properties key - a readable string representation of the key. For instance, “A” for key code 65 help - the help text
browserA browser detection utility object. (Written a la mootools’ browser detection -- not as elegantly, though.) Propertiesxpath | whether document.evaluate is supported, and thus evaluation of xpath expressions | ie | true, if the browser is an internet explorer | ie6 | true, if the internet explorer has version 6 | ie7 | true, if the internet explorer has version 7 | webkit | true, if the browser is a descendant from the webkit / KHTML family; e.g., Safari, Shiira, or Konqueror | webkit419 | true, if the webkit has version < 419. E.g., this is true for Safari 2 | webkit420 | true, if the webkit has version > 420. from this version on, webkit yields xpath support. E.g., this is true for Safari 3 | gecko | true, if the browser uses the gecko rendering engine. true for mozilla and most notably Firefox | opera | an alias of Opera’s nice window.opera |
localizationThis object stores and manages everything related to localization. It is a global object with only one instance per document, which is shared by all Kilauea.Instances. PropertiesMethods
initInitializes the global Kilauea object. Kilauea.init() must be called before the page fires the load DOM event, and after kilauea.js has been included. I.e., <script type="text/javascript" src="js/kilauea.js"></script> <script type="text/javascript"> Kilauea.init(); </script>
Kilauea.init registers an document.onload DOM handler, which then calls Kilauea.create. The parameters passed (if any) are stored in a temporary property Kilauea.params, which gets deleted once Kilauea.create is done. Parametersa | a parameter object with 0..inf entries of the following form: |
<ID>: { keyBind: <boolean:true>, onReady: <fn>, title: <string>, titleSeparator: <string:"::"> externalTransition: <boolean:false>, forceEmbeddedMode: <boolean:false>, menu: {}, settings: { clickAdvance: <boolean:true>, showNotes: <boolean:false>, useRealAnchors: <boolean:true>, adaptiveTitle: <boolean:true>, useShortTitles: <boolean:true>, stackBackgrounds: <boolean:false>, clickAreas: <boolean:true>, showToolbar: <boolean:false>, coupleFooter: <boolean:false> }, indicators: { notes: <class Indicator>, incremental: <class Indicator>} }
Parameter object propertiesID | must be either a valid id of an element document in this document or “’#body’” (in the latter case, the ID must appear in quotation marks, as it is not a valid javascript object identifier (which, btw, is a good thing, because it’s not a legal xs:NCName either, thus avoiding collisions.)) | keyBind | specifies which instance will get the keyboard events. if multiple instances are being set up, and multiple instances claim to get the keyboard events, the first instance to do so wins. (right now, I can’t see a sensible use case for multiple receivers.) | useRealAnchors | if set to true, existing anchors (i.e., fragment identifiers) are used. otherwise, parenthesized slide numbers are used (as in slidy). | indicators | have to implement the Indicator class, which is fairly simple: 1) the constructor takes one argument: a pointer to the corresponding html element, and 2) the class has to implement two argument-less methods on() and off() with the respective obvious meanings. | title | the presentation’s title. if no title is specified, the document’s title tag is chosen instead, or the title of the first presentation slide. | titleSeparator | the separator used to join parts of the title. By default, titles are concatenated through a double colon (“::”). | forceEmbeddedMode | if set, even full-window presentations are treated as embedded presentations. | onReady | a function to be evaluated as soon as the instance is ready | externalTransition | if set, Kilauea.Instance.showSlide does not hide / show the slides itself. this is useful if a plugin (e.g., <transition>) which listens to slideCHhange events takes care of hiding / showing slides. | menu | a list of menu items that shall appear in the toolbar. By default, {‘help’: {}, ‘contents’: {}, ‘restart’: {}} are displayed. | settings | a setting obect of the following form |
{ clickAdvance: <boolean:true>, showNotes: <boolean:false>, useRealAnchors: <boolean:true>, adaptiveTitle: <boolean:true>, useShortTitles: <boolean:true>, stackBackgrounds: <boolean:false>, clickAreas: <boolean:true>, showToolbar: <boolean:false>, coupleFooter: <boolean:false> }
useShortTitles | indicates that short forms of part titles should be used where present. |
registerKeyregisterKey: function( | key, | | fun, | | thisObj, | | sym, | | help | ) |
|
Registers a keystroke mapping. Accepts parameters key, fun, [thisObj, [sym, help]] Parameterskey | a key (accepts both keyCode values and ASCII chars. for non-alphabetic chars, key codes are recommended.) | fun | a function which accepts one argument ‘inst’, denoting the keybound instance | thisObj | an object to be used as this pointer | sym | the keyboard symbol | help | an explaining help text |
setupLocalizationsetupLocalization: function() |
Initializes localization.
localization. langsKeeps all the language packages fetched so far. ISO language codes are used as object keys; the object entries are pairs of an english string and its respective translation, e.g. Kilauea.localization.langs = { 'de': { "help": "Hilfe", "Remote Panel": "Fernsitzungssteuerungsanzeige" }, 'pl': { "help": "Pomoc" } };
localization. parts.addAdds a part to localization.parts. Parametersinst | The ID of the Kilauea.Instance to which the inserted node belongs | node | A node with localized content. Either an element or an attribute node. in the latter case, make sure to retrieve the node through *.getAttributeNode (and not *.getAttribute, which returns the nodeValue). | lang | An ISO language code. |
localization. parts. updateUpdates all Kilauea.localization.parts, or only the parts with a given language / in a given instance -- depending on the (optional) parameter. ParametersThere are two principal use cases for this method- a language pack has been added / updated, and all parts using this language have to be updated
- an instanced changed its <Kilauea.Instance.lang>, and all parts belonging to this instance have to be updated
Therefore, we do a little polymorphic magic (knowing that instance IDs are integers and language codes don’t.) Furthermore, a call to this method without an argument issues updates of all parts in all instances
localization.addAdds a new language package to Kilauea.localization. The language information is then stored in Kilauea.localization.langs. See the sample code and documentation in Kilauea.localization.langs. Parameterslang | The ISO language code | obj | The object which contains pairs of english strings and respective translations |
Note that if two language packages translate the same english string, only one translation will be kept in Kilauea.localization.langs. The language package which has been included after all others wins.
localization. localizeInitializes <Kilauea.lang>. Looks for possible language attributes on the document’s element. Respects both @lang and @xml:lang.
localization. fetchFetches a language package for Kilauea and all Kilauea.plugins.
loadPluginsLoads all plugins. Parametersa | the same parameter object as for <Kilaeua.create> |
The method also fills Kilauea.pluginLocations and it loads the respective CSS file for each plugin.
resolvePluginIDresolvePluginID: function( | id | ) |
|
Takes a plugin ID token or an URI+URL and returns an ID object Parametersid | either an ID token or a full-fledged URI + URL, separated by whitespace |
ReturnsAn object with properties id | the id -- either the ID token or the plugin URI | url | the location of the directory from which the plugin is to be retrieved (the trailing slash is included) | name | the name of the plugin’s js file, without the extension. |
Two examples for input and returned object (assuming that kilauea.js resides in a directory with relative path js/ Kilauea.resolvePluginID("bigtimes") => { id: 'bigtimes', url: 'js/plugins/bigtimes/', name: 'bigtimes'}
Kilauea.resolvePluginID("http://sharpeleven.net/kilauea/bigtimes \\ http://myserver/somedirectory/bigtimes.js"); => { id: 'http://sharpeleven.net/kilauea/bigtimes', url: 'http://myserver/somedirectory/', name: 'bigtimes' }
addPluginaddPlugin: function( | uri, | | id, | | pl, | | requireVersion | ) |
|
Registers a plugin. Parametersuri | the plugin URI | id | the plugin’s ID token | pl | the plugin class itself | requireVersion | an optional version object which determines a minimal Kilauea.version that the plugin needs in order to work properly. The object must have the following properties |
{major: <int>, minor: <int>}
The method inserts the plugin class into Kilauea.plugins, and makes the plugin usable for Kilauea.Instances to be instantiated and inserted into Kilauea.Instance.plugins. Besides inserting the plugin class, this method also replaces all those object keys in Kilauea.pluginLocations, which up to now have only been an ID token, by the plugin’s full URI.
hasClassReturns true if the given element has a certain class attributed to it. Parameterse | a DOM element | c | a class name |
Returnstrue, if the element has the class assigned to it, false otherwise.
addClassAdds a class to a given element. Parameterse | a DOM element | c | a class name |
removeClassremoveClass: function( | e, | | c | ) |
|
Removes a class from a given element. Parameterse | a DOM element | c | a class name |
getStylegetStyle: function( | obj, | | css | ) |
|
Returns an element’s computed style for a given CSS property. Parametersobj | a DOM element node | css | a CSS property (W3C style; i.e. border-left-color) |
ReturnsThe computed style, if possible, and null otherwise. The method tries really hard to get the computed value of the desired style property. It is easily possible that it fails nevertheless, due to the quite disparate approaches to, and support of, computed styles across different browsers. Furthermore, the results may be inconsistent across differen browser families. For example, gecko translates a “border-width: thin” into a pixel value, which is parseable as integer, while IE returns the declared value “thin”. You might want to postprocess the return value of Kilauea.getStyle using Kilauea.toInteger.
getByClassgetByClass: function( | parent, | | c | ) |
|
Returns all child elements that exhibit a given class. Parametersparent | the parent DOM element containind the child nodes to search among | c | a class name |
ReturnsAn array of zero or more elements. Note that although this method sounds like the family of DOM methods such as *.getElementByID, the syntax of Kilauea.getByClass is different: This method cannot be applied as a method of the DOM element, the DOM element has rather to be passed as an argument. The reason is that Kilauea does not alter or extend any DOM nodes.
windowDimensionswindowDimensions: function() |
Yields browser-independent information about the current window’s dimensions. ReturnsAn object with properties: width | the window’s width, or null | height | the window’s height, or null |
toIntegertoInteger: function( | i, | | def, | | ref | ) |
|
Converts a value to integer, if possible. Kilauea.toInteger is more powerful than javascript’s parseInt() in that it accepts two additional parameters. Parametersi | The value to convert | def | A default value that should be returned if the conversion of i fails | ref | A reference value against which percentual values are computed |
Returns- If i is castable with parseInt (e.g., 14px), then parseInt(i)
- If i is a percent value (e.g., 30%), then parseInt(i) * ref / 100
- The default value def otherwise, or null, if no default is specified
toIntegerConverts a value to float, if possible. Similar to Kilauea.toInteger, but works for floating point numbers. Parametersi | The value to convert | def | A default value that should be returned if the conversion of i fails | ref | A reference value against which percentual values are computed |
Returns- If i is castable with parseFloat (e.g., 0.7ex), then parseInt(i)
- If i is a percent value (e.g., 49%), then parseInt(i) * ref / 100
- The default value def otherwise, or null, if no default is specified
compareAddresscompareAddress: function( | l1, | | l2 | ) |
|
Compares to URIs without fragment identifiers. It also normalizes file:/// to file:/ and thus avoids browser-dependent confusion (e.g., in Opera). Parametersl1 | A location object -- either window.location or the location property of a hyperlink element | l2 | An other (optional) location object to be compared with l1. If no second parameter is passed, window.location is used. |
Returnstrue, if the locations are identical, otherwise false
pageAddressRetrieves an URL without fragment identifiers, URL parameters etc. Parametersl | An optional location object, Defaults to window.location |
ReturnsThe URL without fragment identifiers, URL parameters etc. For example, assuming that window.location is “http://sharpeleven.net- /some- /file#part?param=value" var me = Kilauea.pageAddress(); alert(me); => 'http://sharpeleven.net/some/file'
restartReloads the HTML page, thereby restarting all presentations. This clear the <Kilauea.Instance.histories> of all instances as well.
addEventaddEvent: function( | node, | | type, | | fn, | | capt | ) |
|
Adds a DOM event handler in a fairly browser-independent way. See John Resig’s similar function on http://ejohn.org- /projects- /flexible-javascript-events- /, on which Kilauea.addEvent is partly based. Parametersnode | the DOM element on which the event handler should listen | type | the type of the DOM event | fn | the function to be called on DOM events. Note that fn is evaluated with the this pointer pointing to the element which has been passed to Kilauea.addEvent as first argument | capt | whether to use event capture. Defaults to false, because usually, one wants to have event handling during the bubble phase. IE’s event model only knows event bubbling, and this parameter thus has no effect in IE. |
For more information about the different DOM event models, see
removeEventremoveEvent: function( | node, | | type, | | fn, | | capt | ) |
|
Removes a DOM event handler. This is the complementary method to Kilauea.addEvent. Note that this does not work reliably for anonymous functions. Parametersnode | the DOM element on which the event handler should listen | type | the type of the DOM event | fn | the function to be called on DOM events. Note that fn is evaluated with the this pointer pointing to the element which has been passed to Kilauea.addEvent as first argument | capt | whether to use event capture. Defaults to false, because usually, one wants to have event handling during the bubble phase. IE’s event model only knows event bubbling, and this parameter thus has no effect in IE. |
cancelEventcancelEvent: function( | ev | ) |
|
Cancels a DOM event. ParametersReturnsfalse. This is useful for writing return cancelEvent(ev);
getXHRA cross-browser utility method which returns a XMLHttpRequest object. ReturnsAn XMLHttpRequest object.
collectScriptscollectScripts: function() |
Collects all scripts included so far and pushes them onto Kilauea.scripts.
loadScriptloadScript: function( | url, | | isUTF8 | ) |
|
Loads a script at runtime. This method is different from Kilauea.includeScript in that it works at runtime, not during page load. As a consequence, no document.load event fires when the loading of the script completes. Parametersurl | the URL to the script. No expansion / modification of the URL is done; the caller has to make sure that the URL is correct. | isUTF8 | whether the file is UTF8-encoded. Defaults to false. For example, Kilauea.localization.fetch utilizes this feature, as language packages are very likely to contain special characters. |
includeScriptincludeScript: function( | url, | | isUTF8 | ) |
|
Includes a script during page load. As opposed to Kilauea.loadScript, this method inserts a script element into the document header. Th script then is loaded during page load, and the loading process of the script is taken into consideration when determining completion of document.load. Parametersurl | the URL to the script. No expansion / modification of the URL is done; the caller has to make sure that the URL is correct. | isUTF8 | whether the file is UTF8-encoded. Defaults to false. |
includeCSSincludeCSS: function( | url | ) |
|
Includes a CSS file during page load. Similar to Kilauea.includeScript, but works for CSS files rather than for scripts. Parametersurl | the URL to the script. No expansion / modification of the URL is done; the caller has to make sure that the URL is correct. |
draggable.pickHandles the picking up in a drag’n’drop action. As a side-effect, the z-index of the element which is to be dragged is set to 700 while dragging. Parameters
draggable.dropPerforms the drop of a drag’n’drop. Parameters
draggable.dragUpdates the element’s position while dragging. Parameters
isURIDetermines whether a string is an URI. Applys the following regular expression pattern to the string /^(\w+:\/\/)/
Parametersn | a string Returns: true, if the string is an URI, otherwise false. |
html2textReturns a plain-text version of a possibly HTML-formatted string. It recursively traverses all child elements, retrieves all text nodes and concats these strings. Parametersel | a DOM element Returns: A string representation of the element’s content. |
Kilauea. EventA Class for Kilauea Events A utility class that stores an event callback and a this pointer. ParametersSummary | | | The function to be used as callback | | The object to be used as this pointer when calling fn. | | | | |
fnThe function to be used as callback
thisObjThe object to be used as this pointer when calling fn.
firethis.fire = function( | t, | | inst | ) |
|
Fires fn with this set to thisObj.
Kilauea. PanelA Utility Class for Panels Constructor Parameterselm | The panel’s DOM element | defVis | The initial default visibility -- either ‘hidden’ or ‘visible’ | embedded | Whether the panel is part of an embedded presentation | isDrag | Whether the panel should be draggable through Kilauea.draggable (default is false) |
Summary | | | A reference to the DOM element. | | The current status of the panel’s visibility. | | | | Sets the visibility of the panel. | | | | | | | | Temporarily hides the panel. | | |
refA reference to the DOM element. This can be used if for example the DOM contents of the panels are altered.
statusThe current status of the panel’s visibility.
setSets the visibility of the panel. Parametersv | the visibility. Either ‘visible’ or ‘hidden’. |
quickHidethis.quickHide = function() |
Temporarily hides the panel.
restorethis.restore = function() |
Restores the panel after a quickHide.
Kilauea. CanvasA Utility Canvas Class A utility class for the canvas element which encloses Kilauea presentations in <Kilauea.embeddedMode>. Constructor Parametersel | The DOM element. | isFull | Whether the Canvas is the full browser window itself. |
Summary | | | The absolute x-coordinate of the canvas, in pixels. | | The absolute y-coordinate of the canvas, in pixels. | | The total width of the canvas, in pixels. | | The total height of the canvas, in pixels. | | | | Updates the canvas’ position and dimensions. |
leftThe absolute x-coordinate of the canvas, in pixels.
topThe absolute y-coordinate of the canvas, in pixels.
widthThe total width of the canvas, in pixels.
heightThe total height of the canvas, in pixels.
Kilauea. SlideThe Slide Class The slide class used for all Kilauea.Instance.slides. This class is only accessible within the scope of Kilauea.Instance’s constructor. Constructor ParametersSummary | | | A pointer to the slide’s DOM element, usually a div.slide. | | | | | | | | A fragment identifier for this slide (if present), or a self-assigned pseudo-identifier. | | A plain text slide title. | | | | An array which contains objects for each incremental part of the slide. | | | | | | | | Unveils incrementals up to a given position. | | Sets the slide’s visibility. | | |
refA pointer to the slide’s DOM element, usually a div.slide.
anchorA fragment identifier for this slide (if present), or a self-assigned pseudo-identifier. Pseudo-identifiers have the form “(<slide number>)”. Note that self-assigned anchors may confilct with other user-defined anchors.
titleA plain text slide title.
incrementalsAn array which contains objects for each incremental part of the slide. The object has two methods, unveil - unveils the incremental part cover - covers the incremental part Slide.incrementals are used in Slide.unveilUpto.
hideHides the slide. ReturnsThe Slide.id.
showShows the slide. Not ot be confused with Kilauea.Instance.showSlide, which does a lot more besides showing slides. (In fact, it doesn’t even necessarily show slides: e.g., the <transition> plugin may take care of that.) ReturnsThe Slide.id.
unveilUptothis.unveilUpto = function( | i | ) |
|
Unveils incrementals up to a given position. The position is the array index of the incremental part within Slide.incrementals. Parameters: i - the incremental index up to which incrementals shall be unveiled. ReturnsThe the current incremental index.
setSets the slide’s visibility. Parametersvis | the desired visibility. Either true or false. |
findBackgroundthis.findBackground = function( | bg | ) |
|
Finds a matching background in Kilauea.Instance.backgrounds for a Kilauea.Slide. Backgrounds are associated to slides via the class attribute. If a slide bears the class ‘xyz’ in its classname and there is a background with _class=”background xyz”_, then this background is the matching background for that slide. Parametersgb | An associative arrray of backgrounds, where the keys are the background names (i.e., ‘xyz’ in the above example). |
ReturnsA background name, or ‘#default’, if no explicitly associated backgound can be found.
Kilauea. BackgroundThe Background Class Constructor ParametersSummary | | | A pointer to the backgounnd’s DOM element. | | | | | | Sets the backgound’s visibility. | | The x-coordinate of the computed position, in pixels. | | The y-coordinate of the computed position, in pixels. | | Adapts the scroll position to given coordinates. | | Resets the background’s position to the top left corner of the canvas. |
refA pointer to the backgounnd’s DOM element. THis is important if the background’s DOM content has to be modified.
setSets the backgound’s visibility. Parametersvis | The desired visibility -- either true or false. |
leftThe x-coordinate of the computed position, in pixels.
topThe y-coordinate of the computed position, in pixels.
adaptScrollthis.adaptScroll = function( | left, | | top | ) |
|
Adapts the scroll position to given coordinates. This is used in order to get the same behaviour (i.e., backgrounds move together with slides while scrolling) in Kilauea.Instance.embeddedMode as in standalone mode. Parametersleft | the x-coordinate | top | the y-coordinate |
resetScrollthis.resetScroll = function() |
Resets the background’s position to the top left corner of the canvas.
Kilauea.MenuThe Menu Class Constructor Parameters
Kilauea. SubmenuThe Submenu Class Constructor Parametersm | The li DOM element. | parent | The parent Kilauea.Menu. | id | The submenu’s ID, which is its key within the parent’s <Kilauea.Menu.submenus> object. |
Summary | | | Adds a hyperlink to a given submenu. |
Kilauea. InstanceThe Kilauea Instance Class Summary | | | | | true, if the presentation instance occupies the whole window. | | true, if the presentation is in embedded mode. | | A pointer to the top-level DOM element that contains all slides. | | | | Kilauea events that are fired on appropriate occasions. | | | | The array which contains all slides. | | The object which contains all backgrounds. | | The presentation’s title. | | An array where part and subpart information for each presentation is stored. | | | | | | Shows a given slide with the correct incrementals and notes unveiled. | | | | | | | | | | | | | | | | | | Adds a hyperlink to the instance’s toolbar menu. | | Replaces a hyperlink in the instance’s toolbar menu by another. | | | | | | Adds a hyperlink to a given submenu. | | Replaces a hyperlink in the instance’s toolbar menu by another. | | | | | | | | |
idThe instance ID. Every Kilauea.Instance can access itself via Kilauea.instances[this.id]
isFullWindowtrue, if the presentation instance occupies the whole window. Full-window presentations are treated differently, e.g. with regard to <Kilauea.Instance.updateLocation>: In full-window presentations, the URL in the address bar of the browser is updated.
embeddedModetrue, if the presentation is in embedded mode. The principal difference from standalone mode is that presentations are wrapped in a special div.kilaueaCanvas wich has fixed dimensions and the CSS property overflow: hidden;. Doing so, multiple slideshow presentations in one single XHMTL document (and in one single broser window) become possible.
containerA pointer to the top-level DOM element that contains all slides.
pluginsThe object that contains the Kilauea.Instance’s plugin instances. The object keys are the plugin URIs. Note the difference to Kilauea.plugins, which contains the plugin classes, not the instances.
eventsKilauea events that are fired on appropriate occasions. External applications or Kilauea plugins can listen to these events by means of <Kilauea.Instance.registerEvent>. The available event types are slideChange - fired, if the slide changes. This is not the case if only incremental parts are unveiled or if there is a change from / to alSlideMode. incrementalChange - fired if incremental parts of a slide are unveiled or covered again. eos - fired, if the end of the slides is reached. Note that this may happen several times (in case the presentator moves back and forth to the last slide). ready - fired after complete initialization of the respective Kilauea.Instance. Registration of this particular event is different, as <registerEvent> cannot be used before complete initialization of the Kilauea.Instance. Instead, the function which is to be executed for this event must be passed as property onReady of the parameter object of Kilauea.init. singleSlideView - fired if singleSlideMode is reached after allSlideMode allSlideView - fired if allSlideMode is reached after singleSlideMode redraw - fired after redraws of the Kilauea.Instance.
slidesThe array which contains all slides.
backgroundsThe object which contains all backgrounds. The background names are used for object keys. Kilauea.Instance.backgrounds always contains at least one entry, which then has the key ‘#default’ and may have a null value.
titleThe presentation’s title. Either the title specified in Kilauea.init’s parameter object, or an inferred title from the cover slide.
partsAn array where part and subpart information for each presentation is stored. The array contains an entry for every part and for every slide. Array indices are used for identifying the entries. In the former case, the entry is an object with properties title - A plain text part title. It is either given by an id attribute on the part’s DOM element (which usually is a div.part) or it gets inferred from a outline slide (usually a div.slide.outline). href - A (pseudo) fragment identifier that can be used for linking to the part, equivalent to Slide.anchor. children - An array with part IDs of children elements, which can be slides or parts. In the latter case, the entry has only one property, slide - The Slide.id of the slide. Kilauea.Instance.parts is especially useful for building hierarchical table of contents, as done in <Kilauea.Instance.getHierarchicalToc>.
Slide Manipulation and Retrieval
showSlideshowSlide: function( | sn, | | inc | ) |
|
Shows a given slide with the correct incrementals and notes unveiled. Kilauea.Instance.showSlide should be called with legal slide indices, although it legalizes all parameters by using <Kilauea.Instance.legalSlide> and <Kilauea.Instance.legalIncremental>. The method fires the following Kilauea.Instance.events, if appropriate: - slideChange
- incrementalChange
- eos
Parameterssn | a slide number | inc | an incremental index |
Custom Kilauea Event Methods
getLinkgetLink: function( | chld, | | title, | | href, | | thisObj, | | params | ) |
|
Creates a hyperlink. Parameterschld | either a string (the link text) or a DOM node (to be inserted as the link’s child node) | title | a title string href- getLink accepts either a URL as string or a pointer to a function. in the latter case, the following optional parameters are possible: | thisObj | a pointer to an object which should be used as <i>this</i>, when the function is evaluated | params | an array of arguments to be passed to the function |
The method localizes all strings and adds them as parts to Kilauea.localization. ReturnsA hyperlink DOM element
addToToolbarMenuaddToToolbarMenu: function( | a | ) |
|
Adds a hyperlink to the instance’s toolbar menu. ParametersReturnsThe newly appended menu entry (which is a list DOM element), or null.
replaceInToolbarMenureplaceInToolbarMenu: function( | li, | | a | ) |
|
Replaces a hyperlink in the instance’s toolbar menu by another. ParametersReturnsThe new menu entry (which is a list DOM element), or null.
getSubmenuDescription ParametersReturns
removeSubmenuremoveSubmenu: function( | m | ) |
|
Description ParametersReturns
replaceInSubmenureplaceInSubmenu: function( | m, | | li, | | a | ) |
|
Replaces a hyperlink in the instance’s toolbar menu by another. ParametersReturnsThe new menu entry (which is a list DOM element), or null.
removeFromSubmenuremoveFromSubmenu: function( | m, | | li | ) |
|
Description ParametersReturns
redrawDescription ParametersReturns
|