<NME> pageguide.min.js
<BEF> ADDFILE
<MSG> Revert "Out with the old."

This reverts commit 56ea36a7bcc7539d810adf72a144b21010dfca43.

<DFF> @@ -0,0 +1,1 @@
+tl=window.tl||{};tl.pg=tl.pg||{};tl.pg.default_prefs={auto_show_first:true,loading_selector:"#loading",track_events_cb:function(){return},handle_doc_switch:null,custom_open_button:null,pg_caption:"page guide",check_welcome_dismissed:function(){var e="tlypageguide_welcome_shown_"+tl.pg.hashUrl();try{if(localStorage.getItem(e)){return true}}catch(t){if(document.cookie.indexOf(e)>-1){return true}}return false},dismiss_welcome:function(){var e="tlypageguide_welcome_shown_"+tl.pg.hashUrl();try{localStorage.setItem(e,true)}catch(t){var n=new Date;n.setDate(n.getDate()+365);document.cookie=e+"=true; expires="+n.toUTCString()}}};tl.pg.init=function(e){e=jQuery.extend({},tl.pg.default_prefs,e);if(jQuery("#tlyPageGuide").length===0){return}jQuery("#tlyPageGuideWrapper").remove();var t=jQuery("#tlyPageGuide"),n=jQuery("<div>",{id:"tlyPageGuideWrapper"}),r=jQuery("<div>",{id:"tlyPageGuideMessages"}),i=jQuery("#tlyPageGuideWelcome");r.append('<a href="#" class="tlypageguide_close" title="Close Guide">close</a>').append("<span></span>").append("<div></div>").append('<a href="#" class="tlypageguide_back" title="Previous">Previous</a>').append('<a href="#" class="tlypageguide_fwd" title="Next">Next</a>');if(e.custom_open_button==null&&$(".tlypageguide_toggle").length<1){jQuery("<div/>",{title:"Launch Page Guide","class":"tlypageguide_toggle"}).append(e.pg_caption).append("<div><span>"+t.data("tourtitle")+"</span></div>").append('<a href="#" class="tlypageguide_close" title="close guide">close guide &raquo;</a>').appendTo(n)}if(i.length>0){e.show_welcome=!e.check_welcome_dismissed();if(e.show_welcome){jQuery("body").prepend('<div id="tlyPageGuideOverlay"></div>');i.appendTo(n)}}n.append(t);n.append(r);jQuery("body").append(n);var s=new tl.pg.PageGuide(jQuery("#tlyPageGuideWrapper"),e);s.ready(function(){s.setup_handlers();s.$base.children(".tlypageguide_toggle").animate({right:"-120px"},250);if(s.preferences.show_welcome){s.pop_welcome()}});return s};tl.pg.PageGuide=function(e,t){this.preferences=t;this.$base=e;this.$all_items=jQuery("#tlyPageGuide > li",this.$base);this.$items=jQuery([]);this.$message=jQuery("#tlyPageGuideMessages");this.$fwd=jQuery("a.tlypageguide_fwd",this.$base);this.$back=jQuery("a.tlypageguide_back",this.$base);this.$welcome=jQuery("#tlyPageGuideWelcome");this.cur_idx=0;this.track_event=this.preferences.track_events_cb;this.handle_doc_switch=this.preferences.handle_doc_switch;this.custom_open_button=this.preferences.custom_open_button;this.is_open=false};tl.pg.hashUrl=function(){var e=window.location.href;var t=0,n,r;if(e.length===0){return t}for(n=0;n<e.length;n++){r=e.charCodeAt(n);t=(t<<5)-t+r;t=t&t}return t.toString()};tl.pg.isScrolledIntoView=function(e){var t=jQuery(window).scrollTop(),n=t+jQuery(window).height(),r=jQuery(e).offset().top,i=r+jQuery(e).height();return i>=t&&r<=n-100};tl.pg.PageGuide.prototype.ready=function(e){var t=this,n=window.setInterval(function(){if(!jQuery(t.preferences.loading_selector).is(":visible")){e();clearInterval(n)}},250);return this};tl.pg.PageGuide.prototype._on_expand=function(){var e=this,t=document,n=window;this.position_tour();this.cur_idx=0;var r=t.createElement("style");t.getElementsByTagName("head")[0].appendChild(r);if(!n.createPopup){r.appendChild(t.createTextNode(""));r.setAttribute("type","text/css")}var i=t.styleSheets[t.styleSheets.length-1];var s="";this.$items.each(function(e){var i=jQuery(jQuery(this).data("tourtarget")+":visible:first");i.addClass("tlypageguide_shadow tlypageguide_shadow"+e);var o=".tlypageguide_shadow"+e+":after { height: "+i.outerHeight()+"px; width: "+i.outerWidth(false)+"px; }";if(!n.createPopup){var u=t.createTextNode(o,0);r.appendChild(u)}else{s+=o}jQuery(this).prepend("<ins>"+(e+1)+"</ins>");jQuery(this).data("idx",e)});if(n.createPopup){i.cssText=s}if(this.preferences.auto_show_first&&this.$items.length>0){this.show_message(0)}};tl.pg.PageGuide.prototype.open=function(){if(this.preferences.show_welcome){this.preferences.dismiss_welcome();this.close_welcome()}if(this.is_open){return}else{this.is_open=true}this.track_event("PG.open");this._on_expand();this.$items.toggleClass("expanded");jQuery("body").addClass("tlypageguide-open")};tl.pg.PageGuide.prototype.close=function(){if(!this.is_open){return}else{this.is_open=false}this.track_event("PG.close");this.$items.toggleClass("expanded");this.$message.animate({height:"0"},500,function(){jQuery(this).hide()});$('[class~="tlypageguide_shadow"]').removeClass(function(e,t){return t.match(/tlypageguide_shadow.*?\b/g).join(" ")});jQuery("ins").remove();jQuery("body").removeClass("tlypageguide-open")};tl.pg.PageGuide.prototype.setup_handlers=function(){var e=this;var t=e.custom_open_button==null?jQuery(".tlypageguide_toggle",this.$base):jQuery(e.custom_open_button);t.on("click",function(){if(e.is_open){e.close()}else if(e.preferences.show_welcome&&!e.preferences.check_welcome_dismissed()&&!jQuery("body").hasClass("tlyPageGuideWelcomeOpen")){e.pop_welcome()}else{e.open()}return false});jQuery(".tlypageguide_close",this.$message.add(jQuery(".tlypageguide_toggle"))).on("click",function(){e.close();return false});this.$all_items.on("click",function(){var t=jQuery(this).data("idx");e.track_event("PG.specific_elt");e.show_message(t)});this.$fwd.on("click",function(){var t=(e.cur_idx+1)%e.$items.length;e.track_event("PG.fwd");e.show_message(t);return false});this.$back.on("click",function(){var t=(e.cur_idx+e.$items.length-1)%e.$items.length;e.track_event("PG.back");e.show_message(t,true);return false});if(this.$welcome.length){if(this.$welcome.find(".tlypageguide_ignore").length){this.$welcome.on("click",".tlypageguide_ignore",function(){e.close_welcome()})}if(this.$welcome.find(".tlypageguide_dismiss").length){this.$welcome.on("click",".tlypageguide_dismiss",function(){e.close_welcome();e.preferences.dismiss_welcome()})}this.$welcome.on("click",".tlypageguide_start",function(){e.open()})}jQuery(window).resize(function(){e.position_tour()})};tl.pg.PageGuide.prototype.show_message=function(e,t){var n=this.cur_idx,r=this.$items[n],i=this.$items[e];this.cur_idx=e;if(this.handle_doc_switch){this.handle_doc_switch(jQuery(i).data("tourtarget"),jQuery(r).data("tourtarget"))}jQuery("div",this.$message).html(jQuery(i).children("div").html());this.$items.removeClass("tlypageguide-active");jQuery(i).addClass("tlypageguide-active");if(!tl.pg.isScrolledIntoView(jQuery(i))){jQuery("html,body").animate({scrollTop:jQuery(i).offset().top-50},500)}var s=100;var o=this.$message.css("height");this.$message.css("height","auto");var u=this.$message.height();this.$message.css("height",o);if(u<s){u=s}if(u>jQuery(window).height()/2){u=jQuery(window).height()/2}u=u+"px";this.$message.not(":visible").show().animate({height:u},500);this.roll_number(jQuery("span",this.$message),jQuery(i).children("ins").html(),t)};tl.pg.PageGuide.prototype.roll_number=function(e,t,n){e.animate({"text-indent":(n?"":"-")+"50px"},"fast",function(){e.html(t);e.css({"text-indent":(n?"-":"")+"50px"},"fast").animate({"text-indent":"0"},"fast")})};tl.pg.PageGuide.prototype.position_tour=function(){this.$items=this.$all_items.filter(function(){return jQuery(jQuery(this).data("tourtarget")).is(":visible")});this.$items.each(function(){var e=jQuery(this),t=jQuery(e.data("tourtarget")).filter(":visible:first"),n=e.data("position"),r=t.offset().left,i=t.offset().top;if(n=="fixed"){i-=jQuery(window).scrollTop()}if(e.hasClass("tlypageguide_top")){i-=60}else if(e.hasClass("tlypageguide_bottom")){i+=t.outerHeight()+15}else{i+=5}if(e.hasClass("tlypageguide_right")){r+=t.outerWidth(false)+15}else if(e.hasClass("tlypageguide_left")){r-=65}else{r+=5}e.css({left:r+"px",top:i+"px",position:n})})};tl.pg.PageGuide.prototype.pop_welcome=function(){jQuery("body").addClass("tlyPageGuideWelcomeOpen")};tl.pg.PageGuide.prototype.close_welcome=function(){jQuery("body").removeClass("tlyPageGuideWelcomeOpen")}

Revert "Out with the old."