export class Paginator { constructor(host, context, path) { this.endpoint = `${host}${context}?path=${path}`; } populatePageAnchors() { const pagination_widget = document.querySelector(".pagination"); var anchors = pagination_widget.querySelectorAll('a'); for(let anchor of anchors) { var page = /\d/.exec(anchor.id)[0]; anchor.setAttribute("href", `${this.endpoint}&page=${page}`); } } }