/
MMM-Sudoku.js
46 lines (33 loc) · 942 Bytes
/
MMM-Sudoku.js
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
/* Magic Mirror
* Module: MMM-Suduko
*
* By Mykle1 - MIT Licensed
*
*/
Module.register("MMM-Sudoku",{
defaults: {
height:"290px",
width:"216px"
},
getStyles: function() {
return ["MMM-Sudoku.css"];
},
getDom: function() {
var iframe = document.createElement("IFRAME");
iframe.classList.add("iframe");
iframe.style = "border:none";
iframe.width = this.config.width;
iframe.height = this.config.height;
type="text/javascript";
iframe.src = '//100widgets.com/js_data.php?id=162';
return iframe;
},
///// Add this function to the modules you want to control with voice //////
notificationReceived: function(notification, payload) {
if (notification === 'HIDE_SUDOKU') {
this.hide(1000);
} else if (notification === 'SHOW_SUDOKU') {
this.show(1000);
}
},
});