Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skater as an Overlay (no more popup) #4

Merged
merged 89 commits into from
Aug 24, 2020
Merged
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
ca77718
<WIP> adds a new div to a webpage
Ecalzo Aug 9, 2020
e6ab88e
feat: create and inject overlay div onto webpage
Ecalzo Aug 15, 2020
a525b4e
new: use only content_script to create overlay
Ecalzo Aug 15, 2020
233d28c
checkpointing progress
Ecalzo Aug 15, 2020
b004608
new: working communication between background.js bookmark search and …
Ecalzo Aug 15, 2020
6dccf6a
chore: cleanup background.js
Ecalzo Aug 15, 2020
4f995ff
fixes: creates input on webpage, populates ul with results dynamically
Ecalzo Aug 15, 2020
3fcdfe4
fix: append all new dom elements to overlayDiv
Ecalzo Aug 15, 2020
f14f36d
general css styling
Ecalzo Aug 15, 2020
83144e3
checkpoint
Ecalzo Aug 15, 2020
f15d78c
feat: rm border on search input, even on focus
Ecalzo Aug 16, 2020
c072ee1
new: centralize border and border-radius css around search container div
Ecalzo Aug 16, 2020
57e52f5
new: add opacity to search icon
Ecalzo Aug 16, 2020
fd693b5
new: remove overlayDiv by pressing Escape
Ecalzo Aug 16, 2020
f9dd148
search results list refinement
Ecalzo Aug 16, 2020
abaf038
fix: ensure that the search window closes after the user presses Enter)
Ecalzo Aug 17, 2020
40e1311
wip: add todos for webpage/tab handling
Ecalzo Aug 17, 2020
dde4036
chore: move createListItem up to other create funcs
Ecalzo Aug 17, 2020
501cc48
poc: selection with down arrow key
Ecalzo Aug 17, 2020
ffdcefb
feat: traverse search results with arrow keys
Ecalzo Aug 17, 2020
982517c
fix: make available on both http and https websites
Ecalzo Aug 17, 2020
d490177
chore: functionize moveUp and moveDown, handle event inputs errors wh…
Ecalzo Aug 17, 2020
d300f62
chore: functionize updateSearchResultsCSS
Ecalzo Aug 17, 2020
3f348bf
chore: refactor moveDownOneResult
Ecalzo Aug 17, 2020
8c08a50
fix: use let to assign index outside of if else block
Ecalzo Aug 17, 2020
34f6c6d
css: increase top to 25pc for search icon
Ecalzo Aug 17, 2020
4347017
Include favicons in search results
Ecalzo Aug 18, 2020
436dc59
better css selections
Ecalzo Aug 18, 2020
ab1be7a
better padding for search results
Ecalzo Aug 18, 2020
bcd6fef
fix: preventDefault() prevents page from scrolling
Ecalzo Aug 18, 2020
bfd7d08
more FIXMEs
Ecalzo Aug 18, 2020
4ba4e20
change opacity for highlighted search result
Ecalzo Aug 19, 2020
2811541
css: first result is always highlighted, css tweaks
Ecalzo Aug 19, 2020
1ee543d
increase padding size on searchWrapperDiv
Ecalzo Aug 19, 2020
b64cf4b
css: improve box shadow
Ecalzo Aug 19, 2020
19d850b
css: animations for search result focus
Ecalzo Aug 19, 2020
a806fbb
chore: rm commented lines
Ecalzo Aug 19, 2020
799ea1c
fix: add boolean to array check
Ecalzo Aug 19, 2020
cab186f
css: rm border from focused element
Ecalzo Aug 19, 2020
6515d86
rm unused lines
Ecalzo Aug 19, 2020
104d019
fix: separate input event listener into a main function
Ecalzo Aug 19, 2020
8c6a5af
chore: rename main to setUpInputEventListener
Ecalzo Aug 19, 2020
722c4c1
chore: delete unused code
Ecalzo Aug 19, 2020
4affb72
rm whitespace
Ecalzo Aug 19, 2020
1a24642
css: border-radius and better infill for focused search result
Ecalzo Aug 19, 2020
3423792
css: refine searchIcon
Ecalzo Aug 19, 2020
d65ca11
css: more tweaks
Ecalzo Aug 19, 2020
ca16391
use setTimeout to animate the first result
Ecalzo Aug 19, 2020
e549a01
css: fix input element overflow by using px
Ecalzo Aug 19, 2020
0ce0afa
css: reduce padding for search wrapper div
Ecalzo Aug 19, 2020
c31a29b
css: recenter search icon
Ecalzo Aug 19, 2020
2bc350e
css: update left property of search icon
Ecalzo Aug 19, 2020
84a19a9
rm fake function
Ecalzo Aug 19, 2020
bcd89dc
fix: new settimeout func, increase delays
Ecalzo Aug 19, 2020
4df158b
css: reduce ease time, favicon margins
Ecalzo Aug 19, 2020
1a6fe05
css: margin-bottom for favicon
Ecalzo Aug 19, 2020
8e583d4
js: reduce setTimeout to 100ms for focusInput
Ecalzo Aug 19, 2020
47092d4
js: check for valid input keys before triggering expensive update fun…
Ecalzo Aug 19, 2020
abe79b1
js: handle arrow key errors
Ecalzo Aug 19, 2020
0ec5c5e
css: use skate to..., icon css tweaks
Ecalzo Aug 19, 2020
590aee7
refactor: never unfocus input, use new focus class as indicator for h…
Ecalzo Aug 20, 2020
9a481df
rm unused files
Ecalzo Aug 20, 2020
9c26639
use z-index to hoist overlay div to top of the page
Ecalzo Aug 20, 2020
252a1e2
css: increase z-index
Ecalzo Aug 20, 2020
7c337ba
feat: prevent opening infinite number of windows
Ecalzo Aug 20, 2020
a2570fd
use shift key to open
Ecalzo Aug 20, 2020
1e6d070
auto refocus
Ecalzo Aug 20, 2020
c229444
rm unused function in background.js
Ecalzo Aug 20, 2020
73fe112
manifest: use <all_urls>
Ecalzo Aug 21, 2020
1992a76
css: rm default styling from a tags
Ecalzo Aug 21, 2020
9e2078b
js: reduce calls of preventDefault()
Ecalzo Aug 22, 2020
036c9f3
js: reduce return true statements
Ecalzo Aug 22, 2020
a67e01a
js: add Escape to if statement
Ecalzo Aug 22, 2020
4705a3b
html: change .focused to .skater-focused
Ecalzo Aug 22, 2020
531c4f9
js: use const instead of var
Ecalzo Aug 22, 2020
8dd0d4d
js: functionize getting the currently focused element
Ecalzo Aug 22, 2020
b2caa10
js: massively simplify moveDownOneResult
Ecalzo Aug 22, 2020
b8acd5e
js: handle if you are trying to go down but are at the last list item
Ecalzo Aug 22, 2020
6a063ce
js: rm returned undefined value from getSearchText
Ecalzo Aug 22, 2020
aac71ce
js: move edgecase handling to moveUpOneResult
Ecalzo Aug 22, 2020
c9f80a1
chore: code formatting
Ecalzo Aug 22, 2020
2047547
js: formatting
Ecalzo Aug 22, 2020
f4dc41c
js: pass searchInput.value w/o intermediary variable
Ecalzo Aug 22, 2020
792e37e
js: rename func to stripIndexFromElementClass
Ecalzo Aug 22, 2020
95223b0
fix: undo rm of query variables
Ecalzo Aug 22, 2020
548422f
js: rename updateSearchText
Ecalzo Aug 22, 2020
89cd3bf
js: change activation key to cmd/ctrl + j
Ecalzo Aug 23, 2020
538e88c
css: set display: inline for search result icons
Ecalzo Aug 23, 2020
c75438c
js: change keydown trigger to j key
Ecalzo Aug 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
new: remove overlayDiv by pressing Escape
  • Loading branch information
