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.
14 lines
74 KiB
14 lines
74 KiB
/** # Semantic UI
|
|
* Version: 0.1
|
|
* http://github.com/quirkyinc/semantic
|
|
*
|
|
*
|
|
* Copyright 2013 Contributors
|
|
* Released under the MIT license
|
|
* http://opensource.org/licenses/MIT
|
|
*
|
|
* Released: 05/16/2013
|
|
*/
|
|
(function(e,t,n,o){e.fn.accordion=function(t){var n=e.extend(!0,{},e.fn.accordion.settings,t),i=arguments||!1;return e(this).each(function(){var t,a=e(this),s=a.find(n.selector.title),r=(a.find(n.selector.icon),a.find(n.selector.content)),l=a.data("module"),c=n.className;return t={initialize:function(){s.on("click",t.change),a.data("module",t)},change:function(){var o=e(this),i=(o.next(r),o.hasClass(c.active));i?n.collapsible&&e.proxy(t.close,o)():e.proxy(t.open,o)()},open:function(){var t=e(this),o=t.next(r),i=s.filter("."+c.active),a=i.next(s);n.exclusive&&i.size()>0&&(i.removeClass("active"),a.stop().slideUp(n.speed,n.easing,function(){e(this).removeClass("active").removeAttr("style")})),t.addClass(c.active),o.hide().addClass(c.active).stop().slideDown(n.speed,n.easing,function(){e(this).removeAttr("style")})},close:function(){var t=e(this),o=t.next(r);t.removeClass(c.active),o.removeClass(c.active).show().stop().slideUp(n.speed,n.easing,function(){e(this).removeAttr("style")})},debug:function(e){n.debug&&console.info(n.moduleName+": "+e)},error:function(e){console.warn(n.moduleName+": "+e)},invoke:function(i,a,s){var r;return s=s||Array.prototype.slice.call(arguments,2),"string"==typeof i&&l!==o&&(i=i.split("."),e.each(i,function(o,i){return e.isPlainObject(l[i])?(l=l[i],!0):e.isFunction(l[i])?(r=l[i],!0):(t.error(n.errors.method),!1)})),e.isFunction(r)?r.apply(a,s):r}},l!==o&&i?("invoke"==i[0]&&(i=Array.prototype.slice.call(i,1)),t.invoke(i[0],this,Array.prototype.slice.call(i,1))):(t.initialize(),o)}),this},e.fn.accordion.settings={moduleName:"Accordion",debug:!1,exclusive:!0,collapsible:!0,errors:{method:"The method you called is not defined"},className:{active:"active",hover:"hover"},selector:{title:".title",icon:".icon",content:".content"},speed:500,easing:"easeInOutQuint"}})(jQuery,window,document),function(e,t,n,o){e.animationSettings=function(t,n,i,a){return t=n===o?t:"object"==typeof n?e.extend({},t,n):"function"==typeof i?e.extend({},t,{duration:n,complete:i}):"object"==typeof i?e.extend(!0,{},t,{duration:n},i):e.extend({},t,{duration:n,easing:i,complete:a})},e.fn.popIn=function(t,n,o){var i=e.animationSettings(e.fn.popIn.settings,t,n,o),a=e(this),s=a.size(),r=0,l=function(){0==a.filter(":animated").size(),r++,e(this).css("transform","").removeClass(i.className.init),e.proxy(i.eachComplete,this)(),r==s&&e.proxy(i.complete,a)()},c=function(t){e(this).delay(i.delay*t).animate({opacity:i.endOpacity,transform:"scale("+i.endScale+")"},i.duration,i.easing,l)};return i.isLegacyBrowser?a.show():a.addClass(i.className.init).show().css({opacity:i.startOpacity,transform:"scale("+i.startScale+")"}).each(c),e(this)},e.fn.popOut=function(t,n,o){var i=e.animationSettings(e.fn.popIn.settings,t,n,o),a={complete:function(){e(this).hide(),e.proxy(i.complete,this)()},startOpacity:i.endOpacity,endOpacity:0,startScale:i.endScale,endScale:i.startScale},s=e.extend(!0,{},i,a);e(this).popIn(s)},e.fn.popIn.settings={isLegacyBrowser:!1,className:{init:"init"},duration:450,easing:"easeOutExpo",delay:100,startOpacity:0,endOpacity:1,startScale:.7,endScale:1,eachComplete:function(){},complete:function(){}},e.fn.kenBurns=function(t,n,i){var a=e.animationSettings(e.fn.kenBurns.settings,t,n,i),s={randomPosition:function(e,t,n){var n=n!==o?n:t,i=Math.random()*(e+n-(e-t))+(e-t);return parseInt(i,10)},animate:function(){var t={},n={};t=a.useStartPosition?{x:parseInt(e(this).css("background-position-x"),10),y:parseInt(e(this).css("background-position-y"),10)}:{x:s.randomPosition(50,a.xRange),y:s.randomPosition(50,a.yRange)},n.x=t.x>50?s.randomPosition(t.x,a.xMaxTravelDistance,-a.xMinTravelDistance):s.randomPosition(t.x,-a.xMinTravelDistance,a.xMaxTravelDistance),n.y=t.y>50?s.randomPosition(t.y,a.yMaxTravelDistance,-a.yMinTravelDistance):s.randomPosition(t.y,-a.yMinTravelDistance,a.yMaxTravelDistance),e(this).css({backgroundPosition:t.x+"%",backgroundPositionY:t.y+"%"}).stop().animate({backgroundPosition:n.x+"%",backgroundPositionY:n.y+"%"},a.duration,a.easing,a.complete)}};return a.isLegacyBrowser||e(this).each(s.animate),e(this)},e.fn.kenBurns.settings={isLegacyBrowser:!1,duration:1e4,easing:"linear",useStartPosition:!1,xRange:40,yRange:20,xMinTravelDistance:30,xMaxTravelDistance:60,yMinTravelDistance:20,yMaxTravelDistance:40,scale:.1,complete:function(){}}}(jQuery,window,document),function(e,t,n,o){e.api=e.fn.api=function(n){var i,a=e.extend(!0,{},e.api.settings,n),s="function"!=typeof this?this:e("<div/>"),r=a.stateContext?e(a.stateContext):e(s),l="object"==typeof this?e(s):r,c=l.data(a.metadata.action)||a.action||!1,u=a.className,d=a.metadata,f=a.errors;return i={initialize:function(){var s,f,p,m,g,h,v,b=!1,y=(new Date).getTime(),x={},w={},C=a.errors;return a.serializeForm&&e(this).toJSON()!==o&&(x=l.closest("form").toJSON(),e.extend(!0,a.data,x),i.debug("Adding form data to API Request",x)),s=e.proxy(a.beforeSend,l)(a),s===o||s?(c&&(i.debug("Initializing API Request for: ",c),a.api[c]!==o?m=a.api[c]:i.error(C.missingAction)),a.url&&(m=a.url,i.debug("Using specified url: ",m)),m||(i.error(C.missingURL),i.reset()),g=m.match(a.regExpTemplate),g&&(i.debug("Looking for URL variables",g),e.each(g,function(t,s){var r=s.substr(2,s.length-3),c=e.isPlainObject(n.urlData)&&n.urlData[r]!==o?n.urlData[r]:l.data(r)!==o?l.data(r):a.urlData[r];i.verbose("Looking for variable",r,l,l.data(r),a.urlData[r]),c===!1?(i.debug("Removing variable from URL",g),m=m.replace("/"+s,"")):c!==o&&c?m=m.replace(s,c):(i.error(C.missingParameter+r),b=!0)})),b?(i.reset(),o):(p=e.Deferred().always(function(){a.stateContext&&r.removeClass(u.loading),e.proxy(a.complete,l)()}).done(function(t){i.debug("API request successful"),"json"==a.dataType?t.success===!0?e.proxy(a.success,r)(t,a,l):(i.debug("JSON success flag is not set."),t.error!==o?e.proxy(a.failure,r)(t.error,a,l):e.isArray(t.errors)?e.proxy(a.failure,r)(t.errors[0],a,l):t.message!==o?e.proxy(a.failure,r)(t.message,a,l):e.proxy(a.failure,r)(C.error,a,l)):e.proxy(a.success,r)(t,a,l)}).fail(function(t,n,s){var l,c=a.errors[n]!==o?a.errors[n]:s;if(t!==o)if(t.readyState!==o&&4==t.readyState){if(200!=t.status&&s!==o&&""!==s)i.error(C.statusMessage+s);else if("error"==n&&"json"==a.dataType)try{l=e.parseJSON(t.responseText),l&&l.error!==o&&(c=l.error)}catch(d){i.error(C.JSONParse)}r.removeClass(u.loading).addClass(u.error),a.errorLength>0&&setTimeout(function(){r.removeClass(u.error)},a.errorLength),i.debug("API Request error:",c),e.proxy(a.failure,r)(c,a,this)}else i.debug("Request Aborted (Most likely caused by page change)")}),e.extend(!0,w,a,{type:a.method||a.type,data:h,url:m,beforeSend:a.beforeXHR}),a.stateContext&&r.addClass(u.loading),a.progress&&(i.verbose("Adding progress events"),e.extend(!0,w,{xhr:function(){var n=new t.XMLHttpRequest;return n.upload.addEventListener("progress",function(t){var n;t.lengthComputable&&(n=Math.round(1e4*(t.loaded/t.total))/100+"%",e.proxy(a.progress,r)(n,t))},!1),n.addEventListener("progress",function(t){var n;t.lengthComputable&&(n=Math.round(1e4*(t.loaded/t.total))/100+"%",e.proxy(a.progress,r)(n,t))},!1),n}})),i.verbose("Creating AJAX request with settings: ",w),v=e.ajax(w).always(function(){f=a.loadingLength-((new Date).getTime()-y),a.loadingDelay=0>f?0:f}).done(function(e){var t=this;setTimeout(function(){p.resolveWith(t,[e])},a.loadingDelay)}).fail(function(e,t,n){var o=this;"abort"!=t?setTimeout(function(){p.rejectWith(o,[e,t,n])},a.loadingDelay):r.removeClass(u.error).removeClass(u.loading)}),a.stateContext&&l.data(d.promise,p).data(d.xhr,v),o)):(i.error(C.beforeSend),i.reset(),o)},reset:function(){l.data(d.promise,!1).data(d.xhr,!1),r.removeClass(u.error).removeClass(u.loading),i.error(f.exitConditions)},setting:function(e,t){return t===o?a[e]:(a[e]=t,o)},verbose:function(){a.verbose&&i.debug.apply(this,arguments)},debug:function(){var e=[],t=a.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),a.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=a.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),a.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))}},i.initialize(),this},e.fn.apiButton=function(t){return e(this).each(function(){var n,o=e(this),i=e(this).selector||"",a=e.isFunction(t)?e.extend(!0,{},e.api.settings,e.fn.apiButton.settings,{stateContext:this,success:t}):e.extend(!0,{},e.api.settings,e.fn.apiButton.settings,{stateContext:this},t);n={initialize:function(){a.context&&""!==i?e(a.context).on(i,"click."+a.namespace,n.click):o.on("click."+a.namespace,n.click)},click:function(){a.filter&&0!==e(this).filter(a.filter).size()||e.proxy(e.api,this)(a)}},n.initialize()}),this},e.api.settings={moduleName:"API Module",namespace:"api",verbose:!0,debug:!0,api:{},beforeSend:function(e){return e},beforeXHR:function(){},success:function(){},complete:function(){},failure:function(){},progress:!1,errors:{missingAction:"API action used but no url was defined",missingURL:"URL not specified for the API action",missingParameter:"Missing an essential URL parameter: ",timeout:"Your request timed out",error:"There was an error with your request",parseError:"There was an error parsing your request",JSONParse:"JSON could not be parsed during error handling",statusMessage:"Server gave an error: ",beforeSend:"The before send function has aborted the request",exitConditions:"API Request Aborted. Exit conditions met"},className:{loading:"loading",error:"error"},metadata:{action:"action",promise:"promise",xhr:"xhr"},regExpTemplate:/\{\$([A-z]+)\}/g,action:!1,url:!1,urlData:!1,serializeForm:!1,stateContext:!1,method:"get",data:{},dataType:"json",cache:!0,loadingLength:200,errorLength:2e3},e.fn.apiButton.settings={filter:".disabled, .loading",context:!1,stateContext:!1}}(jQuery,window,document),function(e,t,n,o){e.fn.colorize=function(t){var n=e.extend(!0,{},e.fn.colorize.settings,t),i=arguments||!1;return e(this).each(function(t){var a,s,r,l,c,u,d,f,p=e(this),m=e("<canvas />")[0],g=e("<canvas />")[0],h=e("<canvas />")[0],v=new Image,b=n.colors,y=(n.paths,n.namespace),x=n.errors,w=p.data("module-"+y);return f={checkPreconditions:function(){return f.debug("Checking pre-conditions"),!e.isPlainObject(b)||e.isEmptyObject(b)?(f.error(x.undefinedColors),!1):!0},async:function(e){n.async?setTimeout(e,0):e()},getMetadata:function(){f.debug("Grabbing metadata"),l=p.data("image")||n.image||o,c=p.data("name")||n.name||t,u=n.width||p.width(),d=n.height||p.height(),(0===u||0===d)&&f.error(x.undefinedSize)},initialize:function(){f.debug("Initializing with colors",b),f.checkPreconditions()&&f.async(function(){f.getMetadata(),f.canvas.create(),f.draw.image(function(){f.draw.colors(),f.canvas.merge()}),p.data("module-"+y,f)})},redraw:function(){f.debug("Redrawing image"),f.async(function(){f.canvas.clear(),f.draw.colors(),f.canvas.merge()})},change:{color:function(e,t){return f.debug("Changing color",e),b[e]===o?(f.error(x.missingColor),!1):(b[e]=t,f.redraw(),o)}},canvas:{create:function(){f.debug("Creating canvases"),m.width=u,m.height=d,g.width=u,g.height=d,h.width=u,h.height=d,a=m.getContext("2d"),s=g.getContext("2d"),r=h.getContext("2d"),p.append(m),a=p.children("canvas")[0].getContext("2d")},clear:function(){f.debug("Clearing canvas"),r.fillStyle="#FFFFFF",r.fillRect(0,0,u,d)},merge:function(){return e.isFunction(a.blendOnto)?(a.putImageData(s.getImageData(0,0,u,d),0,0),r.blendOnto(a,"multiply"),o):(f.error(x.missingPlugin),o)}},draw:{image:function(e){f.debug("Drawing image"),e=e||function(){},l?(v.src=l,v.onload=function(){s.drawImage(v,0,0),e()}):(f.error(x.noImage),e())},colors:function(){f.debug("Drawing color overlays",b),e.each(b,function(e,t){n.onDraw(r,c,e,t)})}},debug:function(e,t){n.debug&&(t!==o?console.info(n.moduleName+": "+e,t):console.info(n.moduleName+": "+e))},error:function(e){console.warn(n.moduleName+": "+e)},invoke:function(t,i,a){var s;return a=a||Array.prototype.slice.call(arguments,2),"string"==typeof t&&w!==o&&(t=t.split("."),e.each(t,function(t,o){return e.isPlainObject(w[o])?(w=w[o],!0):e.isFunction(w[o])?(s=w[o],!0):(f.error(n.errors.method),!1)})),e.isFunction(s)?s.apply(i,a):!1}},w!==o&&i?("invoke"==i[0]&&(i=Array.prototype.slice.call(i,1)),f.invoke(i[0],this,Array.prototype.slice.call(i,1))):(f.initialize(),o)}),this},e.fn.colorize.settings={moduleName:"Image Colorizer",debug:!0,namespace:"colorize",onDraw:function(){},async:!0,colors:{},metadata:{image:"image",name:"name"},errors:{noImage:"No tracing image specified",undefinedColors:"No default colors specified.",missingColor:"Attempted to change color that does not exist",missingPlugin:"Blend onto plug-in must be included",undefinedHeight:"The width or height of image canvas could not be automatically determined. Please specify a height."}}}(jQuery,window,document),function(e){e.fn.defaultText=function(t){var n="string"==typeof t?e.extend({},e.fn.defaultText.settings,{defaultValue:t}):e.extend(!0,{},e.fn.defaultText.settings,t);return"string"==typeof t&&(t={defaultValue:t}),e.extend(n,t),e(this).each(function(){var t=e(this),o={checkDefault:function(){t.val().toLowerCase()!=n.defaultValue.toLowerCase()&&t.addClass(n.filledClass)},placeholder:{add:function(){0===t.filter(n.disabledClassList).size()&&(t.val()==n.replaceValue?n.alwaysReplace?t.removeClass(n.filledClass).val(t.attr("last")).removeAttr("last"):t.removeClass(n.filledClass).val(n.defaultValue):t.addClass(n.filledClass))},remove:function(){0===t.filter(n.disabledClassList).size()&&(n.alwaysReplace?t.attr("last",t.val()).val(n.replaceValue):t.val().toLowerCase()==n.defaultValue.toLowerCase()&&t.val(n.replaceValue))}}};"auto"==n.defaultValue&&(n.defaultValue=e(this).val()),t.on("focus",o.placeholder.remove).on("blur",o.placeholder.add),o.checkDefault()}),this},e.fn.defaultText.settings={defaultValue:"auto",replaceValue:"",alwaysReplace:!1,disabledClassList:".readonly, .disabled",filledClass:"filled"}}(jQuery,window,document),function(e,t,n,o){e.fn.validateForm=function(t,n){var i,a=e(this),s=e.extend(!0,{},e.fn.validateForm.settings,n),r=arguments[0],l=[].slice.call(arguments,1);return a.each(function(){var n,a=e(this),c=e(this).find(s.selector.group),u=(e(this).find(s.selector.field),e(this).find(s.selector.prompt),[]),d=(a.selector||"",a.data("module-"+s.namespace)),f="string"==typeof r,p=s.namespace,m=s.metadata,g=s.className,h=s.errors;n={initialize:function(){n.verbose("Initializing form validation"),t===o&&e.isEmptyObject(t)?n.error(h.noFields,a):(e.fn.defaultText!==o&&e.each(t,function(e,t){n.field.add.defaultText(t)}),a.on("submit."+p,n.validate.form))},destroy:function(){a.off(p)},field:{find:function(t){var n=a.find(s.selector.field);return n.filter("#"+t).size()>0?n.filter("#"+t):n.filter('[name="'+t+'"]').size()>0?n.filter('[name="'+t+'"]'):n.filter("[data-"+m.validate+'="'+t+'"]').size()>0?n.filter("[data-"+m.validate+'="'+t+'"]'):e("<input/>")},add:{defaultText:function(e){var t=n.field.find(e.identifier);e.defaultText!==o&&t.defaultText(e.defaultText)},error:function(t,o){var i=n.field.find(t.identifier),a=i.closest(c),r=c.find(r),l=0!==r.size();a.addClass(g.error),s.inlineError&&(l||(r=e("<div />").addClass(g.prompt).insertBefore(i)),r.html(o[0]).fadeIn(s.animateSpeed))}},remove:{error:function(e){var t=n.field.find(e.identifier),o=t.closest(c),i=c.find(i);o.removeClass(g.error),s.inlineError&&i.hide()}}},validate:{form:function(o){var i=!0;return u=[],e.each(t,function(e,t){n.validate.field(t)||(i=!1)}),i?e.proxy(s.onSuccess,this)(o):e.proxy(s.onFailure,this)(u)},field:function(t){var i=n.field.find(t.identifier),a=!0,r=[];return t.rules!==o&&e.each(t.rules,function(e,o){n.validate.rule(t,o)||(n.debug("Field is invalid",t.identifier,o.type),r.push(o.prompt),a=!1)}),a?(n.field.remove.error(t,r),s.onValid(i),!0):(u=u.concat(r),n.field.add.error(t,r),e.proxy(s.onInvalid,i)(r),!1)},rule:function(t,i){var r,l,c=n.field.find(t.identifier),u=i.type,d=t.defaultText!==o?t.defaultText:!1,f=c.val()==d?"":c.val(),p=/\[(.*?)\]/i,m=p.exec(u),g=!0;return m!==o&&null!=m?(r=m[1],l=u.replace(m[0],""),g=e.proxy(s.rules[l],a)(f,r)):g="checked"==u?c.filter(":checked").size()>0:s.rules[u](f),g}},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},verbose:function(){s.verbose&&n.debug.apply(this,arguments)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,i,a){var s,r;return a=a||[].slice.call(arguments,2),"string"==typeof t&&d!==o&&(t=t.split("."),s=t.length-1,e.each(t,function(t,i){return e.isPlainObject(d[i])&&t!=s?(d=d[i],!0):d[i]!==o?(r=d[i],!0):(n.error(h.method),!1)})),e.isFunction(r)?r.apply(i,a):r}},f?i=n.invoke(r,this,l):n.initialize()}),i!==o?i:this},e.fn.validateForm.settings={moduleName:"Validate Form Module",debug:!0,verbose:!1,namespace:"validate",animateSpeed:150,inlineError:!1,onValid:function(){},onInvalid:function(){},onSuccess:function(){return!0},onFailure:function(){return!1},metadata:{validate:"validate"},errors:{method:"The method you called is not defined.",noFields:"No validation object specified."},selector:{group:".field",prompt:".prompt",field:"input, textarea, select"},className:{error:"error",prompt:"prompt"},rules:{empty:function(e){return!(e===o||""===e)},email:function(e){var t=RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");return t.test(e)},length:function(e,t){return e!==o?e.length>=t:!1},not:function(e,t){return e!=t},maxLength:function(e,t){return e!==o?t>=e.length:!1},match:function(t,n){var i,a=e(this);return a.find("#"+n).size()>0?i=a.find("#"+n).val():a.find("[name="+n+"]").size()>0?i=a.find("[name="+n+"]").val():a.find('[data-validate="'+n+'"]').size()>0&&(i=a.find('[data-validate="'+n+'"]').val()),i!==o?""+t==""+i:!1},url:function(e){var t=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return t.test(e)}}}}(jQuery,window,document),function(e,t,n,o){e.fn.state=function(t){var n,i=e(this),a=i.selector||"",s=arguments[0],r=[].slice.call(arguments,1),l=(new Date).getTime(),c=[];return i.each(function(){var u,d=e(this),f=e.extend(!0,{},e.fn.state.settings,t),p=this,m=d.data("module-"+f.namespace),g="string"==typeof s,h=f.namespace,v=f.metadata,b=f.className,y=f.states,x=f.text;u={initialize:function(){u.verbose("Initializing module",p),f.automatic&&u.add.defaults(),f.context&&""!==a?(u.allows("hover")&&e(p,f.context).on(a,"mouseenter."+h,u.hover.enable).on(a,"mouseleave."+h,u.hover.disable),u.allows("pressed")&&e(p,f.context).on(a,"mousedown."+h,u.pressed.enable).on(a,"mouseup."+h,u.pressed.disable),u.allows("focus")&&e(p,f.context).on(a,"focus."+h,u.focus.enable).on(a,"blur."+h,u.focus.disable),e(f.context).on(a,"mouseenter."+h,u.text.change).on(a,"mouseleave."+h,u.text.reset).on(a,"click."+h,u.toggle)):(u.allows("hover")&&d.on("mouseenter."+h,u.hover.enable).on("mouseleave."+h,u.hover.disable),u.allows("pressed")&&d.on("mousedown."+h,u.pressed.enable).on("mouseup."+h,u.pressed.disable),u.allows("focus")&&d.on("focus."+h,u.focus.enable).on("blur."+h,u.focus.disable),d.on("mouseenter."+h,u.text.change).on("mouseleave."+h,u.text.reset).on("click."+h,u.toggle)),d.data("module-"+h,u)},destroy:function(){u.verbose("Destroying previous module",p),d.off("."+h)},refresh:function(){u.verbose("Refreshing selector cache",p),d=e(p)},add:{defaults:function(){var n=t&&e.isPlainObject(t.states)?t.states:{};e.each(f.defaults,function(t,i){u.is[t]!==o&&u.is[t]()&&(u.verbose("Adding default states",t,p),e.extend(f.states,i,n))})}},is:{active:function(){return d.hasClass(b.active)},loading:function(){return d.hasClass(b.loading)},inactive:function(){return!d.hasClass(b.active)},enabled:function(){return!d.is(f.filter.active)},disabled:function(){return d.is(f.filter.active)},textEnabled:function(){return!d.is(f.filter.text)},button:function(){return d.is(".button:not(a, .submit)")},input:function(){return d.is("input")}},allows:function(e){return y[e]||!1},enable:function(e){u.allows(e)&&d.addClass(b[e])},disable:function(e){u.allows(e)&&d.removeClass(b[e])},textFor:function(e){return x[e]||!1},focus:{enable:function(){d.addClass(b.focus)},disable:function(){d.removeClass(b.focus)}},hover:{enable:function(){d.addClass(b.hover)},disable:function(){d.removeClass(b.hover)}},pressed:{enable:function(){d.addClass(b.pressed).one("mouseleave",u.pressed.disable)},disable:function(){d.removeClass(b.pressed)}},toggle:function(){var e=d.data(v.promise);u.allows("active")&&u.is.enabled()&&(u.refresh(),e!==o?u.listenTo(e):u.change())},listenTo:function(t){u.debug("API request detected, waiting for state signal",t),t?(x.loading&&u.text.update(x.loading),e.when(t).then(function(){"resolved"==t.state()?(u.debug("API request succeeded"),f.activateTest=function(){return!0},f.deactivateTest=function(){return!0}):(u.debug("API request failed"),f.activateTest=function(){return!1},f.deactivateTest=function(){return!1}),u.change()})):(f.activateTest=function(){return!1},f.deactivateTest=function(){return!1})},change:function(){u.debug("Determining state change direction"),u.is.inactive()?u.activate():u.deactivate(),f.sync&&u.sync(),f.onChange()},activate:function(){e.proxy(f.activateTest,p)()&&(u.debug("Setting state to active"),d.addClass(b.active),u.text.update(x.active))},deactivate:function(){e.proxy(f.deactivateTest,p)()&&(u.debug("Setting state to inactive"),d.removeClass(b.active),u.text.update(x.inactive))},sync:function(){u.verbose("Syncing other buttons to current state"),u.is.active()?i.not(d).state("activate"):i.not(d).state("deactivate")},text:{get:function(){return f.selector.text?d.find(f.selector.text).text():d.html()},flash:function(e,t){var n=u.text.get();e=e||f.text.flash,t=t||f.flashDuration,u.text.update(e),setTimeout(function(){u.text.update(n)},t)},change:function(){u.verbose("Checking if text should be changed"),u.is.textEnabled()&&(u.is.active()?x.hover?(u.verbose("Changing text to hover text",x.hover),u.text.update(x.hover)):x.disable&&(u.verbose("Changing text to disable text",x.disable),u.text.update(x.disable)):x.hover?(u.verbose("Changing text to hover text",x.disable),u.text.update(x.hover)):x.enable&&(u.verbose("Changing text to enable text",x.disable),u.text.update(x.enable)))},reset:function(){var e=x.active||d.data(v.storedText),t=x.inactive||d.data(v.storedText);u.is.textEnabled()&&(u.is.active()&&e?(u.verbose("Resetting active text",e),u.text.update(e)):t&&(u.verbose("Resetting inactive text",e),u.text.update(t)))},update:function(e){var t=u.text.get();e&&e!==t&&(u.debug("Updating text",e),f.selector.text?d.data(v.storedText,e).find(f.selector.text).text(e):d.data(v.storedText,e).html(e))}},setting:function(e,t){return t===o?f[e]:(f[e]=t,o)},performance:{log:function(e){var t,n;f.performance&&(t=(new Date).getTime(),n=t-l,l=t,c.push({Name:e,"Execution Time":n}),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,100))},display:function(){var t=f.moduleName+" Performance ("+a+")";f.moduleName+": "+a+"("+i.size()+" elements)",console.group!==o&&c.length>0&&(console.groupCollapsed(t),console.table?console.table(c):e.each(c,function(e,t){console.log(t.Name+":"+t["Execution Time"])}),console.groupEnd(),c=[])}},verbose:function(){f.verbose&&f.debug&&(u.performance.log(arguments[0]),u.verbose=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},debug:function(){f.debug&&(u.performance.log(arguments[0]),u.verbose=Function.prototype.bind.call(console.info,console,f.moduleName+":"))},error:function(){console.log!==o&&(u.error=Function.prototype.bind.call(console.log,console,f.moduleName+":"))},invoke:function(t,n,i){var a,s;return i=i||[].slice.call(arguments,2),"string"==typeof t&&m!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(m[n])&&t!=a?(m=m[n],!0):m[n]!==o?(s=m[n],!0):(u.error(f.errors.method),!1)})),e.isFunction(s)?s.apply(n,i):s}},g?n=u.invoke(s,this,r):(m!==o&&u.destroy(),u.initialize())}),n!==o?n:this},e.fn.state.settings={moduleName:"State Module",debug:!0,verbose:!1,namespace:"state",performance:!0,onChange:function(){},activateTest:function(){return!0},deactivateTest:function(){return!0},automatic:!0,sync:!1,flashDuration:3e3,filter:{text:".loading, .disabled",active:".disabled"},context:!1,errors:{method:"The method you called is not defined."},metadata:{promise:"promise",storedText:"stored-text"},className:{focus:"focus",hover:"hover",pressed:"down",active:"active",loading:"loading"},selector:{text:!1},defaults:{input:{hover:!0,focus:!0,pressed:!0,loading:!1,active:!1},button:{hover:!0,focus:!1,pressed:!0,active:!1,loading:!0}},states:{hover:!0,focus:!0,pressed:!0,loading:!1,active:!1},text:{flash:!1,hover:!1,active:!1,inactive:!1,enable:!1,disable:!1}}}(jQuery,window,document),function(e,t,n,o){e.fn.chat=function(t,n,i){var a=e.extend(!0,{},e.fn.chat.settings,i),s=arguments||!1;return e(this).each(function(){var i,r,l,c,u,d,f=e(this),p=f.find(a.selector.expandButton),m=f.find(a.selector.userListButton),g=f.find(a.selector.userList),h=(f.find(a.selector.room),f.find(a.selector.userCount)),v=f.find(a.selector.log),b=(f.find(a.selector.message),f.find(a.selector.messageInput)),y=f.find(a.selector.messageButton),x=f.data("module"),w=a.className,C=a.namespace,k="",T={};return d={channel:!1,width:{log:v.width(),userList:g.outerWidth()},initialize:function(){return Pusher===o&&d.error(a.errors.pusher),t===o||n===o?(d.error(a.errors.key),!1):a.endpoint.message||a.endpoint.authentication?(u=new Pusher(t),Pusher.channel_auth_endpoint=a.endpoint.authentication,d.channel=u.subscribe(n),d.channel.bind("pusher:subscription_succeeded",d.user.list.create),d.channel.bind("pusher:subscription_error",d.error),d.channel.bind("pusher:member_added",d.user.joined),d.channel.bind("pusher:member_removed",d.user.left),d.channel.bind("update_messages",d.message.receive),e.each(a.customEvents,function(e,t){d.channel.bind(e,t)}),e.fn.hoverClass!==o&&e.fn.downClass!==o&&(p.hoverClass().downClass(),m.hoverClass().downClass(),y.hoverClass().downClass()),m.on("click."+C,d.event.toggleUserList),p.on("click."+C,d.event.toggleExpand),b.on("keydown."+C,d.event.input.keydown).on("keyup."+C,d.event.input.keyup),y.on("mouseenter."+C,d.event.hover).on("mouseleave."+C,d.event.hover).on("click."+C,d.event.submit),v.animate({scrollTop:v.prop("scrollHeight")},400),f.data("module",d).addClass(w.loading),o):(d.error(a.errors.endpoint),!1)},refresh:function(){m.removeClass(w.active),d.width={log:v.width(),userList:g.outerWidth()},m.hasClass(w.active)&&d.user.list.hide(),f.data("module",d)},user:{updateCount:function(){a.userCount&&(T=f.data("users"),l=0,e.each(T,function(){l++}),h.html(a.templates.userCount(l)))},joined:function(t){T=f.data("users"),"anonymous"!=t.id&&T[t.id]===o&&(T[t.id]=t.info,a.randomColor&&t.info.color===o&&(t.info.color=a.templates.color(t.id)),k=a.templates.userList(t.info),t.info.isAdmin?e(k).prependTo(g).preview({type:"user",placement:"left"}):e(k).appendTo(g).preview({type:"user",placement:"left"}),e.fn.preview!==o&&g.children().last().preview({type:"user",placement:"left"}),a.partingMessages&&(v.append(a.templates.joined(t.info)),d.message.scroll.test()),d.user.updateCount())},left:function(e){T=f.data("users"),e!==o&&"anonymous"!==e.id&&(delete T[e.id],f.data("users",T),g.find("[data-id="+e.id+"]").remove(),a.partingMessages&&(v.append(a.templates.left(e.info)),d.message.scroll.test()),d.user.updateCount())},list:{create:function(t){T={},t.each(function(e){"anonymous"!==e.id&&"undefined"!==e.id&&(a.randomColor&&e.info.color===o&&(e.info.color=a.templates.color(e.id)),k=e.info.isAdmin?a.templates.userList(e.info)+k:k+a.templates.userList(e.info),T[e.id]=e.info)}),f.data("users",T).data("user",T[t.me.id]).removeClass(w.loading),g.html(k),e.fn.preview!==o&&g.children().preview({type:"user",placement:"left"}),d.user.updateCount(),e.proxy(a.onJoin,g.children())()},show:function(){v.animate({width:d.width.log-d.width.userList},{duration:a.speed,easing:a.easing,complete:d.message.scroll.move})},hide:function(){v.stop().animate({width:d.width.log},{duration:a.speed,easing:a.easing,complete:d.message.scroll.move})}}},message:{scroll:{test:function(){c=v.prop("scrollHeight")-v.height(),Math.abs(v.scrollTop()-c)<a.scrollArea&&d.message.scroll.move()},move:function(){c=v.prop("scrollHeight")-v.height(),v.scrollTop(c)}},send:function(t){d.utils.emptyString(t)||e.api({url:a.endpoint.message,method:"POST",data:{chat_message:{content:t,timestamp:(new Date).getTime()}}})},receive:function(e){r=e.data,T=f.data("users"),i=f.data("user"),T[r.userID]!==o&&(i===o||i.id!=r.userID)&&(r.user=T[r.userID],d.message.display(r))},display:function(t){v.append(a.templates.message(t)),d.message.scroll.test(),e.proxy(a.onMessage,v.children().last())()}},expand:function(){f.addClass(w.expand),e.proxy(a.onExpand,f)(),d.refresh()},contract:function(){f.removeClass(w.expand),e.proxy(a.onContract,f)(),d.refresh()},event:{input:{keydown:function(e){13==e.which&&y.addClass(w.down)},keyup:function(e){13==e.which&&(y.removeClass(w.down),d.event.submit())}},submit:function(){var e=b.val(),t=f.data("user");t===o||d.utils.emptyString(e)||(d.message.send(e),d.message.display({user:t,text:e}),d.message.scroll.move(),b.val(""))},toggleExpand:function(){f.hasClass(w.expand)?(p.removeClass(w.active),d.contract()):(p.addClass(w.active),d.expand())},toggleUserList:function(){v.is(":animated")||(m.hasClass(w.active)?(m.removeClass("active"),d.user.list.hide()):(m.addClass(w.active),d.user.list.show()))}},utils:{emptyString:function(e){return"string"==typeof e?-1==e.search(/\S/):!1}},debug:function(e){a.debug&&console.info(a.moduleName+": "+e)},error:function(e){console.warn(a.moduleName+": "+e)},invoke:function(t,n,i){var s;return i=i||Array.prototype.slice.call(arguments,2),"string"==typeof t&&x!==o&&(t=t.split("."),e.each(t,function(t,n){return e.isPlainObject(x[n])?(x=x[n],!0):e.isFunction(x[n])?(s=x[n],!0):(d.error(a.errors.method),!1)})),e.isFunction(s)?s.apply(n,i):!1}},x!==o&&s?("invoke"==s[0]&&(s=Array.prototype.slice.call(s,1)),d.invoke(s[0],this,Array.prototype.slice.call(s,1))):(d.initialize(),o)}),this},e.fn.chat.settings={moduleName:"Chat Module",debug:!1,namespace:"chat",onJoin:function(){},onMessage:function(){},onExpand:function(){},onContract:function(){},customEvents:{},partingMessages:!1,userCount:!0,randomColor:!0,speed:300,easing:"easeOutQuint",scrollArea:9999,endpoint:{message:!1,authentication:!1},errors:{method:"The method you called is not defined",endpoint:"Please define a message and authentication endpoint.",key:"You must specify a pusher key and channel.",pusher:"You must include the Pusher library."},className:{expand:"expand",active:"active",hover:"hover",down:"down",loading:"loading"},selector:{userCount:".actions .message",userListButton:".actions .button.user-list",expandButton:".actions .button.expand",room:".room",userList:".room .user-list",log:".room .log",message:".room .log .message",author:".room log .message .author",messageInput:".talk input",messageButton:".talk .send.button"},templates:{userCount:function(e){return e+" users in chat"},color:function(){var e=["#000000","#333333","#666666","#999999","#CC9999","#CC6666","#CC3333","#993333","#663333","#CC6633","#CC9966","#CC9933","#999966","#CCCC66","#99CC66","#669933","#669966","#33A3CC","#336633","#33CCCC","#339999","#336666","#336699","#6666CC","#9966CC","#333399","#663366","#996699","#993366","#CC6699"];return e[Math.floor(Math.random()*e.length)]
|
|
},message:function(e){var t="";return e.user.isAdmin?(e.user.color="#55356A",t+='<div class="admin message">',t+='<span class="quirky ui flag team"></span>'):t+='<div class="message">',t+="<p>",t+=e.user.color!==o?'<span class="author" style="color: '+e.user.color+';">'+e.user.name+"</span>: ":'<span class="author">'+e.user.name+"</span>: ",t+=""+e.text+" </p>"+"</div>"},joined:function(e){return typeof e.name!==o?'<div class="status">'+e.name+" has joined the chat.</div>":!1},left:function(e){return typeof e.name!==o?'<div class="status">'+e.name+" has left the chat.</div>":!1},userList:function(e){var t="";return e.isAdmin&&(e.color="#55356A"),t+='<div class="user" data-id="'+e.id+'">'+' <div class="image">'+' <img src="'+e.avatarURL+'">'+" </div>",t+=e.color!==o?' <p><a href="/users/'+e.id+'" target="_blank" style="color: '+e.color+';">'+e.name+"</a></p>":' <p><a href="/users/'+e.id+'" target="_blank">'+e.name+"</a></p>",t+="</div>"}}}}(jQuery,window,document),function(e,t,n,o){e.fn.checkbox=function(t){var n,i=e(this),a=e.extend(!0,{},e.fn.checkbox.settings,t),s="."+a.namespace,r="module-"+a.namespace,l=(i.selector||"",(new Date).getTime()),c=[],u=arguments[0],d="string"==typeof u,f=[].slice.call(arguments,1);return i.each(function(){var t,p=e(this),m=e(this).find(a.selector.input),g=p.selector||"",h=this,v=p.data("module-"+a.namespace),b=a.className,y=a.namespace,x=a.errors;t={initialize:function(){a.context&&""!==g?(t.verbose("Initializing checkbox with delegated events",p),e(h,a.context).on(g,"click"+s,t.toggle).data(r,t)):(t.verbose("Initializing checkbox with bound events",p),p.on("click"+s,t.toggle).data(r,t))},destroy:function(){t.verbose("Destroying previous module for",p),p.off(y)},enable:function(){t.debug("Enabling checkbox"),p.addClass(b.active),m.prop("checked",!0),e.proxy(a.onChange,m.get())(),e.proxy(a.onEnable,m.get())()},disable:function(){t.debug("Disabling checkbox"),p.removeClass(b.active),m.prop("checked",!1),e.proxy(a.onChange,m.get())(),e.proxy(a.onDisable,m.get())()},toggle:function(){m.prop("checked")!==o&&m.prop("checked")?t.disable():t.enable()},setting:function(t,n){return n===o?a[t]:(e.isPlainObject(t)?e.extend(!0,a,t):a[t]=n,o)},internal:function(n,i){return i===o?t[n]:(e.isPlainObject(n)?e.extend(!0,t,n):t[n]=i,o)},debug:function(){a.debug&&(t.performance.log(arguments[0]),t.verbose=Function.prototype.bind.call(console.info,console,a.moduleName+":"))},verbose:function(){a.verbose&&a.debug&&(t.performance.log(arguments[0]),t.verbose=Function.prototype.bind.call(console.info,console,a.moduleName+":"))},error:function(){console.log!==o&&(t.error=Function.prototype.bind.call(console.log,console,a.moduleName+":"))},performance:{log:function(e){var n,o,i;a.performance&&(n=(new Date).getTime(),i=l||n,o=n-i,l=n,c.push({Element:h,Name:e,"Execution Time":o}),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100))},display:function(){var t=a.moduleName,n=(a.moduleName+": "+g+"("+i.size()+" elements)",0);g&&(t+="Performance ("+g+")"),(console.group!==o||console.table!==o)&&c.length>0&&(console.groupCollapsed(t),console.table?(e.each(c,function(e,t){n+=t["Execution Time"]}),console.table(c)):e.each(c,function(e,t){n+=t["Execution Time"]}),console.log("Total Execution Time:",n+"ms"),console.groupEnd(),c=[],l=!1)}},invoke:function(n,i,a){var s,r;return i=i||f,a=h||a,"string"==typeof n&&v!==o&&(n=n.split("."),s=n.length-1,e.each(n,function(n,i){return e.isPlainObject(v[i])&&n!=s?(v=v[i],!0):v[i]!==o?(r=v[i],!0):(t.error(x.method),!1)})),e.isFunction(r)?(t.verbose("Executing invoked function",r),r.apply(a,i)):r||!1}},d?(v===o&&t.initialize(),n=t.invoke(u)):(v!==o&&t.destroy(),t.initialize())}),n?n:this},e.fn.checkbox.settings={moduleName:"Checkbox Module",namespace:"checkbox",verbose:!0,debug:!0,performance:!0,context:!1,onChange:function(){},onEnable:function(){},onDisable:function(){},errors:{method:"The method you called is not defined."},selector:{input:"input"},className:{active:"active"}}}(jQuery,window,document),function(e,t,n,o){e.dimScreen=function(t){var n="function"==typeof t?e.extend({},e.fn.modal.settings,{dim:t}):e.extend({},e.fn.modal.settings,t),o=e(n.context),i=o.children(n.selector.dimmer),a=i.size()>0,s=i.css("opacity");return a||(i=e("<div/>").attr("id","dimmer").html('<div class="content"></div>'),o.append(i)),s!=n.opacity&&(i.one("click",function(){n.unDim(),e.unDimScreen()}),0===n.duration?i.css({visibility:"visible"}).find(".content").css({opacity:n.opacity,visibility:"visible"}):i.css({visibility:"visible"}).find(".content").css({opacity:0,visibility:"visible"}).fadeTo(n.duration,n.opacity,n.dim)),this},e.unDimScreen=function(t){var n="function"==typeof t?e.extend({},e.fn.modal.settings,{unDim:t}):e.extend({},e.fn.modal.settings,t),o=e(n.context),i=o.children(n.selector.dimmer),a=i.size()>0;return a&&(n.unDim(),0===n.duration?i.css({visibility:"hidden"}).remove():i.find(".content").fadeTo(n.duration,0,function(){i.remove()})),this},e.fn.modal=function(i){var a,s=e.extend(!0,{},e.fn.modal.settings,i),r=arguments[0],l=[].slice.call(arguments,1);return e(this).each(function(){var i,c=e(this),u=c.find(s.selector.closeButton),d=(e(s.context).find(s.selector.dimmer),e(s.context).children(s.selector.modal)),f=d.not(c),p=c.data("module-"+s.namespace),m="string"==typeof r,g=(s.className,s.namespace);i={initialize:function(){c.on("modalShow."+g,i.show).on("modalHide."+g,i.hide).data("module-"+g,i)},show:function(){var i=c.outerHeight(),a=e(t).height(),r=i>a,l=r?"absolute":"fixed",d=r?"0":"50%",p=r?a/8:-((i-s.closeSpacing)/2),m="absolute"==c.css("position")?p+e(t).prop("pageYOffset"):p,h=m+s.animationOffset;e.fn.popIn!==o?c.addClass(l).css({display:"block",opacity:0,top:d,marginTop:m+"px"}).popIn():c.addClass(l).css({display:"block",opacity:0,top:d,marginTop:h+"px"}).animate({opacity:1,marginTop:m+"px"},s.duration+300,s.easing),f.is(":visible")&&f.filter(":visible").hide(),e.dimScreen({context:s.context,duration:0,dim:function(){e(n).on("keyup."+g,function(e){var t=e.which,n=27;switch(t){case n:c.trigger("modalHide"),e.preventDefault()}}),u.one("click",function(){c.trigger("modalHide")}),s.dim()},unDim:function(){c.trigger("modalHide"),u.unbind("click")}})},hide:function(){e(n).off("keyup."+g),e.unDimScreen({duration:0,unDim:function(){c.popOut(200),s.unDim()}})},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};s.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};s.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,n,a){var r,l;return a=a||[].slice.call(arguments,2),"string"==typeof t&&p!==o&&(t=t.split("."),r=t.length-1,e.each(t,function(t,n){return e.isPlainObject(p[n])&&t!=r?(p=p[n],!0):p[n]!==o?(l=p[n],!0):(i.error(s.errors.method),!1)})),e.isFunction(l)?l.apply(n,a):l}},m?a=i.invoke(r,this,l):i.initialize()}),a!==o?a:this},e.fn.modal.settings={moduleName:"Modal",debug:!1,namespace:"modal",errors:{method:"The method you called is not defined"},dim:function(){},unDim:function(){},hide:function(){},show:function(){},context:"body",opacity:.8,closeSpacing:25,animationOffset:15,duration:400,easing:"easeOutExpo",selector:{dimmer:"#dimmer",modal:".modal",closeButton:".close"}}}(jQuery,window,document),function(e,t,n,o){e.fn.nag=function(n){var i=e.extend(!0,{},e.fn.nag.settings,n),a=arguments||!1;return e(this).each(function(){var n,s,r,l,c,u,d,f,p,m=e(this),g=m.find(i.selector.close),h=e(i.context),v=m.data("module"),b=i.className,y=t.requestAnimationFrame||t.mozRequestAnimationFrame||t.webkitRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,0)};return p={initialize:function(){n=m.offset(),s=m.outerHeight(),r=h.outerWidth(),l=h.outerHeight(),c=h.offset(),m.data("module",p),g.on("mouseenter mouseleave",p.event.hover).on("click",p.dismiss),i.context==t&&"fixed"==i.position&&m.addClass(b.fixed),i.sticky&&("absolute"==i.position?h.on("scroll resize",p.event.scroll):e(t).on("scroll resize",p.event.scroll),e.proxy(p.event.scroll,this)()),i.followLink&&m.on("mouseenter mouseleave",p.event.hover).on("click",p.followLink),i.displayTime>0&&setTimeout(p.hide,i.displayTime),p.should.show()?m.is(":visible")||p.show():p.hide()},refresh:function(){n=m.offset(),s=m.outerHeight(),r=h.outerWidth(),l=h.outerHeight(),c=h.offset()},show:function(){e.fn.popIn!==o?m.popIn(i.duration):m.fadeIn(i.duration,i.easing)},hide:function(){m.fadeOut(i.duration,i.easing)},stick:function(){if(p.refresh(),"fixed"==i.position){var n=e(t).prop("pageYOffset")||e(t).scrollTop(),o=m.hasClass(b.bottom)?c.top+(l-s)-n:c.top-n;m.css({position:"fixed",top:o,left:c.left,width:r-i.scrollBarWidth})}else m.css({top:d})},unStick:function(){m.css({top:""})},dismiss:function(){i.storageMethod&&p.storage.set(i.storedKey,i.storedValue),p.hide()},should:{show:function(){return p.storage.get(i.storedKey)==i.storedValue?!1:!0},stick:function(){return u=h.prop("pageYOffset")||h.scrollTop(),d=m.hasClass(b.bottom)?l-m.outerHeight()+u:u,d>n.top?!0:"fixed"==i.position?!0:!1}},followLink:function(){e.fn.followLink!==o&&m.followLink()},storage:{set:function(t,n){"local"==i.storageMethod&&store!==o?store.set(t,n):e.cookie!==o?e.cookie(t,n):p.error(i.errors.noStorage)},get:function(t){return"local"==i.storageMethod&&store!==o?store.get(t):e.cookie!==o?e.cookie(t):(p.error(i.errors.noStorage),o)}},event:{hover:function(){e(this).toggleClass(b.hover)},scroll:function(){f!==o&&clearTimeout(f),f=setTimeout(function(){p.should.stick()?y(p.stick):p.unStick()},i.lag)}},error:function(e){console.log("Nag Module:"+e)},invoke:function(t,n,a){var s;return a=a||Array.prototype.slice.call(arguments,2),"string"==typeof t&&v!==o&&(t=t.split("."),e.each(t,function(t,n){return e.isPlainObject(v[n])?(v=v[n],!0):e.isFunction(v[n])?(s=v[n],!0):(p.error(i.errors.method),!1)})),e.isFunction(s)?s.apply(n,a):s}},v!==o&&a?("invoke"==a[0]&&(a=Array.prototype.slice.call(a,1)),p.invoke(a[0],this,Array.prototype.slice.call(a,1))):(p.initialize(),o)}),this},e.fn.nag.settings={displayTime:0,followLink:!0,position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!0,lag:0,context:t,errors:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",followLink:"Follow link is set but the plugin is not included"},className:{bottom:"bottom",hover:"hover",fixed:"fixed"},selector:{close:".icon.close"},speed:500,easing:"easeOutQuad"}}(jQuery,window,document),function(e,t,n,o){e.fn.popup=function(i){var a,s=e.extend(!0,{},e.fn.popup.settings,i),r=arguments||!1;return e(this).each(function(){var l,c,u=e(this),d=e(t),f=u.offsetParent(),p=s.inline?u.next(s.selector.popup):d.children(s.selector.popup).last(),m=0,g=u.data("module-"+s.namespace),h=g!==o&&"string"==typeof i,v=s.selector,b=s.className,y=s.errors,x=s.metadata,w=s.namespace;c={initialize:function(){"hover"==s.event?u.on("mouseenter."+w,c.event.mouseenter).on("mouseleave."+w,c.event.mouseleave):u.on(s.event+"."+w,c.event[s.event]),d.on("resize."+w,c.event.resize),u.data("module-"+w,c)},refresh:function(){p=s.inline?u.next(v.popup):d.children(v.popup).last(),f=u.offsetParent()},destroy:function(){c.debug("Destroying existing popups"),u.off("."+w),p.remove()},event:{mouseenter:function(t){var n=this;l=setTimeout(function(){e.proxy(c.toggle,n)(),e(n).hasClass(b.visible)&&t.stopPropagation()},s.delay)},mouseleave:function(){clearTimeout(l),u.is(":visible")&&c.hide()},click:function(t){e.proxy(c.toggle,this)(),e(this).hasClass(b.visible)&&t.stopPropagation()},resize:function(){p.is(":visible")&&c.position()}},create:function(){c.debug("Creating pop-up content");var t=u.data(x.html)||s.html,n=u.data(x.title)||s.title,o=u.data(x.content)||u.attr("title")||s.content;t||o||n?(t||(t=s.template({title:n,content:o})),p=e("<div/>").addClass(b.popup).html(t),s.inline?p.insertAfter(u):p.appendTo(e("body"))):c.error(y.content)},remove:function(){p.remove()},get:{offstagePosition:function(){var n={top:e(t).scrollTop(),bottom:e(t).scrollTop()+e(t).height(),left:0,right:e(t).width()},o={width:p.outerWidth(),height:p.outerHeight(),position:p.offset()},i={},a=[];return o.position&&(i={top:o.position.top<n.top,bottom:o.position.top+o.height>n.bottom,right:o.position.left+o.width>n.right,left:o.position.left<n.left}),e.each(i,function(e,t){t&&a.push(e)}),a.length>0?a.join(" "):!1},nextPosition:function(e){switch(e){case"top left":e="bottom left";break;case"bottom left":e="top right";break;case"top right":e="bottom right";break;case"bottom right":e="top center";break;case"top center":e="bottom center";break;case"bottom center":e="right center";break;case"right center":e="left center";break;case"left center":e="top center"}return e}},toggle:function(){u=e(this),c.debug("Toggling pop-up"),c.refresh(),0===p.size()&&c.create(),u.hasClass(b.visible)?c.hide():c.position()&&c.show()},position:function(n,o){var i,a,r=(e(t).width(),e(t).height(),u.outerWidth()),l=u.outerHeight(),g=p.outerWidth(),h=p.outerHeight(),v=s.inline?u.position():u.offset(),w=s.inline?f.outerWidth():d.outerWidth(),C=s.inline?f.outerHeight():d.outerHeight();switch(n=n||u.data(x.position)||s.position,o=o||u.data(x.arrowOffset)||s.arrowOffset,c.debug("Calculating offset for position",n),n){case"top left":i={top:"auto",bottom:C-v.top+s.distanceAway,left:v.left+o};break;case"top center":i={bottom:C-v.top+s.distanceAway,left:v.left+r/2-g/2+o,top:"auto",right:"auto"};break;case"top right":i={bottom:C-v.top+s.distanceAway,right:w-v.left-r-o,top:"auto",left:"auto"};break;case"left center":i={top:v.top+l/2-h/2,right:w-v.left+s.distanceAway-o,left:"auto",bottom:"auto"};break;case"right center":i={top:v.top+l/2-h/2,left:v.left+r+s.distanceAway+o,bottom:"auto",right:"auto"};break;case"bottom left":i={top:v.top+l+s.distanceAway,left:v.left+o,bottom:"auto",right:"auto"};break;case"bottom center":i={top:v.top+l+s.distanceAway,left:v.left+r/2-g/2+o,bottom:"auto",right:"auto"};break;case"bottom right":i={top:v.top+l+s.distanceAway,right:w-v.left-r-o,left:"auto",bottom:"auto"}}return e.extend(i,{width:p.width()+1}),p.removeAttr("style").removeClass("top right bottom left center").css(i).addClass(n).addClass(b.loading),a=c.get.offstagePosition(),a?(c.debug("Element is outside boundaries ",a),s.maxRecursion>m?(n=c.get.nextPosition(n),m++,c.debug("Trying new position: ",n),c.position(n)):(c.error(y.recursion),m=0,!1)):(c.debug("Position is on stage",n),m=0,!0)},show:function(){c.debug("Showing pop-up"),e(v.popup).filter(":visible").stop().fadeOut(200).prev(u).removeClass(b.visible),u.addClass(b.visible),p.removeClass(b.loading),"pop"==s.animation&&e.fn.popIn!==o?p.stop().popIn(s.duration,s.easing):p.stop().fadeIn(s.duration,s.easing),"click"==s.event&&s.clicktoClose&&(c.debug("Binding popup close event"),e(n).on("click."+w,c.gracefully.hide)),e.proxy(s.onShow,p)()},hide:function(){u.removeClass(b.visible),p.is(":visible")&&(c.debug("Hiding pop-up"),"pop"==s.animation&&e.fn.popOut!==o?p.stop().popOut(s.duration,s.easing,function(){p.hide()}):p.stop().fadeOut(s.duration,s.easing)),"click"==s.event&&s.clicktoClose&&e(n).off("click."+w),e.proxy(s.onHide,p)(),s.inline||c.remove()},gracefully:{hide:function(t){0===e(t.target).closest(v.popup).size()&&c.hide()}},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};s.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};s.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,n,i){var a,r;return i=i||[].slice.call(arguments,2),"string"==typeof t&&g!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(g[n])&&t!=a?(g=g[n],!0):g[n]!==o?(r=g[n],!0):(c.error(s.errors.method),!1)})),e.isFunction(r)?r.apply(n,i):r}},h?a=c.invoke(r[0],this,Array.prototype.slice.call(r,1)):(g&&c.destroy(),c.initialize())}),a!==o?a:this},e.fn.popup.settings={moduleName:"Pop-up Module",debug:!0,namespace:"popup",onShow:function(){},onHide:function(){},content:!1,html:!1,title:!1,position:"top center",delay:0,inline:!0,duration:250,easing:"easeOutQuint",animation:"pop",errors:{content:"Warning: Your popup has no content specified",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},distanceAway:2,arrowOffset:0,maxRecursion:10,event:"hover",clicktoClose:!0,metadata:{content:"content",html:"html",title:"title",position:"position",arrowOffset:"arrowOffset"},className:{popup:"ui popup",visible:"visible",loading:"loading"},selector:{popup:".ui.popup"},template:function(e){var t="";return typeof e!==o&&(typeof e.title!==o&&e.title&&(t+="<h2>"+e.title+"</h2>"),typeof e.content!==o&&e.content&&(t+='<div class="content">'+e.content+"</div>")),t}}}(jQuery,window,document),function(e,t,n,o){e.fn.searchPrompt=function(n,i){var a,s=e.extend(!0,{},e.fn.searchPrompt.settings,i),r=arguments[0],l=[].slice.call(arguments,1);return e(this).each(function(){var i,c=e(this),u=c.find(s.selector.searchPrompt),d=c.find(s.selector.searchButton),f=c.find(s.selector.searchResults),p=(c.find(s.selector.result),c.find(s.selector.category),c.find(s.selector.emptyResult),c.find(s.selector.resultPage),this),m=(c.selector||"",c.data("module-"+s.namespace)),g=m!==o&&"string"==typeof r,h=s.className,v=s.namespace,b=s.errors;i={initialize:function(){var e=u[0],t=e.oninput!==o?"input":e.onpropertychange!==o?"propertychange":"keyup";u.on("focus."+v,i.event.focus).on("blur."+v,i.event.blur).on("keydown."+v,i.handleKeyboard),s.automatic&&u.on(t+"."+v,i.search.throttle),d.on("click."+v,i.search.query),f.on("click."+v,s.selector.result,i.results.select),c.data("module-"+v,i)},event:{focus:function(){c.addClass(h.focus),i.results.show()},blur:function(){i.search.cancel(),c.removeClass(h.focus),i.results.hide()}},handleKeyboard:function(t){var n,o=c.find(s.selector.result),a=c.find(s.selector.category),r=t.which,l={backspace:8,enter:13,escape:27,upArrow:38,downArrow:40},p=h.active,m=o.index(o.filter("."+p)),g=o.size();if(r==l.escape&&u.trigger("blur"),f.filter(":visible").size()>0)if(r==l.enter){if(o.filter("."+p).exists())return e.proxy(i.results.select,o.filter("."+p))(),t.preventDefault(),!1}else r==l.upArrow?(n=0>m-1?m:m-1,a.removeClass(p),o.removeClass(p).eq(n).addClass(p).closest(a).addClass(p),t.preventDefault()):r==l.downArrow&&(n=m+1>=g?m:m+1,a.removeClass(p),o.removeClass(p).eq(n).addClass(p).closest(a).addClass(p),t.preventDefault());else r==l.enter&&(i.search.query(),d.addClass(h.down),u.one("keyup",function(){d.removeClass(h.down)}))},search:{cancel:function(){var e=c.data("xhr")||!1;e&&"resolved"!=e.state()&&e.abort()},throttle:function(){var e,t=u.val(),n=t.length;clearTimeout(c.data("timer")),n>=s.minCharacters?(e=setTimeout(i.search.query,s.searchThrottle),c.data("timer",e)):i.results.hide()},query:function(){var t=u.val(),o=i.search.cache.read(t);o?(i.debug("Reading result for '"+t+"' from cache"),i.results.add(o)):(i.debug("Querying for '"+t+"'"),"object"==typeof n?i.search.local(t):i.search.remote(t),e.proxy(s.onSearchQuery,c)(t))},local:function(t){var o,a=[],r=[],l=e.isArray(s.searchFields)?s.searchFields:[s.searchFields],u=RegExp("(?:s|^)"+t,"i"),d=RegExp(t,"i");c.addClass(h.loading),e.each(l,function(t,o){e.each(n,function(t,n){"string"==typeof n[o]&&-1==e.inArray(n,a)&&-1==e.inArray(n,r)&&(u.test(n[o])?a.push(n):d.test(n[o])&&r.push(n))})}),o=i.results.generate({results:e.merge(a,r)}),c.removeClass(h.loading),i.search.cache.write(t,o),i.results.add(o)},remote:function(t){var a,r=c.data("xhr")!==o?c.data("xhr"):!1,l={stateContext:c,url:n,urlData:{query:t},success:function(e){a=i.results.generate(e),i.search.cache.write(t,a),i.results.add(a)},failure:i.error};r&&"resolved"!=r.state()&&r.abort(),e.extend(!0,l,s.apiSettings),e.api(l)},cache:{read:function(e){var t=c.data("cache");return s.cache&&"object"==typeof t&&t[e]!==o?t[e]:!1},write:function(e,t){var n=c.data("cache")!==o?c.data("cache"):{};n[e]=t,c.data("cache",n)}}},results:{generate:function(t){i.debug("Generating html from response",t);var n=s.templates[s.type],o="";return e.isPlainObject(t.results)&&!e.isEmptyObject(t.results)||e.isArray(t.results)&&t.results.length>0?(s.maxResults>0&&(t.results=e.makeArray(t.results).slice(0,s.maxResults)),t.results.length>0&&(e.isFunction(n)?o=n(t):i.error(b.noTemplate,!1))):o=i.message(b.noResults,"empty"),e.proxy(s.onSearchResults,c)(t),o},add:function(t){("default"==s.onResultsAdd||"default"==e.proxy(s.onResultsAdd,f)(t))&&f.html(t),i.results.show()},show:function(){0===f.filter(":visible").size()&&u.filter(":focus").size()>0&&""!==f.html()&&(f.stop().fadeIn(200),e.proxy(s.onResultsOpen,f)())},hide:function(){f.filter(":visible").size()>0&&(f.stop().fadeOut(200),e.proxy(s.onResultsClose,f)())},followLink:function(){},select:function(n){i.debug("Search result selected");var o=e(this),a=o.find(".title"),r=a.html();if("default"==s.onSelect||"default"==e.proxy(s.onSelect,this)(n)){var l=o.find("a[href]").eq(0),c=l.attr("href"),d=l.attr("target");try{i.results.hide(),u.val(r),"_blank"==d||n.ctrlKey?t.open(c):t.location.href=c}catch(f){}}}},setting:function(e,t){return t===o?s[e]:(s[e]=t,o)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),o.apply(console,e.concat(n)))},message:function(e,t){return t=t||"standard",i.results.add(s.templates.message(e,t)),s.templates.message(e,t)},error:function(e,t){t=t!==o?t:!0,console.warn(s.moduleName+": "+e),t&&e!==o&&i.message(e,"error")},invoke:function(t,n,a){var s,r;return a=a||[].slice.call(arguments,2),"string"==typeof t&&m!==o&&(t=t.split("."),s=t.length-1,e.each(t,function(t,n){return e.isPlainObject(m[n])&&t!=s?(m=m[n],!0):m[n]!==o?(r=m[n],!0):(i.error(b.method),!1)})),e.isFunction(r)?r.apply(n,a):r}},g?a=i.invoke(r,p,l):i.initialize()}),a!==o?a:this},e.fn.searchPrompt.settings={moduleName:"Search Module",debug:!0,namespace:"search",onSelect:"default",onResultsAdd:"default",onSearchQuery:function(){},onSearchResults:function(){},onResultsOpen:function(){},onResultsClose:function(){},automatic:"true",type:"simple",minCharacters:3,searchThrottle:300,maxResults:7,cache:!0,searchFields:["title","description"],apiSettings:{},className:{active:"active",down:"down",focus:"focus",empty:"empty",loading:"loading"},errors:{noResults:"Your search returned no results",logging:"Error in debug logging, exiting.",noTemplate:"A valid template name was not specified.",serverError:"There was an issue with querying the server.",method:"The method you called is not defined."},selector:{searchPrompt:".prompt",searchButton:".search.button",searchResults:".results",category:".category",result:".result",emptyResult:".results .message",resultPage:".results .page"},templates:{message:function(e,t){var n="";return e!==o&&t!==o&&(n+='<div class="message '+t+'">'+'<div class="text">',n+="empty"==t?"<h2>No Results</h2><p>"+e+"</p>":' <div class="text">'+e+"</div>",n+="</div>"),n},categories:function(t){var n="";return t.results!==o?(e.each(t.results,function(t,i){i.results!==o&&i.results.length>0&&(n+='<div class="category"><div class="name">'+i.name+"</div>"+"<ul>",e.each(i.results,function(e,t){n+='<li class="result">',n+='<a href="'+t.url+'"></a>',t.image!==o&&(n+='<div class="image"> <img src="'+t.image+'">'+"</div>"),n+=t.image!==o?'<div class="indented info">':'<div class="info">',t.price!==o&&(n+='<div class="price">'+t.price+"</div>"),t.title!==o&&(n+='<div class="title">'+t.title+"</div>"),t.description!==o&&(n+='<div class="description">'+t.description+"</div>"),n+="</div></li>"}),n+="</ul></div>")}),t.resultPage&&(n+='<a href="'+t.resultPage.url+'" class="result-page">'+t.resultPage.text+"</a>"),n):!1},simple:function(t){var n="";return t.results!==o?(n+="<ul>",e.each(t.results,function(e,t){n+='<li class="result">',t.url!==o&&(n+='<a href="'+t.url+'"></a>'),t.image!==o&&(n+='<div class="image"> <img src="'+t.image+'">'+"</div>"),n+=t.image!==o?'<div class="indented info">':'<div class="info">',t.price!==o&&(n+='<div class="price">'+t.price+"</div>"),t.title!==o&&(n+='<div class="title">'+t.title+"</div>"),t.description!==o&&(n+='<div class="description">'+t.description+"</div>"),n+="</div></li>"}),n+="</ul>",t.resultPage&&(n+='<a href="'+t.resultPage.url+'" class="result-page">'+t.resultPage.text+"</a>"),n):!1}}}}(jQuery,window,document),function(e,t,n,o){e.fn.shape=function(t){var i,a=e(this),s=e.extend(!0,{},e.fn.shape.settings,t),r="."+s.namespace,l="module-"+s.namespace,c=arguments[0],u=[].slice.call(arguments,1),d="string"==typeof c;return a.each(function(){var t,a,f,p=e(this),m=p.find(s.selector.shape),g=p.find(s.selector.side),h="transitionend msTransitionEnd oTransitionEnd",v=(p.selector||"",this),b=p.data(l),y=(s.namespace,s.error),x=s.className;f={initialize:function(){f.verbose("Initializing module for",v),f.set.defaultSide(),b=f,p.data(l,b)},destroy:function(){f.verbose("Destroying previous module for",v),p.removeData(l).off(r)},refresh:function(){f.verbose("Refreshing selector cache for",v),p=e(v),m=e(this).find(s.selector.shape),g=e(this).find(s.selector.side)},repaint:function(){f.verbose("Forcing repaint event");var e=m.get(0)||n.createElement("div");e.offsetWidth},animate:function(n,o){f.verbose("Animating box with properties",n),o=o||function(t){f.reset(),f.set.active(),e.proxy(s.onChange,a)(),t.stopImmediatePropagation()},s.useCSS?(f.verbose("Starting CSS animation"),p.addClass(x.animating),f.set.stageSize(),f.repaint(),p.addClass(x.css),t.addClass(x.hidden),m.css(n).one(h,o)):(f.verbose("Starting javascript animation"),p.addClass(x.animating).removeClass(x.css),f.set.stageSize(),f.repaint(),t.animate({opacity:0},s.duration,s.easing),m.animate(n,s.duration,s.easing,o))},queue:function(e){f.debug("Queueing animation of",e),m.one(h,function(){f.debug("Executing queued animation"),p.shape(e)})},reset:function(){f.verbose("Animating states reset"),p.removeClass(x.css).removeClass(x.animating).removeAttr("style"),m.removeAttr("style"),g.removeAttr("style").removeClass(x.hidden),a.removeClass(x.animating).removeAttr("style")},is:{animating:function(){return p.hasClass(x.animating)}},get:{nextSide:function(){return t.next(s.selector.side).size()>0?t.next(s.selector.side):p.find(s.selector.side).first()}},set:{defaultSide:function(){t=p.find("."+s.className.active),a=t.next(s.selector.side).size()>0?t.next(s.selector.side):p.find(s.selector.side).first(),f.verbose("Active side set to",t),f.verbose("Next side set to",a)},stageSize:function(){var e={width:a.outerWidth(),height:a.outerHeight()};f.verbose("Resizing stage to fit new content",e),p.css({width:e.width,height:e.height})},nextSide:function(e){a=p.find(e),0===a.size()&&f.error(y.side),f.verbose("Next side manually set to",a)},active:function(){f.verbose("Setting new side to active",a),g.removeClass(x.active),a.addClass(x.active),f.set.defaultSide()}},flip:{up:function(){f.debug("Flipping up",a),f.is.animating()?f.queue("flip.up"):(f.stage.above(),f.animate(f.getTransform.up()))},down:function(){f.debug("Flipping down",a),f.is.animating()?f.queue("flip.down"):(f.stage.below(),f.animate(f.getTransform.down()))},left:function(){f.debug("Flipping left",a),f.is.animating()?f.queue("flip.left"):(f.stage.left(),f.animate(f.getTransform.left()))},right:function(){f.debug("Flipping right",a),f.is.animating()?f.queue("flip.right"):(f.stage.right(),f.animate(f.getTransform.right()))},over:function(){f.debug("Flipping over",a),f.is.animating()?f.queue("flip.over"):(f.stage.behind(),f.animate(f.getTransform.behind()))}},getTransform:{up:function(){var e={y:-((t.outerHeight()-a.outerHeight())/2),z:-(t.outerHeight()/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(-90deg)"}},down:function(){var e={y:-((t.outerHeight()-a.outerHeight())/2),z:-(t.outerHeight()/2)};return{transform:"translateY("+e.y+"px) translateZ("+e.z+"px) rotateX(90deg)"}},left:function(){var e={x:-((t.outerWidth()-a.outerWidth())/2),z:-(t.outerWidth()/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(90deg)"}},right:function(){var e={x:-((t.outerWidth()-a.outerWidth())/2),z:-(t.outerWidth()/2)};return{transform:"translateX("+e.x+"px) translateZ("+e.z+"px) rotateY(-90deg)"}},behind:function(){var e={x:-((t.outerWidth()-a.outerWidth())/2)};return{transform:"translateX("+e.x+"px) rotateY(180deg)"}}},stage:{above:function(){var e={origin:(t.outerHeight()-a.outerHeight())/2,depth:{active:a.outerHeight()/2,next:t.outerHeight()/2}};f.verbose("Setting the initial animation position as above",a,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),a.addClass(x.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(90deg) translateZ("+e.depth.next+"px)"})},below:function(){var e={origin:(t.outerHeight()-a.outerHeight())/2,depth:{active:a.outerHeight()/2,next:t.outerHeight()/2}};f.verbose("Setting the initial animation position as below",a,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),a.addClass(x.animating).css({display:"block",top:e.origin+"px",transform:"rotateX(-90deg) translateZ("+e.depth.next+"px)"})},left:function(){var e={origin:(t.outerWidth()-a.outerWidth())/2,depth:{active:a.outerWidth()/2,next:t.outerWidth()/2}};f.verbose("Setting the initial animation position as left",a,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),a.addClass(x.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-90deg) translateZ("+e.depth.next+"px)"})},right:function(){var e={origin:(t.outerWidth()-a.outerWidth())/2,depth:{active:a.outerWidth()/2,next:t.outerWidth()/2}};f.verbose("Setting the initial animation position as left",a,e),t.css({transform:"rotateY(0deg) translateZ("+e.depth.active+"px)"}),a.addClass(x.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(90deg) translateZ("+e.depth.next+"px)"})},behind:function(){var e={origin:(t.outerWidth()-a.outerWidth())/2,depth:{active:a.outerWidth()/2,next:t.outerWidth()/2}};f.verbose("Setting the initial animation position as behind",a,e),t.css({transform:"rotateY(0deg)"}),a.addClass(x.animating).css({display:"block",left:e.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(t,n){if(e.isPlainObject(t))e.extend(!0,s,t);else{if(n===o)return s[t];s[t]=n}},verbose:function(){s.verbose&&f.debug.apply(this,arguments)},debug:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=s.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),s.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,n,i){var a,s;return n=n||u||[].slice.call(arguments,2),i=v||i,"string"==typeof t&&b!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(b[n])&&t!=a?(b=b[n],!0):b[n]!==o?(s=b[n],!0):(f.error(y.method),!1)})),e.isFunction(s)?(f.verbose("Executing invoked function",s),s.apply(i,n)):s||!1}},d?(b===o&&f.initialize(),i=f.invoke(c)):(b!==o&&f.destroy(),f.initialize())}),i?i:this},e.fn.shape.settings={moduleName:"Shape Module",debug:!0,verbose:!0,namespace:"shape",beforeChange:function(){},onChange:function(){},useCSS:!0,duration:1e3,easing:"easeInOutQuad",error:{side:"You tried to switch to a side that does not exist.",method:"The method you called is not defined"},className:{css:"css",animating:"animating",hidden:"hidden",active:"active"},selector:{shape:".shape",side:".side"}}
|
|
}(jQuery,window,document),function(e,t,n,o){e.fn.starReview=function(t){var n=e.extend(!0,{},e.fn.starReview.settings,t),i=arguments||!1;return e(this).each(function(){var t,a=e(this),s=a.find(n.selector.star),r=n.className,l=n.namespace,c=a.data("module");return t={settings:n,initialize:function(){n.rateable&&(e.fn.state!==o&&(a.state(),s.state()),s.bind("mouseenter."+l,t.event.mouseenter).bind("mouseleave."+l,t.event.mouseleave).bind("click."+l,t.event.click)),a.addClass(r.initialize).data("module",t)},setRating:function(t){var o=s.eq(t-1);a.removeClass(r.hover),s.removeClass(r.hover),o.nextAll().removeClass(r.active),o.addClass(r.active).prevAll().addClass(r.active),e.proxy(n.onRate,a)()},event:{mouseenter:function(){var t=e(this);t.nextAll().removeClass(r.hover),a.addClass(r.hover),t.addClass(r.hover).prevAll().addClass(r.hover)},mouseleave:function(){s.removeClass(r.hover)},click:function(){var n=e(this);t.setRating(s.index(n)+1)}},error:function(e){console.warn(n.moduleName+": "+e)},invoke:function(i,a,s){var r;return s=s||Array.prototype.slice.call(arguments,2),"string"==typeof i&&c!==o&&(i=i.split("."),e.each(i,function(o,i){return e.isPlainObject(c[i])?(c=c[i],!0):e.isFunction(c[i])?(r=c[i],!0):(t.error(n.errors.method),!1)})),e.isFunction(r)?r.apply(a,s):!1}},c!==o&&i?("invoke"==i[0]&&(i=Array.prototype.slice.call(i,1)),t.invoke(i[0],this,Array.prototype.slice.call(i,1))):(t.initialize(),o)}),this},e.fn.starReview.settings={moduleName:"Star Module",namespace:"star",rateable:!0,onRate:function(){},className:{initialize:"initialize",loading:"loading",active:"active",hover:"hover",down:"down"},selector:{star:"i"}}}(jQuery,window,document),function(e,t,n,o){e.fn.tabNavigation=function(n){var i,a,s,r,l,c=e.extend(!0,{},e.fn.tabNavigation.settings,n),u=e(this),d=e(c.context).find(c.selector.tabs),f=!0,p={},m=0,g=c.className,h=c.metadata,v=c.namespace,b=c.errors,y=u.data("module"),x=arguments[0],w=y!==o&&"string"==typeof x,C=[].slice.call(arguments,1);return r={initialize:function(){r.debug("Initializing Tabs",u),c.history&&c.path!==!1&&(e.address!==o?(r.verbose("Address library found adding state change event"),e.address.state(c.path).change(r.event.history.change)):r.error(b.state)),e.isWindow(u.get(0))||u.on("click."+v,r.event.click),u.data("module",r)},destroy:function(){r.debug("Destroying tabs",u),u.off("."+v)},event:{click:function(){r.debug("Navigation clicked");var t=e(this).data(h.tab);t!==o?t!==i&&(c.history?e.address.value(t):r.change(t)):r.debug("No tab specified")},history:{change:function(t){var n=t.pathNames.join("/")||r.get.initialPath(),i=c.templates.determineTitle(n)||!1;r.debug("History change event",n,t),s=t,n!==o&&r.change(n),i&&e.address.title(i)}}},refresh:function(){i&&(r.debug("Refreshing tab",i),r.change(i))},cache:{read:function(e){return e!==o?p[e]:p},add:function(e,t){e=e||i,r.debug("Adding cached content for",e),p[e]=t},remove:function(e){e=e||i,r.debug("Removing cached content for",e),delete p[e]}},change:function(n){var l=r.get.defaultPathArray(n);r.deactivate.all(),e.each(l,function(u,d){var m=l.slice(0,u+1),g=r.utils.arrayToPath(m),h=r.utils.last(l)==g,v=r.is.tab(g),b=!v,y=t.history&&t.history.pushState,x=y&&c.ignoreFirstLoad&&f,w=e.isPlainObject(c.apiSettings),C=r.get.tabElement(g);return r.verbose("Looking for tab",d),b?(r.verbose("Tab is not found, assuming it is a parameter",d),!0):(v&&(r.verbose("Tab was found",d),i=g,a=r.utils.filterArray(l,m),h&&w?x?(r.debug("Ignoring remote content on first tab load",g),f=!1,p[n]=C.html(),r.activate.all(g),e.proxy(c.onTabInit,C)(g,a,s)):(r.activate.navigation(g),r.content.fetch(g,c.onTabLoad)):(r.debug("Opened tab",g),r.activate.all(g),e.proxy(c.onTabLoad,C)(g,a,s))),o)})},content:{fetch:function(t){var n=r.get.tabElement(t),l=p[t]||!1,u={dataType:"html",stateContext:n,success:function(o){p[t]=o,r.content.update(t,o),t==i?(r.debug("Content loaded",t),r.activate.tab(t)):r.debug("Content loaded in background",t),e.proxy(c.onTabInit,n)(t,a,s)},urlData:{tab:t}},d=n.data(h.promise)||!1,f=d&&"pending"===d.state();c.cache&&l?(r.debug("Showing existing content",t),r.activate.tab(t),e.proxy(c.onTabLoad,n)(t,a,s)):f?(r.debug("Content is already loading",t),n.addClass(g.loading)):e.api!==o?(r.debug("Retrieving content",t),e.api(e.extend(!0,{},c.apiSettings,u))):r.error(b.api)},update:function(e,t){r.debug("Updating html for",e);var n=r.get.tabElement(e);n.html(t)}},activate:{all:function(e){r.activate.tab(e),r.activate.navigation(e)},tab:function(e){var t=r.get.tabElement(e);r.verbose("Showing tab content for",t),t.addClass(g.active)},navigation:function(e){var t=r.get.navElement(e);r.verbose("Activating tab navigation for",t),t.addClass(g.active)}},deactivate:{all:function(){r.deactivate.navigation(),r.deactivate.tabs()},navigation:function(){u.removeClass(g.active)},tabs:function(){d.removeClass(g.active+" "+g.loading)}},is:{tab:function(e){return r.get.tabElement(e).size()>0}},get:{initialPath:function(){return u.eq(0).data(h.tab)||d.eq(0).data(h.tab)},defaultPathArray:function(e){return r.utils.pathToArray(r.get.defaultPath(e))},defaultPath:function(e){var t=u.filter("[data-"+h.tab+'^="'+e+'/"]').eq(0),n=t.data(h.tab)||!1;if(n){if(r.debug("Found default tab",n),c.maxDepth>m)return m++,r.get.defaultPath(n);r.error(b.recursion)}return m=0,e},navElement:function(e){return e=e||i,u.filter("[data-"+h.tab+'="'+e+'"]')},tabElement:function(e){var t,n,o,a;return e=e||i,o=r.utils.pathToArray(e),a=r.utils.last(o),t=d.filter("[data-"+h.tab+'="'+a+'"]'),n=d.filter("[data-"+h.tab+'="'+e+'"]'),t.size()>0?t:n},tab:function(){return i}},utils:{filterArray:function(t,n){return e.grep(t,function(t){return-1==e.inArray(t,n)})},last:function(t){return e.isArray(t)?t[t.length-1]:!1},pathToArray:function(e){return e===o&&(e=i),"string"==typeof e?e.split("/"):[e]},arrayToPath:function(t){return e.isArray(t)?t.join("/"):!1}},setting:function(e,t){return t===o?c[e]:(c[e]=t,o)},verbose:function(){c.verbose&&r.debug.apply(this,arguments)},debug:function(){var e=[],t=c.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.info||console.log||function(){};o=Function.prototype.bind.call(o,console),c.debug&&(e.push(t),o.apply(console,e.concat(n)))},error:function(){var e=[],t=c.moduleName+": "+arguments[0],n=[].slice.call(arguments,1),o=console.warn||console.log||function(){};o=Function.prototype.bind.call(o,console),c.debug&&(e.push(t),e.concat(n),o.apply(console,e.concat(n)))},invoke:function(t,n,i){var a,s;return i=i||[].slice.call(arguments,2),"string"==typeof t&&y!==o&&(t=t.split("."),a=t.length-1,e.each(t,function(t,n){return e.isPlainObject(y[n])&&t!=a?(y=y[n],!0):y[n]!==o?(s=y[n],!0):(r.error(c.errors.method),!1)})),e.isFunction(s)?s.apply(n,i):s}},w?l=r.invoke(x,this,C):r.initialize(),l!==o?l:this},e.tabNavigation=function(n){e(t).tabNavigation(n)},e.fn.tabNavigation.settings={moduleName:"Tab Module",verbose:!1,debug:!0,namespace:"tab",onTabInit:function(){},onTabLoad:function(){},templates:{determineTitle:function(){}},history:!1,path:!1,context:"body",maxDepth:25,ignoreFirstLoad:!0,alwaysRefresh:!1,cache:!0,apiSettings:!1,errors:{api:"You attempted to load content without API module",noContent:"The tab you specified is missing a content url.",method:"The method you called is not defined",state:"The state library has not been initialized",missingTab:"Missing tab: ",recursion:"Max recursive depth reached"},metadata:{tab:"tab",loaded:"loaded",promise:"promise"},className:{loading:"loading",active:"active"},selector:{tabs:".tab"}}}(jQuery,window,document),function(e,t,n,o){e.fn.video=function(t){var n,i=e.extend(!0,{},e.fn.video.settings,t),a=arguments||!1;return e(this).each(function(){var s,r=e(this),l=r.find(i.selector.placeholder),c=r.find(i.selector.playButton),u=r.find(i.selector.embed),d=r.data("module-"+i.namespace),f="string"==typeof t,p=i.namespace,m=i.metadata,g=i.className;s={initialize:function(){s.debug("Initializing video"),l.off(".video").on("click."+p,s.play),c.off(".video").on("click."+p,s.play),r.data("module-"+p,s)},change:function(e,t){s.debug("Changing video to ",t),r.data(m.source,e).data(m.flv,t),i.onChange()},reset:function(){s.debug("Clearing video embed and showing placeholder"),r.removeClass(g.active),u.html(" "),l.show(),i.onReset()},play:function(){s.debug("Playing video");var e=r.data(m.source),t=r.data(m.flv);u.html(s.generate.html(e,t)),r.addClass(g.active),i.onPlay()},generate:{html:function(e,t){s.debug("Generating embed html");var n,o="auto"==i.width?r.width():i.width,a="auto"==i.height?r.height():i.height;return"vimeo"==e?n='<iframe src="http://player.vimeo.com/video/'+t+"?="+s.generate.url(e)+'"'+' width="'+o+'" height="'+a+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>':"youtube"==e&&(n='<iframe src="http://www.youtube.com/embed/'+t+"?="+s.generate.url(e)+'"'+' width="'+o+'" height="'+a+'"'+' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'),n},url:function(e){var t=i.api?1:0,n=i.autoplay?1:0,o=i.hd?1:0,a=i.showUI?1:0,s=i.showUI?0:1,r="";return"vimeo"==e?(r="api="+t+"&title="+a+"&byline="+a+"&portrait="+a+"&autoplay="+n,i.color&&(r+="&color="+i.color)):"youtube"==e&&(r="enablejsapi="+t+"&autoplay="+n+"&autohide="+s+"&hq="+o+"&modestbranding=1",i.color&&(r+="&color="+i.color)),r}},debug:function(e,t){i.debug&&(t!==o?console.info(i.moduleName+": "+e,t):console.info(i.moduleName+": "+e))},error:function(e){console.warn(i.moduleName+": "+e)},invoke:function(t,n,a){var r;return a=a||Array.prototype.slice.call(arguments,2),"string"==typeof t&&d!==o&&(t=t.split("."),e.each(t,function(t,n){return e.isPlainObject(d[n])?(d=d[n],!0):e.isFunction(d[n])?(r=d[n],!0):(s.error(i.errors.method),!1)})),e.isFunction(r)?r.apply(n,a):r}},f?n=s.invoke(a[0],this,Array.prototype.slice.call(a,1)):(d&&s.destroy(),s.initialize())}),n!==o?n:this},e.fn.videoPlaylist=function(t,n){var o=e(this),i=e(t),a=i.find(".embed iframe"),s=e.extend({},e.fn.videoPlaylist.settings,n,!0);o.each(function(){var t=e(this),n=s.metadata,a=s.namespace,r=s.className,l={initialize:function(){t.on("click."+a,l.changeVideo)},changeVideo:function(){var a=t.data(n.flv)||!1,l=t.data(n.source)||!1,c=t.data(n.placeholder)||!1;if(a&&l){if(i.data(n.source,l).data(n.flv,a),s.showPlaceholder)i.removeClass(r.active).find(e.fn.video.selector.placeholder).attr("src",c);else try{i.video("play")}catch(u){console.warn("Video Playlist Module: "+s.error.init)}o.removeClass(r.active),t.addClass(r.active)}}};l.initialize()}),s.playFirst&&(o.eq(0).trigger("click"),a.size()>0&&a.attr("src",a.attr("src").replace("autoplay=1","autoplay=0")))},e.fn.video.settings={moduleName:"Video",namespace:"video",debug:!1,metadata:{source:"source",flv:"flv"},onPlay:function(){},onReset:function(){},onChange:function(){},play:function(){},pause:function(){},stop:function(){},width:"auto",height:"auto",autoplay:!1,color:"#442359",hd:!0,showUI:!1,api:!0,errors:{method:"The method you called is not defined"},className:{active:"active"},selector:{embed:".embed",placeholder:".placeholder",playButton:".play"}},e.fn.videoPlaylist.settings={moduleName:"Video Playlist",namespace:"videoPlaylist",source:"vimeo",showPlaceholder:!1,playFirst:!0,metadata:{flv:"flv",source:"source",placeholder:"placeholder"},errors:{init:"The video player you specified was not yet initialized"},className:{active:"active"}}}(jQuery,window,document);
|