Skip to content

Instantly share code, notes, and snippets.

@halfempty
Created October 9, 2023 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halfempty/c843da1d60f40307ce316cef4086a90b to your computer and use it in GitHub Desktop.
Save halfempty/c843da1d60f40307ce316cef4086a90b to your computer and use it in GitHub Desktop.
Rubin scripts
<!-- Global site tag (gtag.js) - Google Ads: 646509206 -->
<script async type="text/javascript" src="https://www.googletagmanager.com/gtag/js?id=AW-646509206"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-646509206');
</script>
<script>
gtag('event', 'conversion', {'send_to': 'AW-646509206/89afCKzcqc4BEJblo7QC'});
</script>
<script type="text/javascript">var _s4mq=_s4mq||[];!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"libjs.s4mdsp.com/pa.js";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s)}(),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 6sec"}])},6e3),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 9sec"}])},9e3),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 12sec"}])},12e3),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 20sec"}])},2e4),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 25sec"}])},25e3),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 30sec"}])},3e4),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 40sec"}])},4e4),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 50sec"}])},5e4),window.setTimeout(function(){_s4mq.push(["trackAction",{name:"temps passe 60sec"}])},6e4);</script>
<!-- Start of Sleeknote signup and lead generation tool - www.sleeknote.com -->
<script id="sleeknoteScript" type="text/javascript">
(function () {
var sleeknoteScriptTag = document.createElement("script");
sleeknoteScriptTag.type = "text/javascript";
sleeknoteScriptTag.charset = "utf-8";
sleeknoteScriptTag.src = ("//sleeknotecustomerscripts.sleeknote.com/50468.js");
var s = document.getElementById("sleeknoteScript");
s.parentNode.insertBefore(sleeknoteScriptTag, s);
})();
</script>
<!-- End of Sleeknote signup and lead generation tool - www.sleeknote.com -->
<!-- AWAKEN podcast pixels -->
<script type="application/javascript">(function(w,d,t,r,u){w[u]=w[u]||[];w[u].push({'projectId':'10000','properties':{'pixelId':'10153114','userEmail': '<email_address>'}});var s=d.createElement(t);s.src=r;s.async=true;s.onload=s.onreadystatechange=function(){var y,rs=this.readyState,c=w[u];if(rs&&rs!="complete"&&rs!="loaded"){return}try{y=YAHOO.ywa.I13N.fireBeacon;w[u]=[];w[u].push=function(p){y([p])};y(c)}catch(e){}};var scr=d.getElementsByTagName(t)[0],par=scr.parentNode;par.insertBefore(s,scr)})(window,document,"script","https://s.yimg.com/wi/ytc.js","dotq");</script>
<!-- Reddit Pixel -->
<script>
!function(w,d){if(!w.rdt){var p=w.rdt=function(){p.sendEvent?p.sendEvent.apply(p,arguments):p.callQueue.push(arguments)};p.callQueue=[];var t=d.createElement("script");t.src="https://www.redditstatic.com/ads/pixel.js",t.async=!0;var s=d.getElementsByTagName("script")[0];s.parentNode.insertBefore(t,s)}}(window,document);rdt('init','t2_cciu3rh0');rdt('track', 'PageVisit');
</script>
<!-- DO NOT MODIFY -->
<!-- End Reddit Pixel -->
<!--
Event snippet for RBN_Landing Page_Counter on https://rubinmuseum.org/: Please do not remove.
Place this snippet on pages with events you’re tracking.
Creation date: 10/07/2022
-->
<script>
gtag('event', 'conversion', {
'allow_custom_scripts': true,
'send_to': 'DC-12569752/rbnla0/rbn_l0+standard'
});
</script>
<noscript>
<img src="https://ad.doubleclick.net/ddm/activity/src=12569752;type=rbnla0;cat=rbn_l0;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;npa=;gdpr=${GDPR};gdpr_consent=${GDPR_CONSENT_755};ord=1?" width="1" height="1" alt=""/>
</noscript>
<!-- End of event snippet: Please do not remove -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/themes/site_themes/rubin/js/vendor/jquery-1.11.1.min.js"><\/script>')</script>
<script type="text/javascript" src="//use.typekit.net/hjl5sji.js"></script>
<script src="/themes/site_themes/rubin/js/vendor/bootstrap.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script>
<!-- BEGIN jquery.sidr.min.js -->
<script>(function(e){var t=!1,i=!1,n={isUrl:function(e){var t=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return t.test(e)?!0:!1},loadContent:function(e,t){e.html(t)},addPrefix:function(e){var t=e.attr("id"),i=e.attr("class");"string"==typeof t&&""!==t&&e.attr("id",t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&e.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),e.removeAttr("style")},execute:function(n,s,a){"function"==typeof s?(a=s,s="sidr"):s||(s="sidr");var r,d,l,c=e("#"+s),u=e(c.data("body")),f=e("html"),p=c.outerWidth(!0),g=c.data("speed"),h=c.data("side"),m=c.data("displace"),v=c.data("onOpen"),y=c.data("onClose"),x="sidr"===s?"sidr-open":"sidr-open "+s+"-open";if("open"===n||"toggle"===n&&!c.is(":visible")){if(c.is(":visible")||t)return;if(i!==!1)return o.close(i,function(){o.open(s)}),void 0;t=!0,"left"===h?(r={left:p+"px"},d={left:"0px"}):(r={right:p+"px"},d={right:"0px"}),u.is("body")&&(l=f.scrollTop(),f.css("overflow-x","initial").scrollTop(l)),m?u.addClass("sidr-animating").css({width:u.width(),position:"fixed"}).css("overflow-x","initial").animate(r,g,function(){e(this).addClass(x)}):setTimeout(function(){e(this).addClass(x)},g),c.css("display","block").animate(d,g,function(){t=!1,i=s,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),v()}else{if(!c.is(":visible")||t)return;t=!0,"left"===h?(r={left:0},d={left:"-"+p+"px"}):(r={right:0},d={right:"-"+p+"px"}),u.is("body")&&(l=f.scrollTop(),f.removeAttr("style").scrollTop(l)),u.addClass("sidr-animating").animate(r,g).removeClass(x),c.animate(d,g,function(){c.removeAttr("style").hide(),u.removeAttr("style"),e("html").removeAttr("style"),t=!1,i=!1,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),y()}}},o={open:function(e,t){n.execute("open",e,t)},close:function(e,t){n.execute("close",e,t)},toggle:function(e,t){n.execute("toggle",e,t)},toogle:function(e,t){n.execute("toggle",e,t)}};e.sidr=function(t){return o[t]?o[t].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof t&&"string"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.sidr"),void 0):o.toggle.apply(this,arguments)},e.fn.sidr=function(t){var i=e.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body",displace:!0,onOpen:function(){},onClose:function(){}},t),s=i.name,a=e("#"+s);if(0===a.length&&(a=e("<div />").attr("id",s).appendTo(e("body"))),a.addClass("sidr").addClass(i.side).data({speed:i.speed,side:i.side,body:i.body,displace:i.displace,onOpen:i.onOpen,onClose:i.onClose}),"function"==typeof i.source){var r=i.source(s);n.loadContent(a,r)}else if("string"==typeof i.source&&n.isUrl(i.source))e.get(i.source,function(e){n.loadContent(a,e)});else if("string"==typeof i.source){var d="",l=i.source.split(",");if(e.each(l,function(t,i){d+='<nav class="sidr-inner">'+e(i).html()+"</nav>"}),i.renaming){var c=e("<div />").html(d);c.find("*").each(function(t,i){var o=e(i);n.addPrefix(o)}),d=c.html()}n.loadContent(a,d)}else null!==i.source&&e.error("Invalid Sidr Source");return this.each(function(){var t=e(this),i=t.data("sidr");i||(t.data("sidr",s),"ontouchstart"in document.documentElement?(t.bind("touchstart",function(e){e.originalEvent.touches[0],this.touched=e.timeStamp}),t.bind("touchend",function(e){var t=Math.abs(e.timeStamp-this.touched);200>t&&(e.preventDefault(),o.toggle(s))})):t.click(function(e){e.preventDefault(),o.toggle(s)}))})}})(jQuery);
</script>
<!-- END jquery.sidr.min.js -->
<script src="/themes/site_themes/rubin/js/vendor/libs_rubinmuseum.org.min.js"></script>
<script type="text/javascript">!function(a){var o={setup:function(){var o=a("#mediarotator"),i=a(".jcarousel-pagination"),e=a("#mediarotator-carousel");0!=o.length&&(a(e).on("jcarousel:reload jcarousel:create",function(){a("#mediarotator-carousel li.slide-li:first-child");e.jcarousel("items").width(e.innerWidth())}).jcarousel({items:".slide-li",wrap:"circular",transitions:!1}),is_ie9||a(e).jcarouselAutoscroll({interval:3e3,target:"+=1",autostart:!0}),a(document).on("click","#mediarotator a, #mediarotator .play-button",function(){is_ie9||a(e).jcarouselAutoscroll("stop")}),a(e).on("jcarousel:firstin","li",function(a,o){}),i.on("click",function(o){o.preventDefault(),is_ie9||a(e).jcarouselAutoscroll("stop")}).on("jcarouselpagination:active","a",function(){a(this).addClass("active")}).on("jcarouselpagination:inactive","a",function(){a(this).removeClass("active")}).jcarouselPagination(),a(window).resize(function(){e.length&&a("#mediarotator-carousel .jcarousel").jcarousel("reload",{})}))}};a(window).load(function(){function i(){a(".play-button.video").each(function(o,i){var e=a(i).parents(".embed-event"),t=a("img",e).height();a(i).css({top:t-33})})}"mediacenter"===firstPathname&&(is_safari&&a("body").addClass("browser-safari"),is_chrome&&a("body").addClass("browser-chrome"),is_firefox&&a("body").addClass("browser-firefox"),is_mac&&a("body").addClass("platform-mac"),is_ipad&&a("body").addClass("device-ipad"),o.setup(),a(window).resize(function(){i()}),i())})}(jQuery);
</script>
<script src="/themes/site_themes/rubin/js/main.min.js?091719"></script>
<script>
$(function(){
$news_slider = $('#news_slider .news_slider_text');
$news_slider.html('The Museum will close early at 5:00 PM on Friday, September 29 due to inclement weather');
var $slider = $('#news_slider'); var $closeBtn =$('#closeSlider');
$slider.on('load',function(event){ $slider.slideDown('slow');});
$closeBtn.on('click',function(event){$slider.slideUp().end();});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment