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.

20 lines
229 KiB

9 years ago
9 years ago
  1. /*
  2. * # Semantic UI - 2.0.0
  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){e.site=e.fn.site=function(o){var a,r,s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,d=[].slice.call(arguments,1),m=e.isPlainObject(o)?e.extend(!0,{},e.site.settings,o):e.extend({},e.site.settings),f=m.namespace,g=m.error,p="module-"+f,v=e(n),h=v,b=this,y=h.data(p);return a={initialize:function(){a.instantiate()},instantiate:function(){a.verbose("Storing instance of site",a),y=a,h.data(p,a)},normalize:function(){a.fix.console(),a.fix.requestAnimationFrame()},fix:{console:function(){a.debug("Normalizing window.console"),(console===i||console.log===i)&&(a.verbose("Console not available, normalizing events"),a.disable.console()),("undefined"==typeof console.group||"undefined"==typeof console.groupEnd||"undefined"==typeof console.groupCollapsed)&&(a.verbose("Console group not available, normalizing events"),t.console.group=function(){},t.console.groupEnd=function(){},t.console.groupCollapsed=function(){}),"undefined"==typeof console.markTimeline&&(a.verbose("Mark timeline not available, normalizing events"),t.console.markTimeline=function(){})},consoleClear:function(){a.debug("Disabling programmatic console clearing"),t.console.clear=function(){}},requestAnimationFrame:function(){a.debug("Normalizing requestAnimationFrame"),t.requestAnimationFrame===i&&(a.debug("RequestAnimationFrame not available, normailizing event"),t.requestAnimationFrame=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)})}},moduleExists:function(t){return e.fn[t]!==i&&e.fn[t].settings!==i},enabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)&&n.push(t)}),n}},disabled:{modules:function(t){var n=[];return t=t||m.modules,e.each(t,function(e,t){a.moduleExists(t)||n.push(t)}),n}},change:{setting:function(t,n,o,r){o="string"==typeof o?"all"===o?m.modules:[o]:o||m.modules,r=r!==i?r:!0,e.each(o,function(i,o){var s,c=a.moduleExists(o)?e.fn[o].settings.namespace||!1:!0;a.moduleExists(o)&&(a.verbose("Changing default setting",t,n,o),e.fn[o].settings[t]=n,r&&c&&(s=e(":data(module-"+c+")"),s.length>0&&(a.verbose("Modifying existing settings",s),s[o]("setting",t,n))))})},settings:function(t,n,o){n="string"==typeof n?[n]:n||m.modules,o=o!==i?o:!0,e.each(n,function(n,i){var r;a.moduleExists(i)&&(a.verbose("Changing default setting",t,i),e.extend(!0,e.fn[i].settings,t),o&&f&&(r=e(":data(module-"+f+")"),r.length>0&&(a.verbose("Modifying existing settings",r),r[i]("setting",t))))})}},enable:{console:function(){a.console(!0)},debug:function(e,t){e=e||m.modules,a.debug("Enabling debug for modules",e),a.change.setting("debug",!0,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Enabling verbose debug for modules",e),a.change.setting("verbose",!0,e,t)}},disable:{console:function(){a.console(!1)},debug:function(e,t){e=e||m.modules,a.debug("Disabling debug for modules",e),a.change.setting("debug",!1,e,t)},verbose:function(e,t){e=e||m.modules,a.debug("Disabling verbose debug for modules",e),a.change.setting("verbose",!1,e,t)}},console:function(e){if(e){if(y.cache.console===i)return void a.error(g.console);a.debug("Restoring console function"),t.console=y.cache.console}else a.debug("Disabling console function"),y.cache.console=t.console,t.console={clear:function(){},error:function(){},group:function(){},groupCollapsed:function(){},groupEnd:function(){},info:function(){},log:function(){},markTimeline:function(){},warn:function(){}}},destroy:function(){a.verbose("Destroying previous site for",h),h.removeData(p)},cache:{},setting:function(t,n){if(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,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(conso
  12. Element:T,"Execution Time":n})),clearTimeout(m.performance.timer),m.performance.timer=setTimeout(m.performance.display,500)},display:function(){var t=f.name+":",n=0;s=!1,clearTimeout(m.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,a){var r,s,c,l=k;return n=n||d,a=T||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):(m.error(h.method,t),!1);l=l[o]}})),e.isFunction(s)?c=s.apply(a,n):s!==i&&(c=s),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),s}},u?(k===i&&m.initialize(),m.invoke(l)):(k!==i&&k.invoke("destroy"),m.initialize())}),o!==i?o:this},e.fn.checkbox.settings={name:"Checkbox",namespace:"checkbox",debug:!1,verbose:!0,performance:!0,uncheckable:"auto",fireOnInit:!0,onChange:function(){},onChecked:function(){},onUnchecked:function(){},onEnabled:function(){},onDisabled:function(){},className:{checked:"checked",disabled:"disabled",radio:"radio",readOnly:"read-only"},error:{method:"The method you called is not defined"},selector:{checkbox:".ui.checkbox",input:'> input[type="checkbox"], > input[type="radio"]',label:"> label"}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.dimmer=function(t){var o,a=e(this),r=(new Date).getTime(),s=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);return a.each(function(){var d,m,f,g=e.isPlainObject(t)?e.extend(!0,{},e.fn.dimmer.settings,t):e.extend({},e.fn.dimmer.settings),p=g.selector,v=g.namespace,h=g.className,b=g.error,y="."+v,x="module-"+v,C=a.selector||"",w="ontouchstart"in n.documentElement?"touchstart":"click",k=e(this),T=this,S=k.data(x);f={preinitialize:function(){f.is.dimmer()?(m=k.parent(),d=k):(m=k,d=f.has.dimmer()?g.dimmerName?m.find(p.dimmer).filter("."+g.dimmerName):m.find(p.dimmer):f.create())},initialize:function(){f.debug("Initializing dimmer",g),"hover"==g.on?m.on("mouseenter"+y,f.show).on("mouseleave"+y,f.hide):"click"==g.on&&m.on(w+y,f.toggle),f.is.page()&&(f.debug("Setting as a page dimmer",m),f.set.pageDimmer()),f.is.closable()&&(f.verbose("Adding dimmer close event",d),m.on(w+y,p.dimmer,f.event.click)),f.set.dimmable(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),S=f,k.data(x,S)},destroy:function(){f.verbose("Destroying previous module",d),k.removeData(x),m.off(y)},event:{click:function(t){f.verbose("Determining if event occured on dimmer",t),(0===d.find(t.target).length||e(t.target).is(p.content))&&(f.hide(),t.stopImmediatePropagation())}},addContent:function(t){var n=e(t);f.debug("Add content to dimmer",n),n.parent()[0]!==d[0]&&n.detach().appendTo(d)},create:function(){var t=e(g.template.dimmer());return g.variation&&(f.debug("Creating dimmer with variation",g.variation),t.addClass(g.variation)),g.dimmerName&&(f.debug("Creating named dimmer",g.dimmerName),t.addClass(g.dimmerName)),t.appendTo(m),t},show:function(t){t=e.isFunction(t)?t:function(){},f.debug("Showing dimmer",d,g),f.is.dimmed()&&!f.is.animating()||!f.is.enabled()?f.debug("Dimmer is already shown or disabled"):(f.animate.show(t),g.onShow.call(T),g.onChange.call(T))},hide:function(t){t=e.isFunction(t)?t:function(){},f.is.dimmed()||f.is.animating()?(f.debug("Hiding dimmer",d),f.animate.hide(t),g.onHide.call(T),g.onChange.call(T)):f.debug("Dimmer is not visible")},toggle:function(){f.verbose("Toggling dimmer visibility",d),f.is.dimmed()?f.hide():f.show()},animate:{show:function(t){t=e.isFunction(t)?t:function(){},g.useCSS&&e.fn.transition!==i&&d.transition("is supported")?("auto"!==g.opacity&&f.set.opacity(),d.transition({animation:g.transition+" in",queue:!1,duration:f.get.duration(),useFailSafe:!0,onStart:function(){f.set.dimme
  13. })):!1}},add:{label:function(t,n,i){var o,a=y.is.searchSelection()?q:D;return o=e("<a />").addClass(C.label).attr("data-value",t).html(E.label(t,n)),o=x.onLabelCreate.call(o,t,n),y.has.label(t)?void y.debug("Label already exists, skipping",t):(x.label.variation&&o.addClass(x.label.variation),void(i===!0?(y.debug("Animating in label",o),o.addClass(C.hidden).insertBefore(a).transition(x.label.transition,x.label.duration)):(y.debug("Adding selection label",o),o.insertBefore(a))))},message:function(t){var n=I.children(A.message),i=x.templates.message(y.add.variables(t));n.length>0?n.html(i):n=e("<div/>").html(i).addClass(C.message).appendTo(I)},optionValue:function(t){return z.is("select")?(h&&h.disconnect(),e.each(t,function(t,n){var i=z.find('option[value="'+n+'"]'),o=i.length>0;o||(e("<option/>").prop("value",n).html(n).appendTo(z),y.verbose("Adding user addition as an <option>",n))}),void(h&&h.observe(z[0],{childList:!0,subtree:!0}))):!1},userChoice:function(t){var n,i=y.get.item(t),o=I.children(A.addition);if(!y.has.maxSelections()){if(""===t||i)return void o.remove();n=x.templates.addition(t),M.removeClass(C.selected),o.length>0?o.html(n).data(k.value,t).removeClass(C.filtered).addClass(C.selected):o=e("<div/>").html(n).data(k.value,t).addClass(C.addition).addClass(C.item).prependTo(I).addClass(C.selected)}},variables:function(e){var t,n,i=-1!==e.search("{count}"),o=-1!==e.search("{maxCount}"),a=-1!==e.search("{term}");return i&&(t=y.get.selectionCount(),e=e.replace("{count}",t)),o&&(t=y.get.selectionCount(),e=e.replace("{maxCount}",x.maxSelections)),a&&(n=y.get.query(),e=e.replace("{term}",n)),e}},remove:{active:function(){O.removeClass(C.active)},activeLabel:function(){O.find(A.label).removeClass(C.active)},upward:function(e){var t=e||O;t.removeClass(C.upward)},visible:function(){O.removeClass(C.visible)},activeItem:function(){M.removeClass(C.active)},filteredItem:function(){y.has.maxSelections()||(x.useLabels?M.not("."+C.active).removeClass(C.filtered):M.removeClass(C.filtered))},message:function(){I.children(A.message).remove()},searchTerm:function(){y.verbose("Cleared search term"),q.val(""),y.set.filtered()},selected:function(e){var t=y.get.item(e),n=y.get.choiceValue(t);return t?(y.remove.value(n),y.is.multiple()&&(x.useLabels?y.remove.label(n):y.set.text(y.add.variables(w.count))),t.removeClass(C.filtered).removeClass(C.active),void(x.useLabels&&t.removeClass(C.selected))):!1},selectedItem:function(){M.removeClass(C.selected)},value:function(e){var t=z.val();z.is("select")?(y.verbose("Input is <select> removing selected"),z.find('option[value="'+e+'"]').prop("selected",!1)):(y.verbose("Input is csv removing value"),t=y.remove.delimitedValue(e,t),z.val(t).trigger("change")),y.check.maxSelections()},delimitedValue:function(t,n){return"string"!=typeof n?!1:(n=n.split(x.delimiter),n=e.grep(n,function(e){return t!=e}),n=n.join(x.delimiter),y.verbose("Removed value from delimited string",t,n),n)},label:function(e){var t=O.find(A.label),n=t.filter('[data-value="'+e+'"]'),i=t.length,o=t.index(n)+1==i,a=(!y.is.searchSelection()||!y.is.focusedOnSearch())&&o;a?(y.verbose("Animating and removing label",n),n.transition(x.label.transition,x.label.duration,function(){n.remove()})):(y.verbose("Removing label",n),n.remove())},labels:function(t){t=t||O.find(A.label).filter("."+C.active),y.verbose("Removing active label selections",t),t.each(function(){var t=e(this).data("value"),n=y.is.userValue(t);n?(y.remove.value(t),y.remove.label(t)):y.remove.selected(t)})},tabbable:function(){y.has.search()?(y.debug("Searchable dropdown initialized"),q.attr("tabindex","-1"),I.attr("tabindex","-1")):(y.debug("Simple selection dropdown initialized"),O.attr("tabindex","-1"),I.attr("tabindex","-1"))}},has:{search:function(){return q.length>0},input:function(){return z.length>0},menu:function(){return I.length>0},message:function(){return 0!==I.children(A.message).length},label:function(e){var t=O.find(A.label);return t.filter('[data-value="'+e+'"]').length>0},maxSelections:function(){return x.maxSelections&&y.get.selectionCount()>=x.maxSelecti
  14. e}},clear:function(){a.storage.remove(m.key)},storage:{set:function(n,o){var r=a.get.storageOptions();if("localstorage"==m.storageMethod&&t.localStorage!==i)t.localStorage.setItem(n,o),a.debug("Value stored using local storage",n,o);else{if(e.cookie===i)return void a.error(g.noCookieStorage);e.cookie(n,o,r),a.debug("Value stored using cookie",n,o,r)}},get:function(n,o){var r;return"localstorage"==m.storageMethod&&t.localStorage!==i?r=t.localStorage.getItem(n):e.cookie!==i?r=e.cookie(n):a.error(g.noCookieStorage),("undefined"==r||"null"==r||r===i||null===r)&&(r=i),r},remove:function(n){var o=a.get.storageOptions();"local"==m.storageMethod&&t.store!==i?t.localStorage.removeItem(n):e.cookie!==i?e.removeCookie(n,o):a.error(g.noStorage)}},setting:function(t,n){if(a.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,a,t);else{if(n===i)return a[t];a[t]=n}},debug:function(){m.debug&&(m.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,m.name+":"),a.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,m.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var t,n,i;m.performance&&(t=(new Date).getTime(),i=s||t,n=t-i,s=t,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:x,"Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,500)},display:function(){var t=m.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,t){n+=t["Execution Time"]}),t+=" "+n+"ms",r&&(t+=" '"+r+"'"),(console.group!==i||console.table!==i)&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(t,n,r){var s,c,l,u=C;return n=n||d,r=x||r,"string"==typeof t&&u!==i&&(t=t.split(/[\. ]/),s=t.length-1,e.each(t,function(n,o){var r=n!=s?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==i)return c=u[r],!1;if(!e.isPlainObject(u[o])||n==s)return u[o]!==i?(c=u[o],!1):(a.error(g.method,t),!1);u=u[o]}})),e.isFunction(c)?l=c.apply(r,n):c!==i&&(l=c),e.isArray(o)?o.push(l):o!==i?o=[o,l]:l!==i&&(o=l),c}},u?(C===i&&a.initialize(),a.invoke(l)):(C!==i&&C.invoke("destroy"),a.initialize())}),o!==i?o:this},e.fn.nag.settings={name:"Nag",debug:!1,verbose:!1,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noCookieStorage:"$.cookie is not included. A storage solution is required.",noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.popup=function(o){var a,r=e(this),s=e(n),c=r.selector||"",l="ontouchstart"in n.documentElement,u=(new Date).getTime(),d=[],m=arguments[0],f="string"==typeof m,g=[].slice.call(arguments,1);return r.each(function(){var n,r,p,v,h,b=e.isPlainObject(o)?e.extend(!0,{},e.fn.popup.settings,o):e.extend({},e.fn.popup.settings),y=b.selector,x=b.className,C=b.error,w=b.metadata,k=b.namespace,T="."+b.namespace,S="module-"+k,A=e(this),P=e(b.context),E=b.target?e(b.target):A,R=e(t),F=e("body"),O=0,D=!1,q=this,z=A.data(S);h={initialize:function(){h.debug("Initializing",A),h.createID(),h.bind.events(),!h.exists()&&b.preserve&&h.create(),h.instantiate()},instantiate:function(){h.verbose("Storing instance",h),z=h,A.data(S,z)},refresh:function(){b.popup?n=e(b.popup).eq
  15. }},invoke:function(t,o,a){var r,s,c,l=x;return o=o||u,a=y||a,"string"==typeof t&&l!==i&&(t=t.split(/[\. ]/),r=t.length-1,e.each(t,function(n,o){var a=n!=r?o+t[n+1].charAt(0).toUpperCase()+t[n+1].slice(1):t;if(e.isPlainObject(l[a])&&n!=r)l=l[a];else{if(l[a]!==i)return s=l[a],!1;if(!e.isPlainObject(l[o])||n==r)return l[o]!==i?(s=l[o],!1):!1;l=l[o]}})),e.isFunction(s)?c=s.apply(a,o):s!==i&&(c=s),e.isArray(n)?n.push(c):n!==i?n=[n,c]:c!==i&&(n=c),s}},l?(x===i&&d.initialize(),d.invoke(c)):(x!==i&&x.invoke("destroy"),d.initialize())}),n!==i?n:this},e.fn.rating.settings={name:"Rating",namespace:"rating",debug:!1,verbose:!1,performance:!0,initialRating:0,interactive:!0,maxRating:4,clearable:"auto",onRate:function(e){},error:{method:"The method you called is not defined",noMaximum:"No maximum rating specified. Cannot generate HTML automatically"},metadata:{rating:"rating",maxRating:"maxRating"},className:{active:"active",disabled:"disabled",selected:"selected",loading:"loading"},selector:{icon:".icon"},templates:{icon:function(e){for(var t=1,n="";e>=t;)n+='<i class="icon"></i>',t++;return n}}}}(jQuery,window,document),function(e,t,n,i){"use strict";e.fn.search=function(o){var a,r=e(this),s=r.selector||"",c=(new Date).getTime(),l=[],u=arguments[0],d="string"==typeof u,m=[].slice.call(arguments,1);return e(this).each(function(){var f,g=e.isPlainObject(o)?e.extend(!0,{},e.fn.search.settings,o):e.extend({},e.fn.search.settings),p=g.className,v=g.metadata,h=g.regExp,b=g.selector,y=g.error,x=g.namespace,C="."+x,w=x+"-module",k=e(this),T=k.find(b.prompt),S=k.find(b.searchButton),A=k.find(b.results),P=(k.find(b.result),k.find(b.category),this),E=k.data(w);f={initialize:function(){f.verbose("Initializing module"),f.determine.searchFields(),f.bind.events(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),E=f,k.data(w,f)},destroy:function(){f.verbose("Destroying instance"),k.off(C).removeData(w)},bind:{events:function(){f.verbose("Binding events to search"),g.automatic&&(k.on(f.get.inputEvent()+C,b.prompt,f.throttle),T.attr("autocomplete","off")),k.on("focus"+C,b.prompt,f.event.focus).on("blur"+C,b.prompt,f.event.blur).on("keydown"+C,b.prompt,f.handleKeyboard).on("click"+C,b.searchButton,f.query).on("mousedown"+C,b.results,f.event.result.mousedown).on("mouseup"+C,b.results,f.event.result.mouseup).on("click"+C,b.result,f.event.result.click)}},determine:{searchFields:function(){o&&o.searchFields!==i&&(g.searchFields=o.searchFields)}},event:{focus:function(){f.set.focus(),f.has.minimumCharacters()&&(f.query(),f.showResults())},blur:function(e){var t=n.activeElement===this;t||f.resultsClicked||(f.cancel.query(),f.remove.focus(),f.timer=setTimeout(f.hideResults,g.hideDelay))},result:{mousedown:function(){f.resultsClicked=!0},mouseup:function(){f.resultsClicked=!1},click:function(n){f.debug("Search result selected");var i=e(this),o=i.find(b.title).eq(0),a=i.find("a[href]").eq(0),r=a.attr("href")||!1,s=a.attr("target")||!1,c=(o.html(),o.length>0?o.text():!1),l=f.get.results(),u=i.data(v.result)||f.get.result(c,l);return e.isFunction(g.onSelect)&&g.onSelect.call(P,u,l)===!1?void f.debug("Custom onSelect callback cancelled default select action"):(f.hideResults(),c&&f.set.value(c),void(r&&(f.verbose("Opening search link found in result",a),"_blank"==s||n.ctrlKey?t.open(r):t.location.href=r)))}}},handleKeyboard:function(e){var t,n=k.find(b.result),i=k.find(b.category),o=n.index(n.filter("."+p.active)),a=n.length,r=e.which,s={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40};if(r==s.escape&&(f.verbose("Escape key pressed, blurring search field"),T.trigger("blur")),f.is.visible())if(r==s.enter){if(f.verbose("Enter key pressed, selecting active result"),n.filter("."+p.active).length>0)return f.event.result.click.call(n.filter("."+p.active),e),e.preventDefault(),!1}else r==s.upArrow?(f.verbose("Up key pressed, changing active result"),t=0>o-1?o:o-1,i.removeClass(p.active),n.removeClass(p.active).eq(t).addClass(p.active).closest(i).addClass(p.active),e.preventDefault()):r==s.downArrow&&(f.verbose("Down key pressed, c
  16. return q.not(O).filter("."+S.visible).length>0},othersActive:function(){return w.othersVisible()||w.othersAnimating()},hideOthers:function(e){var t=q.not(O).filter("."+S.visible),n=t.length,i=0;e=e||function(){},t.sidebar("hide",function(){i++,i==n&&e()})},toggle:function(){w.verbose("Determining toggled direction"),w.is.hidden()?w.show():w.hide()},pushPage:function(t){var n,i,o,a=w.get.transition(),r="safe"==a?D:"overlay"===a||w.othersActive()?O:j;t=e.isFunction(t)?t:function(){},"scale down"==k.transition&&w.scrollToTop(),w.set.transition(a),w.repaint(),n=function(){w.bind.clickaway(),w.add.bodyCSS(),w.set.animating(),w.set.visible()},i=function(){w.set.dimmed()},o=function(e){e.target==r[0]&&(r.off(C+b,o),w.remove.animating(),w.bind.scrollLock(),t.call(N))},r.off(C+b),r.on(C+b,o),h(n),k.dimPage&&!w.othersVisible()&&h(i)},pullPage:function(t){var n,i,o=w.get.transition(),a="safe"==o?D:"overlay"==o||w.othersActive()?O:j;t=e.isFunction(t)?t:function(){},w.verbose("Removing context push state",w.get.direction()),w.unbind.clickaway(),w.unbind.scrollLock(),n=function(){w.set.transition(o),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersVisible()&&j.removeClass(S.dimmed)},i=function(e){e.target==a[0]&&(a.off(C+b,i),w.remove.animating(),w.remove.transition(),w.remove.bodyCSS(),("scale down"==o||k.returnScroll&&w.is.mobile())&&w.scrollBack(),t.call(N))},a.off(C+b),a.on(C+b,i),h(n)},legacyPushPage:function(t){var n=O.width(),i=w.get.direction(),o={};n=n||O.width(),t=e.isFunction(t)?t:function(){},o[i]=n,w.debug("Using javascript to push context",o),w.set.visible(),w.set.transition(),w.set.animating(),k.dimPage&&j.addClass(S.dimmed),D.css("position","relative").animate(o,k.duration,k.easing,function(){w.remove.animating(),w.bind.clickaway(),t.call(N)})},legacyPullPage:function(t){var n=0,i=w.get.direction(),o={};n=n||O.width(),t=e.isFunction(t)?t:function(){},o[i]="0px",w.debug("Using javascript to pull context",o),w.unbind.clickaway(),w.set.animating(),w.remove.visible(),k.dimPage&&!w.othersActive()&&j.removeClass(S.dimmed),D.css("position","relative").animate(o,k.duration,k.easing,function(){w.remove.animating(),t.call(N)})},scrollToTop:function(){w.verbose("Scrolling to top of page to avoid animation issues"),x=e(t).scrollTop(),O.scrollTop(0),t.scrollTo(0,0)},scrollBack:function(){w.verbose("Scrolling back to original page position"),t.scrollTo(0,x)},clear:{cache:function(){w.verbose("Clearing cached dimensions"),w.cache={}}},set:{ios:function(){l.addClass(S.ios)},pushed:function(){D.addClass(S.pushed)},pushable:function(){D.addClass(S.pushable)},dimmed:function(){j.addClass(S.dimmed)},active:function(){O.addClass(S.active)},animating:function(){O.addClass(S.animating)},transition:function(e){e=e||w.get.transition(),O.addClass(e)},direction:function(e){e=e||w.get.direction(),O.addClass(S[e])},visible:function(){O.addClass(S.visible)},overlay:function(){O.addClass(S.overlay)}},remove:{bodyCSS:function(){w.debug("Removing body css styles",r),r&&r.length>0&&r.remove()},pushed:function(){D.removeClass(S.pushed)},pushable:function(){D.removeClass(S.pushable)},active:function(){O.removeClass(S.active)},animating:function(){O.removeClass(S.animating)},transition:function(e){e=e||w.get.transition(),O.removeClass(e)},direction:function(e){e=e||w.get.direction(),O.removeClass(S[e])},visible:function(){O.removeClass(S.visible)},overlay:function(){O.removeClass(S.overlay)}},get:{direction:function(){return O.hasClass(S.top)?S.top:O.hasClass(S.right)?S.right:O.hasClass(S.bottom)?S.bottom:S.left},transition:function(){var e,t=w.get.direction();return e=w.is.mobile()?"auto"==k.mobileTransition?k.defaultTransition.mobile[t]:k.mobileTransition:"auto"==k.transition?k.defaultTransition.computer[t]:k.transition,w.verbose("Determined transition",e),e},transitionEvent:function(){var e,t=n.createElement("element"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in o)if(t.style[e]!==i)return o[e]}},is:{ie:function(){var e=!t.ActiveXObject&&"ActiveXObject
  17. C.set.duration(f.duration),f.onStart.call(this),C.debug("Starting tween",e,w.attr("class"))},duration:function(e,t){t=t||f.duration,t="number"==typeof t?t+"ms":t,(t||0===t)&&(C.verbose("Setting animation duration",t),w.css({"animation-duration":t}))},display:function(){var e=C.get.style(),t=C.get.displayType(),n=e+"display: "+t+" !important;";w.css("display",""),C.refresh(),w.css("display")!==t&&(C.verbose("Setting inline visibility to",t),w.attr("style",n))},direction:function(){w.is(":visible")&&!C.is.hidden()?(C.debug("Automatically determining the direction of animation","Outward"),w.removeClass(v.inward).addClass(v.outward)):(C.debug("Automatically determining the direction of animation","Inward"),w.removeClass(v.outward).addClass(v.inward))},looping:function(){C.debug("Transition set to loop"),w.addClass(v.looping)},hidden:function(){C.is.hidden()||w.addClass(v.transition).addClass(v.hidden),"none"!==w.css("display")&&(C.verbose("Overriding default display to hide element"),w.css("display","none"))},visible:function(){w.addClass(v.transition).addClass(v.visible)}},save:{displayType:function(e){"none"!==e&&w.data(h.displayType,e)},transitionExists:function(t,n){e.fn.transition.exists[t]=n,C.verbose("Saving existence of transition",t,n)},conditions:function(){w.removeClass(f.animation),C.remove.direction(),C.cache={className:w.attr("class"),style:C.get.style()},C.verbose("Saving original attributes",C.cache)}},restore:{conditions:function(){return C.cache===i?!1:(C.cache.className?w.attr("class",C.cache.className):w.removeAttr("class"),C.cache.style?(C.verbose("Restoring original style attribute",C.cache.style),w.attr("style",C.cache.style)):(C.verbose("Clearing style attribute"),w.removeAttr("style")),void C.verbose("Restoring original attributes",C.cache))}},add:{failSafe:function(){var e=C.get.duration();C.timer=setTimeout(function(){w.trigger(b)},e+f.failSafeDelay),C.verbose("Adding fail safe timer",C.timer)}},remove:{animating:function(){w.removeClass(v.animating)},animation:function(){w.css({"-webkit-animation":"","-moz-animation":"","-ms-animation":"","-o-animation":"",animation:""})},animationCallbacks:function(){C.remove.queueCallback(),C.remove.completeCallback()},queueCallback:function(){w.off(".queue"+x)},completeCallback:function(){w.off(".complete"+x)},display:function(){w.css("display","")},direction:function(){w.removeClass(v.inward).removeClass(v.outward)},failSafe:function(){C.verbose("Removing fail safe timer",C.timer),C.timer&&clearTimeout(C.timer)},hidden:function(){w.removeClass(v.hidden)},visible:function(){w.removeClass(v.visible)},looping:function(){C.debug("Transitions are no longer looping"),C.is.looping()&&(C.reset(),w.removeClass(v.looping))},transition:function(){w.removeClass(v.visible).removeClass(v.hidden)}},get:{settings:function(t,n,i){return"object"==typeof t?e.extend(!0,{},e.fn.transition.settings,t):"function"==typeof i?e.extend({},e.fn.transition.settings,{animation:t,onComplete:i,duration:n}):"string"==typeof n||"number"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,duration:n}):"object"==typeof n?e.extend({},e.fn.transition.settings,n,{animation:t}):"function"==typeof n?e.extend({},e.fn.transition.settings,{animation:t,onComplete:n}):e.extend({},e.fn.transition.settings,{animation:t})},direction:function(t){return t=t||f.animation,"string"==typeof t&&(t=t.split(" "),e.each(t,function(e,t){return t===v.inward?v.inward:t===v.outward?v.outward:void 0})),C.can.transition()?w.is(":visible")&&!C.is.hidden()?v.outward:v.inward:"static"},duration:function(e){return e=e||f.duration,e===!1&&(e=w.css("animation-duration")||0),"string"==typeof e?e.indexOf("ms")>-1?parseFloat(e):1e3*parseFloat(e):e},displayType:function(){return f.displayType?f.displayType:(w.data(h.displayType)===i&&C.can.transition(!0),w.data(h.displayType))},style:function(){var e=w.attr("style")||"";return e.replace(/display.*?;/,"")},transitionExists:function(t){return e.fn.transition.exists[t]},animationStartEvent:function(){var e,t=n.createElement("div"),o={animation:"animationstart",OAnimation:"oAnim
  18. }},refresh:function(){f.debug("Refreshing constants (width/height)"),f.reset(),f.save.position(),f.checkVisibility(),g.onRefresh.call(S)},reset:function(){f.verbose("Reseting all cached values"),e.isPlainObject(f.cache)&&(f.cache.screen={},f.cache.element={})},checkVisibility:function(e){f.verbose("Checking visibility of element",f.cache.element),f.is.visible()&&(f.save.scroll(e),f.save.calculations(),f.passed(),f.passingReverse(),f.topVisibleReverse(),f.bottomVisibleReverse(),f.topPassedReverse(),f.bottomPassedReverse(),f.onScreen(),f.offScreen(),f.passing(),f.topVisible(),f.bottomVisible(),f.topPassed(),f.bottomPassed(),g.onUpdate&&g.onUpdate.call(S,f.get.elementCalculations()))},passed:function(t,n){var o=f.get.elementCalculations();if(t&&n)g.onPassed[t]=n;else{if(t!==i)return f.get.pixelsPassed(t)>o.pixelsPassed;o.passing&&e.each(g.onPassed,function(e,t){o.bottomVisible||o.pixelsPassed>f.get.pixelsPassed(e)?f.execute(t,e):g.once||f.remove.occurred(t)})}},onScreen:function(e){var t=f.get.elementCalculations(),n=e||g.onOnScreen,o="onScreen";return e&&(f.debug("Adding callback for onScreen",e),g.onOnScreen=e),t.onScreen?f.execute(n,o):g.once||f.remove.occurred(o),e!==i?t.onOnScreen:void 0},offScreen:function(e){var t=f.get.elementCalculations(),n=e||g.onOffScreen,o="offScreen";return e&&(f.debug("Adding callback for offScreen",e),g.onOffScreen=e),t.offScreen?f.execute(n,o):g.once||f.remove.occurred(o),e!==i?t.onOffScreen:void 0},passing:function(e){var t=f.get.elementCalculations(),n=e||g.onPassing,o="passing";return e&&(f.debug("Adding callback for passing",e),g.onPassing=e),t.passing?f.execute(n,o):g.once||f.remove.occurred(o),e!==i?t.passing:void 0},topVisible:function(e){var t=f.get.elementCalculations(),n=e||g.onTopVisible,o="topVisible";return e&&(f.debug("Adding callback for top visible",e),g.onTopVisible=e),t.topVisible?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.topVisible:void 0},bottomVisible:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomVisible,o="bottomVisible";return e&&(f.debug("Adding callback for bottom visible",e),g.onBottomVisible=e),t.bottomVisible?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.bottomVisible:void 0},topPassed:function(e){var t=f.get.elementCalculations(),n=e||g.onTopPassed,o="topPassed";return e&&(f.debug("Adding callback for top passed",e),g.onTopPassed=e),t.topPassed?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.topPassed:void 0},bottomPassed:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomPassed,o="bottomPassed";return e&&(f.debug("Adding callback for bottom passed",e),g.onBottomPassed=e),t.bottomPassed?f.execute(n,o):g.once||f.remove.occurred(o),e===i?t.bottomPassed:void 0},passingReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onPassingReverse,o="passingReverse";return e&&(f.debug("Adding callback for passing reverse",e),g.onPassingReverse=e),t.passing?g.once||f.remove.occurred(o):f.get.occurred("passing")&&f.execute(n,o),e!==i?!t.passing:void 0},topVisibleReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onTopVisibleReverse,o="topVisibleReverse";return e&&(f.debug("Adding callback for top visible reverse",e),g.onTopVisibleReverse=e),t.topVisible?g.once||f.remove.occurred(o):f.get.occurred("topVisible")&&f.execute(n,o),e===i?!t.topVisible:void 0},bottomVisibleReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomVisibleReverse,o="bottomVisibleReverse";return e&&(f.debug("Adding callback for bottom visible reverse",e),g.onBottomVisibleReverse=e),t.bottomVisible?g.once||f.remove.occurred(o):f.get.occurred("bottomVisible")&&f.execute(n,o),e===i?!t.bottomVisible:void 0},topPassedReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onTopPassedReverse,o="topPassedReverse";return e&&(f.debug("Adding callback for top passed reverse",e),g.onTopPassedReverse=e),t.topPassed?g.once||f.remove.occurred(o):f.get.occurred("topPassed")&&f.execute(n,o),e===i?!t.onTopPassed:void 0},bottomPassedReverse:function(e){var t=f.get.elementCalculations(),n=e||g.onBottomPassedReverse,o="bottomPassedReverse";retur