Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Add search functionality #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add search functionality #13

wants to merge 1 commit into from

Conversation

icook
Copy link
Owner

@icook icook commented Dec 21, 2014

Search will now find transactions or blocks if given the hash. From @ericecook

$(this).attr('action', "/search/" + query);
});
});
</script>
Copy link
Owner Author

Choose a reason for hiding this comment

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

Why are you using JS here? We should probably just use GET method if we want it to make a nice history entry for users.

Copy link
Collaborator

Choose a reason for hiding this comment

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

copy pasta code from simple multi. Idk what you mean about a history entry, please elaborate?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Three options I suppose

  1. Use POST. This means that going backward then forward usually prompts for form resubmission. We don't really want that here.
  2. Use GET. No prompt when going through history. It also will cause google and the like to not index/cache these pages I believe.
  3. Use canoncial URLs. This is probably not what we want here since google will index and cache the page.

Just switch method to GET and toss the JS I think.

@icook
Copy link
Owner Author

icook commented Dec 21, 2014

This is good work. Other things that I would like to be able to search for:

  1. Block number, even if there's a comma in it (abe chokes on commas...)
  2. Address

Should I open a ticket, or do you think you could handle adding those? It should basically be running a query on block height that strips everything but numeric values, and stipping the version number and public checksum from a decoded base58 address.

@ericecook
Copy link
Collaborator

best to open a ticket either way ;)

@icook
Copy link
Owner Author

icook commented Dec 21, 2014

To clarify I'm asking if you want to amend this commit now, or defer to later.

Also, worth mentioning that it should also just direct you to the appropriate page if there's only one result.

@ericecook
Copy link
Collaborator

I think its 'ok' as-is, and most importantly, it is functional. I'm in favor of merging & opening a ticket for the improvements.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants