It is highly recommended to use a Static Object API in order to avoid polluting the global namespace. As there should be no more than one SlideShow Object per document, a static object should be sufficient.
The static object is named Slideous
in Slideous. It will be named "X" in the following table, in need for a better name. The browser's window and document objects are abbreviated as win and doc.
Description | Slidy | Slideous | S5 | Proposal |
Event handlers |
win.onload | startup() | X.init() | startup() | X.init() |
win.onresize | resized() | – | anonymous() | X.resize() |
win.onscroll | scrolled() | – | – | X.scroll() |
win.onbeforeprint | beforePrint() | – | – | X.beforeprint() |
win.onafterprint | afterPrint() | – | – | X.afterprint() |
doc.onmousedown | – | X.mousedown(e) | – | X.mousedown(e) |
doc.onmouseup | mouseButtonUp(e) | X.mouseup(e) | – | X.mouseup(e) |
doc.onclick | mouseButtonClick(e) | – | – | X.click(e) |
doc.onkeypress | – | – | trap(e) | – |
doc.onkeydown | keyDown(e) | X.keydown(e) | – | X.keydown(e) |
doc.onkeyup | – | – | keys(e) | – |
Navigational methods |
first slide | firstSlide() | X.gotoslide(1) | goTo(0) | X.toSlide(0) |
last slide | lastSlide() | X.gotoslide(n) | goTo(n) | X.toSlide(n) |
next slide/item | nextSlide(incr) | X.next(incr) | go(1) | X.next(incr) |
previous slide/item | previousSlide(incr) | X.previous(incr) | go(-1) | X.previous(incr) |
goto slide | – | X.gotoslide(i) | goTo(i) | X.toSlide(i) |
UI related methods |
show all slides | toggleView() | X.showall(bool) | toggle() | X.showAll(bool) |
show/hide statusbar | showToolbar() | X.toggle- statusbar() | – | X.showBar(bool) |
mouse navigation on/off | – | X.mouse- navigation(bool) | – | X.mouse- Navigation(bool) |
change font size | smaller(), bigger() | X.change- fontsize(delta) | – | X.setFontSize (index) |
Slide methods |
get slide by index | – | – | – | X.slide(idx) |
get slide by id | – | – | – | X.slideById(id) |
get slide visibilty | – | – | – | X.isVisible (slide) |
get slide title | – | – | – | X.slideTitle (slide) |
get slide note | – | – | – | X.slideNote (slide) |
set slide visibility | – | – | – | X.showSlide (slide, bool) |
set slide note visibility | – | – | – | X.showNote (slide, bool) |
X properties |
# of slides | – | – | – | X.count |
current slide index | – | – | – | X.idx |
view mode (bool) | – | – | – | X.all |
mouse navigation (bool) | – | – | – | X.mouse |
current font size index | – | – | – | X.fontSize |
localization of messages (arrays) | – | – | – | X.msg.de, …, X.msg.en |
It might be somewhat tidier, to collect all event handlers in an internal object, so we would have X.evt.mousedown
instead of X.mousedown
.