Converted all client code to Standard JS compliant

This commit is contained in:
NGPixel
2017-02-09 20:24:28 -05:00
parent 414dc386d6
commit 547f3065d3
28 changed files with 418 additions and 173 deletions

View File

@@ -1,8 +1,9 @@
/* global $, Vue, mde, _ */
const videoRules = {
'youtube': new RegExp(/(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/, 'i'),
'vimeo': new RegExp(/vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|)(\d+)(?:$|\/|\?)/, 'i'),
'dailymotion': new RegExp(/(?:dailymotion\.com(?:\/embed)?(?:\/video|\/hub)|dai\.ly)\/([0-9a-z]+)(?:[\-_0-9a-zA-Z]+(?:#video=)?([a-z0-9]+)?)?/, 'i')
'youtube': new RegExp(/(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|&v(?:i)?=))([^#&?]*).*/, 'i'),
'vimeo': new RegExp(/vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^/]*)\/videos\/|album\/(?:\d+)\/video\/|)(\d+)(?:$|\/|\?)/, 'i'),
'dailymotion': new RegExp(/(?:dailymotion\.com(?:\/embed)?(?:\/video|\/hub)|dai\.ly)\/([0-9a-z]+)(?:[-_0-9a-zA-Z]+(?:#video=)?([a-z0-9]+)?)?/, 'i')
}
// Vue Video instance
@@ -18,7 +19,7 @@ let vueVideo = new Vue({
$('#modal-editor-video input').focus()
},
cancel: (ev) => {
mdeModalOpenState = false
mdeModalOpenState = false // eslint-disable-line no-undef
$('#modal-editor-video').removeClass('is-active')
vueVideo.link = ''
},
@@ -27,7 +28,7 @@ let vueVideo = new Vue({
mde.codemirror.execCommand('singleSelection')
}
// Guess video type
// Guess video type
let videoType = _.findKey(videoRules, (vr) => {
return vr.test(vueVideo.link)
@@ -36,7 +37,7 @@ let vueVideo = new Vue({
videoType = 'video'
}
// Insert video tag
// Insert video tag
let videoText = '[video](' + vueVideo.link + '){.' + videoType + '}\n'