Minor fixes

This commit is contained in:
Schmelczer András 2020-01-08 22:22:26 +01:00
parent 073f087e52
commit aa0906405c
19 changed files with 219 additions and 174 deletions

View file

View file

@ -0,0 +1,5 @@
export const turnOnAnimations = () =>
document.body.parentElement.setAttribute('animations', 'on');
export const turnOffAnimations = () =>
document.body.parentElement.setAttribute('animations', 'off');

View file

@ -1,6 +1,6 @@
export const addImul = () => {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
if (!Math.imul)
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul
Math.imul = function(opA, opB) {
opB |= 0; // ensure that opB is an integer. opA will automatically be coerced.
// floating points give us 53 bits of precision to work with plus 1 sign bit

View file

@ -1,4 +1,4 @@
import { addImul } from '../polyfills';
import { addImul } from './polyfills';
export class Random {
public constructor(private seed: number) {

View file

@ -8,6 +8,10 @@ export class Anchor implements Primitive {
) {}
public toHTML(): html {
return `<a class="primitive-anchor" href="${this.href}" rel="noreferrer" target="_blank">${this.text}</a>`;
return `<a class="primitive-anchor"
href="${this.href}"
rel="noreferrer"
target="_blank"
>${this.text}</a>`;
}
}