1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added checkmark/x instead of SAVED/UNSAVED

This commit is contained in:
Zack Scholl 2016-04-13 12:49:19 -04:00
parent 6c0a67f63d
commit 04424b566e

View File

@ -6,7 +6,7 @@ $(document).ready(function() {
var updateInterval; var updateInterval;
var uhohTimer; var uhohTimer;
var doneTypingInterval = 500; //time in ms, 5 second for example var doneTypingInterval = 500; //time in ms, 5 second for example
var pollToGetNewestCopyInterval = 10000; var pollToGetNewestCopyInterval = 20000;
//on keyup, start the countdown //on keyup, start the countdown
$('#emit').keyup(function() { $('#emit').keyup(function() {
clearTimeout(typingTimer); clearTimeout(typingTimer);
@ -20,7 +20,7 @@ $(document).ready(function() {
clearTimeout(typingTimer); clearTimeout(typingTimer);
clearInterval(updateInterval); clearInterval(updateInterval);
$('#saveInfo').removeClass().addClass("glyphicon glyphicon-floppy-remove"); $('#saveInfo').removeClass().addClass("glyphicon glyphicon-floppy-remove");
document.title = "[UNSAVED] " + title_name; document.title = '✗ ' + title_name;
}); });
//user is "finished typing," do something //user is "finished typing," do something
@ -31,7 +31,7 @@ $(document).ready(function() {
$('#saveInfo').removeClass().addClass("glyphicon glyphicon-floppy-open"); $('#saveInfo').removeClass().addClass("glyphicon glyphicon-floppy-open");
console.log("Done typing") console.log("Done typing")
updateInterval = setInterval(updateText, pollToGetNewestCopyInterval); updateInterval = setInterval(updateText, pollToGetNewestCopyInterval);
document.title = "[SAVED] " + title_name; document.title = " " + title_name;
if (currentText().indexOf("self-destruct\n") > -1 || currentText().indexOf("\nself-destruct") > -1) { if (currentText().indexOf("self-destruct\n") > -1 || currentText().indexOf("\nself-destruct") > -1) {
if (selfDestruct == false) { if (selfDestruct == false) {
selfDestruct = true; selfDestruct = true;
@ -72,7 +72,7 @@ $(document).ready(function() {
if (data.UpdateClient == true) { if (data.UpdateClient == true) {
console.log("Updating...") console.log("Updating...")
$('#emit_data').val(data.TextData) $('#emit_data').val(data.TextData)
document.title = "[LOADED] " + title_name; document.title = " " + title_name;
} }
console.log((data.TextData == "saved")) console.log((data.TextData == "saved"))
console.log(data.TextData) console.log(data.TextData)