From 34080c56ff59f27cdc29ffce969e8d2ce5edcdf2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 19 Mar 2018 14:15:38 -0400 Subject: Use requirejs to load JS modules; use yarn to get requirejs --- public-src/3rd-party/.gitignore | 2 ++ public-src/3rd-party/package.json | 5 +++++ public-src/3rd-party/yarn.lock | 7 +++++++ public-src/index.html.gen | 26 +++++++++----------------- public-src/main.js | 5 +++++ public-src/require.config.js | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 public-src/3rd-party/.gitignore create mode 100644 public-src/3rd-party/package.json create mode 100644 public-src/3rd-party/yarn.lock create mode 100644 public-src/main.js create mode 100644 public-src/require.config.js (limited to 'public-src') diff --git a/public-src/3rd-party/.gitignore b/public-src/3rd-party/.gitignore new file mode 100644 index 0000000..33c63bb --- /dev/null +++ b/public-src/3rd-party/.gitignore @@ -0,0 +1,2 @@ +/yarn/ +/yarn.LICENSES.txt 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 ' Dashboard - + + - - - - - - - - - - - - - + + + - - - + + + + ' 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", + }, +}; -- cgit v1.2.3-2-g168b