-
Notifications
You must be signed in to change notification settings - Fork 0
/
note.html
87 lines (49 loc) · 1.81 KB
/
note.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!--
/////////////CONFIGURATION//////////////
- npm install
- npm i angularjs
- npm i socket.io
- npm i express
Models -> contient les pages principals qui appelent les views
Views -> contient des morceaux de page
Controllers -> contient le traitement views
Directives -> contient les balises personnaliser
////////SOURCE///////
Mettre socket.io en place : https://scotch.io/@gitedy/simple-socketio-using-node-js-and-angular-js
////////NOTIFICATION DE BUREAU////////
<script>
// request permission on page load
document.addEventListener('DOMContentLoaded', function () {
if (!Notification) {
alert('Desktop notifications not available in your browser. Try Chromium.');
return;
}
if (Notification.permission !== "granted")
Notification.requestPermission();
});
function notifyMe() {
if (Notification.permission !== "granted")
Notification.requestPermission();
else {
var notification = new Notification('Notification title', {
icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
body: "Hey there! You've been notified!",
});
notification.onclick = function () {
window.open("http://stackoverflow.com/a/13328397/1269037");
};
}
}
</script>
<button onclick="notifyMe()">Notify me!</button>
///////////////INSTALLATION D'UN CHATBOX////////////
ajouter dans les controllers le script suivant :
<script src="controllers/chatBoxCtrl.js"></script>
ajouter dans les directives le script suivant :
<script src="directives/chatBox.js"></script>
Dans la parti Socket.io ajouter :
socket.on('chatBox', function(data){
socket.emit('chatBoxRetourMoi', data)
socket.broadcast.emit('chatBoxRetour', data)
})
-->