Skip to content

Commit

Permalink
Add possibility to paste Google play URL into search field
Browse files Browse the repository at this point in the history
  • Loading branch information
pnu-s committed Mar 8, 2020
1 parent 27a3700 commit 26cc610
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions exodus/web/templates/base/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ <h4>{% trans "Need an overview?" %}</h4>
}
const query = jQuery.trim(jQuery(this).val())
if(query.length >= 5) {
// Extract handle from Google Play url
const regex = /id=((?:\w+\.)+\w+)/gmi;
if(query.startsWith("https://play.google.com")){
var match = regex.exec(query)
while (match != null) {
if(match[1]){
jQuery(this).val(match[1])
}
return
}
}
search_timer = setTimeout(function(){ get_results(query, 20); }, 200);
}
if(query == '') {
Expand Down

0 comments on commit 26cc610

Please sign in to comment.