# HG changeset patch # User Oleksandr Gavenko # Date 1411596601 -10800 # Node ID 23cd36180bf9f36240a6c65fe26c8e0c6d1c74ab # Parent be8ee2240a17344b354124f72a79da736cdb2dad Add ability to enable browser profile. diff -r be8ee2240a17 -r 23cd36180bf9 2048.html --- a/2048.html Thu Sep 25 00:54:13 2014 +0300 +++ b/2048.html Thu Sep 25 01:10:01 2014 +0300 @@ -163,6 +163,7 @@ +
profile

@@ -636,6 +637,9 @@ document.getElementById("visual-finish").addEventListener("click", ui.action.visualFinish, false); ui.action.finish = function() { + var isProfile = document.getElementById("profile").checked; + if (isProfile) + console.profile(); if ( ! ui.ai.current) { ui.game.setMessage('Select AI!'); return; @@ -668,6 +672,8 @@ ui.score.speed(parseFloat((step*1000.0/(tsTo-tsFrom)).toPrecision(3))); ui.game.setMessage("Game over!"); ui.ai.current.cleanup(); + if (isProfile) + console.profileEnd(); } document.getElementById("finish").addEventListener("click", ui.action.finish, false);