#96 Finished adding test functionality to notifications

This commit is contained in:
Drewster727 2016-03-28 14:42:25 -05:00
commit 3d41445f6f
3 changed files with 101 additions and 0 deletions

View file

@ -36,6 +36,12 @@
</div>
</div>
<div class="form-group">
<div>
<button id="testPushbullet" type="submit" class="btn btn-primary-outline">Test</button>
</div>
</div>
<div class="form-group">
<div>
<button id="save" type="submit" class="btn btn-primary-outline">Submit</button>
@ -70,5 +76,28 @@
}
});
});
$('#testPushbullet').click(function (e) {
e.preventDefault();
var $form = $("#mainForm");
$.ajax({
type: $form.prop("method"),
data: $form.serialize(),
url: '/admin/testpushbulletnotification',
dataType: "json",
success: function (response) {
if (response.result === true) {
generateNotify(response.message, "success");
} else {
generateNotify(response.message, "warning");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
});
</script>