mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Merge pull request #61 from schollz/frontend
Update frontend for locking page Former-commit-id: 6c657ff4a43f33cb040185d259c03e793676f332 [formerly 72b937774f347af8f114d919bcc260c1c441ced7] [formerly 9429791652dc3e9a3e44d866dc346a45225e5560 [formerly c5fa54646d56b3eaebfef06aff2821b1839a39cc]] Former-commit-id: 182ba5b59c9852b46a80f7215a7113a640e11ef7 [formerly 4a66a0a6bce4d892bcef1eb00d074ddcd025b425] Former-commit-id: e6fdc1362ec4b3d22195a9c7b2874010dfda4a36
This commit is contained in:
commit
695b838991
@ -41,6 +41,10 @@
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.success {
|
||||||
|
color: #5cb85c;
|
||||||
|
}
|
||||||
|
|
||||||
.pure-menu a {
|
.pure-menu a {
|
||||||
color: #777;
|
color: #777;
|
||||||
}
|
}
|
||||||
@ -100,6 +104,7 @@
|
|||||||
function debounce(func, wait, immediate) {
|
function debounce(func, wait, immediate) {
|
||||||
var timeout;
|
var timeout;
|
||||||
return function() {
|
return function() {
|
||||||
|
$('#saveEditButton').removeClass()
|
||||||
$('#saveEditButton').text("Editing");
|
$('#saveEditButton').text("Editing");
|
||||||
var context = this,
|
var context = this,
|
||||||
args = arguments;
|
args = arguments;
|
||||||
@ -118,6 +123,7 @@
|
|||||||
// And it only fires 500ms or half a second after the user stopped typing
|
// And it only fires 500ms or half a second after the user stopped typing
|
||||||
$('#userInput').on('keyup', debounce(function() {
|
$('#userInput').on('keyup', debounce(function() {
|
||||||
console.log('typing occurred');
|
console.log('typing occurred');
|
||||||
|
$('#saveEditButton').removeClass()
|
||||||
$('#saveEditButton').text("Saving")
|
$('#saveEditButton').text("Saving")
|
||||||
upload();
|
upload();
|
||||||
}, 500));
|
}, 500));
|
||||||
@ -131,6 +137,12 @@
|
|||||||
page: "{{ .Page }}"
|
page: "{{ .Page }}"
|
||||||
}),
|
}),
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
$('#saveEditButton').removeClass()
|
||||||
|
if (data.success == true) {
|
||||||
|
$('#saveEditButton').addClass("success");
|
||||||
|
} else {
|
||||||
|
$('#saveEditButton').addClass("failure");
|
||||||
|
}
|
||||||
$('#saveEditButton').text(data.message);
|
$('#saveEditButton').text(data.message);
|
||||||
},
|
},
|
||||||
error: function(xhr, error) {
|
error: function(xhr, error) {
|
||||||
@ -149,6 +161,12 @@
|
|||||||
page: "{{ .Page }}"
|
page: "{{ .Page }}"
|
||||||
}),
|
}),
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
$('#saveEditButton').removeClass()
|
||||||
|
if (data.success == true) {
|
||||||
|
$('#saveEditButton').addClass("success");
|
||||||
|
} else {
|
||||||
|
$('#saveEditButton').addClass("failure");
|
||||||
|
}
|
||||||
$('#saveEditButton').text(data.message);
|
$('#saveEditButton').text(data.message);
|
||||||
},
|
},
|
||||||
error: function(xhr, error) {
|
error: function(xhr, error) {
|
||||||
@ -168,9 +186,22 @@
|
|||||||
passphrase: passphrase
|
passphrase: passphrase
|
||||||
}),
|
}),
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
$('#saveEditButton').removeClass()
|
||||||
|
if (data.success == true) {
|
||||||
|
$('#saveEditButton').addClass("success");
|
||||||
|
} else {
|
||||||
|
$('#saveEditButton').addClass("failure");
|
||||||
|
}
|
||||||
$('#saveEditButton').text(data.message);
|
$('#saveEditButton').text(data.message);
|
||||||
|
if ($('#lockPage').val() == "Lock") {
|
||||||
|
$('#lockPage').text("Unlock");
|
||||||
|
} else {
|
||||||
|
$('#lockPage').text("Lock");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, error) {
|
error: function(xhr, error) {
|
||||||
|
$('#saveEditButton').removeClass()
|
||||||
|
$('#saveEditButton').addClass("failure");
|
||||||
$('#saveEditButton').text(error);
|
$('#saveEditButton').text(error);
|
||||||
},
|
},
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
|
Loading…
Reference in New Issue
Block a user