2016-02-01 09:49:18 -05:00
|
|
|
/**
|
2016-02-02 11:34:03 -05:00
|
|
|
* Event handlers
|
2016-02-01 09:49:18 -05:00
|
|
|
*/
|
2016-02-08 10:57:44 -05:00
|
|
|
((ac) => {
|
2016-02-01 09:49:18 -05:00
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Close event for messages
|
2016-02-08 10:57:44 -05:00
|
|
|
ac.on('header', 'click', '.message', function () {
|
2016-02-16 12:07:01 -05:00
|
|
|
ac.hide(this);
|
2016-02-01 09:49:18 -05:00
|
|
|
});
|
|
|
|
|
2016-04-14 15:16:13 -04:00
|
|
|
// Confirm deleting of list or library items
|
2017-02-16 11:47:54 -05:00
|
|
|
ac.on('form.js-delete', 'submit', (event) => {
|
2017-02-16 13:22:26 -05:00
|
|
|
const proceed = confirm('Are you ABSOLUTELY SURE you want to delete this item?');
|
2016-04-14 15:16:13 -04:00
|
|
|
|
|
|
|
if (proceed === false) {
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-04-21 11:14:21 -04:00
|
|
|
// Clear the api cache
|
2017-02-15 16:13:32 -05:00
|
|
|
ac.on('.js-clear-cache', 'click', () => {
|
2016-04-21 11:14:21 -04:00
|
|
|
ac.get('/cache_purge', () => {
|
2017-02-16 11:47:54 -05:00
|
|
|
ac.showMessage('success', 'Successfully purged api cache');
|
2016-04-21 11:14:21 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-02-08 10:57:44 -05:00
|
|
|
})(AnimeClient);
|