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

Surfaces the titles to the webUI and associates with the respective JSON and links for #178 #570

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
3 changes: 3 additions & 0 deletions ipwb/assets/webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function addURIListToDOM () {

li.setAttribute('data-mime', memento['mime'])
li.setAttribute('data-status', memento['status'])
if ('title' in memento) {
li.setAttribute('title', memento['title'])
Copy link
Member

Choose a reason for hiding this comment

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

If we are planning to merge #566 (after title inclusion) then this change in the webui.js is not desired as it will cause unnecessary conflict. Making the title data available for usage should be good enough for this PR.

Copy link
Member Author

@machawk1 machawk1 Sep 25, 2018

Choose a reason for hiding this comment

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

@ibnesayeed This association is an effort to get #566 merged. #566 currently does not deal with titles. By associating it in the UI with the li, we can work toward including it in the listing.

Copy link
Member

Choose a reason for hiding this comment

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

@machawk1 #566 will be able to directly use the title attribute from the memento object. We don't need to add it to each li beforehand.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ibnesayeed Rm'd in 8b866e6. Once this PR is merged, we can prettify #566 a bit more before merging it in.

}

const isHTML = memento['mime'].toLowerCase().startsWith('text/html')
const isARedirect = memento['status'][0] === '3'
Expand Down
2 changes: 2 additions & 0 deletions ipwb/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ def getURIsAndDatetimesInCDXJ(cdxjFilePath=INDEX_FILE):
'mime': jsonFields['mime_type'],
'status': jsonFields['status_code']
}
if 'title' in jsonFields:
mementoAsJSON['title'] = jsonFields['title']

uris[uri].append(mementoAsJSON)

Expand Down