1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Fix client search

This commit is contained in:
Chocobozzz 2017-12-05 17:46:33 +01:00
parent d235f6b0d1
commit f3aaa9a95c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
33 changed files with 245 additions and 249 deletions

View file

@ -0,0 +1,18 @@
// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
function getParameterByName (name: string, url: string) {
if (!url) url = window.location.href
name = name.replace(/[\[\]]/g, '\\$&')
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)')
const results = regex.exec(url)
if (!results) return null
if (!results[2]) return ''
return decodeURIComponent(results[2].replace(/\+/g, ' '))
}
export {
getParameterByName
}