Ecalzo committed Aug 16, 2020
commit fd693b5ed10968036a643f34700c29096029afa5
22 changes: 17 additions & 5 deletions overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ document.addEventListener('keydown', event => {
console.log(refinedResults);
updateSearchText(refinedResults);
updateLinkEventListeners();
if (event.key === "Enter") {
// go to first event in the list
const top_result = refinedResults[0];
window.open(top_result.url)
}
}
if (event.key === "Enter") {
// go to first event in the list
const top_result = refinedResults[0];
window.open(top_result.url)
if (event.key === "Escape") {
destroyOverlay();
}
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if block should be in the func and return the index

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the only diff between these two functions is the +1 vs -1

Expand All @@ -38,6 +41,10 @@ function getSearchWrapperElement() {
return document.getElementById("searchWrapperDiv");
}

function getOverlayDiv() {
return document.getElementById("skater-overlay");
}

function createOverlay() {
const searchIcon = createSearchIcon();
const overlayDiv = createOverlayDiv();
Expand All @@ -53,10 +60,15 @@ function createOverlay() {
document.body.appendChild(overlayDiv);
}

function destroyOverlay() {
const overlayDiv = getOverlayDiv();
overlayDiv.parentNode.removeChild(overlayDiv);
}

function createOverlayDiv () {
const overlayDiv = document.createElement('div');
overlayDiv.style = "position: fixed; left: 0; top: 0; width: 100%; height: 100%; background: rgba(204, 204, 204, 0.5);";
overlayDiv.id = "evans-div"
overlayDiv.id = "skater-overlay"
return overlayDiv
}

Expand Down