-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from jaredmoody/standard-js
Fixes #157 - Replace eslint with standard js
- Loading branch information
Showing
25 changed files
with
1,331 additions
and
1,095 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import '@hotwired/turbo-rails'; | ||
import './controllers'; | ||
import '@hotwired/turbo-rails' | ||
import './controllers' | ||
|
||
import Player from './player'; | ||
import Player from './player' | ||
|
||
window.App = { player: new Player() }; | ||
window.App = { player: new Player() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { Application } from '@hotwired/stimulus'; | ||
import { Application } from '@hotwired/stimulus' | ||
|
||
const application = Application.start(); | ||
const application = Application.start() | ||
|
||
// Configure Stimulus development experience | ||
application.debug = false; | ||
window.Stimulus = application; | ||
application.debug = false | ||
window.Stimulus = application | ||
|
||
export { application }; | ||
export { application } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
static values = { | ||
isShown: Boolean | ||
} | ||
|
||
initialize() { | ||
initialize () { | ||
if (this.isShownValue) { | ||
this.show(); | ||
this.show() | ||
} else { | ||
this.hide(); | ||
this.hide() | ||
} | ||
} | ||
|
||
connect() { | ||
this.element.addEventListener('dialog:hide', this.hide); | ||
this.element.addEventListener('dialog:show', this.show); | ||
connect () { | ||
this.element.addEventListener('dialog:hide', this.hide) | ||
this.element.addEventListener('dialog:show', this.show) | ||
} | ||
|
||
disconnect() { | ||
this.element.removeEventListener('dialog:hide', this.hide); | ||
this.element.removeEventListener('dialog:show', this.show); | ||
disconnect () { | ||
this.element.removeEventListener('dialog:hide', this.hide) | ||
this.element.removeEventListener('dialog:show', this.show) | ||
} | ||
|
||
show = () => { | ||
document.querySelector('#js-overlay').classList.remove('u-display-none'); | ||
this.element.classList.remove('u-display-none'); | ||
document.querySelector('#js-overlay').classList.remove('u-display-none') | ||
this.element.classList.remove('u-display-none') | ||
} | ||
|
||
hide = () => { | ||
document.querySelector('#js-overlay').classList.add('u-display-none'); | ||
this.element.classList.add('u-display-none'); | ||
document.querySelector('#js-overlay').classList.add('u-display-none') | ||
this.element.classList.add('u-display-none') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
static targets = ['list']; | ||
static targets = ['list'] | ||
|
||
show() { | ||
this.listTarget.classList.remove('u-display-none'); | ||
show () { | ||
this.listTarget.classList.remove('u-display-none') | ||
|
||
document.addEventListener('click', () => { | ||
this.listTarget.classList.add('u-display-none'); | ||
}, { once: true, capture: true }); | ||
this.listTarget.classList.add('u-display-none') | ||
}, { once: true, capture: true }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
static values = { | ||
timeout: { type: Number, default: 4000 } | ||
} | ||
|
||
connect() { | ||
setTimeout(this._removeFlash.bind(this), this.timeoutValue); | ||
connect () { | ||
setTimeout(this._removeFlash.bind(this), this.timeoutValue) | ||
} | ||
|
||
_removeFlash() { | ||
this.element.addEventListener('animationend', function removeFlashElement() { | ||
this.remove(); | ||
}, { once: true }); | ||
_removeFlash () { | ||
this.element.addEventListener('animationend', function removeFlashElement () { | ||
this.remove() | ||
}, { once: true }) | ||
|
||
this.element.classList.add('o-animation-fadeOutUp'); | ||
this.element.classList.add('o-animation-fadeOutUp') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
import { Controller } from '@hotwired/stimulus' | ||
|
||
export default class extends Controller { | ||
reset() { | ||
this.element.reset(); | ||
reset () { | ||
this.element.reset() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.