mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 09:27:23 +00:00
Themes: init
This commit is contained in:
parent
251fa153f0
commit
cbc6207ad9
9 changed files with 108 additions and 46 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import { h } from 'preact'
|
||||
|
||||
export default function ({ emitName, emitURL }) {
|
||||
const reURL = /^(http|https):\/\/[^ "]+$/
|
||||
export default function ({ setTargetName, setTargetUrl }) {
|
||||
const urlRE = /^(http|https):\/\/[^ "]+$/
|
||||
|
||||
const emit = url => {
|
||||
emitName(url)
|
||||
emitURL(url)
|
||||
setTargetName(url)
|
||||
setTargetUrl(url)
|
||||
}
|
||||
|
||||
const urlInputHandler = ({ target }) => {
|
||||
const url = target.value
|
||||
emit(reURL.test(url)
|
||||
emit(urlRE.test(url)
|
||||
? url
|
||||
: null)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue