Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed06ff6b09 | ||
|
|
6175d6bb7a | ||
|
|
931ca67fc2 | ||
|
|
340c1d9a53 | ||
|
|
ae59f75594 | ||
|
|
d57ce0052a | ||
|
|
894f32da54 | ||
|
|
a8c19ba44c | ||
|
|
a627e2febc | ||
|
|
e32fe6648d | ||
|
|
a2ab0dce4f | ||
|
|
90d2c3e444 | ||
|
|
a56876a10e | ||
|
|
2d5e35324a | ||
|
|
28de7c5403 | ||
|
|
2630b6197d | ||
|
|
62d64c717c | ||
|
|
5691406d09 | ||
|
|
e80f7d899d | ||
|
|
292c5c020c | ||
|
|
58279ac213 | ||
|
|
6f4b9d6701 | ||
|
|
e9e393e105 | ||
|
|
5921a5f355 | ||
|
|
c9458ffcae | ||
|
|
c7b58d5743 | ||
|
|
7389547e3e | ||
|
|
6aec0b21a8 | ||
|
|
04eb8f039b | ||
|
|
0abd4130cf | ||
|
|
418b630e02 | ||
|
|
59ba0ba29e |
82 changed files with 4580 additions and 7427 deletions
|
|
@ -11,6 +11,6 @@ trim_trailing_whitespace = true
|
|||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{js,html,scss,json}]
|
||||
[*.{js,html,scss,json,yml,md}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@ node_modules/
|
|||
build/
|
||||
.sass-cache/
|
||||
config.json
|
||||
.idea/
|
||||
.eslintrc
|
||||
|
|
|
|||
3
.sass-lint.yml
Normal file
3
.sass-lint.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
rules:
|
||||
no-color-literals: 0
|
||||
single-line-per-selector: 0
|
||||
10
.travis.yml
10
.travis.yml
|
|
@ -1,7 +1,7 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "lts/*"
|
||||
- "node"
|
||||
before_install:
|
||||
- gem install sass
|
||||
- npm install -g grunt-cli
|
||||
install:
|
||||
- yarn
|
||||
script: node_modules/.bin/grunt
|
||||
- npm install
|
||||
script: grunt
|
||||
|
|
|
|||
27
Gruntfile.js
27
Gruntfile.js
|
|
@ -1,24 +1,11 @@
|
|||
module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks("grunt-git-describe")
|
||||
"use strict";
|
||||
|
||||
grunt.initConfig({
|
||||
"git-describe": {
|
||||
options: {},
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
grunt.loadTasks("tasks");
|
||||
|
||||
grunt.registerTask("saveRevision", function() {
|
||||
grunt.event.once("git-describe", function (rev) {
|
||||
grunt.option("gitRevision", rev)
|
||||
})
|
||||
grunt.task.run("git-describe")
|
||||
})
|
||||
|
||||
grunt.loadTasks("tasks")
|
||||
|
||||
grunt.registerTask("default", ["lint", "saveRevision", "copy", "sass", "postcss", "requirejs"])
|
||||
grunt.registerTask("lint", ["eslint"])
|
||||
grunt.registerTask("dev", ["default", "connect:server", "watch"])
|
||||
}
|
||||
grunt.registerTask("default", ["bower-install-simple", "lint", "copy", "sass", "postcss", "requirejs:default", "inline"]);
|
||||
grunt.registerTask("lint", ["sasslint", "eslint"]);
|
||||
grunt.registerTask("dev", ["bower-install-simple", "lint", "copy", "sass", "requirejs:dev"]);
|
||||
grunt.registerTask("serve", ["dev", "connect:server", "watch"]);
|
||||
};
|
||||
|
||||
|
|
|
|||
38
README.md
38
README.md
|
|
@ -1,8 +1,8 @@
|
|||
[](https://travis-ci.org/hopglass/hopglass)
|
||||
[](https://travis-ci.org/plumpudding/hopglass)
|
||||
|
||||
# HopGlass
|
||||
|
||||
HopGlass is a frontend for the [HopGlass Server](https://github.com/hopglass/hopglass-server).
|
||||
HopGlass is a frontend for the [HopGlass Server](https://github.com/plumpudding/hopglass-server).
|
||||
|
||||
# Screenshots
|
||||
|
||||
|
|
@ -14,32 +14,29 @@ HopGlass is a frontend for the [HopGlass Server](https://github.com/hopglass/hop
|
|||
|
||||
# Dependencies
|
||||
|
||||
- NodeJS
|
||||
- yarn (recommended) or npm
|
||||
- npm
|
||||
- bower
|
||||
- grunt-cli
|
||||
- Sass (>= 3.2)
|
||||
|
||||
# Installing dependencies
|
||||
|
||||
Install npm package-manager. On Debian-like systems run:
|
||||
|
||||
sudo apt-get install nodejs
|
||||
sudo apt-get install npm
|
||||
|
||||
**Note:** The official Debian packages for NodeJS are quite old, you might want to check at [NodeSource](https://github.com/nodesource/distributions/blob/master/README.md) for current binaries installable with your distribution's package manager.
|
||||
|
||||
On Mac you can install nodejs and yarn via brew:
|
||||
On Mac you have to install only npm via brew and sass
|
||||
|
||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||
brew install node
|
||||
brew install yarn
|
||||
|
||||
On Arch Linux you can install nodejs and yarn via pacman:
|
||||
|
||||
sudo pacman -S nodejs yarn
|
||||
npm install node-sass
|
||||
|
||||
Execute these commands on your server as a normal user to prepare the dependencies:
|
||||
|
||||
git clone https://github.com/hopglass/hopglass
|
||||
git clone https://github.com/plumpudding/hopglass
|
||||
cd hopglass
|
||||
yarn install # or `npm install`
|
||||
npm install
|
||||
npm install grunt-cli
|
||||
|
||||
# Building
|
||||
|
||||
|
|
@ -49,13 +46,22 @@ Just run the following command from the hopglass directory:
|
|||
|
||||
This will generate `build/` containing all required files.
|
||||
|
||||
## Development
|
||||
|
||||
Use `grunt serve` for development.
|
||||
|
||||
# Configure
|
||||
|
||||
Copy `config.json.example` to `build/config.json` and change it to match your community.
|
||||
|
||||
|
||||
## Customize style
|
||||
|
||||
Start your development and edit files in `scss/custom/`. Additional information in comments.
|
||||
|
||||
## dataPath (string/array)
|
||||
|
||||
`dataPath` can be either a string containing the address of a [HopGlass Server](https://github.com/hopglass/hopglass-server) or an array containing multiple addresses.
|
||||
`dataPath` can be either a string containing the address of a [HopGlass Server](https://github.com/plumpudding/hopglass-server) or an array containing multiple addresses.
|
||||
Don't forget the trailing slash!
|
||||
Also, proxying the data through a webserver will allow GZip and thus will greatly reduce bandwidth consumption.
|
||||
It may help with firewall problems too.
|
||||
|
|
|
|||
44
app.js
44
app.js
|
|
@ -1,36 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
require.config({
|
||||
baseUrl: "lib",
|
||||
paths: {
|
||||
"leaflet": "../node_modules/leaflet/dist/leaflet",
|
||||
"leaflet.label": "../node_modules/leaflet-label/dist/leaflet.label",
|
||||
"leaflet.providers": "../node_modules/leaflet-providers/leaflet-providers",
|
||||
"chroma-js": "../node_modules/chroma-js/chroma.min",
|
||||
"moment": "../node_modules/moment/min/moment-with-locales.min",
|
||||
"tablesort": "../node_modules/tablesort/tablesort.min",
|
||||
"tablesort.numeric": "../node_modules/tablesort/src/sorts/tablesort.numeric",
|
||||
"d3": "../node_modules/d3/d3.min",
|
||||
"numeral": "../node_modules/numeraljs/min/numeral.min",
|
||||
"numeral-intl": "../node_modules/numeraljs/min/languages.min",
|
||||
"virtual-dom": "../node_modules/virtual-dom/dist/virtual-dom",
|
||||
"rbush": "../node_modules/rbush/rbush",
|
||||
"helper": "../helper",
|
||||
"jshashes": "../node_modules/jshashes/hashes"
|
||||
"leaflet": "../bower_components/leaflet/dist/leaflet",
|
||||
"leaflet.label": "../bower_components/Leaflet.label/dist/leaflet.label",
|
||||
"leaflet.providers": "../bower_components/leaflet-providers/leaflet-providers",
|
||||
"chroma-js": "../bower_components/chroma-js/chroma.min",
|
||||
"moment": "../bower_components/moment/min/moment.min",
|
||||
"moment.de": "../bower_components/moment/locale/de",
|
||||
"tablesort": "../bower_components/tablesort/src/tablesort",
|
||||
"d3": "../bower_components/d3/d3.min",
|
||||
"virtual-dom": "../bower_components/virtual-dom/dist/virtual-dom",
|
||||
"rbush": "../bower_components/rbush/rbush",
|
||||
"helper": "utils/helper"
|
||||
},
|
||||
shim: {
|
||||
"leaflet.label": ["leaflet"],
|
||||
"leaflet.providers": ["leaflet"],
|
||||
"moment.de": ["moment"],
|
||||
"tablesort": {
|
||||
exports: "Tablesort"
|
||||
},
|
||||
"numeral-intl": {
|
||||
deps: ["numeral"],
|
||||
exports: "numeral"
|
||||
},
|
||||
"tablesort.numeric": ["tablesort"],
|
||||
"helper": ["numeral-intl"]
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
require(["main", "helper"], function (main) {
|
||||
getJSON("config.json").then(main)
|
||||
})
|
||||
require(["main", "helper"], function (main, helper) {
|
||||
helper.getJSON("config.json").then(main);
|
||||
});
|
||||
|
|
|
|||
7
assets/icons/_icon-mixin.scss
Normal file
7
assets/icons/_icon-mixin.scss
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@mixin icon($name, $code, $prefix: 'ion-') {
|
||||
.#{$prefix}#{$name} {
|
||||
&:before {
|
||||
content: '#{$code}';
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
assets/icons/fonts/icon.ttf
Normal file
BIN
assets/icons/fonts/icon.ttf
Normal file
Binary file not shown.
BIN
assets/icons/fonts/icon.woff
Normal file
BIN
assets/icons/fonts/icon.woff
Normal file
Binary file not shown.
BIN
assets/icons/fonts/icon.woff2
Normal file
BIN
assets/icons/fonts/icon.woff2
Normal file
Binary file not shown.
45
assets/icons/icon.scss
Normal file
45
assets/icons/icon.scss
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// Needed for standalone scss
|
||||
// @import 'icon-mixin';
|
||||
|
||||
@font-face {
|
||||
font-family: 'ionicons';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: url('fonts/icon.woff2') format('woff2'),
|
||||
url('fonts/icon.woff') format('woff'),
|
||||
url('fonts/icon.ttf') format('truetype');
|
||||
}
|
||||
|
||||
[class^='ion-'], [class*=' ion-'] {
|
||||
&:before {
|
||||
display: inline-block;
|
||||
font-family: $font-family-icons;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
speak: none;
|
||||
text-rendering: auto;
|
||||
text-transform: none;
|
||||
vertical-align: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@include icon('android-add', '\f2c7');
|
||||
@include icon('chevron-left', '\f124');
|
||||
@include icon('chevron-right', '\f125');
|
||||
@include icon('pin', '\f3a3');
|
||||
@include icon('wifi', '\f25c');
|
||||
@include icon('eye', '\f133');
|
||||
@include icon('ios-arrow-thin-left', '\f3d5');
|
||||
@include icon('ios-arrow-thin-right', '\f3d6');
|
||||
@include icon('arrow-up-b', '\f10d');
|
||||
@include icon('arrow-down-b', '\f104');
|
||||
@include icon('android-locate', '\f2e9');
|
||||
@include icon('android-close', '\f2d7');
|
||||
@include icon('android-lock', '\f392');
|
||||
@include icon('ios-copy', '\f41c');
|
||||
@include icon('location', '\f456');
|
||||
@include icon('android-remove', '\f2f4');
|
||||
@include icon('ios-person', '\f47e');
|
||||
@include icon('layer', '\f229');
|
||||
32
bower.json
Normal file
32
bower.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "hopglass",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"**/.*",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"Leaflet.label": "~0.2.1",
|
||||
"chroma-js": "~1.1.1",
|
||||
"leaflet": "~0.7.7",
|
||||
"moment": "~2.13.0",
|
||||
"requirejs": "~2.2.0",
|
||||
"tablesort": "https://github.com/tristen/tablesort.git#v4.0.1",
|
||||
"roboto-slab-fontface": "*",
|
||||
"es6-shim": "~0.35.1",
|
||||
"almond": "~0.3.2",
|
||||
"d3": "~3.5.17",
|
||||
"roboto-fontface": "~0.4.5",
|
||||
"virtual-dom": "~2.1.1",
|
||||
"leaflet-providers": "~1.1.10",
|
||||
"rbush": "https://github.com/mourner/rbush.git#~1.4.3"
|
||||
},
|
||||
"authors": [
|
||||
"Milan Pässler <me@petabyteboy.de>",
|
||||
"Nils Schneider <nils@nilsschneider.net>"
|
||||
],
|
||||
"license": "AGPL3",
|
||||
"private": true
|
||||
}
|
||||
9
build.js
9
build.js
|
|
@ -1,9 +0,0 @@
|
|||
({
|
||||
baseUrl: "lib",
|
||||
name: "../node_modules/almond/almond",
|
||||
mainConfigFile: "app.js",
|
||||
include: "../app",
|
||||
wrap: true,
|
||||
optimize: "uglify",
|
||||
out: "app-combined.js"
|
||||
})
|
||||
|
|
@ -5,25 +5,11 @@
|
|||
"showContact": true,
|
||||
"maxAge": 14,
|
||||
"mapLayers": [
|
||||
{ "name": "CartoDB",
|
||||
"url": "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png",
|
||||
"config": {
|
||||
"maxZoom": 18,
|
||||
"attribution": "© <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>, © | <a href=\"https://carto.com/attribution\">CARTO</a>"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "OpenStreetMap.HOT"
|
||||
},
|
||||
{
|
||||
"name": "Luftbilder NRW",
|
||||
"url": "https://www.wms.nrw.de/geobasis/wms_nw_dop?",
|
||||
"config": {
|
||||
"maxZoom": 20,
|
||||
"attribution": "<a href=\"http://www.bezreg-koeln.nrw.de/brk_internet/geobasis/luftbilderzeugnisse/digitale_orthophotos/index.html\">DOP20</a>, Land NRW (2017), Datenlizenz Deutschland - Namensnennung - Version 2.0 (<a href=\"https://www.govdata.de/dl-de/by-2-0\">www.govdata.de/dl-de/by-2-0</a>)",
|
||||
"format": "image/jpeg",
|
||||
"layers": "nw_dop_rgb"
|
||||
}
|
||||
"name": "Stamen.TonerLite"
|
||||
}
|
||||
],
|
||||
"nodeInfos": [
|
||||
|
|
|
|||
249
helper.js
249
helper.js
|
|
@ -1,228 +1,241 @@
|
|||
function get(url) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var req = new XMLHttpRequest()
|
||||
req.open('GET', url)
|
||||
return new Promise(function (resolve, reject) {
|
||||
var req = new XMLHttpRequest();
|
||||
req.open('GET', url);
|
||||
|
||||
req.onload = function() {
|
||||
req.onload = function () {
|
||||
if (req.status == 200) {
|
||||
resolve(req.response)
|
||||
resolve(req.response);
|
||||
}
|
||||
else {
|
||||
reject(Error(req.statusText))
|
||||
reject(Error(req.statusText));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
req.onerror = function() {
|
||||
reject(Error("Network Error"))
|
||||
}
|
||||
req.onerror = function () {
|
||||
reject(Error("Network Error"));
|
||||
};
|
||||
|
||||
req.send()
|
||||
})
|
||||
req.send();
|
||||
});
|
||||
}
|
||||
|
||||
function getJSON(url) {
|
||||
return get(url).then(JSON.parse)
|
||||
return get(url).then(JSON.parse);
|
||||
}
|
||||
|
||||
function sortByKey(key, d) {
|
||||
return d.slice().sort( function (a, b) {
|
||||
return a[key] - b[key]
|
||||
}).reverse()
|
||||
return d.slice().sort(function (a, b) {
|
||||
return a[key] - b[key];
|
||||
}).reverse();
|
||||
}
|
||||
|
||||
function limit(key, m, d) {
|
||||
return d.filter( function (d) {
|
||||
return d[key].isAfter(m)
|
||||
})
|
||||
return d.filter(function (d) {
|
||||
return d[key].isAfter(m);
|
||||
});
|
||||
}
|
||||
|
||||
function sum(a) {
|
||||
return a.reduce( function (a, b) {
|
||||
return a + b
|
||||
}, 0)
|
||||
return a.reduce(function (a, b) {
|
||||
return a + b;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function one() {
|
||||
return 1
|
||||
return 1;
|
||||
}
|
||||
|
||||
function trueDefault(d) {
|
||||
return d === undefined ? true : d
|
||||
return d === undefined ? true : d;
|
||||
}
|
||||
|
||||
function dictGet(dict, key) {
|
||||
var k = key.shift()
|
||||
var k = key.shift();
|
||||
|
||||
if (!(k in dict))
|
||||
return null
|
||||
if (!(k in dict)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (key.length == 0)
|
||||
return dict[k]
|
||||
if (key.length == 0) {
|
||||
return dict[k];
|
||||
}
|
||||
|
||||
return dictGet(dict[k], key)
|
||||
return dictGet(dict[k], key);
|
||||
}
|
||||
|
||||
function localStorageTest() {
|
||||
var test = 'test'
|
||||
var test = 'test';
|
||||
try {
|
||||
localStorage.setItem(test, test)
|
||||
localStorage.removeItem(test)
|
||||
return true
|
||||
} catch(e) {
|
||||
return false
|
||||
localStorage.setItem(test, test);
|
||||
localStorage.removeItem(test);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function listReplace(s, subst) {
|
||||
for (key in subst) {
|
||||
var re = new RegExp(key, 'g')
|
||||
s = s.replace(re, subst[key])
|
||||
var re = new RegExp(key, 'g');
|
||||
s = s.replace(re, subst[key]);
|
||||
}
|
||||
return s
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Helpers working with nodes */
|
||||
|
||||
function offline(d) {
|
||||
return !d.flags.online
|
||||
return !d.flags.online;
|
||||
}
|
||||
|
||||
function online(d) {
|
||||
return d.flags.online
|
||||
return d.flags.online;
|
||||
}
|
||||
|
||||
function has_location(d) {
|
||||
return "location" in d.nodeinfo &&
|
||||
Math.abs(d.nodeinfo.location.latitude) < 90 &&
|
||||
Math.abs(d.nodeinfo.location.longitude) < 180
|
||||
Math.abs(d.nodeinfo.location.latitude) < 90 &&
|
||||
Math.abs(d.nodeinfo.location.longitude) < 180;
|
||||
}
|
||||
|
||||
function subtract(a, b) {
|
||||
var ids = {}
|
||||
var ids = {};
|
||||
|
||||
b.forEach( function (d) {
|
||||
ids[d.nodeinfo.node_id] = true
|
||||
})
|
||||
b.forEach(function (d) {
|
||||
ids[d.nodeinfo.node_id] = true;
|
||||
});
|
||||
|
||||
return a.filter( function (d) {
|
||||
return !(d.nodeinfo.node_id in ids)
|
||||
})
|
||||
return a.filter(function (d) {
|
||||
return !(d.nodeinfo.node_id in ids);
|
||||
});
|
||||
}
|
||||
|
||||
/* Helpers working with links */
|
||||
|
||||
function showDistance(d) {
|
||||
if (isNaN(d.distance))
|
||||
return
|
||||
if (isNaN(d.distance)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return numeral(d.distance).format("0,0") + " m"
|
||||
return d.distance.toFixed(0) + " m"
|
||||
}
|
||||
|
||||
function showTq(d) {
|
||||
return numeral(1/d.tq).format("0%")
|
||||
return (1 / d.tq * 100).toFixed(0) + "%"
|
||||
}
|
||||
|
||||
/* Infobox stuff (XXX: move to module) */
|
||||
|
||||
function attributeEntry(el, label, value) {
|
||||
if (value === null || value == undefined)
|
||||
return
|
||||
|
||||
var tr = document.createElement("tr")
|
||||
var th = document.createElement("th")
|
||||
if (typeof label === "string")
|
||||
th.textContent = label
|
||||
else {
|
||||
th.appendChild(label)
|
||||
tr.className = "routerpic"
|
||||
if (value === null || value == undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
tr.appendChild(th)
|
||||
var tr = document.createElement("tr");
|
||||
var th = document.createElement("th");
|
||||
if (typeof label === "string") {
|
||||
th.textContent = label;
|
||||
} else {
|
||||
th.appendChild(label);
|
||||
tr.className = "routerpic";
|
||||
}
|
||||
|
||||
var td = document.createElement("td")
|
||||
tr.appendChild(th);
|
||||
|
||||
if (typeof value == "function")
|
||||
value(td)
|
||||
else
|
||||
td.appendChild(document.createTextNode(value))
|
||||
var td = document.createElement("td");
|
||||
|
||||
tr.appendChild(td)
|
||||
if (typeof value == "function") {
|
||||
value(td);
|
||||
} else {
|
||||
td.appendChild(document.createTextNode(value));
|
||||
}
|
||||
|
||||
el.appendChild(tr)
|
||||
tr.appendChild(td);
|
||||
|
||||
return td
|
||||
el.appendChild(tr);
|
||||
|
||||
return td;
|
||||
}
|
||||
|
||||
function createIframe(opt, width, height) {
|
||||
el = document.createElement("iframe")
|
||||
width = typeof width !== 'undefined' ? width : '100%'
|
||||
height = typeof height !== 'undefined' ? height : '350px'
|
||||
el = document.createElement("iframe");
|
||||
width = typeof width !== 'undefined' ? width : '100%';
|
||||
height = typeof height !== 'undefined' ? height : '350px';
|
||||
|
||||
if (opt.src)
|
||||
el.src = opt.src
|
||||
else
|
||||
el.src = opt
|
||||
if (opt.src) {
|
||||
el.src = opt.src;
|
||||
} else {
|
||||
el.src = opt;
|
||||
}
|
||||
|
||||
if (opt.frameBorder)
|
||||
el.frameBorder = opt.frameBorder
|
||||
else
|
||||
el.frameBorder = 1
|
||||
if (opt.frameBorder) {
|
||||
el.frameBorder = opt.frameBorder;
|
||||
} else {
|
||||
el.frameBorder = 1;
|
||||
}
|
||||
|
||||
if (opt.width)
|
||||
el.width = opt.width
|
||||
else
|
||||
el.width = width
|
||||
if (opt.width) {
|
||||
el.width = opt.width;
|
||||
} else {
|
||||
el.width = width;
|
||||
}
|
||||
|
||||
if (opt.height)
|
||||
el.height = opt.height
|
||||
else
|
||||
el.height = height
|
||||
if (opt.height) {
|
||||
el.height = opt.height;
|
||||
} else {
|
||||
el.height = height;
|
||||
}
|
||||
|
||||
el.scrolling = "no"
|
||||
el.seamless = "seamless"
|
||||
el.scrolling = "no";
|
||||
el.seamless = "seamless";
|
||||
|
||||
return el
|
||||
return el;
|
||||
}
|
||||
|
||||
function showStat(o, subst) {
|
||||
var content, caption
|
||||
subst = typeof subst !== 'undefined' ? subst : {}
|
||||
var content, caption;
|
||||
subst = typeof subst !== 'undefined' ? subst : {};
|
||||
|
||||
if (o.thumbnail) {
|
||||
content = document.createElement("img")
|
||||
content.src = listReplace(o.thumbnail, subst)
|
||||
content = document.createElement("img");
|
||||
content.src = listReplace(o.thumbnail, subst);
|
||||
}
|
||||
|
||||
if (o.caption) {
|
||||
caption = listReplace(o.caption, subst)
|
||||
caption = listReplace(o.caption, subst);
|
||||
|
||||
if (!content)
|
||||
content = document.createTextNode(caption)
|
||||
if (!content) {
|
||||
content = document.createTextNode(caption);
|
||||
}
|
||||
}
|
||||
|
||||
if (o.iframe) {
|
||||
content = createIframe(o.iframe, o.width, o.height)
|
||||
if (o.iframe.src)
|
||||
content.src = listReplace(o.iframe.src, subst)
|
||||
else
|
||||
content.src = listReplace(o.iframe, subst)
|
||||
content = createIframe(o.iframe, o.width, o.height);
|
||||
if (o.iframe.src) {
|
||||
content.src = listReplace(o.iframe.src, subst);
|
||||
} else {
|
||||
content.src = listReplace(o.iframe, subst);
|
||||
}
|
||||
}
|
||||
|
||||
var p = document.createElement("p")
|
||||
var p = document.createElement("p");
|
||||
|
||||
if (o.href) {
|
||||
var link = document.createElement("a")
|
||||
link.target = "_blank"
|
||||
link.href = listReplace(o.href, subst)
|
||||
link.appendChild(content)
|
||||
var link = document.createElement("a");
|
||||
link.target = "_blank";
|
||||
link.href = listReplace(o.href, subst);
|
||||
link.appendChild(content);
|
||||
|
||||
if (caption && o.thumbnail)
|
||||
link.title = caption
|
||||
if (caption && o.thumbnail) {
|
||||
link.title = caption;
|
||||
}
|
||||
|
||||
p.appendChild(link)
|
||||
} else
|
||||
p.appendChild(content)
|
||||
p.appendChild(link);
|
||||
} else {
|
||||
p.appendChild(content);
|
||||
}
|
||||
|
||||
return p
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
<link rel="stylesheet" href="css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="css/roboto-slab/roboto-slab-fontface.css">
|
||||
<link rel="stylesheet" href="css/roboto/roboto-fontface.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="vendor/es6-shim/es6-shim.min.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script>
|
||||
console.log("Version: #revision#")
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="loader">
|
||||
<p>
|
||||
Lade<br />
|
||||
<span class="spinner"></span><br />
|
||||
Karte & Knoten...
|
||||
</p>
|
||||
<noscript>
|
||||
<strong>JavaScript required</strong>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
<link rel="stylesheet" href="roboto-slab-fontface.css">
|
||||
<link rel="stylesheet" href="roboto-fontface.css">
|
||||
<link rel="stylesheet" href="style.css?__inline=true">
|
||||
<script src="vendor/es6-shim/es6-shim.min.js?__inline=true"></script>
|
||||
<script src="app.js"></script>
|
||||
<script>
|
||||
console.log("Version: #revision#");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="loader">
|
||||
<p>
|
||||
Lade<br/>
|
||||
<span class="spinner"></span><br/>
|
||||
Karte & Knoten...
|
||||
</p>
|
||||
<noscript>
|
||||
<strong>JavaScript required</strong>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
38
index.html
38
index.html
|
|
@ -1,17 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
<link rel="stylesheet" href="node_modules/roboto-fontface/css/roboto-slab/roboto-slab-fontface.css">
|
||||
<link rel="stylesheet" href="node_modules/roboto-fontface/css/roboto/roboto-fontface.css">
|
||||
<link rel="stylesheet" href="node_modules/leaflet/dist/leaflet.css">
|
||||
<link rel="stylesheet" href="node_modules/leaflet-label/dist/leaflet.label.css">
|
||||
<link rel="stylesheet" href="node_modules/ionicons/css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
|
||||
<script src="node_modules/requirejs/require.js" data-main="app"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||
<link rel="stylesheet" href="bower_components/roboto-slab-fontface/roboto-slab-fontface.css">
|
||||
<link rel="stylesheet" href="bower_components/roboto-fontface/roboto-fontface.css">
|
||||
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css">
|
||||
<link rel="stylesheet" href="bower_components/Leaflet.label/dist/leaflet.label.css">
|
||||
<link rel="stylesheet" href="assets/icons/hopglass-icons.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="bower_components/es6-shim/es6-shim.min.js"></script>
|
||||
<script src="bower_components/requirejs/require.js" data-main="app"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="loader">
|
||||
<p>
|
||||
Lade<br/>
|
||||
<span class="spinner"></span><br \>
|
||||
Karte & Knoten...
|
||||
</p>
|
||||
<noscript>
|
||||
<strong>JavaScript required</strong>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
56
lib/about.js
56
lib/about.js
|
|
@ -1,38 +1,38 @@
|
|||
define(function () {
|
||||
return function() {
|
||||
"use strict";
|
||||
|
||||
return function () {
|
||||
this.render = function (d) {
|
||||
var el = document.createElement("div")
|
||||
d.appendChild(el)
|
||||
var s = "<h2>Über HopGlass</h2>"
|
||||
var s = "<h2>Über HopGlass</h2>";
|
||||
|
||||
s += "<p>Mit Doppelklick und Shift+Doppelklick kann man in der Karte "
|
||||
s += "auch zoomen.</p>"
|
||||
s += "<p>Mit Doppelklick und Shift+Doppelklick kann man in der Karte ";
|
||||
s += "auch zoomen.</p>";
|
||||
|
||||
s += "<h3>AGPL 3</h3>"
|
||||
s += "<h3>AGPL 3</h3>";
|
||||
|
||||
s += "<p>Copyright (C) Milan Pässler</p>"
|
||||
s += "<p>Copyright (C) Nils Schneider</p>"
|
||||
s += "<p>Copyright (C) Milan Pässler</p>";
|
||||
s += "<p>Copyright (C) Nils Schneider</p>";
|
||||
|
||||
s += "<p>This program is free software: you can redistribute it and/or "
|
||||
s += "modify it under the terms of the GNU Affero General Public "
|
||||
s += "License as published by the Free Software Foundation, either "
|
||||
s += "version 3 of the License, or (at your option) any later version.</p>"
|
||||
s += "<p>This program is free software: you can redistribute it and/or ";
|
||||
s += "modify it under the terms of the GNU Affero General Public ";
|
||||
s += "License as published by the Free Software Foundation, either ";
|
||||
s += "version 3 of the License, or (at your option) any later version.</p>";
|
||||
|
||||
s += "<p>This program is distributed in the hope that it will be useful, "
|
||||
s += "but WITHOUT ANY WARRANTY; without even the implied warranty of "
|
||||
s += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
|
||||
s += "GNU Affero General Public License for more details.</p>"
|
||||
s += "<p>This program is distributed in the hope that it will be useful, ";
|
||||
s += "but WITHOUT ANY WARRANTY; without even the implied warranty of ";
|
||||
s += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ";
|
||||
s += "GNU Affero General Public License for more details.</p>";
|
||||
|
||||
s += "<p>You should have received a copy of the GNU Affero General "
|
||||
s += "Public License along with this program. If not, see "
|
||||
s += "<a href=\"https://www.gnu.org/licenses/\">"
|
||||
s += "https://www.gnu.org/licenses/</a>.</p>"
|
||||
s += "<p>You should have received a copy of the GNU Affero General ";
|
||||
s += "Public License along with this program. If not, see ";
|
||||
s += "<a href=\"https://www.gnu.org/licenses/\">";
|
||||
s += "https://www.gnu.org/licenses/</a>.</p>";
|
||||
|
||||
s += "<p>The source code is available at "
|
||||
s += "<a href=\"https://github.com/hopglass/hopglass\">"
|
||||
s += "https://github.com/hopglass/hopglass</a>."
|
||||
s += "<p>The source code is available at ";
|
||||
s += "<a href=\"https://github.com/plumpudding/hopglass\">";
|
||||
s += "https://github.com/plumpudding/hopglass</a>.";
|
||||
|
||||
el.innerHTML = s
|
||||
}
|
||||
}
|
||||
})
|
||||
d.innerHTML = s;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,20 +1,23 @@
|
|||
define([], function () {
|
||||
"use strict";
|
||||
|
||||
return function (tag) {
|
||||
if (!tag)
|
||||
tag = "div"
|
||||
if (!tag) {
|
||||
tag = "div";
|
||||
}
|
||||
|
||||
var self = this
|
||||
var self = this;
|
||||
|
||||
var container = document.createElement(tag)
|
||||
var container = document.createElement(tag);
|
||||
|
||||
self.add = function (d) {
|
||||
d.render(container)
|
||||
}
|
||||
d.render(container);
|
||||
};
|
||||
|
||||
self.render = function (el) {
|
||||
el.appendChild(container)
|
||||
}
|
||||
el.appendChild(container);
|
||||
};
|
||||
|
||||
return self
|
||||
}
|
||||
})
|
||||
return self;
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue