Izmjenjena struktura, dodan backand

This commit is contained in:
GotPPay
2017-10-16 11:19:46 +02:00
parent 1ec88afacb
commit 048e32c4aa
37153 changed files with 2975854 additions and 1 deletions

File diff suppressed because one or more lines are too long

184
web/node_modules/webpack-dev-server/client/index.js generated vendored Normal file
View File

@@ -0,0 +1,184 @@
/* global __resourceQuery */
var url = require("url");
var stripAnsi = require("strip-ansi");
var socket = require("./socket");
var overlay = require("./overlay");
function getCurrentScriptSource() {
// `document.currentScript` is the most accurate way to find the current script,
// but is not supported in all browsers.
if(document.currentScript)
return document.currentScript.getAttribute("src");
// Fall back to getting all scripts in the document.
var scriptElements = document.scripts || [];
var currentScript = scriptElements[scriptElements.length - 1];
if(currentScript)
return currentScript.getAttribute("src");
// Fail as there was no script to use.
throw new Error("[WDS] Failed to get current script source");
}
var urlParts;
if(typeof __resourceQuery === "string" && __resourceQuery) {
// If this bundle is inlined, use the resource query to get the correct url.
urlParts = url.parse(__resourceQuery.substr(1));
} else {
// Else, get the url from the <script> this file was called with.
var scriptHost = getCurrentScriptSource();
scriptHost = scriptHost.replace(/\/[^\/]+$/, "");
urlParts = url.parse((scriptHost ? scriptHost : "/"), false, true);
}
var hot = false;
var initial = true;
var currentHash = "";
var logLevel = "info";
var useWarningOverlay = false;
var useErrorOverlay = false;
function log(level, msg) {
if(logLevel === "info" && level === "info")
return console.log(msg);
if(["info", "warning"].indexOf(logLevel) >= 0 && level === "warning")
return console.warn(msg);
if(["info", "warning", "error"].indexOf(logLevel) >= 0 && level === "error")
return console.error(msg);
}
// Send messages to the outside, so plugins can consume it.
function sendMsg(type, data) {
if(typeof self !== "undefined" && self.window) {
self.postMessage({
type: "webpack" + type,
data: data
}, "*");
}
}
var onSocketMsg = {
hot: function() {
hot = true;
log("info", "[WDS] Hot Module Replacement enabled.");
},
invalid: function() {
log("info", "[WDS] App updated. Recompiling...");
sendMsg("Invalid");
},
hash: function(hash) {
currentHash = hash;
},
"still-ok": function() {
log("info", "[WDS] Nothing changed.")
if(useWarningOverlay || useErrorOverlay) overlay.clear();
sendMsg("StillOk");
},
"log-level": function(level) {
logLevel = level;
},
"overlay": function(overlay) {
if(typeof document !== "undefined") {
if(typeof(overlay) === "boolean") {
useWarningOverlay = overlay;
useErrorOverlay = overlay;
} else if(overlay) {
useWarningOverlay = overlay.warnings;
useErrorOverlay = overlay.errors;
}
}
},
ok: function() {
sendMsg("Ok");
if(useWarningOverlay || useErrorOverlay) overlay.clear();
if(initial) return initial = false;
reloadApp();
},
"content-changed": function() {
log("info", "[WDS] Content base changed. Reloading...")
self.location.reload();
},
warnings: function(warnings) {
log("info", "[WDS] Warnings while compiling.");
var strippedWarnings = warnings.map(function(warning) {
return stripAnsi(warning);
});
sendMsg("Warnings", strippedWarnings);
for(var i = 0; i < strippedWarnings.length; i++)
console.warn(strippedWarnings[i]);
if(useWarningOverlay) overlay.showMessage(warnings);
if(initial) return initial = false;
reloadApp();
},
errors: function(errors) {
log("info", "[WDS] Errors while compiling. Reload prevented.");
var strippedErrors = errors.map(function(error) {
return stripAnsi(error);
});
sendMsg("Errors", strippedErrors);
for(var i = 0; i < strippedErrors.length; i++)
console.error(strippedErrors[i]);
if(useErrorOverlay) overlay.showMessage(errors);
},
error: function(error) {
console.error(error);
},
close: function() {
log("error", "[WDS] Disconnected!");
sendMsg("Close");
}
};
var hostname = urlParts.hostname;
var protocol = urlParts.protocol;
//check ipv4 and ipv6 `all hostname`
if(hostname === "0.0.0.0" || hostname === "::") {
// why do we need this check?
// hostname n/a for file protocol (example, when using electron, ionic)
// see: https://github.com/webpack/webpack-dev-server/pull/384
if(self.location.hostname && !!~self.location.protocol.indexOf("http")) {
hostname = self.location.hostname;
}
}
// `hostname` can be empty when the script path is relative. In that case, specifying
// a protocol would result in an invalid URL.
// When https is used in the app, secure websockets are always necessary
// because the browser doesn't accept non-secure websockets.
if(hostname && (self.location.protocol === "https:" || urlParts.hostname === "0.0.0.0")) {
protocol = self.location.protocol;
}
var socketUrl = url.format({
protocol: protocol,
auth: urlParts.auth,
hostname: hostname,
port: (urlParts.port === "0") ? self.location.port : urlParts.port,
pathname: urlParts.path == null || urlParts.path === "/" ? "/sockjs-node" : urlParts.path
});
socket(socketUrl, onSocketMsg);
var isUnloading = false;
self.addEventListener("beforeunload", function() {
isUnloading = true;
});
function reloadApp() {
if(isUnloading) {
return;
}
if(hot) {
log("info", "[WDS] App hot update...");
var hotEmitter = require("webpack/hot/emitter");
hotEmitter.emit("webpackHotUpdate", currentHash);
if(typeof self !== "undefined" && self.window) {
// broadcast update to window
self.postMessage("webpackHotUpdate" + currentHash, "*");
}
} else {
log("info", "[WDS] App updated. Reloading...");
self.location.reload();
}
}

