-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1.3.x' into temp-489ead
- Loading branch information
Showing
50 changed files
with
1,034 additions
and
212 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pull_request_rules: | ||
- name: Automatic merge | ||
description: Merge when PR passes all branch protection and has label automerge | ||
conditions: | ||
- label = automerge | ||
actions: | ||
merge: | ||
- name: Label conflicting pull requests | ||
description: Add a label to a pull request with conflict to spot it easily | ||
conditions: | ||
- conflict | ||
- '-closed' | ||
actions: | ||
label: | ||
toggle: | ||
- conflict |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
import { Controller } from '@hotwired/stimulus'; | ||
|
||
/* stimulusFetch: 'lazy' */ | ||
export default class extends Controller { | ||
dispatchEvent = (name, payload) => { | ||
this.dispatch(name, { detail: payload }); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
import AbstractController from './abstract_controller.js'; | ||
|
||
/* stimulusFetch: 'lazy' */ | ||
export default class extends AbstractController { | ||
update = async ({counter}) => { | ||
await navigator.setAppBadge(counter); | ||
this.dispatchEvent('badge:updated', { counter }); | ||
} | ||
|
||
clear = async () => { | ||
await navigator.clearAppBadge(); | ||
this.dispatchEvent('badge:cleared'); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
import AbstractController from './abstract_controller.js'; | ||
|
||
/* stimulusFetch: 'lazy' */ | ||
export default class extends AbstractController { | ||
async connect() { | ||
const battery = await navigator.getBattery(); | ||
battery.addEventListener('chargingchange', () => this.updateChargeInfo(battery)); | ||
battery.addEventListener('levelchange', () => this.updateLevelInfo(battery)); | ||
battery.addEventListener('chargingtimechange', () => this.updateChargingInfo(battery)); | ||
battery.addEventListener('dischargingtimechange', () => this.updateDischargingInfo(battery)); | ||
|
||
await this.updateChargeInfo(battery); | ||
await this.updateLevelInfo(battery); | ||
await this.updateChargingInfo(battery); | ||
await this.updateDischargingInfo(battery); | ||
} | ||
update = async ({counter}) => { | ||
await navigator.setAppBadge(counter); | ||
this.dispatchEvent('badge:updated', { counter }); | ||
} | ||
|
||
updateChargeInfo = async (battery) => { | ||
this.dispatchEvent('battery:charge', { charging: battery.charging }); | ||
} | ||
updateLevelInfo = async (battery) => { | ||
this.dispatchEvent('battery:level', { level: battery.level }); | ||
} | ||
updateChargingInfo = async (battery) => { | ||
this.dispatchEvent('battery:chargingtime', { chargingTime: battery.chargingTime }); | ||
} | ||
updateDischargingInfo = async (battery) => { | ||
this.dispatchEvent('battery:dischargingtime', { dischargingTime: battery.dischargingTime }); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
import AbstractController from './abstract_controller.js'; | ||
|
||
/* stimulusFetch: 'lazy' */ | ||
export default class extends AbstractController { | ||
connect() { | ||
window.addEventListener( | ||
'deviceorientation', | ||
(event) => { | ||
this.dispatchEvent({ | ||
absolute: event.absolute, | ||
alpha: event.alpha, | ||
beta: event.beta, | ||
gamma: event.gamma | ||
}) | ||
}, | ||
true | ||
); | ||
} | ||
} |
Oops, something went wrong.