From 44afcadd4142358993d071acb21a1c6d043d9275 Mon Sep 17 00:00:00 2001 From: Jyotishka Dasgupta Date: Mon, 11 Feb 2019 13:45:32 +0530 Subject: [PATCH 1/5] search_history --- options/css/options.css | 154 ++++++++++++++++++++++++++++++++- options/images2/backbutton.jpg | Bin 0 -> 43255 bytes options/js/options.js | 61 +++++++++++-- options/options.html | 30 +++++-- popup/js/popup.js | 32 ++++++- 5 files changed, 258 insertions(+), 19 deletions(-) create mode 100644 options/images2/backbutton.jpg diff --git a/options/css/options.css b/options/css/options.css index 382a014..e83eeff 100644 --- a/options/css/options.css +++ b/options/css/options.css @@ -1,4 +1,152 @@ + .main { - width: 200px; - height: 200px; -} \ No newline at end of file + width: 360px; + height: 500px; +} +#backB +{ + background-color: white +} +#backB:hover +{ + padding: 0px; + background-color: white; + opacity: 1; +} + +#searchHistory +{ + text-align: center; + background: white; + border: none; + width: 340px; + margin-left: 10px; + padding-bottom: 10px; + padding-top: 2px; +} +#histHead +{ + font-family: 'Titillium Web', sans-serif; + color: grey; + text-align: left; +} +#tHead +{ + font-family: 'Titillium Web', sans-serif; + color: grey; + text-align: left; + margin-left: 10px; + +} +#hList +{ + text-align: left; + list-style: none; + font-family: "sans-serif", Arial, Helvetica; +} + +#histClear +{ + border-radius: 7px; + font-style: "sans-serif", Arial, Helvetica; + font-weight: 600; + color: grey; + background-color: white; + border: none; +} +#histClear:hover +{ + box-shadow: 0px 0px 7px 0px grey; +} +#xadd +{ + color: red; +} +#cHist +{ + text-align: right; +} + +ul li +{ + margin: 5px; + border-bottom: 1px solid grey; + padding-left: 10px; + padding-top: 2px; + padding-bottom: 2px; + width: 245px; + color: #5e605b; +} +a +{ + color: grey; + text-decoration: none; + +} +a:hover +{ + color: white; + background-color: grey; + padding: 8px; + opacity: .8; +} + +.switch { + margin-left: 10px; + position: relative; + display: inline-block; + width: 60px; + height: 34px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: grey; + -webkit-transition: .4s; + transition: .4s; +} + +.slider:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + -webkit-transition: .4s; + transition: .4s; +} + +input:checked + .slider { + background-color: #102c7c; +} + +input:focus + .slider { + box-shadow: 0 0 1px #2196F3; +} + +input:checked + .slider:before { + -webkit-transform: translateX(26px); + -ms-transform: translateX(26px); + transform: translateX(26px); +} + +.slider.round { + border-radius: 34px; +} + +.slider.round:before { + border-radius: 50%; +} \ No newline at end of file diff --git a/options/images2/backbutton.jpg b/options/images2/backbutton.jpg new file mode 100644 index 0000000000000000000000000000000000000000..46ed9d429769895037ff8eeac93f5522d0b1198a GIT binary patch literal 43255 zcmeHQ2|U#4|NlDH)jBKnQ%sV?reoK&gBeQ^#UxFxqD$^*Lm4?*3M)-T$GRp>41>to zC84|Aj1Z!dv&a}X|K~f-TDz;(uzwk^SFc{rmoc8>bG+a0&*vF@G58AN(^A(|hnSd{ zpiSTl8mxfSAQoo$1^>$eUaV}a@QZ_u?K?J34lXWE4o*(4?|HxHn#VJblargDn}?T= zkDrh0dx7}^eDlHo`QSHUf`5{Ql>_`B-#pHFVDt-LgZChQ4i+!)#l#OW^E0vVGY#H{ zmcSpC{(?qc@TX#D;sOtU;e(hU4rUHE@XJ}@PtOD~eYbG`Z&xyFm^XmGgI{32?pbyY z(e<+Xe&JkjeEFX1KdFTms3!h+P9{rm(V@NIEf#=@`0NFb^8b0X9Qq!-KQliIKZJ%F zFF`BTCbn(mgrHK0S+#fVLg);{Z9fYKA&5!T_2Tayn;^Cukiep{qfx9LkhRC`8-$qE zoO4|uyPxxRBjl+c_tsWdTxOg1<|34N?A)s*xrbk{z>m8#NCArk2P&a;rYmmHA6Fd? zy9YmJ&*@jXbR&&c&-7cj_&xgL_7EBbKStR#ym{~-BTeP|MNihyAIpclOJD|^zv zJ+xnC_6-6%%GJ2^zAW<%=*MNyweaU^TYvCiSw0H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B zetSL36E~bYCWio`Uz~Pqne-ZRT-*P!u;9;5kaY~P4IPB~!6w37aaH#8Uh-*167iHY zoRKh(99tlwZw@@Dr3{^8;?M#uzN-R{7ZZy7sI~p?nw6Z}-s;{90fobPHng-W)gPLM zi%QzvMqE;{!zw>gCjwHwRwn$J0yJ*~F&I^V za?yxpPJVk+{Y=ZGWAvJ|QnKQ~cA#`9?^6#!!V>8*F&Rq)8V*TreqF(Mh~cV_^M znebLpk)suZ&<`k%qoK8Kd0n?t6&I14DmEr%)HiJNFIP4{(&K(3vnAp!sg!+DB955P z8w(1pB14n3(-nyvBsCWGV+4-#3d98QE98=Zv%|pNY(Ij^_S5nwx3v zPUf$&R##kR`!??QoN-QVI;-J<{r{KB=>IQ2&Y=48|02@Dn7ZxB z>t3eqJ7-syn5mX+d?WU{JA)LkNN`}PGNEa0t3REUy%Xvcfc+nX$fvEUbtZn%%%~%0 z1Qmf8a=Gk(kTaOO@AhBbcT4AKVZehoxW{?@A-k6RZ{7+0m#FK>liXkXoxuK2k9ch= zq5KIw**^_3{t}U|K` Fearch - Options + + -
+ + +
-
- diff --git a/popup/js/popup.js b/popup/js/popup.js index 747ca9c..164bab4 100644 --- a/popup/js/popup.js +++ b/popup/js/popup.js @@ -107,6 +107,7 @@ function register(event) { var dotCheck; var uuid; + query = text.value; query = encodeURIComponent(query); // Note :- avoid hardcoded uuid. @@ -146,6 +147,17 @@ function register(event) { formats = formats + "|" + suggestedFormat; } /* eslint-disable */ + + var sLink=[]; + if(localStorage.getItem('link')) + sLink=JSON.parse(localStorage.getItem('link')); + var sPhrase="http://www.google.com/search?q="+query+" -"+uuid+" -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" ("+formats+")"; + if(sPhrase!="" && sLink.indexOf(sPhrase)==-1) + { + sLink.push(sPhrase); + localStorage.setItem('link',JSON.stringify(sLink)); + } + window.open("http://www.google.com/search?q="+query+" -"+uuid+" -inurl:(htm|html|php|pls|txt) intitle:index.of \"last modified\" ("+formats+")"); /* eslint-enable */ } else { @@ -209,9 +221,27 @@ function themeChange() { } +function recordSearchHistory() +{ + + var sHist=[]; + if(localStorage.getItem('search')) + sHist=JSON.parse(localStorage.getItem('search')); + var x=text.value; + if(x!="" && sHist.indexOf(x)==-1) + { + sHist.push(x); + localStorage.setItem('search',JSON.stringify(sHist)); + } +} + document.addEventListener("DOMContentLoaded", function () { - document.querySelector("button").addEventListener("click", register); + document.querySelector("button").addEventListener("click",function() + { + recordSearchHistory(); + register(); + } ); document.addEventListener("keyup", keyboardShortCutListener, false); suggestion(); suggestionAsValue(); From 0e14876e7363561e7a0774119b3d937027ea4444 Mon Sep 17 00:00:00 2001 From: Jyotishka Dasgupta Date: Mon, 11 Feb 2019 20:19:24 +0530 Subject: [PATCH 2/5] updated variable names --- options/css/options.css | 21 +++++++++------------ options/js/options.js | 40 +++++++++++++++------------------------- options/options.html | 13 ++++++------- popup/js/popup.js | 20 ++++++++++---------- 4 files changed, 40 insertions(+), 54 deletions(-) diff --git a/options/css/options.css b/options/css/options.css index e83eeff..3f479f2 100644 --- a/options/css/options.css +++ b/options/css/options.css @@ -3,11 +3,11 @@ width: 360px; height: 500px; } -#backB +#backButton { background-color: white } -#backB:hover +#backButton:hover { padding: 0px; background-color: white; @@ -24,13 +24,13 @@ padding-bottom: 10px; padding-top: 2px; } -#histHead +#historyHead { font-family: 'Titillium Web', sans-serif; color: grey; text-align: left; } -#tHead +#themeHead { font-family: 'Titillium Web', sans-serif; color: grey; @@ -38,14 +38,14 @@ margin-left: 10px; } -#hList +#historyList { text-align: left; list-style: none; font-family: "sans-serif", Arial, Helvetica; } -#histClear +#clearButton { border-radius: 7px; font-style: "sans-serif", Arial, Helvetica; @@ -53,16 +53,13 @@ color: grey; background-color: white; border: none; + padding-top: 3px; } -#histClear:hover +#clearButton:hover { box-shadow: 0px 0px 7px 0px grey; } -#xadd -{ - color: red; -} -#cHist +#clearHist { text-align: right; } diff --git a/options/js/options.js b/options/js/options.js index adad706..c6a04ed 100644 --- a/options/js/options.js +++ b/options/js/options.js @@ -1,6 +1,6 @@ -var histo=[]; -var histLink=[]; -var radios = document.getElementById('them'); +var retrieveQuery=[]; +var retrieveURL=[]; +var toggle = document.getElementById('them'); if(!localStorage.getItem('theme')) localStorage.setItem('theme', 'light'); @@ -8,41 +8,41 @@ if(!localStorage.getItem('theme')) if(localStorage.getItem('theme') == 'light') { console.log("light"); - radios.checked = false; + toggle.checked = false; } else { console.log("dark"); - radios.checked = true; + toggle.checked = true; } function handleThemeChange(event) { - if(radios.checked == false) + if (toggle.checked==false) localStorage.setItem('theme', 'light'); else localStorage.setItem('theme', 'dark'); } document.addEventListener("DOMContentLoaded", function () { - var radios = document.getElementById('them'); - radios.addEventListener('click', handleThemeChange); + var toggle = document.getElementById('them'); + toggle.addEventListener('click', handleThemeChange); }); -var mydiv = document.getElementById("hList"); -var histButton = document.querySelector("#histClear"); +var mydiv = document.getElementById("historyList"); +var clearHistory = document.querySelector("#clearButton"); -histo=(JSON.parse(localStorage.getItem('search'))); -histLink=(JSON.parse(localStorage.getItem('link'))); +retrieveQuery=(JSON.parse(localStorage.getItem('search'))); +retrieveURL=(JSON.parse(localStorage.getItem('link'))); mydiv.textContent=""; var count=0; -histo.forEach(function(entr) +retrieveQuery.forEach(function(entr) { var aTag = document.createElement('a'); aTag.setAttribute('target','_blank') - aTag.setAttribute('href',histLink[count]); + aTag.setAttribute('href',retrieveURL[count]); aTag.innerHTML = entr; mydiv.appendChild(aTag); var mybr = document.createElement('br'); @@ -54,19 +54,9 @@ histo.forEach(function(entr) }) -histButton.addEventListener("mouseover",function() -{ - document.getElementById("xadd").innerHTML="X"; - -}); -histButton.addEventListener("mouseout",function() -{ - document.getElementById("xadd").innerHTML=""; - -}); -histButton.addEventListener("click",function() +clearHistory.addEventListener("click",function() { localStorage.clear(); location.reload(); diff --git a/options/options.html b/options/options.html index c625732..c473e05 100644 --- a/options/options.html +++ b/options/options.html @@ -10,12 +10,12 @@
- +

-

THEME

+

THEME