diff --git a/src/Foundation.hs b/src/Foundation.hs index 32ae21e7e..62383403b 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -360,6 +360,7 @@ defaultMenuLayout menu widget = do pc <- widgetToPageContent $ do addStylesheetRemote "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,800,900" + addScript $ StaticR js_featureChecker_js addStylesheet $ StaticR css_fonts_css addStylesheet $ StaticR css_icons_css $(widgetFile "default-layout") diff --git a/src/Handler/Term.hs b/src/Handler/Term.hs index 3eee14c4e..6fa1ae646 100644 --- a/src/Handler/Term.hs +++ b/src/Handler/Term.hs @@ -77,7 +77,7 @@ getTermShowR = do } defaultLayout $ do setTitle "Freigeschaltete Semester" - table + $(widgetFile "terms") getTermEditR :: Handler Html getTermEditR = do diff --git a/static/js/featureChecker.js b/static/js/featureChecker.js new file mode 100644 index 000000000..a3a21e663 --- /dev/null +++ b/static/js/featureChecker.js @@ -0,0 +1,7 @@ +window.addEventListener('touchstart', function onFirstTouch() { + // we could use a class + document.body.classList.add('touch-supported'); + + // we only need to know once that a human touched the screen, so we can stop listening now + window.removeEventListener('touchstart', onFirstTouch, false); +}, false); diff --git a/templates/courses.hamlet b/templates/courses.hamlet index 56a9134b6..e4f6fb292 100644 --- a/templates/courses.hamlet +++ b/templates/courses.hamlet @@ -1,6 +1,7 @@