forked from webpack-contrib/webpack-hot-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient-overlay.js
35 lines (30 loc) · 883 Bytes
/
client-overlay.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
/*eslint-env browser*/
var clientOverlay = document.createElement('div');
clientOverlay.style.display = 'none';
clientOverlay.style.background = '#fdd';
clientOverlay.style.color = '#000';
clientOverlay.style.position = 'fixed';
clientOverlay.style.zIndex = 9999;
clientOverlay.style.left = 0;
clientOverlay.style.right = 0;
clientOverlay.style.top = 0;
clientOverlay.style.bottom = 0;
clientOverlay.style.overflow = 'auto';
if (document.body) {
document.body.appendChild(clientOverlay);
}
exports.showProblems =
function showProblems(lines) {
clientOverlay.innerHTML = '';
clientOverlay.style.display = 'block';
lines.forEach(function(msg) {
var pre = document.createElement('pre');
pre.textContent = msg;
clientOverlay.appendChild(pre);
});
};
exports.clear =
function clear() {
clientOverlay.innerHTML = '';
clientOverlay.style.display = 'none';
};