handle most dependencies using requirejs
This commit is contained in:
parent
ca8992b07a
commit
5651c605de
21
app.js
Normal file
21
app.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
require.config({
|
||||||
|
urlArgs: "bust=" + (new Date()).getTime(),
|
||||||
|
baseUrl: "lib",
|
||||||
|
paths: {
|
||||||
|
"leaflet": "../bower_components/leaflet/dist/leaflet",
|
||||||
|
"leaflet.label": "../bower_components/Leaflet.label/dist/leaflet.label",
|
||||||
|
"chroma-js": "../bower_components/chroma-js/chroma.min",
|
||||||
|
"moment": "../bower_components/moment/min/moment-with-locales.min",
|
||||||
|
"tablesort": "../bower_components/tablesort/tablesort.min",
|
||||||
|
"tablesort.numeric": "../bower_components/tablesort/src/sorts/tablesort.numeric"
|
||||||
|
},
|
||||||
|
shim: {
|
||||||
|
"leaflet.label": ["leaflet"],
|
||||||
|
"tablesort": {
|
||||||
|
exports: "Tablesort"
|
||||||
|
},
|
||||||
|
"tablesort.numeric": ["tablesort"]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
require(["main"])
|
@ -9,15 +9,9 @@
|
|||||||
<link rel="stylesheet" href="bower_components/ionicons/css/ionicons.min.css">
|
<link rel="stylesheet" href="bower_components/ionicons/css/ionicons.min.css">
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<script src="bower_components/es6-shim/es6-shim.min.js"></script>
|
<script src="bower_components/es6-shim/es6-shim.min.js"></script>
|
||||||
<script src="bower_components/chroma-js/chroma.min.js"></script>
|
|
||||||
<script src="bower_components/moment/min/moment-with-locales.min.js"></script>
|
|
||||||
<script src="bower_components/leaflet/dist/leaflet.js"></script>
|
|
||||||
<script src="bower_components/Leaflet.label/dist/leaflet.label.js"></script>
|
|
||||||
<script src="bower_components/tablesort/tablesort.min.js"></script>
|
|
||||||
<script src="bower_components/tablesort/src/sorts/tablesort.numeric.js"></script>
|
|
||||||
<script src="bower_components/intl/Intl.complete.js"></script>
|
<script src="bower_components/intl/Intl.complete.js"></script>
|
||||||
<script src="helper.js"></script>
|
<script src="helper.js"></script>
|
||||||
<script src="bower_components/requirejs/require.js" data-main="lib/main"></script>
|
<script src="bower_components/requirejs/require.js" data-main="app"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(function () {
|
define(["moment", "tablesort", "tablesort.numeric"], function (moment, Tablesort) {
|
||||||
return function(config, el, router, d) {
|
return function(config, el, router, d) {
|
||||||
var h2 = document.createElement("h2")
|
var h2 = document.createElement("h2")
|
||||||
h2.textContent = d.nodeinfo.hostname
|
h2.textContent = d.nodeinfo.hostname
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(function () {
|
define(["tablesort", "tablesort.numeric"], function (Tablesort) {
|
||||||
return function(linkScale, router) {
|
return function(linkScale, router) {
|
||||||
var self = this
|
var self = this
|
||||||
var el
|
var el
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
require(["config", "router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "nodelist", "simplenodelist", "infobox/main"],
|
require(["config", "moment", "chroma-js", "router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "nodelist", "simplenodelist", "infobox/main"],
|
||||||
function (Config, Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, Nodelist, SimpleNodelist, Infobox) {
|
function (Config, moment, chroma, Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, Nodelist, SimpleNodelist, Infobox) {
|
||||||
main(Config)
|
main(Config)
|
||||||
|
|
||||||
function main(config) {
|
function main(config) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(function () {
|
define(["leaflet", "moment", "leaflet.label"], function (L, moment) {
|
||||||
var options = { worldCopyJump: true,
|
var options = { worldCopyJump: true,
|
||||||
zoomControl: false
|
zoomControl: false
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(function () {
|
define(["moment"], function (moment) {
|
||||||
return function () {
|
return function () {
|
||||||
var self = this
|
var self = this
|
||||||
var p
|
var p
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(function () {
|
define(["tablesort", "tablesort.numeric"], function (Tablesort) {
|
||||||
return function(router) {
|
return function(router) {
|
||||||
var self = this
|
var self = this
|
||||||
var el
|
var el
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define(function () {
|
define(["moment"], function (moment) {
|
||||||
return function(config, field, router, title) {
|
return function(config, field, router, title) {
|
||||||
var self = this
|
var self = this
|
||||||
var el
|
var el
|
||||||
|
Loading…
Reference in New Issue
Block a user