2016-01-17 04:59:40 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
$("#apiResetForm").submit(function(e) {
|
2015-08-15 21:03:39 +00:00
|
|
|
$.post("/api/reset", $(this).serialize())
|
2016-01-17 04:59:40 +00:00
|
|
|
.done(function(data) {
|
|
|
|
api_key = data.data
|
|
|
|
successFlash(data.message)
|
|
|
|
$("#api_key").val(api_key)
|
|
|
|
})
|
|
|
|
.fail(function(data) {
|
|
|
|
errorFlash(data.message)
|
|
|
|
})
|
2015-08-15 21:03:39 +00:00
|
|
|
return false
|
|
|
|
})
|
2016-01-17 04:59:40 +00:00
|
|
|
$("#settingsForm").submit(function(e) {
|
2015-08-15 21:03:39 +00:00
|
|
|
$.post("/settings", $(this).serialize())
|
2016-01-17 04:59:40 +00:00
|
|
|
.done(function(data) {
|
|
|
|
successFlash(data.message)
|
|
|
|
})
|
|
|
|
.fail(function(data) {
|
|
|
|
errorFlash(data.responseJSON.message)
|
|
|
|
})
|
2015-08-15 21:03:39 +00:00
|
|
|
return false
|
|
|
|
})
|
|
|
|
})
|