class playersSearcher { constructor(context_type, context_id) { this.context_type = context_type this.context_id = context_id this.searchType = "by_name" this.query = "" this.page = 1 this.successCallback = () => {} this.errorCallback = () => {} this.beforesendCallback = () => {} this.clearContainer = () => {} } execute() { $.ajax({ type: "POST", url: "/audios/context", data: { context: this.context_type, hash: u("meta[name=csrf]").attr("value"), page: this.page, query: this.query, context_entity: this.context_id, type: this.searchType, returnPlayers: 1, }, beforeSend: () => { this.beforesendCallback() }, error: () => { this.errorCallback() }, success: (response) => { this.successCallback(response, this) } }) } movePage(page) { this.page = page this.execute() } } window.player = new class { context = { object: {}, pagesCount: 0, count: 0, playedPages: [], } __linked_player_id = null current_track_id = 0 tracks = [] // time type: // 0 - shows remaining time before end // 1 - shows full track time get timeType() { return localStorage.getItem('audio.timeType') ?? 0 } set timeType(value) { localStorage.setItem('audio.timeType', value) } //