Skip to content

Commit

Permalink
Apply standard --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jiri-janousek committed Nov 8, 2020
1 parent dfa91fd commit c45e16f
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions integrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@

(function (Nuvola) {
// Create media player component
var player = Nuvola.$object(Nuvola.MediaPlayer)
const player = Nuvola.$object(Nuvola.MediaPlayer)

// Handy aliases
var PlaybackState = Nuvola.PlaybackState
var PlayerAction = Nuvola.PlayerAction
const PlaybackState = Nuvola.PlaybackState
const PlayerAction = Nuvola.PlayerAction

// Translations
var C_ = Nuvola.Translate.pgettext
const C_ = Nuvola.Translate.pgettext

// Custom action
var ACTION_LIKE = 'like'
const ACTION_LIKE = 'like'

// Create new WebApp prototype
var WebApp = Nuvola.$WebApp()
const WebApp = Nuvola.$WebApp()

WebApp._onInitAppRunner = function (emitter) {
Nuvola.WebApp._onInitAppRunner.call(this, emitter)
Expand All @@ -50,7 +50,7 @@
WebApp._onInitWebWorker = function (emitter) {
Nuvola.WebApp._onInitWebWorker.call(this, emitter)

var state = document.readyState
const state = document.readyState
if (state === 'interactive' || state === 'complete') {
this._onPageReady()
} else {
Expand All @@ -75,21 +75,21 @@
WebApp.update = function () {
/* Fox for white flash container */
if (!this.flashFixed) {
var movieContainer = document.querySelector('div.movieContainer')
const movieContainer = document.querySelector('div.movieContainer')
if (movieContainer) {
movieContainer.style.visibility = 'hidden'
this.flashFixed = true
}
}

var track = {
const track = {
title: null,
artist: null,
album: null,
artLocation: null
}

var buttons = this.getButtons()
const buttons = this.getButtons()
this.state = this.getState()
player.setCanPause(!!buttons.pause)
player.setCanPlay(!!buttons.play)
Expand All @@ -110,8 +110,8 @@
}

WebApp.getButtons = function () {
var skip = document.getElementById('player_skip_button') || document.getElementById('youtube_skip_button')
var like = document.getElementById('player_like_button') || document.getElementById('youtube_like_button')
const skip = document.getElementById('player_skip_button') || document.getElementById('youtube_skip_button')
const like = document.getElementById('player_like_button') || document.getElementById('youtube_like_button')
switch (this.getState()) {
case PlaybackState.PAUSED:
return {
Expand All @@ -133,7 +133,7 @@
}

WebApp.getState = function () {
var elm = document.getElementById('mix_youtube')
const elm = document.getElementById('mix_youtube')
if (!elm || elm.style.display === 'none') {
return PlaybackState.UNKNOWN
}
Expand All @@ -142,7 +142,7 @@

// Handler of playback actions
WebApp._onActionActivated = function (emitter, name, param) {
var buttons = this.getButtons()
const buttons = this.getButtons()
switch (name) {
case PlayerAction.TOGGLE_PLAY:
if (this.state === PlaybackState.PLAYING) {
Expand All @@ -168,4 +168,4 @@
}

WebApp.start()
})(this) // function(Nuvola)
})(this) // function(Nuvola)

0 comments on commit c45e16f

Please sign in to comment.