diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js index 86b699f..c52a6df 100644 --- a/wwwroot/js/site.js +++ b/wwwroot/js/site.js @@ -22,6 +22,7 @@ var poller = null; +// refresh the UI every 10 seconds when not typing let pollJob = function () { poller = setInterval(function () { @@ -29,7 +30,7 @@ let pollJob = function () { $.get('/api/get', function (content) { $('textarea').val(content); }); - }, 30000); + }, 10000); } $(function () { @@ -46,7 +47,7 @@ $(function () { // start polling pollJob(); - // save after half-second delay after typing + // save after a second delay after typing $('textarea').keyup(function (e) { clearTimeout(timer); @@ -63,9 +64,6 @@ $(function () { } }); - // 20 second interval - // setInterval(saveContent, 60000); - // support tab key in textarea $('textarea').keydown(function (e) { if (e.keyCode === 9) { // tab was pressed