Comparing version 3.0.0 to 3.0.1
@@ -9,5 +9,7 @@ riot.tag2('rg-modal', '<div class="overlay {overlay--dismissable: opts.modal.dismissable}" if="{opts.modal.isvisible}" onclick="{close}"></div> <div class="modal {modal--ghost: opts.modal.ghost}" if="{opts.modal.isvisible}"> <header class="modal__header"> <button if="{opts.modal.dismissable}" type="button" class="button button--close" onclick="{close}"> × </button> <h3 class="heading heading--small">{opts.modal.heading}</h3> </header> <div class="modal__body"> <yield></yield> </div> <footer class="modal__footer {\'modal__footer--block\': !opts.modal.ghost}"> <button each="{opts.modal.buttons}" type="button" class="button {\'button--\' + type}" onclick="{action}" riot-style="{style}"> {text} </button> </footer> </div>', 'rg-modal .modal--ghost .modal__footer .button,[riot-tag="rg-modal"] .modal--ghost .modal__footer .button { margin: 0 .5em 0 0; }', '', function(opts) { | ||
this.close = function () { | ||
if (opts.modal.dismissable) opts.modal.isvisible = false; | ||
_this.trigger('close'); | ||
if (opts.modal.dismissable) { | ||
opts.modal.isvisible = false; | ||
_this.trigger('close'); | ||
} | ||
}; | ||
}, '{ }'); |
/*!v3.0.0*/ | ||
riot.tag2("rg-alerts",'<div class="alerts"> <div each="{opts.alerts}" class="alerts__alert {\'alerts__alert--\' + type}" if="{isvisible}" onclick="{select}"> <button class="button button--close" if="{dismissable != false}" onclick="{parent.dismiss}"> × </button> {text} </div> </div>',"","",function(t){var e=this;this.on("update",function(){t.alerts&&t.alerts.forEach(function(t){"undefined"==typeof t.isvisible&&(t.isvisible=!0),t.timeout&&(t.startTimer=function(){t.timer=setTimeout(function(){e.dismiss({item:t})},t.timeout)},t.startTimer())})}),this.dismiss=function(t){var a=t.item;a.isvisible=!1,clearTimeout(a.timer),e.trigger("dismiss",a),e.update()},this.select=function(t){var a=t.item;a.onclick&&a.onclick(a),e.trigger("select",a)}},"{ }"),riot.tag2("rg-bubble",'<div class="context"> <div class="bubble bubble--top" if="{isvisible}"> {opts.bubble.text} </div> <div class="content" onmouseover="{showBubble}" onmouseout="{hideBubble}" onclick="{toggleBubble}"> <yield></yield> </div> </div>','rg-bubble .context,[riot-tag="rg-bubble"] .context,rg-bubble .content,[riot-tag="rg-bubble"] .content { display: inline-block; position: relative; } rg-bubble .bubble,[riot-tag="rg-bubble"] .bubble { position: absolute; top: -70px; left: 50%; transform: translate3d(-50%, 0, 0); }',"",function(t){var e=this;this.showBubble=function(){clearTimeout(e._timer),e.isvisible=!0},this.hideBubble=function(){e._timer=setTimeout(function(){e.isvisible=!1,e.update()},1e3)},this.toggleBubble=function(){e.isvisible=!e.isvisible}},"{ }"),riot.tag2("rg-code",'<div class="editor"></div>','rg-code .editor,[riot-tag="rg-code"] .editor { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }',"",function(t){var e=this;t.editor||(t.editor={code:""});var a=void 0,i=function(){a.setTheme("ace/theme/"+(t.editor.theme||"monokai")),a.getSession().setMode("ace/mode/"+(t.editor.mode||"html")),a.getSession().setTabSize(t.editor.tabsize||2),a.getSession().setUseSoftTabs(t.editor.softtabs),a.getSession().setUseWrapMode(t.editor.wordwrap),a.setReadOnly(t.editor.readonly)};this.on("mount",function(){if(a=ace.edit(e.root.querySelector(".editor")),a.$blockScrolling=1/0,e.on("update",function(){i(),t.editor.code!=a.getValue()&&a.setValue(t.editor.code,1)}),t.url){var o=new XMLHttpRequest;o.onload=function(a){t.editor.code=a,e.update()},o.open("get",t.url,!0),o.send()}a.setValue(t.editor.code,1),a.getSession().on("change",function(i){t.editor.code=a.getValue(),e.trigger("onchange",a.getValue())}),i(),e.update()})}),riot.tag2("rg-credit-card-number",'<input type="text" name="cardnumber" class="field card-no {icon} {\'field--success\': opts.card.valid}" oninput="{validate}" placeholder="{opts.card.placeholder}">','rg-credit-card-number .card-no,[riot-tag="rg-credit-card-number"] .card-no { padding-right: 60px; background-repeat: no-repeat; background-position: right center; background-size: 60px; } rg-credit-card-number .amex,[riot-tag="rg-credit-card-number"] .amex { background-image: url(img/amex.png); } rg-credit-card-number .diners_club,[riot-tag="rg-credit-card-number"] .diners_club { background-image: url(img/diners_club.png); } rg-credit-card-number .discover,[riot-tag="rg-credit-card-number"] .discover { background-image: url(img/discover.png); } rg-credit-card-number .jcb,[riot-tag="rg-credit-card-number"] .jcb { background-image: url(img/jcb.png); } rg-credit-card-number .mastercard,[riot-tag="rg-credit-card-number"] .mastercard { background-image: url(img/mastercard.png); } rg-credit-card-number .visa,[riot-tag="rg-credit-card-number"] .visa { background-image: url(img/visa.png); }',"",function(t){function e(t){var e,a,i,o,n,s,r,l,d,c,u,g,p=[].indexOf||function(t){for(var e=0,a=this.length;a>e;e++)if(e in this&&this[e]===t)return e;return-1};i=[{name:"amex",icon:"images/amex.png",pattern:/^3[47]/,valid_length:[15]},{name:"diners_club",icon:"images/diners_club.png",pattern:/^30[0-5]/,valid_length:[14]},{name:"diners_club",icon:"images/diners_club.png",pattern:/^36/,valid_length:[14]},{name:"jcb",icon:"images/jcb.png",pattern:/^35(2[89]|[3-8][0-9])/,valid_length:[16]},{name:"laser",pattern:/^(6304|670[69]|6771)/,valid_length:[16,17,18,19]},{name:"visa_electron",pattern:/^(4026|417500|4508|4844|491(3|7))/,valid_length:[16]},{name:"visa",icon:"images/visa.png",pattern:/^4/,valid_length:[16]},{name:"mastercard",icon:"images/mastercard.png",pattern:/^5[1-5]/,valid_length:[16]},{name:"maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,valid_length:[12,13,14,15,16,17,18,19]},{name:"discover",icon:"images/discover.png",pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,valid_length:[16]}];var m={};for(null==m.accept&&(m.accept=function(){var t,a,o;for(o=[],t=0,a=i.length;a>t;t++)e=i[t],o.push(e.name);return o}()),g=m.accept,c=0,u=g.length;u>c;c++)if(a=g[c],p.call(function(){var t,a,o;for(o=[],t=0,a=i.length;a>t;t++)e=i[t],o.push(e.name);return o}(),a)<0)throw"Credit card type '"+a+"' is not supported";return o=function(t){var o,n,s;for(s=function(){var t,a,o,n;for(n=[],t=0,a=i.length;a>t;t++)e=i[t],o=e.name,p.call(m.accept,o)>=0&&n.push(e);return n}(),o=0,n=s.length;n>o;o++)if(a=s[o],t.match(a.pattern))return a;return null},s=function(t){var e,a,i,o,n,s;for(i=0,s=t.split("").reverse(),a=o=0,n=s.length;n>o;a=++o)e=s[a],e=+e,a%2?(e*=2,i+=10>e?e:e-9):i+=e;return i%10===0},n=function(t,e){var a;return a=t.length,p.call(e.valid_length,a)>=0},d=function(t){return function(t){var e,i;return a=o(t),i=!1,e=!1,null!=a&&(i=s(t),e=n(t,a)),{card_type:a,valid:i&&e,luhn_valid:i,length_valid:e}}}(this),r=function(t){return t.replace(/[ -]/g,"")},(l=function(e){return function(){return d(r(t))}}(this))(t)}var a=this;t.card||(t.card={cardnumber:""}),this.on("update",function(){a.cardnumber.value!=t.card.cardnumber&&(a.cardnumber.value=t.card.cardnumber),a.validate()}),this.validate=function(){t.card.cardnumber=a.cardnumber.value;var i=e(t.card.cardnumber);t.card.valid=i.valid,a.icon=t.card.valid?i.card_type.name:""}},"{ }"),riot.tag2("rg-date",'<div class="container"> <input type="text" class="field" onclick="{open}" value="{opts.date.date.format(format)}" readonly> <div class="calendar calendar--high" if="{opts.date.isvisible}"> <button class="calendar__control" onclick="{prevYear}">‹</button> <div class="calendar__header">{opts.date.date.format(yearFormat)}</div> <button class="calendar__control" onclick="{nextYear}">›</button> <button class="calendar__control" onclick="{prevMonth}">‹</button> <div class="calendar__header">{opts.date.date.format(monthFormat)}</div> <button class="calendar__control" onclick="{nextMonth}">›</button> <div class="calendar__day">Mo</div> <div class="calendar__day">Tu</div> <div class="calendar__day">We</div> <div class="calendar__day">Th</div> <div class="calendar__day">Fr</div> <div class="calendar__day">Sa</div> <div class="calendar__day">Su</div> <button class="calendar__date {\'calendar__date--selected\': day.selected, \'calendar__date--today\': day.today}" each="{day in startBuffer}" onclick="{select}">{day.date.format(dayFormat)}</button> <button class="calendar__date calendar__date--in-month {\'calendar__date--selected\': day.selected, \'calendar__date--today\': day.today}" each="{day in days}" onclick="{select}">{day.date.format(dayFormat)}</button> <button class="calendar__date {\'calendar__date--selected\': day.selected, \'calendar__date--today\': day.today}" each="{day in endBuffer}" onclick="{select}">{day.date.format(dayFormat)}</button> <button class="button button--block button--primary" onclick="{setToday}">Today</button> </div> </div>','rg-date .container,[riot-tag="rg-date"] .container { position: relative; display: inline-block; cursor: pointer; } rg-date .calendar,[riot-tag="rg-date"] .calendar { position: absolute; min-width: 400px; margin-top: .5em; left: 0; }',"",function(t){var e=this,a=function(t){return moment.isMoment(t)||(t=moment(t)),t.isValid()?t:moment()},i=function(t){e.root.contains(t.target)||e.close(),e.update()},o=function(e){var a=e||moment();return{date:a,selected:t.date.date.isSame(e,"day"),today:moment().isSame(e,"day")}},n=function(){e.format="LL",e.yearFormat="YYYY",e.monthFormat="MMMM",e.dayFormat="DD",e.days=[],e.startBuffer=[],e.endBuffer=[];for(var a=moment(t.date.date).startOf("month"),i=moment(t.date.date).daysInMonth(),n=moment(t.date.date).endOf("month"),s=a.isoWeekday()-1;s>0;s-=1){var r=moment(a).subtract(s,"days");e.startBuffer.push(o(r))}for(var s=0;i>s;s++){var l=moment(a).add(s,"days");e.days.push(o(l))}for(var s=n.isoWeekday()+1;7>=s;s++){var r=moment(n).add(s-n.isoWeekday(),"days");e.endBuffer.push(o(r))}};this.on("mount",function(){t.date||(t.date={date:moment()}),t.date.date||(t.date.date=moment()),t.date.date=a(t.date.date),e.on("update",function(){n()}),document.addEventListener("click",i),e.update()}),this.on("unmount",function(){document.removeEventListener("click",i)}),this.open=function(){t.date.isvisible=!0,e.trigger("open")},this.close=function(){t.date.isvisible&&(t.date.isvisible=!1,e.trigger("close"))},this.select=function(a){t.date.date=a.item.day.date,e.trigger("select",t.date.date)},this.setToday=function(){t.date.date=moment(),e.trigger("select",t.date.date)},this.prevYear=function(){t.date.date=t.date.date.subtract(1,"year")},this.nextYear=function(){t.date.date=t.date.date.add(1,"year")},this.prevMonth=function(){t.date.date=t.date.date.subtract(1,"month")},this.nextMonth=function(){t.date.date=t.date.date.add(1,"month")}},"{ }"),riot.tag2("rg-drawer",'<div class="overlay" if="{opts.drawer.isvisible}" onclick="{close}"></div> <div class="drawer {\'drawer--\' + opts.drawer.position || \'drawer--bottom\'} {\'drawer--visible\': opts.drawer.isvisible}"> <h4 class="heading heading--xsmall">{opts.drawer.header}</h4> <ul class="menu"> <li class="menu__item {\'menu__item--active\': active}" each="{opts.drawer.items}" onclick="{parent.select}"> {text} </li> </ul> <div class="drawer__body"> <yield></yield> </div> </div>',"","",function(t){var e=this;this.on("mount",function(){t.drawer||(t.drawer={})}),this.close=function(){t.drawer.isvisible=!1,e.trigger("close")},this.select=function(a){t.drawer.items.forEach(function(t){return t.active=!1}),a.item.active=!0,e.trigger("select",a.item)}},"{ }"),riot.tag2("rg-ga","","","",function(t){!function(t,e,a,i,o,n,s){t.GoogleAnalyticsObject=o,t[o]=t[o]||function(){(t[o].q=t[o].q||[]).push(arguments)},t[o].l=1*new Date,n=e.createElement(a),s=e.getElementsByTagName(a)[0],n.async=1,n.src=i,s.parentNode.insertBefore(n,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",t.property,"auto"),ga("send","pageview")}),riot.tag2("rg-include","<div> {responseText} </div>","","",function(t){var e=this,a=function(){var a=new XMLHttpRequest;a.onload=function(i){t.include.unsafe?e.root.innerHTML=a.responseText:e.responseText=a.responseText,e.update(),e.trigger("loaded")},a.open("get",t.include.url,!0),a.send(),e.trigger("loading")};this.on("mount",function(){a()})},"{ }"),riot.tag2("rg-map",'<div class="rg-map"></div>','rg-map .rg-map,[riot-tag="rg-map"] .rg-map { margin: 0; padding: 0; width: 100%; height: 100%; } rg-map .rg-map img,[riot-tag="rg-map"] .rg-map img { max-width: inherit; }',"",function(t){var e=this;window.rg=window.rg||{},window.rg.gmap=riot.observable({initialize:function(){window.rg.gmap.trigger("initialize")}}),this.on("mount",function(){if(t.map||(t.map={center:{lat:53.806,lng:-1.535},zoom:7}),rg.gmap.on("initialize",function(){new google.maps.Map(e.root.querySelector(".rg-map"),t.map)}),!document.getElementById("gmap_script")){var a=document.createElement("script");a.setAttribute("id","gmap_script"),a.type="text/javascript",a.src="https://maps.googleapis.com/maps/api/js?callback=window.rg.gmap.initialize",document.body.appendChild(a)}})}),riot.tag2("rg-markdown","","","",function(t){var e=this;commonmark&&(this.reader=new commonmark.Parser,this.writer=new commonmark.HtmlRenderer),this.on("update",function(){t.markdown||(t.markdown={}),t.markdown.content?e.root.innerHTML=e.writer.render(e.reader.parse(t.markdown.content)):t.markdown.url&&!function(){var a=new XMLHttpRequest;a.onload=function(t){e.root.innerHTML=e.writer.render(e.reader.parse(a.responseText)),e.trigger("loaded")},a.open("get",t.markdown.url,!0),a.send(),e.trigger("loading")}()})}),riot.tag2("rg-modal",'<div class="overlay {overlay--dismissable: opts.modal.dismissable}" if="{opts.modal.isvisible}" onclick="{close}"></div> <div class="modal {modal--ghost: opts.modal.ghost}" if="{opts.modal.isvisible}"> <header class="modal__header"> <button if="{opts.modal.dismissable}" type="button" class="button button--close" onclick="{close}"> × </button> <h3 class="heading heading--small">{opts.modal.heading}</h3> </header> <div class="modal__body"> <yield></yield> </div> <footer class="modal__footer {\'modal__footer--block\': !opts.modal.ghost}"> <button each="{opts.modal.buttons}" type="button" class="button {\'button--\' + type}" onclick="{action}" riot-style="{style}"> {text} </button> </footer> </div>','rg-modal .modal--ghost .modal__footer .button,[riot-tag="rg-modal"] .modal--ghost .modal__footer .button { margin: 0 .5em 0 0; }',"",function(t){var e=this;this.on("mount",function(){t.modal||(t.modal={})}),this.close=function(){t.modal.dismissable&&(t.modal.isvisible=!1),e.trigger("close")}},"{ }"),riot.tag2("rg-phone-sim",'<div class="emulator"> <iframe class="screen" riot-src="{opts.phonesim.url}"></iframe> </div>','rg-phone-sim .emulator,[riot-tag="rg-phone-sim"] .emulator { position: relative; width: 365px; height: 792px; background-image: url(\'data:image/png;base64,iV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5+gW2ZnZG5vqa+wOEFB09bWtru7qrCwcXd4t7u83eDgzM7O7/DwNT4+7e7uwMPDwcPEeH5/////70wnUQAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAA+NSURBVHja7N13nBTlGcDxEQI5AmJQBAkcnqhEDIhoWMt5iogmQbOaYNrqYrJh16gplmTVkILJpYCmF+DSE1JIcjRR7L333ntPYjQxvTl55tnr7N7t7uw+vDP3+/0x3G3hs5+vr++8M7s7eH75Xb5x+rOjN017aeq+tO++U1+atmn0s9M3Xl6BoFfm466ZOPROhIt259CJ19RS++7LdgW133a97O7aaI/a+VE0y+jRnUeF1p6wqfvvaz6+YVjT0jMyJ3rkeSdmzljaNKzh+OZuoE0TQmmvv67zLzrwmMY8wkXLNx5zYCfTdeur1p6wdeegblgKar8tbegc4lv/rirtjTMLT99/UVMKzgFLNS3avwA2c2Pl2n8tPHV1QxLJMks2rC6g/alC7ScvKozrhhyIFZRrKIzvi56sRHt94b/RIsZ1xeN7UYFuffna4/UJB68Er4rGHax648vUfmqkPnxBBrmqyixQv5FPlaP9Dz2eWdIEW9U1LdFjnQsG1n5ETz4dyowdavY+VE9XPTKQ9phddPfICjvk6lt3lruM6V97j132l26BK3S3BJAv79Gf9jN3BY85HKsadHhAedebSmtf+ofgEcOQqknDAsyLLi2pPTq4/0icatSRAefoUto7Bvc2oFSzGgLQHYtr3xTct5DVSA1XJgsD0puKaa99s9wzlwPImh5WzhXTl/5TRHt7uaN5GUI1bVmzqL64ufZfgkF/GD417rCA9e99tf8VzCPHoVPzjhPXaVv10d5bblzCyZE6nDIJ5pKde2u/Egz487Cp1zHlHr20h8otp50ETT2WgaeL7dCe2vcF/uOQqUsrA9z7emgHQ3thdEZLLpeL0kHYwq7BrdqjAv2ofEAnlU0EZaPjvTTgHdWlvXeEhnYu0VkuUoN7707tbW6X35oiciyc6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qd7372O22dczxLlUaLt/1l+aHV0cMfl89utYvxvP9B+QX66zbnXF6/vJtwmxrur9vnyk4MX84/V927O1mk70H7mHMm9qSRO3ylrDYifUW3/CvlxjefqXBKH70uuEeEr/IL2pJaWFhe/DVLVd4Gd/P7eASI8qUP76YT8stzBF1nF99ydvKzAcvFNPN2h7d8sv7l44bRUxddwcPPLe8PF92a/U3uM/NayymnuKF+fZFXAO6ZL23/C0cEdj2vvBEP7Cb9be2KLozN3HK4rFczaLRN7aPuvOros8WJwzbRgQfKq31N7ROC/xs1Xu/n1ALNRuh7gkID23l7a/p5y05xjPfeHd9Sudblijsi+6PfWvjApNzr7z3pG+DquB4nrjG36aPu/d3gu8aJ7jeI1Aetefl9t/wVXF91dy+piAzzt9vW3dan9N39z7cdODdYlrS6/9shdW741WI+c+lgRbf/5FlePcfpMKtH5dxOC45qW5/1i2v7I4L42j2pVWwA60i+u7Y8N7l2HUo1aF3CO9Utpb7VbcP8QnGp3WLPbViW1/Uv2gbum2Ptc4pfW9v/ZGDxmHlahmxdANt7r96ft/0+521vhCrf0a1fs//r9a/u3zjhZumoFYmFOjlwVIM641R9I239ldvDIxcsxq7rliwPC2a/4A2v7D14bPPbkNmaTKmeRNvW79kG/HG3fn6wPP5PhXdXAPlP1JheDLartX6lPOPlsZu+KZ+z2At2Vfvna/pjdTtCYTiqcRApsV6z3K9H2/fGF553Txvgue1y3nVNAG18KtaS2P2Ja4akntDN/lzVft3d4vXGEX7m27+81q+P5N7atQrPfVrXd2GE1a69+RPvTlr3lHft11NJ+BFNKiQnkiPaWTqY7/tivZ//avn/+7P26ahl+yJD5q1a0sufUPWLrilXzhxwyvKUbaPb5A2gOpC3z956N+9HANe05YkDLgbWlh0fOQLPfZox8uBzIsrSlC6Zcj3gJ6eunXFCmYrnaQWtHTLph7EONresQlta1Nj409oZJI9ZWIPh/AQYA2whzWlA9R/cAAAAASUVORK5CYII=\'); background-repeat: no-repeat; background-position: center; background-size: cover; } rg-phone-sim .screen,[riot-tag="rg-phone-sim"] .screen { position: absolute; top: 105px; left: 22px; background-color: white; width: 320px; height: 568px; border: 0; }',"",function(t){},"{ }"),riot.tag2("rg-placeholdit",'<img riot-src="https://placeholdit.imgix.net/~text?bg={opts.placeholdit.background}&txtclr={opts.placeholdit.color}&txt={opts.placeholdit.text}&txtsize={opts.placeholdit.textsize}&w={opts.placeholdit.width}&h={opts.placeholdit.height}&fm={opts.placeholdit.format}">',"","",function(t){this.on("update",function(){t.placeholdit||(t.placeholdit={}),t.placeholdit.width=t.placeholdit.width||450,t.placeholdit.height=t.placeholdit.height||250,t.placeholdit.background=t.placeholdit.background||"000",t.placeholdit.color=t.placeholdit.color||"fff",t.placeholdit.text=t.placeholdit.text||t.placeholdit.width+" x "+t.placeholdit.height,t.placeholdit.textsize=t.placeholdit.textsize||30,t.placeholdit.format=t.placeholdit.format||"png"})},"{ }"),riot.tag2("rg-raw","<span></span>","","",function(t){this.on("mount update",function(){this.root.innerHTML=t.content||""})}),riot.tag2("rg-select",'<input type="text" name="selectfield" class="field" value="{fieldText}" placeholder="{opts.select.placeholder}" onkeydown="{handleKeys}" onclick="{toggle}" readonly> <ul class="menu menu--high" if="{opts.select.isvisible}"> <li each="{opts.select.options}" onclick="{parent.select}" class="menu__item {\'menu__item--active\': selected, \'menu__item--disabled\': disabled, \'menu__item--hover\': active}"> {text} </li> </ul>','rg-select .menu,[riot-tag="rg-select"] .menu { position: absolute; }',"",function(t){var e=this;t.select||(t.select={options:[]});var a=function(t){e.root.contains(t.target)||e.close(),e.update()};this.handleKeys=function(a){if([13,38,40].indexOf(a.keyCode)>-1&&!t.select.isvisible)return a.preventDefault(),e.open(),!0;t.select.isvisible||e.open();var i=t.select.options.length;if(i>0&&[13,38,40].indexOf(a.keyCode)>-1){a.preventDefault();for(var o=null,n=0;i>n;n++){var s=t.select.options[n];if(s.active){o=n;break}}null!=o&&(t.select.options[o].active=!1),38==a.keyCode?null==o||0==o?t.select.options[i-1].active=!0:t.select.options[o-1].active=!0:40==a.keyCode?null==o||o==i-1?t.select.options[0].active=!0:t.select.options[o+1].active=!0:13==a.keyCode&&null!=o&&e.select({item:t.select.options[o]})}return!0},this.open=function(){t.select.isvisible=!0,e.trigger("open")},this.close=function(){t.select.isvisible&&(t.select.isvisible=!1,e.trigger("close"))},this.toggle=function(){t.select.isvisible?e.close():e.open()},this.select=function(a){t.select.options.forEach(function(t){return t.selected=!1}),a.item.selected=!0,t.select.isvisible=!1,e.trigger("select",a.item)},this.on("mount",function(){document.addEventListener("click",a),e.update()}),this.on("update",function(){for(var a=0;a<t.select.options.length;a++){var i=t.select.options[a];if(i.selected){e.selectfield.value=i.text;break}}}),this.on("unmount",function(){document.removeEventListener("click",a)})},"{ }"),riot.tag2("rg-tabs",'<div class="tabs {\'tabs--\' + opts.tabs.type}"> <div class="tabs__headings"> <div each="{opts.tabs.tabs}" class="tab-heading {\'tab-heading--active\': active, \'tab-heading--disabled\': disabled}" onclick="{parent.open}"> {heading} </div> </div> <div each="{opts.tabs.tabs}" class="tabs__tab {\'tabs__tab--active\': active}"> <div if="{text}"> {text} </div> <div if="{include}"> {include.responseText} </div> </div> </div>',"","",function(t){var e=this,a=function(t){var a=new XMLHttpRequest;a.onload=function(i){e.root.querySelector(".tabs__tab--active").innerHTML=a.responseText,e.trigger("loaded",t)},a.open("get",t.include,!0),a.send(),e.trigger("loading",t)};this.open=function(a){var i=a.item;i.disabled||i.active||(t.tabs.tabs.forEach(function(t){t.active=!1}),e.trigger("open",i),i.active=!0)},this.on("update",function(){t.tabs||(t.tabs={}),Array.isArray(t.tabs.tabs)&&t.tabs.tabs.forEach(function(t){!t.disabled&&t.active&&t.include&&a(t)})})},"{ }"),riot.tag2("rg-tags",'<div class="tags"> <span class="tags__container"> <button each="{opts.tags.tags}" onclick="{removeTag}" type="button" class="button button--primary tag"> {text} <span class="tag__close">×</span> </button> </span> <div class="tags__field-container"> <input type="text" name="selectfield" class="field" placeholder="{opts.tags.placeholder}" onkeydown="{handleKeys}" onclick="{toggle}" readonly> <ul class="menu menu--high" if="{opts.tags.isvisible}"> <li each="{opts.tags.options}" onclick="{parent.select}" class="menu__item {\'menu__item--active\': selected, \'menu__item--disabled\': disabled, \'menu__item--hover\': active}"> {text} </li> </ul> </div> </div>','rg-tags .menu,[riot-tag="rg-tags"] .menu { position: absolute; }',"",function(t){var e=this;t.tags||(t.tags={options:[],tags:[]}),t.tags.options||(t.tags.options=[]),t.tags.tags||(t.tags.tags=[]);var a=function(t){e.root.contains(t.target)||e.close(),e.update()};this.handleKeys=function(a){if([13,38,40].indexOf(a.keyCode)>-1&&!t.tags.isvisible)return a.preventDefault(),e.open(),!0;t.tags.isvisible||e.open();var i=t.tags.options.length;if(i>0&&[13,38,40].indexOf(a.keyCode)>-1){a.preventDefault();for(var o=null,n=0;i>n;n++){var s=t.tags.options[n];if(s.active){o=n;break}}null!=o&&(t.tags.options[o].active=!1),38==a.keyCode?null==o||0==o?t.tags.options[i-1].active=!0:t.tags.options[o-1].active=!0:40==a.keyCode?null==o||o==i-1?t.tags.options[0].active=!0:t.tags.options[o+1].active=!0:13==a.keyCode&&null!=o&&e.select({item:t.tags.options[o]})}return!0},this.open=function(){t.tags.isvisible=!0,e.trigger("open")},this.close=function(){t.tags.isvisible&&(t.tags.isvisible=!1,e.trigger("close"))},this.toggle=function(){t.tags.isvisible?e.close():e.open()},this.select=function(a){t.tags.options.forEach(function(t){return t.selected=!1}),a.item.selected=!0,e.addTag(a.item),t.tags.isvisible=!1,e.trigger("select",a.item)},this.addTag=function(e){-1==t.tags.tags.indexOf(e)&&t.tags.tags.push(e)},this.removeTag=function(e){t.tags.tags=t.tags.tags.filter(function(t){return t._id!=e.item._id?t:void 0})},this.on("mount",function(){document.addEventListener("click",a),e.update()}),this.on("update",function(){t.tags.options.forEach(function(t){t._id=t._id||(Math.floor(60466175*Math.random())+1679615).toString(36)}),t.tags.tags.forEach(function(t){t._id=t._id||(Math.floor(60466175*Math.random())+1679615).toString(36)})}),this.on("unmount",function(){document.removeEventListener("click",a)})},"{ }"),riot.tag2("rg-toasts",'<div if="{opts.toasts.isvisible}" class="toasts {\'toasts--\' + opts.toasts.position}"> <div each="{opts.toasts.toasts}" class="toast {\'toast--\' + type}" if="{isvisible}" onclick="{parent.toastClicked}"> {text} </div> </div>',"","",function(t){var e=this;this.toastClicked=function(t){var a=t.item;window.clearTimeout(a.timer),a.isvisible=!1,e.trigger("select",a)};var a=1,i=function(){return a++};this.on("update",function(){t.toasts&&Array.isArray(t.toasts.toasts)&&(t.toasts.position=t.toasts.position||"bottomright",t.toasts.toasts.forEach(function(t){"undefined"==typeof t.isvisible&&(t.isvisible=!0),t.id=t.id||i(),t.timer||t.sticky||(t.startTimer=function(){t.timer=window.setTimeout(function(){t.isvisible=!1,e.trigger("close",t),e.update()},t.timeout||6e3)},t.startTimer())}),t.toasts.isvisible=t.toasts.toasts.filter(function(t){return t.isvisible}).length>0)})},"{ }"),riot.tag2("rg-toggle",'<div class="toggle {\'toggle--\' + opts.toggle.type}"> <label class="toggle__wrapper"> <input type="checkbox" __checked="{opts.toggle.checked}" onclick="{toggle}"> <div class="toggle__track"> <div class="toggle__handle"></div> </div> </label> </div>',"","",function(t){var e=this;this.on("mount",function(){t.toggle||(t.toggle={checked:!1})}),this.toggle=function(){t.toggle.checked=!t.toggle.checked,e.trigger("toggle",t.toggle.checked)}},"{ }"),riot.tag2("rg-unsplash",'<img riot-src="https://unsplash.it/{opts.unsplash.greyscale}{opts.unsplash.width}/{opts.unsplash.height}/?{options}">',"","",function(t){var e=this;this.on("update",function(){e.options="",t.unsplash||(t.unsplash={}),t.unsplash.width=t.unsplash.width||450,t.unsplash.height=t.unsplash.height||250,t.unsplash.greyscale&&(t.unsplash.greyscale="g/"),t.unsplash.random&&(e.options+="random&"),t.unsplash.blur&&(e.options+="blur&"),t.unsplash.image&&(e.options+="image="+t.unsplash.image+"&"),"undefined"!=typeof t.unsplash.gravity&&(e.options+="gravity="+t.unsplash.gravity)})},"{ }"); | ||
riot.tag2("rg-alerts",'<div class="alerts"> <div each="{opts.alerts}" class="alerts__alert {\'alerts__alert--\' + type}" if="{isvisible}" onclick="{select}"> <button class="button button--close" if="{dismissable != false}" onclick="{parent.dismiss}"> × </button> {text} </div> </div>',"","",function(t){var e=this;this.on("update",function(){t.alerts&&t.alerts.forEach(function(t){"undefined"==typeof t.isvisible&&(t.isvisible=!0),t.timeout&&(t.startTimer=function(){t.timer=setTimeout(function(){e.dismiss({item:t})},t.timeout)},t.startTimer())})}),this.dismiss=function(t){var a=t.item;a.isvisible=!1,clearTimeout(a.timer),e.trigger("dismiss",a),e.update()},this.select=function(t){var a=t.item;a.onclick&&a.onclick(a),e.trigger("select",a)}},"{ }"),riot.tag2("rg-bubble",'<div class="context"> <div class="bubble bubble--top" if="{isvisible}"> {opts.bubble.text} </div> <div class="content" onmouseover="{showBubble}" onmouseout="{hideBubble}" onclick="{toggleBubble}"> <yield></yield> </div> </div>','rg-bubble .context,[riot-tag="rg-bubble"] .context,rg-bubble .content,[riot-tag="rg-bubble"] .content { display: inline-block; position: relative; } rg-bubble .bubble,[riot-tag="rg-bubble"] .bubble { position: absolute; top: -70px; left: 50%; transform: translate3d(-50%, 0, 0); }',"",function(t){var e=this;this.showBubble=function(){clearTimeout(e._timer),e.isvisible=!0},this.hideBubble=function(){e._timer=setTimeout(function(){e.isvisible=!1,e.update()},1e3)},this.toggleBubble=function(){e.isvisible=!e.isvisible}},"{ }"),riot.tag2("rg-code",'<div class="editor"></div>','rg-code .editor,[riot-tag="rg-code"] .editor { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }',"",function(t){var e=this;t.editor||(t.editor={code:""});var a=void 0,i=function(){a.setTheme("ace/theme/"+(t.editor.theme||"monokai")),a.getSession().setMode("ace/mode/"+(t.editor.mode||"html")),a.getSession().setTabSize(t.editor.tabsize||2),a.getSession().setUseSoftTabs(t.editor.softtabs),a.getSession().setUseWrapMode(t.editor.wordwrap),a.setReadOnly(t.editor.readonly)};this.on("mount",function(){if(a=ace.edit(e.root.querySelector(".editor")),a.$blockScrolling=1/0,e.on("update",function(){i(),t.editor.code!=a.getValue()&&a.setValue(t.editor.code,1)}),t.url){var o=new XMLHttpRequest;o.onload=function(a){t.editor.code=a,e.update()},o.open("get",t.url,!0),o.send()}a.setValue(t.editor.code,1),a.getSession().on("change",function(i){t.editor.code=a.getValue(),e.trigger("onchange",a.getValue())}),i(),e.update()})}),riot.tag2("rg-credit-card-number",'<input type="text" name="cardnumber" class="field card-no {icon} {\'field--success\': opts.card.valid}" oninput="{validate}" placeholder="{opts.card.placeholder}">','rg-credit-card-number .card-no,[riot-tag="rg-credit-card-number"] .card-no { padding-right: 60px; background-repeat: no-repeat; background-position: right center; background-size: 60px; } rg-credit-card-number .amex,[riot-tag="rg-credit-card-number"] .amex { background-image: url(img/amex.png); } rg-credit-card-number .diners_club,[riot-tag="rg-credit-card-number"] .diners_club { background-image: url(img/diners_club.png); } rg-credit-card-number .discover,[riot-tag="rg-credit-card-number"] .discover { background-image: url(img/discover.png); } rg-credit-card-number .jcb,[riot-tag="rg-credit-card-number"] .jcb { background-image: url(img/jcb.png); } rg-credit-card-number .mastercard,[riot-tag="rg-credit-card-number"] .mastercard { background-image: url(img/mastercard.png); } rg-credit-card-number .visa,[riot-tag="rg-credit-card-number"] .visa { background-image: url(img/visa.png); }',"",function(t){function e(t){var e,a,i,o,n,s,r,l,d,c,u,g,p=[].indexOf||function(t){for(var e=0,a=this.length;a>e;e++)if(e in this&&this[e]===t)return e;return-1};i=[{name:"amex",icon:"images/amex.png",pattern:/^3[47]/,valid_length:[15]},{name:"diners_club",icon:"images/diners_club.png",pattern:/^30[0-5]/,valid_length:[14]},{name:"diners_club",icon:"images/diners_club.png",pattern:/^36/,valid_length:[14]},{name:"jcb",icon:"images/jcb.png",pattern:/^35(2[89]|[3-8][0-9])/,valid_length:[16]},{name:"laser",pattern:/^(6304|670[69]|6771)/,valid_length:[16,17,18,19]},{name:"visa_electron",pattern:/^(4026|417500|4508|4844|491(3|7))/,valid_length:[16]},{name:"visa",icon:"images/visa.png",pattern:/^4/,valid_length:[16]},{name:"mastercard",icon:"images/mastercard.png",pattern:/^5[1-5]/,valid_length:[16]},{name:"maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,valid_length:[12,13,14,15,16,17,18,19]},{name:"discover",icon:"images/discover.png",pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,valid_length:[16]}];var m={};for(null==m.accept&&(m.accept=function(){var t,a,o;for(o=[],t=0,a=i.length;a>t;t++)e=i[t],o.push(e.name);return o}()),g=m.accept,c=0,u=g.length;u>c;c++)if(a=g[c],p.call(function(){var t,a,o;for(o=[],t=0,a=i.length;a>t;t++)e=i[t],o.push(e.name);return o}(),a)<0)throw"Credit card type '"+a+"' is not supported";return o=function(t){var o,n,s;for(s=function(){var t,a,o,n;for(n=[],t=0,a=i.length;a>t;t++)e=i[t],o=e.name,p.call(m.accept,o)>=0&&n.push(e);return n}(),o=0,n=s.length;n>o;o++)if(a=s[o],t.match(a.pattern))return a;return null},s=function(t){var e,a,i,o,n,s;for(i=0,s=t.split("").reverse(),a=o=0,n=s.length;n>o;a=++o)e=s[a],e=+e,a%2?(e*=2,i+=10>e?e:e-9):i+=e;return i%10===0},n=function(t,e){var a;return a=t.length,p.call(e.valid_length,a)>=0},d=function(t){return function(t){var e,i;return a=o(t),i=!1,e=!1,null!=a&&(i=s(t),e=n(t,a)),{card_type:a,valid:i&&e,luhn_valid:i,length_valid:e}}}(this),r=function(t){return t.replace(/[ -]/g,"")},(l=function(e){return function(){return d(r(t))}}(this))(t)}var a=this;t.card||(t.card={cardnumber:""}),this.on("update",function(){a.cardnumber.value!=t.card.cardnumber&&(a.cardnumber.value=t.card.cardnumber),a.validate()}),this.validate=function(){t.card.cardnumber=a.cardnumber.value;var i=e(t.card.cardnumber);t.card.valid=i.valid,a.icon=t.card.valid?i.card_type.name:""}},"{ }"),riot.tag2("rg-date",'<div class="container"> <input type="text" class="field" onclick="{open}" value="{opts.date.date.format(format)}" readonly> <div class="calendar calendar--high" if="{opts.date.isvisible}"> <button class="calendar__control" onclick="{prevYear}">‹</button> <div class="calendar__header">{opts.date.date.format(yearFormat)}</div> <button class="calendar__control" onclick="{nextYear}">›</button> <button class="calendar__control" onclick="{prevMonth}">‹</button> <div class="calendar__header">{opts.date.date.format(monthFormat)}</div> <button class="calendar__control" onclick="{nextMonth}">›</button> <div class="calendar__day">Mo</div> <div class="calendar__day">Tu</div> <div class="calendar__day">We</div> <div class="calendar__day">Th</div> <div class="calendar__day">Fr</div> <div class="calendar__day">Sa</div> <div class="calendar__day">Su</div> <button class="calendar__date {\'calendar__date--selected\': day.selected, \'calendar__date--today\': day.today}" each="{day in startBuffer}" onclick="{select}">{day.date.format(dayFormat)}</button> <button class="calendar__date calendar__date--in-month {\'calendar__date--selected\': day.selected, \'calendar__date--today\': day.today}" each="{day in days}" onclick="{select}">{day.date.format(dayFormat)}</button> <button class="calendar__date {\'calendar__date--selected\': day.selected, \'calendar__date--today\': day.today}" each="{day in endBuffer}" onclick="{select}">{day.date.format(dayFormat)}</button> <button class="button button--block button--primary" onclick="{setToday}">Today</button> </div> </div>','rg-date .container,[riot-tag="rg-date"] .container { position: relative; display: inline-block; cursor: pointer; } rg-date .calendar,[riot-tag="rg-date"] .calendar { position: absolute; min-width: 400px; margin-top: .5em; left: 0; }',"",function(t){var e=this,a=function(t){return moment.isMoment(t)||(t=moment(t)),t.isValid()?t:moment()},i=function(t){e.root.contains(t.target)||e.close(),e.update()},o=function(e){var a=e||moment();return{date:a,selected:t.date.date.isSame(e,"day"),today:moment().isSame(e,"day")}},n=function(){e.format="LL",e.yearFormat="YYYY",e.monthFormat="MMMM",e.dayFormat="DD",e.days=[],e.startBuffer=[],e.endBuffer=[];for(var a=moment(t.date.date).startOf("month"),i=moment(t.date.date).daysInMonth(),n=moment(t.date.date).endOf("month"),s=a.isoWeekday()-1;s>0;s-=1){var r=moment(a).subtract(s,"days");e.startBuffer.push(o(r))}for(var s=0;i>s;s++){var l=moment(a).add(s,"days");e.days.push(o(l))}for(var s=n.isoWeekday()+1;7>=s;s++){var r=moment(n).add(s-n.isoWeekday(),"days");e.endBuffer.push(o(r))}};this.on("mount",function(){t.date||(t.date={date:moment()}),t.date.date||(t.date.date=moment()),t.date.date=a(t.date.date),e.on("update",function(){n()}),document.addEventListener("click",i),e.update()}),this.on("unmount",function(){document.removeEventListener("click",i)}),this.open=function(){t.date.isvisible=!0,e.trigger("open")},this.close=function(){t.date.isvisible&&(t.date.isvisible=!1,e.trigger("close"))},this.select=function(a){t.date.date=a.item.day.date,e.trigger("select",t.date.date)},this.setToday=function(){t.date.date=moment(),e.trigger("select",t.date.date)},this.prevYear=function(){t.date.date=t.date.date.subtract(1,"year")},this.nextYear=function(){t.date.date=t.date.date.add(1,"year")},this.prevMonth=function(){t.date.date=t.date.date.subtract(1,"month")},this.nextMonth=function(){t.date.date=t.date.date.add(1,"month")}},"{ }"),riot.tag2("rg-drawer",'<div class="overlay" if="{opts.drawer.isvisible}" onclick="{close}"></div> <div class="drawer {\'drawer--\' + opts.drawer.position || \'drawer--bottom\'} {\'drawer--visible\': opts.drawer.isvisible}"> <h4 class="heading heading--xsmall">{opts.drawer.header}</h4> <ul class="menu"> <li class="menu__item {\'menu__item--active\': active}" each="{opts.drawer.items}" onclick="{parent.select}"> {text} </li> </ul> <div class="drawer__body"> <yield></yield> </div> </div>',"","",function(t){var e=this;this.on("mount",function(){t.drawer||(t.drawer={})}),this.close=function(){t.drawer.isvisible=!1,e.trigger("close")},this.select=function(a){t.drawer.items.forEach(function(t){return t.active=!1}),a.item.active=!0,e.trigger("select",a.item)}},"{ }"),riot.tag2("rg-ga","","","",function(t){!function(t,e,a,i,o,n,s){t.GoogleAnalyticsObject=o,t[o]=t[o]||function(){(t[o].q=t[o].q||[]).push(arguments)},t[o].l=1*new Date,n=e.createElement(a),s=e.getElementsByTagName(a)[0],n.async=1,n.src=i,s.parentNode.insertBefore(n,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",t.property,"auto"),ga("send","pageview")}),riot.tag2("rg-include","<div> {responseText} </div>","","",function(t){var e=this,a=function(){var a=new XMLHttpRequest;a.onload=function(i){t.include.unsafe?e.root.innerHTML=a.responseText:e.responseText=a.responseText,e.update(),e.trigger("loaded")},a.open("get",t.include.url,!0),a.send(),e.trigger("loading")};this.on("mount",function(){a()})},"{ }"),riot.tag2("rg-map",'<div class="rg-map"></div>','rg-map .rg-map,[riot-tag="rg-map"] .rg-map { margin: 0; padding: 0; width: 100%; height: 100%; } rg-map .rg-map img,[riot-tag="rg-map"] .rg-map img { max-width: inherit; }',"",function(t){var e=this;window.rg=window.rg||{},window.rg.gmap=riot.observable({initialize:function(){window.rg.gmap.trigger("initialize")}}),this.on("mount",function(){if(t.map||(t.map={center:{lat:53.806,lng:-1.535},zoom:7}),rg.gmap.on("initialize",function(){new google.maps.Map(e.root.querySelector(".rg-map"),t.map)}),!document.getElementById("gmap_script")){var a=document.createElement("script");a.setAttribute("id","gmap_script"),a.type="text/javascript",a.src="https://maps.googleapis.com/maps/api/js?callback=window.rg.gmap.initialize",document.body.appendChild(a)}})}),riot.tag2("rg-markdown","","","",function(t){var e=this;commonmark&&(this.reader=new commonmark.Parser,this.writer=new commonmark.HtmlRenderer),this.on("update",function(){t.markdown||(t.markdown={}),t.markdown.content?e.root.innerHTML=e.writer.render(e.reader.parse(t.markdown.content)):t.markdown.url&&!function(){var a=new XMLHttpRequest;a.onload=function(t){e.root.innerHTML=e.writer.render(e.reader.parse(a.responseText)),e.trigger("loaded")},a.open("get",t.markdown.url,!0),a.send(),e.trigger("loading")}()})}),riot.tag2("rg-modal",'<div class="overlay {overlay--dismissable: opts.modal.dismissable}" if="{opts.modal.isvisible}" onclick="{close}"></div> <div class="modal {modal--ghost: opts.modal.ghost}" if="{opts.modal.isvisible}"> <header class="modal__header"> <button if="{opts.modal.dismissable}" type="button" class="button button--close" onclick="{close}"> × </button> <h3 class="heading heading--small">{opts.modal.heading}</h3> </header> <div class="modal__body"> <yield></yield> </div> <footer class="modal__footer {\'modal__footer--block\': !opts.modal.ghost}"> <button each="{opts.modal.buttons}" type="button" class="button {\'button--\' + type}" onclick="{action}" riot-style="{style}"> {text} </button> </footer> </div>','rg-modal .modal--ghost .modal__footer .button,[riot-tag="rg-modal"] .modal--ghost .modal__footer .button { margin: 0 .5em 0 0; }',"",function(t){var e=this;this.on("mount",function(){t.modal||(t.modal={})}),this.close=function(){t.modal.dismissable&&(t.modal.isvisible=!1,e.trigger("close"))}},"{ }"),riot.tag2("rg-phone-sim",'<div class="emulator"> <iframe class="screen" riot-src="{opts.phonesim.url}"></iframe> </div>','rg-phone-sim .emulator,[riot-tag="rg-phone-sim"] .emulator { position: relative; width: 365px; height: 792px; background-image: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAAMYCAMAAAA3r0ZLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAwBQTFRFMDk6+vr6KTM0lJucMz4/PklKJS8wLTg5Qk1OxsjILzo7gomJ2NvbdH5/ho2O9fb2KzY3ztHRPEdIOkVGZWxtjJSVOEJDkpeYWGRluL2+KTQ1vcHBoaWlPUZHcnp6nKKjOkRF1NfXqa2tp62tZnBxanV2VmFiZ29wVl1eaXJzbXR04uTktbq7QElK1tnZipKTi5CRTlZXpKioo6mqXmlqUVlaOEFCSVFSUFxdISssT1tcTlpbJC4vIiwtTVlaJjAxIy0uTFhZS1dYJzEyKDIzSlZXPUhJOURFO0ZHSVVWKzU2P0pLKjQ1OENEND0+QEtMLDY3SFRVN0JDQ05PLTc4ND9ANUBBQUxNNkFCR1NUMTo7RE9QLjg5N0BBR1JTRlJTLzk6RVFSMjs8RVBRRlFSNj9AMzw9SFNUMj0+IissMTs8MDo7SVRVRFBRMDs8MTw9IiwsMz0+Mjw9SlVWQ09QLjk6NT4/S1ZXND4/JC4uQU1OIy0tQk5PTFdYTVhZQExNTllaJS8vJzIyP0tMLzg5LDc4KDMzNT9AKjU1N0FCNkBBJjAwIywtMDs7Mj09NkFBJjExLjk5LDc3N0JCNUBAKjU2MTw8LDU2Ljc4OUNEKDEyQU1NPEhIPEhJO0dHOkZGND8/Qk5ORFBQQ09PLTY3OUREPkpKPkpLPUlJT1pbP0tLJTAwPUlKJzAxKjM07u/vKTIzsbW2YGprtLm50tXWPkhJo6endn+A3d/f6uvreoOEg4yN2tvc/Pz8n6am8/T0VFtcm6CgJS4v4OLi5ufnYGdncnt8dHp7gYaHJC0uu8DAjJGRQkxNxMfHKzQ1YGtsS1NUaXN0bnh5yMzMyszMy83Oy8/PdoCAKDIy7O3tT1dYuLu70NTUbXd46Onq6erreoCA2dzc8PHx8vPz5OXlnaSkn6Wmqq6ucHZ2t7y8o6eoeoSEkJaWm5+gW2ZnZG5vqa+wOEFB09bWtru7qrCwcXd4t7u83eDgzM7O7/DwNT4+7e7uwMPDwcPEeH5/////70wnUQAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAA+NSURBVHja7N13nBTlGcDxEQI5AmJQBAkcnqhEDIhoWMt5iogmQbOaYNrqYrJh16gplmTVkILJpYCmF+DSE1JIcjRR7L333ntPYjQxvTl55tnr7N7t7uw+vDP3+/0x3G3hs5+vr++8M7s7eH75Xb5x+rOjN017aeq+tO++U1+atmn0s9M3Xl6BoFfm466ZOPROhIt259CJ19RS++7LdgW133a97O7aaI/a+VE0y+jRnUeF1p6wqfvvaz6+YVjT0jMyJ3rkeSdmzljaNKzh+OZuoE0TQmmvv67zLzrwmMY8wkXLNx5zYCfTdeur1p6wdeegblgKar8tbegc4lv/rirtjTMLT99/UVMKzgFLNS3avwA2c2Pl2n8tPHV1QxLJMks2rC6g/alC7ScvKozrhhyIFZRrKIzvi56sRHt94b/RIsZ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bQJbbQJbbTRplppf1qCwiCFRhtttCm89lwJCoMUGm200Sa00Sa00Uab0Eab0Eab0EY73tqnS1AYpNBoo402hdc+VILCIIVGG220CW20CW200Sa00Sa00aYC9GkSFAYpNNpoo01oR0v7bRIUBik02mijTWijTWijjTahjTah7bL2hyUoDFJotNFGm9BGm0ppv0OCwiCFRhtttAlttAlttNEmtOOhfbwEhUEKjTbaaBPaaBPaLmi/T4LCIIVGG220CW20CW200ab6aS+UoDBIodFGG21CG21C2wXt4yQoDFJotNFGm9BGm9BGe7BpL5KgMEih0UYbbUIbbULbBe0PSFAYpNBoo402oY02oY32YNP+oASFQQqNNtpoE9poE9poDzbtj0hQGKTQaKONNqGNNpXS/qkEhUEKfYwEhUEKjTbaaBPaaBPaaA827Y9LUBik0GijjTahHS3tn0lQGKTQCyQoDFJotNFGm9BGm9BGG22qn/anJCgMUmi00Uabwmv/RILCIIVukKAwSKHRRhttQhttQhtttKl+2p+UoDBIodFGG20Kr/09CQqDFPo9EhQGKTTaaKNNaKNNaKONNtVP+7MSFAYpNNpoo03htY+UoDBIodFGG21CG21CG220Ce14aH9egsIghUYb7bhq/1qCwiCFPlyCwiCFRhtttAlttAlttNEmtNGmSrV/KUFhkEL/QoLCIIUeJkFhkEKjjTbahDbahDbaaBPaaFOl2r+VoDBIoX8lQWGQQh8mQWGQQqONNtqENtqENtpoE9poE9oua/9AgsIghf6+BIVBCr2tBIVBCo022mgT2mgT2mijTWijTWi7rP1DCQqDFPqtEhQGKTTaaKNNaKNNaKONNqGNNqHtsvaPJCgMUujtJCgMUmi00Uab0Eab0EYbbUIbbUIbbSpAv0WCwiCFRhtttAlttAlttNEmtNEmtF3W/rkEhUEKvVKCwiCFfrsEhUEKjTbaaBPaaBPaaKNNaKNNaLusPU6CwiCFfqcEhUEKjTbaaBPaaBPaaKNNaMdD+1sSFAYpNNqW2kslKAxSaLQttd8rQWGQQqONNtqENtqENtpoU/20vyZBYZBCo22pvUyCwiCFRttS+90SFAYpNNpoo01o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lwVIM641R9I239ldvDIxcsxq7rliwPC2a/4A2v7D14bPPbkNmaTKmeRNvW79kG/HG3fn6wPP5PhXdXAPlP1JheDLartX6lPOPlsZu+KZ+z2At2Vfvna/pjdTtCYTiqcRApsV6z3K9H2/fGF553Txvgue1y3nVNAG18KtaS2P2Ja4akntDN/lzVft3d4vXGEX7m27+81q+P5N7atQrPfVrXd2GE1a69+RPvTlr3lHft11NJ+BFNKiQnkiPaWTqY7/tivZ//avn/+7P26ahl+yJD5q1a0sufUPWLrilXzhxwyvKUbaPb5A2gOpC3z956N+9HANe05YkDLgbWlh0fOQLPfZox8uBzIsrSlC6Zcj3gJ6eunXFCmYrnaQWtHTLph7EONresQlta1Nj409oZJI9ZWIPh/AQYA2whzWlA9R/cAAAAASUVORK5CYII=\'); background-repeat: no-repeat; background-position: center; background-size: cover; } rg-phone-sim .screen,[riot-tag="rg-phone-sim"] .screen { position: absolute; top: 105px; left: 22px; background-color: white; width: 320px; height: 568px; border: 0; }',"",function(t){},"{ }"),riot.tag2("rg-placeholdit",'<img riot-src="https://placeholdit.imgix.net/~text?bg={opts.placeholdit.background}&txtclr={opts.placeholdit.color}&txt={opts.placeholdit.text}&txtsize={opts.placeholdit.textsize}&w={opts.placeholdit.width}&h={opts.placeholdit.height}&fm={opts.placeholdit.format}">',"","",function(t){this.on("update",function(){t.placeholdit||(t.placeholdit={}),t.placeholdit.width=t.placeholdit.width||450,t.placeholdit.height=t.placeholdit.height||250,t.placeholdit.background=t.placeholdit.background||"000",t.placeholdit.color=t.placeholdit.color||"fff",t.placeholdit.text=t.placeholdit.text||t.placeholdit.width+" x "+t.placeholdit.height,t.placeholdit.textsize=t.placeholdit.textsize||30,t.placeholdit.format=t.placeholdit.format||"png"})},"{ }"),riot.tag2("rg-raw","<span></span>","","",function(t){this.on("mount update",function(){this.root.innerHTML=t.content||""})}),riot.tag2("rg-select",'<input type="text" name="selectfield" class="field" value="{fieldText}" placeholder="{opts.select.placeholder}" onkeydown="{handleKeys}" onclick="{toggle}" readonly> <ul class="menu menu--high" if="{opts.select.isvisible}"> <li each="{opts.select.options}" onclick="{parent.select}" class="menu__item {\'menu__item--active\': selected, \'menu__item--disabled\': disabled, \'menu__item--hover\': active}"> {text} </li> </ul>','rg-select .menu,[riot-tag="rg-select"] .menu { position: absolute; }',"",function(t){var e=this;t.select||(t.select={options:[]});var a=function(t){e.root.contains(t.target)||e.close(),e.update()};this.handleKeys=function(a){if([13,38,40].indexOf(a.keyCode)>-1&&!t.select.isvisible)return a.preventDefault(),e.open(),!0;t.select.isvisible||e.open();var i=t.select.options.length;if(i>0&&[13,38,40].indexOf(a.keyCode)>-1){a.preventDefault();for(var o=null,n=0;i>n;n++){var s=t.select.options[n];if(s.active){o=n;break}}null!=o&&(t.select.options[o].active=!1),38==a.keyCode?null==o||0==o?t.select.options[i-1].active=!0:t.select.options[o-1].active=!0:40==a.keyCode?null==o||o==i-1?t.select.options[0].active=!0:t.select.options[o+1].active=!0:13==a.keyCode&&null!=o&&e.select({item:t.select.options[o]})}return!0},this.open=function(){t.select.isvisible=!0,e.trigger("open")},this.close=function(){t.select.isvisible&&(t.select.isvisible=!1,e.trigger("close"))},this.toggle=function(){t.select.isvisible?e.close():e.open()},this.select=function(a){t.select.options.forEach(function(t){return t.selected=!1}),a.item.selected=!0,t.select.isvisible=!1,e.trigger("select",a.item)},this.on("mount",function(){document.addEventListener("click",a),e.update()}),this.on("update",function(){for(var a=0;a<t.select.options.length;a++){var i=t.select.options[a];if(i.selected){e.selectfield.value=i.text;break}}}),this.on("unmount",function(){document.removeEventListener("click",a)})},"{ }"),riot.tag2("rg-tabs",'<div class="tabs {\'tabs--\' + opts.tabs.type}"> <div class="tabs__headings"> <div each="{opts.tabs.tabs}" class="tab-heading {\'tab-heading--active\': active, \'tab-heading--disabled\': disabled}" onclick="{parent.open}"> {heading} </div> </div> <div each="{opts.tabs.tabs}" class="tabs__tab {\'tabs__tab--active\': active}"> <div if="{text}"> {text} </div> <div if="{include}"> {include.responseText} </div> </div> </div>',"","",function(t){var e=this,a=function(t){var a=new XMLHttpRequest;a.onload=function(i){e.root.querySelector(".tabs__tab--active").innerHTML=a.responseText,e.trigger("loaded",t)},a.open("get",t.include,!0),a.send(),e.trigger("loading",t)};this.open=function(a){var i=a.item;i.disabled||i.active||(t.tabs.tabs.forEach(function(t){t.active=!1}),e.trigger("open",i),i.active=!0)},this.on("update",function(){t.tabs||(t.tabs={}),Array.isArray(t.tabs.tabs)&&t.tabs.tabs.forEach(function(t){!t.disabled&&t.active&&t.include&&a(t)})})},"{ }"),riot.tag2("rg-tags",'<div class="tags"> <span class="tags__container"> <button each="{opts.tags.tags}" onclick="{removeTag}" type="button" class="button button--primary tag"> {text} <span class="tag__close">×</span> </button> </span> <div class="tags__field-container"> <input type="text" name="selectfield" class="field" placeholder="{opts.tags.placeholder}" onkeydown="{handleKeys}" onclick="{toggle}" readonly> <ul class="menu menu--high" if="{opts.tags.isvisible}"> <li each="{opts.tags.options}" onclick="{parent.select}" class="menu__item {\'menu__item--active\': selected, \'menu__item--disabled\': disabled, \'menu__item--hover\': active}"> {text} </li> </ul> </div> </div>','rg-tags .menu,[riot-tag="rg-tags"] .menu { position: absolute; }',"",function(t){var e=this;t.tags||(t.tags={options:[],tags:[]}),t.tags.options||(t.tags.options=[]),t.tags.tags||(t.tags.tags=[]);var a=function(t){e.root.contains(t.target)||e.close(),e.update()};this.handleKeys=function(a){if([13,38,40].indexOf(a.keyCode)>-1&&!t.tags.isvisible)return a.preventDefault(),e.open(),!0;t.tags.isvisible||e.open();var i=t.tags.options.length;if(i>0&&[13,38,40].indexOf(a.keyCode)>-1){a.preventDefault();for(var o=null,n=0;i>n;n++){var s=t.tags.options[n];if(s.active){o=n;break}}null!=o&&(t.tags.options[o].active=!1),38==a.keyCode?null==o||0==o?t.tags.options[i-1].active=!0:t.tags.options[o-1].active=!0:40==a.keyCode?null==o||o==i-1?t.tags.options[0].active=!0:t.tags.options[o+1].active=!0:13==a.keyCode&&null!=o&&e.select({item:t.tags.options[o]})}return!0},this.open=function(){t.tags.isvisible=!0,e.trigger("open")},this.close=function(){t.tags.isvisible&&(t.tags.isvisible=!1,e.trigger("close"))},this.toggle=function(){t.tags.isvisible?e.close():e.open()},this.select=function(a){t.tags.options.forEach(function(t){return t.selected=!1}),a.item.selected=!0,e.addTag(a.item),t.tags.isvisible=!1,e.trigger("select",a.item)},this.addTag=function(e){-1==t.tags.tags.indexOf(e)&&t.tags.tags.push(e)},this.removeTag=function(e){t.tags.tags=t.tags.tags.filter(function(t){return t._id!=e.item._id?t:void 0})},this.on("mount",function(){document.addEventListener("click",a),e.update()}),this.on("update",function(){t.tags.options.forEach(function(t){t._id=t._id||(Math.floor(60466175*Math.random())+1679615).toString(36)}),t.tags.tags.forEach(function(t){t._id=t._id||(Math.floor(60466175*Math.random())+1679615).toString(36)})}),this.on("unmount",function(){document.removeEventListener("click",a)})},"{ }"),riot.tag2("rg-toasts",'<div if="{opts.toasts.isvisible}" class="toasts {\'toasts--\' + opts.toasts.position}"> <div each="{opts.toasts.toasts}" class="toast {\'toast--\' + type}" if="{isvisible}" onclick="{parent.toastClicked}"> {text} </div> </div>',"","",function(t){var e=this;this.toastClicked=function(t){var a=t.item;window.clearTimeout(a.timer),a.isvisible=!1,e.trigger("select",a)};var a=1,i=function(){return a++};this.on("update",function(){t.toasts&&Array.isArray(t.toasts.toasts)&&(t.toasts.position=t.toasts.position||"bottomright",t.toasts.toasts.forEach(function(t){"undefined"==typeof t.isvisible&&(t.isvisible=!0),t.id=t.id||i(),t.timer||t.sticky||(t.startTimer=function(){t.timer=window.setTimeout(function(){t.isvisible=!1,e.trigger("close",t),e.update()},t.timeout||6e3)},t.startTimer())}),t.toasts.isvisible=t.toasts.toasts.filter(function(t){return t.isvisible}).length>0)})},"{ }"),riot.tag2("rg-toggle",'<div class="toggle {\'toggle--\' + opts.toggle.type}"> <label class="toggle__wrapper"> <input type="checkbox" __checked="{opts.toggle.checked}" onclick="{toggle}"> <div class="toggle__track"> <div class="toggle__handle"></div> </div> </label> </div>',"","",function(t){var e=this;this.on("mount",function(){t.toggle||(t.toggle={checked:!1})}),this.toggle=function(){t.toggle.checked=!t.toggle.checked,e.trigger("toggle",t.toggle.checked)}},"{ }"),riot.tag2("rg-unsplash",'<img riot-src="https://unsplash.it/{opts.unsplash.greyscale}{opts.unsplash.width}/{opts.unsplash.height}/?{options}">',"","",function(t){var e=this;this.on("update",function(){e.options="",t.unsplash||(t.unsplash={}),t.unsplash.width=t.unsplash.width||450,t.unsplash.height=t.unsplash.height||250,t.unsplash.greyscale&&(t.unsplash.greyscale="g/"),t.unsplash.random&&(e.options+="random&"),t.unsplash.blur&&(e.options+="blur&"),t.unsplash.image&&(e.options+="image="+t.unsplash.image+"&"),"undefined"!=typeof t.unsplash.gravity&&(e.options+="gravity="+t.unsplash.gravity)})},"{ }"); |
{ | ||
"name": "riotgear", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "The open source component library for RiotJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/rg.min.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70277
775
2