nav tabs on admin dashboard
This commit is contained in:
39
node_modules/webpack-dev-server/client/overlay.js
generated
vendored
39
node_modules/webpack-dev-server/client/overlay.js
generated
vendored
@@ -1,13 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)
|
||||
'use strict'; // The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)
|
||||
// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).
|
||||
|
||||
var ansiHTML = require('ansi-html');
|
||||
|
||||
var Entities = require('html-entities').AllHtmlEntities;
|
||||
|
||||
var entities = new Entities();
|
||||
|
||||
var colors = {
|
||||
reset: ['transparent', 'transparent'],
|
||||
black: '181818',
|
||||
@@ -71,34 +69,33 @@ function ensureOverlayDivExists(onOverlayDivReady) {
|
||||
// Everything is ready, call the callback right away.
|
||||
onOverlayDivReady(overlayDiv);
|
||||
return;
|
||||
}
|
||||
|
||||
// Creating an iframe may be asynchronous so we'll schedule the callback.
|
||||
} // Creating an iframe may be asynchronous so we'll schedule the callback.
|
||||
// In case of multiple calls, last callback wins.
|
||||
|
||||
|
||||
lastOnOverlayDivReady = onOverlayDivReady;
|
||||
|
||||
if (overlayIframe) {
|
||||
// We're already creating it.
|
||||
return;
|
||||
}
|
||||
} // Create iframe and, when it is ready, a div inside it.
|
||||
|
||||
|
||||
// Create iframe and, when it is ready, a div inside it.
|
||||
overlayIframe = createOverlayIframe(function () {
|
||||
overlayDiv = addOverlayDivTo(overlayIframe);
|
||||
// Now we can talk!
|
||||
lastOnOverlayDivReady(overlayDiv);
|
||||
});
|
||||
overlayDiv = addOverlayDivTo(overlayIframe); // Now we can talk!
|
||||
|
||||
// Zalgo alert: onIframeLoad() will be called either synchronously
|
||||
lastOnOverlayDivReady(overlayDiv);
|
||||
}); // Zalgo alert: onIframeLoad() will be called either synchronously
|
||||
// or asynchronously depending on the browser.
|
||||
// We delay adding it so `overlayIframe` is set when `onIframeLoad` fires.
|
||||
|
||||
document.body.appendChild(overlayIframe);
|
||||
}
|
||||
|
||||
function showMessageOverlay(message) {
|
||||
ensureOverlayDivExists(function (div) {
|
||||
// Make it look similar to our terminal.
|
||||
div.innerHTML = '<span style="color: #' + colors.red + '">Failed to compile.</span><br><br>' + ansiHTML(entities.encode(message));
|
||||
div.innerHTML = "<span style=\"color: #".concat(colors.red, "\">Failed to compile.</span><br><br>").concat(ansiHTML(entities.encode(message)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,21 +103,21 @@ function destroyErrorOverlay() {
|
||||
if (!overlayDiv) {
|
||||
// It is not there in the first place.
|
||||
return;
|
||||
}
|
||||
} // Clean up and reset internal state.
|
||||
|
||||
|
||||
// Clean up and reset internal state.
|
||||
document.body.removeChild(overlayIframe);
|
||||
overlayDiv = null;
|
||||
overlayIframe = null;
|
||||
lastOnOverlayDivReady = null;
|
||||
}
|
||||
} // Successful compilation.
|
||||
|
||||
|
||||
// Successful compilation.
|
||||
exports.clear = function handleSuccess() {
|
||||
destroyErrorOverlay();
|
||||
};
|
||||
}; // Compilation with errors (e.g. syntax error or missing modules).
|
||||
|
||||
|
||||
// Compilation with errors (e.g. syntax error or missing modules).
|
||||
exports.showMessage = function handleMessage(messages) {
|
||||
showMessageOverlay(messages[0]);
|
||||
};
|
||||
Reference in New Issue
Block a user