-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMMM-Iframe.js
More file actions
50 lines (43 loc) · 1.24 KB
/
MMM-Iframe.js
File metadata and controls
50 lines (43 loc) · 1.24 KB
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
/* Magic Mirror
* Module: Iframe
*
* By Avella https://github.com/Av3lla
* MIT Licensed.
*/
Module.register("MMM-Iframe", {
defaults: {
headerText: 'Iframe',
url: null,
width: 800,
height: 600,
updateInterval: 1000 * 60
},
start: function() {
// define global variables
Log.info("Starting module: " + this.name);
var self = this;
setInterval(function() {
self.updateDom();
}, this.config.updateInterval)
},
getStyles: function() {
return ["MMM-Iframe.css"];
},
getHeader: function() {
return `${this.config.headerText}`;
},
getDom: function() {
var mainDiv = document.createElement("div");
var iframeDiv = document.createElement("iframe");
iframeDiv.className = "iframe";
iframeDiv.setAttribute('src', `${this.config.url}`);
iframeDiv.setAttribute('width', `${this.config.width}`);
iframeDiv.setAttribute('height', `${this.config.height}`);
iframeDiv.setAttribute('scrolling', 'no');
var developedbyDiv = document.createElement("div");
developedbyDiv.className = "devby";
developedbyDiv.innerHTML = "이지원 Github @Av3lla / 허성빈 Github @seongbeenheo";
mainDiv.append(iframeDiv, developedbyDiv);
return mainDiv;
}
});