jekyll-theme-isotc154 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 501"><title>ribose logo normal</title><path d="M180.9,31.3h36.2l18.1,31.3h36.2l18.1,31.3-18.1,31.4,18.1,31.3-18.1,31.3,18.1,31.3-18.1,31.3H235.2l-18.1,31.3,18.1,31.3h36.2l18.1,31.4-18.1,31.3,18.1,31.3-18.1,31.3,18.1,31.3L272.1,501H235.9l-18.8-31.3,18.1-31.3-18.1-31.3,18.1-31.3-18.1-31.3H180.9l-18.1-31.4H126.7l-18.1-31.3H72.4L54.3,313.1l18.1,31.4L54.3,375.8l18.1,31.3L54.3,438.4l18.1,31.3L55,501H18.8L0,469.7l18.1-31.3L0,407.1l18.1-31.3L0,344.5l18.1-31.4L0,281.8l18.1-31.3L0,219.2l18.1-31.3L0,156.6l18.1-31.3L0,93.9,18.1,62.6H54.3L72.4,31.3h36.2L126.7,0h36.1ZM126.7,250.5h36.1l18.1-31.3h36.2l18.1-31.3-18.1-31.3,18.1-31.3L217.1,93.9H180.9L162.8,62.6H126.7L108.6,93.9H72.4L54.3,125.3l18.1,31.3L54.3,187.9l18.1,31.3h36.2Z"/><path d="M470.2,93.9l-18.1,31.4H416L397.9,93.9,416,62.6h36.1Zm0,125.3-18.1,31.3,18.1,31.3-18.1,31.3,18.1,31.4-18.1,31.3,18.1,31.3-18.1,31.3,18.1,31.3L452.8,501H416.7l-18.8-31.3L416,438.4l-18.1-31.3L416,375.8l-18.1-31.3L416,313.1l-18.1-31.3L416,250.5l-18.1-31.3L416,187.9h36.1Z"/><path d="M659.9,31.3,641.8,62.6l18.1,31.3-18.1,31.4,18.1,31.3-18.1,31.3,18.1,31.3h36.2l18.1-31.3h36.2l18.1,31.3h36.2l18.1,31.3h36.1L877,281.8l-18.1,31.3L877,344.5l-18.1,31.3L877,407.1l-18.1,31.3H822.8l-18.1,31.3H768.5L751.1,501H714.9l-18.8-31.3H659.9L642.5,501H606.3l-18.7-31.3,18.1-31.3-18.1-31.3,18.1-31.3-18.1-31.3,18.1-31.4-18.1-31.3,18.1-31.3-18.1-31.3,18.1-31.3-18.1-31.3,18.1-31.3L587.6,93.9l18.1-31.3L587.6,31.3,605.7,0h36.1ZM822.8,375.8l-18.1-31.3,18.1-31.4-18.1-31.3H768.5l-18.1-31.3H714.2l-18.1,31.3H659.9l-18.1,31.3,18.1,31.4-18.1,31.3,18.1,31.3h36.2l18.1,31.3h36.2l18.1-31.3h36.2Z"/><path d="M1034.6,219.2h36.2l18.1-31.3H1125l18.1,31.3h36.2l18.1,31.3h36.2l18.1,31.3-18.1,31.3,18.1,31.4-18.1,31.3,18.1,31.3-18.1,31.3h-36.2l-18.1,31.3h-36.2L1125.7,501h-36.1l-18.8-31.3h-36.2l-18.1-31.3H980.3l-18.1-31.3,18.1-31.3-18.1-31.3,18.1-31.4-18.1-31.3,18.1-31.3h36.2Zm0,125.3-18.1,31.3,18.1,31.3h36.2l18.1,31.3H1125l18.1-31.3h36.2l18.1-31.3-18.1-31.3,18.1-31.4-18.1-31.3h-36.2L1125,250.5h-36.1l-18.1,31.3h-36.2l-18.1,31.3Z"/><path d="M1408,219.2h36.2l18.1-31.3h36.2l18.1,31.3h36.2l18.1,31.3h36.2l18,31.3-18,31.3h-36.2l-18.1-31.3h-36.2l-18.1-31.3h-36.2l-18.1,31.3,18.1,31.3h36.2l18.1,31.4h36.2l18.1,31.3h36.2l18,31.3-18,31.3h-36.2l-18.1,31.3h-36.2L1499.2,501H1463l-18.8-31.3H1408l-18.1-31.3h-36.2l-18-31.3,18-31.3h36.2l18.1,31.3h36.2l18.1,31.3h36.2l18.1-31.3-18.1-31.3h-36.2l-18.1-31.3H1408l-18.1-31.4h-36.2l-18-31.3,18-31.3h36.2Z"/><path d="M1782.9,219.2h36.2l18.1-31.3h36.2l18,31.3h36.2l18.1,31.3h36.2l18.1,31.3-18.1,31.3h-36.2l-18.1,31.4h-36.2l-18,31.3h-36.2l-18.1-31.3,18.1-31.4h36.2l18-31.3-18-31.3h-36.2l-18.1,31.3h-36.2l-18.1,31.3,18.1,31.4-18.1,31.3,18.1,31.3h36.2l18.1,31.3h36.2l18-31.3h36.2l18.1-31.3h36.2l18.1,31.3-18.1,31.3h-36.2l-18.1,31.3h-36.2L1874.1,501h-36.2l-18.8-31.3h-36.2l-18.1-31.3h-36.2l-18.1-31.3,18.1-31.3-18.1-31.3,18.1-31.4-18.1-31.3,18.1-31.3h36.2Z"/></svg>
@@ -0,0 +1,333 @@
1
+ (function () {
2
+
3
+ /* Initializes maps based on targets
4
+ represented by DOM elements with data-map-container attribute present.
5
+
6
+ Map targets are expected to specify following additional attributes:
7
+
8
+ - data-map-id with unique string identifier for the map on current page.
9
+
10
+ - data-map-center with JSON in following format {
11
+ lon: <number>
12
+ lat: <number>
13
+ zoom: <number>
14
+ }
15
+
16
+ - optional data-map-disable-interactions, if set the map will be static.
17
+
18
+ Exposes OL map objects under window.maps[<map ID>], with each value as {
19
+ map: <OL map instance>
20
+ }.
21
+
22
+ Adds map markers based on DOM elements with data-map-marker attribute present.
23
+
24
+ Marker elements are expected to specify following additional attributes:
25
+
26
+ - data-map-id with unique string identifier for the map on current page.
27
+
28
+ - data-map-marker-id with unique string identifier for given map marker.
29
+
30
+ - data-map-marker-place-details JSON in following format: {
31
+ title: <place name as string>
32
+ }
33
+
34
+ - data-map-marker-coords, with JSON in following format: {
35
+ lon: <number>
36
+ lat: <number>
37
+ }
38
+
39
+ Ties map markers with the elements on the page.
40
+
41
+ */
42
+
43
+ const PRIMARY_COLOR = '#0061AD';
44
+ // NOTE: Keep up-to-date with the corresponding SCSS variable.
45
+
46
+ const BODY_FONT = '16px Helvetica, Arial, sans-serif';
47
+ // NOTE: Keep up-to-date with prevailing page style.
48
+
49
+ const SUMMONED_MAP_HTML_CLASS = 'map-focused';
50
+
51
+ const SELECTED_MAP_MARKER_REFERENCE_HTML_CLASS = 'map-marker-selected';
52
+
53
+ window.maps = {};
54
+
55
+ const maps = document.querySelectorAll('[data-map-container][data-map-id][data-map-center]');
56
+ const markers = document.querySelectorAll('[data-map-marker][data-map-id][data-map-marker-id][data-map-marker-coords][data-map-marker-place-details]');
57
+
58
+ for (const mapTarget of maps) {
59
+ const mapID = mapTarget.dataset.mapId;
60
+ if (!mapID) {
61
+ throw new Error("Invalid map target: DOM dataset does not specify map ID");
62
+ }
63
+ window.maps[mapID] = initMap(mapID, mapTarget, markers);
64
+ }
65
+
66
+ function createMarkerReference(markerEl, markerIndex, onClick) {
67
+ /* Append an element to place mention in body text,
68
+ tying it to corresponding map marker. */
69
+
70
+ const markerNumber = document.createElement('span');
71
+ markerNumber.textContent = `${markerIndex}`;
72
+ markerNumber.classList.add('map-marker-reference');
73
+ markerNumber.addEventListener('click', onClick);
74
+
75
+ markerEl.appendChild(markerNumber);
76
+ }
77
+
78
+ function initMap(mapID, target, allMarkers) {
79
+ /* mapID: unique map ID as a string.
80
+ target: DOM element to contain the map.
81
+ allMarkers: DOM elements representing map markers. */
82
+
83
+
84
+ // Prepare basic map data
85
+
86
+ if (!target) {
87
+ throw new Error("Invalid map target: DOM element is missing");
88
+ }
89
+
90
+ const centerDataRaw = target.dataset.mapCenter;
91
+
92
+ if (!centerDataRaw) {
93
+ throw new Error("Invalid map target: DOM dataset is missing map center");
94
+ }
95
+
96
+ let centerData;
97
+ try {
98
+ centerData = JSON.parse(centerDataRaw);
99
+ } catch (e) {
100
+ console.error("Failed to parse map center data");
101
+ throw e;
102
+ }
103
+
104
+ const disableInteractions =
105
+ target.dataset.mapDisableInteractions !== undefined;
106
+
107
+
108
+ // Read and initialize markers
109
+
110
+ var markers = {};
111
+
112
+ for (const [_idx, markerEl] of allMarkers.entries()) {
113
+ if (markerEl.dataset.mapId !== mapID) {
114
+ // Skip this marker if it belongs to another map.
115
+ continue;
116
+ }
117
+
118
+ const markerID = markerEl.dataset.mapMarkerId;
119
+ const idx = _idx + 1;
120
+
121
+ // Parse coordinates and place details from marker DOM dataset
122
+ let coords, details;
123
+ try {
124
+ coords = JSON.parse(markerEl.dataset.mapMarkerCoords);
125
+ details = JSON.parse(markerEl.dataset.mapMarkerPlaceDetails);
126
+ } catch (e) {
127
+ console.error("Failed to parse map marker coords or details");
128
+ throw e;
129
+ }
130
+
131
+ if (!details.title) {
132
+ console.error("Malformed marker place details", markerID, details);
133
+ continue;
134
+ }
135
+
136
+ // Convert OpenLayers coordinates
137
+ const olCoords = ol.proj.fromLonLat([coords.lon, coords.lat]);
138
+
139
+ createMarkerReference(
140
+ markerEl,
141
+ idx,
142
+ function () { selectMarker(markerID, 'page') });
143
+
144
+ // (see below for overlay usage)
145
+ const overlayEl = document.createElement('div');
146
+ overlayEl.dataset.mapMarkerBubble = true;
147
+ overlayEl.dataset.tippyContent = details.title;
148
+
149
+ const markerFeature = new ol.Feature({
150
+ markerID: markerID,
151
+ geometry: new ol.geom.Point(olCoords),
152
+ });
153
+ const fill = new ol.style.Fill({
154
+ color: 'rgba(255, 255, 255, 0.4)',
155
+ });
156
+ const stroke = new ol.style.Stroke({
157
+ color: PRIMARY_COLOR,
158
+ width: 1.25,
159
+ });
160
+ markerFeature.setStyle([new ol.style.Style({
161
+ image: new ol.style.Circle({
162
+ fill: fill,
163
+ stroke: stroke,
164
+ radius: 5,
165
+ }),
166
+ }), new ol.style.Style({
167
+ text: new ol.style.Text({
168
+ font: BODY_FONT,
169
+ placement: 'point',
170
+ textAlign: 'left',
171
+ offsetX: 10,
172
+ text: `${idx}`,
173
+ padding: [2, 3, 2, 3],
174
+ backgroundFill: new ol.style.Fill({ color: PRIMARY_COLOR }),
175
+ fill: new ol.style.Fill({
176
+ color: '#fff',
177
+ }),
178
+ stroke: new ol.style.Stroke({
179
+ color: '#000',
180
+ width: 2,
181
+ }),
182
+ }),
183
+ })]);
184
+
185
+ markers[markerID] = {
186
+ coords: olCoords,
187
+ el: markerEl,
188
+ idx: idx,
189
+
190
+ // Feature is used to visualize place marker
191
+ // on the map as a point.
192
+ feature: markerFeature,
193
+
194
+ // Overlay is used as an anchor for tooltip
195
+ // showing extra place information.
196
+ overlay: new ol.Overlay({
197
+ id: `marker-${markerID}`,
198
+ element: overlayEl,
199
+ position: olCoords,
200
+ }),
201
+ };
202
+ }
203
+
204
+
205
+ // Initialize the map
206
+
207
+ const markerFeatures = Object.values(markers).map(function (marker) {
208
+ return marker.feature;
209
+ });
210
+
211
+ const map = new ol.Map({
212
+ target: target,
213
+ controls: disableInteractions ? [] : null,
214
+ interactions: disableInteractions ? [] : null,
215
+ layers: [
216
+ new ol.layer.Tile({
217
+ source: new ol.source.OSM(),
218
+ }),
219
+ new ol.layer.Vector({
220
+ source: new ol.source.Vector({
221
+ features: markerFeatures,
222
+ }),
223
+ }),
224
+ ],
225
+ view: new ol.View({
226
+ center: ol.proj.fromLonLat([centerData.lon, centerData.lat]),
227
+ zoom: centerData.zoom,
228
+ }),
229
+ });
230
+
231
+
232
+ // Initialize marker highlighting & map (de)focusing
233
+
234
+ for (const marker of Object.values(markers)) {
235
+ map.addOverlay(marker.overlay);
236
+ }
237
+
238
+ const tippys = tippy('[data-map-marker-bubble]', {
239
+ trigger: 'manual',
240
+ hideOnClick: false,
241
+ });
242
+
243
+ function hideAllTippys() {
244
+ tippys.map(function (instance) { instance.hide(); });
245
+ }
246
+
247
+ map.on('singleclick', function (event) {
248
+ map.forEachFeatureAtPixel(
249
+ event.pixel,
250
+ function (feature) {
251
+ const markerID = feature.getProperties()['markerID'];
252
+ if (markerID) {
253
+ selectMarker(markerID, 'map');
254
+ return true;
255
+ }
256
+ })
257
+ });
258
+
259
+ map.on('movestart', hideAllTippys);
260
+
261
+ function deselectMarkers() {
262
+ Object.values(markers).map(function (marker) {
263
+ marker.el.classList.remove(SELECTED_MAP_MARKER_REFERENCE_HTML_CLASS);
264
+ });
265
+ }
266
+
267
+ function selectMarker(markerID, eventSource) {
268
+ /* eventSource: How the marker got selected; 'map' or 'page' */
269
+
270
+ const marker = markers[markerID];
271
+
272
+ if (!marker) {
273
+ throw new Error(`Attempt to select unknown marker ${markerID}`);
274
+ }
275
+
276
+ deselectMarkers();
277
+
278
+ if (!mapIsSummoned()) {
279
+ summonMap();
280
+ }
281
+
282
+ let selectedMarkerTippy;
283
+ try {
284
+ selectedMarkerTippy = marker.overlay.getElement()._tippy;
285
+ } catch (e) {
286
+ throw new Error(`Unable to obtain tippy instance for ${markerID}`);
287
+ }
288
+
289
+ map.once('moveend', function () {
290
+ hideAllTippys();
291
+ selectedMarkerTippy.show();
292
+ })
293
+
294
+ map.getView().setCenter(marker.coords);
295
+
296
+ if (eventSource === 'map') {
297
+ marker.el.scrollIntoView();
298
+ }
299
+
300
+ marker.el.classList.add(SELECTED_MAP_MARKER_REFERENCE_HTML_CLASS);
301
+ }
302
+
303
+ function summonMap() {
304
+ target.classList.add(SUMMONED_MAP_HTML_CLASS);
305
+ document.body.classList.add(SUMMONED_MAP_HTML_CLASS);
306
+
307
+ function handlePotentiallyMapDismissingDocumentClick(event) {
308
+ const clickedInsideMapMarkerReference = event.target.closest('[data-map-marker]');
309
+ if (!target.contains(event.target) && !clickedInsideMapMarkerReference && mapIsSummoned()) {
310
+ dismissMap();
311
+ deselectMarkers();
312
+ document.removeEventListener('click', handlePotentiallyMapDismissingDocumentClick);
313
+ }
314
+ }
315
+ document.addEventListener('click', handlePotentiallyMapDismissingDocumentClick);
316
+ }
317
+
318
+ function dismissMap() {
319
+ hideAllTippys();
320
+ target.classList.remove(SUMMONED_MAP_HTML_CLASS);
321
+ document.body.classList.remove(SUMMONED_MAP_HTML_CLASS);
322
+ }
323
+
324
+ function mapIsSummoned() {
325
+ return target.classList.contains(SUMMONED_MAP_HTML_CLASS);
326
+ }
327
+
328
+ return {
329
+ map: map,
330
+ };
331
+ }
332
+
333
+ }());
@@ -0,0 +1,15 @@
1
+ (function () {
2
+
3
+ var gaid = document.documentElement.getAttribute('data-gaid');
4
+
5
+ if (gaid) {
6
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
7
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
8
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
9
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
10
+
11
+ ga('create', gaid, 'auto');
12
+ ga('send', 'pageview');
13
+ }
14
+
15
+ }());
@@ -0,0 +1,125 @@
1
+ (function () {
2
+
3
+ // Requires accompanying CSS rules, based on classes on main container
4
+ // (body) that style header, menu and trigger button.
5
+ // Container classes used: .with-expandable-nav, .with-expanded-nav
6
+
7
+ class NavTrigger {
8
+ constructor({ triggerTemplateSelector, onTriggerClick }) {
9
+ this.onTriggerClick = onTriggerClick;
10
+ this.triggerTemplate = document.querySelector(`${triggerTemplateSelector}`);
11
+ this.triggerEl = document.importNode(this.triggerTemplate.content, true);
12
+ }
13
+
14
+ render() {
15
+ const wrapper = this.triggerEl.children[0];
16
+ wrapper.addEventListener('click', this.onTriggerClick);
17
+ return wrapper;
18
+ }
19
+ }
20
+
21
+ class ExpandableContainer {
22
+ constructor({
23
+ containerEl,
24
+ headerEl,
25
+ mainEl,
26
+ footerEl,
27
+ expandableNavEl, priorityNavEl,
28
+ expandableHtmlClass, expandedHtmlClass }) {
29
+
30
+ this.toggle = this.toggle.bind(this);
31
+
32
+ this.expandedHtmlClass = expandedHtmlClass;
33
+
34
+ this.containerEl = containerEl;
35
+ this.headerEl = headerEl;
36
+ this.mainEl = mainEl;
37
+ this.footerEl = footerEl;
38
+ this.expandableNavEl = expandableNavEl;
39
+ this.priorityNavEl = priorityNavEl;
40
+
41
+ this.expandableNavBottomOffset = 20;
42
+ this.containerEl.classList.add(expandableHtmlClass);
43
+
44
+ this.expanded = false;
45
+ this.animationTimeout = undefined;
46
+ }
47
+
48
+ toggle() {
49
+ this.expanded = !this.expanded;
50
+ this.update();
51
+ }
52
+
53
+ update() {
54
+ if (this.expanded) {
55
+ window.clearTimeout(this.animationTimeout);
56
+
57
+ // Hold main position
58
+ const mainTopOffset =
59
+ this.mainEl.getBoundingClientRect().top +
60
+ document.documentElement.scrollTop -
61
+ (document.documentElement.clientTop || document.body.clientTop || 0);
62
+ this.mainEl.style.marginTop = `${mainTopOffset}px`;
63
+
64
+ this.containerEl.classList.add(this.expandedHtmlClass);
65
+
66
+ const expH = this.expandableNavEl ?
67
+ this.expandableNavEl.getBoundingClientRect().height :
68
+ 0;
69
+
70
+ const prioH = this.priorityNavEl ?
71
+ this.priorityNavEl.getBoundingClientRect().height :
72
+ 0;
73
+
74
+ const heightDifference = expH - prioH + this.expandableNavBottomOffset;
75
+
76
+ this.headerEl.style.paddingBottom = `${heightDifference}px`;
77
+ this.headerEl.style.zIndex = '2';
78
+ this.headerEl.style.position = 'absolute';
79
+ this.headerEl.style.top = '0px';
80
+ this.headerEl.style.left = '0px';
81
+ this.headerEl.style.right = '0px';
82
+
83
+ } else {
84
+ this.containerEl.classList.remove(this.expandedHtmlClass);
85
+ this.headerEl.style.removeProperty('padding-bottom');
86
+
87
+ window.clearTimeout(this.animationTimeout);
88
+
89
+ this.animationTimeout = window.setTimeout(() => {
90
+ this.mainEl.style.removeProperty('margin-top');
91
+ this.headerEl.style.removeProperty('z-index');
92
+ this.headerEl.style.removeProperty('position');
93
+ }, 1000);
94
+ }
95
+ }
96
+ }
97
+
98
+ const body = document.querySelector('body');
99
+ const headerEl = document.querySelector('body > header');
100
+ const expandableNavEl = headerEl.querySelector('nav.expandable-nav');
101
+ const committeeMenuEl = headerEl.querySelector('.committee-widget .committee-menu');
102
+
103
+ if (expandableNavEl || committeeMenuEl) {
104
+
105
+ const container = new ExpandableContainer({
106
+ containerEl: body,
107
+ expandableHtmlClass: 'with-expandable-nav',
108
+ expandedHtmlClass: 'with-expanded-nav',
109
+ headerEl: headerEl,
110
+ footerEl: document.querySelector('body > footer'),
111
+ mainEl: document.querySelector('body > main'),
112
+ expandableNavEl: expandableNavEl,
113
+ priorityNavEl: headerEl.querySelector('nav.priority-nav'),
114
+ });
115
+
116
+ const trigger = new NavTrigger({
117
+ triggerTemplateSelector: '#expandableNavTrigger',
118
+ onTriggerClick: container.toggle,
119
+ });
120
+
121
+ headerEl.appendChild(trigger.render());
122
+
123
+ }
124
+
125
+ }());