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

Fix add the window.cowyo to the rest of the vars

This commit is contained in:
Zack Scholl 2018-02-09 15:15:17 -08:00
parent dfd9aea863
commit 3d3161a09c
2 changed files with 503 additions and 634 deletions

1131
bindata.go

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@ $(window).load(function() {
$('#saveEditButton').removeClass()
$('#saveEditButton').text("Saving")
upload();
}, window.debounceMS));
}, window.cowyo.debounceMS));
var latestUpload = null, needAnother = false;
function upload() {
@ -54,7 +54,7 @@ $(window).load(function() {
data: JSON.stringify({
new_text: $('#userInput').val(),
page: window.cowyo.pageName,
fetched_at: window.lastFetch,
fetched_at: window.cowyo.lastFetch,
}),
success: function(data) {
latestUpload = null;
@ -62,7 +62,7 @@ $(window).load(function() {
$('#saveEditButton').removeClass()
if (data.success == true) {
$('#saveEditButton').addClass("success");
window.lastFetch = data.unix_time;
window.cowyo.lastFetch = data.unix_time;
if (needAnother) {
upload();