DefinitelyTyped/types/bootstrap-notify/bootstrap-notify-tests.ts
2019-02-21 13:04:37 +02:00

67 lines
1.7 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//Test for bootstrap-notify v3.1.3
//Copied example directly from Bootstrap-notify site
$.notify({
// options
icon: 'glyphicon glyphicon-warning-sign',
title: 'Bootstrap notify',
message: 'Turning standard Bootstrap alerts into "notify" like notifications',
url: 'https://github.com/mouse0270/bootstrap-notify',
target: '_blank'
},{
// settings
element: 'body',
position: null,
type: "info",
allow_dismiss: true,
newest_on_top: false,
showProgressbar: false,
placement: {
from: "top",
align: "right"
},
offset: 20,
spacing: 10,
z_index: 1031,
delay: 5000,
timer: 1000,
url_target: '_blank',
mouse_over: null,
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
},
onShow: null,
onShown: null,
onClose: null,
onClosed: null,
icon_type: 'class',
template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>' +
'<span data-notify="icon"></span> ' +
'<span data-notify="title">{1}</span> ' +
'<span data-notify="message">{2}</span>' +
'<div class="progress" data-notify="progressbar">' +
'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
'</div>' +
'<a href="{3}" target="{4}" data-notify="url"></a>' +
'</div>'
});
const notifyResult = $.notify({
message: 'Callbacks have the popup element as an argument',
},{
onShow: function($ele) {
notifyResult.$ele === $ele;
},
onShown: function($ele) {
notifyResult.$ele === $ele;
},
onClose: function($ele) {
notifyResult.$ele === $ele;
},
onClosed: function($ele) {
notifyResult.$ele === $ele;
},
});