$(function() {
	remark.highlighter.engine.registerLanguage('γλώσσα', glossa);

	var slideshow = remark.create({
		sourceUrl: 'presentation.md',
	//	ratio: '16:9',
		highlightLanguage: 'γλώσσα',
		highlightLines: true,
		highlightStyle: 'vs'
	});

	$(window).on('hashchange', function() {
		if(window.location.hash) {
            var hash = window.location.hash;
			var id = hash.substr(1).replace(/\./ig,'-') + '-';
			var name = hash.substr(1);
		//	console.log(id);
		//	console.log(name);
			var index = $('[id^="' + id +'"]').closest('.remark-slide-container').index() + 1;
			slideshow.gotoSlide(index);
    	}
	});

	slideshow.on('showSlide', function (slide) {
		setTimeout(function() {
			// Clear flowchart markup first
			// Then draw flowchart
			$('.remark-visible .remark-code.flowchart:not(:has(>svg))').each(function () {
				var $this = $(this);
				var html = $this.html();
			//	console.log(html);
				var code = html;
				code = code.replace(/<\/div>/ig, '\n');
				code = code.replace(/<\/?[^>]+>/ig, '');
				code = code.replace(/&lt;/ig, '<');
				code = code.replace(/&gt;/ig, '>');
			//	console.log(code);

				var diagram = flowchart.parse(code);
				$this.html('');
				diagram.drawSVG($this.get(0));
				$this.hide();
				setTimeout(() => {
					$this.find('svg').attr('width', '100%');
					$this.find('svg').attr('height', '98%');
					$this.show();
				}, 100);
			});

			// Prevent scrolling on overflowing code elements
			$('.remark-visible pre > code').each(function () {
				var $this = $(this);
				var el = $this[0];
				var hasHorizontalScrollbar = el.scrollWidth > el.clientWidth;
				var hasVerticalScrollbar = el.scrollHeight > el.clientHeight;
				if (hasHorizontalScrollbar || hasVerticalScrollbar) {
					$this.on('mousewheel', function(event) {
						event.stopPropagation();
					});
				}
			});
		}, 100);
	});
});

@@ -8,16 +8,32 @@
 ion() %7B%0A
+%09'use scrict';%0A%0A
 %09remark.
@@ -1869,13 +1869,448 @@
 0);%0A%09%7D);
+%0A%0A%09if ('serviceWorker' in navigator) %7B%0A%09%09console.log('CLIENT: service worker registration in progress.');%0A%09%09navigator.serviceWorker%0A%09%09%09.register('./service-worker.js')%0A%09%09%09.then(%0A%09%09%09%09function() %7B%0A%09%09%09%09%09console.log('CLIENT: service worker registration complete.');%0A%09%09%09%09%7D,%0A%09%09%09%09function() %7B%0A%09%09%09%09%09console.log('CLIENT: service worker registration failure.');%0A%09%09%09%09%7D%0A%09%09%09);%0A%09%7D else %7B%0A%09%09console.log('CLIENT: service worker is not supported.');%0A%09%7D
 %0A%7D);%0A

Add the presentation to work offline