pandoc/s5/default/slides.min.js

1 line
10 KiB
JavaScript
Raw Normal View History

var undef;var slideCSS="";var snum=0;var smax=1;var incpos=0;var number=undef;var s5mode=true;var defaultView="slideshow";var controlVis="visible";var isIE=navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("Opera")<1?1:0;var isOp=navigator.userAgent.indexOf("Opera")>-1?1:0;var isGe=navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("Safari")<1?1:0;function hasClass(a,b){if(!a.className){return false}return(a.className.search("(^|\\s)"+b+"(\\s|$)")!=-1)}function hasValue(a,b){if(!a){return false}return(a.search("(^|\\s)"+b+"(\\s|$)")!=-1)}function removeClass(a,b){if(!a){return}a.className=a.className.replace(new RegExp("(^|\\s)"+b+"(\\s|$)"),RegExp.$1+RegExp.$2)}function addClass(a,b){if(!a||hasClass(a,b)){return}if(a.className){a.className+=" "+b}else{a.className=b}}function GetElementsWithClassName(a,c){var d=document.getElementsByTagName(a);var e=new Array();for(var b=0;b<d.length;b++){if(hasClass(d[b],c)){e[e.length]=d[b]}}return e}function isParentOrSelf(a,b){if(a==null||a.nodeName=="BODY"){return false}else{if(a.id==b){return true}else{return isParentOrSelf(a.parentNode,b)}}}function nodeValue(d){var a="";if(d.nodeType==1){var c=d.childNodes;for(var b=0;b<c.length;++b){a+=nodeValue(c[b])}}else{if(d.nodeType==3){a=d.nodeValue}}return(a)}function slideLabel(){var f=GetElementsWithClassName("*","slide");var g=document.getElementById("jumplist");smax=f.length;for(var c=0;c<smax;c++){var e=f[c];var i="slide"+c.toString();e.setAttribute("id",i);if(isOp){continue}var d="";var b=e.firstChild;if(!b){continue}while(b&&b.nodeType==3){b=b.nextSibling}if(!b){continue}var h=b.childNodes;for(var a=0;a<h.length;a++){d+=nodeValue(h[a])}g.options[g.length]=new Option(c+" : "+d,c)}}function currentSlide(){var a;if(document.getElementById){a=document.getElementById("currentSlide")}else{a=document.currentSlide}a.innerHTML='<span id="csHere">'+snum+'</span> <span id="csSep">/</span> <span id="csTotal">'+(smax-1)+"</span>";if(snum==0){a.style.visibility="hidden"}else{a.style.visibility="visible"}}function go(c){if(document.getElementById("slideProj").disabled||c==0){return}var b=document.getElementById("jumplist");var g="slide"+snum;var e=document.getElementById(g);if(incrementals[snum].length>0){for(var a=0;a<incrementals[snum].length;a++){removeClass(incrementals[snum][a],"current");removeClass(incrementals[snum][a],"incremental")}}if(c!="j"){snum+=c;lmax=smax-1;if(snum>lmax){snum=lmax}if(snum<0){snum=0}}else{snum=parseInt(b.value)}var f="slide"+snum;var d=document.getElementById(f);if(!d){d=document.getElementById("slide0");snum=0}if(c<0){incpos=incrementals[snum].length}else{incpos=0}if(incrementals[snum].length>0&&incpos==0){for(var a=0;a<incrementals[snum].length;a++){if(hasClass(incrementals[snum][a],"current")){incpos=a+1}else{addClass(incrementals[snum][a],"incremental")}}}if(incrementals[snum].length>0&&incpos>0){addClass(incrementals[snum][incpos-1],"current")}e.style.visibility="hidden";d.style.visibility="visible";b.selectedIndex=snum;currentSlide();number=0}function goTo(a){if(a>=smax||a==snum){return}go(a-snum)}function subgo(a){if(a>0){removeClass(incrementals[snum][incpos-1],"current");removeClass(incrementals[snum][incpos],"incremental");addClass(incrementals[snum][incpos],"current");incpos++}else{incpos--;removeClass(incrementals[snum][incpos],"current");addClass(incrementals[snum][incpos],"incremental");addClass(incrementals[snum][incpos-1],"current")}}function toggle(){var b=GetElementsWithClassName("*","slide");var d=document.getElementById("slideProj");var c=document.getElementById("outlineStyle");if(!d.disabled){d.disabled=true;c.disabled=false;s5mode=false;fontSize("1em");for(var e=0;e<smax;e++){var a=b[e];a.style.visibility="visible"}}else{d.disabled=false;c.disabled=true;s5mode=true;fontScale();for(var e=0;e<smax;e++){var a=b[e];a.style.visibility="hidden"}b[snum].style.visibility="visible"}}function showHide(a){var b=GetElementsWithClassName("*","hideme")[0];switch(a){case"s":b.style.visibility="visible";break;case"h":b.style.visibility="hidden";break;case"k":if(b