mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
linting
This commit is contained in:
parent
fa64f930a9
commit
9d484a49d0
@ -148,18 +148,18 @@
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
this.$http
|
this.$http
|
||||||
.get<string>('https://raw.githubusercontent.com/nurdism/neko/master/docs/README.md')
|
.get<string>('https://raw.githubusercontent.com/nurdism/neko/master/docs/README.md')
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
return this.$http.post('https://api.github.com/markdown', {
|
return this.$http.post('https://api.github.com/markdown', {
|
||||||
text: res.data,
|
text: res.data,
|
||||||
mode: 'gfm',
|
mode: 'gfm',
|
||||||
context: 'github/gollum',
|
context: 'github/gollum',
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
this.$accessor.client.setAbout(res.data)
|
this.$accessor.client.setAbout(res.data)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.catch(err => console.error(err))
|
.catch((err) => console.error(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
<template v-if="admin">
|
<template v-if="admin">
|
||||||
<li class="seperator" />
|
<li class="seperator" />
|
||||||
<li>
|
<li>
|
||||||
<span @click="kick(child.data.member)" style="color: #f04747">{{ $t('context.kick') }}</span>
|
<span @click="kick(child.data.member)" style="color: #f04747;">{{ $t('context.kick') }}</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span @click="ban(child.data.member)" style="color: #f04747">{{ $t('context.ban') }}</span>
|
<span @click="ban(child.data.member)" style="color: #f04747;">{{ $t('context.ban') }}</span>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
@ -329,7 +329,7 @@
|
|||||||
for (const emoji of this.list) {
|
for (const emoji of this.list) {
|
||||||
if (
|
if (
|
||||||
emoji.includes(this.search) || typeof this.keywords[emoji] !== 'undefined'
|
emoji.includes(this.search) || typeof this.keywords[emoji] !== 'undefined'
|
||||||
? this.keywords[emoji].some(keyword => keyword.includes(this.search))
|
? this.keywords[emoji].some((keyword) => keyword.includes(this.search))
|
||||||
: false
|
: false
|
||||||
) {
|
) {
|
||||||
filtered.push(emoji)
|
filtered.push(emoji)
|
||||||
|
@ -150,7 +150,7 @@
|
|||||||
'cold',
|
'cold',
|
||||||
'blush',
|
'blush',
|
||||||
'sad',
|
'sad',
|
||||||
].filter(v => !this.recent.includes(v))
|
].filter((v) => !this.recent.includes(v))
|
||||||
}
|
}
|
||||||
|
|
||||||
get muted() {
|
get muted() {
|
||||||
|
@ -64,7 +64,7 @@ function htmlTag(
|
|||||||
if (attributes.class && state.cssModuleNames) {
|
if (attributes.class && state.cssModuleNames) {
|
||||||
attributes.class = attributes.class
|
attributes.class = attributes.class
|
||||||
.split(' ')
|
.split(' ')
|
||||||
.map(cl => state.cssModuleNames[cl] || cl)
|
.map((cl) => state.cssModuleNames[cl] || cl)
|
||||||
.join(' ')
|
.join(' ')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ const rules: MarkdownRules = {
|
|||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
...text,
|
...text,
|
||||||
match: source => /^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff-]|\n\n|\n|\w+:\S|$)/.exec(source),
|
match: (source) => /^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff-]|\n\n|\n|\w+:\S|$)/.exec(source),
|
||||||
html(node, output, state) {
|
html(node, output, state) {
|
||||||
if (state.escapeHTML) {
|
if (state.escapeHTML) {
|
||||||
return md.sanitizeText(node.content)
|
return md.sanitizeText(node.content)
|
||||||
@ -214,7 +214,7 @@ const rules: MarkdownRules = {
|
|||||||
},
|
},
|
||||||
emoji: {
|
emoji: {
|
||||||
order: md.defaultRules.strong.order,
|
order: md.defaultRules.strong.order,
|
||||||
match: source => /^:([a-zA-z_-]*):/.exec(source),
|
match: (source) => /^:([a-zA-z_-]*):/.exec(source),
|
||||||
parse(capture) {
|
parse(capture) {
|
||||||
return {
|
return {
|
||||||
id: capture[1],
|
id: capture[1],
|
||||||
@ -235,7 +235,7 @@ const rules: MarkdownRules = {
|
|||||||
},
|
},
|
||||||
emoticon: {
|
emoticon: {
|
||||||
order: md.defaultRules.text.order,
|
order: md.defaultRules.text.order,
|
||||||
match: source => /^(¯\\_\(ツ\)_\/¯)/.exec(source),
|
match: (source) => /^(¯\\_\(ツ\)_\/¯)/.exec(source),
|
||||||
parse(capture) {
|
parse(capture) {
|
||||||
return {
|
return {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
@ -248,7 +248,7 @@ const rules: MarkdownRules = {
|
|||||||
},
|
},
|
||||||
spoiler: {
|
spoiler: {
|
||||||
order: 0,
|
order: 0,
|
||||||
match: source => /^\|\|([\s\S]+?)\|\|/.exec(source),
|
match: (source) => /^\|\|([\s\S]+?)\|\|/.exec(source),
|
||||||
parse(capture, parse, state) {
|
parse(capture, parse, state) {
|
||||||
return {
|
return {
|
||||||
content: parse(capture[1], state),
|
content: parse(capture[1], state),
|
||||||
|
@ -327,7 +327,7 @@
|
|||||||
this.$accessor.video.setPlayable(false)
|
this.$accessor.video.setPlayable(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
this._video.addEventListener('error', event => {
|
this._video.addEventListener('error', (event) => {
|
||||||
this.$log.error(event.error)
|
this.$log.error(event.error)
|
||||||
this.$accessor.video.setPlayable(false)
|
this.$accessor.video.setPlayable(false)
|
||||||
})
|
})
|
||||||
@ -352,7 +352,7 @@
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
this.onResise()
|
this.onResise()
|
||||||
})
|
})
|
||||||
.catch(err => this.$log.error)
|
.catch((err) => this.$log.error)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.$log.error(err)
|
this.$log.error(err)
|
||||||
}
|
}
|
||||||
@ -391,7 +391,7 @@
|
|||||||
if (this.hosting && navigator.clipboard && typeof navigator.clipboard.readText === 'function') {
|
if (this.hosting && navigator.clipboard && typeof navigator.clipboard.readText === 'function') {
|
||||||
navigator.clipboard
|
navigator.clipboard
|
||||||
.readText()
|
.readText()
|
||||||
.then(text => {
|
.then((text) => {
|
||||||
if (this.clipboard !== text) {
|
if (this.clipboard !== text) {
|
||||||
this.$accessor.remote.setClipboard(text)
|
this.$accessor.remote.setClipboard(text)
|
||||||
this.$accessor.remote.sendClipboard(text)
|
this.$accessor.remote.sendClipboard(text)
|
||||||
|
@ -27,7 +27,7 @@ Vue.use(Client)
|
|||||||
new Vue({
|
new Vue({
|
||||||
i18n,
|
i18n,
|
||||||
store,
|
store,
|
||||||
render: h => h(app),
|
render: (h) => h(app),
|
||||||
created() {
|
created() {
|
||||||
const click = () => {
|
const click = () => {
|
||||||
this.$accessor.setActive()
|
this.$accessor.setActive()
|
||||||
|
@ -62,8 +62,8 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
|
|||||||
this._ws = new WebSocket(`${url}ws?password=${password}`)
|
this._ws = new WebSocket(`${url}ws?password=${password}`)
|
||||||
this.emit('debug', `connecting to ${this._ws.url}`)
|
this.emit('debug', `connecting to ${this._ws.url}`)
|
||||||
this._ws.onmessage = this.onMessage.bind(this)
|
this._ws.onmessage = this.onMessage.bind(this)
|
||||||
this._ws.onerror = event => this.onError.bind(this)
|
this._ws.onerror = (event) => this.onError.bind(this)
|
||||||
this._ws.onclose = event => this.onDisconnected.bind(this, new Error('websocket closed'))
|
this._ws.onclose = (event) => this.onDisconnected.bind(this, new Error('websocket closed'))
|
||||||
this._timeout = setTimeout(this.onTimeout.bind(this), 15000)
|
this._timeout = setTimeout(this.onTimeout.bind(this), 15000)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.onDisconnected(err)
|
this.onDisconnected(err)
|
||||||
@ -174,15 +174,15 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
|
|||||||
|
|
||||||
this._peer = new RTCPeerConnection()
|
this._peer = new RTCPeerConnection()
|
||||||
|
|
||||||
this._peer.onconnectionstatechange = event => {
|
this._peer.onconnectionstatechange = (event) => {
|
||||||
this.emit('debug', `peer connection state changed`, this._peer ? this._peer.connectionState : undefined)
|
this.emit('debug', `peer connection state changed`, this._peer ? this._peer.connectionState : undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._peer.onsignalingstatechange = event => {
|
this._peer.onsignalingstatechange = (event) => {
|
||||||
this.emit('debug', `peer signaling state changed`, this._peer ? this._peer.signalingState : undefined)
|
this.emit('debug', `peer signaling state changed`, this._peer ? this._peer.signalingState : undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._peer.oniceconnectionstatechange = event => {
|
this._peer.oniceconnectionstatechange = (event) => {
|
||||||
this._state = this._peer!.iceConnectionState
|
this._state = this._peer!.iceConnectionState
|
||||||
|
|
||||||
this.emit('debug', `peer ice connection state changed: ${this._peer!.iceConnectionState}`)
|
this.emit('debug', `peer ice connection state changed: ${this._peer!.iceConnectionState}`)
|
||||||
@ -217,7 +217,7 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
|
|||||||
this._peer.setRemoteDescription({ type: 'offer', sdp })
|
this._peer.setRemoteDescription({ type: 'offer', sdp })
|
||||||
this._peer
|
this._peer
|
||||||
.createAnswer()
|
.createAnswer()
|
||||||
.then(d => {
|
.then((d) => {
|
||||||
this._peer!.setLocalDescription(d)
|
this._peer!.setLocalDescription(d)
|
||||||
this._ws!.send(
|
this._ws!.send(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@ -227,7 +227,7 @@ export abstract class BaseClient extends EventEmitter<BaseEvents> {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.catch(err => this.emit('error', err))
|
.catch((err) => this.emit('error', err))
|
||||||
}
|
}
|
||||||
|
|
||||||
private onMessage(e: MessageEvent) {
|
private onMessage(e: MessageEvent) {
|
||||||
|
@ -37,7 +37,7 @@ class VueSweetalert2 {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (Object.prototype.hasOwnProperty.call(Swal, methodName) && typeof Swal[methodName] === 'function') {
|
if (Object.prototype.hasOwnProperty.call(Swal, methodName) && typeof Swal[methodName] === 'function') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
swalFunction[methodName] = (method => {
|
swalFunction[methodName] = ((method) => {
|
||||||
return (...args: any[]) => {
|
return (...args: any[]) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return Swal[method].apply(Swal, args)
|
return Swal[method].apply(Swal, args)
|
||||||
|
@ -61,7 +61,7 @@ export const actions = actionTree(
|
|||||||
initialise() {
|
initialise() {
|
||||||
$http
|
$http
|
||||||
.get<Emojis>('/emoji.json')
|
.get<Emojis>('/emoji.json')
|
||||||
.then(req => {
|
.then((req) => {
|
||||||
for (const group of req.data.groups) {
|
for (const group of req.data.groups) {
|
||||||
accessor.emoji.addGroup(group)
|
accessor.emoji.addGroup(group)
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,9 @@ export const state = () => ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const getters = getterTree(state, {
|
export const getters = getterTree(state, {
|
||||||
member: state => state.members[state.id] || null,
|
member: (state) => state.members[state.id] || null,
|
||||||
admin: state => (state.members[state.id] ? state.members[state.id].admin : false),
|
admin: (state) => (state.members[state.id] ? state.members[state.id].admin : false),
|
||||||
muted: state => (state.members[state.id] ? state.members[state.id].muted : false),
|
muted: (state) => (state.members[state.id] ? state.members[state.id].muted : false),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const mutations = mutationTree(state, {
|
export const mutations = mutationTree(state, {
|
||||||
|
@ -23,9 +23,9 @@ export const state = () => ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export const getters = getterTree(state, {
|
export const getters = getterTree(state, {
|
||||||
stream: state => state.streams[state.index],
|
stream: (state) => state.streams[state.index],
|
||||||
track: state => state.tracks[state.index],
|
track: (state) => state.tracks[state.index],
|
||||||
resolution: state => ({ w: state.width, h: state.height }),
|
resolution: (state) => ({ w: state.width, h: state.height }),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const mutations = mutationTree(state, {
|
export const mutations = mutationTree(state, {
|
||||||
|
Loading…
Reference in New Issue
Block a user