Commit 600177f8 authored by Tobias Steiner's avatar Tobias Steiner
Browse files

Add webcomponent and remove the rest

parent ec028fb9
FROM node:8-alpine
# add basic libs
RUN apk --no-cache add \
bash \
g++ \
ca-certificates \
lz4-dev \
musl-dev \
cyrus-sasl-dev \
openssl-dev \
make \
python \
bash \
git
RUN apk add --no-cache --virtual .build-deps gcc zlib-dev libc-dev bsd-compat-headers py-setuptools libexecinfo libexecinfo-dev
# Create app directory
RUN mkdir -p /usr/local/app
# Move to the app directory
WORKDIR /usr/local/app
# copy app to the container
COPY package.json package-lock.json config.json tsconfig.json /usr/local/app/
COPY src /usr/local/app/src
# Install dependencies
RUN npm install
# build stuff
RUN npm run build
# run app
CMD node dist/index.js
\ No newline at end of file
......@@ -2,16 +2,19 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script
src="https://code.jquery.com/jquery-1.9.1.min.js"
integrity="sha256-wS9gmOZBqsqWxgIVgA8Y9WcQOa7PgSIX+rPA0VL2rbQ="
crossorigin="anonymous"></script>
<title>Histhub widget </title>
<script src="../src/histhub-widget.js"></script>
</head>
<body>
<div id="geolinkerWidget" data-url="https://dodis.ch/G8" data-endpoint="sameas" data-api-version="v1" data-language="fr">Loading widget...</div>
<script src="../dist/bundle.js"></script>
<histhub-widget endpoint="//api.tagcloud.histhub.ch/v1/sameas/" resolver="resolvermanual" location="https://dodis.ch/T171">
<h3 slot="title">Links from tagcloud</h3>
</histhub-widget>
<histhub-widget endpoint="//api.orgalinker.histhub.ch/v1/sameas/" resolver="resolvermanual" location="https://dodis.ch/R20">
<h3 slot="title">Links from orgalinker</h3>
</histhub-widget>
<histhub-widget endpoint="//api.geolinker.histhub.ch/v1/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G8">
<h3 slot="title">Links from orgalinker</h3>
</histhub-widget>
</body>
</html>
<div class="geolinker-widget">
<h2>{{title}}</h2>
<img src="{{image}}"/>
<p>{{description}}</p>
<ul>
{{#links}}
<li>{{link}}</li>
{{/links}}
</ul>
</div>
\ No newline at end of file
{"error":{"code":404,"message":"Not Found"}}
/*
* Kendo UI Localization Project for v2012.3.1114
* Copyright 2012 Telerik AD. All rights reserved.
*
* Standard German (de-DE) Language Pack
*
* Project home : https://github.com/loudenvier/kendo-global
* Kendo UI home : http://kendoui.com
* Author : Claudio Mertz
*
*
* This project is released to the public domain, although one must abide to the
* licensing terms set forth by Telerik to use Kendo UI, as shown bellow.
*
* Telerik's original licensing terms:
* -----------------------------------
* Kendo UI Web commercial licenses may be obtained at
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx
* If you do not own a commercial license, this file shall be governed by the
* GNU General Public License (GPL) version 3.
* For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html
*/
kendo.ui.Locale = "Deutschland (de-DE)";
kendo.ui.ColumnMenu.prototype.options.messages =
$.extend(kendo.ui.ColumnMenu.prototype.options.messages, {
/* COLUMN MENU MESSAGES
****************************************************************************/
sortAscending: "Aufsteigend",
sortDescending: "Absteigend",
filter: "Filter",
columns: "Spalten"
/***************************************************************************/
});
kendo.ui.Groupable.prototype.options.messages =
$.extend(kendo.ui.Groupable.prototype.options.messages, {
/* GRID GROUP PANEL MESSAGES
****************************************************************************/
empty: "Keine Einträge vorhanden"
/***************************************************************************/
});
kendo.ui.FilterMenu.prototype.options.messages =
$.extend(kendo.ui.FilterMenu.prototype.options.messages, {
/* FILTER MENU MESSAGES
***************************************************************************/
info: "Zeige Einträge mit", // sets the text on top of the filter menu
filter: "Filtern", // sets the text for the "Filter" button
clear: "Löschen", // sets the text for the "Clear" button
// when filtering boolean numbers
isTrue: "Ist wahr", // sets the text for "isTrue" radio button
isFalse: "Ist falsch", // sets the text for "isFalse" radio button
//changes the text of the "And" and "Or" of the filter menu
and: "UND",
or: "ODER",
selectValue: "-Wählen Sie einen Wert-"
/***************************************************************************/
});
kendo.ui.FilterMenu.prototype.options.operators =
$.extend(kendo.ui.FilterMenu.prototype.options.operators, {
/* FILTER MENU OPERATORS (for each supported data type)
****************************************************************************/
string: {
eq: "Ist gleich",
neq: "Ist ungleich",
startswith: "Beginnt mit",
contains: "Enthält",
doesnotcontain: "Enthält nicht",
endswith: "Endet mit"
},
number: {
eq: "Ist gleich",
neq: "Ist ungleich",
gte: "Ist größer oder gleich",
gt: "Ist größer",
lte: "Ist kleiner oder gleich",
lt: "Ist kleiner"
},
date: {
eq: "Ist gleich",
neq: "Ist ungleich",
gte: "Ist größer oder gleich",
gt: "Ist größer",
lte: "Ist kleiner oder gleich",
lt: "Ist kleiner"
},
enums: {
eq: "Ist gleich",
neq: "Ist ungleich"
}
/***************************************************************************/
});
kendo.ui.Pager.prototype.options.messages =
$.extend(kendo.ui.Pager.prototype.options.messages, {
/* PAGER MESSAGES
****************************************************************************/
display: "{0} - {1} von {2} Einträgen",
empty: "Keine Einträge",
page: "Seite",
of: "von {0}",
itemsPerPage: "Einträge pro Seite",
first: "Erste Seite",
previous: "Vorherige Seite",
next: "Nächste Seite",
last: "Letzte Seite",
refresh: "Aktualisieren"
/***************************************************************************/
});
kendo.ui.Validator.prototype.options.messages =
$.extend(kendo.ui.Validator.prototype.options.messages, {
/* VALIDATOR MESSAGES
****************************************************************************/
required: "{0} ist notwendig",
pattern: "{0} ist ungültig",
min: "{0} muss größer oder gleich sein als {1}",
max: "{0} muss kleiner oder gleich sein als {1}",
step: "{0} ist ungültig",
email: "{0} ist keine gültige E-Mail",
url: "{0} ist keine gültige URL",
date: "{0} ist kein gültiges Datum"
/***************************************************************************/
});
kendo.ui.ImageBrowser.prototype.options.messages =
$.extend(kendo.ui.ImageBrowser.prototype.options.messages, {
/* IMAGE BROWSER MESSAGES
****************************************************************************/
uploadFile: "Senden",
orderBy: "Sortieren nach",
orderByName: "Name",
orderBySize: "Größe",
directoryNotFound: "Das Verzeichnis wurde nicht gefunden.",
emptyFolder: "Leeres Verzeichnis",
deleteFile: 'Sind Sie sicher, dass Sie "{0}" wirklich löschen wollen?',
invalidFileType: "Die ausgewählte Datei \"{0}\" ist ungültig. Unterstützte Dateitypen sind {1}.",
overwriteFile: "Eine Datei namens \"{0}\" existiert bereits im aktuellen Ordner. Überschreiben?",
dropFilesHere: "Dateien hier verschieben"
/***************************************************************************/
});
kendo.ui.Editor.prototype.options.messages =
$.extend(kendo.ui.Editor.prototype.options.messages, {
/* EDITOR MESSAGES
****************************************************************************/
bold: "Fett",
italic: "Kursiv",
underline: "Unterstrichen",
strikethrough: "Durchgestrichen",
superscript: "Hochgestellt",
subscript: "Tiefgestellt",
justifyCenter: "Zentrieren",
justifyLeft: "Linksbündig",
justifyRight: "Rechtsbündig",
justifyFull: "Blocksatz",
insertUnorderedList: "Unsortierte Liste einfügen",
insertOrderedList: "Sortierte Liste einfügen",
indent: "Einzug vergrößern",
outdent: "Einzug verkleinern",
createLink: "Link erstellen",
unlink: "Link entfernen",
insertImage: "Bild einfügen",
insertHtml: "HTML einfügen",
fontName: "Schriftart",
fontNameInherit: "(Schriftart vererben)",
fontSize: "Wählen Si die Schrifgröße",
fontSizeInherit: "(Schriftgröße vererben)",
formatBlock: "Format",
foreColor: "Farbe",
backColor: "Hintergrundfarbe",
style: "Stil",
emptyFolder: "Leeres Verzeichnis",
uploadFile: "Senden",
orderBy: "Sortieren nach:",
orderBySize: "Größe",
orderByName: "Name",
invalidFileType: "Die ausgewählte Datei \"{0}\" ist ungültig. Unterstützte Dateitypen sind {1}.",
deleteFile: 'Sind Sie sicher, dass Sie "{0}" wirklich löschen wollen?',
overwriteFile: "Eine Datei namens \"{0}\" existiert bereits im aktuellen Ordner. Überschreiben?",
directoryNotFound: "Das Verzeichnis wurde nicht gefunden.",
imageWebAddress: "Internet-Adresse",
imageAltText: "Alternativer Text",
dialogInsert: "Einfügen",
dialogButtonSeparator: "oder",
dialogCancel: "Abbrechen"
/***************************************************************************/
});
\ No newline at end of file
/**
* Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that
* modifies the layers of the map style to use the 'text-field' that matches the browser language.
* @constructor
* @param {object} options - Options to configure the plugin.
* @param {string[]} [options.supportedLanguages] - List of supported languages
* @param {Function} [options.languageTransform] - Custom style transformation to apply
* @param {RegExp} [options.languageField=/^\{name/] - RegExp to match if a text-field is a language field
* @param {Function} [options.getLanguageField] - Given a language choose the field in the vector tiles
* @param {string} [options.languageSource] - Name of the source that contains the different languages.
* @param {string} [options.defaultLanguage] - Name of the default language to initialize style after loading.
*/
function MapboxLanguage(options) {
options = Object.assign({}, options);
if (!(this instanceof MapboxLanguage)) {
throw new Error('MapboxLanguage needs to be called with the new keyword');
}
this.setLanguage = this.setLanguage.bind(this);
this._initialStyleUpdate = this._initialStyleUpdate.bind(this);
this._defaultLanguage = options.defaultLanguage;
this._isLanguageField = options.languageField || /^\{name/;
this._getLanguageField = options.getLanguageField || function nameField(language) {
return '{name_' + language + '}';
};
this._languageSource = options.languageSource || null;
this._languageTransform = options.languageTransform || function (style, language) {
if (language === 'ar') {
return noSpacing(style);
} else {
return standardSpacing(style);
}
};
this.supportedLanguages = options.supportedLanguages || ['en', 'es', 'fr', 'de', 'ru', 'zh', 'ar', 'pt'];
}
function standardSpacing(style) {
var changedLayers = style.layers.map(function (layer) {
if (!(layer.layout || {})['text-field']) return layer;
var spacing = 0;
if (layer['source-layer'] === 'state_label') {
spacing = 0.15;
}
if (layer['source-layer'] === 'marine_label') {
if (/-lg/.test(layer.id)) {
spacing = 0.25;
}
if (/-md/.test(layer.id)) {
spacing = 0.15;
}
if (/-sm/.test(layer.id)) {
spacing = 0.1;
}
}
if (layer['source-layer'] === 'place_label') {
if (/-suburb/.test(layer.id)) {
spacing = 0.15;
}
if (/-neighbour/.test(layer.id)) {
spacing = 0.1;
}
if (/-islet/.test(layer.id)) {
spacing = 0.01;
}
}
if (layer['source-layer'] === 'airport_label') {
spacing = 0.01;
}
if (layer['source-layer'] === 'rail_station_label') {
spacing = 0.01;
}
if (layer['source-layer'] === 'poi_label') {
if (/-scalerank/.test(layer.id)) {
spacing = 0.01;
}
}
if (layer['source-layer'] === 'road_label') {
if (/-label-/.test(layer.id)) {
spacing = 0.01;
}
if (/-shields/.test(layer.id)) {
spacing = 0.05;
}
}
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
'text-letter-spacing': spacing
})
});
});
return Object.assign({}, style, {
layers: changedLayers
});
}
function noSpacing(style) {
var changedLayers = style.layers.map(function (layer) {
if (!(layer.layout || {})['text-field']) return layer;
var spacing = 0;
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
'text-letter-spacing': spacing
})
});
});
return Object.assign({}, style, {
layers: changedLayers
});
}
function isNameStringField(isLangField, property) {
return typeof property === 'string' && isLangField.test(property);
}
function isNameFunctionField(isLangField, property) {
return property.stops && property.stops.filter(function (stop) {
return isLangField.test(stop[1]);
}).length > 0;
}
function adaptPropertyLanguage(isLangField, property, languageFieldName) {
if (isNameStringField(isLangField, property)) return languageFieldName;
if (isNameFunctionField(isLangField, property)) {
var newStops = property.stops.map(function (stop) {
if (isLangField.test(stop[1])) {
return [stop[0], languageFieldName];
}
return stop;
});
return Object.assign({}, property, {
stops: newStops
});
}
return property;
}
function changeLayerTextProperty(isLangField, layer, languageFieldName) {
if (layer.layout && layer.layout['text-field']) {
return Object.assign({}, layer, {
layout: Object.assign({}, layer.layout, {
'text-field': adaptPropertyLanguage(isLangField, layer.layout['text-field'], languageFieldName)
})
});
}
return layer;
}
function findStreetsSource(style) {
var sources = Object.keys(style.sources).filter(function (sourceName) {
var source = style.sources[sourceName];
return /mapbox-streets-v\d/.test(source.url);
});
return sources[0];
}
/**
* Explicitly change the language for a style.
* @param {object} style - Mapbox GL style to modify
* @param {string} language - The language iso code
* @returns {object} the modified style
*/
MapboxLanguage.prototype.setLanguage = function (style, language) {
if (this.supportedLanguages.indexOf(language) < 0) throw new Error('Language ' + language + ' is not supported');
var streetsSource = this._languageSource || findStreetsSource(style);
if (!streetsSource) return style;
var field = this._getLanguageField(language);
var isLangField = this._isLanguageField;
var changedLayers = style.layers.map(function (layer) {
if (layer.source === streetsSource) return changeLayerTextProperty(isLangField, layer, field);
return layer;
});
var languageStyle = Object.assign({}, style, {
layers: changedLayers
});
return this._languageTransform(languageStyle, language);
};
MapboxLanguage.prototype._initialStyleUpdate = function () {
var style = this._map.getStyle();
var language = this._defaultLanguage || browserLanguage(this.supportedLanguages);
// We only update the style once
this._map.off('styledata', this._initialStyleUpdate);
this._map.setStyle(this.setLanguage(style, language));
};
function browserLanguage(supportedLanguages) {
var language = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage);
var parts = language.split('-');
var languageCode = language;
if (parts.length > 1) {
languageCode = parts[0];
}
if (supportedLanguages.indexOf(languageCode) > -1) {
return languageCode;
}
return null;
}
MapboxLanguage.prototype.onAdd = function (map) {
this._map = map;
this._map.on('styledata', this._initialStyleUpdate);
this._container = document.createElement('div');
return this._container;
};
MapboxLanguage.prototype.onRemove = function () {
this._map.off('styledata', this._initialStyleUpdate);
this._map = undefined;
};
function ie11Polyfill() {
if (typeof Object.assign != 'function') {
// Must be writable: true, enumerable: false, configurable: true
Object.defineProperty(Object, 'assign', {
// eslint-disable-next-line no-unused-vars
value: function assign(target, varArgs) { // .length of function is 2
// eslint-disable-next-line strict
'use strict';
if (target === null) { // TypeError if undefined or null
throw new TypeError('Cannot convert undefined or null to object');
}
var to = Object(target);
for (var index = 1; index < arguments.length; index++) {
var nextSource = arguments[index];
if (nextSource !== null) { // Skip over if undefined or null
for (var nextKey in nextSource) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
to[nextKey] = nextSource[nextKey];
}
}
}
}
return to;
},
writable: true,
configurable: true
});
}
}
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = MapboxLanguage;
} else {
ie11Polyfill();
window.MapboxLanguage = MapboxLanguage;
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
#map {
width: 100%;
height: 350px;
}
.css-icon {
background-image: url('../images/marker-3.png');
background-size: cover;
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
}
\ No newline at end of file
/*Hide unnecessary elements*/
.navbar, #header, #menu_left_container, #footer_container, #search_top, h1{
padding: 0;
margin: 0;
display: none !important;
}
/*Use whole width*/
.span8{
width: 95% !important;
}
body, #menu_and_content_container{
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
color: #000000;
background: none;
font-family: 'Times New Roman', serif;
font-size: 11pt;
float: none !important;
border: 0;
}