INNER CODE UNIT · JavaScript
NewExampleLocation
carvel-dev/ytt · pkg/website/js/app.js:310
function NewExampleLocation() {
var prefix = "#example:";
return {
isSet: function() {
return window.location.hash && window.location.hash.startsWith(prefix);
},
get: function() {
var defaultExample = "example-demo";
if (window.location.hash) {
if (window.location.hash.startsWith(prefix)) {
defaultExample = window.location.hash.replace(prefix, "", 1)
}
}
return defaultExample
},
set: function(example) {
window.location.hash = "#example:"+example
}