File diff suppressed because one or more lines are too long

1
web/node_modules/webpack-dev-server/client/live.html generated vendored Normal file
View File

@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/><script type="text/javascript" charset="utf-8" src="/__webpack_dev_server__/live.bundle.js"></script></head><body></body></html>

119
web/node_modules/webpack-dev-server/client/live.js generated vendored Normal file
View File

@@ -0,0 +1,119 @@
var $ = require("jquery");
var stripAnsi = require("strip-ansi");
var socket = require("./socket");
require("./style.css");
var hot = false;
var currentHash = "";
$(function() {
$("body").html(require("./page.pug")());
var status = $("#status");
var okness = $("#okness");
var $errors = $("#errors");
var iframe = $("#iframe");
var header = $(".header");
var contentPage = window.location.pathname.substr("/webpack-dev-server".length) + window.location.search;
status.text("Connecting to sockjs server...");
$errors.hide();
iframe.hide();
header.css({
borderColor: "#96b5b4"
});
var onSocketMsg = {
hot: function() {
hot = true;
iframe.attr("src", contentPage + window.location.hash);
},
invalid: function() {
okness.text("");
status.text("App updated. Recompiling...");
header.css({
borderColor: "#96b5b4"
});
$errors.hide();
if(!hot) iframe.hide();
},
hash: function(hash) {
currentHash = hash;
},
"still-ok": function() {
okness.text("");
status.text("App ready.");
header.css({
borderColor: ""
});
$errors.hide();
if(!hot) iframe.show();
},
ok: function() {
okness.text("");
$errors.hide();
reloadApp();
},
warnings: function() {
okness.text("Warnings while compiling.");
$errors.hide();
reloadApp();
},
errors: function(errors) {
status.text("App updated with errors. No reload!");
okness.text("Errors while compiling.");
$errors.text("\n" + stripAnsi(errors.join("\n\n\n")) + "\n\n");
header.css({
borderColor: "#ebcb8b"
});
$errors.show();
iframe.hide();
},
close: function() {
status.text("");
okness.text("Disconnected.");
$errors.text("\n\n\n Lost connection to webpack-dev-server.\n Please restart the server to reestablish connection...\n\n\n\n");
header.css({
borderColor: "#ebcb8b"
});
$errors.show();
iframe.hide();
}
};
socket("/sockjs-node", onSocketMsg);
iframe.load(function() {
status.text("App ready.");
header.css({
borderColor: ""
});
iframe.show();
});
function reloadApp() {
if(hot) {
status.text("App hot update.");
try {
iframe[0].contentWindow.postMessage("webpackHotUpdate" + currentHash, "*");
} catch(e) {
console.warn(e);
}
iframe.show();
} else {
status.text("App updated. Reloading app...");
header.css({
borderColor: "#96b5b4"
});
try {
var old = iframe[0].contentWindow.location + "";
if(old.indexOf("about") == 0) old = null;
iframe.attr("src", old || (contentPage + window.location.hash));
old && iframe[0].contentWindow.location.reload();
} catch(e) {
iframe.attr("src", contentPage + window.location.hash);
}
}
}
});

126
web/node_modules/webpack-dev-server/client/overlay.js generated vendored Normal file
View File

