UNPKG

rwt-reading-points

Version:

Percentage read, reading time & points, a standards-based DOM Component

43 lines (38 loc) 1.5 kB
//============================================================================= // // File: /node_modules/rwt-reading-points/readers-item.class.js // Language: ECMAScript 2015 // Copyright: Read Write Tools © 2020 // License: MIT // Initial date: Jan 15, 2019 // Contents: An object representing a single page // //============================================================================= export default class ReadersItem { constructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { if (arg0.constructor.name == 'Object') this.copyConstructor(arg0); else this.normalConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6 ); } copyConstructor(rhs) { this.title = rhs.title; this.skillCategory = rhs.skillCategory; this.skillLevel = rhs.skillLevel; this.skillPoints = rhs.skillPoints; this.suggestedReadingTime = rhs.suggestedReadingTime; this.percentRead = rhs.percentRead; this.readingTime = rhs.readingTime; Object.seal(this); } normalConstructor(title, skillCategory, skillLevel, skillPoints, suggestedReadingTime, percentRead, readingTime) { this.title = title; this.skillCategory = skillCategory; this.skillLevel = skillLevel; this.skillPoints = skillPoints; this.suggestedReadingTime = suggestedReadingTime; this.percentRead = percentRead; // 0.0 to 1.0 this.readingTime = readingTime; // integer time in seconds Object.seal(this); } }