!function(t,o){"function"==typeof define&&define.amd?define(o):"object"==typeof exports&&(module.exports=o()),t.tingle=o()}(this,function(){function t(t){var o={onClose:null,onOpen:null,beforeOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]};this.opts=r({},o,t),this.init()}function o(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}function e(){this.modal=document.createElement("div"),this.modal.classList.add("tingle-modal"),0!==this.opts.closeMethods.length&&-1!==this.opts.closeMethods.indexOf("overlay")||this.modal.classList.add("tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach(function(t){"string"==typeof t&&this.modal.classList.add(t)},this),-1!==this.opts.closeMethods.indexOf("button")&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.classList.add("tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML="×",this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("tingle-modal-box"),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),-1!==this.opts.closeMethods.indexOf("button")&&this.modal.appendChild(this.modalCloseBtn),this.modal.appendChild(this.modalBox)}function s(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}function i(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:l.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:n.bind(this)},-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}function n(t){-1!==this.opts.closeMethods.indexOf("escape")&&27===t.which&&this.isOpen()&&this.close()}function l(t){-1!==this.opts.closeMethods.indexOf("overlay")&&!d(t.target,"tingle-modal")&&t.clientX=t},t.prototype.checkOverflow=function(){this.modal.classList.contains("tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("tingle-modal--overflow"):this.modal.classList.remove("tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(o.call(this),this.setStickyFooter(!0)))},{modal:t}}); (function(window, document, undefined) { var thatDoc = document; var btnType = '11'; var pid = '74765'; var cssId = 'myCss'; if (!document.getElementById(cssId)) { var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.id = cssId; link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://www.reviewtube.com/embed/dist/tingle.min.css'; link.media = 'all'; head.appendChild(link); } var font = document.createElement('link'); font.setAttribute('rel', 'stylesheet'); font.setAttribute('type', 'text/css'); font.setAttribute('href', 'https://fonts.googleapis.com/css?family=Lato:400,700'); document.head.appendChild(font); function bindEvent(element, eventName, eventHandler) { if (element.addEventListener){ element.addEventListener(eventName, eventHandler, false); } else if (element.attachEvent) { element.attachEvent('on' + eventName, eventHandler); } } var sheet = (function() { var style = document.createElement("style"); style.appendChild(document.createTextNode("")); document.head.appendChild(style); return style.sheet; })(); var newstylesheet = sheet; newstylesheet.insertRule(".reviewtube {width: 100%; position: relative; }", 0); newstylesheet.insertRule(".rtButton {border: 1px solid #ccc; }", 0); newstylesheet.insertRule(".reviewtube iframe {position: absolute; width: 100%; height: 100%;}", 0); newstylesheet.insertRule(".tingle-modal { background: rgba(0,0,0,.5); }", 0); newstylesheet.insertRule("@media only screen and (max-width: 420px) { .reviewtube iframe { height: 1350px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 768px) { .reviewtube iframe { height: 1475px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 1024px) { .reviewtube iframe { height: 940px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 1200px) { .reviewtube iframe { height: 970px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 1400px) { .reviewtube iframe { height: 980px !important; } }", 0); newstylesheet.insertRule(".tingle-modal-box__content { padding: 1rem !important; }", 0); newstylesheet.insertRule(".tingle-modal-box { width: 80% }", 0); newstylesheet.insertRule("@media only screen and (max-width: 540px) { .tingle-modal-box { width: 100% !important; } }", 0); var tubes = thatDoc.querySelectorAll('.reviewtube'), i; for (i = 0; i < tubes.length; ++i) { var vidid = tubes[i].getAttribute("embed"); //console.log(vidid); var rtURL = "https://www.reviewtube.com/proc/business_profile.php?pid=" + vidid; var viewType = tubes[i].getAttribute("viewType"); if ( viewType == "modal" ) { var btnOption = "

Find Video Reviews From People Like You

"; //var btnEleven = document.createElement('div'); //btnEleven.setAttribute("id", "rtmodbt"); // btnEleven.innerHTML = btnOption; // document.body.appendChild(btnEleven); var referenceNode = document.querySelector('.reviewtube'); //referenceNode.before(btnEleven); referenceNode.innerHTML = btnOption; var btnModal = document.querySelector('.js-tingle-modal'); btnModal.addEventListener('click', function(e){ e.preventDefault(); var modalSurprise = new tingle.modal({ onClose: function(){ modalSurprise.destroy(); var vid = document.getElementById("mediaspace"); //vid.pause(); } }); modalSurprise.setContent(''); modalSurprise.open(); }); bindEvent(window, 'message', function (e) { if (e.data=='rtrs') { if (document.getElementById('rtif'+pid)) { document.getElementById('rtif'+pid).height="562"; } } }); } else if ( viewType == "fullwidth" ) { newstylesheet.insertRule(".reviewtube:after { display: block;content: '';width: 100%; padding-bottom: 56.25%;}", 0); newstylesheet.insertRule(".reviewtube {width: 100%; position: relative; height: 1000px;}", 0); newstylesheet.insertRule("@media only screen and (max-width: 420px) { .reviewtube { height: 1350px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 768px) { .reviewtube { height: 1475px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 1024px) { .reviewtube { height: 940px !important; } }", 0); newstylesheet.insertRule("@media only screen and (max-width: 1400px) { .reviewtube { height: 980px !important; } }", 0); var iframe = thatDoc.createElement( "iframe" ); iframe.setAttribute( "frameborder", "0"); iframe.setAttribute( "allowfullscreen", ""); iframe.setAttribute( "webkitallowfullscreen", ""); iframe.setAttribute( "mozallowfullscreen", ""); iframe.setAttribute( "src", "https://www.reviewtube.com/proc/business_profile.php?pid=" + vidid ); iframe.setAttribute( "width", "100%"); tubes[i].innerHTML = ""; tubes[i].appendChild( iframe ); bindEvent(window, 'message', function (e) { if (e.data=='rtrs') { if (window.matchMedia("(max-width: 700px)").matches) { newstylesheet.insertRule(".reviewtube { max-height: 1030px !important;}", 0); var rtSingleVid = document.getElementById('rtFrame'); rtSingleVid.setAttribute("style", "height: 1030px !important;"); } else { newstylesheet.insertRule(".reviewtube { max-height: 750px !important;}", 0); var rtSingleVid = document.getElementById('rtFrame'); rtSingleVid.setAttribute("style", "height: 750px !important;"); } } }); } } })(window, document);