From 45ac1d00155c896c70ddf79bfdce2ffca152736f Mon Sep 17 00:00:00 2001 From: Colin Tucker Date: Tue, 23 Jan 2018 21:47:24 +1100 Subject: [PATCH] Added ToggleComponent --- README.md | 7 + .../dist/images/icons/ToggleComponent.png | Bin 0 -> 708 bytes admin/client/dist/js/bundle.js | 2 +- .../src/images/icons/ToggleComponent.png | Bin 0 -> 708 bytes client/dist/js/bundle.js | 2 +- client/dist/styles/bundle.css | 2 +- client/src/bundles/bundle.js | 1 + client/src/components/ToggleComponent.js | 35 +++++ client/src/styles/bundle.scss | 1 + .../styles/components/ToggleComponent.scss | 59 ++++++++ src/Components/ToggleComponent.php | 126 ++++++++++++++++++ 11 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 admin/client/dist/images/icons/ToggleComponent.png create mode 100644 admin/client/src/images/icons/ToggleComponent.png create mode 100644 client/src/components/ToggleComponent.js create mode 100644 client/src/styles/components/ToggleComponent.scss create mode 100644 src/Components/ToggleComponent.php diff --git a/README.md b/README.md index 1d100c8..0c87351 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,7 @@ SilverWare ships with the following components ready for use: - [`TagCloudComponent`](#tagcloudcomponent) - [`TileComponent`](#tilecomponent) - [`TitleComponent`](#titlecomponent) +- [`ToggleComponent`](#togglecomponent) ### AreaComponent @@ -269,6 +270,12 @@ If you need to hide the page title in the template (so that two titles are not s select the "Hide title of page" option in your `PageComponent`. This adds the class `page-title-hidden` which can be used in your site styles. +### ToggleComponent + +Allows you to embed a block of rich-text content, edited using `HTMLEditorField`, with +the visibility of the content toggleable via clicking on the header of the component. +Can be started open or closed. + ## Issues Please use the [GitHub issue tracker][issues] for bug reports and feature requests. diff --git a/admin/client/dist/images/icons/ToggleComponent.png b/admin/client/dist/images/icons/ToggleComponent.png new file mode 100644 index 0000000000000000000000000000000000000000..c5e87b1c45e27c8494eab6ca256e3060137fd927 GIT binary patch literal 708 zcmV;#0z3VQP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGxhX4Q_hXIe}@nrx202y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;2BNCs_jk00J~gL_t(IPlb~2Yf@1d$M?S8_XlkDLIwp9 zje-S>MZy}CtM+0+l2+0r9FnmbgR$y;{R`_=kQK~D!O)FuE(b0vbt+1^d)@pwe_frw zzCGuVr|1e@_;8-*p67h-a~|yhz_~U%dzrZNANuq&Gd)+Pr^PuD(8k?Lvx)rSAySG0 zsa(d-QVBnbMb5jG6|fpY(^Wt(@0IFxWawbBP(VDB!Oq?uzRNPcNfKT;om2*}IzrPq zCj_H*ySYq)T&2=g@^WE8pwa1`s01T6+kK_c!28uz-mcs4$CAgR>V#c~)v5%Stk%gY z%^;9W^1`pXyYMFxs!o`I)v5%;7K^1ug2nZ9tOWw1leca+94;4@eLlX&2Fq$yf+4f{ zLA}*NXn!9;`WoxRu_j~cMGD4enQp{xKTYd}V9;c;Hc0Sca}&;u4gNLbd<4E71?_fQ z1$%$}Q8Xq5XAOp_CT&FMzTtG5cQR!3ph?%N)oL7;=W;p7G>bIVuv`evOib8XB>3p{ z;&UXzJ2`oE5!GrHMH-weCwacT{e=?>g?TOnr^d%0wke2avmDk*-^JG`(|>}k{}K+z z`6>h_#>VWl;?vd^@4_36qIcMVZ1w>8e3`@YP8^TRJQsrFI^AO?U=JHolLo3CSw<>V zf+Q6'+n+"")}})}},findTab:function(e){return this.find(this.getTabId(e))},getTabId:function(e){return"a#tab-"+e.replace(".","_")}}),e(".cms-tree li").entwine({updateBadge:function(t){if(this.find("span.status-number-badge").length){var n="#"+this.attr("id"),i=n+".status-number-badge > a span.jstree-pageicon::before",s='content: "'+(t>0?t:"")+'";';e("head").append('")}}}),e("span.status-number-badge-value").entwine({onmatch:function(){if(this._super(),!this.data("updated")){var e=parseInt(this.attr("title"));this.closest("li").updateBadge(e),this.data("updated",!0)}}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.listviewextension",function(e){e(".tabset.silverware-extensions-lists-listviewextension").entwine({onmatch:function(){var t=e(this);this.handlePagination(),this.getPaginateItemsField().entwine({onchange:function(e){t.handlePagination(),this._super(e)}}),this._super()},handlePagination:function(){1==this.getPaginateItemsField().val()?this.getPaginationHolder().show():this.getPaginationHolder().hide()},getPaginateItemsField:function(){return e(this).find("#Form_EditForm_List_PaginateItems")},getPaginationHolder:function(){return e(this).find("#Form_EditForm_List_ItemsPerPage_Holder")}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.togglegroup",function(e){e(".field.togglegroup").entwine({onmatch:function(){var t=e(this);t.doToggle(),t.getToggleInput().entwine({onclick:function(e){t.doToggle(),this._super(e)}}),this._super()},doToggle:function(){var t=e(this.getToggleInput()),n=this.getToggleMode();this.getFields().toggle(n?t.is(":checked"):!t.is(":checked"))},getToggle:function(){return e(this).find(".group-toggle")},getFields:function(){return e(this).find(".group-fields")},getToggleInput:function(){return this.getToggle().find("input")},getToggleMode:function(){return this.getToggle().data("show-when-checked")}})})}]); \ No newline at end of file +!function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/resources/silverware/silverware/admin/client/dist/",t(t.s=1)}([function(e,t){e.exports=jQuery},function(e,t,n){n(2),n(3),n(4),n(5)},function(e,t){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.numberbadges",function(e){e("div.ss-tabset").entwine({onmatch:function(){this._super();var t=this;if(this.attr("data-number-badges")){var n=e.parseJSON(this.attr("data-number-badges"));e.each(n,function(e,n){if(n){var i=t.findTab(e);i.length&&i.append(''+n+"")}})}},findTab:function(e){return this.find(this.getTabId(e))},getTabId:function(e){return"a#tab-"+e.replace(".","_")}}),e(".cms-tree li").entwine({updateBadge:function(t){if(this.find("span.status-number-badge").length){var n="#"+this.attr("id")+".status-number-badge > a span.jstree-pageicon::before",i='content: "'+(t>0?t:"")+'";';e("head").append('")}}}),e("span.status-number-badge-value").entwine({onmatch:function(){if(this._super(),!this.data("updated")){var e=parseInt(this.attr("title"));this.closest("li").updateBadge(e),this.data("updated",!0)}}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.listviewextension",function(e){e(".tabset.silverware-extensions-lists-listviewextension").entwine({onmatch:function(){var t=e(this);this.handlePagination(),this.getPaginateItemsField().entwine({onchange:function(e){t.handlePagination(),this._super(e)}}),this._super()},handlePagination:function(){1==this.getPaginateItemsField().val()?this.getPaginationHolder().show():this.getPaginationHolder().hide()},getPaginateItemsField:function(){return e(this).find("#Form_EditForm_List_PaginateItems")},getPaginationHolder:function(){return e(this).find("#Form_EditForm_List_ItemsPerPage_Holder")}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.togglegroup",function(e){e(".field.togglegroup").entwine({onmatch:function(){var t=e(this);t.doToggle(),t.getToggleInput().entwine({onclick:function(e){t.doToggle(),this._super(e)}}),this._super()},doToggle:function(){var t=e(this.getToggleInput()),n=this.getToggleMode();this.getFields().toggle(n?t.is(":checked"):!t.is(":checked"))},getToggle:function(){return e(this).find(".group-toggle")},getFields:function(){return e(this).find(".group-fields")},getToggleInput:function(){return this.getToggle().find("input")},getToggleMode:function(){return this.getToggle().data("show-when-checked")}})})}]); \ No newline at end of file diff --git a/admin/client/src/images/icons/ToggleComponent.png b/admin/client/src/images/icons/ToggleComponent.png new file mode 100644 index 0000000000000000000000000000000000000000..c5e87b1c45e27c8494eab6ca256e3060137fd927 GIT binary patch literal 708 zcmV;#0z3VQP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGxhX4Q_hXIe}@nrx202y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E;2BNCs_jk00J~gL_t(IPlb~2Yf@1d$M?S8_XlkDLIwp9 zje-S>MZy}CtM+0+l2+0r9FnmbgR$y;{R`_=kQK~D!O)FuE(b0vbt+1^d)@pwe_frw zzCGuVr|1e@_;8-*p67h-a~|yhz_~U%dzrZNANuq&Gd)+Pr^PuD(8k?Lvx)rSAySG0 zsa(d-QVBnbMb5jG6|fpY(^Wt(@0IFxWawbBP(VDB!Oq?uzRNPcNfKT;om2*}IzrPq zCj_H*ySYq)T&2=g@^WE8pwa1`s01T6+kK_c!28uz-mcs4$CAgR>V#c~)v5%Stk%gY z%^;9W^1`pXyYMFxs!o`I)v5%;7K^1ug2nZ9tOWw1leca+94;4@eLlX&2Fq$yf+4f{ zLA}*NXn!9;`WoxRu_j~cMGD4enQp{xKTYd}V9;c;Hc0Sca}&;u4gNLbd<4E71?_fQ z1$%$}Q8Xq5XAOp_CT&FMzTtG5cQR!3ph?%N)oL7;=W;p7G>bIVuv`evOib8XB>3p{ z;&UXzJ2`oE5!GrHMH-weCwacT{e=?>g?TOnr^d%0wke2avmDk*-^JG`(|>}k{}K+z z`6>h_#>VWl;?vd^@4_36qIcMVZ1w>8e3`@YP8^TRJQsrFI^AO?U=JHolLo3CSw<>V zf+Q60)}function C(t,i,e,s){var n,a=t.createLinearGradient(0,0,i,0);for(n in s)a.addColorStop(1-n,s[n]);t.fillStyle=a,t.fillRect(0,e,i,1)}function z(t,i,e){var s,a,h,o,r=1024,l=1,u=t.weightGradient;if(t.gCanvas)a=t.gCanvas.getContext("2d"),l=t.gCanvas.height;else{if(n(u[0])?l=u.length:u=[u],t.gCanvas=s=S(r,l),!s)return null;for(a=s.getContext("2d"),h=0;h0?o=r*o/100:o*=n,h=a.getContext("2d"),h.globalCompositeOperation="source-over",h.fillStyle="#fff",o>=r/2?(o=St(e,s)/2,h.beginPath(),h.moveTo(e/2,s/2),h.arc(e/2,s/2,o,0,2*Math.PI,!1),h.fill(),h.closePath()):(o=St(e/2,s/2,o),I(h,0,0,e,s,o,!0),h.fill()),h.globalCompositeOperation="source-in",h.drawImage(t,0,0,e,s),a):null}function P(t,i,e,s,n,a,h){var o,r,l=xt(h[0]),u=xt(h[1]),c=i+(l>a?l+a:2*a)*s,g=e+(u>a?u+a:2*a)*s,f=s*((a||0)+(h[0]<0?l:0)),d=s*((a||0)+(h[1]<0?u:0));return(o=S(c,g))?(r=o.getContext("2d"),n&&(r.shadowColor=n),a&&(r.shadowBlur=a*s),h&&(r.shadowOffsetX=h[0]*s,r.shadowOffsetY=h[1]*s),r.drawImage(t,f,d,i,e),{image:o,width:c/s,height:g/s}):null}function E(t,i,e){var s,n,a,h,o,r,l,u,c=parseInt(t.toString().length*e),g=parseInt(2*e*t.length),f=S(c,g);if(!f)return null;for(s=f.getContext("2d"),s.fillStyle="#000",s.fillRect(0,0,c,g),D(s,e+"px "+i,"#fff",t,0,0,0,0,[],"centre"),n=s.getImageData(0,0,c,g),a=n.width,h=n.height,u={min:{x:a,y:h},max:{x:-1,y:-1}},r=0;r0&&(ou.max.x&&(u.max.x=o),ru.max.y&&(u.max.y=r));return a!=c&&(u.min.x*=c/a,u.max.x*=c/a),h!=g&&(u.min.y*=c/h,u.max.y*=c/h),f=null,u}function B(t){return"'"+t.replace(/(\'|\")/g,"").replace(/\s*,\s*/g,"', '")+"'"}function R(t,i,e){e=e||At,e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i)}function _(t,i,e){e=e||At,e.removeEventListener?e.removeEventListener(t,i):e.detachEvent("on"+t,i)}function N(t,i,e,s){var n,a,h,o,r,l,u=s.imageScale;return i.complete?t.complete?(i.width=i.width,i.height=i.height,u&&(t.width=i.width*u,t.height=i.height*u),e.iw=t.width,e.ih=t.height,s.txtOpt&&(a=t,n=s.zoomMax*s.txtScale,r=e.iw*n,l=e.ih*n,r0?(e.iw+=2*s.outlineIncrease,e.ih+=2*s.outlineIncrease,r=n*e.iw,l=n*e.ih,a=F(e.fimage,r,l),e.oimage=a,e.fimage=A(e.fimage,e.oimage.width,e.oimage.height)):(r=n*(e.iw+2*s.outlineIncrease),l=n*(e.ih+2*s.outlineIncrease),a=F(e.fimage,r,l),e.oimage=A(a,e.fimage.width,e.fimage.height))))),void e.Init()):R("load",function(){N(t,i,e,s)},t):R("load",function(){N(t,i,e,s)},i)}function L(t,i){var e=At.defaultView,s=i.replace(/\-([a-z])/g,function(t){return t.charAt(1).toUpperCase()});return e&&e.getComputedStyle&&e.getComputedStyle(t,null).getPropertyValue(i)||t.currentStyle&&t.currentStyle[s]}function H(t,i,e){var s,n=1;return i?n=1*(t.getAttribute(i)||e):(s=L(t,"font-size"))&&(n=s.indexOf("px")>-1&&1*s.replace("px","")||s.indexOf("pt")>-1&&1.25*s.replace("pt","")||3.3*s),n}function W(t){return t.target&&s(t.target.id)?t.target.id:t.srcElement.parentNode.id}function X(t,i){var e,n,a=parseInt(L(i,"width"))/i.width,h=parseInt(L(i,"height"))/i.height;return s(t.offsetX)?e={x:t.offsetX,y:t.offsetY}:(n=tt(i.id),s(t.changedTouches)&&(t=t.changedTouches[0]),t.pageX&&(e={x:t.pageX-n.x,y:t.pageY-n.y})),e&&a&&h&&(e.x/=a,e.y/=h),e}function j(t){var i=t.target||t.fromElement.parentNode,e=at.tc[i.id];e&&(e.mx=e.my=-1,e.UnFreeze(),e.EndDrag())}function Y(t){var i,e,s,n=at,a=W(t);for(i in n.tc)e=n.tc[i],e.tttimer&&(clearTimeout(e.tttimer),e.tttimer=null);a&&n.tc[a]&&(e=n.tc[a],(s=X(t,e.canvas))&&(e.mx=s.x,e.my=s.y,e.Drag(t,s)),e.drawn=0)}function U(t){var i=at,e=At.addEventListener?0:1,s=W(t);s&&t.button==e&&i.tc[s]&&i.tc[s].BeginDrag(t)}function V(t){var i,e=at,s=At.addEventListener?0:1,n=W(t);n&&t.button==s&&e.tc[n]&&(i=e.tc[n],Y(t),i.EndDrag()||i.touchState||i.Clicked(t))}function q(t){var i,e=W(t),s=e&&at.tc[e];s&&t.changedTouches&&(1==t.touches.length&&0==s.touchState?(s.touchState=1,s.BeginDrag(t),(i=X(t,s.canvas))&&(s.mx=i.x,s.my=i.y,s.drawn=0)):2==t.targetTouches.length&&s.pinchZoom?(s.touchState=3,s.EndDrag(),s.BeginPinch(t)):(s.EndDrag(),s.EndPinch(),s.touchState=0))}function G(t){var i=W(t),e=i&&at.tc[i];if(e&&t.changedTouches){switch(e.touchState){case 1:e.Draw(),e.Clicked();break;case 2:e.EndDrag();break;case 3:e.EndPinch()}e.touchState=0}}function Z(t){var i,e,s,n=at,a=W(t);for(i in n.tc)e=n.tc[i],e.tttimer&&(clearTimeout(e.tttimer),e.tttimer=null);if((e=a&&n.tc[a])&&t.changedTouches&&e.touchState){switch(e.touchState){case 1:case 2:(s=X(t,e.canvas))&&(e.mx=s.x,e.my=s.y,e.Drag(t,s)&&(e.touchState=2));break;case 3:e.Pinch(t)}e.drawn=0}}function Q(t){var i=at,e=W(t);e&&i.tc[e]&&(t.cancelBubble=!0,t.returnValue=!1,t.preventDefault&&t.preventDefault(),i.tc[e].Wheel((t.wheelDelta||t.detail)>0))}function J(t){var i,e=at;clearTimeout(e.scrollTimer);for(i in e.tc)e.tc[i].Pause();e.scrollTimer=setTimeout(function(){var t,i=at;for(t in i.tc)i.tc[t].Resume()},e.scrollPause)}function K(){$(o())}function $(t){var i,e=at.tc;at.NextFrame(at.interval),t=t||o();for(i in e)e[i].Draw(t)}function tt(t){var i=At.getElementById(t),e=i.getBoundingClientRect(),s=At.documentElement,n=At.body,a=window,h=a.pageXOffset||s.scrollLeft,o=a.pageYOffset||s.scrollTop,r=s.clientLeft||n.clientLeft,l=s.clientTop||n.clientTop;return{x:e.left+h-r,y:e.top+o-l}}function it(t,i,e,s){var n=t.radius*t.z1/(t.z1+t.z2+i.z);return{x:i.x*n*e,y:i.y*n*s,z:i.z,w:(t.z1-i.z)/t.z2}}function et(t){this.e=t,this.br=0,this.line=[],this.text=[],this.original=t.innerText||t.textContent}function st(t,i){this.ts=null,this.tc=t,this.tag=i,this.x=this.y=this.w=this.h=this.sc=1,this.z=0,this.pulse=1,this.pulsate=t.pulsateTo<1,this.colour=t.outlineColour,this.adash=~~t.outlineDash,this.agap=~~t.outlineDashSpace||this.adash,this.aspeed=1*t.outlineDashSpeed,"tag"==this.colour?this.colour=L(i.a,"color"):"tagbg"==this.colour&&(this.colour=L(i.a,"background-color")),this.Draw=this.pulsate?this.DrawPulsate:this.DrawSimple,this.radius=0|t.outlineRadius,this.SetMethod(t.outlineMethod)}function nt(t,i,e,s,n,a,h,o,r,l,c,g,f,d){this.tc=t,this.image=null,this.text=i,this.text_original=d,this.line_widths=[],this.title=e.title||null,this.a=e,this.position=new u(s[0],s[1],s[2]),this.x=this.y=this.z=0,this.w=n,this.h=a,this.colour=h||t.textColour,this.bgColour=o||t.bgColour,this.bgRadius=0|r,this.bgOutline=l||this.colour,this.bgOutlineThickness=0|c,this.textFont=g||t.textFont,this.padding=0|f,this.sc=this.alpha=1,this.weighted=!t.weight,this.outline=new st(t,this)}function at(t,i,e){var n,r,l,u=At.getElementById(t),c=["id","class","innerHTML"];if(!u)throw 0;if(s(window.G_vmlCanvasManager)&&(u=window.G_vmlCanvasManager.initElement(u),this.ie=parseFloat(navigator.appVersion.split("MSIE")[1])),u&&(!u.getContext||!u.getContext("2d").fillText)){for(r=At.createElement("DIV"),n=0;n0?at.scrollPause=~~this.scrollPause:this.scrollPause=0,this.minTags>0&&this.repeatTags<1&&(n=this.GetTags().length)&&(this.repeatTags=bt(this.minTags/n)-1),this.transform=g.Identity(),this.startTime=this.time=o(),this.mx=this.my=-1,this.centreImage&&y(this),this.Animate=this.dragControl?this.AnimateDrag:this.AnimatePosition,this.animTiming="function"==typeof at[this.animTiming]?at[this.animTiming]:at.Smooth,this.shadowBlur||this.shadowOffset[0]||this.shadowOffset[1]?(this.ctxt.shadowColor=this.shadow,this.shadow=this.ctxt.shadowColor,this.shadowAlpha=b()):delete this.shadow,this.Load(),i&&this.hideTags&&function(t){at.loaded?t.HideTags():R("load",function(){t.HideTags()},window)}(this),this.yaw=this.initial?this.initial[0]*this.maxSpeed:0,this.pitch=this.initial?this.initial[1]*this.maxSpeed:0,this.tooltip?(this.ctitle=u.title,u.title="","native"==this.tooltip?this.Tooltip=this.TooltipNative:(this.Tooltip=this.TooltipDiv,this.ttdiv||(this.ttdiv=At.createElement("div"),this.ttdiv.className=this.tooltipClass,this.ttdiv.style.position="absolute",this.ttdiv.style.zIndex=u.style.zIndex+1,R("mouseover",function(t){t.target.style.display="none"},this.ttdiv),At.body.appendChild(this.ttdiv)))):this.Tooltip=this.TooltipNone,!this.noMouse&&!Ft[t])for(Ft[t]=[["mousemove",Y],["mouseout",j],["mouseup",V],["touchstart",q],["touchend",G],["touchcancel",G],["touchmove",Z]],this.dragControl&&(Ft[t].push(["mousedown",U]),Ft[t].push(["selectstart",h])),this.wheelZoom&&(Ft[t].push(["mousewheel",Q]),Ft[t].push(["DOMMouseScroll",Q])),this.scrollPause&&Ft[t].push(["scroll",J,window]),n=0;n=1?0:i<=-1?Math.PI:Math.acos(i))},dt.unit=function(){var t=this.length();return new u(this.x/t,this.y/t,this.z/t)},ft=g.prototype,g.Identity=function(){return new g([1,0,0,0,1,0,0,0,1])},g.Rotation=function(t,i){var e=vt(t),s=yt(t),n=1-s;return new g([s+zt(i.x,2)*n,i.x*i.y*n-i.z*e,i.x*i.z*n+i.y*e,i.y*i.x*n+i.z*e,s+zt(i.y,2)*n,i.y*i.z*n-i.x*e,i.z*i.x*n-i.y*e,i.z*i.y*n+i.x*e,s+zt(i.z,2)*n])},ft.mul=function(t){var i,e,s=[],n=t.xform?1:0;for(i=1;i<=3;++i)for(e=1;e<=3;++e)n?s.push(this[i][1]*t[1][e]+this[i][2]*t[2][e]+this[i][3]*t[3][e]):s.push(this[i][e]*t);return new g(s)},ft.xform=function(t){var i={},e=t.x,s=t.y,n=t.z;return i.x=e*this[1][1]+s*this[2][1]+n*this[3][1],i.y=e*this[1][2]+s*this[2][2]+n*this[3][2],i.z=e*this[1][3]+s*this[2][3]+n*this[3][3],i},pt=M.prototype,pt.SetImage=function(t,i,e,s,n,a,h,o){this.image=t,this.iwidth=i*this.scale,this.iheight=e*this.scale,this.ipos=s,this.ipad=n*this.scale,this.iscale=o,this.ialign=a,this.ivalign=h},pt.Align=function(t,i,e){var s=0;return"right"==e||"bottom"==e?s=i-t:"left"!=e&&"top"!=e&&(s=(i-t)/2),s},pt.Create=function(t,i,e,s,n,a,h,o,r){var l,u,c,g,f,d,m,p,w,x,v,y,T,b,C,z,M,A=xt(h[0]),F=xt(h[1]);return o=Tt(o,A+a,F+a),f=2*(o+s),m=2*(o+s),u=this.width+f,c=this.height+m,w=x=o+s,this.image&&(v=y=o+s,T=this.iwidth,b=this.iheight,"top"==this.ipos||"bottom"==this.ipos?(Tt?(o.push(this.line.join(" ")),this.line=[h[a]]):this.line.push(h[a]);o.push(this.line.join(" "))}return this.text=o},ut=st.prototype,ut.SetMethod=function(t){var i={block:["PreDraw","DrawBlock"],colour:["PreDraw","DrawColour"],outline:["PostDraw","DrawOutline"],classic:["LastDraw","DrawOutline"],size:["PreDraw","DrawSize"],none:["LastDraw"]},e=i[t]||i.outline;"none"==t?this.Draw=function(){return 1}:this.drawFunc=this[e[1]],this[e[0]]=this.Draw},ut.Update=function(t,i,e,s,n,a,h,o){var r=this.tc.outlineOffset,l=2*r;this.x=n*t+h-r,this.y=n*i+o-r,this.w=n*e+l,this.h=n*s+l,this.sc=n,this.z=a},ut.Ants=function(t){if(this.adash){var i,e=this.adash,s=this.agap,n=this.aspeed,a=e+s,h=0,r=e,l=s,u=0,c=0;n&&(c=xt(n)*(o()-this.ts)/50,n<0&&(c=864e4-c),n=~~c%a),n?(e>=n?(h=e-n,r=n):(l=a-n,u=s-l),i=[h,l,r,u]):i=[e,s],t.setLineDash(i)}},ut.DrawOutline=function(t,i,e,s,n,a){var h=St(this.radius,n/2,s/2);t.strokeStyle=a,this.Ants(t),I(t,i,e,s,n,h,!0)},ut.DrawSize=function(t,i,e,s,n,a,h,o,r){var l,u,c,g=h.w,f=h.h;return this.pulsate?(c=h.image?(h.image.height+this.tc.outlineIncrease)/h.image.height:h.oscale,u=h.fimage||h.image,l=1+(c-1)*(1-this.pulse),h.h*=l,h.w*=l):u=h.oimage,h.alpha=1,h.Draw(t,o,r,u),h.h=f,h.w=g,1},ut.DrawColour=function(t,i,e,s,n,a,h,o,r){return h.oimage?(this.pulse<1?(h.alpha=1-zt(this.pulse,2),h.Draw(t,o,r,h.fimage),h.alpha=this.pulse):h.alpha=1,h.Draw(t,o,r,h.oimage),1):this[h.image?"DrawColourImage":"DrawColourText"](t,i,e,s,n,a,h,o,r)},ut.DrawColourText=function(t,i,e,s,n,a,h,o,r){var l=h.colour;return h.colour=a,h.alpha=1,h.Draw(t,o,r),h.colour=l,1},ut.DrawColourImage=function(t,i,e,s,n,a,h,o,r){var l,u=t.canvas,c=~~Tt(i,0),g=~~Tt(e,0),f=St(u.width-c,s)+.5|0,d=St(u.height-g,n)+.5|0;return wt?(wt.width=f,wt.height=d):wt=S(f,d),wt?(l=wt.getContext("2d"),l.drawImage(u,c,g,f,d,0,0,f,d),t.clearRect(c,g,f,d),this.pulsate?h.alpha=1-zt(this.pulse,2):h.alpha=1,h.Draw(t,o,r),t.setTransform(1,0,0,1,0,0),t.save(),t.beginPath(),t.rect(c,g,f,d),t.clip(),t.globalCompositeOperation="source-in",t.fillStyle=a,t.fillRect(c,g,f,d),t.restore(),t.globalAlpha=1,t.globalCompositeOperation="destination-over",t.drawImage(wt,0,0,f,d,c,g,f,d),t.globalCompositeOperation="source-over",1):this.SetMethod("outline")},ut.DrawBlock=function(t,i,e,s,n,a){var h=St(this.radius,n/2,s/2);t.fillStyle=a,I(t,i,e,s,n,h)},ut.DrawSimple=function(t,i,e,s,n,a){var h=this.tc;return t.setTransform(1,0,0,1,0,0),t.strokeStyle=this.colour,t.lineWidth=h.outlineThickness,t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0,t.globalAlpha=a?n:1,this.drawFunc(t,this.x,this.y,this.w,this.h,this.colour,i,e,s)},ut.DrawPulsate=function(t,i,e,s){var n=o()-this.ts,a=this.tc,h=a.pulsateTo+(1-a.pulsateTo)*(.5+yt(2*Math.PI*n/(1e3*a.pulsateTime))/2);return this.pulse=h=at.Smooth(1,h),this.DrawSimple(t,i,e,s,h,1)},ut.Active=function(t,i,e){var s=i>=this.x&&e>=this.y&&i<=this.x+this.w&&e<=this.y+this.h;return this.ts=s?this.ts||o():null,s},ut.PreDraw=ut.PostDraw=ut.LastDraw=h,ct=nt.prototype,ct.Init=function(t){var i=this.tc;this.textHeight=i.textHeight,this.HasText()?this.Measure(i.ctxt,i):(this.w=this.iw,this.h=this.ih),this.SetShadowColour=i.shadowAlpha?this.SetShadowColourAlpha:this.SetShadowColourFixed,this.SetDraw(i)},ct.Draw=h,ct.HasText=function(){return this.text&&this.text[0].length>0},ct.EqualTo=function(t){var i=t.getElementsByTagName("img");return this.a.href!=t.href?0:i.length?this.image.src==i[0].src:(t.innerText||t.textContent)==this.text_original},ct.SetImage=function(t){this.image=this.fimage=t},ct.SetDraw=function(t){this.Draw=this.fimage?t.ie>7?this.DrawImageIE:this.DrawImage:this.DrawText,t.noSelect&&(this.CheckActive=h)},ct.MeasureText=function(t){var i,e,s=this.text.length,n=0;for(i=0;i0?l=A(l,this.oimage.width,this.oimage.height):this.oimage=A(this.oimage,l.width,l.height)),l&&(this.fimage=l,o=this.fimage.width/e,r=this.fimage.height/e),this.SetDraw(i),i.txtOpt=!!this.fimage),this.h=r,this.w=o},ct.SetFont=function(t,i,e,s){this.textFont=t,this.colour=i,this.bgColour=e,this.bgOutline=s,this.Measure(this.tc.ctxt,this.tc)},ct.SetWeight=function(t){var i,e,s=this.tc,n=s.weightMode.split(/[, ]/),a=t.length;if(this.HasText()){for(this.weighted=!0,e=0;e0&&e.weightSizeMax>e.weightSizeMin?this.textHeight=e.weightSize*(e.weightSizeMin+(e.weightSizeMax-e.weightSizeMin)*o):this.textHeight=Tt(1,t*e.weightSize))},ct.SetShadowColourFixed=function(t,i,e){t.shadowColor=i},ct.SetShadowColourAlpha=function(t,i,e){t.shadowColor=T(i,e)},ct.DrawText=function(t,i,e){var s,n,a=this.tc,h=this.x,o=this.y,r=this.sc;for(t.globalAlpha=this.alpha,t.fillStyle=this.colour,a.shadow&&this.SetShadowColour(t,a.shadow,this.alpha),t.font=this.font,h+=i/r,o+=e/r-this.h/2,s=0;sthis.max_weight[s])&&(this.max_weight[s]=i),(!this.min_weight[s]||ithis.min_weight[s]&&(n=1);if(n)for(e=0;e=0&&this.my>=0&&this.taglist[s].CheckActive(d,g,f))&&e.sc>u&&(!x||e.z<=0)&&(i=e,m=s,i.tag=this.taglist[s],u=e.sc);this.active=i}for(this.txtOpt||this.shadow&&this.SetShadow(d),d.clearRect(0,0,o,l),s=0;s=this.fadeIn?(this.fadeIn=0,this.fixedAlpha=1):this.fixedAlpha=i/this.fadeIn),!!this.fixedAnim&&(this.fixedAnim.transform||(this.fixedAnim.transform=this.transform),t=this.fixedAnim,i=o()-t.t0,e=t.angle,n=this.animTiming(t.t,i),this.transform=t.transform,i>=t.t?(this.fixedCallbackTag=t.tag,this.fixedCallback=t.cb,this.fixedAnim=this.yaw=this.pitch=0):e*=n,s=g.Rotation(e,t.axis),this.transform=this.transform.mul(s),0!=this.fixedAnim)},gt.AnimatePosition=function(t,i,e){var s,n,a=this,h=a.mx,o=a.my;!a.frozen&&h>=0&&o>=0&&hi&&(t.yaw=e>t.z0?t.yaw*t.decel:0),!t.ly&&s>i&&(t.pitch=s>t.z0?t.pitch*t.decel:0)},gt.Zoom=function(t){this.z2=this.z1*(1/t),this.drawn=0},gt.Clicked=function(t){var i=this.active;try{i&&i.tag&&(!1===this.clickToFront||null===this.clickToFront?i.tag.Clicked(t):this.TagToFront(i.tag,this.clickToFront,function(){i.tag.Clicked(t)},!0))}catch(t){}},gt.Wheel=function(t){var i=this.zoom+this.zoomStep*(t?1:-1);this.zoom=St(this.zoomMax,Tt(this.zoomMin,i)),this.Zoom(this.zoom)},gt.BeginDrag=function(t){this.down=X(t,this.canvas),t.cancelBubble=!0,t.returnValue=!1,t.preventDefault&&t.preventDefault()},gt.Drag=function(t,i){if(this.dragControl&&this.down){var e=this.dragThreshold*this.dragThreshold,s=i.x-this.down.x,n=i.y-this.down.y;(this.dragging||s*s+n*n>e)&&(this.dx=s,this.dy=n,this.dragging=1,this.down=i)}return this.dragging},gt.EndDrag=function(){var t=this.dragging;return this.dragging=this.down=null,t},gt.BeginPinch=function(t){this.pinched=[ht(t),this.zoom],t.preventDefault&&t.preventDefault()},gt.Pinch=function(t){var i,e,s=this.pinched;s&&(e=ht(t),i=s[1]*e/s[0],this.zoom=St(this.zoomMax,Tt(this.zoomMin,i)),this.Zoom(this.zoom))},gt.EndPinch=function(t){this.pinched=null},gt.Pause=function(){this.paused=!0},gt.Resume=function(){this.paused=!1},gt.SetSpeed=function(t){this.initial=t,this.yaw=t[0]*this.maxSpeed,this.pitch=t[1]*this.maxSpeed},gt.FindTag=function(t){if(!s(t))return null;if(s(t.index)&&(t=t.index),!n(t))return this.taglist[t];var i,e,a;for(s(t.id)?(i="id",e=t.id):s(t.text)&&(i="innerText",e=t.text),a=0;a").addClass(e.iconBase).addClass(r)).append(" ")}s.append(t("").html(a.message)),s.addClass(e.messageClass);var l=e.alertClasses[e.defaultAlert];e.alertClasses[a.messageType]&&(l=e.alertClasses[a.messageType]),s.addClass(l),o.after(s),s.fadeIn()})),h?e.onSuccess.call(this):e.onFailure.call(this)}},t.fn.handleMessages.defaults={messages:[],alertClasses:{good:"alert-success",info:"alert-info",error:"alert-danger",warning:"alert-warning"},iconClasses:{good:"fa-check",info:"fa-info-circle",error:"fa-times",warning:"fa-warning"},showIcons:!0,iconBase:"fa fa-fw",defaultIcon:"warning",defaultAlert:"warning",messageClass:"js-message",messageSelector:".message",onSuccess:function(){},onFailure:function(){}}}(n.a)},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".field.togglegroup").each(function(){var t=n()(this),i=t.find(".group-toggle").data("show-when-checked"),e=t.find(".group-toggle input"),s=t.find(".group-fields");s.toggle(i?e.is(":checked"):!e.is(":checked")),e.on("click",function(){s.toggle(i?n()(this).is(":checked"):!n()(this).is(":checked"))})})})},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".scrolltotopbutton").each(function(){var t=n()(this),i=parseInt(t.data("offset-show")),e=parseInt(t.data("offset-opacity")),s=parseInt(t.data("scroll-duration"));n()(window).scroll(function(){n()(this).scrollTop()>i?t.addClass("is-visible"):t.removeClass("is-visible fade-out"),n()(this).scrollTop()>e&&t.addClass("fade-out")}),t.on("click",function(t){t.preventDefault(),n()("body, html").animate({scrollTop:0},s)})})})},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".tagcloudcomponent").each(function(){var t=n()(this);n()(t.data("canvas")).tagcanvas({depth:parseFloat(t.data("depth")),zoom:parseFloat(t.data("zoom")),zoomMin:parseFloat(t.data("zoom-min")),zoomMax:parseFloat(t.data("zoom-max")),textColour:t.data("color-text"),outlineColour:t.data("color-outline"),initial:t.data("initial"),weightSizeMin:parseInt(t.data("weight-size-min")),weightSizeMax:parseInt(t.data("weight-size-max")),weightFrom:"data-weight",weight:t.data("weight")},t.data("tag-list"))});var t=function(){n()(".tagcloudcomponent").each(function(){var t=n()(this),i=n()(t.data("canvas")),e=t.width();i.attr("width",e)})},i=null;n()(window).resize(function(){null!==i&&clearTimeout(i),i=setTimeout(t,500)}),n()(window).on("load",function(){t()})})}]); \ No newline at end of file +!function(t){function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var e={};i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:s})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="/resources/silverware/silverware/client/dist/",i(i.s=1)}([function(t,i){t.exports=jQuery},function(t,i,e){e(2),e(3),e(4),e(5),e(6),e(7),e(8)},function(t,i){},function(t,i,e){(function(t){var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(e){"use strict";function s(t){return void 0!==t}function n(t){return"object"==(void 0===t?"undefined":i(t))&&null!=t}function a(t,i,e){return isNaN(t)?e:ft(e,gt(i,t))}function h(){return!1}function o(){return(new Date).valueOf()}function r(t){for(var i,e,s=t.length-1;s;)e=~~(Math.random()*s),i=t[s],t[s]=t[e],t[e]=i,--s}function l(t,i,e){this.x=t,this.y=i,this.z=e}function u(t){this[1]={1:t[0],2:t[1],3:t[2]},this[2]={1:t[3],2:t[4],3:t[5]},this[3]={1:t[6],2:t[7],3:t[8]}}function c(t,i,e,s,n){var a,h,o,r,l,u=[],c=2/t;for(l=Math.PI*(3-mt(5)+(parseFloat(n)?parseFloat(n):0)),a=0;a0&&(ou.max.x&&(u.max.x=o),ru.max.y&&(u.max.y=r));return a!=c&&(u.min.x*=c/a,u.max.x*=c/a),h!=g&&(u.min.y*=c/h,u.max.y*=c/h),f=null,u}function M(t){return"'"+t.replace(/(\'|\")/g,"").replace(/\s*,\s*/g,"', '")+"'"}function A(t,i,e){(e=e||yt).addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i)}function F(t,i,e,s){var n,a,h,o,r,l,u=s.imageScale;return i.complete?t.complete?(i.width=i.width,i.height=i.height,u&&(t.width=i.width*u,t.height=i.height*u),e.iw=t.width,e.ih=t.height,s.txtOpt&&(a=t,n=s.zoomMax*s.txtScale,r=e.iw*n,l=e.ih*n,r0?o=r*o/100:o*=n,(h=a.getContext("2d")).globalCompositeOperation="source-over",h.fillStyle="#fff",o>=r/2?(o=ft(e,s)/2,h.beginPath(),h.moveTo(e/2,s/2),h.arc(e/2,s/2,o,0,2*Math.PI,!1),h.fill(),h.closePath()):(S(h,0,0,e,s,o=ft(e/2,s/2,o),!0),h.fill()),h.globalCompositeOperation="source-in",h.drawImage(t,0,0,e,s),a):null}(e.image,s.imageRadius,r,l,n)),e.HasText()||(s.shadow&&(a=function(t,i,e,s,n,a,h){var o,r,l=lt(h[0]),u=lt(h[1]),c=i+(l>a?l+a:2*a)*s,g=e+(u>a?u+a:2*a)*s,f=s*((a||0)+(h[0]<0?l:0)),d=s*((a||0)+(h[1]<0?u:0));return(o=x(c,g))?(r=o.getContext("2d"),n&&(r.shadowColor=n),a&&(r.shadowBlur=a*s),h&&(r.shadowOffsetX=h[0]*s,r.shadowOffsetY=h[1]*s),r.drawImage(t,f,d,i,e),{image:o,width:c/s,height:g/s}):null}(e.image,r,l,n,s.shadow,s.shadowBlur,s.shadowOffset))&&(e.fimage=a.image,e.w=a.width,e.h=a.height),(s.bgColour||s.bgOutlineThickness)&&(h="tag"==s.bgColour?O(e.a,"background-color"):s.bgColour,o="tag"==s.bgOutline?O(e.a,"color"):s.bgOutline||s.textColour,r=e.fimage.width,l=e.fimage.height,"colour"==s.outlineMethod&&(a=D(e.fimage,r,l,n,h,s.bgOutlineThickness,e.outline.colour,s.padding,s.bgRadius,1))&&(e.oimage=a.image),(a=D(e.fimage,r,l,n,h,s.bgOutlineThickness,o,s.padding,s.bgRadius))&&(e.fimage=a.image,e.w=a.width,e.h=a.height)),"size"==s.outlineMethod&&(s.outlineIncrease>0?(e.iw+=2*s.outlineIncrease,e.ih+=2*s.outlineIncrease,r=n*e.iw,l=n*e.ih,a=z(e.fimage,r,l),e.oimage=a,e.fimage=C(e.fimage,e.oimage.width,e.oimage.height)):(r=n*(e.iw+2*s.outlineIncrease),l=n*(e.ih+2*s.outlineIncrease),a=z(e.fimage,r,l),e.oimage=C(a,e.fimage.width,e.fimage.height))))),void e.Init()):A("load",function(){F(t,i,e,s)},t):A("load",function(){F(t,i,e,s)},i)}function O(t,i){var e=yt.defaultView,s=i.replace(/\-([a-z])/g,function(t){return t.charAt(1).toUpperCase()});return e&&e.getComputedStyle&&e.getComputedStyle(t,null).getPropertyValue(i)||t.currentStyle&&t.currentStyle[s]}function k(t,i,e){var s,n=1;return i?n=1*(t.getAttribute(i)||e):(s=O(t,"font-size"))&&(n=s.indexOf("px")>-1&&1*s.replace("px","")||s.indexOf("pt")>-1&&1.25*s.replace("pt","")||3.3*s),n}function P(t){return t.target&&s(t.target.id)?t.target.id:t.srcElement.parentNode.id}function E(t,i){var e,n,a=parseInt(O(i,"width"))/i.width,h=parseInt(O(i,"height"))/i.height;return s(t.offsetX)?e={x:t.offsetX,y:t.offsetY}:(n=V(i.id),s(t.changedTouches)&&(t=t.changedTouches[0]),t.pageX&&(e={x:t.pageX-n.x,y:t.pageY-n.y})),e&&a&&h&&(e.x/=a,e.y/=h),e}function B(t){var i=t.target||t.fromElement.parentNode,e=Q.tc[i.id];e&&(e.mx=e.my=-1,e.UnFreeze(),e.EndDrag())}function R(t){var i,e,s,n=Q,a=P(t);for(i in n.tc)(e=n.tc[i]).tttimer&&(clearTimeout(e.tttimer),e.tttimer=null);a&&n.tc[a]&&((s=E(t,(e=n.tc[a]).canvas))&&(e.mx=s.x,e.my=s.y,e.Drag(t,s)),e.drawn=0)}function _(t){var i=Q,e=yt.addEventListener?0:1,s=P(t);s&&t.button==e&&i.tc[s]&&i.tc[s].BeginDrag(t)}function N(t){var i,e=Q,s=yt.addEventListener?0:1,n=P(t);n&&t.button==s&&e.tc[n]&&(i=e.tc[n],R(t),i.EndDrag()||i.touchState||i.Clicked(t))}function L(t){var i,e=P(t),s=e&&Q.tc[e];s&&t.changedTouches&&(1==t.touches.length&&0==s.touchState?(s.touchState=1,s.BeginDrag(t),(i=E(t,s.canvas))&&(s.mx=i.x,s.my=i.y,s.drawn=0)):2==t.targetTouches.length&&s.pinchZoom?(s.touchState=3,s.EndDrag(),s.BeginPinch(t)):(s.EndDrag(),s.EndPinch(),s.touchState=0))}function H(t){var i=P(t),e=i&&Q.tc[i];if(e&&t.changedTouches){switch(e.touchState){case 1:e.Draw(),e.Clicked();break;case 2:e.EndDrag();break;case 3:e.EndPinch()}e.touchState=0}}function W(t){var i,e,s,n=Q,a=P(t);for(i in n.tc)(e=n.tc[i]).tttimer&&(clearTimeout(e.tttimer),e.tttimer=null);if((e=a&&n.tc[a])&&t.changedTouches&&e.touchState){switch(e.touchState){case 1:case 2:(s=E(t,e.canvas))&&(e.mx=s.x,e.my=s.y,e.Drag(t,s)&&(e.touchState=2));break;case 3:e.Pinch(t)}e.drawn=0}}function X(t){var i=Q,e=P(t);e&&i.tc[e]&&(t.cancelBubble=!0,t.returnValue=!1,t.preventDefault&&t.preventDefault(),i.tc[e].Wheel((t.wheelDelta||t.detail)>0))}function j(t){var i,e=Q;for(i in clearTimeout(e.scrollTimer),e.tc)e.tc[i].Pause();e.scrollTimer=setTimeout(function(){var t,i=Q;for(t in i.tc)i.tc[t].Resume()},e.scrollPause)}function Y(){U(o())}function U(t){var i,e=Q.tc;for(i in Q.NextFrame(Q.interval),t=t||o(),e)e[i].Draw(t)}function V(t){var i=yt.getElementById(t).getBoundingClientRect(),e=yt.documentElement,s=yt.body,n=window,a=n.pageXOffset||e.scrollLeft,h=n.pageYOffset||e.scrollTop,o=e.clientLeft||s.clientLeft,r=e.clientTop||s.clientTop;return{x:i.left+a-o,y:i.top+h-r}}function q(t){this.e=t,this.br=0,this.line=[],this.text=[],this.original=t.innerText||t.textContent}function G(t,i){this.ts=null,this.tc=t,this.tag=i,this.x=this.y=this.w=this.h=this.sc=1,this.z=0,this.pulse=1,this.pulsate=t.pulsateTo<1,this.colour=t.outlineColour,this.adash=~~t.outlineDash,this.agap=~~t.outlineDashSpace||this.adash,this.aspeed=1*t.outlineDashSpeed,"tag"==this.colour?this.colour=O(i.a,"color"):"tagbg"==this.colour&&(this.colour=O(i.a,"background-color")),this.Draw=this.pulsate?this.DrawPulsate:this.DrawSimple,this.radius=0|t.outlineRadius,this.SetMethod(t.outlineMethod)}function Z(t,i,e,s,n,a,h,o,r,u,c,g,f,d){this.tc=t,this.image=null,this.text=i,this.text_original=d,this.line_widths=[],this.title=e.title||null,this.a=e,this.position=new l(s[0],s[1],s[2]),this.x=this.y=this.z=0,this.w=n,this.h=a,this.colour=h||t.textColour,this.bgColour=o||t.bgColour,this.bgRadius=0|r,this.bgOutline=u||this.colour,this.bgOutlineThickness=0|c,this.textFont=g||t.textFont,this.padding=0|f,this.sc=this.alpha=1,this.weighted=!t.weight,this.outline=new G(t,this)}function Q(t,i,e){var n,r,l,c,g=yt.getElementById(t),f=["id","class","innerHTML"];if(!g)throw 0;if(s(window.G_vmlCanvasManager)&&(g=window.G_vmlCanvasManager.initElement(g),this.ie=parseFloat(navigator.appVersion.split("MSIE")[1])),g&&(!g.getContext||!g.getContext("2d").fillText)){for(r=yt.createElement("DIV"),n=0;n0?Q.scrollPause=~~this.scrollPause:this.scrollPause=0,this.minTags>0&&this.repeatTags<1&&(n=this.GetTags().length)&&(this.repeatTags=dt(this.minTags/n)-1),this.transform=u.Identity(),this.startTime=this.time=o(),this.mx=this.my=-1,this.centreImage&&function(t){var i=new Image;i.onload=function(){var e=i.width/2,s=i.height/2;t.centreFunc=function(t,n,a,h,o){t.setTransform(1,0,0,1,0,0),t.globalAlpha=1,t.drawImage(i,h-e,o-s)}},i.src=t.centreImage}(this),this.Animate=this.dragControl?this.AnimateDrag:this.AnimatePosition,this.animTiming="function"==typeof Q[this.animTiming]?Q[this.animTiming]:Q.Smooth,this.shadowBlur||this.shadowOffset[0]||this.shadowOffset[1]?(this.ctxt.shadowColor=this.shadow,this.shadow=this.ctxt.shadowColor,this.shadowAlpha=function(){var t,i=x(3,3);return!!i&&((t=i.getContext("2d")).strokeStyle="#000",t.shadowColor="#fff",t.shadowBlur=3,t.globalAlpha=0,t.strokeRect(2,2,2,2),t.globalAlpha=1,i=null,t.getImageData(2,2,1,1).data[0]>0)}()):delete this.shadow,this.Load(),i&&this.hideTags&&(c=this,Q.loaded?c.HideTags():A("load",function(){c.HideTags()},window)),this.yaw=this.initial?this.initial[0]*this.maxSpeed:0,this.pitch=this.initial?this.initial[1]*this.maxSpeed:0,this.tooltip?(this.ctitle=g.title,g.title="","native"==this.tooltip?this.Tooltip=this.TooltipNative:(this.Tooltip=this.TooltipDiv,this.ttdiv||(this.ttdiv=yt.createElement("div"),this.ttdiv.className=this.tooltipClass,this.ttdiv.style.position="absolute",this.ttdiv.style.zIndex=g.style.zIndex+1,A("mouseover",function(t){t.target.style.display="none"},this.ttdiv),yt.body.appendChild(this.ttdiv)))):this.Tooltip=this.TooltipNone,!this.noMouse&&!Tt[t])for(Tt[t]=[["mousemove",R],["mouseout",B],["mouseup",N],["touchstart",L],["touchend",H],["touchcancel",H],["touchmove",W]],this.dragControl&&(Tt[t].push(["mousedown",_]),Tt[t].push(["selectstart",h])),this.wheelZoom&&(Tt[t].push(["mousewheel",X]),Tt[t].push(["DOMMouseScroll",X])),this.scrollPause&&Tt[t].push(["scroll",j,window]),n=0;n=1?0:i<=-1?Math.PI:Math.acos(i)},at.unit=function(){var t=this.length();return new l(this.x/t,this.y/t,this.z/t)},nt=u.prototype,u.Identity=function(){return new u([1,0,0,0,1,0,0,0,1])},u.Rotation=function(t,i){var e=ut(t),s=ct(t),n=1-s;return new u([s+pt(i.x,2)*n,i.x*i.y*n-i.z*e,i.x*i.z*n+i.y*e,i.y*i.x*n+i.z*e,s+pt(i.y,2)*n,i.y*i.z*n-i.x*e,i.z*i.x*n-i.y*e,i.z*i.y*n+i.x*e,s+pt(i.z,2)*n])},nt.mul=function(t){var i,e,s=[],n=t.xform?1:0;for(i=1;i<=3;++i)for(e=1;e<=3;++e)n?s.push(this[i][1]*t[1][e]+this[i][2]*t[2][e]+this[i][3]*t[3][e]):s.push(this[i][e]*t);return new u(s)},nt.xform=function(t){var i={},e=t.x,s=t.y,n=t.z;return i.x=e*this[1][1]+s*this[2][1]+n*this[3][1],i.y=e*this[1][2]+s*this[2][2]+n*this[3][2],i.z=e*this[1][3]+s*this[2][3]+n*this[3][3],i},(ot=b.prototype).SetImage=function(t,i,e,s,n,a,h,o){this.image=t,this.iwidth=i*this.scale,this.iheight=e*this.scale,this.ipos=s,this.ipad=n*this.scale,this.iscale=o,this.ialign=a,this.ivalign=h},ot.Align=function(t,i,e){var s=0;return"right"==e||"bottom"==e?s=i-t:"left"!=e&&"top"!=e&&(s=(i-t)/2),s},ot.Create=function(t,i,e,s,n,a,h,o,r){var l,u,c,g,f,d,m,p,w,v,y,b,C,z,D,I,M,A=lt(h[0]),F=lt(h[1]);return f=2*((o=gt(o,A+a,F+a))+s),m=2*(o+s),u=this.width+f,c=this.height+m,w=v=o+s,this.image&&(y=b=o+s,C=this.iwidth,z=this.iheight,"top"==this.ipos||"bottom"==this.ipos?(Ct?(o.push(this.line.join(" ")),this.line=[h[a]]):this.line.push(h[a]);o.push(this.line.join(" "))}return this.text=o},(it=G.prototype).SetMethod=function(t){var i={block:["PreDraw","DrawBlock"],colour:["PreDraw","DrawColour"],outline:["PostDraw","DrawOutline"],classic:["LastDraw","DrawOutline"],size:["PreDraw","DrawSize"],none:["LastDraw"]},e=i[t]||i.outline;"none"==t?this.Draw=function(){return 1}:this.drawFunc=this[e[1]],this[e[0]]=this.Draw},it.Update=function(t,i,e,s,n,a,h,o){var r=this.tc.outlineOffset,l=2*r;this.x=n*t+h-r,this.y=n*i+o-r,this.w=n*e+l,this.h=n*s+l,this.sc=n,this.z=a},it.Ants=function(t){if(this.adash){var i,e=this.adash,s=this.agap,n=this.aspeed,a=e+s,h=0,r=e,l=s,u=0,c=0;n&&(c=lt(n)*(o()-this.ts)/50,n<0&&(c=864e4-c),n=~~c%a),n?(e>=n?(h=e-n,r=n):u=s-(l=a-n),i=[h,l,r,u]):i=[e,s],t.setLineDash(i)}},it.DrawOutline=function(t,i,e,s,n,a){var h=ft(this.radius,n/2,s/2);t.strokeStyle=a,this.Ants(t),S(t,i,e,s,n,h,!0)},it.DrawSize=function(t,i,e,s,n,a,h,o,r){var l,u,c,g=h.w,f=h.h;return this.pulsate?(c=h.image?(h.image.height+this.tc.outlineIncrease)/h.image.height:h.oscale,u=h.fimage||h.image,l=1+(c-1)*(1-this.pulse),h.h*=l,h.w*=l):u=h.oimage,h.alpha=1,h.Draw(t,o,r,u),h.h=f,h.w=g,1},it.DrawColour=function(t,i,e,s,n,a,h,o,r){return h.oimage?(this.pulse<1?(h.alpha=1-pt(this.pulse,2),h.Draw(t,o,r,h.fimage),h.alpha=this.pulse):h.alpha=1,h.Draw(t,o,r,h.oimage),1):this[h.image?"DrawColourImage":"DrawColourText"](t,i,e,s,n,a,h,o,r)},it.DrawColourText=function(t,i,e,s,n,a,h,o,r){var l=h.colour;return h.colour=a,h.alpha=1,h.Draw(t,o,r),h.colour=l,1},it.DrawColourImage=function(t,i,e,s,n,a,h,o,r){var l=t.canvas,u=~~gt(i,0),c=~~gt(e,0),g=ft(l.width-u,s)+.5|0,f=ft(l.height-c,n)+.5|0;return rt?(rt.width=g,rt.height=f):rt=x(g,f),rt?(rt.getContext("2d").drawImage(l,u,c,g,f,0,0,g,f),t.clearRect(u,c,g,f),this.pulsate?h.alpha=1-pt(this.pulse,2):h.alpha=1,h.Draw(t,o,r),t.setTransform(1,0,0,1,0,0),t.save(),t.beginPath(),t.rect(u,c,g,f),t.clip(),t.globalCompositeOperation="source-in",t.fillStyle=a,t.fillRect(u,c,g,f),t.restore(),t.globalAlpha=1,t.globalCompositeOperation="destination-over",t.drawImage(rt,0,0,g,f,u,c,g,f),t.globalCompositeOperation="source-over",1):this.SetMethod("outline")},it.DrawBlock=function(t,i,e,s,n,a){var h=ft(this.radius,n/2,s/2);t.fillStyle=a,S(t,i,e,s,n,h)},it.DrawSimple=function(t,i,e,s,n,a){var h=this.tc;return t.setTransform(1,0,0,1,0,0),t.strokeStyle=this.colour,t.lineWidth=h.outlineThickness,t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0,t.globalAlpha=a?n:1,this.drawFunc(t,this.x,this.y,this.w,this.h,this.colour,i,e,s)},it.DrawPulsate=function(t,i,e,s){var n=o()-this.ts,a=this.tc,h=a.pulsateTo+(1-a.pulsateTo)*(.5+ct(2*Math.PI*n/(1e3*a.pulsateTime))/2);return this.pulse=h=Q.Smooth(1,h),this.DrawSimple(t,i,e,s,h,1)},it.Active=function(t,i,e){var s=i>=this.x&&e>=this.y&&i<=this.x+this.w&&e<=this.y+this.h;return this.ts=s?this.ts||o():null,s},it.PreDraw=it.PostDraw=it.LastDraw=h,(et=Z.prototype).Init=function(t){var i=this.tc;this.textHeight=i.textHeight,this.HasText()?this.Measure(i.ctxt,i):(this.w=this.iw,this.h=this.ih),this.SetShadowColour=i.shadowAlpha?this.SetShadowColourAlpha:this.SetShadowColourFixed,this.SetDraw(i)},et.Draw=h,et.HasText=function(){return this.text&&this.text[0].length>0},et.EqualTo=function(t){var i=t.getElementsByTagName("img");return this.a.href!=t.href?0:i.length?this.image.src==i[0].src:(t.innerText||t.textContent)==this.text_original},et.SetImage=function(t){this.image=this.fimage=t},et.SetDraw=function(t){this.Draw=this.fimage?t.ie>7?this.DrawImageIE:this.DrawImage:this.DrawText,t.noSelect&&(this.CheckActive=h)},et.MeasureText=function(t){var i,e,s=this.text.length,n=0;for(i=0;i0?l=C(l,this.oimage.width,this.oimage.height):this.oimage=C(this.oimage,l.width,l.height)),l&&(this.fimage=l,o=this.fimage.width/e,r=this.fimage.height/e),this.SetDraw(i),i.txtOpt=!!this.fimage),this.h=r,this.w=o},et.SetFont=function(t,i,e,s){this.textFont=t,this.colour=i,this.bgColour=e,this.bgOutline=s,this.Measure(this.tc.ctxt,this.tc)},et.SetWeight=function(t){var i,e,s=this.tc,n=s.weightMode.split(/[, ]/),a=t.length;if(this.HasText()){for(this.weighted=!0,e=0;e0&&e.weightSizeMax>e.weightSizeMin?this.textHeight=e.weightSize*(e.weightSizeMin+(e.weightSizeMax-e.weightSizeMin)*o):this.textHeight=gt(1,t*e.weightSize))},et.SetShadowColourFixed=function(t,i,e){t.shadowColor=i},et.SetShadowColourAlpha=function(t,i,e){t.shadowColor=function(t,i){var e,s,n=t,a=(1*i).toPrecision(3)+")";return"#"===t[0]?(wt[t]||(4===t.length?wt[t]="rgba("+vt[t[1]]+vt[t[2]]+vt[t[3]]:wt[t]="rgba("+xt[t.substr(1,2)]+xt[t.substr(3,2)]+xt[t.substr(5,2)]),n=wt[t]+a):"rgb("===t.substr(0,4)||"hsl("===t.substr(0,4)?n=t.replace("(","a(").replace(")",","+a):"rgba("!==t.substr(0,5)&&"hsla("!==t.substr(0,5)||(e=t.lastIndexOf(",")+1,s=t.indexOf(")"),i*=parseFloat(t.substring(e,s)),n=t.substr(0,e)+i.toPrecision(3)+")"),n}(i,e)},et.DrawText=function(t,i,e){var s,n,a=this.tc,h=this.x,o=this.y,r=this.sc;for(t.globalAlpha=this.alpha,t.fillStyle=this.colour,a.shadow&&this.SetShadowColour(t,a.shadow,this.alpha),t.font=this.font,h+=i/r,o+=e/r-this.h/2,s=0;sthis.max_weight[s])&&(this.max_weight[s]=i),(!this.min_weight[s]||ithis.min_weight[s]&&(n=1);if(n)for(e=0;e=0&&this.my>=0&&this.taglist[s].CheckActive(f,c,g))&&e.sc>l&&(!w||e.z<=0)&&(d=s,(i=e).tag=this.taglist[s],l=e.sc);this.active=i}for(this.txtOpt||this.shadow&&this.SetShadow(f),f.clearRect(0,0,o,r),s=0;s=this.fadeIn?(this.fadeIn=0,this.fixedAlpha=1):this.fixedAlpha=i/this.fadeIn),!!this.fixedAnim&&(this.fixedAnim.transform||(this.fixedAnim.transform=this.transform),t=this.fixedAnim,i=o()-t.t0,e=t.angle,n=this.animTiming(t.t,i),this.transform=t.transform,i>=t.t?(this.fixedCallbackTag=t.tag,this.fixedCallback=t.cb,this.fixedAnim=this.yaw=this.pitch=0):e*=n,s=u.Rotation(e,t.axis),this.transform=this.transform.mul(s),0!=this.fixedAnim)},st.AnimatePosition=function(t,i,e){var s,n,a=this,h=a.mx,o=a.my;!a.frozen&&h>=0&&o>=0&&hi&&(t.yaw=e>t.z0?t.yaw*t.decel:0),!t.ly&&s>i&&(t.pitch=s>t.z0?t.pitch*t.decel:0)},st.Zoom=function(t){this.z2=this.z1*(1/t),this.drawn=0},st.Clicked=function(t){var i=this.active;try{i&&i.tag&&(!1===this.clickToFront||null===this.clickToFront?i.tag.Clicked(t):this.TagToFront(i.tag,this.clickToFront,function(){i.tag.Clicked(t)},!0))}catch(t){}},st.Wheel=function(t){var i=this.zoom+this.zoomStep*(t?1:-1);this.zoom=ft(this.zoomMax,gt(this.zoomMin,i)),this.Zoom(this.zoom)},st.BeginDrag=function(t){this.down=E(t,this.canvas),t.cancelBubble=!0,t.returnValue=!1,t.preventDefault&&t.preventDefault()},st.Drag=function(t,i){if(this.dragControl&&this.down){var e=this.dragThreshold*this.dragThreshold,s=i.x-this.down.x,n=i.y-this.down.y;(this.dragging||s*s+n*n>e)&&(this.dx=s,this.dy=n,this.dragging=1,this.down=i)}return this.dragging},st.EndDrag=function(){var t=this.dragging;return this.dragging=this.down=null,t},st.BeginPinch=function(t){this.pinched=[J(t),this.zoom],t.preventDefault&&t.preventDefault()},st.Pinch=function(t){var i,e,s=this.pinched;s&&(e=J(t),i=s[1]*e/s[0],this.zoom=ft(this.zoomMax,gt(this.zoomMin,i)),this.Zoom(this.zoom))},st.EndPinch=function(t){this.pinched=null},st.Pause=function(){this.paused=!0},st.Resume=function(){this.paused=!1},st.SetSpeed=function(t){this.initial=t,this.yaw=t[0]*this.maxSpeed,this.pitch=t[1]*this.maxSpeed},st.FindTag=function(t){if(!s(t))return null;if(s(t.index)&&(t=t.index),!n(t))return this.taglist[t];var i,e,a;for(s(t.id)?(i="id",e=t.id):s(t.text)&&(i="innerText",e=t.text),a=0;a").addClass(i.iconBase).addClass(r)).append(" ")}e.append(s("").html(h.message)),e.addClass(i.messageClass);var l=i.alertClasses[i.defaultAlert];i.alertClasses[h.messageType]&&(l=i.alertClasses[h.messageType]),e.addClass(l),o.after(e),e.fadeIn()})),a?i.onSuccess.call(this):i.onFailure.call(this)}},s.fn.handleMessages.defaults={messages:[],alertClasses:{good:"alert-success",info:"alert-info",error:"alert-danger",warning:"alert-warning"},iconClasses:{good:"fa-check",info:"fa-info-circle",error:"fa-times",warning:"fa-warning"},showIcons:!0,iconBase:"fa fa-fw",defaultIcon:"warning",defaultAlert:"warning",messageClass:"js-message",messageSelector:".message",onSuccess:function(){},onFailure:function(){}}},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".field.togglegroup").each(function(){var t=n()(this),i=t.find(".group-toggle").data("show-when-checked"),e=t.find(".group-toggle input"),s=t.find(".group-fields");s.toggle(i?e.is(":checked"):!e.is(":checked")),e.on("click",function(){s.toggle(i?n()(this).is(":checked"):!n()(this).is(":checked"))})})})},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".scrolltotopbutton").each(function(){var t=n()(this),i=parseInt(t.data("offset-show")),e=parseInt(t.data("offset-opacity")),s=parseInt(t.data("scroll-duration"));n()(window).scroll(function(){n()(this).scrollTop()>i?t.addClass("is-visible"):t.removeClass("is-visible fade-out"),n()(this).scrollTop()>e&&t.addClass("fade-out")}),t.on("click",function(t){t.preventDefault(),n()("body, html").animate({scrollTop:0},s)})})})},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".tagcloudcomponent").each(function(){var t=n()(this);n()(t.data("canvas")).tagcanvas({depth:parseFloat(t.data("depth")),zoom:parseFloat(t.data("zoom")),zoomMin:parseFloat(t.data("zoom-min")),zoomMax:parseFloat(t.data("zoom-max")),textColour:t.data("color-text"),outlineColour:t.data("color-outline"),initial:t.data("initial"),weightSizeMin:parseInt(t.data("weight-size-min")),weightSizeMax:parseInt(t.data("weight-size-max")),weightFrom:"data-weight",weight:t.data("weight")},t.data("tag-list"))});var t=function(){n()(".tagcloudcomponent").each(function(){var t=n()(this),i=n()(t.data("canvas")),e=t.width();i.attr("width",e)})},i=null;n()(window).resize(function(){null!==i&&clearTimeout(i),i=setTimeout(t,500)}),n()(window).on("load",function(){t()})})},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e(0),n=e.n(s);n()(function(){n()(".togglecomponent").each(function(){var t=n()(this),i=t.find("header");t.data("start-open")&&i.addClass("opened"),i.on("click",function(){n()(this).toggleClass("opened")}),i.find("a").on("click",function(t){t.stopPropagation()})})})}]); \ No newline at end of file diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index 830ca53..521db03 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1 @@ -.baselistcomponent .items>article.item{margin-bottom:1rem}.baselistcomponent .items>article.item:last-child{margin-bottom:0}.baselistcomponent .items>article.item>div.image{position:relative}.baselistcomponent .items>article.item>div.image a{display:block}.baselistcomponent .items>article.item>div.image img{margin:0;display:inline-block}.baselistcomponent .items>article.item>div.image div.image-overlay{top:0;left:0;right:0;bottom:0;width:100%;height:100%;opacity:0;overflow:hidden;position:absolute;-webkit-transition:.5s ease;transition:.5s ease;background-color:rgba(33,37,41,.5)}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner{top:50%;left:0;width:100%;position:absolute;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner>div.icon{font-size:32px;text-align:center;color:#fff}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner>div.text{text-align:center;padding:0 1rem}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner>div.text>*{margin:0;padding:0;font-size:1.25rem;color:#fff}.baselistcomponent .items>article.item>div.image:hover div.image-overlay,.baselistcomponent .items>article.item>div.image a:focus div.image-overlay{opacity:1}.baselistcomponent .items>article.item>section.content{margin-top:1rem}.baselistcomponent .items>article.item>section.content header{margin-bottom:.5rem}.baselistcomponent .items>article.item>section.content header>*{margin-bottom:0}.baselistcomponent .items>article.item>section.content header a{color:inherit}.baselistcomponent .items>article.item>section.content div.details{color:#868e96}.baselistcomponent .items>article.item>section.content div.details>span{margin-right:.5rem}.baselistcomponent .items>article.item>section.content div.details a{color:inherit}.baselistcomponent .items>article.item>section.content footer{margin-top:1rem}.baselistcomponent .items>article.item>section.content>div{margin-bottom:.5rem}.baselistcomponent ul.pagination{margin-top:2rem;margin-bottom:0}.contentcomponent>header a{color:inherit}.contentcomponent>div.content:after{content:"";display:table;clear:both}.featurecomponent article.feature>a.feature{display:block;text-decoration:none;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.featurecomponent article.feature>a.feature:focus,.featurecomponent article.feature>a.feature:hover{text-decoration:none}.featurecomponent article.feature div.icon{margin-bottom:.5rem}.featurecomponent article.feature div.summary>p:last-child{margin-bottom:0}.featurecomponent article.feature footer{margin-top:1rem}.imagecomponent figure{width:100%;margin-bottom:0}.imagecomponent figure>figcaption>p:last-child{margin-bottom:0}.imagecomponent a.image{display:block}@media (min-width:768px){.listcomponent .items>article.item{display:block}.listcomponent .items.image-align-left>article.item,.listcomponent .items.image-align-right>article.item,.listcomponent .items.image-align-stagger>article.item{display:-webkit-box;display:-ms-flexbox;display:flex}.listcomponent .items.image-align-left>article.item>div.image,.listcomponent .items.image-align-right>article.item>div.image,.listcomponent .items.image-align-stagger>article.item>div.image{margin-bottom:0}.listcomponent .items.image-align-left>article.item.has-image>div.image,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(odd)>div.image{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.listcomponent .items.image-align-left>article.item.has-image>section.content,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(odd)>section.content{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;margin-top:0;margin-left:1rem}.listcomponent .items.image-align-right>article.item.has-image>div.image,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(2n)>div.image,.listcomponent .items>div.image{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.listcomponent .items.image-align-right>article.item.has-image>section.content,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(2n)>section.content,.listcomponent .items>section.content{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1;margin-top:0;margin-right:1rem}}.mediacomponent figure{width:100%;margin-bottom:0}.mediacomponent figure>figcaption>p:last-child{margin-bottom:0}.mediacomponent a.text{display:block}.mediacomponent a.text:hover{text-decoration:none}.mediacomponent a.text:hover span{text-decoration:underline}.mediacomponent a.text>i.fa{color:#868e96}.mediacomponent a.image{display:block}.mediacomponent a.image+a.text{margin-top:.5rem}.mediacomponent .rich>iframe{margin:0!important}.mediacomponent .video{width:100%;height:0;display:block;position:relative}.mediacomponent .video.four-three{padding-bottom:75%}.mediacomponent .video.sixteen-nine{padding-bottom:56.25%}.mediacomponent .video>iframe{top:0;left:0;border:0;width:100%;height:100%;position:absolute}.pagecomponent.page-title-hidden .content-container>article>header{display:none}.pagecomponent .content-container>article>div{margin-bottom:1rem}.scrolltotopbutton{opacity:0;outline:0;right:1rem;bottom:1rem;width:4rem;height:4rem;z-index:1000;position:fixed;display:block;overflow:hidden;visibility:hidden;white-space:nowrap;text-align:center;font-size:16px;line-height:4rem;-webkit-box-shadow:0 0 20px rgba(0,0,0,.2);box-shadow:0 0 20px rgba(0,0,0,.2);-webkit-transition:opacity .3s 0s,visibility 0s .3s,color .15s ease-in-out 0s,background-color .15s ease-in-out 0s;transition:opacity .3s 0s,visibility 0s .3s,color .15s ease-in-out 0s,background-color .15s ease-in-out 0s}.scrolltotopbutton.is-visible{opacity:1;visibility:visible}.scrolltotopbutton.fade-out{opacity:.5}.scrolltotopbutton:hover{opacity:1}@media (min-width:768px){.scrolltotopbutton{width:5rem;height:5rem;right:2rem;bottom:2rem;line-height:5rem}}@media (min-width:992px){.scrolltotopbutton{width:6rem;height:6rem;font-size:20px;line-height:6rem}}.tablecomponent .row>.column>.component{margin-bottom:1rem}.tilecomponent .items{-webkit-box-orient:horizontal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.tilecomponent .items,.tilecomponent .items>article.item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-direction:normal}.tilecomponent .items>article.item{-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex:1 100%;flex:1 100%;padding:2%}.tilecomponent .items>article.item>section.content{margin-top:auto}.tilecomponent .items>article.item>section.content div.details>span{display:block;margin-right:0;margin-bottom:.25rem}@media (min-width:576px){.tilecomponent .items>article.item{-webkit-box-flex:1;-ms-flex:1 50%;flex:1 50%}}@media (min-width:768px){.tilecomponent .items>article.item{-webkit-box-flex:1;-ms-flex:1 33.3%;flex:1 33.3%}}@media (min-width:992px){.tilecomponent .items>article.item{-webkit-box-flex:1;-ms-flex:1 25%;flex:1 25%}}div.detail-fields a{color:inherit}div.detail-fields>ul{margin:0;padding:0;list-style:none}div.detail-fields>ul>li>dl,div.detail-fields>ul>li>dl>dd{margin:0;padding:0}div.detail-fields.block>ul>li{margin-bottom:1rem}div.detail-fields.block>ul>li dl dt{font-size:1rem;font-weight:700}div.detail-fields.block>ul>li dl dd{font-size:1rem}div.detail-fields.inline>ul>li{color:#868e96;display:inline-block;margin-right:.5rem}div.detail-fields.inline>ul>li dl dd,div.detail-fields.inline>ul>li dl dt{display:inline-block;font-size:1rem}div.detail-fields.hide-header>header,div.detail-fields.hide-icons>ul>li dl>dt>i,div.detail-fields.hide-names>ul>li dl>dt>span.name{display:none}.component.link{text-decoration:none}.component.link,.component.link>i.fa{display:inline-block}.component.link:active,.component.link:focus,.component.link:hover{text-decoration:none}.show-icons.hide-text .component.link{overflow:hidden;text-align:center;-webkit-transition:color .15s ease-in-out 0s,background-color .15s ease-in-out 0s,border-color .15s ease-in-out 0s;transition:color .15s ease-in-out 0s,background-color .15s ease-in-out 0s,border-color .15s ease-in-out 0s}.show-icons.hide-text .component.link>i.fa{display:block}.show-icons.hide-text .component.link.size-16{width:16px;height:16px;font-size:8px;line-height:16px}.show-icons.hide-text .component.link.size-16>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-24{width:24px;height:24px;font-size:12px;line-height:24px}.show-icons.hide-text .component.link.size-24>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-32{width:32px;height:32px;font-size:16px;line-height:32px}.show-icons.hide-text .component.link.size-32>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-48{width:48px;height:48px;font-size:24px;line-height:48px}.show-icons.hide-text .component.link.size-48>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-64{width:64px;height:64px;font-size:32px;line-height:64px}.show-icons.hide-text .component.link.size-64>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-96{width:96px;height:96px;font-size:48px;line-height:96px}.show-icons.hide-text .component.link.size-96>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-128{width:128px;height:128px;font-size:64px;line-height:128px}.show-icons.hide-text .component.link.size-128>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.hide-icons .component.link>i.fa,.hide-text .component.link>span.text{display:none}.component.slide .slide-caption.title-after>h1,.component.slide .slide-caption.title-after>h2,.component.slide .slide-caption.title-after>h3,.component.slide .slide-caption.title-after>h4,.component.slide .slide-caption.title-after>h5,.component.slide .slide-caption.title-after>h6{margin-bottom:0} \ No newline at end of file +.baselistcomponent .items>article.item{margin-bottom:1rem}.baselistcomponent .items>article.item:last-child{margin-bottom:0}.baselistcomponent .items>article.item>div.image{position:relative}.baselistcomponent .items>article.item>div.image a{display:block}.baselistcomponent .items>article.item>div.image img{margin:0;display:inline-block}.baselistcomponent .items>article.item>div.image div.image-overlay{top:0;left:0;right:0;bottom:0;width:100%;height:100%;opacity:0;overflow:hidden;position:absolute;-webkit-transition:.5s ease;transition:.5s ease;background-color:rgba(33,37,41,.5)}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner{top:50%;left:0;width:100%;position:absolute;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner>div.icon{font-size:32px;text-align:center;color:#fff}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner>div.text{text-align:center;padding:0 1rem}.baselistcomponent .items>article.item>div.image div.image-overlay>div.inner>div.text>*{margin:0;padding:0;font-size:1.25rem;color:#fff}.baselistcomponent .items>article.item>div.image:hover div.image-overlay,.baselistcomponent .items>article.item>div.image a:focus div.image-overlay{opacity:1}.baselistcomponent .items>article.item>section.content{margin-top:1rem}.baselistcomponent .items>article.item>section.content header{margin-bottom:.5rem}.baselistcomponent .items>article.item>section.content header>*{margin-bottom:0}.baselistcomponent .items>article.item>section.content header a{color:inherit}.baselistcomponent .items>article.item>section.content div.details{color:#868e96}.baselistcomponent .items>article.item>section.content div.details>span{margin-right:.5rem}.baselistcomponent .items>article.item>section.content div.details a{color:inherit}.baselistcomponent .items>article.item>section.content footer{margin-top:1rem}.baselistcomponent .items>article.item>section.content>div{margin-bottom:.5rem}.baselistcomponent ul.pagination{margin-top:2rem;margin-bottom:0}.contentcomponent>header a{color:inherit}.contentcomponent>div.content:after{content:"";display:table;clear:both}.featurecomponent article.feature>a.feature{display:block;text-decoration:none;-webkit-transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.featurecomponent article.feature>a.feature:focus,.featurecomponent article.feature>a.feature:hover{text-decoration:none}.featurecomponent article.feature div.icon{margin-bottom:.5rem}.featurecomponent article.feature div.summary>p:last-child{margin-bottom:0}.featurecomponent article.feature footer{margin-top:1rem}.imagecomponent figure{width:100%;margin-bottom:0}.imagecomponent figure>figcaption>p:last-child{margin-bottom:0}.imagecomponent a.image{display:block}@media (min-width:768px){.listcomponent .items>article.item{display:block}.listcomponent .items.image-align-left>article.item,.listcomponent .items.image-align-right>article.item,.listcomponent .items.image-align-stagger>article.item{display:-webkit-box;display:-ms-flexbox;display:flex}.listcomponent .items.image-align-left>article.item>div.image,.listcomponent .items.image-align-right>article.item>div.image,.listcomponent .items.image-align-stagger>article.item>div.image{margin-bottom:0}.listcomponent .items.image-align-left>article.item.has-image>div.image,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(odd)>div.image{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.listcomponent .items.image-align-left>article.item.has-image>section.content,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(odd)>section.content{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;margin-top:0;margin-left:1rem}.listcomponent .items.image-align-right>article.item.has-image>div.image,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(2n)>div.image,.listcomponent .items>div.image{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.listcomponent .items.image-align-right>article.item.has-image>section.content,.listcomponent .items.image-align-stagger>article.item.has-image:nth-child(2n)>section.content,.listcomponent .items>section.content{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1;margin-top:0;margin-right:1rem}}.mediacomponent figure{width:100%;margin-bottom:0}.mediacomponent figure>figcaption>p:last-child{margin-bottom:0}.mediacomponent a.text{display:block}.mediacomponent a.text:hover{text-decoration:none}.mediacomponent a.text:hover span{text-decoration:underline}.mediacomponent a.text>i.fa{color:#868e96}.mediacomponent a.image{display:block}.mediacomponent a.image+a.text{margin-top:.5rem}.mediacomponent .rich>iframe{margin:0!important}.mediacomponent .video{width:100%;height:0;display:block;position:relative}.mediacomponent .video.four-three{padding-bottom:75%}.mediacomponent .video.sixteen-nine{padding-bottom:56.25%}.mediacomponent .video>iframe{top:0;left:0;border:0;width:100%;height:100%;position:absolute}.pagecomponent.page-title-hidden .content-container>article>header{display:none}.pagecomponent .content-container>article>div{margin-bottom:1rem}.scrolltotopbutton{opacity:0;outline:0;right:1rem;bottom:1rem;width:4rem;height:4rem;z-index:1000;position:fixed;display:block;overflow:hidden;visibility:hidden;white-space:nowrap;text-align:center;font-size:16px;line-height:4rem;-webkit-box-shadow:0 0 20px rgba(0,0,0,.2);box-shadow:0 0 20px rgba(0,0,0,.2);-webkit-transition:opacity .3s 0s,visibility 0s .3s,color .15s ease-in-out 0s,background-color .15s ease-in-out 0s;transition:opacity .3s 0s,visibility 0s .3s,color .15s ease-in-out 0s,background-color .15s ease-in-out 0s}.scrolltotopbutton.is-visible{opacity:1;visibility:visible}.scrolltotopbutton.fade-out{opacity:.5}.scrolltotopbutton:hover{opacity:1}@media (min-width:768px){.scrolltotopbutton{width:5rem;height:5rem;right:2rem;bottom:2rem;line-height:5rem}}@media (min-width:992px){.scrolltotopbutton{width:6rem;height:6rem;font-size:20px;line-height:6rem}}.tablecomponent .row>.column>.component{margin-bottom:1rem}.tilecomponent .items{-webkit-box-orient:horizontal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.tilecomponent .items,.tilecomponent .items>article.item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-direction:normal}.tilecomponent .items>article.item{-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-ms-flex:1 100%;flex:1 100%;padding:2%}.tilecomponent .items>article.item>section.content{margin-top:auto}.tilecomponent .items>article.item>section.content div.details>span{display:block;margin-right:0;margin-bottom:.25rem}@media (min-width:576px){.tilecomponent .items>article.item{-webkit-box-flex:1;-ms-flex:1 50%;flex:1 50%}}@media (min-width:768px){.tilecomponent .items>article.item{-webkit-box-flex:1;-ms-flex:1 33.3%;flex:1 33.3%}}@media (min-width:992px){.tilecomponent .items>article.item{-webkit-box-flex:1;-ms-flex:1 25%;flex:1 25%}}.togglecomponent{margin:0 0 1rem;border:1px solid #e9ecef}.togglecomponent>header{cursor:pointer;padding:1rem;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.togglecomponent>header>*{margin:0;font-size:inherit}.togglecomponent>header>:before{opacity:.75;content:"\F0FE";display:inline-block;padding-right:.5rem;font-family:FontAwesome}.togglecomponent>header.opened>:before{content:"\F146"}.togglecomponent>header.opened+div.content{display:block}.togglecomponent>header:focus,.togglecomponent>header:hover{background-color:rgba(0,0,0,.1)}.togglecomponent>div.content{display:none;padding:1rem;border-top-width:1px;border-top-style:dotted;border-top-color:inherit}div.detail-fields a{color:inherit}div.detail-fields>ul{margin:0;padding:0;list-style:none}div.detail-fields>ul>li>dl,div.detail-fields>ul>li>dl>dd{margin:0;padding:0}div.detail-fields.block>ul>li{margin-bottom:1rem}div.detail-fields.block>ul>li dl dt{font-size:1rem;font-weight:700}div.detail-fields.block>ul>li dl dd{font-size:1rem}div.detail-fields.inline>ul>li{color:#868e96;display:inline-block;margin-right:.5rem}div.detail-fields.inline>ul>li dl dd,div.detail-fields.inline>ul>li dl dt{display:inline-block;font-size:1rem}div.detail-fields.hide-header>header,div.detail-fields.hide-icons>ul>li dl>dt>i,div.detail-fields.hide-names>ul>li dl>dt>span.name{display:none}.component.link{text-decoration:none}.component.link,.component.link>i.fa{display:inline-block}.component.link:active,.component.link:focus,.component.link:hover{text-decoration:none}.show-icons.hide-text .component.link{overflow:hidden;text-align:center;-webkit-transition:color .15s ease-in-out 0s,background-color .15s ease-in-out 0s,border-color .15s ease-in-out 0s;transition:color .15s ease-in-out 0s,background-color .15s ease-in-out 0s,border-color .15s ease-in-out 0s}.show-icons.hide-text .component.link>i.fa{display:block}.show-icons.hide-text .component.link.size-16{width:16px;height:16px;font-size:8px;line-height:16px}.show-icons.hide-text .component.link.size-16>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-24{width:24px;height:24px;font-size:12px;line-height:24px}.show-icons.hide-text .component.link.size-24>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-32{width:32px;height:32px;font-size:16px;line-height:32px}.show-icons.hide-text .component.link.size-32>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-48{width:48px;height:48px;font-size:24px;line-height:48px}.show-icons.hide-text .component.link.size-48>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-64{width:64px;height:64px;font-size:32px;line-height:64px}.show-icons.hide-text .component.link.size-64>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-96{width:96px;height:96px;font-size:48px;line-height:96px}.show-icons.hide-text .component.link.size-96>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.show-icons.hide-text .component.link.size-128{width:128px;height:128px;font-size:64px;line-height:128px}.show-icons.hide-text .component.link.size-128>i.fa{top:50%;position:relative;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.hide-icons .component.link>i.fa,.hide-text .component.link>span.text{display:none}.component.slide .slide-caption.title-after>h1,.component.slide .slide-caption.title-after>h2,.component.slide .slide-caption.title-after>h3,.component.slide .slide-caption.title-after>h4,.component.slide .slide-caption.title-after>h5,.component.slide .slide-caption.title-after>h6{margin-bottom:0} \ No newline at end of file diff --git a/client/src/bundles/bundle.js b/client/src/bundles/bundle.js index ccd5625..587c8c9 100644 --- a/client/src/bundles/bundle.js +++ b/client/src/bundles/bundle.js @@ -18,3 +18,4 @@ require('forms/ToggleGroup.js'); require('components/ScrollToTopButton.js'); require('components/TagCloudComponent.js'); +require('components/ToggleComponent.js'); diff --git a/client/src/components/ToggleComponent.js b/client/src/components/ToggleComponent.js new file mode 100644 index 0000000..6390d4d --- /dev/null +++ b/client/src/components/ToggleComponent.js @@ -0,0 +1,35 @@ +/* Toggle Component +===================================================================================================================== */ + +import $ from 'jquery'; + +$(function() { + + // Handle Toggle Components: + + $('.togglecomponent').each(function() { + + var $self = $(this); + var $header = $self.find('header'); + + // Detect Start Open Status: + + if ($self.data('start-open')) { + $header.addClass('opened'); + } + + // Handle Header Click: + + $header.on('click', function() { + $(this).toggleClass('opened'); + }); + + // Handle Header Link Click: + + $header.find('a').on('click', function(e) { + e.stopPropagation(); + }); + + }); + +}); diff --git a/client/src/styles/bundle.scss b/client/src/styles/bundle.scss index fc28659..2c35918 100644 --- a/client/src/styles/bundle.scss +++ b/client/src/styles/bundle.scss @@ -29,6 +29,7 @@ @import "components/ScrollToTopButton"; @import "components/TableComponent"; @import "components/TileComponent"; +@import "components/ToggleComponent"; // Import Extension Styles: diff --git a/client/src/styles/components/ToggleComponent.scss b/client/src/styles/components/ToggleComponent.scss new file mode 100644 index 0000000..591527d --- /dev/null +++ b/client/src/styles/components/ToggleComponent.scss @@ -0,0 +1,59 @@ +/* Toggle Component Styles +===================================================================================================================== */ + +.togglecomponent { + + margin: 0 0 $spacer; + border: $border-width solid $border-color; + + > header { + + cursor: pointer; + padding: $spacer; + transition: $transition-base; + + > * { + + margin: 0; + font-size: inherit; + + &:before { + opacity: 0.75; + content: "\f0fe"; + display: inline-block; + padding-right: $spacer-half; + font-family: 'FontAwesome'; + } + + } + + &.opened { + + > *:before { + content: "\f146"; + } + + } + + &.opened + div.content { + display: block; + } + + @include hover-focus { + background-color: rgba(0, 0, 0, 0.1); + } + + } + + > div.content { + + display: none; + padding: $spacer; + + border-top-width: $border-width; + border-top-style: dotted; + border-top-color: inherit; + + } + +} diff --git a/src/Components/ToggleComponent.php b/src/Components/ToggleComponent.php new file mode 100644 index 0000000..bf42591 --- /dev/null +++ b/src/Components/ToggleComponent.php @@ -0,0 +1,126 @@ +=5.6.0 + * + * For full copyright and license information, please view the + * LICENSE.md file that was distributed with this source code. + * + * @package SilverWare\Components + * @author Colin Tucker + * @copyright 2018 Praxis Interactive + * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://github.com/praxisnetau/silverware + */ + +namespace SilverWare\Components; + +use SilverStripe\Forms\CheckboxField; +use SilverWare\Forms\FieldSection; + +/** + * An extension of the content component class for a toggle component. + * + * @package SilverWare\Components + * @author Colin Tucker + * @copyright 2018 Praxis Interactive + * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause + * @link https://github.com/praxisnetau/silverware + */ +class ToggleComponent extends ContentComponent +{ + /** + * Human-readable singular name. + * + * @var string + * @config + */ + private static $singular_name = 'Toggle Component'; + + /** + * Human-readable plural name. + * + * @var string + * @config + */ + private static $plural_name = 'Toggle Components'; + + /** + * Description of this object. + * + * @var string + * @config + */ + private static $description = 'A component to show a toggleable block of content'; + + /** + * Icon file for this object. + * + * @var string + * @config + */ + private static $icon = 'silverware/silverware: admin/client/dist/images/icons/ToggleComponent.png'; + + /** + * Defines the table name to use for this object. + * + * @var string + * @config + */ + private static $table_name = 'SilverWare_ToggleComponent'; + + /** + * Maps field names to field types for this object. + * + * @var array + * @config + */ + private static $db = [ + 'StartOpen' => 'Boolean' + ]; + + /** + * Defines the default values for the fields of this object. + * + * @var array + * @config + */ + private static $defaults = [ + 'StartOpen' => 0 + ]; + + /** + * Answers an array of HTML tag attributes for the object. + * + * @return array + */ + public function getAttributes() + { + $attributes = array_merge( + parent::getAttributes(), + [ + 'data-start-open' => $this->dbObject('StartOpen')->NiceAsBoolean() + ] + ); + + return $attributes; + } + + /** + * Event method called before the receiver is written to the database. + * + * @return void + */ + public function onBeforeWrite() + { + // Call Parent Event: + + parent::onBeforeWrite(); + + // Enforce Visible Title: + + $this->HideTitle = 0; + } +}