You can now paste GitHub URLs in the search box
This commit is contained in:
@@ -34,6 +34,10 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-lg-offset-2">
|
||||
<form id="search">
|
||||
<p>
|
||||
Paste a GitHub project URL, or the repository ("user/repository"):
|
||||
</p>
|
||||
|
||||
<div class="form-group input-group input-group-lg">
|
||||
<input id="search-input" type="text" class="form-control" placeholder="user/repository">
|
||||
<span class="input-group-btn">
|
||||
|
||||
@@ -9,6 +9,11 @@ jQuery(function ($) {
|
||||
|
||||
var repository = $(this).find('#search-input').val();
|
||||
|
||||
if (repository.indexOf('https://github.com/') !== -1) {
|
||||
repository = repository.slice('https://github.com/'.length);
|
||||
console.log(repository);
|
||||
}
|
||||
|
||||
if (repository.length === 0 || repository.indexOf('/') === -1) {
|
||||
$(this).find('.alert-warning').show();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user