mirror of
https://github.com/caronc/apprise-api.git
synced 2024-12-12 09:50:50 +01:00
Added SweetAlert2 popups (#6)
This commit is contained in:
parent
948454f4df
commit
96dcaf7758
@ -12,6 +12,7 @@
|
||||
<link rel="stylesheet" href="{% static 'css/base.css' %}" />
|
||||
<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}" />
|
||||
<script src="{% static 'js/materialize.min.js' %}"></script>
|
||||
<script src="{% static 'js/sweetalert2.all.min.js' %}"></script>
|
||||
<title>{% block title %}{% trans "Apprise API" %}{% endblock %}</title>
|
||||
</head>
|
||||
|
||||
|
@ -140,6 +140,18 @@ document.querySelector('#addurl').onsubmit = function(event) {
|
||||
|
||||
// reset our form
|
||||
form.reset();
|
||||
|
||||
Swal.fire(
|
||||
'Save',
|
||||
'Successfully saved the specified URL(s).',
|
||||
'success'
|
||||
);
|
||||
} else {
|
||||
Swal.fire(
|
||||
'Save',
|
||||
'Failed to save the specified URL(s).',
|
||||
'error'
|
||||
);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
@ -160,6 +172,20 @@ document.querySelector('#addconfig').onsubmit = function(event) {
|
||||
{
|
||||
// update our settings
|
||||
update();
|
||||
|
||||
// user notification
|
||||
Swal.fire(
|
||||
'Save',
|
||||
'Successfully saved the specified URL(s).',
|
||||
'success'
|
||||
);
|
||||
} else {
|
||||
// user notification
|
||||
Swal.fire(
|
||||
'Save',
|
||||
'Failed to save the specified URL(s).',
|
||||
'error'
|
||||
);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
@ -178,8 +204,19 @@ document.querySelector('#donotify').onsubmit = function(event) {
|
||||
}).then(function(response) {
|
||||
if(response.status == 200)
|
||||
{
|
||||
// update our settings
|
||||
alert('Notification Sent');
|
||||
// user notification
|
||||
Swal.fire(
|
||||
'Notification',
|
||||
'Successfully sent the notification(s).',
|
||||
'success'
|
||||
);
|
||||
} else {
|
||||
// user notification
|
||||
Swal.fire(
|
||||
'Notification',
|
||||
'Failed to send the notification(s).',
|
||||
'error'
|
||||
);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
|
2
apprise_api/static/js/sweetalert2.all.min.js
vendored
Normal file
2
apprise_api/static/js/sweetalert2.all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
22
apprise_api/static/licenses/sweetalert2-9.5.4.LICENSE
Normal file
22
apprise_api/static/licenses/sweetalert2-9.5.4.LICENSE
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Tristan Edwards & Limon Monte
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
Loading…
Reference in New Issue
Block a user