"use strict";YUI.add("rg.core.layout.ResponsiveHelpers",function(a){a.namespace("rg.core.layout"),a.rg.core.layout.ResponsiveHelpers=a.Base.create("ResponsiveHelpers",a.Plugin.Base,[],{matchesBreakpoint:function(a,b){var c={l:1200,m:992,s:768},d=!1,e=!1,f="only screen";return!!(window.matchMedia&&a&&a.length)&&("xs"===a?d="s":"s"===a?(d="m",e="s"):"m"===a?(d="l",e="m"):"l"===a?e="l":-1!==a.indexOf("-ge")?e=a.charAt(0):-1!==a.indexOf("-lt")&&(d=a.charAt(0)),e&&(f+=" and (min-width: "+c[e]+"px)"),d&&(f+=" and (max-width: "+(c[d]-1)+"px)"),"p"===b?f+=" and (orientation:portrait)":"l"===b&&(f+=" and (orientation:landscape)"),window.matchMedia(f).matches)}},{NS:"ResponsiveHelpers"})},"0.0.1",{requires:[]});
"use strict";YUI.add("rg.core.util.ClipboardPlugin",function(a){a.namespace("rg.core.util"),a.rg.core.util.ClipboardPlugin=a.Base.create("ClipboardPlugin",a.Plugin.Base,[],{handlers:[],initializer:function(b){var c=a.one("document");b&&(b.textPattern&&this.set("textPattern",b.textPattern),b.htmlPattern&&this.set("htmlPattern",b.htmlPattern),b.context&&this.set("context",b.context)),this.handlers=[],this.handlers.push(c.on("copy",this.attachMessageToClipboard,this))},destructor:function(){a.Array.each(this.handlers,function(a){a.detach()})},sendAjaxExperimentData:function(b){var c=a.one("body").hasClass("logged-out"),d=c?"Logged out":"Logged in",e=d+" - "+this.get("context");a.rg.ajax("application.AjaxCommon.ajaxClipboardExperiment.html",{context:e}),window.ga&&window.ga("send","social","researchgate","copy",e+": "+b)},attachMessageToClipboard:function(b){if(b=b._event||window.event,b.clipboardData||window.clipboardData){var c,d,e,f,g=new Date,h=window.datetimeHelpers.getFullDatestring(g),i=this.get("textPattern").replace(/\{\{title\}\}/g,document.title).replace(/\{\{url\}\}/g,window.location.href).replace(/\{\{currentYear\}\}/g,g.getFullYear()).replace(/\{\{currentDate\}\}/g,h),j=this.get("htmlPattern").replace(/\{\{title\}\}/g,document.title).replace(/\{\{url\}\}/g,window.location.href).replace(/\{\{currentYear\}\}/g,g.getFullYear()).replace(/\{\{currentDate\}\}/g,h),k=document.createElement("div"),l=!!b.clipboardData,m=l?"text/plain":"text",n=l?b.clipboardData:window.clipboardData;if(void 0!==window.getSelection){if(e=window.getSelection(),f=e.baseNode||e.focusNode,!a.one(f).ancestors(".abstract, .publication-abstract, .pub-abstract, .document-viewer, .publication-full-text-container, .topic-post-text, .pdf-html-reader")._nodes.length)return;if(c=e.toString(),c.length<150)return;if(e.rangeCount){for(var o=0,p=e.rangeCount;o<p;++o)k.appendChild(e.getRangeAt(o).cloneContents());d=k.innerHTML}n.setData(m,c+" "+i),l&&n.setData("text/html",d+j)}else{if(!n.getData("Text"))return;if(c=n.getData("Text"),c.length<150)return;n.clearData(),n.setData(m,c+" "+i)}this.sendAjaxExperimentData(c),b.preventDefault()}}},{NS:"ClipboardPlugin",ATTRS:{textPattern:{value:"\n\n{{title}}. Available from: {{url}} [accessed {{currentDate}}]."},htmlPattern:{value:'\n<br><i>{{title}}</i>. Available from: <a href="{{url}}">{{url}}</a> [accessed {{currentDate}}].'},context:{value:null}}})},"1.0.0",{requires:["datetimeHelpers"]});
