Commit 2a526a56 authored by Klaus-Dieter Quibeldey-Cirkel's avatar Klaus-Dieter Quibeldey-Cirkel 🏀

Merge branch '1000-disable-the-presentation-clock-on-safari-browsers' into 'staging'

Resolve "Disable the presentation clock on safari browsers"

Closes #1000

See merge request arsnova/flashcards!1155
parents f4996e61 eadca664
......@@ -3,4 +3,8 @@ export let NavigatorCheck = class CardVisuals {
static isIOS () {
return ['iPad', 'iPhone', 'iPod'].indexOf(navigator.platform) >= 0;
}
static isSafari () {
return navigator.userAgent.indexOf("Safari") >= 0 && navigator.userAgent.indexOf("Chrome") === -1;
}
};
<template name="cardHeaderItemClock">
<svg class="clock cardHeaderItem hidden-xs" xmlns="http://www.w3.org/2000/svg" width="600" height="600" viewBox="0 0 600 600">
<g class="face">
<circle class="circle" cx="300" cy="300" r="253.9"/>
<path class="hour-marks"
d="M300.5 94V61M506 300.5h32M300.5 506v33M94 300.5H60M411.3 107.8l7.9-13.8M493 190.2l13-7.4M492.1 411.4l16.5 9.5M411 492.3l8.9 15.3M189 492.3l-9.2 15.9M107.7 411L93 419.5M107.5 189.3l-17.1-9.9M188.1 108.2l-9-15.6"/>
</g>
<g class="hour">
<path class="hour-arm" d="M300.5 298V142"/>
<circle class="sizing-box" cx="300" cy="300" r="253.9"/>
</g>
<g class="minute">
<path class="minute-arm" d="M300.5 298V67"/>
<circle class="sizing-box" cx="300" cy="300" r="253.9"/>
</g>
<g class="second">
<path class="second-arm" d="M300.5 350V55"/>
<circle class="sizing-box" cx="300" cy="300" r="253.9"/>
</g>
<g class="mid">
<circle class="mid-circle" cx="300" cy="300" r="20.0"/>
</g>
</svg>
{{#unless isSafariOriOS}}
<svg class="clock cardHeaderItem hidden-xs" xmlns="http://www.w3.org/2000/svg" width="600" height="600"
viewBox="0 0 600 600">
<g class="face">
<circle class="circle" cx="300" cy="300" r="253.9"/>
<path class="hour-marks"
d="M300.5 94V61M506 300.5h32M300.5 506v33M94 300.5H60M411.3 107.8l7.9-13.8M493 190.2l13-7.4M492.1 411.4l16.5 9.5M411 492.3l8.9 15.3M189 492.3l-9.2 15.9M107.7 411L93 419.5M107.5 189.3l-17.1-9.9M188.1 108.2l-9-15.6"/>
</g>
<g class="hour">
<path class="hour-arm" d="M300.5 298V142"/>
<circle class="sizing-box" cx="300" cy="300" r="253.9"/>
</g>
<g class="minute">
<path class="minute-arm" d="M300.5 298V67"/>
<circle class="sizing-box" cx="300" cy="300" r="253.9"/>
</g>
<g class="second">
<path class="second-arm" d="M300.5 350V55"/>
<circle class="sizing-box" cx="300" cy="300" r="253.9"/>
</g>
<g class="mid">
<circle class="mid-circle" cx="300" cy="300" r="20.0"/>
</g>
</svg>
{{/unless}}
</template>
import "./clock.html";
import {NavigatorCheck} from "../../../../api/navigatorCheck";
function updatePresentationClock() {
let date = new Date();
......@@ -18,6 +19,13 @@ function updatePresentationClock() {
* presentationClock
* ############################################################################
*/
Template.cardHeaderItemClock.helpers({
isSafariOriOS: function () {
return NavigatorCheck.isIOS() || NavigatorCheck.isSafari();
}
});
let clockInterval;
Template.cardHeaderItemClock.onRendered(function () {
updatePresentationClock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment