mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Only save the page if its contents have changed
This commit is contained in:
parent
b42750073c
commit
d0bc74ec55
@ -167,7 +167,13 @@ body#pad textarea {
|
||||
|
||||
// This will apply the debounce effect on the keyup event
|
||||
// And it only fires 500ms or half a second after the user stopped typing
|
||||
var prevText = $('#userInput').val();
|
||||
$('#userInput').on('keyup', debounce(function() {
|
||||
if (prevText == $('#userInput').val()) {
|
||||
return // no changes
|
||||
}
|
||||
prevText = $('#userInput').val();
|
||||
|
||||
if (oulipo) {
|
||||
$('#userInput').val($('#userInput').val().replace(/e/g,""));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user