/* * RhetButler presentation Javascript (version 0.5 * Build date: 12-05-2013 * * Copyright 2013 Judson Lester (@judsonlester) * * Inspired by impress.js by * Bartek Szopka (@bartaz) * * Released under the MIT and GPL Licenses. */ var rhetButler={}; (function(){var b=rhetButler;b.arrayify=function(a){return[].slice.call(a)};b.$$=function(a,b){b=b||document;return this.arrayify(b.querySelectorAll(a))};b.byId=function(a){return document.getElementById(a)};b.triggerEvent=function(a,b,d){var e=document.createEvent("CustomEvent");e.initCustomEvent(b,!0,!0,d);a.dispatchEvent(e)};var a="Webkit webkit moz Moz o O ms khtml Khtml".split(" ");b.pfx=function(){var c=window.getComputedStyle(document.createElement("dummy")),b={};return function(d){if("undefined"===typeof b[d]){var e, f;e=d.replace(/-[a-z]/g,function(a){return a.slice(-1)[0].toUpperCase()});f=[d,e];e=e.replace(/^[a-z]/,function(a){return a.toUpperCase()});var h=a.forEach(function(a){f.push(a+d);f.push(a+e);f.push(a+"-"+d);f.push(a+"-"+e);f.push("-"+a+"-"+d);f.push("-"+a+"-"+e)});f=f.concat(h);b[d]=null;for(var k in f)if(h=c.getPropertyValue(f[k]),null!==h&&void 0!==h){b[d]=f[k];break}}return b[d]}}()})();rhetButler.Step=function(b){this.element=b;this.groups=[];this.steps=[]}; (function(){var b=rhetButler.Step.prototype;b.toString=function(){return"A Step "+this.element.id};b.setup=function(a,c){this.element=a;this.children=[];this.indexes={};this.childrenById={};for(field in c)this.indexes[field]=c[field];this.element.classList.add("future");this.nextItem=this.prevItem=this.lastItem=this.firstItem=this.nextSlide=this.prevSlide=this.lastSlide=this.firstSlide=null};b.treeFinished=function(){};b.addClass=function(a){this.element.classList.add(a)};b.removeClass=function(a){a instanceof RegExp?Array.prototype.forEach.call(this.element.classList,function(c){a.test(c)&&this.element.classList.remove(c)},this):this.element.classList.remove(a)};b.hasClass=function(a){return this.element.classList.contains(a)};b.beginDeparture=function(){this.addClass("previous");this.removeClass("current");this.parent.beginDeparture()};b.completeDeparture=function(){this.removeClass("previous");this.removeClass("present");this.removeClass("future");this.removeClass("current");this.addClass("past");this.parent.completeDeparture()}; b.beginArrival=function(){this.addClass("next");this.parent.beginArrival()};b.completeArrival=function(){this.removeClass("next");this.addClass("current");this.removeClass("future");this.removeClass("past");this.addClass("present");this.parent.completeArrival()};b.cancelArrival=function(){this.removeClass("next")};b.eachStep=function(a){a(this);this.children.forEach(function(c){c.eachStep(a)})};b.relativeLevelPosition=function(a,c){if(!c)return["none","same",a];var b=c.indexes[a]-this.indexes[a]; return-1>b?["jump","backwards","by-"+a]:-1==b?["advance","backwards","by-"+a]:1==b?["advance","forwards","by-"+a]:1b?this.stepsList[stepsList.length+b]:this.stepsList[b]:"string"===typeof b&&(b=a.byId(b)); return b&&b.id&&this.stepsData[b.id]?b:null};b.prev=function(){var a=this.steps.indexOf(this.activeStep)-1,a=0<=a?this.steps[a]:this.getStep(-1);return this.moveTo(a)};b.next=function(){var a=steps.indexOf(activeStep)+1,a=a