blob: a7356a59901044fecd34182cd7b6697314db5431 [file] [log] [blame]
// Copyright 2021 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.
// for /play; play.js is for embedded play widgets
window.addEventListener('DOMContentLoaded', () => {
// Set up playground if enabled.
if (window.playground) {
window.playground({
"codeEl": ".js-playgroundCodeEl",
"outputEl": ".js-playgroundOutputEl",
"runEl": ".js-playgroundRunEl",
"fmtEl": ".js-playgroundFmtEl",
"shareEl": ".js-playgroundShareEl",
"shareRedirect": "/play/p/",
"toysEl": ".js-playgroundToysEl",
'enableHistory': true,
'enableShortcuts': true,
'enableVet': true
});
// The pre matched below is added by the code above. Style it appropriately.
document.querySelector(".js-playgroundOutputEl pre").classList.add("Playground-output");
$('.js-playgroundToysEl').val("hello.go").trigger("change")
$('#code').linedtextarea();
$('#code').attr('wrap', 'off');
$('#code').resize(function() { $('#code').linedtextarea(); });
}
});