From 10c667e42cf163e554fe0bf40379046d2ac3ed22 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Tue, 14 Jun 2016 16:26:02 +0100 Subject: [PATCH] Make easy eslint fixes to links.js --- public/assets/js/links.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/public/assets/js/links.js b/public/assets/js/links.js index b683edd5..38467335 100644 --- a/public/assets/js/links.js +++ b/public/assets/js/links.js @@ -6,20 +6,20 @@ var ytidregex = /watch\?v=([A-Za-z0-9\-_]+)/; //grab the notes and loop through them var notes = document.querySelectorAll('.e-content'); -for(var i = 0; i < notes.length; i++) { - //get Youtube ID - var ytid = notes[i].textContent.match(ytidregex); - if(ytid !== null) { - var id = ytid[1]; - var iframe = document.createElement('iframe'); - iframe.classList.add('youtube'); - iframe.setAttribute('src', '//www.youtube.com/embed/' + id); - iframe.setAttribute('frameborder', 0); - iframe.setAttribute('allowfullscreen', 'true'); - notes[i].appendChild(iframe); - } - //now linkify everything - var orig = notes[i].innerHTML; - var linked = autolinker.link(orig); - notes[i].innerHTML = linked; -} \ No newline at end of file +for (var i = 0; i < notes.length; i++) { + //get Youtube ID + var ytid = notes[i].textContent.match(ytidregex); + if (ytid !== null) { + var id = ytid[1]; + var iframe = document.createElement('iframe'); + iframe.classList.add('youtube'); + iframe.setAttribute('src', '//www.youtube.com/embed/' + id); + iframe.setAttribute('frameborder', 0); + iframe.setAttribute('allowfullscreen', 'true'); + notes[i].appendChild(iframe); + } + //now linkify everything + var orig = notes[i].innerHTML; + var linked = autolinker.link(orig); + notes[i].innerHTML = linked; +}