Skip to content

Commit

Permalink
Re-add displayDateAdded option (#130)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Heimler <[email protected]>
  • Loading branch information
Fannon and Simon Heimler authored Aug 25, 2024
1 parent c8dc2f9 commit 09ed00e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ searchStrategy: precise
historyDaysAgo: 14
historyMaxItems: 2048
historyIgnoreList:
- extension://
- http://localhost
- http://127.0.0.1
colorStripeWidth: 4 # Customize width of search result color stripe
Expand Down
6 changes: 5 additions & 1 deletion popup/js/model/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export const defaultOptions = {
* Display how many times a result was visited (by history)
*/
displayVisitCounter: false,
/**
* Display date when a bookmark was added
*/
displayDateAdded: false,
/**
* Display result score.
* The score indicates the relevance of the result and defines the order of results.
Expand Down Expand Up @@ -184,7 +188,7 @@ export const defaultOptions = {
/**
* All history items that where the URL includes the given strings will be skipped
*/
historyIgnoreList: [],
historyIgnoreList: ['extension://'],

//////////////////////////////////////////
// SEARCH ENGINES OPTIONS //
Expand Down
7 changes: 7 additions & 0 deletions popup/js/view/searchView.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ export function renderSearchResults(result) {
visitCounter.innerText = resultEntry.visitCount
titleDiv.appendChild(visitCounter)
}
if (ext.opts.displayDateAdded && resultEntry.dateAdded) {
const dateAdded = document.createElement('span')
dateAdded.title = 'Date Added'
dateAdded.classList.add('badge', 'date-added')
dateAdded.innerText = new Date(resultEntry.dateAdded).toISOString().split('T')[0]
titleDiv.appendChild(dateAdded)
}
if (ext.opts.tabsDisplayWindowId && resultEntry.windowId) {
const windowId = document.createElement('span')
windowId.title = 'Window'
Expand Down

0 comments on commit 09ed00e

Please sign in to comment.