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

  1. /** # Semantic UI
  2. * Version: 0.1
  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: 09/28/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).removeAttr("style").children().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).removeAttr("style").children().removeAttr("style")})),d.addClass(g.active),e.stop().children().removeAttr("style").end().slideDown(f.duration,f.easing,function(){e.addClass(g.active).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.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.destroy(),b.initialize())}),c!==d?c:this},a.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!0,verbose:
  13. },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+=" '"+moduleSelector+"'"),b+=" ("+$allDropdowns.size()+")",(console.group!==d||console.table!==d)&&performance.length>0&&(console.groupCollapsed(b),cons
  14. 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):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=D||f,"string"==typeof b&&E!==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(E[e])&&c!=g)E=E[e];else{if(!a.isPlainObject(E[f])||c==g)return E[e]!==d?(h=E[e],!1):E[f]!==d?(h=E[f],!1):(z.error(j.method),!1);E=E[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?(E===d&&z.initialize(),z.invoke(q)):(E!==d&&z.destroy(),z.initialize())}),e!==d?e:this},a.fn.nag.settings={name:"Nag",verbose:!0,debug:!0,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},position:"fixed",scrollBarWidth:18,storageMethod:"cookie",storedKey:"nag",storedValue:"dismiss",sticky:!1,lag:0,context:b,error:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".icon.close"},speed:500,easing:"easeOutQuad",onHide:function(){}}}(jQuery,window,document),function(a,b,c,d){a.fn.popup=function(e){var f,g=a(this),h=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.fn.popup.settings,i=g.selector||"",j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var e,o=a(this),p=a(b),q=o.offsetParent(),r=h.inline?o.next(h.selector.popup):p
  15. }),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+"]")},attach:{events:function(c,d){var e=a(c);d=a.isFunction(b[d])?b[d]:b.toggle,e.size()>0?(b.debug("Attaching sidebar events to element",c,d),e.off(k).on("click"+k,d)):b.error(j.notFound)}},show:function(){b.debug("Showing sidebar"),b.is.closed()?(g.overlay||b.pushPage(),b.set.active()):b.debug("Sidebar is already visible")},hide:function(){b.is.open()&&(g.overlay||(b.pullPage(),b.remove.pushed()),b.remove.active())},toggle:function(){b.is.closed()?b.show():b.hide()},pushPage:function(){var a=b.get.direction(),c=b.is.vertical()?s.outerHeight():s.outerWidth();g.useCSS?(b.debug("Using CSS to animate body"),b.add.bodyCSS(a,c),b.set.pushed()):b.animatePage(a,c,b.set.pushed)},pullPage:function(){var a=b.get.direction();g.useCSS?(b.debug("Resetting body position css"),b.remove.bodyCSS()):(b.debug("Resetting body position using javascript"),b.animatePage(a,0)),b.remove.pushed()},animatePage:function(a,c){var d={};d["padding-"+a]=c,b.debug("Using javascript to animate body",d),t.animate(d,g.duration,b.set.pushed)},add:{bodyCSS:function(a,c){var d;a!==h.bottom&&(d='<style title="'+i+'">'+"body.pushed {"+" margin-"+a+": "+c+"px !important;"+"}"+"</style>"),u.append(d),b.debug("Adding body css to head",v)}},remove:{bodyCSS:function(){b.debug("Removing body css styles",v),b.refresh(),v.remove()},active:function(){s.removeClass(h.active)},pushed:function(){b.verbose("Removing body push state",b.get.direction()),t.removeClass(h[b.get.direction()]).removeClass(h.pushed)}},set:{active:function(){s.addClass(h.active)},pushed:function(){b.verbose("Adding body push state",b.get.direction()),t.addClass(h[b.get.direction()]).addClass(h.pushed)}},get:{direction:function(){return s.hasClass(h.top)?h.top:s.hasClass(h.right)?h.right:s.hasClass(h.bottom)?h.bottom:h.left},transitionEvent:function(){var a,b=c.createElement("element"),e={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in e)if(b.style[a]!==d)return e[a]}},is:{open:function(){return s.is(":animated")||