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
122 KiB

  1. /** # Semantic UI
  2. * Version: 0.3.7
  3. * http://github.com/jlukic/semantic-ui
  4. *
  5. *
  6. * Copyright 2013 Contributors
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. * Release Date: 10/08/2013
  11. */
  12. !function(a,b,c,d){a.fn.accordion=function(b){var c,e=a(this),f=a.isPlainObject(b)?a.extend(!0,{},a.fn.accordion.settings,b):a.fn.accordion.settings,g=f.className,h=f.namespace,i=f.selector,j=f.error,k="."+h,l="module-"+h,m=e.selector||"",n=(new Date).getTime(),o=[],p=arguments[0],q="string"==typeof p,r=[].slice.call(arguments,1);return e.each(function(){var b,h=a(this),s=h.find(i.title),t=h.find(i.content),u=this,v=h.data(l);b={initialize:function(){b.debug("Initializing accordion with bound events",h),s.on("click"+k,b.event.click),b.instantiate()},instantiate:function(){h.data(l,b)},destroy:function(){b.debug("Destroying previous accordion for",h),h.removeData(l),s.off(k)},event:{click:function(){b.verbose("Title clicked",this);var c=a(this),d=s.index(c);b.toggle(d)},resetStyle:function(){b.verbose("Resetting styles on element",this),a(this).attr("style","").removeAttr("style").children().attr("style","").removeAttr("style")}},toggle:function(a){b.debug("Toggling content content at index",a);var c=s.eq(a),d=c.next(t),e=d.is(":visible");e?f.collapsible?b.close(a):b.debug("Cannot close accordion content collapsing is disabled"):b.open(a)},open:function(c){var d=s.eq(c),e=d.next(t),h=s.filter("."+g.active),i=h.next(s),j=h.size()>0;e.is(":animated")||(b.debug("Opening accordion content",d),f.exclusive&&j&&(h.removeClass(g.active),i.stop().children().animate({opacity:0},f.duration,b.event.resetStyle).end().slideUp(f.duration,f.easing,function(){i.removeClass(g.active).attr("style","").removeAttr("style").children().attr("style","").removeAttr("style")})),d.addClass(g.active),e.stop().children().attr("style","").removeAttr("style").end().slideDown(f.duration,f.easing,function(){e.addClass(g.active).attr("style","").removeAttr("style"),a.proxy(f.onOpen,e)(),a.proxy(f.onChange,e)()}))},close:function(c){var d=s.eq(c),e=d.next(t);b.debug("Closing accordion content",d),d.removeClass(g.active),e.removeClass(g.active).show().stop().children().animate({opacity:0},f.duration,b.event.resetStyle).end().slideUp(f.duration,f.easing,function(){e.attr("style","").removeAttr("style"),a.proxy(f.onClose,e)(),a.proxy(f.onChange,e)()})},setting:function(c,e){return b.debug("Changing setting",c,e),e===d?f[c]:(a.isPlainObject(c)?a.extend(!0,f,c):f[c]=e,void 0)},internal:function(c,e){return b.debug("Changing internal",c,e),e===d?b[c]:(a.isPlainObject(c)?a.extend(!0,b,c):b[c]=e,void 0)},debug:function(){f.debug&&(f.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,f.name+":"),b.debug.apply(console,arguments)))},verbose:function(){f.verbose&&f.debug&&(f.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),b.verbose.apply(console,arguments)))},error:function(){b.error=Function.prototype.bind.call(console.error,console,f.name+":"),b.error.apply(console,arguments)},performance:{log:function(a){var c,d,e;f.performance&&(c=(new Date).getTime(),e=n||c,d=c-e,n=c,o.push({Element:u,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,100)},display:function(){var c=f.name+":",g=0;n=!1,clearTimeout(b.performance.timer),a.each(o,function(a,b){g+=b["Execution Time"]}),c+=" "+g+"ms",m&&(c+=" '"+m+"'"),e.size()>1&&(c+=" ("+e.size()+")"),(console.group!==d||console.table!==d)&&o.length>0&&(console.groupCollapsed(c),console.table?console.table(o):a.each(o,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),o=[]}},invoke:function(e,f,g){var h,i,k;return f=f||r,g=u||g,"string"==typeof e&&v!==d&&(e=e.split(/[\. ]/),h=e.length-1,a.each(e,function(c,f){var g=c!=h?f+e[c+1].charAt(0).toUpperCase()+e[c+1].slice(1):e;if(a.isPlainObject(v[f])&&c!=h)v=v[f];else{if(!a.isPlainObject(v[g])||c==h)return v[f]!==d?(i=v[f],!1):v[g]!==d?(i=v[g],!1):(b.error(j.method),!1);v=v[g]}})),a.isFunction(i)?k=i.apply(g,f):i!==d&&(k=i),a.isArray(c)?c.push(k):"string"==typeof c?c=[c,k]:k!==d&&(c=k),i}},q?(v===d&&b.initialize(),b.invoke(p)):(v!==d&&b.dest
  13. },refresh:function(){q.removeClass(e.active),n.width={log:t.width(),userList:r.outerWidth()},q.hasClass(e.active)&&n.user.list.hide(),o.data("module",n)},user:{updateCount:function(){c.userCount&&(y=o.data("users"),k=0,a.each(y,function(){k++}),s.html(c.templates.userCount(k)))},joined:function(b){y=o.data("users"),"anonymous"!=b.id&&y[b.id]===d&&(y[b.id]=b.info,c.randomColor&&b.info.color===d&&(b.info.color=c.templates.color(b.id)),x=c.templates.userList(b.info),b.info.isAdmin?a(x).prependTo(r):a(x).appendTo(r),c.partingMessages&&(t.append(c.templates.joined(b.info)),n.message.scroll.test()),n.user.updateCount())},left:function(a){y=o.data("users"),a!==d&&"anonymous"!==a.id&&(delete y[a.id],o.data("users",y),r.find("[data-id="+a.id+"]").remove(),c.partingMessages&&(t.append(c.templates.left(a.info)),n.message.scroll.test()),n.user.updateCount())},list:{create:function(b){y={},b.each(function(a){"anonymous"!==a.id&&"undefined"!==a.id&&(c.randomColor&&a.info.color===d&&(a.info.color=c.templates.color(a.id)),x=a.info.isAdmin?c.templates.userList(a.info)+x:x+c.templates.userList(a.info),y[a.id]=a.info)}),o.data("users",y).data("user",y[b.me.id]).removeClass(e.loading),r.html(x),n.user.updateCount(),a.proxy(c.onJoin,r.children())()},show:function(){t.animate({width:n.width.log-n.width.userList},{duration:c.speed,easing:c.easing,complete:n.message.scroll.move})},hide:function(){t.stop().animate({width:n.width.log},{duration:c.speed,easing:c.easing,complete:n.message.scroll.move})}}},message:{scroll:{test:function(){l=t.prop("scrollHeight")-t.height(),Math.abs(t.scrollTop()-l)<c.scrollArea&&n.message.scroll.move()},move:function(){l=t.prop("scrollHeight")-t.height(),t.scrollTop(l)}},send:function(b){n.utils.emptyString(b)||a.api({url:c.endpoint.message,method:"POST",data:{message:{content:b,timestamp:(new Date).getTime()}}})},receive:function(a){j=a.data,y=o.data("users"),i=o.data("user"),y[j.userID]!==d&&(i===d||i.id!=j.userID)&&(j.user=y[j.userID],n.message.display(j))},display:function(b){t.append(c.templates.message(b)),n.message.scroll.test(),a.proxy(c.onMessage,t.children().last())()}},expand:function(){o.addClass(e.expand),a.proxy(c.onExpand,o)(),n.refresh()},contract:function(){o.removeClass(e.expand),a.proxy(c.onContract,o)(),n.refresh()},event:{input:{keydown:function(a){13==a.which&&v.addClass(e.down)},keyup:function(a){13==a.which&&(v.removeClass(e.down),n.event.submit())}},submit:function(){var a=u.val(),b=o.data("user");b===d||n.utils.emptyString(a)||(n.message.send(a),n.message.display({user:b,text:a}),n.message.scroll.move(),u.val(""))},toggleExpand:function(){o.hasClass(e.expand)?(p.removeClass(e.active),n.contract()):(p.addClass(e.active),n.expand())},toggleUserList:function(){t.is(":animated")||(q.hasClass(e.active)?(q.removeClass("active"),n.user.list.hide()):(q.addClass(e.active),n.user.list.show()))}},utils:{emptyString:function(a){return"string"==typeof a?-1==a.search(/\S/):!1}},setting:function(b,e){return e===d?c[b]:(a.isPlainObject(b)?a.extend(!0,c,b):c[b]=e,void 0)},internal:function(b,c){return c===d?n[b]:(a.isPlainObject(b)?a.extend(!0,n,b):n[b]=c,void 0)},debug:function(){c.debug&&(c.performance?n.performance.log(arguments):(n.debug=Function.prototype.bind.call(console.info,console,c.name+":"),n.debug.apply(console,arguments)))},verbose:function(){c.verbose&&c.debug&&(c.performance?n.performance.log(arguments):(n.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),n.verbose.apply(console,arguments)))},error:function(){n.error=Function.prototype.bind.call(console.error,console,c.name+":"),n.error.apply(console,arguments)},performance:{log:function(a){var b,d,e;c.performance&&(b=(new Date).getTime(),e=time||b,d=b-e,time=b,performance.push({Element:element,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":d})),clearTimeout(n.performance.timer),n.performance.timer=setTimeout(n.performance.display,100)},display:function(){var b=c.name+":",e=0;time=!1,clearTimeout(n.performance.timer),a.each(performance,function(a,b){e+=b["Execution Time"]}),b+=" "+e+"ms",moduleSelector&&(b+
  14. return a(this).each(function(){var c,k,t,u,v,w,x,y,z,A=a(this),B=A.find(i.close),C=a(g.context),D=this,E=A.data(m),F=b.requestAnimationFrame||b.mozRequestAnimationFrame||b.webkitRequestAnimationFrame||b.msRequestAnimationFrame||function(a){setTimeout(a,0)};z={initialize:function(){z.verbose("Initializing element"),c=A.offset(),k=A.outerHeight(),t=C.outerWidth(),u=C.outerHeight(),v=C.offset(),A.data(m,z),B.on("click"+l,z.dismiss),g.context==b&&"fixed"==g.position&&A.addClass(h.fixed),g.sticky&&(z.verbose("Adding scroll events"),"absolute"==g.position?C.on("scroll"+l,z.event.scroll).on("resize"+l,z.event.scroll):a(b).on("scroll"+l,z.event.scroll).on("resize"+l,z.event.scroll),a.proxy(z.event.scroll,this)()),g.displayTime>0&&setTimeout(z.hide,g.displayTime),z.should.show()?A.is(":visible")||z.show():z.hide()},destroy:function(){z.verbose("Destroying instance"),A.removeData(m).off(l),g.sticky&&C.off(l)},refresh:function(){z.debug("Refreshing cached calculations"),c=A.offset(),k=A.outerHeight(),t=C.outerWidth(),u=C.outerHeight(),v=C.offset()},show:function(){z.debug("Showing nag",g.animation.show),"fade"==g.animation.show?A.fadeIn(g.duration,g.easing):A.slideDown(g.duration,g.easing)},hide:function(){z.debug("Showing nag",g.animation.hide),"fade"==g.animation.show?A.fadeIn(g.duration,g.easing):A.slideUp(g.duration,g.easing)},onHide:function(){z.debug("Removing nag",g.animation.hide),A.remove(),g.onHide&&g.onHide()},stick:function(){if(z.refresh(),"fixed"==g.position){var c=a(b).prop("pageYOffset")||a(b).scrollTop(),d=A.hasClass(h.bottom)?v.top+(u-k)-c:v.top-c;A.css({position:"fixed",top:d,left:v.left,width:t-g.scrollBarWidth})}else A.css({top:x})},unStick:function(){A.css({top:""})},dismiss:function(a){g.storageMethod&&z.storage.set(g.storedKey,g.storedValue),z.hide(),a.stopImmediatePropagation(),a.preventDefault()},should:{show:function(){return g.persist?(z.debug("Persistent nag is set, can show nag"),!0):z.storage.get(g.storedKey)!=g.storedValue?(z.debug("Stored value is not set, can show nag",z.storage.get(g.storedKey)),!0):(z.debug("Stored value is set, cannot show nag",z.storage.get(g.storedKey)),!1)},stick:function(){return w=C.prop("pageYOffset")||C.scrollTop(),x=A.hasClass(h.bottom)?u-A.outerHeight()+w:w,x>c.top?!0:"fixed"==g.position?!0:!1}},storage:{set:function(c,e){z.debug("Setting stored value",c,e,g.storageMethod),"local"==g.storageMethod&&b.store!==d?b.store.set(c,e):a.cookie!==d?a.cookie(c,e):z.error(j.noStorage)},get:function(c){return z.debug("Getting stored value",c,g.storageMethod),"local"==g.storageMethod&&b.store!==d?b.store.get(c):a.cookie!==d?a.cookie(c):(z.error(j.noStorage),void 0)}},event:{scroll:function(){y!==d&&clearTimeout(y),y=setTimeout(function(){z.should.stick()?F(z.stick):z.unStick()},g.lag)}},setting:function(b,c){return z.debug("Changing setting",b,c),c===d?g[b]:(a.isPlainObject(b)?a.extend(!0,g,b):g[b]=c,void 0)},internal:function(b,c){return z.debug("Changing internal",b,c),c===d?z[b]:(a.isPlainObject(b)?a.extend(!0,z,b):z[b]=c,void 0)},debug:function(){g.debug&&(g.performance?z.performance.log(arguments):(z.debug=Function.prototype.bind.call(console.info,console,g.name+":"),z.debug.apply(console,arguments)))},verbose:function(){g.verbose&&g.debug&&(g.performance?z.performance.log(arguments):(z.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),z.verbose.apply(console,arguments)))},error:function(){z.error=Function.prototype.bind.call(console.error,console,g.name+":"),z.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;g.performance&&(b=(new Date).getTime(),d=o||b,c=b-d,o=b,p.push({Element:D,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(z.performance.timer),z.performance.timer=setTimeout(z.performance.display,100)},display:function(){var b=g.name+":",c=0;o=!1,clearTimeout(z.performance.timer),a.each(p,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",n&&(b+=" '"+n+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&p.length>0&&(console.groupCollapsed(b),console.table?console.table(p)
  15. t.verbose("Setting the initial animation position as left",i,a),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),i.addClass(l.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-90deg) translateZ("+a.depth.next+"px)"})},right:function(){var a={origin:(b.outerWidth()-i.outerWidth())/2,depth:{active:i.outerWidth()/2,next:b.outerWidth()/2}};t.verbose("Setting the initial animation position as left",i,a),b.css({transform:"rotateY(0deg) translateZ("+a.depth.active+"px)"}),i.addClass(l.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(90deg) translateZ("+a.depth.next+"px)"})},behind:function(){var a={origin:(b.outerWidth()-i.outerWidth())/2,depth:{active:i.outerWidth()/2,next:b.outerWidth()/2}};t.verbose("Setting the initial animation position as behind",i,a),b.css({transform:"rotateY(0deg)"}),i.addClass(l.animating).css({display:"block",left:a.origin+"px",transform:"rotateY(-180deg)"})}},setting:function(b,c){return c===d?h[b]:(a.isPlainObject(b)?a.extend(!0,h,b):h[b]=c,void 0)},internal:function(b,c){return c===d?t[b]:(a.isPlainObject(b)?a.extend(!0,t,b):t[b]=c,void 0)},debug:function(){h.debug&&(h.performance?t.performance.log(arguments):(t.debug=Function.prototype.bind.call(console.info,console,h.name+":"),t.debug.apply(console,arguments)))},verbose:function(){h.verbose&&h.debug&&(h.performance?t.performance.log(arguments):(t.verbose=Function.prototype.bind.call(console.info,console,h.name+":"),t.verbose.apply(console,arguments)))},error:function(){t.error=Function.prototype.bind.call(console.error,console,h.name+":"),t.error.apply(console,arguments)},performance:{log:function(a){var b,c,d;h.performance&&(b=(new Date).getTime(),d=o||b,c=b-d,o=b,p.push({Element:x,Name:a[0],Arguments:[].slice.call(a,1)||"","Execution Time":c})),clearTimeout(t.performance.timer),t.performance.timer=setTimeout(t.performance.display,100)},display:function(){var b=h.name+":",c=0;o=!1,clearTimeout(t.performance.timer),a.each(p,function(a,b){c+=b["Execution Time"]}),b+=" "+c+"ms",g&&(b+=" '"+g+"'"),f.size()>1&&(b+=" ("+f.size()+")"),(console.group!==d||console.table!==d)&&p.length>0&&(console.groupCollapsed(b),console.table?console.table(p):a.each(p,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),p=[]}},invoke:function(b,c,f){var g,h,i;return c=c||s,f=x||f,"string"==typeof b&&y!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(y[e])&&c!=g)y=y[e];else{if(!a.isPlainObject(y[f])||c==g)return y[e]!==d?(h=y[e],!1):y[f]!==d?(h=y[f],!1):(t.error(k.method),!1);y=y[f]}})),a.isFunction(h)?i=h.apply(f,c):h!==d&&(i=h),a.isArray(e)?e.push(i):"string"==typeof e?e=[e,i]:i!==d&&(e=i),h}},r?(y===d&&t.initialize(),t.invoke(q)):(y!==d&&t.destroy(),t.initialize())}),e!==d?e:this},a.fn.shape.settings={name:"Shape",debug:!0,verbose:!0,performance:!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:{sides:".sides",side:".side"}}}(jQuery,window,document),function(a,b,c,d){a.fn.sidebar=function(b){var e,f=a(this),g=a.isPlainObject(b)?a.extend(!0,{},a.fn.sidebar.settings,b):a.fn.sidebar.settings,h=(g.selector,g.className),i=g.namespace,j=g.error,k="."+i,l="module-"+i,m=f.selector||"",n=(new Date).getTime(),o=[],p=arguments[0],q="string"==typeof p,r=[].slice.call(arguments,1);return f.each(function(){var b,s=a(this),t=a("body"),u=a("head"),v=a("style[title="+i+"]"),w=this,x=s.data(l);b={initialize:function(){b.debug("Initializing sidebar",s),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),x=b,s.data(l,b)},destroy:function(){b.verbose("Destroying previous module for",s),s.off(k).removeData(l)},refresh:function(){b.verbose("Refreshing selector cache"),v=a("style[title="+i+"]")},attachEvents:function(c,