From 7890968398a644b41eefde560562a23b8728ef87 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 18 Jul 2019 09:09:52 +0900 Subject: [PATCH] Further documentation --- desktop/sources/scripts/library.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index bffba50..99a3291 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -90,7 +90,7 @@ function Library (ronin) { return a === b } - this.and = (a, b, ...rest) => { + this.and = (a, b, ...rest) => { // Returns true if all conditions are true. let args = [a, b].concat(rest) for (let i = 0; i < args.length; i++) { if (!args[i]) { @@ -100,7 +100,7 @@ function Library (ronin) { return args[args.length - 1] } - this.or = (a, b, ...rest) => { + this.or = (a, b, ...rest) => { // Returns true if at least one condition is true. let args = [a, b].concat(rest) for (let i = 0; i < args.length; i++) { if (args[i]) { @@ -327,9 +327,13 @@ function Library (ronin) { this.ronin = ronin // Livecoding - this.time = Date.now + this.time = () => { // Returns timestamp in milliseconds. + return Date.now + } - this.animate = (b = true) => ronin.animate(b) + this.animate = (play = true) => { // Toggles animation. + ronin.animate(play) + } // javascript interop this.js = window