Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function mkcircuit(data) {
loading = false;
$('form').find('input, textarea, button, select').prop('disabled', false);
circuit = new digitaljs.Circuit(data);
circuit.on('postUpdateGates', (tick) => {
$('#tick').val(tick);
});
circuit.start();
monitor = new digitaljs.Monitor(circuit);
if (monitormem) {
monitor.loadWiresDesc(monitormem);
monitormem = undefined;
}
monitorview = new digitaljs.MonitorView({model: monitor, el: $('#monitor') });
paper = circuit.displayOn($('<div>').appendTo($('#paper')));
circuit.on('userChange', () => {
updatebuttons();
});
circuit.on('changeRunning', () => {
updatebuttons();
});
updatebuttons();
$('#monitorbox button').prop('disabled', false);
$('#monitorbox button[name=ppt_up]').on('click', (e) => { monitorview.pixelsPerTick *= 2; });
$('#monitorbox button[name=ppt_down]').on('click', (e) => { monitorview.pixelsPerTick /= 2; });</div>