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.

13 lines
78 KiB

  1. /** # Semantic UI
  2. * Version: 0.1
  3. * http://github.com/quirkyinc/semantic
  4. *
  5. *
  6. * Copyright 2013 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. * Released: 05/26/2013
  11. */
  12. (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
  13. },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))},is:{radio:function(){return p.hasClass(b.radio)}},can:{disable:function(){return"boolean"==typeof a.required?a.required:!t.is.radio()}},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(){t.verbose("Toggling checkbox state"),m.prop("checked")!==o&&m.prop("checked")?t.can.disable()&&t.disable():t.enable()},setting:function(n,i){return i===o?a[n]:(e.isPlainObject(n)?(t.verbose("Modifying settings object",n,i),e.extend(!0,a,n)):(t.verbose("Modifying setting",n,i),a[n]=i),o)},internal:function(n,i){return i===o?t[n]:(e.isPlainObject(n)?(t.verbose("Modifying internal property",n,i),e.extend(!0,t,n)):(t.verbose("Changing internal method to",i),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.f
  14. },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 cal