summaryrefslogtreecommitdiff
path: root/public-src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-03-19 14:15:38 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-03-19 18:09:13 -0400
commit60fd3a9845987713e9f0971e2eabfe847c68ff57 (patch)
tree4646dcac132b5348eba302fa4d13f5159960875f /public-src
parente83d7d8f474ed93bf11e7f595056f7f6c0a6e923 (diff)
Use requirejs to load JS modules; use yarn to get requirejs
Diffstat (limited to 'public-src')
-rw-r--r--public-src/3rd-party/.gitignore3
-rw-r--r--public-src/3rd-party/package.json5
-rw-r--r--public-src/3rd-party/yarn.lock7
-rwxr-xr-xpublic-src/index.html.gen26
-rw-r--r--public-src/main.js5
-rw-r--r--public-src/require.config.js39
6 files changed, 68 insertions, 17 deletions
diff --git a/public-src/3rd-party/.gitignore b/public-src/3rd-party/.gitignore
new file mode 100644
index 0000000..4574e17
--- /dev/null
+++ b/public-src/3rd-party/.gitignore
@@ -0,0 +1,3 @@
+/yarn/
+/yarn.LICENSES.txt
+*.log
diff --git a/public-src/3rd-party/package.json b/public-src/3rd-party/package.json
new file mode 100644
index 0000000..d3ea028
--- /dev/null
+++ b/public-src/3rd-party/package.json
@@ -0,0 +1,5 @@
+{
+ "dependencies": {
+ "requirejs": "^2.3.5"
+ }
+}
diff --git a/public-src/3rd-party/yarn.lock b/public-src/3rd-party/yarn.lock
new file mode 100644
index 0000000..96c4650
--- /dev/null
+++ b/public-src/3rd-party/yarn.lock
@@ -0,0 +1,7 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+requirejs@^2.3.5:
+ version "2.3.5"
+ resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0"
diff --git a/public-src/index.html.gen b/public-src/index.html.gen
index be6c6d8..dfb2e34 100755
--- a/public-src/index.html.gen
+++ b/public-src/index.html.gen
@@ -13,27 +13,19 @@ echo '<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Dashboard</title>
- <link rel=stylesheet href=style.css>
+
+ <!-- Scripts: DHTML (run before DOMContentLoaded) -->
<script src="sorttable.js"></script>
<script src="colordate.js"></script>
- <link rel="stylesheet" type="text/css" href="jarmon-style/style.css" />
- <link rel="stylesheet" type="text/css" href="jarmon-style/jquerytools.tabs.tabs-no-images.css" />
-
- <!--<script src="jarmon-dependencies.js"></script>-->
- <script src="./jarmon-dependencies/jquery-1.6.3.js"></script>
- <script src="./jarmon-dependencies/flot-0.8.3/jquery.flot.js"></script>
- <script src="./jarmon-dependencies/flot-0.8.3/jquery.flot.time.js"></script>
- <script src="./jarmon-dependencies/flot-0.8.3/jquery.flot.stack.js"></script>
- <script src="./jarmon-dependencies/flot-0.8.3/jquery.flot.selection.js"></script>
- <script src="./jarmon-dependencies/javascriptrrd-1.1.1/rrdFile.js"></script>
- <script src="./jarmon-dependencies/javascriptrrd-1.1.1/binaryXHR.js"></script>
- <script src="./jarmon-dependencies/jquerytools-8ac4636a01d3860f1c4726ba722190a531bf1068/tabs.js"></script>
- <script src="./jarmon-dependencies/jquerytools-8ac4636a01d3860f1c4726ba722190a531bf1068/toolbox.history.js"></script>
+ <!-- Scripts: Modules (run asynchronously after DOMContentLoaded) -->
+ <script src="./require.config.js"></script>
+ <script src="./3rd-party/yarn/requirejs/require.js" data-main="main"></script>
- <script src="jarmon.js"></script>
- <script src="cfg/jarmon-proton.js"></script>
- <script src="cfg/jarmon-winston.js"></script>
+ <!-- CSS -->
+ <link rel="stylesheet" href="style.css">
+ <link rel="stylesheet" href="jarmon-style/style.css" />
+ <link rel="stylesheet" href="jarmon-style/jquerytools.tabs.tabs-no-images.css" />
</head>
<body>'
col sed 's/@name@/proton/' jarmon.html.in
diff --git a/public-src/main.js b/public-src/main.js
new file mode 100644
index 0000000..ebb09a9
--- /dev/null
+++ b/public-src/main.js
@@ -0,0 +1,5 @@
+define([
+ //'jquerytools/dateinput',
+ 'cfg/jarmon-winston',
+ 'cfg/jarmon-proton',
+], {});
diff --git a/public-src/require.config.js b/public-src/require.config.js
new file mode 100644
index 0000000..bb48fd7
--- /dev/null
+++ b/public-src/require.config.js
@@ -0,0 +1,39 @@
+var require = {
+ baseUrl: "/",
+ shim: {
+ "jarmon": {
+ deps: [
+ "javascriptrrd/rrdFile", // ~1.1
+ "javascriptrrd/binaryXHR", // ~1.1
+ "jquery", // ^1.6.3
+ "flot/jquery.flot.stack", // >= 0.7
+ "flot/jquery.flot.time", // split in to a plugin in >=0.8.0
+ "flot/jquery.flot.selection", // split in to a plugin in >= 0.6
+ "jquerytools/tabs",
+ "jquerytools/toolbox.history",
+ ],
+ exports: "jarmon"
+ },
+ // jQuery plugins
+ "jquerytools/tabs" : { deps: ["jquery"], exports: "jQuery.tools.tabs" },
+ "jquerytools/toolbox.history" : { deps: ["jquery"], exports: "jQuery.tools.history" },
+ "flot/jquery.flot" : { deps: ["jquery"], exports: "jQuery.plot" },
+ // Flot plugins
+ "flot/jquery.flot.time" : { deps: ["flot/jquery.flot"] },
+ "flot/jquery.flot.selection" : { deps: ["flot/jquery.flot"] },
+ "flot/jquery.flot.stack" : { deps: ["flot/jquery.flot"] },
+ // Jarmon configs
+ "cfg/jarmon-winston": { deps: ["jquery", "jarmon"] },
+ "cfg/jarmon-proton": { deps: ["jquery", "jarmon"] },
+ },
+ paths: {
+ //"jquery" : "3rd-party/yarn/jquery/dist/jquery",
+ //"flot" : "3rd-party/yarn/flot",
+ "requirejs" : "3rd-party/yarn/requirejs/require",
+
+ "flot" : "jarmon-dependencies/flot-0.8.3",
+ "javascriptrrd" : "jarmon-dependencies/javascriptrrd-1.1.1",
+ "jquery" : "jarmon-dependencies/jquery-1.6.3",
+ "jquerytools" : "jarmon-dependencies/jquerytools-8ac4636a01d3860f1c4726ba722190a531bf1068",
+ },
+};