@@ -0,0 +1,126 @@
// 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",
red: "E36049",
green: "B3CB74",
yellow: "FFD080",
blue: "7CAFC2",
magenta: "7FACCA",
cyan: "C3C2EF",
lightgrey: "EBE7E3",
darkgrey: "6D7891"
};
ansiHTML.setColors(colors);
function createOverlayIframe(onIframeLoad) {
var iframe = document.createElement("iframe");
iframe.id = "webpack-dev-server-client-overlay";
iframe.src = "about:blank";
iframe.style.position = "fixed";
iframe.style.left = 0;
iframe.style.top = 0;
iframe.style.right = 0;
iframe.style.bottom = 0;
iframe.style.width = "100vw";
iframe.style.height = "100vh";
iframe.style.border = "none";
iframe.style.zIndex = 9999999999;
iframe.onload = onIframeLoad;
return iframe;
}
function addOverlayDivTo(iframe) {
var div = iframe.contentDocument.createElement("div");
div.id = "webpack-dev-server-client-overlay-div";
div.style.position = "fixed";
div.style.boxSizing = "border-box";
div.style.left = 0;
div.style.top = 0;
div.style.right = 0;
div.style.bottom = 0;
div.style.width = "100vw";
div.style.height = "100vh";
div.style.backgroundColor = "black";
div.style.color = "#E8E8E8";
div.style.fontFamily = "Menlo, Consolas, monospace";
div.style.fontSize = "large";
div.style.padding = "2rem";
div.style.lineHeight = "1.2";
div.style.whiteSpace = "pre-wrap";
div.style.overflow = "auto";
iframe.contentDocument.body.appendChild(div);
return div;
}
var overlayIframe = null;
var overlayDiv = null;
var lastOnOverlayDivReady = null;
function ensureOverlayDivExists(onOverlayDivReady) {
if(overlayDiv) {
// Everything is ready, call the callback right away.
onOverlayDivReady(overlayDiv);
return;
}
// 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.
overlayIframe = createOverlayIframe(function onIframeLoad() {
overlayDiv = addOverlayDivTo(overlayIframe);
// Now we can talk!
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 onOverlayDivReady(overlayDiv) {
// Make it look similar to our terminal.
overlayDiv.innerHTML =
"<span style=\"color: #" +
colors.red +
"\">Failed to compile.</span><br><br>" +
ansiHTML(entities.encode(message));
});
}
function destroyErrorOverlay() {
if(!overlayDiv) {
// It is not there in the first place.
return;
}
// Clean up and reset internal state.
document.body.removeChild(overlayIframe);
overlayDiv = null;
overlayIframe = null;
lastOnOverlayDivReady = null;
}
// Successful compilation.
exports.clear = function handleSuccess() {
destroyErrorOverlay();
}
// Compilation with errors (e.g. syntax error or missing modules).
exports.showMessage = function handleMessage(messages) {
showMessageOverlay(messages[0]);
}

7
web/node_modules/webpack-dev-server/client/page.pug generated vendored Normal file
View File

@@ -0,0 +1,7 @@
.header
span#okness
= " "
span#status
pre#errors
#warnings
iframe#iframe(src="javascript:;" allowfullscreen)

41
web/node_modules/webpack-dev-server/client/socket.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
var SockJS = require("sockjs-client");
var retries = 0;
var sock = null;
function socket(url, handlers) {
sock = new SockJS(url);
sock.onopen = function() {
retries = 0;
}
sock.onclose = function() {
if(retries === 0)
handlers.close();
// Try to reconnect.
sock = null;
// After 10 retries stop trying, to prevent logspam.
if(retries <= 10) {
// Exponentially increase timeout to reconnect.
// Respectfully copied from the package `got`.
var retryInMs = 1000 * Math.pow(2, retries) + Math.random() * 100;
retries += 1;
setTimeout(function() {
socket(url, handlers);
}, retryInMs);
}
};
sock.onmessage = function(e) {
// This assumes that all data sent via the websocket is JSON.
var msg = JSON.parse(e.data);
if(handlers[msg.type])
handlers[msg.type](msg.data);
};
}
module.exports = socket;

File diff suppressed because one or more lines are too long

1
web/node_modules/webpack-dev-server/client/sockjs.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require("sockjs-client");

58
web/node_modules/webpack-dev-server/client/style.css generated vendored Normal file
View File

@@ -0,0 +1,58 @@
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body,
html {
margin: 0;
padding: 0;
height: 100%;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.header {
width: 100%;
height: 30px;
padding: 0 10px;
border-left: 10px solid #a3be8c;
font-size: 12px;
line-height: 30px;
color: #eff1f5;
background: #343d46;
overflow: hidden;
}
#iframe {
position: absolute;
top: 30px;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: -webkit-calc(100% - 30px);
height: -moz-calc(100% - 30px);
height: -ms-calc(100% - 30px);
height: -o-calc(100% - 30px);
height: calc(100% - 30px);
border: 0;
}
#errors {
width: 100%;
margin: 0;
padding: 10px;
font-family: monospace;
font-size: 14px;
line-height: 1.4;
color: #eff1f5;
background: #bf616a;
overflow: auto;
}
#okness {
font-weight: bold;
}

View File

@@ -0,0 +1,2 @@
require("./jquery-1.8.1");
module.exports = jQuery;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
module.exports = {
module: {
rules: [
{
test: /\.pug$/,
use: [
"pug-loader?self",
]
},
{
test: /\.css$/,
use: [
"style-loader",
"css-loader"
],
}
]
}
};

View File

@@ -0,0 +1,6 @@
module.exports = {
output: {
library: "SockJS",
libraryTarget: "umd"
}
}