eValert.js
eVents alert - jQuery plugin
About:
Provides a window alarms and alarm events.
The alerts will appear before minutes, hours, days or weeks according to your choice.
Additionally You can choose also when the event occurs.
Features:
- Customize event alert window.
- Notifications minutes, hours, days or weeks according to your choice before event occurs.
- Supports ajax
- Supports json file
- compatible with meshesha/jCal calendar.
Installation:
Add in the header of your html page:
- jquery.js
- evalert.js
- evalert.css
Usage:
add in the BODY
and then add javascript code:
<div id="my_events_example"></div>and then add javascript code:
<script type="text/javascript">
$('#my_events_example').evalert({
//here eValert options
});
</script>
Example:
<script type="text/javascript">
$('#my_events_example').evalert({
eventParams:{
'Event-1':[
'2017-01-02',
'14:45',
'TYPE=ALERT;BFOR=MIN;VAL=1',
'http://localhost/my_tiny_todo/',
'#4CAF50',
'white',
],
'Event-2':[
'2017-01-02',
'14:47',
'TYPE=ALERT;BFOR=MIN;VAL=1',
'',
'#2196F3',
'black',
]
},
alertWinWidth: '300px',
alertWinHeight: '80px',
alertWinPos: 'fbl',
title: 'Alerts',
titleBgColor: 'red',
titleTextColor: 'white'
});
</script>
Result:eValert options:
| Name | Description | Options | Default | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| eventSource | Type of data file. | '' - Do not use external data. must use eventParams,for details, see below. 'json' - use json file 'php' - use php source |
'' | ||||||||||||||||||||||
| eventUrl | Path to events/alerts file. | 'path/to/myevents.json' 'path/to/myevents.php' |
|||||||||||||||||||||||
| eventParams | Object that contains the event data and alarm parametrs. |
format:
{
'Event name -1':[
'event date',
'event time',
'alarm parametrs',
'url',
'background color',
'text color',
],
'Event name -2':[
'2017-01-30',
'14:50',
'TYPE=ALERT;BFOR=MIN;VAL=1',
'http://your/link/of/this/event.html',
'#2196F3',
'black',
]
}
Where:
|
|||||||||||||||||||||||
| eventOntimeAlert | Do alert when the event occurs? | true-show alert when the event occur. false-don't show alert when the event occur. |
true | ||||||||||||||||||||||
| alertWinPos | The position of the DIV (Alerts window) relative to its parent alemnt. note: If it has no parent, then will be relative to <BODY> |
Options:
|
false | ||||||||||||||||||||||
| alertWinWidth | The width of the Alerts window. | falseauto (100%). width in px. |
false | ||||||||||||||||||||||
| alertWinHeight | The height of the Alerts window. | false-80px. height in px. |
false | ||||||||||||||||||||||
| title | The title of Alerts window. | text | 'Events Box' | ||||||||||||||||||||||
| newAlertFirst | Order of appearance of alerts. | true-new alert first. false-new alert last. |
true | ||||||||||||||||||||||
| bodyBorderColor | Border Color of Alerts window. | color value | white | ||||||||||||||||||||||
| titleBgColor | background color of the title of the Alerts window. | color value | #03a9f4 | ||||||||||||||||||||||
| titleTextColor | Text color of the title of the Alerts window. | color value | white | ||||||||||||||||||||||
| titleFontSize | The font size of the title of the Alerts window. | font size value | 15px | ||||||||||||||||||||||
| contentBgColor | background color of the content area of the Alerts window. | color value | white | ||||||||||||||||||||||
| contentFontSize | The font size of the content area of the Alerts window. | font size value | 10px |
Alerts Window
Using json file and Ajax php
Licensing
GPLv3