From e22877900bda086e60fbed89832058c85f6b00bb Mon Sep 17 00:00:00 2001 From: vishvanath45 Date: Tue, 31 Jan 2017 23:49:18 +0530 Subject: [PATCH] Removed Lint errors. --- popup.js | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/popup.js b/popup.js index 24b5542..e7cb664 100644 --- a/popup.js +++ b/popup.js @@ -1,7 +1,8 @@ - +"use strict"; // Styling content // Place suggestion in query box + function suggestionAsValue() { var sLabel; sLabel = document.getElementById("suggest-label"); @@ -43,7 +44,17 @@ function keyboardShortCutListener(e) { } } } - + /* eslint-disable */ +function trim(s, mask) { + while (~mask.indexOf(s[0])) { + s = s.slice(1); + } + while (~mask.indexOf(s[s.length - 1])) { + s = s.slice(0, -1); + } + return s; +} + /* eslint-enable */ function register(event) { var set1; var set2; @@ -98,16 +109,17 @@ function register(event) { query = querySplit[0]; formats = formats + "|" + suggestedFormat; } + formats = trim(formats, "|"); + /* eslint-disable */ - window.open("http://www.google.com/search?q="+query+" -"+uuid+" -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" ("+formats+")"); - - if(document.getElementById("GDrive").checked === true) - { - if((document.getElementById("video").checked === true)||(document.getElementById("music").checked === true)){ - window.open("https://www.google.co.in/#q="+query+" site:drive.google.com ("+formats+")"); - } - else{ - window.open("https://www.google.co.in/#q="+query+" site:docs.google.com ("+formats+")"); + window.open("http://www.google.com/search?q=" + query + " - " + uuid + " -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" (" + formats + ")"); + if (check4) { + + if ((document.getElementById("video").checked === true) || (document.getElementById("music").checked === true)) { + window.open("https://www.google.co.in/#q=" + query + " site:drive.google.com (" + formats + ")"); + + } else { + window.open("https://www.google.co.in/#q=" + query + " site:docs.google.com (" + formats + ")"); } } /* eslint-enable */