From 5211e7c8fa1282c74e284f0325cf3c50f5d7af5d Mon Sep 17 00:00:00 2001 From: Sandeep Suman Date: Sun, 3 Apr 2022 00:32:16 +0530 Subject: [PATCH] implemented web search feature --- popup/popup.js | 6 +++++- popup/style.css | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/popup/popup.js b/popup/popup.js index 88604d4..5ee5a09 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -27,6 +27,7 @@ let wordef, pos, defin, example, + sourceurl, index = 0, indlimit; @@ -38,6 +39,7 @@ async function dictionary(query) { indlimit = wordef[0].meanings.length; word = wordef[0].word; phonetic = wordef[0].phonetic ? wordef[0].phonetic : ""; + sourceurl = `https://en.wiktionary.org/wiki/${word}`; index = 0; setValues(); @@ -74,7 +76,9 @@ function setValues() { ? wordef[0].meanings[index].definitions[0].example : null; - document.getElementById("word").innerHTML = word; + document.getElementById( + "word" + ).innerHTML = `${word} read more`; document.getElementById("phonetic").innerHTML = `${phonetic} (${pos})`; document.getElementById("definition").innerHTML = defin; if (example) { diff --git a/popup/style.css b/popup/style.css index e0f2001..2634c35 100644 --- a/popup/style.css +++ b/popup/style.css @@ -54,3 +54,24 @@ div { background-color: #f1f1f1; color: black; } + +.searchsvg { + width: 17px; + user-drag: none; + -webkit-user-drag: none; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; +} + +.searchanchor { + text-decoration: none; + outline: none; +} + +.searchanchor:hover { + text-decoration: none; + outline: none; + border: none; +} \ No newline at end of file