blob: d75d2266838a81eecc2973908b45d3551e4a3fae [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;a=b+"/badge/"+a.target.value;htmlEl.value='<a href="'+c+'"><img src="'+a+'" alt="PkgGoDev"></a>';markdownEl.value="[![PkgGoDev]("+a+")]("+c+")";badgeEl.href=c});