in src/main/resources/SLING-INF/etc/clientlibs/repl/script.js [129:157]
function init() {
// Setup editors
$('.editor').each(function () {
new Editor(this, reloadOutput);
});
// Setup output tabs
var allTargets = $('.output-view');
$('a[data-toggle=tab]').each(function () {
var link = $(this),
href = link.attr('href'),
target = allTargets.filter(href),
state = target.attr('id');
link.click(function () {
currentState = state;
allTargets.addClass('hidden');
target.removeClass('hidden');
reloadOutput();
window.location = href;
});
});
$(window).on('hashchange', function () {
hash = window.location.hash;
currentState = hash ? hash.substr(1) : 'source';
$('a[href=#' + currentState + ']').click();
});
}