blob: 6eaf28e067368db61fe50dcaedebdd03c719648d [file] [log] [blame]
/*
Copyright 2019-2020 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};var snippetEls=document.querySelectorAll(".js-toolsCopySnippet");snippetEls.forEach(function(a){a.addEventListener("click",function(b){b.preventDefault();b.currentTarget.select();document.execCommand("copy")})});
var pathEl=document.querySelector(".js-toolsPathInput"),htmlEl=document.querySelector('input[name="html"].js-toolsCopySnippet'),markdownEl=document.querySelector('input[name="markdown"].js-toolsCopySnippet'),badgeEl=document.querySelector(".js-badgeExampleButton");
pathEl&&htmlEl&&markdownEl&&badgeEl&&pathEl.addEventListener("input",function(a){var b=window.location.origin,c=b+"/"+a.target.value;b=b+"/badge/"+a.target.value;a.target.value&&(b+=".svg");htmlEl.value='<a href="'+c+'"><img src="'+b+'" alt="Go Reference"></a>';markdownEl.value="[![Go Reference]("+b+")]("+c+")";badgeEl.href=c});