You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
200 KiB

10 years ago
10 years ago
10 years ago
9 years ago
9 years ago
  1. /*
  2. * # Semantic UI
  3. * https://github.com/Semantic-Org/Semantic-UI
  4. * http://www.semantic-ui.com/
  5. *
  6. * Copyright 2014 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. !function(e,t,n,i){"use strict";e.fn.accordion=function(n){{var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(){var d,m,f=e.isPlainObject(n)?e.extend(!0,{},e.fn.accordion.settings,n):e.extend({},e.fn.accordion.settings),g=f.className,p=f.namespace,b=f.selector,v=f.error,h="."+p,y="module-"+p,x=a.selector||"",w=e(this),C=w.find(b.title),T=w.find(b.content),k=this,S=w.data(y);m={initialize:function(){m.debug("Initializing accordion with bound events",w),w.on("click"+h,b.title,m.event.click),m.observeChanges(),m.instantiate()},instantiate:function(){S=m,w.data(y,m)},destroy:function(){m.debug("Destroying previous accordion for",w),w.removeData(y),C.off(h)},refresh:function(){C=w.find(b.title),T=w.find(b.content)},observeChanges:function(){"MutationObserver"in t&&(d=new MutationObserver(function(){m.debug("DOM tree modified, updating selector cache"),m.refresh()}),d.observe(k,{childList:!0,subtree:!0}),m.debug("Setting up mutation observer",d))},event:{click:function(){e.proxy(m.toggle,this)()}},toggle:function(t){var n=t!==i?"number"==typeof t?C.eq(t):e(t):e(this),o=n.next(T),a=o.is(":visible");m.debug("Toggling visibility of content",n),a?f.collapsible?e.proxy(m.close,n)():m.debug("Cannot close accordion content collapsing is disabled"):e.proxy(m.open,n)()},open:function(t){var n=t!==i?"number"==typeof t?C.eq(t):e(t):e(this),o=n.next(T),a=o.is(":animated"),r=o.hasClass(g.active);a||r||(m.debug("Opening accordion content",n),f.exclusive&&e.proxy(m.closeOthers,n)(),n.addClass(g.active),o.stop().children().stop().animate({opacity:1},f.duration,m.reset.display).end().slideDown(f.duration,f.easing,function(){o.addClass(g.active),e.proxy(m.reset.display,this)(),e.proxy(f.onOpen,this)(),e.proxy(f.onChange,this)()}))},close:function(t){var n=t!==i?"number"==typeof t?C.eq(t):e(t):e(this),o=n.next(T),a=o.hasClass(g.active);a&&(m.debug("Closing accordion content",o),n.removeClass(g.active),o.removeClass(g.active).show().stop().children().stop().animate({opacity:0},f.duration,m.reset.opacity).end().slideUp(f.duration,f.easing,function(){e.proxy(m.reset.display,this)(),e.proxy(f.onClose,this)(),e.proxy(f.onChange,this)()}))},closeOthers:function(t){var n,o,a,r=t!==i?C.eq(t):e(this),s=r.parents(b.content).prev(b.title),c=r.closest(b.accordion),l=b.title+"."+g.active+":visible",u=b.content+"."+g.active+":visible";f.closeNested?(n=c.find(l).not(s),a=n.next(T)):(n=c.find(l).not(s),o=c.find(u).find(l).not(s),n=n.not(o),a=n.next(T)),n.size()>0&&(m.debug("Exclusive enabled, closing other content",n),n.removeClass(g.active),a.stop().children().stop().animate({opacity:0},f.duration,m.resetOpacity).end().slideUp(f.duration,f.easing,function(){e(this).removeClass(g.active),e.proxy(m.reset.display,this)()}))},reset:{display:function(){m.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){m.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(t,n){if(m.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,f,t);else{if(n===i)return f[t];f[t]=n}},internal:function(t,n){return m.debug("Changing internal",t,n),n===i?m[t]:void(e.isPlainObject(t)?e.extend(!0,m,t):m[t]=n)},debug:function(){f.debug&&(f.performance?m.performance.log(arguments):(m.debug=Function.prototype.bind.call(console.info,console,f.name+":"),m.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?m.performance.log(arguments):(m.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),m.verbose.apply(console,arguments)))},error:function(){m.error=Function.prototype.bind.call(console.error,console,f.name+":"),m.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;f
  12. return r.each(function(){var p,b,v,h,y=e.isPlainObject(o)?e.extend(!0,{},e.fn.dropdown.settings,o):e.extend({},e.fn.dropdown.settings),x=y.className,w=y.metadata,C=y.namespace,T=y.selector,k=y.error,S="."+C,A="module-"+C,z=e(this),P=z.find(T.text),E=z.find(T.search),F=z.find(T.input),D=z.prev().find(T.text).size()>0?z.prev().find(T.text):z.prev(),O=z.children(T.menu),R=O.find(T.item),j=!1,q=!1,N=this,I=z.data(A);h={initialize:function(){h.debug("Initializing dropdown",y),h.setup.layout(),h.save.defaults(),h.set.selected(),h.create.id(),l&&h.bind.touchEvents(),h.bind.mouseEvents(),h.bind.keyboardEvents(),h.observeChanges(),h.instantiate()},instantiate:function(){h.verbose("Storing instance of dropdown",h),I=h,z.data(A,h)},destroy:function(){h.verbose("Destroying previous dropdown for",z),h.remove.tabbable(),z.off(S).removeData(A),s.off(p)},observeChanges:function(){"MutationObserver"in t&&(v=new MutationObserver(function(){h.debug("DOM tree modified, updating selector cache"),h.refresh()}),v.observe(N,{childList:!0,subtree:!0}),h.debug("Setting up mutation observer",v))},create:{id:function(){h.verbose("Creating unique id for element"),b=h.get.uniqueID(),p="."+b}},search:function(){var e;e=E.val(),h.verbose("Searching for query",e),h.is.searchSelection()&&(h.filter(e),h.can.show()&&h.show())},setup:{layout:function(){z.is("select")&&h.setup.select(),h.is.search()&&!h.is.searchable()&&(E=e("<input />").addClass(x.search).insertBefore(P)),y.allowTab&&h.set.tabbable()},select:function(){var t=h.get.selectValues();h.debug("Dropdown initialized on a select",t),F=z,F.parents(T.dropdown).size()>0?(h.debug("Creating dropdown menu only from template"),z=F.closest(T.dropdown),0===z.find("."+x.dropdown).size()&&e("<div />").addClass(x.menu).html(y.templates.menu(t)).appendTo(z)):(h.debug("Creating entire dropdown from template"),z=e("<div />").attr("class",F.attr("class")).addClass(x.selection).addClass(x.dropdown).html(y.templates.dropdown(t)).insertBefore(F),F.removeAttr("class").prependTo(z)),h.refresh()}},refresh:function(){P=z.find(T.text),E=z.find(T.search),F=z.find(T.input),O=z.children(T.menu),R=O.find(T.item)},toggle:function(){h.verbose("Toggling menu visibility"),h.is.active()?h.hide():h.show()},show:function(t){t=e.isFunction(t)?t:function(){},h.is.active()||h.is.allFiltered()||(h.debug("Showing dropdown"),h.animate.show(function(){h.can.click()&&h.bind.intent(),h.set.visible(),e.proxy(t,N)()}),e.proxy(y.onShow,N)())},hide:function(t){t=e.isFunction(t)?t:function(){},h.is.active()&&(h.debug("Hiding dropdown"),h.animate.hide(function(){h.remove.visible(),e.proxy(t,N)()}),e.proxy(y.onHide,N)())},hideOthers:function(){h.verbose("Finding other dropdowns to hide"),r.not(z).has(T.menu+":visible:not(."+x.animating+")").dropdown("hide")},hideSubMenus:function(){var e=O.find(T.menu);e.transition("hide")},bind:{keyboardEvents:function(){h.debug("Binding keyboard events"),z.on("keydown"+S,h.event.keydown),h.is.searchable()&&z.on(h.get.inputEvent(),T.search,h.event.input)},touchEvents:function(){h.debug("Touch device detected binding additional touch events"),h.is.searchSelection()||z.on("touchstart"+S,h.event.test.toggle),O.on("touchstart"+S,T.item,h.event.item.mouseenter)},mouseEvents:function(){h.verbose("Mouse detected binding mouse events"),h.is.searchSelection()?z.on("mousedown"+S,T.menu,h.event.menu.activate).on("mouseup"+S,T.menu,h.event.menu.deactivate).on("click"+S,T.search,h.show).on("focus"+S,T.search,h.event.searchFocus).on("blur"+S,T.search,h.event.searchBlur):("click"==y.on?z.on("click"+S,h.event.test.toggle):"hover"==y.on?z.on("mouseenter"+S,h.delay.show).on("mouseleave"+S,h.delay.hide):z.on(y.on+S,h.toggle),z.on("mousedown"+S,h.event.mousedown).on("mouseup"+S,h.event.mouseup).on("focus"+S,h.event.focus).on("blur"+S,h.event.blur)),O.on("mouseenter"+S,T.item,h.event.item.mouseenter).on("mouseleave"+S,T.item,h.event.item.mouseleave).on("click"+S,T.item,h.event.item.click)},intent:function(){h.verbose("Binding hide intent event to document"),l&&s.on("touchstart"+p,h.event.test.touch).on("touchmove"+p,h.event.test.touch
  13. })))):k.debug("Modal is already visible")},hideModal:function(t){t=e.isFunction(t)?t:function(){},k.debug("Hiding modal"),e.proxy(S.onHide,q)(),(k.is.animating()||k.is.active())&&(S.transition&&e.fn.transition!==i&&O.transition("is supported")?(k.remove.active(),O.transition({debug:S.debug,animation:S.transition+" out",queue:S.queue,duration:S.duration,useFailSafe:!0,onStart:function(){k.othersActive()||k.hideDimmer(),k.remove.keyboardShortcuts()},onComplete:function(){e.proxy(S.onHidden,q)(),k.restore.focus(),t()}})):(k.remove.active(),k.othersActive()||k.hideDimmer(),k.remove.keyboardShortcuts(),O.fadeOut(S.duration,S.easing,function(){e.proxy(S.onHidden,q)(),k.restore.focus(),t()})))},showDimmer:function(){y.dimmer("is animating")||!y.dimmer("is active")?(k.debug("Showing dimmer"),y.dimmer("show")):k.debug("Dimmer already visible")},hideDimmer:function(){return y.dimmer("is animating")||y.dimmer("is active")?void y.dimmer("hide",function(){S.transition&&e.fn.transition!==i&&O.transition("is supported")&&(k.remove.clickaway(),k.remove.screenHeight())}):void k.debug("Dimmer is not visible cannot hide")},hideAll:function(t){t=e.isFunction(t)?t:function(){},r.is(":visible")&&(k.debug("Hiding all visible modals"),k.hideDimmer(),r.filter(":visible").modal("hide modal",t))},hideOthers:function(t){t=e.isFunction(t)?t:function(){},v.is(":visible")&&(k.debug("Hiding other modals",v),v.filter(":visible").modal("hide modal",t))},othersActive:function(){return v.filter("."+z.active).size()>0},add:{keyboardShortcuts:function(){k.verbose("Adding keyboard shortcuts"),c.on("keyup"+F,k.event.keyboard)}},save:{focus:function(){h=e(n.activeElement).blur()}},restore:{focus:function(){h&&h.size()>0&&h.focus()}},remove:{active:function(){O.removeClass(z.active)},clickaway:function(){S.closable&&x.off("click"+w)},screenHeight:function(){k.cache.height>k.cache.pageHeight&&(k.debug("Removing page height"),l.css("height",""))},keyboardShortcuts:function(){k.verbose("Removing keyboard shortcuts"),c.off("keyup"+F)},scrolling:function(){y.removeClass(z.scrolling),O.removeClass(z.scrolling)}},cacheSizes:function(){var o=O.outerHeight();(k.cache===i||0!==o)&&(k.cache={pageHeight:e(n).outerHeight(),height:o+S.offset,contextHeight:"body"==S.context?e(t).height():y.height()}),k.debug("Caching modal and container sizes",k.cache)},can:{fit:function(){return k.cache.height<k.cache.contextHeight}},is:{active:function(){return O.hasClass(z.active)},animating:function(){return O.transition("is supported")?O.transition("is animating"):O.is(":visible")},scrolling:function(){return y.hasClass(z.scrolling)},modernBrowser:function(){return!(t.ActiveXObject||"ActiveXObject"in t)}},set:{autofocus:function(){if(S.autofocus){var e=O.find(":input:visible"),t=e.filter("[autofocus]"),n=t.size()>0?t:e;n.first().focus()}},clickaway:function(){S.closable&&x.on("click"+w,k.event.click)},screenHeight:function(){k.cache.height>k.cache.pageHeight?(k.debug("Modal is taller than page content, resizing page height"),l.css("height",k.cache.height+S.padding)):l.css("height","")},active:function(){O.addClass(z.active)},scrolling:function(){y.addClass(z.scrolling),O.addClass(z.scrolling)},type:function(){k.can.fit()?(k.verbose("Modal fits on screen"),k.othersActive||k.remove.scrolling()):(k.verbose("Modal cannot fit on screen setting to scrolling"),k.set.scrolling())},position:function(){k.verbose("Centering modal on page",k.cache),O.css(k.can.fit()?{top:"",marginTop:-(k.cache.height/2)}:{marginTop:"",top:c.scrollTop()})}},setting:function(t,n){if(k.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,S,t);else{if(n===i)return S[t];S[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,k,t);else{if(n===i)return k[t];k[t]=n}},debug:function(){S.debug&&(S.performance?k.performance.log(arguments):(k.debug=Function.prototype.bind.call(console.info,console,S.name+":"),k.debug.apply(console,arguments)))},verbose:function(){S.verbose&&S.debug&&(S.performance?k.performance.log(arguments):(k.verbose=Function.prototype.bind.call(console.info,console,S.name+":"),k.verbose.ap
  14. }},l?(T===i&&o.initialize(),o.invoke(c)):(T!==i&&o.destroy(),o.initialize())}),n!==i?n:this},e.fn.progress.settings={name:"Progress",namespace:"progress",debug:!1,verbose:!0,performance:!0,random:{min:2,max:5},autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:1,percent:!1,total:!1,value:!1,onChange:function(){},onSuccess:function(){},onActive:function(){},onError:function(){},onWarning:function(){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%"},regExp:{variable:/\{\$*[A-z0-9]+\}/g},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}"},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.rating=function(t){var n,o=e(this),a=o.selector||"",r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);return o.each(function(){var d,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.rating.settings,t):e.extend({},e.fn.rating.settings),f=m.namespace,g=m.className,p=m.metadata,b=m.selector,v=(m.error,"."+f),h="module-"+f,y=this,x=e(this).data(h),w=e(this),C=w.find(b.icon);d={initialize:function(){d.verbose("Initializing rating module",m),0===C.size()&&d.setup.layout(),m.interactive?d.enable():d.disable(),m.initialRating&&(d.debug("Setting initial rating"),d.setRating(m.initialRating)),w.data(p.rating)&&(d.debug("Rating found in metadata"),d.setRating(w.data(p.rating))),d.instantiate()},instantiate:function(){d.verbose("Instantiating module",m),x=d,w.data(h,d)},destroy:function(){d.verbose("Destroying previous instance",x),w.removeData(h),C.off(v)},refresh:function(){C=w.find(b.icon)},setup:{layout:function(){var t=w.data(p.maxRating)||m.maxRating;d.debug("Generating icon html dynamically"),w.html(e.fn.rating.settings.templates.icon(t)),d.refresh()}},event:{mouseenter:function(){var t=e(this);t.nextAll().removeClass(g.selected),w.addClass(g.selected),t.addClass(g.selected).prevAll().addClass(g.selected)},mouseleave:function(){w.removeClass(g.selected),C.removeClass(g.selected)},click:function(){var t=e(this),n=d.getRating(),i=C.index(t)+1,o="auto"==m.clearable?1===C.size():m.clearable;o&&n==i?d.clearRating():d.setRating(i)}},clearRating:function(){d.debug("Clearing current rating"),d.setRating(0)},getRating:function(){var e=C.filter("."+g.active).size();return d.verbose("Current rating retrieved",e),e},enable:function(){d.debug("Setting rating to interactive mode"),C.on("mouseenter"+v,d.event.mouseenter).on("mouseleave"+v,d.event.mouseleave).on("click"+v,d.event.click),w.removeClass(g.disabled)},disable:function(){d.debug("Setting rating to read-only mode"),C.off(v),w.addClass(g.disabled)},setRating:function(t){var n=t-1>=0?t-1:0,i=C.eq(n);w.removeClass(g.selected),C.removeClass(g.selected).removeClass(g.active),t>0&&(d.verbose("Setting current rating to",t),i.prevAll().andSelf().addClass(g.active)),e.proxy(m.onRate,y)(t)},setting:function(t,n){if(d.debug("Changing setting",t,n),e.isPlainObject(t))e.extend(!0,m,t);else{if(n===i)return m[t];m[t]=n}},internal:function(t,n){if(e.isPlainObject(t))e.extend(!0,d,t);else{if(n===i)return d[t];d[t]=n}},debug:function(){m.debug&&(m.performance?d.performance.log(arguments):(d.debug=Function.prototype.bind.call(console.info,console,m.name+":"),d.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?d.performance.log(arguments):(d.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),d.verbose.apply(console,arguments)))},error:function(){d.error=Function.prototype.bind.call(console.error,console,m.name+":"),d.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=r||t,n=t-i,r=t,s.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:y,"Execution Time":n})),clearTi
  15. }),e.proxy(T.onChange,q)(),e.proxy(T.onVisible,q)()):C.debug("Sidebar is already visible")},hide:function(t){var n=T.useLegacy?C.legacyPullPage:C.pullPage;t=e.isFunction(t)?t:function(){},(C.is.visible()||C.is.animating())&&(C.debug("Hiding sidebar",t),C.refreshSidebars(),n(function(){e.proxy(t,q)(),e.proxy(T.onHidden,q)()}),e.proxy(T.onChange,q)(),e.proxy(T.onHide,q)())},othersVisible:function(){return R.not(D).filter("."+S.visible).size()>0},hideOthers:function(e){var t=R.not(D).filter("."+S.visible),e=e||function(){},n=t.size(),i=0;t.sidebar("hide",function(){i++,i==n&&e()})},toggle:function(){C.verbose("Determining toggled direction"),C.is.hidden()?C.show():C.hide()},pushPage:function(t){var n,i,o=C.get.transition(),a="safe"==o?O:"overlay"==o||C.othersVisible()?D:j;t=e.isFunction(t)?t:function(){},"scale down"==T.transition&&C.scrollToTop(),C.set.transition(),C.repaint(),n=function(){C.bind.clickaway(),C.add.bodyCSS(),C.set.animating(),C.set.visible(),C.othersVisible()||T.dimPage&&j.addClass(S.dimmed)},i=function(n){n.target==a[0]&&(a.off(w+h,i),C.remove.animating(),C.bind.scrollLock(),e.proxy(t,q)())},a.off(w+h),a.on(w+h,i),v(n)},pullPage:function(t){var n,i,o=C.get.transition(),a="safe"==o?O:"overlay"==o||C.othersVisible()?D:j;t=e.isFunction(t)?t:function(){},C.verbose("Removing context push state",C.get.direction()),C.unbind.clickaway(),C.unbind.scrollLock(),n=function(){C.set.animating(),C.remove.visible(),T.dimPage&&!C.othersVisible()&&j.removeClass(S.dimmed)},i=function(n){n.target==a[0]&&(a.off(w+h,i),C.remove.animating(),C.remove.transition(),C.remove.bodyCSS(),("scale down"==o||T.returnScroll&&C.is.mobile())&&C.scrollBack(),e.proxy(t,q)())},a.off(w+h),a.on(w+h,i),v(n)},legacyPushPage:function(t){var n=D.width(),i=C.get.direction(),o={};n=n||D.width(),t=e.isFunction(t)?t:function(){},o[i]=n,C.debug("Using javascript to push context",o),C.set.visible(),C.set.transition(),C.set.animating(),T.dimPage&&j.addClass(S.dimmed),O.css("position","relative").animate(o,T.duration,T.easing,function(){C.remove.animating(),C.bind.clickaway(),e.proxy(t,C)()})},legacyPullPage:function(t){var n=0,i=C.get.direction(),o={};n=n||D.width(),t=e.isFunction(t)?t:function(){},o[i]="0px",C.debug("Using javascript to pull context",o),C.unbind.clickaway(),C.set.animating(),C.remove.visible(),T.dimPage&&!C.othersVisible()&&j.removeClass(S.dimmed),O.css("position","relative").animate(o,T.duration,T.easing,function(){C.remove.animating(),e.proxy(t,C)()})},scrollToTop:function(){C.verbose("Scrolling to top of page to avoid animation issues"),x=e(t).scrollTop(),D.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){C.verbose("Scrolling back to original page position"),t.scrollTo(0,x)},set:{ios:function(){l.addClass(S.ios)},pushed:function(){O.addClass(S.pushed)},pushable:function(){O.addClass(S.pushable)},active:function(){D.addClass(S.active)},animating:function(){D.addClass(S.animating)},transition:function(e){e=e||C.get.transition(),D.addClass(e)},direction:function(e){e=e||C.get.direction(),D.addClass(S[e])},visible:function(){D.addClass(S.visible)},overlay:function(){D.addClass(S.overlay)}},remove:{bodyCSS:function(){C.debug("Removing body css styles",r),r.size()>0&&r.remove()},pushed:function(){O.removeClass(S.pushed)},pushable:function(){O.removeClass(S.pushable)},active:function(){D.removeClass(S.active)},animating:function(){D.removeClass(S.animating)},transition:function(e){e=e||C.get.transition(),D.removeClass(e)},direction:function(e){e=e||C.get.direction(),D.removeClass(S[e])},visible:function(){D.removeClass(S.visible)},overlay:function(){D.removeClass(S.overlay)}},get:{direction:function(){return D.hasClass(S.top)?S.top:D.hasClass(S.right)?S.right:D.hasClass(S.bottom)?S.bottom:S.left},transition:function(){var e=C.get.direction();return C.is.mobile()?"auto"==T.mobileTransition?T.defaultTransition.mobile[e]:T.mobileTransition:"auto"==T.transition?T.defaultTransition.computer[e]:T.transition},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"tra
  16. return r.each(function(){var n,g,p,b,v,h=s.className,y=s.metadata,x=s.selector,w=s.error,C="."+s.namespace,T="module-"+s.namespace,k=e(this),S={},A=!0,z=0,P=this,E=k.data(T);o={initialize:function(){o.debug("Initializing tab menu item",k),o.determineTabs(),o.debug("Determining tabs",s.context,g),s.auto&&(o.verbose("Setting up automatic tab retrieval from server"),s.apiSettings={url:s.path+"/{$tab}"}),e.isWindow(P)||(o.debug("Attaching tab activation events to element",k),k.on("click"+C,o.event.click)),o.instantiate()},determineTabs:function(){var t;"parent"===s.context?(k.closest(x.ui).size()>0?(t=k.closest(x.ui),o.verbose("Using closest UI element for determining parent",t)):t=k,n=t.parent(),o.verbose("Determined parent element for creating context",n)):s.context?(n=e(s.context),o.verbose("Using selector for tab context",s.context,n)):n=e("body"),s.childrenOnly?(g=n.children(x.tabs),o.debug("Searching tab context children for tabs",n,g)):(g=n.find(x.tabs),o.debug("Searching tab context for tabs",n,g))},initializeHistory:function(){if(s.history){if(o.debug("Initializing page state"),e.address===i)return o.error(w.state),!1;if("state"==s.historyType){if(o.debug("Using HTML5 to manage state"),s.path===!1)return o.error(w.path),!1;e.address.history(!0).state(s.path)}e.address.bind("change",o.event.history.change)}},instantiate:function(){o.verbose("Storing instance of module",o),k.data(T,o)},destroy:function(){o.debug("Destroying tabs",k),k.removeData(T).off(C)},event:{click:function(t){var n=e(this).data(y.tab);n!==i?(s.history?(o.verbose("Updating page state",t),e.address.value(n)):(o.verbose("Changing tab",t),o.changeTab(n)),t.preventDefault()):o.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||o.get.initialPath(),a=s.templates.determineTitle(n)||!1;o.performance.display(),o.debug("History change event",n,t),v=t,n!==i&&o.changeTab(n),a&&e.address.title(a)}}},refresh:function(){p&&(o.debug("Refreshing tab",p),o.changeTab(p))},cache:{read:function(e){return e!==i?S[e]:!1},add:function(e,t){e=e||p,o.debug("Adding cached content for",e),S[e]=t},remove:function(e){e=e||p,o.debug("Removing cached content for",e),delete S[e]}},set:{state:function(t){e.address.value(t)}},changeTab:function(i){var a=t.history&&t.history.pushState,r=a&&s.ignoreFirstLoad&&A,c=s.auto||e.isPlainObject(s.apiSettings),l=c&&!r?o.utilities.pathToArray(i):o.get.defaultPathArray(i);i=o.utilities.arrayToPath(l),e.each(l,function(t,a){var u,d,m,f,g=l.slice(0,t+1),h=o.utilities.arrayToPath(g),y=o.is.tab(h),x=t+1==l.length,C=o.get.tabElement(h);if(o.verbose("Looking for tab",a),y){if(o.verbose("Tab was found",a),p=h,b=o.utilities.filterArray(l,g),x?f=!0:(d=l.slice(0,t+2),m=o.utilities.arrayToPath(d),f=!o.is.tab(m),f&&o.verbose("Tab parameters found",d)),f&&c)return r?(o.debug("Ignoring remote content on first tab load",h),A=!1,o.cache.add(i,C.html()),o.activate.all(h),e.proxy(s.onTabInit,C)(h,b,v),e.proxy(s.onTabLoad,C)(h,b,v)):(o.activate.navigation(h),o.content.fetch(h,i)),!1;o.debug("Opened local tab",h),o.activate.all(h),o.cache.read(h)||(o.cache.add(h,!0),o.debug("First time tab loaded calling tab init"),e.proxy(s.onTabInit,C)(h,b,v)),e.proxy(s.onTabLoad,C)(h,b,v)}else{if(-1!=i.search("/"))return o.error(w.missingTab,k,n,h),!1;if(u=e("#"+i+', a[name="'+i+'"]'),h=u.closest("[data-tab]").data("tab"),C=o.get.tabElement(h),u&&u.size()>0&&h)return o.debug("No tab found, but deep anchor link present, opening parent tab"),o.activate.all(h),o.cache.read(h)||(o.cache.add(h,!0),o.debug("First time tab loaded calling tab init"),e.proxy(s.onTabInit,C)(h,b,v)),!1}})},content:{fetch:function(t,n){var a,r,c=o.get.tabElement(t),l={dataType:"html",stateContext:c,onSuccess:function(i){o.cache.add(n,i),o.content.update(t,i),t==p?(o.debug("Content loaded",t),o.activate.tab(t)):o.debug("Content loaded in background",t),e.proxy(s.onTabInit,c)(t,b,v),e.proxy(s.onTabLoad,c)(t,b,v)},urlData:{tab:n}},u=c.data(y.promise)||!1,d=u&&"pending"===u.state();n=n||t,r=o.cache.read(n),s.cache&&r?(o.debug("Showing existing content",n),o.content.update(t,r)
  17. },topPassedReverse:function(e){var t=r.get.elementCalculations(),n=e||f.onTopPassedReverse,o="topPassedReverse";return e&&(r.debug("Adding callback for top passed reverse",e),f.onTopPassedReverse=e),t.topPassed?f.once||r.remove.occurred(o):r.get.occurred("topPassed")&&r.execute(n,o),e===i?!t.onTopPassed:void 0},bottomPassedReverse:function(e){var t=r.get.elementCalculations(),n=e||f.onBottomPassedReverse,o="bottomPassedReverse";return e&&(r.debug("Adding callback for bottom passed reverse",e),f.onBottomPassedReverse=e),t.bottomPassed?f.once||r.remove.occurred(o):r.get.occurred("bottomPassed")&&r.execute(n,o),e===i?!t.bottomPassed:void 0},execute:function(t,n){var i=r.get.elementCalculations(),o=r.get.screenCalculations();t=t||!1,t&&(f.continuous?(r.debug("Callback being called continuously",n,i),e.proxy(t,k)(i,o)):r.get.occurred(n)||(r.debug("Conditions met",n,i),e.proxy(t,k)(i,o))),r.save.occurred(n)},remove:{occurred:function(e){e?r.cache.occurred[e]!==i&&r.cache.occurred[e]===!0&&(r.debug("Callback can now be called again",e),r.cache.occurred[e]=!1):r.cache.occurred={}}},save:{calculations:function(){r.verbose("Saving all calculations necessary to determine positioning"),r.save.scroll(),r.save.direction(),r.save.screenCalculations(),r.save.elementCalculations()},occurred:function(e){e&&(r.cache.occurred[e]===i||r.cache.occurred[e]!==!0)&&(r.verbose("Saving callback occurred",e),r.cache.occurred[e]=!0)},scroll:function(){r.cache.scroll=w.scrollTop()+f.offset},direction:function(){var e,t=r.get.scroll(),n=r.get.lastScroll();return e=t>n&&n?"down":n>t&&n?"up":"static",r.cache.direction=e,r.cache.direction},elementPosition:function(){var t=r.get.screenSize();return r.verbose("Saving element position"),e.extend(r.cache.element,{margin:{top:parseInt(x.css("margin-top"),10),bottom:parseInt(x.css("margin-bottom"),10)},fits:k.height<t.height,offset:x.offset(),width:x.outerWidth(),height:x.outerHeight()}),r.cache.element},elementCalculations:function(){var t=r.get.screenCalculations(),n=r.get.elementPosition();f.includeMargin?e.extend(r.cache.element,{top:n.offset.top-n.margin.top,bottom:n.offset.top+n.height+n.margin.bottom}):e.extend(r.cache.element,{top:n.offset.top,bottom:n.offset.top+n.height}),e.extend(r.cache.element,{topVisible:t.bottom>=n.top,topPassed:t.top>=n.top,bottomVisible:t.bottom>=n.bottom,bottomPassed:t.top>=n.bottom,pixelsPassed:0,percentagePassed:0}),e.extend(r.cache.element,{visible:r.cache.element.topVisible||r.cache.element.bottomVisible,passing:r.cache.element.topPassed&&!r.cache.element.bottomPassed,hidden:!r.cache.element.topVisible&&!r.cache.element.bottomVisible}),r.cache.element.passing&&(r.cache.element.pixelsPassed=t.top-n.top,r.cache.element.percentagePassed=(t.top-n.top)/n.height),r.verbose("Updated element calculations",r.cache.element)},screenCalculations:function(){var t=w.scrollTop()+f.offset;return r.cache.scroll===i&&(r.cache.scroll=w.scrollTop()+f.offset),r.save.direction(),e.extend(r.cache.screen,{top:t,bottom:t+r.cache.screen.height}),r.cache.screen},screenSize:function(){r.verbose("Saving window position"),r.cache.screen={height:w.height()}},position:function(){r.save.screenSize(),r.save.elementPosition()}},get:{pixelsPassed:function(e){var t=r.get.elementCalculations();return e.search("%")>-1?t.height*(parseInt(e,10)/100):parseInt(e,10)},occurred:function(e){return r.cache.occurred!==i?r.cache.occurred[e]||!1:!1},direction:function(){return r.cache.direction===i&&r.save.direction(),r.cache.direction},elementPosition:function(){return r.cache.element===i&&r.save.elementPosition(),r.cache.element},elementCalculations:function(){return r.cache.element===i&&r.save.elementCalculations(),r.cache.element},screenCalculations:function(){return r.cache.screen===i&&r.save.screenCalculations(),r.cache.screen},screenSize:function(){return r.cache.screen===i&&r.save.screenSize(),r.cache.screen},scroll:function(){return r.cache.scroll===i&&r.save.scroll(),r.cache.scroll},lastScroll:function(){return r.cache.screen===i?(r.debug("First scroll event, no last scroll could be found"),!1):r.cache.screen.