@@ -0,0 +1,3016 @@
3+ Copyright (c) 2005-2011 W3C (MIT, ERCIM, Keio), All Rights Reserved.
4+ W3C liability, trademark, document use and software licensing
7+ http://www.w3.org/Consortium/Legal/copyright-documents
8+ http://www.w3.org/Consortium/Legal/copyright-software
10+ Defines single name "w3c_slidy" in global namespace
11+ Adds event handlers without trampling on any others
14+// the slidy object implementation
16+ // classify which kind of browser we're running under
17+ ns_pos: (typeof window.pageYOffset!='undefined'),
18+ khtml: ((navigator.userAgent).indexOf("KHTML") >= 0 ? true : false),
19+ opera: ((navigator.userAgent).indexOf("Opera") >= 0 ? true : false),
20+ ipad: ((navigator.userAgent).indexOf("iPad") >= 0 ? true : false),
21+ iphone: ((navigator.userAgent).indexOf("iPhone") >= 0 ? true : false),
22+ android: ((navigator.userAgent).indexOf("Android") >= 0 ? true : false),
23+ ie: (typeof document.all != "undefined" && !this.opera),
24+ ie6: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 6") != -1),
25+ ie7: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 7") != -1),
26+ ie8: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 8") != -1),
27+ ie9: (!this.ns_pos && navigator.userAgent.indexOf("MSIE 9") != -1),
29+ // data for swipe and double tap detection on touch screens
37+ // are we running as XHTML? (doesn't work on Opera)
38+ is_xhtml: /xml/.test(document.contentType),
40+ slide_number: 0, // integer slide count: 0, 1, 2, ...
41+ slide_number_element: null, // element containing slide number
42+ slides: [], // set to array of slide div's
43+ notes: [], // set to array of handout div's
44+ backgrounds: [], // set to array of background div's
45+ toolbar: null, // element containing toolbar
46+ title: null, // document title
47+ last_shown: null, // last incrementally shown item
48+ eos: null, // span element for end of slide indicator
49+ toc: null, // table of contents
50+ outline: null, // outline element with the focus
51+ selected_text_len: 0, // length of drag selection on document
52+ view_all: 0, // 1 to view all slides + handouts
53+ want_toolbar: true, // user preference to show/hide toolbar
54+ mouse_click_enabled: true, // enables left click for next slide
55+ scroll_hack: 0, // IE work around for position: fixed
56+ disable_slide_click: false, // used by clicked anchors
58+ lang: "en", // updated to language specified by html file
60+ help_anchor: null, // used for keyboard focus hack in showToolbar()
61+ help_page: "http://www.w3.org/Talks/Tools/Slidy2/help/help.html",
62+ help_text: "Navigate with mouse click, space bar, Cursor Left/Right, " +
63+ "or Pg Up and Pg Dn. Use S and B to change font size.",
67+ sizes: new Array("10pt", "12pt", "14pt", "16pt", "18pt", "20pt",
68+ "22pt", "24pt", "26pt", "28pt", "30pt", "32pt"),
70+ // needed for efficient resizing
75+ // Needed for cross browser support for relative width/height on
76+ // object elements. The work around is to save width/height attributes
77+ // and then to recompute absolute width/height dimensions on resizing
80+ // attach initialiation event handlers
81+ set_up: function () {
82+ var init = function() { w3c_slidy.init(); };
83+ if (typeof window.addEventListener != "undefined")
84+ window.addEventListener("load", init, false);
86+ window.attachEvent("onload", init);
89+ hide_slides: function () {
90+ if (document.body && !w3c_slidy.initialized)
91+ document.body.style.visibility = "hidden";
93+ setTimeout(w3c_slidy.hide_slides, 50);
96+ // hack to persuade IE to compute correct document height
97+ // as needed for simulating fixed positioning of toolbar
98+ ie_hack: function () {
99+ window.resizeBy(0,-1);
100+ window.resizeBy(0, 1);
104+ //alert("slidy starting test 10");
105+ document.body.style.visibility = "visible";
106+ this.init_localization();
108+ this.wrap_implicit_slides();
109+ this.collect_slides();
110+ this.collect_notes();
111+ this.collect_backgrounds();
112+ this.objects = document.body.getElementsByTagName("object");
113+ this.patch_anchors();
114+ this.slide_number = this.find_slide_number(location.href);
115+ window.offscreenbuffering = true;
116+ this.size_adjustment = this.find_size_adjust();
117+ this.time_left = this.find_duration();
118+ this.hide_image_toolbar(); // suppress IE image toolbar popup
119+ this.init_outliner(); // activate fold/unfold support
120+ this.title = document.title;
121+ this.keyboardless = (this.ipad||this.iphone||this.android);
123+ if (this.keyboardless)
125+ w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden")
126+ this.want_toolbar = 0;
129+ // work around for opera bug
130+ this.is_xhtml = (document.body.tagName == "BODY" ? false : true);
132+ if (this.slides.length > 0)
134+ var slide = this.slides[this.slide_number];
136+ if (this.slide_number > 0)
138+ this.set_visibility_all_incremental("visible");
139+ this.last_shown = this.previous_incremental_item(null);
140+ this.set_eos_status(true);
144+ this.last_shown = null;
145+ this.set_visibility_all_incremental("hidden");
146+ this.set_eos_status(!this.next_incremental_item(this.last_shown));
149+ this.set_location();
150+ this.add_class(this.slides[0], "first-slide");
151+ w3c_slidy.show_slide(slide);
154+ this.toc = this.table_of_contents();
156+ this.add_initial_prompt();
158+ // bind event handlers without interfering with custom page scripts
159+ // Tap events behave too weirdly to support clicks reliably on
160+ // iPhone and iPad, so exclude these from click handler
162+ if (!this.keyboardless)
164+ this.add_listener(document.body, "click", this.mouse_button_click);
165+ this.add_listener(document.body, "mousedown", this.mouse_button_down);
168+ this.add_listener(document, "keydown", this.key_down);
169+ this.add_listener(document, "keypress", this.key_press);
170+ this.add_listener(window, "resize", this.resized);
171+ this.add_listener(window, "scroll", this.scrolled);
172+ this.add_listener(window, "unload", this.unloaded);
174+ //this.add_listener(document.body, "touchstart", this.touchstart);
175+ //this.add_listener(document.body, "touchmove", this.touchmove);
176+ //this.add_listener(document.body, "touchend", this.touchend);
178+ this.add_listener(document, "gesturechange", function ()
183+ this.attach_touch_handers(this.slides);
185+ // this seems to be a debugging hack
186+ //if (!document.body.onclick)
187+ // document.body.onclick = function () { };
189+ this.single_slide_view();
191+ //this.set_location();
196+ setTimeout(w3c_slidy.ie_hack, 100);
198+ this.show_toolbar();
200+ // for back button detection
201+ setInterval(function () { w3c_slidy.check_location(); }, 200);
202+ w3c_slidy.initialized = true;
205+ // create div element with links to each slide
206+ table_of_contents: function () {
207+ var toc = this.create_element("div");
208+ this.add_class(toc, "slidy_toc hidden");
209+ //toc.setAttribute("tabindex", "0");
211+ var heading = this.create_element("div");
212+ this.add_class(heading, "toc-heading");
213+ heading.innerHTML = this.localize("Table of Contents");
215+ toc.appendChild(heading);
216+ var previous = null;
218+ for (var i = 0; i < this.slides.length; ++i)
220+ var title = this.has_class(this.slides[i], "title");
221+ var num = document.createTextNode((i + 1) + ". ");
223+ toc.appendChild(num);
225+ var a = this.create_element("a");
226+ a.setAttribute("href", "#(" + (i+1) + ")");
229+ this.add_class(a, "titleslide");
231+ var name = document.createTextNode(this.slide_name(i));
232+ a.appendChild(name);
233+ a.onclick = w3c_slidy.toc_click;
234+ a.onkeydown = w3c_slidy.toc_key_down;
235+ a.previous = previous;
245+ if (i < this.slides.length - 1)
247+ var br = this.create_element("br");
248+ toc.appendChild(br);
254+ toc.focus = function () {
259+ toc.onmouseup = w3c_slidy.mouse_button_up;
261+ toc.onclick = function (e) {
262+ e||(e=window.event);
264+ if (w3c_slidy.selected_text_len <= 0)
265+ w3c_slidy.hide_table_of_contents(true);
267+ w3c_slidy.stop_propagation(e);
269+ if (e.cancel != undefined)
272+ if (e.returnValue != undefined)
273+ e.returnValue = false;
278+ document.body.insertBefore(toc, document.body.firstChild);
282+ is_shown_toc: function () {
283+ return !w3c_slidy.has_class(w3c_slidy.toc, "hidden");
286+ show_table_of_contents: function () {
287+ w3c_slidy.remove_class(w3c_slidy.toc, "hidden");
288+ var toc = w3c_slidy.toc;
291+ if (w3c_slidy.ie7 && w3c_slidy.slide_number == 0)
292+ setTimeout(w3c_slidy.ie_hack, 100);
295+ hide_table_of_contents: function (focus) {
296+ w3c_slidy.add_class(w3c_slidy.toc, "hidden");
298+ if (focus && !w3c_slidy.opera &&
299+ !w3c_slidy.has_class(w3c_slidy.toc, "hidden"))
300+ w3c_slidy.help_anchor.focus();
303+ toggle_table_of_contents: function () {
304+ if (w3c_slidy.is_shown_toc())
305+ w3c_slidy.hide_table_of_contents(true);
307+ w3c_slidy.show_table_of_contents();
310+ // called on clicking toc entry
311+ toc_click: function (e) {
315+ var target = w3c_slidy.get_target(e);
317+ if (target && target.nodeType == 1)
319+ var uri = target.getAttribute("href");
323+ //alert("going to " + uri);
324+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
325+ w3c_slidy.hide_slide(slide);
326+ w3c_slidy.slide_number = w3c_slidy.find_slide_number(uri);
327+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
328+ w3c_slidy.last_shown = null;
329+ w3c_slidy.set_location();
330+ w3c_slidy.set_visibility_all_incremental("hidden");
331+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
332+ w3c_slidy.show_slide(slide);
337+ if (!w3c_slidy.opera)
338+ w3c_slidy.help_anchor.focus();
346+ w3c_slidy.hide_table_of_contents(true);
347+ if (w3c_slidy.ie7) w3c_slidy.ie_hack();
348+ w3c_slidy.stop_propagation(e);
349+ return w3c_slidy.cancel(e);
352+ // called onkeydown for toc entry
353+ toc_key_down: function (event) {
357+ var event = window.event;
359+ // kludge around NS/IE differences
361+ key = window.event.keyCode;
362+ else if (event.which)
365+ return true; // Yikes! unknown browser
367+ // ignore event if key value is zero
368+ // as for alt on Opera and Konqueror
372+ // check for concurrent control/command/alt key
373+ // but are these only present on mouse events?
375+ if (event.ctrlKey || event.altKey)
380+ var uri = this.getAttribute("href");
384+ //alert("going to " + uri);
385+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
386+ w3c_slidy.hide_slide(slide);
387+ w3c_slidy.slide_number = w3c_slidy.find_slide_number(uri);
388+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
389+ w3c_slidy.last_shown = null;
390+ w3c_slidy.set_location();
391+ w3c_slidy.set_visibility_all_incremental("hidden");
392+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
393+ w3c_slidy.show_slide(slide);
398+ if (!w3c_slidy.opera)
399+ w3c_slidy.help_anchor.focus();
406+ w3c_slidy.hide_table_of_contents(true);
409+ w3c_slidy.ie_hack();
411+ return w3c_slidy.cancel(event);
414+ if (key == 40 && this.next)
417+ return w3c_slidy.cancel(event);
420+ if (key == 38 && this.previous)
422+ this.previous.focus();
423+ return w3c_slidy.cancel(event);
429+ touchstart: function (e)
431+ //e.preventDefault();
432+ this.prev_tap = this.last_tap;
433+ this.last_tap = (new Date).getTime();
435+ var tap_delay = this.last_tap - this.prev_tap;
437+ if (tap_delay <= 200)
442+ var touch = e.touches[0];
444+ this.start_x = touch.pageX;
445+ this.start_y = touch.pageY;
446+ this.delta_x = this.delta_y = 0;
449+ touchmove: function (e)
451+ //e.preventDefault();
452+ var touch = e.touches[0];
453+ this.delta_x = touch.pageX - this.start_x;
454+ this.delta_y = touch.pageY - this.start_y;
457+ touchend: function (e)
459+ //e.preventDefault();
460+ var delay = (new Date).getTime() - this.last_tap;
461+ var dx = this.delta_x;
462+ var dy = this.delta_y;
463+ var abs_dx = Math.abs(dx);
464+ var abs_dy = Math.abs(dy);
466+ if (delay < 500 && (abs_dx > 100 || abs_dy > 100))
468+ if (abs_dx > 0.5 * abs_dy)
471+ w3c_slidy.next_slide(true);
473+ w3c_slidy.previous_slide(true);
475+ else if (abs_dy > 2 * abs_dx)
477+ w3c_slidy.toggle_table_of_contents();
483+ before_print: function () {
484+ this.show_all_slides();
485+ this.hide_toolbar();
486+ alert("before print");
490+ after_print: function () {
493+ this.single_slide_view();
494+ this.show_toolbar();
496+ alert("after print");
500+ print_slides: function () {
501+ this.before_print();
506+ // ### OBSOLETE ?? ###
507+ toggle_view: function () {
510+ this.single_slide_view();
511+ this.show_toolbar();
516+ this.show_all_slides();
517+ this.hide_toolbar();
522+ // prepare for printing ### OBSOLETE ###
523+ show_all_slides: function () {
524+ this.remove_class(document.body, "single_slide");
525+ this.set_visibility_all_incremental("visible");
528+ // restore after printing ### OBSOLETE ###
529+ single_slide_view: function () {
530+ this.add_class(document.body, "single_slide");
531+ this.set_visibility_all_incremental("visible");
532+ this.last_shown = this.previous_incremental_item(null);
535+ // suppress IE's image toolbar pop up
536+ hide_image_toolbar: function () {
539+ var images = document.getElementsByTagName("IMG");
541+ for (var i = 0; i < images.length; ++i)
542+ images[i].setAttribute("galleryimg", "no");
546+ unloaded: function (e) {
547+ //alert("unloaded");
550+ // Safari and Konqueror don't yet support getComputedStyle()
551+ // and they always reload page when location.href is updated
552+ is_KHTML: function () {
553+ var agent = navigator.userAgent;
554+ return (agent.indexOf("KHTML") >= 0 ? true : false);
557+ // find slide name from first h1 element
558+ // default to document title + slide number
559+ slide_name: function (index) {
561+ var slide = this.slides[index];
563+ var heading = this.find_heading(slide);
566+ name = this.extract_text(heading);
569+ name = this.title + "(" + (index + 1) + ")";
571+ name.replace(/\&/g, "&");
572+ name.replace(/\</g, "<");
573+ name.replace(/\>/g, ">");
578+ // find first h1 element in DOM tree
579+ find_heading: function (node) {
580+ if (!node || node.nodeType != 1)
583+ if (node.nodeName == "H1" || node.nodeName == "h1")
586+ var child = node.firstChild;
590+ node = this.find_heading(child);
595+ child = child.nextSibling;
601+ // recursively extract text from DOM tree
602+ extract_text: function (node) {
607+ if (node.nodeType == 3)
608+ return node.nodeValue;
611+ if (node.nodeType == 1)
613+ node = node.firstChild;
618+ text = text + this.extract_text(node);
619+ node = node.nextSibling;
628+ // find copyright text from meta element
629+ find_copyright: function () {
631+ var meta = document.getElementsByTagName("meta");
633+ for (var i = 0; i < meta.length; ++i)
635+ name = meta[i].getAttribute("name");
636+ content = meta[i].getAttribute("content");
638+ if (name == "copyright")
645+ find_size_adjust: function () {
646+ var name, content, offset;
647+ var meta = document.getElementsByTagName("meta");
649+ for (var i = 0; i < meta.length; ++i)
651+ name = meta[i].getAttribute("name");
652+ content = meta[i].getAttribute("content");
654+ if (name == "font-size-adjustment")
661+ // <meta name="duration" content="20" /> for 20 minutes
662+ find_duration: function () {
663+ var name, content, offset;
664+ var meta = document.getElementsByTagName("meta");
666+ for (var i = 0; i < meta.length; ++i)
668+ name = meta[i].getAttribute("name");
669+ content = meta[i].getAttribute("content");
671+ if (name == "duration")
672+ return 60000 * content;
678+ replace_by_non_breaking_space: function (str) {
679+ for (var i = 0; i < str.length; ++i)
683+ // ### CHECK ME ### is use of "li" okay for text/html?
684+ // for XHTML do we also need to specify namespace?
685+ init_outliner: function () {
686+ var items = document.getElementsByTagName("li");
688+ for (var i = 0; i < items.length; ++i)
690+ var target = items[i];
692+ if (!this.has_class(target.parentNode, "outline"))
695+ target.onclick = this.outline_click;
696+/* ### more work needed for IE6
699+ target.onmouseover = this.hover_outline;
700+ target.onmouseout = this.unhover_outline;
703+ if (this.foldable(target))
705+ target.foldable = true;
706+ target.onfocus = function () {w3c_slidy.outline = this;};
707+ target.onblur = function () {w3c_slidy.outline = null;};
709+ if (!target.getAttribute("tabindex"))
710+ target.setAttribute("tabindex", "0");
712+ if (this.has_class(target, "expand"))
713+ this.unfold(target);
719+ this.add_class(target, "nofold");
720+ target.visible = true;
721+ target.foldable = false;
726+ foldable: function (item) {
727+ if (!item || item.nodeType != 1)
730+ var node = item.firstChild;
734+ if (node.nodeType == 1 && this.is_block(node))
737+ node = node.nextSibling;
743+ // ### CHECK ME ### switch to add/remove "hidden" class
744+ fold: function (item) {
747+ this.remove_class(item, "unfolded");
748+ this.add_class(item, "folded");
751+ var node = item ? item.firstChild : null;
755+ if (node.nodeType == 1 && this.is_block(node)) // element
757+ w3c_slidy.add_class(node, "hidden");
760+ node = node.nextSibling;
763+ item.visible = false;
766+ // ### CHECK ME ### switch to add/remove "hidden" class
767+ unfold: function (item) {
770+ this.add_class(item, "unfolded");
771+ this.remove_class(item, "folded");
774+ var node = item ? item.firstChild : null;
778+ if (node.nodeType == 1 && this.is_block(node)) // element
780+ w3c_slidy.remove_class(node, "hidden");
783+ node = node.nextSibling;
786+ item.visible = true;
789+ outline_click: function (e) {
793+ var rightclick = false;
794+ var target = w3c_slidy.get_target(e);
796+ while (target && target.visible == undefined)
797+ target = target.parentNode;
803+ rightclick = (e.which == 3);
805+ rightclick = (e.button == 2);
807+ if (!rightclick && target.visible != undefined)
809+ if (target.foldable)
812+ w3c_slidy.fold(target);
814+ w3c_slidy.unfold(target);
817+ w3c_slidy.stop_propagation(e);
819+ e.returnValue = false;
825+ add_initial_prompt: function () {
826+ var prompt = this.create_element("div");
827+ prompt.setAttribute("class", "initial_prompt");
829+ var p1 = this.create_element("p");
830+ prompt.appendChild(p1);
831+ p1.setAttribute("class", "help");
833+ if (this.keyboardless)
834+ p1.innerHTML = "swipe left to move to next slide";
836+ p1.innerHTML = "Space, Right Arrow or swipe left to move to " +
837+ "next slide, click help below for more details";
839+ this.add_listener(prompt, "click", function (e) {
840+ document.body.removeChild(prompt);
841+ w3c_slidy.stop_propagation(e);
843+ if (e.cancel != undefined)
846+ if (e.returnValue != undefined)
847+ e.returnValue = false;
852+ document.body.appendChild(prompt);
853+ this.initial_prompt = prompt;
854+ setTimeout(function() {document.body.removeChild(prompt);}, 5000);
857+ add_toolbar: function () {
860+ this.toolbar = this.create_element("div");
861+ this.toolbar.setAttribute("class", "toolbar");
863+ // a reasonably behaved browser
864+ if (this.ns_pos || !this.ie6)
866+ var right = this.create_element("div");
867+ right.setAttribute("style", "float: right; text-align: right");
869+ counter = this.create_element("span")
870+ counter.innerHTML = this.localize("slide") + " n/m";
871+ right.appendChild(counter);
872+ this.toolbar.appendChild(right);
874+ var left = this.create_element("div");
875+ left.setAttribute("style", "text-align: left");
877+ // global end of slide indicator
878+ this.eos = this.create_element("span");
879+ this.eos.innerHTML = "* ";
880+ left.appendChild(this.eos);
882+ var help = this.create_element("a");
883+ help.setAttribute("href", this.help_page);
884+ help.setAttribute("title", this.localize(this.help_text));
885+ help.innerHTML = this.localize("help?");
886+ left.appendChild(help);
887+ this.help_anchor = help; // save for focus hack
889+ var gap1 = document.createTextNode(" ");
890+ left.appendChild(gap1);
892+ var contents = this.create_element("a");
893+ contents.setAttribute("href", "javascript:w3c_slidy.toggle_table_of_contents()");
894+ contents.setAttribute("title", this.localize("table of contents"));
895+ contents.innerHTML = this.localize("contents?");
896+ left.appendChild(contents);
898+ var gap2 = document.createTextNode(" ");
899+ left.appendChild(gap2);
901+ var copyright = this.find_copyright();
905+ var span = this.create_element("span");
906+ span.className = "copyright";
907+ span.innerHTML = copyright;
908+ left.appendChild(span);
911+ this.toolbar.setAttribute("tabindex", "0");
912+ this.toolbar.appendChild(left);
914+ else // IE6 so need to work around its poor CSS support
916+ this.toolbar.style.position = (this.ie7 ? "fixed" : "absolute");
917+ this.toolbar.style.zIndex = "200";
918+ this.toolbar.style.width = "99.9%";
919+ this.toolbar.style.height = "1.2em";
920+ this.toolbar.style.top = "auto";
921+ this.toolbar.style.bottom = "0";
922+ this.toolbar.style.left = "0";
923+ this.toolbar.style.right = "0";
924+ this.toolbar.style.textAlign = "left";
925+ this.toolbar.style.fontSize = "60%";
926+ this.toolbar.style.color = "red";
927+ this.toolbar.borderWidth = 0;
928+ this.toolbar.className = "toolbar";
929+ this.toolbar.style.background = "rgb(240,240,240)";
931+ // would like to have help text left aligned
932+ // and page counter right aligned, floating
933+ // div's don't work, so instead use nested
934+ // absolutely positioned div's.
936+ var sp = this.create_element("span");
937+ sp.innerHTML = " * ";
938+ this.toolbar.appendChild(sp);
939+ this.eos = sp; // end of slide indicator
941+ var help = this.create_element("a");
942+ help.setAttribute("href", this.help_page);
943+ help.setAttribute("title", this.localize(this.help_text));
944+ help.innerHTML = this.localize("help?");
945+ this.toolbar.appendChild(help);
946+ this.help_anchor = help; // save for focus hack
948+ var gap1 = document.createTextNode(" ");
949+ this.toolbar.appendChild(gap1);
951+ var contents = this.create_element("a");
952+ contents.setAttribute("href", "javascript:toggleTableOfContents()");
953+ contents.setAttribute("title", this.localize("table of contents".localize));
954+ contents.innerHTML = this.localize("contents?");
955+ this.toolbar.appendChild(contents);
957+ var gap2 = document.createTextNode(" ");
958+ this.toolbar.appendChild(gap2);
960+ var copyright = this.find_copyright();
964+ var span = this.create_element("span");
965+ span.innerHTML = copyright;
966+ span.style.color = "black";
967+ span.style.marginLeft = "0.5em";
968+ this.toolbar.appendChild(span);
971+ counter = this.create_element("div")
972+ counter.style.position = "absolute";
973+ counter.style.width = "auto"; //"20%";
974+ counter.style.height = "1.2em";
975+ counter.style.top = "auto";
976+ counter.style.bottom = 0;
977+ counter.style.right = "0";
978+ counter.style.textAlign = "right";
979+ counter.style.color = "red";
980+ counter.style.background = "rgb(240,240,240)";
982+ counter.innerHTML = this.localize("slide") + " n/m";
983+ this.toolbar.appendChild(counter);
986+ // ensure that click isn't passed through to the page
987+ this.toolbar.onclick =
992+ var target = e.target;
994+ if (!target && e.srcElement)
995+ target = e.srcElement;
997+ // work around Safari bug
998+ if (target && target.nodeType == 3)
999+ target = target.parentNode;
1001+ w3c_slidy.stop_propagation(e);
1003+ if (target && target.nodeName.toLowerCase() != "a")
1004+ w3c_slidy.mouse_button_click(e);
1007+ this.slide_number_element = counter;
1008+ this.set_eos_status(false);
1009+ document.body.appendChild(this.toolbar);
1012+ // wysiwyg editors make it hard to use div elements
1013+ // e.g. amaya loses the div when you copy and paste
1014+ // this function wraps div elements around implicit
1015+ // slides which start with an h1 element and continue
1016+ // up to the next heading or div element
1017+ wrap_implicit_slides: function () {
1018+ var i, heading, node, next, div;
1019+ var headings = document.getElementsByTagName("h1");
1024+ for (i = 0; i < headings.length; ++i)
1026+ heading = headings[i];
1028+ if (heading.parentNode != document.body)
1031+ node = heading.nextSibling;
1033+ div = document.createElement("div");
1034+ this.add_class(div, "slide");
1035+ document.body.replaceChild(div, heading);
1036+ div.appendChild(heading);
1040+ if (node.nodeType == 1) // an element
1042+ if (node.nodeName == "H1" || node.nodeName == "h1")
1045+ if (node.nodeName == "DIV" || node.nodeName == "div")
1047+ if (this.has_class(node, "slide"))
1050+ if (this.has_class(node, "handout"))
1055+ next = node.nextSibling;
1056+ node = document.body.removeChild(node);
1057+ div.appendChild(node);
1063+ attach_touch_handers: function(slides)
1067+ for (i = 0; i < slides.length; ++i)
1070+ this.add_listener(slide, "touchstart", this.touchstart);
1071+ this.add_listener(slide, "touchmove", this.touchmove);
1072+ this.add_listener(slide, "touchend", this.touchend);
1076+// return new array of all slides
1077+ collect_slides: function () {
1078+ var slides = new Array();
1079+ var divs = document.body.getElementsByTagName("div");
1081+ for (var i = 0; i < divs.length; ++i)
1083+ div = divs.item(i);
1085+ if (this.has_class(div, "slide"))
1087+ // add slide to collection
1088+ slides[slides.length] = div;
1090+ // hide each slide as it is found
1091+ this.add_class(div, "hidden");
1093+ // add dummy <br/> at end for scrolling hack
1094+ var node1 = document.createElement("br");
1095+ div.appendChild(node1);
1096+ var node2 = document.createElement("br");
1097+ div.appendChild(node2);
1099+ else if (this.has_class(div, "background"))
1100+ { // work around for Firefox SVG reload bug
1101+ // which otherwise replaces 1st SVG graphic with 2nd
1102+ div.style.display = "block";
1106+ this.slides = slides;
1109+ // return new array of all <div class="handout">
1110+ collect_notes: function () {
1111+ var notes = new Array();
1112+ var divs = document.body.getElementsByTagName("div");
1114+ for (var i = 0; i < divs.length; ++i)
1116+ div = divs.item(i);
1118+ if (this.has_class(div, "handout"))
1120+ // add note to collection
1121+ notes[notes.length] = div;
1124+ this.add_class(div, "hidden");
1128+ this.notes = notes;
1131+ // return new array of all <div class="background">
1132+ // including named backgrounds e.g. class="background titlepage"
1133+ collect_backgrounds: function () {
1134+ var backgrounds = new Array();
1135+ var divs = document.body.getElementsByTagName("div");
1137+ for (var i = 0; i < divs.length; ++i)
1139+ div = divs.item(i);
1141+ if (this.has_class(div, "background"))
1143+ // add background to collection
1144+ backgrounds[backgrounds.length] = div;
1147+ this.add_class(div, "hidden");
1151+ this.backgrounds = backgrounds;
1154+ // set click handlers on all anchors
1155+ patch_anchors: function () {
1156+ var self = w3c_slidy;
1157+ var handler = function (event) {
1158+ // compare this.href with location.href
1159+ // for link to another slide in this doc
1161+ if (self.page_address(this.href) == self.page_address(location.href))
1163+ // yes, so find new slide number
1164+ var newslidenum = self.find_slide_number(this.href);
1166+ if (newslidenum != self.slide_number)
1168+ var slide = self.slides[self.slide_number];
1169+ self.hide_slide(slide);
1170+ self.slide_number = newslidenum;
1171+ slide = self.slides[self.slide_number];
1172+ self.show_slide(slide);
1173+ self.set_location();
1177+ w3c_slidy.stop_propagation(event);
1179+// else if (this.target == null)
1180+// location.href = this.href;
1183+ self.disable_slide_click = true;
1186+ var anchors = document.body.getElementsByTagName("a");
1188+ for (var i = 0; i < anchors.length; ++i)
1190+ if (window.addEventListener)
1191+ anchors[i].addEventListener("click", handler, false);
1193+ anchors[i].attachEvent("onclick", handler);
1197+ // ### CHECK ME ### see which functions are invoked via setTimeout
1198+ // either directly or indirectly for use of w3c_slidy vs this
1199+ show_slide_number: function () {
1200+ var timer = w3c_slidy.get_timer();
1201+ w3c_slidy.slide_number_element.innerHTML = timer + w3c_slidy.localize("slide") + " " +
1202+ (w3c_slidy.slide_number + 1) + "/" + w3c_slidy.slides.length;
1205+ // every 200mS check if the location has been changed as a
1206+ // result of the user activating the Back button/menu item
1207+ // doesn't work for Opera < 9.5
1208+ check_location: function () {
1209+ var hash = location.hash;
1211+ if (w3c_slidy.slide_number > 0 && (hash == "" || hash == "#"))
1212+ w3c_slidy.goto_slide(0);
1213+ else if (hash.length > 2 && hash != "#("+(w3c_slidy.slide_number+1)+")")
1215+ var num = parseInt(location.hash.substr(2));
1218+ w3c_slidy.goto_slide(num-1);
1221+ if (w3c_slidy.time_left && w3c_slidy.slide_number > 0)
1223+ w3c_slidy.show_slide_number();
1225+ if (w3c_slidy.time_left > 0)
1226+ w3c_slidy.time_left -= 200;
1230+ get_timer: function () {
1232+ if (w3c_slidy.time_left)
1235+ secs = Math.floor(w3c_slidy.time_left/1000);
1236+ mins = Math.floor(secs / 60);
1238+ timer = (mins ? mins+"m" : "") + secs + "s ";
1244+ // this doesn't push location onto history stack for IE
1245+ // for which a hidden iframe hack is needed: load page into
1246+ // the iframe with script that set's parent's location.hash
1247+ // but that won't work for standalone use unless we can
1248+ // create the page dynamically via a javascript: URL
1249+ // ### use history.pushState if available
1250+ set_location: function () {
1251+ var uri = w3c_slidy.page_address(location.href);
1252+ var hash = "#(" + (w3c_slidy.slide_number+1) + ")";
1254+ if (w3c_slidy.slide_number >= 0)
1257+ if (typeof(history.pushState) != "undefined")
1259+ document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
1260+ history.pushState(0, document.title, hash);
1261+ w3c_slidy.show_slide_number();
1265+ if (w3c_slidy.ie && (w3c_slidy.ie6 || w3c_slidy.ie7))
1266+ w3c_slidy.push_hash(hash);
1268+ if (uri != location.href) // && !khtml
1269+ location.href = uri;
1272+ hash = "(" + (w3c_slidy.slide_number+1) + ")";
1274+ if (!this.ie && location.hash != hash && location.hash != "")
1275+ location.hash = hash;
1277+ document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
1278+ w3c_slidy.show_slide_number();
1281+ page_address: function (uri) {
1282+ var i = uri.indexOf("#");
1285+ i = uri.indexOf("%23");
1287+ // check if anchor is entire page
1292+ return uri.substr(0, i);
1295+ // only used for IE6 and IE7
1296+ on_frame_loaded: function (hash) {
1297+ location.hash = hash;
1298+ var uri = w3c_slidy.page_address(location.href);
1299+ location.href = uri + hash;
1302+ // history hack with thanks to Bertrand Le Roy
1303+ push_hash: function (hash) {
1304+ if (hash == "") hash = "#(1)";
1305+ window.location.hash = hash;
1307+ var doc = document.getElementById("historyFrame").contentWindow.document;
1308+ doc.open("javascript:'<html></html>'");
1309+ doc.write("<html><head><script type=\"text/javascript\">window.parent.w3c_slidy.on_frame_loaded('"+
1310+ (hash) + "');</script></head><body>hello mum</body></html>");
1314+ // find current slide based upon location
1315+ // first find target anchor and then look
1316+ // for associated div element enclosing it
1317+ // finally map that to slide number
1318+ find_slide_number: function (uri) {
1319+ // first get anchor from page location
1321+ var i = uri.indexOf("#");
1323+ // check if anchor is entire page
1327+ var anchor = unescape(uri.substr(i+1));
1329+ // now use anchor as XML ID to find target
1330+ var target = document.getElementById(anchor);
1334+ // does anchor look like "(2)" for slide 2 ??
1335+ // where first slide is (1)
1336+ var re = /\((\d)+\)/;
1338+ if (anchor.match(re))
1340+ var num = parseInt(anchor.substring(1, anchor.length-1));
1342+ if (num > this.slides.length)
1351+ // accept [2] for backwards compatibility
1354+ if (anchor.match(re))
1356+ var num = parseInt(anchor.substring(1, anchor.length-1));
1358+ if (num > this.slides.length)
1367+ // oh dear unknown anchor
1371+ // search for enclosing slide
1375+ // browser coerces html elements to uppercase!
1376+ if (target.nodeName.toLowerCase() == "div" &&
1377+ this.has_class(target, "slide"))
1379+ // found the slide element
1383+ // otherwise try parent element if any
1385+ target = target.parentNode;
1389+ return 0; // no luck!
1393+ for (i = 0; i < slides.length; ++i)
1395+ if (slides[i] == target)
1396+ return i; // success
1399+ // oh dear still no luck
1403+ previous_slide: function (incremental) {
1404+ if (!w3c_slidy.view_all)
1408+ if ((incremental || w3c_slidy.slide_number == 0) && w3c_slidy.last_shown != null)
1410+ w3c_slidy.last_shown = w3c_slidy.hide_previous_item(w3c_slidy.last_shown);
1411+ w3c_slidy.set_eos_status(false);
1413+ else if (w3c_slidy.slide_number > 0)
1415+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1416+ w3c_slidy.hide_slide(slide);
1418+ w3c_slidy.slide_number = w3c_slidy.slide_number - 1;
1419+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1420+ w3c_slidy.set_visibility_all_incremental("visible");
1421+ w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
1422+ w3c_slidy.set_eos_status(true);
1423+ w3c_slidy.show_slide(slide);
1426+ w3c_slidy.set_location();
1428+ if (!w3c_slidy.ns_pos)
1429+ w3c_slidy.refresh_toolbar(200);
1433+ next_slide: function (incremental) {
1434+ if (!w3c_slidy.view_all)
1436+ var slide, last = w3c_slidy.last_shown;
1438+ if (incremental || w3c_slidy.slide_number == w3c_slidy.slides.length - 1)
1439+ w3c_slidy.last_shown = w3c_slidy.reveal_next_item(w3c_slidy.last_shown);
1441+ if ((!incremental || w3c_slidy.last_shown == null) &&
1442+ w3c_slidy.slide_number < w3c_slidy.slides.length - 1)
1444+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1445+ w3c_slidy.hide_slide(slide);
1447+ w3c_slidy.slide_number = w3c_slidy.slide_number + 1;
1448+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1449+ w3c_slidy.last_shown = null;
1450+ w3c_slidy.set_visibility_all_incremental("hidden");
1451+ w3c_slidy.show_slide(slide);
1453+ else if (!w3c_slidy.last_shown)
1455+ if (last && incremental)
1456+ w3c_slidy.last_shown = last;
1459+ w3c_slidy.set_location();
1461+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1463+ if (!w3c_slidy.ns_pos)
1464+ w3c_slidy.refresh_toolbar(200);
1468+ // to first slide with nothing revealed
1469+ // i.e. state at start of presentation
1470+ first_slide: function () {
1471+ if (!w3c_slidy.view_all)
1475+ if (w3c_slidy.slide_number != 0)
1477+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1478+ w3c_slidy.hide_slide(slide);
1480+ w3c_slidy.slide_number = 0;
1481+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1482+ w3c_slidy.last_shown = null;
1483+ w3c_slidy.set_visibility_all_incremental("hidden");
1484+ w3c_slidy.show_slide(slide);
1487+ w3c_slidy.set_eos_status(
1488+ !w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1489+ w3c_slidy.set_location();
1493+ // goto last slide with everything revealed
1494+ // i.e. state at end of presentation
1495+ last_slide: function () {
1496+ if (!w3c_slidy.view_all)
1500+ w3c_slidy.last_shown = null; //revealNextItem(lastShown);
1502+ if (w3c_slidy.last_shown == null &&
1503+ w3c_slidy.slide_number < w3c_slidy.slides.length - 1)
1505+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1506+ w3c_slidy.hide_slide(slide);
1507+ w3c_slidy.slide_number = w3c_slidy.slides.length - 1;
1508+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1509+ w3c_slidy.set_visibility_all_incremental("visible");
1510+ w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
1512+ w3c_slidy.show_slide(slide);
1516+ w3c_slidy.set_visibility_all_incremental("visible");
1517+ w3c_slidy.last_shown = w3c_slidy.previous_incremental_item(null);
1520+ w3c_slidy.set_eos_status(true);
1521+ w3c_slidy.set_location();
1526+ // ### check this and consider add/remove class
1527+ set_eos_status: function (state) {
1529+ this.eos.style.color = (state ? "rgb(240,240,240)" : "red");
1532+ // first slide is 0
1533+ goto_slide: function (num) {
1534+ //alert("going to slide " + (num+1));
1535+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1536+ w3c_slidy.hide_slide(slide);
1537+ w3c_slidy.slide_number = num;
1538+ slide = w3c_slidy.slides[w3c_slidy.slide_number];
1539+ w3c_slidy.last_shown = null;
1540+ w3c_slidy.set_visibility_all_incremental("hidden");
1541+ w3c_slidy.set_eos_status(!w3c_slidy.next_incremental_item(w3c_slidy.last_shown));
1542+ document.title = w3c_slidy.title + " (" + (w3c_slidy.slide_number+1) + ")";
1543+ w3c_slidy.show_slide(slide);
1544+ w3c_slidy.show_slide_number();
1548+ show_slide: function (slide) {
1549+ this.sync_background(slide);
1550+ this.remove_class(slide, "hidden");
1552+ // work around IE9 object rendering bug
1553+ setTimeout("window.scrollTo(0,0);", 1);
1556+ hide_slide: function (slide) {
1557+ this.add_class(slide, "hidden");
1560+ // show just the backgrounds pertinent to this slide
1561+ // when slide background-color is transparent
1562+ // this should now work with rgba color values
1563+ sync_background: function (slide) {
1567+ if (slide.currentStyle)
1568+ bgColor = slide.currentStyle["backgroundColor"];
1569+ else if (document.defaultView)
1571+ var styles = document.defaultView.getComputedStyle(slide,null);
1574+ bgColor = styles.getPropertyValue("background-color");
1575+ else // broken implementation probably due Safari or Konqueror
1577+ //alert("defective implementation of getComputedStyle()");
1578+ bgColor = "transparent";
1582+ bgColor == "transparent";
1584+ if (bgColor == "transparent" ||
1585+ bgColor.indexOf("rgba") >= 0 ||
1586+ bgColor.indexOf("opacity") >= 0)
1588+ var slideClass = this.get_class_list(slide);
1590+ for (var i = 0; i < this.backgrounds.length; i++)
1592+ background = this.backgrounds[i];
1594+ var bgClass = this.get_class_list(background);
1596+ if (this.matching_background(slideClass, bgClass))
1597+ this.remove_class(background, "hidden");
1599+ this.add_class(background, "hidden");
1602+ else // forcibly hide all backgrounds
1603+ this.hide_backgrounds();
1606+ hide_backgrounds: function () {
1607+ for (var i = 0; i < this.backgrounds.length; i++)
1609+ background = this.backgrounds[i];
1610+ this.add_class(background, "hidden");
1614+ // compare classes for slide and background
1615+ matching_background: function (slideClass, bgClass) {
1616+ var i, count, pattern, result;
1618+ // define pattern as regular expression
1621+ // check background class names
1622+ result = bgClass.match(pattern);
1624+ for (i = count = 0; i < result.length; i++)
1626+ if (result[i] == "hidden")
1629+ if (result[i] == "background")
1635+ if (count == 0) // default match
1638+ // check for matches and place result in array
1639+ result = slideClass.match(pattern);
1641+ // now check if desired name is present for background
1642+ for (i = count = 0; i < result.length; i++)
1644+ if (result[i] == "hidden")
1647+ if (this.has_token(bgClass, result[i]))
1654+ resized: function () {
1657+ if ( typeof( window.innerWidth ) == 'number' )
1658+ width = window.innerWidth; // Non IE browser
1659+ else if (document.documentElement && document.documentElement.clientWidth)
1660+ width = document.documentElement.clientWidth; // IE6
1661+ else if (document.body && document.body.clientWidth)
1662+ width = document.body.clientWidth; // IE4
1666+ if ( typeof( window.innerHeight ) == 'number' )
1667+ height = window.innerHeight; // Non IE browser
1668+ else if (document.documentElement && document.documentElement.clientHeight)
1669+ height = document.documentElement.clientHeight; // IE6
1670+ else if (document.body && document.body.clientHeight)
1671+ height = document.body.clientHeight; // IE4
1673+ if (height && (width/height > 1.05*1024/768))
1675+ width = height * 1024.0/768;
1678+ // IE fires onresize even when only font size is changed!
1679+ // so we do a check to avoid blocking < and > actions
1680+ if (width != w3c_slidy.last_width || height != w3c_slidy.last_height)
1683+ w3c_slidy.size_index = 5; // 4
1684+ else if (width >= 1000)
1685+ w3c_slidy.size_index = 4; // 3
1686+ else if (width >= 800)
1687+ w3c_slidy.size_index = 3; // 2
1688+ else if (width >= 600)
1689+ w3c_slidy.size_index = 2; // 1
1691+ w3c_slidy.size_index = 0;
1693+ // add in font size adjustment from meta element e.g.
1694+ // <meta name="font-size-adjustment" content="-2" />
1695+ // useful when slides have too much content ;-)
1697+ if (0 <= w3c_slidy.size_index + w3c_slidy.size_adjustment &&
1698+ w3c_slidy.size_index + w3c_slidy.size_adjustment < w3c_slidy.sizes.length)
1699+ w3c_slidy.size_index = w3c_slidy.size_index + w3c_slidy.size_adjustment;
1701+ // enables cross browser use of relative width/height
1702+ // on object elements for use with SVG and Flash media
1703+ w3c_slidy.adjust_object_dimensions(width, height);
1705+ if (document.body.style.fontSize != w3c_slidy.sizes[w3c_slidy.size_index])
1707+ document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
1710+ w3c_slidy.last_width = width;
1711+ w3c_slidy.last_height = height;
1713+ // force reflow to work around Mozilla bug
1714+ if (w3c_slidy.ns_pos)
1716+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1717+ w3c_slidy.hide_slide(slide);
1718+ w3c_slidy.show_slide(slide);
1721+ // force correct positioning of toolbar
1722+ w3c_slidy.refresh_toolbar(200);
1726+ scrolled: function () {
1727+ if (w3c_slidy.toolbar && !w3c_slidy.ns_pos && !w3c_slidy.ie7)
1729+ w3c_slidy.hack_offset = w3c_slidy.scroll_x_offset();
1731+ w3c_slidy.toolbar.style.display = "none";
1733+ // make it reappear later
1734+ if (w3c_slidy.scrollhack == 0 && !w3c_slidy.view_all)
1736+ setTimeout(function () {w3c_slidy.show_toolbar(); }, 1000);
1737+ w3c_slidy.scrollhack = 1;
1742+ hide_toolbar: function () {
1743+ w3c_slidy.add_class(w3c_slidy.toolbar, "hidden");
1747+ // used to ensure IE refreshes toolbar in correct position
1748+ refresh_toolbar: function (interval) {
1749+ if (!w3c_slidy.ns_pos && !w3c_slidy.ie7)
1751+ w3c_slidy.hide_toolbar();
1752+ setTimeout(function () {w3c_slidy.show_toolbar();}, interval);
1756+ // restores toolbar after short delay
1757+ show_toolbar: function () {
1758+ if (w3c_slidy.want_toolbar)
1760+ w3c_slidy.toolbar.style.display = "block";
1762+ if (!w3c_slidy.ns_pos)
1764+ // adjust position to allow for scrolling
1765+ var xoffset = w3c_slidy.scroll_x_offset();
1766+ w3c_slidy.toolbar.style.left = xoffset;
1767+ w3c_slidy.toolbar.style.right = xoffset;
1769+ // determine vertical scroll offset
1770+ //var yoffset = scrollYOffset();
1772+ // bottom is doc height - window height - scroll offset
1773+ //var bottom = documentHeight() - lastHeight - yoffset
1775+ //if (yoffset > 0 || documentHeight() > lastHeight)
1776+ // bottom += 16; // allow for height of scrollbar
1778+ w3c_slidy.toolbar.style.bottom = 0; //bottom;
1781+ w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden");
1784+ w3c_slidy.scrollhack = 0;
1787+ // set the keyboard focus to the help link on the
1788+ // toolbar to ensure that document has the focus
1789+ // IE doesn't always work with window.focus()
1790+ // and this hack has benefit of Enter for help
1794+ if (!w3c_slidy.opera)
1795+ w3c_slidy.help_anchor.focus();
1802+// invoked via F key
1803+ toggle_toolbar: function () {
1804+ if (!w3c_slidy.view_all)
1806+ if (w3c_slidy.has_class(w3c_slidy.toolbar, "hidden"))
1808+ w3c_slidy.remove_class(w3c_slidy.toolbar, "hidden")
1809+ w3c_slidy.want_toolbar = 1;
1813+ w3c_slidy.add_class(w3c_slidy.toolbar, "hidden")
1814+ w3c_slidy.want_toolbar = 0;
1819+ scroll_x_offset: function () {
1820+ if (window.pageXOffset)
1821+ return self.pageXOffset;
1823+ if (document.documentElement &&
1824+ document.documentElement.scrollLeft)
1825+ return document.documentElement.scrollLeft;
1828+ return document.body.scrollLeft;
1833+ scroll_y_offset: function () {
1834+ if (window.pageYOffset)
1835+ return self.pageYOffset;
1837+ if (document.documentElement &&
1838+ document.documentElement.scrollTop)
1839+ return document.documentElement.scrollTop;
1842+ return document.body.scrollTop;
1847+ // looking for a way to determine height of slide content
1848+ // the slide itself is set to the height of the window
1849+ optimize_font_size: function () {
1850+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1852+ //var dh = documentHeight(); //getDocHeight(document);
1853+ var dh = slide.scrollHeight;
1854+ var wh = getWindowHeight();
1855+ var u = 100 * dh / wh;
1857+ alert("window utilization = " + u + "% (doc "
1858+ + dh + " win " + wh + ")");
1861+ // from document object
1862+ get_doc_height: function (doc) {
1866+ if (doc && doc.body && doc.body.offsetHeight)
1867+ return doc.body.offsetHeight; // ns/gecko syntax
1869+ if (doc && doc.body && doc.body.scrollHeight)
1870+ return doc.body.scrollHeight;
1872+ alert("couldn't determine document height");
1875+ get_window_height: function () {
1876+ if ( typeof( window.innerHeight ) == 'number' )
1877+ return window.innerHeight; // Non IE browser
1879+ if (document.documentElement && document.documentElement.clientHeight)
1880+ return document.documentElement.clientHeight; // IE6
1882+ if (document.body && document.body.clientHeight)
1883+ return document.body.clientHeight; // IE4
1886+ document_height: function () {
1889+ sh = document.body.scrollHeight;
1890+ oh = document.body.offsetHeight;
1894+ return (sh > oh ? sh : oh);
1901+ smaller: function () {
1902+ if (w3c_slidy.size_index > 0)
1904+ --w3c_slidy.size_index;
1907+ w3c_slidy.toolbar.style.display = "none";
1908+ document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
1909+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1910+ w3c_slidy.hide_slide(slide);
1911+ w3c_slidy.show_slide(slide);
1912+ setTimeout(function () {w3c_slidy.show_toolbar(); }, 50);
1915+ bigger: function () {
1916+ if (w3c_slidy.size_index < w3c_slidy.sizes.length - 1)
1918+ ++w3c_slidy.size_index;
1921+ w3c_slidy.toolbar.style.display = "none";
1922+ document.body.style.fontSize = w3c_slidy.sizes[w3c_slidy.size_index];
1923+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
1924+ w3c_slidy.hide_slide(slide);
1925+ w3c_slidy.show_slide(slide);
1926+ setTimeout(function () {w3c_slidy.show_toolbar(); }, 50);
1929+ // enables cross browser use of relative width/height
1930+ // on object elements for use with SVG and Flash media
1931+ // with thanks to Ivan Herman for the suggestion
1932+ adjust_object_dimensions: function (width, height) {
1933+ for( var i = 0; i < w3c_slidy.objects.length; i++ )
1935+ var obj = this.objects[i];
1936+ var mimeType = obj.getAttribute("type");
1938+ if (mimeType == "image/svg+xml" || mimeType == "application/x-shockwave-flash")
1940+ if ( !obj.initialWidth )
1941+ obj.initialWidth = obj.getAttribute("width");
1943+ if ( !obj.initialHeight )
1944+ obj.initialHeight = obj.getAttribute("height");
1946+ if ( obj.initialWidth && obj.initialWidth.charAt(obj.initialWidth.length-1) == "%" )
1948+ var w = parseInt(obj.initialWidth.slice(0, obj.initialWidth.length-1));
1949+ var newW = width * (w/100.0);
1950+ obj.setAttribute("width",newW);
1953+ if ( obj.initialHeight &&
1954+ obj.initialHeight.charAt(obj.initialHeight.length-1) == "%" )
1956+ var h = parseInt(obj.initialHeight.slice(0, obj.initialHeight.length-1));
1957+ var newH = height * (h/100.0);
1958+ obj.setAttribute("height", newH);
1964+ // needed for Opera to inhibit default behavior
1965+ // since Opera delivers keyPress even if keyDown
1967+ key_press: function (event) {
1969+ event = window.event;
1971+ if (!w3c_slidy.key_wanted)
1972+ return w3c_slidy.cancel(event);
1977+ // See e.g. http://www.quirksmode.org/js/events/keys.html for keycodes
1978+ key_down: function (event) {
1979+ var key, target, tag;
1981+ w3c_slidy.key_wanted = true;
1984+ event = window.event;
1986+ // kludge around NS/IE differences
1989+ key = window.event.keyCode;
1990+ target = window.event.srcElement;
1992+ else if (event.which)
1995+ target = event.target;
1998+ return true; // Yikes! unknown browser
2000+ // ignore event if key value is zero
2001+ // as for alt on Opera and Konqueror
2005+ // avoid interfering with keystroke
2006+ // behavior for non-slidy chrome elements
2007+ if (!w3c_slidy.slidy_chrome(target) &&
2008+ w3c_slidy.special_element(target))
2011+ // check for concurrent control/command/alt key
2012+ // but are these only present on mouse events?
2014+ if (event.ctrlKey || event.altKey || event.metaKey)
2017+ // dismiss table of contents if visible
2018+ if (w3c_slidy.is_shown_toc() && key != 9 && key != 16 && key != 38 && key != 40)
2020+ w3c_slidy.hide_table_of_contents(true);
2022+ if (key == 27 || key == 84 || key == 67)
2023+ return w3c_slidy.cancel(event);
2026+ if (key == 34) // Page Down
2028+ if (w3c_slidy.view_all)
2031+ w3c_slidy.next_slide(false);
2032+ return w3c_slidy.cancel(event);
2034+ else if (key == 33) // Page Up
2036+ if (w3c_slidy.view_all)
2039+ w3c_slidy.previous_slide(false);
2040+ return w3c_slidy.cancel(event);
2042+ else if (key == 32) // space bar
2044+ w3c_slidy.next_slide(true);
2045+ return w3c_slidy.cancel(event);
2047+ else if (key == 37) // Left arrow
2049+ w3c_slidy.previous_slide(!event.shiftKey);
2050+ return w3c_slidy.cancel(event);
2052+ else if (key == 36) // Home
2054+ w3c_slidy.first_slide();
2055+ return w3c_slidy.cancel(event);
2057+ else if (key == 35) // End
2059+ w3c_slidy.last_slide();
2060+ return w3c_slidy.cancel(event);
2062+ else if (key == 39) // Right arrow
2064+ w3c_slidy.next_slide(!event.shiftKey);
2065+ return w3c_slidy.cancel(event);
2067+ else if (key == 13) // Enter
2069+ if (w3c_slidy.outline)
2071+ if (w3c_slidy.outline.visible)
2072+ w3c_slidy.fold(w3c_slidy.outline);
2074+ w3c_slidy.unfold(w3c_slidy.outline);
2076+ return w3c_slidy.cancel(event);
2079+ else if (key == 188) // < for smaller fonts
2081+ w3c_slidy.smaller();
2082+ return w3c_slidy.cancel(event);
2084+ else if (key == 190) // > for larger fonts
2086+ w3c_slidy.bigger();
2087+ return w3c_slidy.cancel(event);
2089+ else if (key == 189 || key == 109) // - for smaller fonts
2091+ w3c_slidy.smaller();
2092+ return w3c_slidy.cancel(event);
2094+ else if (key == 187 || key == 191 || key == 107) // = + for larger fonts
2096+ w3c_slidy.bigger();
2097+ return w3c_slidy.cancel(event);
2099+ else if (key == 83) // S for smaller fonts
2101+ w3c_slidy.smaller();
2102+ return w3c_slidy.cancel(event);
2104+ else if (key == 66) // B for larger fonts
2106+ w3c_slidy.bigger();
2107+ return w3c_slidy.cancel(event);
2109+ else if (key == 90) // Z for last slide
2111+ w3c_slidy.last_slide();
2112+ return w3c_slidy.cancel(event);
2114+ else if (key == 70) // F for toggle toolbar
2116+ w3c_slidy.toggle_toolbar();
2117+ return w3c_slidy.cancel(event);
2119+ else if (key == 65) // A for toggle view single/all slides
2121+ w3c_slidy.toggle_view();
2122+ return w3c_slidy.cancel(event);
2124+ else if (key == 75) // toggle action of left click for next page
2126+ w3c_slidy.mouse_click_enabled = !w3c_slidy.mouse_click_enabled;
2127+ var alert_msg = (w3c_slidy.mouse_click_enabled ?
2128+ "enabled" : "disabled") + " mouse click advance";
2130+ alert(w3c_slidy.localize(alert_msg));
2131+ return w3c_slidy.cancel(event);
2133+ else if (key == 84 || key == 67) // T or C for table of contents
2136+ w3c_slidy.toggle_table_of_contents();
2138+ return w3c_slidy.cancel(event);
2140+ else if (key == 72) // H for help
2142+ window.location = w3c_slidy.help_page;
2143+ return w3c_slidy.cancel(event);
2145+ //else alert("key code is "+ key);
2150+ // safe for both text/html and application/xhtml+xml
2151+ create_element: function (name) {
2152+ if (this.xhtml && (typeof document.createElementNS != 'undefined'))
2153+ return document.createElementNS("http://www.w3.org/1999/xhtml", name)
2155+ return document.createElement(name);
2158+ get_element_style: function (elem, IEStyleProp, CSSStyleProp) {
2159+ if (elem.currentStyle)
2161+ return elem.currentStyle[IEStyleProp];
2163+ else if (window.getComputedStyle)
2165+ var compStyle = window.getComputedStyle(elem, "");
2166+ return compStyle.getPropertyValue(CSSStyleProp);
2171+ // the string str is a whitespace separated list of tokens
2172+ // test if str contains a particular token, e.g. "slide"
2173+ has_token: function (str, token) {
2176+ // define pattern as regular expression
2177+ var pattern = /\w+/g;
2179+ // check for matches
2180+ // place result in array
2181+ var result = str.match(pattern);
2183+ // now check if desired token is present
2184+ for (var i = 0; i < result.length; i++)
2186+ if (result[i] == token)
2194+ get_class_list: function (element) {
2195+ if (typeof element.className != 'undefined')
2196+ return element.className;
2198+ return element.getAttribute("class");
2201+ has_class: function (element, name) {
2202+ if (element.nodeType != 1)
2205+ var regexp = new RegExp("(^| )" + name + "\W*");
2207+ if (typeof element.className != 'undefined')
2208+ return regexp.test(element.className);
2210+ return regexp.test(element.getAttribute("class"));
2213+ remove_class: function (element, name) {
2214+ var regexp = new RegExp("(^| )" + name + "\W*");
2217+ if (typeof element.className != 'undefined')
2219+ clsval = element.className;
2223+ clsval = clsval.replace(regexp, "");
2224+ element.className = clsval;
2229+ clsval = element.getAttribute("class");
2233+ clsval = clsval.replace(regexp, "");
2234+ element.setAttribute("class", clsval);
2239+ add_class: function (element, name) {
2240+ if (!this.has_class(element, name))
2242+ if (typeof element.className != 'undefined')
2243+ element.className += " " + name;
2246+ var clsval = element.getAttribute("class");
2247+ clsval = clsval ? clsval + " " + name : name;
2248+ element.setAttribute("class", clsval);
2253+ // HTML elements that can be used with class="incremental"
2254+ // note that you can also put the class on containers like
2255+ // up, ol, dl, and div to make their contents appear
2256+ // incrementally. Upper case is used since this is what
2257+ // browsers report for HTML node names (text/html).
2258+ incremental_elements: null,
2259+ okay_for_incremental: function (name) {
2260+ if (!this.incremental_elements)
2262+ var inclist = new Array();
2263+ inclist["p"] = true;
2264+ inclist["pre"] = true;
2265+ inclist["li"] = true;
2266+ inclist["blockquote"] = true;
2267+ inclist["dt"] = true;
2268+ inclist["dd"] = true;
2269+ inclist["h2"] = true;
2270+ inclist["h3"] = true;
2271+ inclist["h4"] = true;
2272+ inclist["h5"] = true;
2273+ inclist["h6"] = true;
2274+ inclist["span"] = true;
2275+ inclist["address"] = true;
2276+ inclist["table"] = true;
2277+ inclist["tr"] = true;
2278+ inclist["th"] = true;
2279+ inclist["td"] = true;
2280+ inclist["img"] = true;
2281+ inclist["object"] = true;
2282+ this.incremental_elements = inclist;
2284+ return this.incremental_elements[name.toLowerCase()];
2287+ next_incremental_item: function (node) {
2288+ var br = this.is_xhtml ? "br" : "BR";
2289+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
2293+ node = w3c_slidy.next_node(slide, node);
2295+ if (node == null || node.parentNode == null)
2298+ if (node.nodeType == 1) // ELEMENT
2300+ if (node.nodeName == br)
2303+ if (w3c_slidy.has_class(node, "incremental")
2304+ && w3c_slidy.okay_for_incremental(node.nodeName))
2307+ if (w3c_slidy.has_class(node.parentNode, "incremental")
2308+ && !w3c_slidy.has_class(node, "non-incremental"))
2316+ previous_incremental_item: function (node) {
2317+ var br = this.is_xhtml ? "br" : "BR";
2318+ var slide = w3c_slidy.slides[w3c_slidy.slide_number];
2322+ node = w3c_slidy.previous_node(slide, node);
2324+ if (node == null || node.parentNode == null)
2327+ if (node.nodeType == 1)
2329+ if (node.nodeName == br)
2332+ if (w3c_slidy.has_class(node, "incremental")
2333+ && w3c_slidy.okay_for_incremental(node.nodeName))
2336+ if (w3c_slidy.has_class(node.parentNode, "incremental")
2337+ && !w3c_slidy.has_class(node, "non-incremental"))
2345+ // set visibility for all elements on current slide with
2346+ // a parent element with attribute class="incremental"
2347+ set_visibility_all_incremental: function (value) {
2348+ var node = this.next_incremental_item(null);
2350+ if (value == "hidden")
2354+ w3c_slidy.add_class(node, "invisible");
2355+ node = w3c_slidy.next_incremental_item(node);
2358+ else // value == "visible"
2362+ w3c_slidy.remove_class(node, "invisible");
2363+ node = w3c_slidy.next_incremental_item(node);
2368+ // reveal the next hidden item on the slide
2369+ // node is null or the node that was last revealed
2370+ reveal_next_item: function (node) {
2371+ node = w3c_slidy.next_incremental_item(node);
2373+ if (node && node.nodeType == 1) // an element
2374+ w3c_slidy.remove_class(node, "invisible");
2379+ // exact inverse of revealNextItem(node)
2380+ hide_previous_item: function (node) {
2381+ if (node && node.nodeType == 1) // an element
2382+ w3c_slidy.add_class(node, "invisible");
2384+ return this.previous_incremental_item(node);
2387+ // left to right traversal of root's content
2388+ next_node: function (root, node) {
2390+ return root.firstChild;
2392+ if (node.firstChild)
2393+ return node.firstChild;
2395+ if (node.nextSibling)
2396+ return node.nextSibling;
2400+ node = node.parentNode;
2402+ if (!node || node == root)
2405+ if (node && node.nextSibling)
2406+ return node.nextSibling;
2412+ // right to left traversal of root's content
2413+ previous_node: function (root, node) {
2416+ node = root.lastChild;
2420+ while (node.lastChild)
2421+ node = node.lastChild;
2427+ if (node.previousSibling)
2429+ node = node.previousSibling;
2431+ while (node.lastChild)
2432+ node = node.lastChild;
2437+ if (node.parentNode != root)
2438+ return node.parentNode;
2443+ previous_sibling_element: function (el) {
2444+ el = el.previousSibling;
2446+ while (el && el.nodeType != 1)
2447+ el = el.previousSibling;
2452+ next_sibling_element: function (el) {
2453+ el = el.nextSibling;
2455+ while (el && el.nodeType != 1)
2456+ el = el.nextSibling;
2461+ first_child_element: function (el) {
2464+ for (node = el.firstChild; node; node = node.nextSibling)
2466+ if (node.nodeType == 1)
2473+ first_tag: function (element, tag) {
2476+ if (!this.is_xhtml)
2477+ tag = tag.toUpperCase();
2479+ for (node = element.firstChild; node; node = node.nextSibling)
2481+ if (node.nodeType == 1 && node.nodeName == tag)
2488+ hide_selection: function () {
2489+ if (window.getSelection) // Firefox, Chromium, Safari, Opera
2491+ var selection = window.getSelection();
2493+ if (selection.rangeCount > 0)
2495+ var range = selection.getRangeAt(0);
2496+ range.collapse (false);
2499+ else // Internet Explorer
2501+ var textRange = document.selection.createRange ();
2502+ textRange.collapse (false);
2506+ get_selected_text: function () {
2509+ if (window.getSelection)
2510+ return window.getSelection().toString();
2512+ if (document.getSelection)
2513+ return document.getSelection().toString();
2515+ if (document.selection)
2516+ return document.selection.createRange().text;
2525+ // make note of length of selected text
2526+ // as this evaluates to zero in click event
2527+ mouse_button_up: function (e) {
2528+ w3c_slidy.selected_text_len = w3c_slidy.get_selected_text().length;
2531+ mouse_button_down: function (e) {
2532+ w3c_slidy.selected_text_len = w3c_slidy.get_selected_text().length;
2533+ w3c_slidy.mouse_x = e.clientX;
2534+ w3c_slidy.mouse_y = e.clientY;
2537+ // right mouse button click is reserved for context menus
2538+ // it is more reliable to detect rightclick than leftclick
2539+ mouse_button_click: function (e) {
2541+ var e = window.event;
2543+ if (Math.abs(e.clientX -w3c_slidy.mouse_x) +
2544+ Math.abs(e.clientY -w3c_slidy.mouse_y) > 10)
2547+ if (w3c_slidy.selected_text_len > 0)
2550+ var rightclick = false;
2551+ var leftclick = false;
2552+ var middleclick = false;
2556+ var e = window.event;
2560+ else if (e.srcElement)
2561+ target = e.srcElement;
2563+ // work around Safari bug
2564+ if (target.nodeType == 3)
2565+ target = target.parentNode;
2567+ if (e.which) // all browsers except IE
2569+ leftclick = (e.which == 1);
2570+ middleclick = (e.which == 2);
2571+ rightclick = (e.which == 3);
2575+ // Konqueror gives 1 for left, 4 for middle
2576+ // IE6 gives 0 for left and not 1 as I expected
2579+ middleclick = true;
2581+ // all browsers agree on 2 for right button
2582+ rightclick = (e.button == 2);
2587+ if (w3c_slidy.selected_text_len > 0)
2589+ w3c_slidy.stop_propagation(e);
2591+ e.returnValue = false;
2595+ // dismiss table of contents
2596+ w3c_slidy.hide_table_of_contents(false);
2598+ // check if target is something that probably want's clicks
2599+ // e.g. a, embed, object, input, textarea, select, option
2600+ var tag = target.nodeName.toLowerCase();
2602+ if (w3c_slidy.mouse_click_enabled && leftclick &&
2603+ !w3c_slidy.special_element(target) &&
2606+ w3c_slidy.next_slide(true);
2607+ w3c_slidy.stop_propagation(e);
2609+ e.returnValue = false;
2616+ special_element: function (element) {
2617+ if (this.has_class(element, "non-interactive"))
2620+ var tag = element.nodeName.toLowerCase();
2622+ return element.onkeydown ||
2632+ tag == "textarea" ||
2637+ slidy_chrome: function (el) {
2640+ if (el == w3c_slidy.toc ||
2641+ el == w3c_slidy.toolbar ||
2642+ w3c_slidy.has_class(el, "outline"))
2645+ el = el.parentNode;
2651+ get_key: function (e)
2655+ // kludge around NS/IE differences
2656+ if (typeof window.event != "undefined")
2657+ key = window.event.keyCode;
2664+ get_target: function (e) {
2672+ else if (e.srcElement)
2673+ target = e.srcElement;
2675+ if (target.nodeType != 1)
2676+ target = target.parentNode;
2681+ // does display property provide correct defaults?
2682+ is_block: function (elem) {
2683+ var tag = elem.nodeName.toLowerCase();
2685+ return tag == "ol" || tag == "ul" || tag == "p" ||
2686+ tag == "li" || tag == "table" || tag == "pre" ||
2687+ tag == "h1" || tag == "h2" || tag == "h3" ||
2688+ tag == "h4" || tag == "h5" || tag == "h6" ||
2689+ tag == "blockquote" || tag == "address";
2692+ add_listener: function (element, event, handler) {
2693+ if (window.addEventListener)
2694+ element.addEventListener(event, handler, false);
2696+ element.attachEvent("on"+event, handler);
2699+ // used to prevent event propagation from field controls
2700+ stop_propagation: function (event) {
2701+ event = event ? event : window.event;
2702+ event.cancelBubble = true; // for IE
2704+ if (event.stopPropagation)
2705+ event.stopPropagation();
2710+ cancel: function (event) {
2713+ event.cancel = true;
2714+ event.returnValue = false;
2716+ if (event.preventDefault)
2717+ event.preventDefault();
2720+ w3c_slidy.key_wanted = false;
2724+// for each language define an associative array
2725+// and also the help text which is longer
2730+ "contents?":"Índice",
2731+ "table of contents":"tabla de contenidos",
2732+ "Table of Contents":"Tabla de Contenidos",
2733+ "restart presentation":"Reiniciar presentación",
2734+ "restart?":"Inicio"
2737+ "Utilice el ratón, barra espaciadora, teclas Izda/Dcha, " +
2738+ "o Re pág y Av pág. Use S y B para cambiar el tamaño de fuente.",
2743+ "contents?":"Índex",
2744+ "table of contents":"taula de continguts",
2745+ "Table of Contents":"Taula de Continguts",
2746+ "restart presentation":"Reiniciar presentació",
2750+ "Utilitzi el ratolí, barra espaiadora, tecles Esq./Dta. " +
2751+ "o Re pàg y Av pàg. Usi S i B per canviar grandària de font.",
2755+ "help?":"nápověda",
2756+ "contents?":"obsah",
2757+ "table of contents":"obsah prezentace",
2758+ "Table of Contents":"Obsah prezentace",
2759+ "restart presentation":"znovu spustit prezentaci",
2760+ "restart?":"restart"
2763+ "Prezentaci můžete procházet pomocí kliknutí myši, mezerníku, " +
2764+ "šipek vlevo a vpravo nebo kláves PageUp a PageDown. Písmo se " +
2765+ "dá zvětšit a zmenšit pomocí kláves B a S.",
2770+ "contents?":"Inhoud?",
2771+ "table of contents":"inhoudsopgave",
2772+ "Table of Contents":"Inhoudsopgave",
2773+ "restart presentation":"herstart presentatie",
2774+ "restart?":"Herstart?"
2777+ "Navigeer d.m.v. het muis, spatiebar, Links/Rechts toetsen, " +
2778+ "of PgUp en PgDn. Gebruik S en B om de karaktergrootte te veranderen.",
2783+ "contents?":"Übersicht",
2784+ "table of contents":"Inhaltsverzeichnis",
2785+ "Table of Contents":"Inhaltsverzeichnis",
2786+ "restart presentation":"Präsentation neu starten",
2787+ "restart?":"Neustart"
2790+ "Benutzen Sie die Maus, Leerschlag, die Cursortasten links/rechts oder " +
2791+ "Page up/Page Down zum Wechseln der Seiten und S und B für die Schriftgrösse.",
2796+ "contents?":"spis treści?",
2797+ "table of contents":"spis treści",
2798+ "Table of Contents":"Spis Treści",
2799+ "restart presentation":"Restartuj prezentację",
2800+ "restart?":"restart?"
2803+ "Zmieniaj slajdy klikając myszą, naciskając spację, strzałki lewo/prawo" +
2804+ "lub PgUp / PgDn. Użyj klawiszy S i B, aby zmienić rozmiar czczionki.",
2809+ "contents?":"Index",
2810+ "table of contents":"table des matières",
2811+ "Table of Contents":"Table des matières",
2812+ "restart presentation":"Recommencer l'exposé",
2816+ "Naviguez avec la souris, la barre d'espace, les flèches " +
2817+ "gauche/droite ou les touches Pg Up, Pg Dn. Utilisez " +
2818+ "les touches S et B pour modifier la taille de la police.",
2822+ "help?":"segítség",
2823+ "contents?":"tartalom",
2824+ "table of contents":"tartalomjegyzék",
2825+ "Table of Contents":"Tartalomjegyzék",
2826+ "restart presentation":"bemutató újraindítása",
2827+ "restart?":"újraindítás"
2830+ "Az oldalak közti lépkedéshez kattintson az egérrel, vagy " +
2831+ "használja a szóköz, a bal, vagy a jobb nyíl, illetve a Page Down, " +
2832+ "Page Up billentyűket. Az S és a B billentyűkkel változtathatja " +
2833+ "a szöveg méretét.",
2838+ "contents?":"Indice",
2839+ "table of contents":"indice",
2840+ "Table of Contents":"Indice",
2841+ "restart presentation":"Ricominciare la presentazione",
2842+ "restart?":"Inizio"
2845+ "Navigare con mouse, barra spazio, frecce sinistra/destra o " +
2846+ "PgUp e PgDn. Usare S e B per cambiare la dimensione dei caratteri.",
2850+ "help?":"βοήθεια;",
2851+ "contents?":"περιεχόμενα;",
2852+ "table of contents":"πίνακας περιεχομένων",
2853+ "Table of Contents":"Πίνακας Περιεχομένων",
2854+ "restart presentation":"επανεκκίνηση παρουσίασης",
2855+ "restart?":"επανεκκίνηση;"
2858+ "Πλοηγηθείτε με το κλίκ του ποντικιού, το space, τα βέλη αριστερά/δεξιά, " +
2859+ "ή Page Up και Page Down. Χρησιμοποιήστε τα πλήκτρα S και B για να αλλάξετε " +
2860+ "το μέγεθος της γραμματοσειράς.",
2866+ "table of contents":"目次を表示",
2867+ "Table of Contents":"目次",
2868+ "restart presentation":"最初から再生",
2872+ "マウス左クリック ・ スペース ・ 左右キー " +
2873+ "または Page Up ・ Page Downで操作, S ・ Bでフォントサイズ変更",
2879+ "table of contents":"目录",
2880+ "Table of Contents":"目录",
2881+ "restart presentation":"重新启动展示",
2885+ "用鼠标点击, 空格条, 左右箭头, Pg Up 和 Pg Dn 导航. " +
2891+ "contents?":"содержание?",
2892+ "table of contents":"оглавление",
2893+ "Table of Contents":"Оглавление",
2894+ "restart presentation":"перезапустить презентацию",
2895+ "restart?":"перезапуск?"
2898+ "Перемещайтесь кликая мышкой, используя клавишу пробел, стрелки" +
2899+ "влево/вправо или Pg Up и Pg Dn. Клавиши S и B меняют размер шрифта.",
2904+ "contents?":"innehåll",
2905+ "table of contents":"innehållsförteckning",
2906+ "Table of Contents":"Innehållsförteckning",
2907+ "restart presentation":"visa presentationen från början",
2908+ "restart?":"börja om"
2911+ "Bläddra med ett klick med vänstra musknappen, mellanslagstangenten, " +
2912+ "vänster- och högerpiltangenterna eller tangenterna Pg Up, Pg Dn. " +
2913+ "Använd tangenterna S och B för att ändra textens storlek.",
2917+ localize: function (src) {
2921+ // try full language code, e.g. en-US
2922+ var s, lookup = w3c_slidy.strings[w3c_slidy.lang];
2932+ // strip country code suffix, e.g.
2933+ // try en if undefined for en-US
2934+ var lg = w3c_slidy.lang.split("-");
2938+ lookup = w3c_slidy.strings[lg[0]];
2949+ // otherwise string as is
2953+ init_localization: function () {
2954+ var i18n = w3c_slidy;
2955+ var help_text = w3c_slidy.help_text;
2957+ // each such language array is declared in the localize array
2958+ // this is used as in w3c_slidy.localize("foo");
2960+ "es":this.strings_es,
2961+ "ca":this.strings_ca,
2962+ "cs":this.strings_cs,
2963+ "nl":this.strings_nl,
2964+ "de":this.strings_de,
2965+ "pl":this.strings_pl,
2966+ "fr":this.strings_fr,
2967+ "hu":this.strings_hu,
2968+ "it":this.strings_it,
2969+ "el":this.strings_el,
2970+ "jp":this.strings_ja,
2971+ "zh":this.strings_zh,
2972+ "ru":this.strings_ru,
2973+ "sv":this.strings_sv
2976+ i18n.strings_es[help_text] = i18n.help_es;
2977+ i18n.strings_ca[help_text] = i18n.help_ca;
2978+ i18n.strings_cs[help_text] = i18n.help_cs;
2979+ i18n.strings_nl[help_text] = i18n.help_nl;
2980+ i18n.strings_de[help_text] = i18n.help_de;
2981+ i18n.strings_pl[help_text] = i18n.help_pl;
2982+ i18n.strings_fr[help_text] = i18n.help_fr;
2983+ i18n.strings_hu[help_text] = i18n.help_hu;
2984+ i18n.strings_it[help_text] = i18n.help_it;
2985+ i18n.strings_el[help_text] = i18n.help_el;
2986+ i18n.strings_ja[help_text] = i18n.help_ja;
2987+ i18n.strings_zh[help_text] = i18n.help_zh;
2988+ i18n.strings_ru[help_text] = i18n.help_ru;
2989+ i18n.strings_sv[help_text] = i18n.help_sv;
2991+ w3c_slidy.lang = document.body.parentNode.getAttribute("lang");
2993+ if (!w3c_slidy.lang)
2994+ w3c_slidy.lang = document.body.parentNode.getAttribute("xml:lang");
2996+ if (!w3c_slidy.lang)
2997+ w3c_slidy.lang = "en";
3001+// hack for back button behavior
3002+if (w3c_slidy.ie6 || w3c_slidy.ie7)
3004+ document.write("<iframe id='historyFrame' " +
3005+ "src='javascript:\"<html"+"></"+"html>\"' " +
3006+ "height='1' width='1' " +
3007+ "style='position:absolute;left:-800px'></iframe>");
3010+// attach event listeners for initialization
3013+// hide the slides as soon as body element is available
3014+// to reduce annoying screen mess before the onload event
3015+setTimeout(w3c_slidy.hide_slides, 50);