# HG changeset patch
# User aaa
# Date 1265806357 -32400
# Node ID afa29ac9f05084bf1f4ac6df420708b776df4cd1
# Parent 9cca948713f0f3041abe9c532aec3c86aa6e1d7b
add presen
diff -r 9cca948713f0 -r afa29ac9f050 presen/img/bodybg.gif
Binary file presen/img/bodybg.gif has changed
diff -r 9cca948713f0 -r afa29ac9f050 presen/img/bodybg.jpg
Binary file presen/img/bodybg.jpg has changed
diff -r 9cca948713f0 -r afa29ac9f050 presen/pre.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/presen/pre.html Wed Feb 10 21:52:37 2010 +0900
@@ -0,0 +1,91 @@
+
+
+
+
+
+function collectNotes()
+{
+ var notes = new Array();
+ var divs = document.body.getElementsByTagName("div");
+
+ for (var i = 0; i < divs.length; ++i)
+ {
+ div = divs.item(i);
+
+ if (hasClass(div, "handout"))
+ {
+ // add slide to collection
+ notes[notes.length] = div;
+
+ // hide handout notes as they are found
+ div.style.display = "none";
+ div.style.visibility = "hidden";
+ }
+ }
+
+ return notes;
+}
+
+// return new array of all
+// including named backgrounds e.g. class="background titlepage"
+function collectBackgrounds()
+{
+ var backgrounds = new Array();
+ var divs = document.body.getElementsByTagName("div");
+
+ for (var i = 0; i < divs.length; ++i)
+ {
+ div = divs.item(i);
+
+ if (hasClass(div, "background"))
+ {
+ // add slide to collection
+ backgrounds[backgrounds.length] = div;
+
+ // hide named backgrounds as they are found
+ // e.g. class="background epilog"
+ if (getClassList(div) != "background")
+ {
+ div.style.display = "none";
+ div.style.visibility = "hidden";
+ }
+ }
+ }
+
+ return backgrounds;
+}
+
+// show just the backgrounds pertinent to this slide
+function syncBackground(slide)
+{
+ var background;
+ var bgColor;
+
+ if (slide.currentStyle)
+ bgColor = slide.currentStyle["backgroundColor"];
+ else if (document.defaultView)
+ {
+ var styles = document.defaultView.getComputedStyle(slide,null);
+
+ if (styles)
+ bgColor = styles.getPropertyValue("background-color");
+ else // broken implementation probably due Safari or Konqueror
+ {
+ //alert("defective implementation of getComputedStyle()");
+ bgColor = "transparent";
+ }
+ }
+ else
+ bgColor == "transparent";
+
+ if (bgColor == "transparent")
+ {
+ var slideClass = getClassList(slide);
+
+ for (var i = 0; i < backgrounds.length; i++)
+ {
+ background = backgrounds[i];
+
+ var bgClass = getClassList(background);
+
+ if (matchingBackground(slideClass, bgClass))
+ {
+ background.style.display = "block";
+ background.style.visibility = "visible";
+ }
+ else
+ {
+ background.style.display = "none";
+ background.style.visibility = "hidden";
+ }
+ }
+ }
+ else // forcibly hide all backgrounds
+ hideBackgrounds();
+}
+
+function hideBackgrounds()
+{
+ for (var i = 0; i < backgrounds.length; i++)
+ {
+ background = backgrounds[i];
+ background.style.display = "none";
+ background.style.visibility = "hidden";
+ }
+}
+
+// compare classes for slide and background
+function matchingBackground(slideClass, bgClass)
+{
+ if (bgClass == "background")
+ return true;
+
+ // define pattern as regular expression
+ var pattern = /\w+/g;
+
+ // check for matches and place result in array
+ var result = slideClass.match(pattern);
+
+ // now check if desired name is present for background
+ for (var i = 0; i < result.length; i++)
+ {
+ if (hasToken(bgClass, result[i]))
+ return true;
+ }
+
+ return false;
+}
+
+// left to right traversal of root's content
+function nextNode(root, node)
+{
+ if (node == null)
+ return root.firstChild;
+
+ if (node.firstChild)
+ return node.firstChild;
+
+ if (node.nextSibling)
+ return node.nextSibling;
+
+ for (;;)
+ {
+ node = node.parentNode;
+
+ if (!node || node == root)
+ break;
+
+ if (node && node.nextSibling)
+ return node.nextSibling;
+ }
+
+ return null;
+}
+
+// right to left traversal of root's content
+function previousNode(root, node)
+{
+ if (node == null)
+ {
+ node = root.lastChild;
+
+ if (node)
+ {
+ while (node.lastChild)
+ node = node.lastChild;
+ }
+
+ return node;
+ }
+
+ if (node.previousSibling)
+ {
+ node = node.previousSibling;
+
+ while (node.lastChild)
+ node = node.lastChild;
+
+ return node;
+ }
+
+ if (node.parentNode != root)
+ return node.parentNode;
+
+ return null;
+}
+
+// HTML elements that can be used with class="incremental"
+// note that you can also put the class on containers like
+// up, ol, dl, and div to make their contents appear
+// incrementally. Upper case is used since this is what
+// browsers report for HTML node names (text/html).
+function incrementalElementList()
+{
+ var inclist = new Array();
+ inclist["P"] = true;
+ inclist["PRE"] = true;
+ inclist["LI"] = true;
+ inclist["BLOCKQUOTE"] = true;
+ inclist["DT"] = true;
+ inclist["DD"] = true;
+ inclist["H2"] = true;
+ inclist["H3"] = true;
+ inclist["H4"] = true;
+ inclist["H5"] = true;
+ inclist["H6"] = true;
+ inclist["SPAN"] = true;
+ inclist["ADDRESS"] = true;
+ inclist["TABLE"] = true;
+ inclist["TR"] = true;
+ inclist["TH"] = true;
+ inclist["TD"] = true;
+ inclist["IMG"] = true;
+ inclist["OBJECT"] = true;
+ return inclist;
+}
+
+function nextIncrementalItem(node)
+{
+ var slide = slides[slidenum];
+
+ for (;;)
+ {
+ node = nextNode(slide, node);
+
+ if (node == null || node.parentNode == null)
+ break;
+
+ if (node.nodeType == 1) // ELEMENT
+ {
+ if (node.nodeName == "BR")
+ continue;
+
+ if (hasClass(node, "incremental")
+ && okayForIncremental[node.nodeName])
+ return node;
+
+ if (hasClass(node.parentNode, "incremental")
+ && !hasClass(node, "non-incremental"))
+ return node;
+ }
+ }
+
+ return node;
+}
+
+function previousIncrementalItem(node)
+{
+ var slide = slides[slidenum];
+
+ for (;;)
+ {
+ node = previousNode(slide, node);
+
+ if (node == null || node.parentNode == null)
+ break;
+
+ if (node.nodeType == 1)
+ {
+ if (node.nodeName == "BR")
+ continue;
+
+ if (hasClass(node, "incremental")
+ && okayForIncremental[node.nodeName])
+ return node;
+
+ if (hasClass(node.parentNode, "incremental")
+ && !hasClass(node, "non-incremental"))
+ return node;
+ }
+ }
+
+ return node;
+}
+
+// set visibility for all elements on current slide with
+// a parent element with attribute class="incremental"
+function setVisibilityAllIncremental(value)
+{
+ var node = nextIncrementalItem(null);
+
+ while (node)
+ {
+ node.style.visibility = value;
+ node = nextIncrementalItem(node);
+ }
+}
+
+// reveal the next hidden item on the slide
+// node is null or the node that was last revealed
+function revealNextItem(node)
+{
+ node = nextIncrementalItem(node);
+
+ if (node && node.nodeType == 1) // an element
+ node.style.visibility = "visible";
+
+ return node;
+}
+
+
+// exact inverse of revealNextItem(node)
+function hidePreviousItem(node)
+{
+ if (node && node.nodeType == 1) // an element
+ node.style.visibility = "hidden";
+
+ return previousIncrementalItem(node);
+}
+
+
+/* set click handlers on all anchors */
+function patchAnchors()
+{
+ var anchors = document.body.getElementsByTagName("a");
+
+ for (var i = 0; i < anchors.length; ++i)
+ {
+ anchors[i].onclick = clickedAnchor;
+ }
+}
+
+function clickedAnchor(e)
+{
+ if (!e)
+ var e = window.event;
+
+ // compare this.href with location.href
+ // for link to another slide in this doc
+
+ if (pageAddress(this.href) == pageAddress(location.href))
+ {
+ // yes, so find new slide number
+ var newslidenum = findSlideNumber(this.href);
+
+ if (newslidenum != slidenum)
+ {
+ slide = slides[slidenum];
+ hideSlide(slide);
+ slidenum = newslidenum;
+ slide = slides[slidenum];
+ showSlide(slide);
+ setLocation();
+ }
+ }
+ else if (this.target == null)
+ location.href = this.href;
+
+ this.blur();
+ stopPropagation(e);
+}
+
+function pageAddress(uri)
+{
+ var i = uri.indexOf("#");
+
+ if (i < 0)
+ i = uri.indexOf("%23");
+
+ // check if anchor is entire page
+
+ if (i < 0)
+ return uri; // yes
+
+ return uri.substr(0, i);
+}
+
+function showSlideNumber()
+{
+ slideNumElement.innerHTML = "slide".localize() + " " +
+ (slidenum + 1) + "/" + slides.length;
+}
+
+// every 200mS check if the location has been changed as a
+// result of the user activating the Back button/menu item
+// doesn't work for Opera < 9.5
+function checkLocation()
+{
+ var hash = location.hash;
+
+ if (slidenum > 0 && (hash == "" || hash == "#"))
+ gotoSlide(0);
+ else if (hash.length > 2 && hash != "#("+(slidenum+1)+")")
+ {
+ var num = parseInt(location.hash.substr(2));
+
+ if (!isNaN(num))
+ gotoSlide(num-1);
+ }
+}
+
+// this doesn't push location onto history stack for IE
+// for which a hidden iframe hack is needed: load page into
+// the iframe with script that set's parent's location.hash
+// but that won't work for standalone use unless we can
+// create the page dynamically via a javascript: URL
+function setLocation()
+{
+ var uri = pageAddress(location.href);
+ var hash = "#(" + (slidenum+1) + ")";
+
+ if (slidenum >= 0)
+ uri = uri + hash;
+
+ if (ie && !ie8)
+ pushHash(hash);
+
+ if (uri != location.href /*&& !khtml */)
+ location.href = uri;
+
+ if (khtml)
+ hash = "(" + (slidenum+1) + ")";
+
+ if (!ie && location.hash != hash && location.hash != "")
+ location.hash = hash;
+
+ document.title = title + " (" + (slidenum+1) + ")";
+ showSlideNumber();
+}
+
+// only used for IE6 and IE7
+function onFrameLoaded(hash)
+{
+ location.hash = hash;
+ var uri = pageAddress(location.href);
+ location.href = uri + hash;
+}
+
+// history hack with thanks to Bertrand Le Roy
+function pushHash(hash)
+{
+ if (hash == "") hash = "#(1)";
+ window.location.hash = hash;
+ var doc = document.getElementById("historyFrame").contentWindow.document;
+ doc.open("javascript:''");
+ doc.write("hello mum");
+ doc.close();
+}
+
+// find current slide based upon location
+// first find target anchor and then look
+// for associated div element enclosing it
+// finally map that to slide number
+function findSlideNumber(uri)
+{
+ // first get anchor from page location
+
+ var i = uri.indexOf("#");
+
+ // check if anchor is entire page
+
+ if (i < 0)
+ return 0; // yes
+
+ var anchor = unescape(uri.substr(i+1));
+
+ // now use anchor as XML ID to find target
+ var target = document.getElementById(anchor);
+
+ if (!target)
+ {
+ // does anchor look like "(2)" for slide 2 ??
+ // where first slide is (1)
+ var re = /\((\d)+\)/;
+
+ if (anchor.match(re))
+ {
+ var num = parseInt(anchor.substring(1, anchor.length-1));
+
+ if (num > slides.length)
+ num = 1;
+
+ if (--num < 0)
+ num = 0;
+
+ return num;
+ }
+
+ // accept [2] for backwards compatibility
+ re = /\[(\d)+\]/;
+
+ if (anchor.match(re))
+ {
+ var num = parseInt(anchor.substring(1, anchor.length-1));
+
+ if (num > slides.length)
+ num = 1;
+
+ if (--num < 0)
+ num = 0;
+
+ return num;
+ }
+
+ // oh dear unknown anchor
+ return 0;
+ }
+
+ // search for enclosing slide
+
+ while (true)
+ {
+ // browser coerces html elements to uppercase!
+ if (target.nodeName.toLowerCase() == "div" &&
+ hasClass(target, "slide"))
+ {
+ // found the slide element
+ break;
+ }
+
+ // otherwise try parent element if any
+
+ target = target.parentNode;
+
+ if (!target)
+ {
+ return 0; // no luck!
+ }
+ };
+
+ for (i = 0; i < slides.length; ++i)
+ {
+ if (slides[i] == target)
+ return i; // success
+ }
+
+ // oh dear still no luck
+ return 0;
+}
+
+// find slide name from first h1 element
+// default to document title + slide number
+function slideName(index)
+{
+ var name = null;
+ var slide = slides[index];
+
+ var heading = findHeading(slide);
+
+ if (heading)
+ name = extractText(heading);
+
+ if (!name)
+ name = title + "(" + (index + 1) + ")";
+
+ name.replace(/\&/g, "&");
+ name.replace(/\/g, ">");
+
+ return name;
+}
+
+// find first h1 element in DOM tree
+function findHeading(node)
+{ if (!node || node.nodeType != 1)
+ return null;
+
+ if (node.nodeName == "H1" || node.nodeName == "h1")
+ return node;
+
+ var child = node.firstChild;
+
+ while (child)
+ {
+ node = findHeading(child);
+
+ if (node)
+ return node;
+
+ child = child.nextSibling;
+ }
+
+ return null;
+}
+
+// recursively extract text from DOM tree
+function extractText(node)
+{
+ if (!node)
+ return "";
+
+ // text nodes
+ if (node.nodeType == 3)
+ return node.nodeValue;
+
+ // elements
+ if (node.nodeType == 1)
+ {
+ node = node.firstChild;
+ var text = "";
+
+ while (node)
+ {
+ text = text + extractText(node);
+ node = node.nextSibling;
+ }
+
+ return text;
+ }
+
+ return "";
+}
+
+
+// find copyright text from meta element
+function findCopyright()
+{
+ var name, content;
+ var meta = document.getElementsByTagName("meta");
+
+ for (var i = 0; i < meta.length; ++i)
+ {
+ name = meta[i].getAttribute("name");
+ content = meta[i].getAttribute("content");
+
+ if (name == "copyright")
+ return content;
+ }
+
+ return null;
+}
+
+function findSizeAdjust()
+{
+ var name, content, offset;
+ var meta = document.getElementsByTagName("meta");
+
+ for (var i = 0; i < meta.length; ++i)
+ {
+ name = meta[i].getAttribute("name");
+ content = meta[i].getAttribute("content");
+
+ if (name == "font-size-adjustment")
+ return 1 * content;
+ }
+
+ return 1;
+}
+
+function addToolbar()
+{
+ var slideCounter, page;
+
+ var toolbar = createElement("div");
+ toolbar.setAttribute("class", "toolbar");
+
+ if (ns_pos) // a reasonably behaved browser
+ {
+ var right = document.createElement("div");
+ right.setAttribute("style", "float: right; text-align: right");
+
+ slideCounter = document.createElement("div")
+ slideCounter.innerHTML = "slide".localize() + " n/m";
+ right.appendChild(slideCounter);
+ toolbar.appendChild(right);
+
+ var left = document.createElement("div");
+ left.setAttribute("style", "text-align: left");
+
+ // global end of slide indicator
+ eos = document.createElement("span");
+ eos.innerHTML = "* ";
+ left.appendChild(eos);
+
+ var help = document.createElement("a");
+ help.setAttribute("href", helpPage);
+ help.setAttribute("title", helpText.localize());
+ help.innerHTML = "help?".localize();
+ left.appendChild(help);
+ helpAnchor = help; // save for focus hack
+
+ var gap1 = document.createTextNode(" ");
+ left.appendChild(gap1);
+
+ var contents = document.createElement("a");
+ contents.setAttribute("href", "javascript:toggleTableOfContents()");
+ contents.setAttribute("title", "table of contents".localize());
+ contents.innerHTML = "contents?".localize();
+ left.appendChild(contents);
+
+ var gap2 = document.createTextNode(" ");
+ left.appendChild(gap2);
+
+ var start = document.createElement("a");
+ start.setAttribute("href", "javascript:firstSlide()");
+ start.setAttribute("title", "restart presentation".localize());
+ start.innerHTML = "restart?".localize();
+// start.setAttribute("href", "javascript:printSlides()");
+// start.setAttribute("title", "print all slides".localize());
+// start.innerHTML = "print!".localize();
+ left.appendChild(start);
+
+ var copyright = findCopyright();
+
+ if (copyright)
+ {
+ var span = document.createElement("span");
+ span.innerHTML = copyright;
+ span.style.color = "black";
+ span.style.marginLeft = "4em";
+ left.appendChild(span);
+ }
+
+ toolbar.appendChild(left);
+ }
+ else // IE so need to work around its poor CSS support
+ {
+ toolbar.style.position = (ie7 ? "fixed" : "absolute");
+ toolbar.style.zIndex = "200";
+ toolbar.style.width = "99.9%";
+ toolbar.style.height = "1.2em";
+ toolbar.style.top = "auto";
+ toolbar.style.bottom = "0";
+ toolbar.style.left = "0";
+ toolbar.style.right = "0";
+ toolbar.style.textAlign = "left";
+ toolbar.style.fontSize = "60%";
+ toolbar.style.color = "red";
+ toolbar.borderWidth = 0;
+ toolbar.style.background = "rgb(240,240,240)";
+
+ // would like to have help text left aligned
+ // and page counter right aligned, floating
+ // div's don't work, so instead use nested
+ // absolutely positioned div's.
+
+ var sp = document.createElement("span");
+ sp.innerHTML = " * ";
+ toolbar.appendChild(sp);
+ eos = sp; // end of slide indicator
+
+ var help = document.createElement("a");
+ help.setAttribute("href", helpPage);
+ help.setAttribute("title", helpText.localize());
+ help.innerHTML = "help?".localize();
+ toolbar.appendChild(help);
+ helpAnchor = help; // save for focus hack
+
+ var gap1 = document.createTextNode(" ");
+ toolbar.appendChild(gap1);
+
+ var contents = document.createElement("a");
+ contents.setAttribute("href", "javascript:toggleTableOfContents()");
+ contents.setAttribute("title", "table of contents".localize());
+ contents.innerHTML = "contents?".localize();
+ toolbar.appendChild(contents);
+
+ var gap2 = document.createTextNode(" ");
+ toolbar.appendChild(gap2);
+
+ var start = document.createElement("a");
+ start.setAttribute("href", "javascript:firstSlide()");
+ start.setAttribute("title", "restart presentation".localize());
+ start.innerHTML = "restart?".localize();
+// start.setAttribute("href", "javascript:printSlides()");
+// start.setAttribute("title", "print all slides".localize());
+// start.innerHTML = "print!".localize();
+ toolbar.appendChild(start);
+
+ var copyright = findCopyright();
+
+ if (copyright)
+ {
+ var span = document.createElement("span");
+ span.innerHTML = copyright;
+ span.style.color = "black";
+ span.style.marginLeft = "2em";
+ toolbar.appendChild(span);
+ }
+
+ slideCounter = document.createElement("div")
+ slideCounter.style.position = "absolute";
+ slideCounter.style.width = "auto"; //"20%";
+ slideCounter.style.height = "1.2em";
+ slideCounter.style.top = "auto";
+ slideCounter.style.bottom = 0;
+ slideCounter.style.right = "0";
+ slideCounter.style.textAlign = "right";
+ slideCounter.style.color = "red";
+ slideCounter.style.background = "rgb(240,240,240)";
+
+ slideCounter.innerHTML = "slide".localize() + " n/m";
+ toolbar.appendChild(slideCounter);
+ }
+
+ // ensure that click isn't passed through to the page
+ toolbar.onclick = stopPropagation;
+ document.body.appendChild(toolbar);
+ slideNumElement = slideCounter;
+ setEosStatus(false);
+
+ return toolbar;
+}
+
+function isShownToc()
+{
+ if (toc && toc.style.visible == "visible")
+ return true;
+
+ return false;
+}
+
+function showTableOfContents()
+{
+ if (toc)
+ {
+ if (toc.style.visibility != "visible")
+ {
+ toc.style.visibility = "visible";
+ toc.style.display = "block";
+ toc.focus();
+
+ if (ie7 && slidenum == 0)
+ setTimeout("ieHack()", 100);
+ }
+ else
+ hideTableOfContents();
+ }
+}
+
+function hideTableOfContents()
+{
+ if (toc && toc.style.visibility != "hidden")
+ {
+ toc.style.visibility = "hidden";
+ toc.style.display = "none";
+
+ try
+ {
+ if (!opera)
+ helpAnchor.focus();
+ }
+ catch (e)
+ {
+ }
+ }
+}
+
+function toggleTableOfContents()
+{
+ if (toc)
+ {
+ if (toc.style.visible != "visible")
+ showTableOfContents();
+ else
+ hideTableOfContents();
+ }
+}
+
+// called on clicking toc entry
+function gotoEntry(e)
+{
+ var target;
+
+ if (!e)
+ var e = window.event;
+
+ if (e.target)
+ target = e.target;
+ else if (e.srcElement)
+ target = e.srcElement;
+
+ // work around Safari bug
+ if (target.nodeType == 3)
+ target = target.parentNode;
+
+ if (target && target.nodeType == 1)
+ {
+ var uri = target.getAttribute("href");
+
+ if (uri)
+ {
+ //alert("going to " + uri);
+ var slide = slides[slidenum];
+ hideSlide(slide);
+ slidenum = findSlideNumber(uri);
+ slide = slides[slidenum];
+ lastShown = null;
+ setLocation();
+ setVisibilityAllIncremental("hidden");
+ setEosStatus(!nextIncrementalItem(lastShown));
+ showSlide(slide);
+ //target.focus();
+
+ try
+ {
+ if (!opera)
+ helpAnchor.focus();
+ }
+ catch (e)
+ {
+ }
+ }
+ }
+
+ hideTableOfContents(e);
+ if (ie7) ieHack();
+ stopPropagation(e);
+ return cancel(e);
+}
+
+// called onkeydown for toc entry
+function gotoTocEntry(event)
+{
+ var key;
+
+ if (!event)
+ var event = window.event;
+
+ // kludge around NS/IE differences
+ if (window.event)
+ key = window.event.keyCode;
+ else if (event.which)
+ key = event.which;
+ else
+ return true; // Yikes! unknown browser
+
+ // ignore event if key value is zero
+ // as for alt on Opera and Konqueror
+ if (!key)
+ return true;
+
+ // check for concurrent control/command/alt key
+ // but are these only present on mouse events?
+
+ if (event.ctrlKey || event.altKey)
+ return true;
+
+ if (key == 13)
+ {
+ var uri = this.getAttribute("href");
+
+ if (uri)
+ {
+ //alert("going to " + uri);
+ var slide = slides[slidenum];
+ hideSlide(slide);
+ slidenum = findSlideNumber(uri);
+ slide = slides[slidenum];
+ lastShown = null;
+ setLocation();
+ setVisibilityAllIncremental("hidden");
+ setEosStatus(!nextIncrementalItem(lastShown));
+ showSlide(slide);
+ //target.focus();
+
+ try
+ {
+ if (!opera)
+ helpAnchor.focus();
+ }
+ catch (e)
+ {
+ }
+ }
+
+ hideTableOfContents();
+ if (ie7) ieHack();
+ return cancel(event);
+ }
+
+ if (key == 40 && this.next)
+ {
+ this.next.focus();
+ return cancel(event);
+ }
+
+ if (key == 38 && this.previous)
+ {
+ this.previous.focus();
+ return cancel(event);
+ }
+
+ return true;
+}
+
+function isTitleSlide(slide)
+{
+ return hasClass(slide, "title");
+}
+
+// create div element with links to each slide
+function tableOfContents()
+{
+ var toc = document.createElement("div");
+ addClass(toc, "toc");
+ //toc.setAttribute("tabindex", "0");
+
+ var heading = document.createElement("div");
+ addClass(heading, "toc-heading");
+ heading.innerHTML = "Table of Contents".localize();
+
+ heading.style.textAlign = "center";
+ heading.style.width = "100%";
+ heading.style.margin = "0";
+ heading.style.marginBottom = "1em";
+ heading.style.borderBottomStyle = "solid";
+ heading.style.borderBottomColor = "rgb(180,180,180)";
+ heading.style.borderBottomWidth = "1px";
+
+ toc.appendChild(heading);
+ var previous = null;
+
+ for (var i = 0; i < slides.length; ++i)
+ {
+ var title = hasClass(slides[i], "title");
+ var num = document.createTextNode((i + 1) + ". ");
+
+ toc.appendChild(num);
+
+ var a = document.createElement("a");
+ a.setAttribute("href", "#(" + (i+1) + ")");
+
+ if (title)
+ addClass(a, "titleslide");
+
+ var name = document.createTextNode(slideName(i));
+ a.appendChild(name);
+ a.onclick = gotoEntry;
+ a.onkeydown = gotoTocEntry;
+ a.previous = previous;
+
+ if (previous)
+ previous.next = a;
+
+ toc.appendChild(a);
+
+ if (i == 0)
+ toc.first = a;
+
+ if (i < slides.length - 1)
+ {
+ var br = document.createElement("br");
+ toc.appendChild(br);
+ }
+
+ previous = a;
+ }
+
+ toc.focus = function () {
+ if (this.first)
+ this.first.focus();
+ }
+
+ toc.onmouseup = mouseButtonUp;
+
+ toc.onclick = function (e) {
+ e||(e=window.event);
+
+ if (selectedTextLen <= 0)
+ hideTableOfContents();
+
+ stopPropagation(e);
+
+ if (e.cancel != undefined)
+ e.cancel = true;
+
+ if (e.returnValue != undefined)
+ e.returnValue = false;
+
+ return false;
+ };
+
+ toc.style.position = "absolute";
+ toc.style.zIndex = "300";
+ toc.style.width = "60%";
+ toc.style.maxWidth = "30em";
+ toc.style.height = "30em";
+ toc.style.overflow = "auto";
+ toc.style.top = "auto";
+ toc.style.right = "auto";
+ toc.style.left = "4em";
+ toc.style.bottom = "4em";
+ toc.style.padding = "1em";
+ toc.style.background = "rgb(240,240,240)";
+ toc.style.borderStyle = "solid";
+ toc.style.borderWidth = "2px";
+ toc.style.fontSize = "60%";
+
+ document.body.insertBefore(toc, document.body.firstChild);
+ return toc;
+}
+
+function replaceByNonBreakingSpace(str)
+{
+ for (var i = 0; i < str.length; ++i)
+ str[i] = 160;
+}
+
+
+function initOutliner()
+{
+ var items = document.getElementsByTagName("LI");
+
+ for (var i = 0; i < items.length; ++i)
+ {
+ var target = items[i];
+
+ if (!hasClass(target.parentNode, "outline"))
+ continue;
+
+ target.onclick = outlineClick;
+
+ if (!ns_pos)
+ {
+ target.onmouseover = hoverOutline;
+ target.onmouseout = unhoverOutline;
+ }
+
+ if (foldable(target))
+ {
+ target.foldable = true;
+ target.onfocus = function () {outline = this;};
+ target.onblur = function () {outline = null;};
+
+ if (!target.getAttribute("tabindex"))
+ target.setAttribute("tabindex", "0");
+
+ if (hasClass(target, "expand"))
+ unfold(target);
+ else
+ fold(target);
+ }
+ else
+ {
+ addClass(target, "nofold");
+ target.visible = true;
+ target.foldable = false;
+ }
+ }
+}
+
+function foldable(item)
+{
+ if (!item || item.nodeType != 1)
+ return false;
+
+ var node = item.firstChild;
+
+ while (node)
+ {
+ if (node.nodeType == 1 && isBlock(node))
+ return true;
+
+ node = node.nextSibling;
+ }
+
+ return false;
+}
+
+function fold(item)
+{
+ if (item)
+ {
+ removeClass(item, "unfolded");
+ addClass(item, "folded");
+ }
+
+ var node = item ? item.firstChild : null;
+
+ while (node)
+ {
+ if (node.nodeType == 1 && isBlock(node)) // element
+ {
+ // note that getElementStyle won't work for Safari 1.3
+ node.display = getElementStyle(node, "display", "display");
+ node.style.display = "none";
+ node.style.visibility = "hidden";
+ }
+
+ node = node.nextSibling;
+ }
+
+ item.visible = false;
+}
+
+function unfold(item)
+{
+ if (item)
+ {
+ addClass(item, "unfolded");
+ removeClass(item, "folded");
+ }
+
+ var node = item ? item.firstChild : null;
+
+ while (node)
+ {
+ if (node.nodeType == 1 && isBlock(node)) // element
+ {
+ // with fallback for Safari, see above
+ node.style.display = (node.display ? node.display : "block");
+ node.style.visibility = "visible";
+ }
+
+ node = node.nextSibling;
+ }
+
+ item.visible = true;
+}
+
+function outlineClick(e)
+{
+ var rightclick = false;
+ var target;
+
+ if (!e)
+ var e = window.event;
+
+ if (e.target)
+ target = e.target;
+ else if (e.srcElement)
+ target = e.srcElement;
+
+ // work around Safari bug
+ if (target.nodeType == 3)
+ target = target.parentNode;
+
+ while (target && target.visible == undefined)
+ target = target.parentNode;
+
+ if (!target)
+ return true;
+
+ if (e.which)
+ rightclick = (e.which == 3);
+ else if (e.button)
+ rightclick = (e.button == 2);
+
+ if (!rightclick && target.visible != undefined)
+ {
+ if (target.foldable)
+ {
+ if (target.visible)
+ fold(target);
+ else
+ unfold(target);
+ }
+
+ stopPropagation(e);
+ e.cancel = true;
+ e.returnValue = false;
+ }
+
+ return false;
+}
+
+function hoverOutline(e)
+{
+ var target;
+
+ if (!e)
+ var e = window.event;
+
+ if (e.target)
+ target = e.target;
+ else if (e.srcElement)
+ target = e.srcElement;
+
+ // work around Safari bug
+ if (target.nodeType == 3)
+ target = target.parentNode;
+
+ while (target && target.visible == undefined)
+ target = target.parentNode;
+
+ if (target && target.foldable)
+ target.style.cursor = "pointer";
+
+ return true;
+}
+
+function unhoverOutline(e)
+{
+ var target;
+
+ if (!e)
+ var e = window.event;
+
+ if (e.target)
+ target = e.target;
+ else if (e.srcElement)
+ target = e.srcElement;
+
+ // work around Safari bug
+ if (target.nodeType == 3)
+ target = target.parentNode;
+
+ while (target && target.visible == undefined)
+ target = target.parentNode;
+
+ if (target)
+ target.style.cursor = "default";
+
+ return true;
+}
+
+
+function stopPropagation(e)
+{
+ if (window.event)
+ {
+ window.event.cancelBubble = true;
+ //window.event.returnValue = false;
+ }
+ else if (e)
+ {
+ e.cancelBubble = true;
+ e.stopPropagation();
+ //e.preventDefault();
+ }
+}
+
+/* can't rely on display since we set that to none to hide things */
+function isBlock(elem)
+{
+ var tag = elem.nodeName;
+
+ return tag == "OL" || tag == "UL" || tag == "P" ||
+ tag == "LI" || tag == "TABLE" || tag == "PRE" ||
+ tag == "H1" || tag == "H2" || tag == "H3" ||
+ tag == "H4" || tag == "H5" || tag == "H6" ||
+ tag == "BLOCKQUOTE" || tag == "ADDRESS";
+}
+
+function getElementStyle(elem, IEStyleProp, CSSStyleProp)
+{
+ if (elem.currentStyle)
+ {
+ return elem.currentStyle[IEStyleProp];
+ }
+ else if (window.getComputedStyle)
+ {
+ var compStyle = window.getComputedStyle(elem, "");
+ return compStyle.getPropertyValue(CSSStyleProp);
+ }
+ return "";
+}
+
+// works with text/html and text/xhtml+xml with thanks to Simon Willison
+function createElement(element)
+{
+ if (typeof document.createElementNS != 'undefined')
+ {
+ return document.createElementNS('http://www.w3.org/1999/xhtml', element);
+ }
+
+ if (typeof document.createElement != 'undefined')
+ {
+ return document.createElement(element);
+ }
+
+ return false;
+}
+
+// designed to work with both text/html and text/xhtml+xml
+function getElementsByTagName(name)
+{
+ if (typeof document.getElementsByTagNameNS != 'undefined')
+ {
+ return document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', name);
+ }
+
+ if (typeof document.getElementsByTagName != 'undefined')
+ {
+ return document.getElementsByTagName(name);
+ }
+
+ return null;
+}
+
+/*
+// clean alternative to innerHTML method, but on IE6
+// it doesn't work with named entities like
+// which need to be replaced by numeric entities
+function insertText(element, text)
+{
+ try
+ {
+ element.textContent = text; // DOM3 only
+ }
+ catch (e)
+ {
+ if (element.firstChild)
+ {
+ // remove current children
+ while (element.firstChild)
+ element.removeChild(element.firstChild);
+ }
+
+ element.appendChild(document.createTextNode(text));
+ }
+}
+
+// as above, but as method of all element nodes
+// doesn't work in IE6 which doesn't allow you to
+// add methods to the HTMLElement prototype
+if (HTMLElement != undefined)
+{
+ HTMLElement.prototype.insertText = function(text) {
+ var element = this;
+
+ try
+ {
+ element.textContent = text; // DOM3 only
+ }
+ catch (e)
+ {
+ if (element.firstChild)
+ {
+ // remove current children
+ while (element.firstChild)
+ element.removeChild(element.firstChild);
+ }
+
+ element.appendChild(document.createTextNode(text));
+ }
+ };
+}
+*/
+
+function getSelectedText()
+{
+ try
+ {
+ if (window.getSelection)
+ return window.getSelection().toString();
+
+ if (document.getSelection)
+ return document.getSelection().toString();
+
+ if (document.selection)
+ return document.selection.createRange().text;
+ }
+ catch (e)
+ {
+ return "";
+ }
+ return "";
+}
diff -r 9cca948713f0 -r afa29ac9f050 presen/user.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/presen/user.css Wed Feb 10 21:52:37 2010 +0900
@@ -0,0 +1,142 @@
+/* user.css
+
+*/
+
+/*div.slide{font-size: 80%;}/**/
+/*pre{font-size: 75%;}*/
+
+div.slide h1 {
+ padding-left: 0.5em;
+ padding-right: 0;
+ padding-top: 0.1em;
+ margin-bottom: 0.8em;
+ margin-top: -0.05em;
+ margin-left: -20px;
+ margin-right: -20px;
+ color: white;
+ height: 2.2em;
+ font-size: 160%;
+ line-height: 1.1em;
+ background: #000000;
+ padding-left: 2em;
+}
+
+div.slide h1 a {
+ color: white;
+ text-decoration: none;
+}
+
+div.slide h1 a:link {
+ color: white;
+ text-decoration: none;
+}
+
+div.slide h1 a:visited {
+ color: white;
+ text-decoration: none;
+}
+
+div.slide h1 a:hover {
+ color: white;
+ text-decoration: underline;
+}
+
+div.slide h1 a:active {
+ color: red;
+ text-decoration: underline;
+}
+
+div.pre h1 {
+ background-image: url("img/bodybg.jpg");
+ background-repeat: no-repeat;
+ background-position: 95%;
+ padding-left: 30px;
+ padding-top: 30px;
+ padding-bottom: 0px;
+ height: 1.7em;
+}
+/*cover
+ ----------------------------------------*/
+div.cover {
+ color: White;
+ padding-top: 0;
+ padding-right: 0;
+ /* padding-left: 3em;*/
+ height: 100%;
+}
+
+div.cover h1 {
+ margin-top: 10%;
+ margin-right: 0px;
+ padding-right: 60px;
+ padding-top: 20px;
+ padding-bottom: 50px;
+ color: white;
+ background: #000000;
+ font-size: 150%;
+ text-align: center;
+ line-height: 150%;
+}
+
+div.cover h2 {
+ color: White;
+}
+
+div.cover a {
+ color:White;
+}
+
+div.cover h3 {
+ margin-top: 5em;
+ margin-left: 10em;
+ color: #000000;
+}
+
+div.cover ul {
+ color: Black;
+ margin-right: 60px;
+}
+
+div.cover li {
+ list-style-type: none;
+}
+
+/*notes
+ ----------------------------------------*/
+.notes{
+ font-size: 80%;
+}
+
+/*table
+ ----------------------------------------*/
+table {
+ border-collapse: collapse;
+ margin: 0.8em 1.0em;
+}
+
+th, td, tr,r caption{
+ padding: 3px;
+}
+
+table.listView {
+ font-size: 0.85em;
+ margin: 0.8em 1.0em;
+}
+
+table.listView th, table.listView td, table.listView tr {
+ padding: 0px 3px 0px 3px;
+}
+
+table {
+ border: 1px solid #ccc;
+}
+
+th, thead td {
+ background: #9999FF;
+ border: 1px solid #ccc;
+ color: #ffffff;
+}
+
+td, .viewer tr {
+ border: 1px solid #ccc;
+}
\ No newline at end of file