0byt3m1n1
Path:
/
home
/
mgatv524
/
medcenter.mgaplay.com.br
/
web
/
dist
/
vendor
/
ckeditor
/
samples
/
js
/
[
Home
]
File: sf.js
var SF=function(){function t(t){return(t=t.attributes?t.attributes.getNamedItem("class"):null)?t.value.split(" "):[]}function e(t){var e=document.createAttribute("class");return e.value=t.join(" "),e}var n,o={attachListener:function(t,e,n){if(t.addEventListener)t.addEventListener(e,n,!1);else{if(!t.attachEvent)throw Error("Could not attach event.");t.attachEvent("on"+e,(function(){n.apply(t,arguments)}))}}};return o.indexOf="function"===(n=Array.prototype.indexOf)?function(t,e){return n.call(t,e)}:function(t,e){for(var n=t.length,o=0;o<n;o++)if(t[o]===e)return o;return-1},o.accept=function(t,e){var n;t.children?(n=t.children,e(t)):"number"==typeof t.length&&(n=t);for(var i=n&&n.length||0;i--;)o.accept(n[i],e)},o.getByClass=function(){var t=document.getElementsByClassName;return"function"==typeof t?function(e,n){return"string"==typeof e&&(n=e,e=document),t.call(e,n)}:function(t,e){"string"==typeof t&&(e=t,t=document.getElementsByTagName("html")[0]);var n=[];return o.accept(t,(function(t){o.classList.contains(t,e)&&n.push(t)})),n}}(),o.classList={},o.classList.add=function(n,o){var i=t(n);i.push(o),n.attributes.setNamedItem(e(i))},o.classList.remove=function(n,i){var r=t(n),s=o.indexOf(r,i);-1!==s&&(r.splice(s,1),n.attributes.setNamedItem(e(r)))},o.classList.contains=function(e,n){return-1!==o.indexOf(t(e),n)},o.classList.toggle=function(t,e){this.contains(t,e)?this.remove(t,e):this.add(t,e)},o}();!function(){function t(t){for(var e in t)delete t[e]}SF.modal=function(e){function n(t){27==t.keyCode&&r.close()}e.modalClass="modal content",e.closeClass="modal-close",e.modalStyles=t,e.closeStyles=t;var o=e.afterCreate,i=e.afterClose;e.afterCreate=function(t){o&&o(t),window.addEventListener("keydown",n)},e.afterClose=function(t){i&&i(t),window.removeEventListener("keydown",n)};var r=new picoModal(e).afterCreate(e.afterCreate).afterClose(e.afterClose);return r}}(),function(){for(var t=SF.getByClass("toggler"),e=t.length;e--;)SF.attachListener(t[e],"click",(function(){var t=SF.classList.contains(this,"icon-toggler-expanded")||SF.classList.contains(this,"icon-toggler-collapsed"),e=document.getElementById(this.getAttribute("data-for"));SF.classList.toggle(this,"collapsed"),SF.classList.contains(this,"collapsed")?(SF.classList.add(e,"collapsed"),t&&(SF.classList.remove(this,"icon-toggler-expanded"),SF.classList.add(this,"icon-toggler-collapsed"))):(SF.classList.remove(e,"collapsed"),t&&(SF.classList.remove(this,"icon-toggler-collapsed"),SF.classList.add(this,"icon-toggler-expanded")))}))}(),function(){for(var t=SF.getByClass("tree-a"),e=t.length;e--;)SF.attachListener(t[e],"click",(function(t){"H2"!==(t=t.target||t.srcElement).nodeName||SF.classList.contains(t,"tree-a-no-sub")||SF.classList.toggle(t,"tree-a-active")}))}(),function(t,e){function n(t){return"object"==typeof Node?t instanceof Node:t&&"object"==typeof t&&"number"==typeof t.nodeType}function o(){var t=[];return{watch:t.push.bind(t),trigger:function(e){for(var n=!0,o={preventDefault:function(){n=!1}},i=0;i<t.length;i++)t[i](e,o);return n}}}function i(t){this.elem=t}function r(t,e){return i.div().clazz("pico-overlay").clazz(t("overlayClass","")).stylize({display:"block",position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",zIndex:1e4}).stylize(t("overlayStyles",{opacity:.5,background:"#000"})).onClick((function(){t("overlayClose",!0)&&e()}))}function s(t,e){var n=t("width","auto");return"number"==typeof n&&(n+="px"),i.div().clazz("pico-content").clazz(t("modalClass","")).stylize({display:"block",position:"fixed",zIndex:10001,left:"50%",top:"50px",width:n,"-ms-transform":"translateX(-50%)","-moz-transform":"translateX(-50%)","-webkit-transform":"translateX(-50%)","-o-transform":"translateX(-50%)",transform:"translateX(-50%)"}).stylize(t("modalStyles",{backgroundColor:"white",padding:"20px",borderRadius:"5px"})).html(t("content")).attr("role","dialog").onClick((function(t){new i(t.target).anyAncestor((function(t){return/\bpico-close\b/.test(t.elem.className)}))&&e()}))}function a(t){return function(){return t().elem}}function l(e){function i(t,n){var o=e[t];return"function"==typeof o&&(o=o(n)),void 0===o?n:o}function l(){C().hide(),v().hide(),g.trigger(w)}function c(){y.trigger(w)&&l()}function u(t){return function(){return t.apply(this,arguments),w}}function d(t){if(!f){var e,n=s(i,c),o=r(i,c);e=i("closeButton",!0)?n.child().html(i("closeHtml","×")).clazz("pico-close").clazz(i("closeClass")).stylize(i("closeStyles",{borderRadius:"2px",cursor:"pointer",height:"15px",width:"15px",position:"absolute",top:"5px",right:"5px",fontSize:"16px",textAlign:"center",lineHeight:"15px",background:"#CCC"})):void 0,f={modal:n,overlay:o,close:e},h.trigger(w)}return f[t]}("string"==typeof e||n(e))&&(e={content:e});var f,h=o(),p=o(),m=o(),y=o(),g=o(),v=d.bind(t,"modal"),C=d.bind(t,"overlay"),b=d.bind(t,"close"),w={modalElem:a(v),closeElem:a(b),overlayElem:a(C),show:function(){return p.trigger(w)&&(C().show(),b(),v().show(),m.trigger(w)),this},close:u(c),forceClose:u(l),destroy:function(){v=v().destroy(),C=C().destroy(),b=void 0},options:function(t){e=t},afterCreate:u(h.watch),beforeShow:u(p.watch),afterShow:u(m.watch),beforeClose:u(y.watch),afterClose:u(g.watch)};return w}i.div=function(t){var n=e.createElement("div");return(t||e.body).appendChild(n),new i(n)},i.prototype={child:function(){return i.div(this.elem)},stylize:function(t){for(var e in void 0!==(t=t||{}).opacity&&(t.filter="alpha(opacity="+100*t.opacity+")"),t)t.hasOwnProperty(e)&&(this.elem.style[e]=t[e]);return this},clazz:function(t){return this.elem.className+=" "+t,this},html:function(t){return n(t)?this.elem.appendChild(t):this.elem.innerHTML=t,this},onClick:function(t){return this.elem.addEventListener("click",t),this},destroy:function(){e.body.removeChild(this.elem)},hide:function(){this.elem.style.display="none"},show:function(){this.elem.style.display="block"},attr:function(t,e){return this.elem.setAttribute(t,e),this},anyAncestor:function(t){for(var e=this.elem;e;){if(t(new i(e)))return!0;e=e.parentNode}return!1}},"function"==typeof t.define&&t.define.amd?t.define((function(){return l})):t.picoModal=l}(window,document);