Skip to content

Commit d420618

Browse files
author
vishvanath45
committed
fixes
1 parent 40530d1 commit d420618

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

popup.js

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
"use strict";
12

23
// Styling content
34

45
// Place suggestion in query box
6+
57
function suggestionAsValue() {
68
var sLabel;
79
sLabel = document.getElementById("suggest-label");
@@ -43,7 +45,17 @@ function keyboardShortCutListener(e) {
4345
}
4446
}
4547
}
46-
48+
/* eslint-disable */
49+
function trim(s, mask) {
50+
while (~mask.indexOf(s[0])) {
51+
s = s.slice(1);
52+
}
53+
while (~mask.indexOf(s[s.length - 1])) {
54+
s = s.slice(0, -1);
55+
}
56+
return s;
57+
}
58+
/* eslint-enable */
4759
function register(event) {
4860
var set1;
4961
var set2;
@@ -98,16 +110,17 @@ function register(event) {
98110
query = querySplit[0];
99111
formats = formats + "|" + suggestedFormat;
100112
}
113+
formats = trim(formats, "|");
114+
101115
/* eslint-disable */
102-
window.open("http://www.google.com/search?q="+query+" -"+uuid+" -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" ("+formats+")");
103-
104-
if(document.getElementById("GDrive").checked === true)
105-
{
106-
if((document.getElementById("video").checked === true)||(document.getElementById("music").checked === true)){
107-
window.open("https://www.google.co.in/#q="+query+" site:drive.google.com ("+formats+")");
108-
}
109-
else{
110-
window.open("https://www.google.co.in/#q="+query+" site:docs.google.com ("+formats+")");
116+
window.open("http://www.google.com/search?q=" + query + " - " + uuid + " -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" (" + formats + ")");
117+
if (check4) {
118+
119+
if ((document.getElementById("video").checked === true) || (document.getElementById("music").checked === true)) {
120+
window.open("https://www.google.co.in/#q=" + query + " site:drive.google.com (" + formats + ")");
121+
122+
} else {
123+
window.open("https://www.google.co.in/#q=" + query + " site:docs.google.com (" + formats + ")");
111124
}
112125
}
113126
/* eslint-enable */
@@ -157,4 +170,4 @@ document.addEventListener("DOMContentLoaded", function () {
157170
document.addEventListener("keyup", keyboardShortCutListener, false);
158171
suggestion();
159172
suggestionAsValue();
160-
});
173+
});

0 commit comments

Comments
 (0)