mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +00:00
Fix CLA to get code piece of QS. Closes #2067
This commit is contained in:
parent
d69ecd8102
commit
2615bf9547
@ -418,15 +418,21 @@ footer: true
|
||||
});
|
||||
}
|
||||
|
||||
function qs(key) {
|
||||
key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars
|
||||
var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)"));
|
||||
return match && decodeURIComponent(match[1].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
populateCountries("country", "region");
|
||||
var spinner = new Spinner().spin(document.getElementById('spinner'));
|
||||
var codeCheck = window.location.href.match(/\?code=(.*)/);
|
||||
var codeCheck = qs('code');
|
||||
if (codeCheck && codeCheck.length > 0) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "https://cla.home-assistant.io/github/exchange",
|
||||
data: JSON.stringify({"code": codeCheck[1]}),
|
||||
data: JSON.stringify({"code": codeCheck}),
|
||||
contentType: "application/json",
|
||||
}).done(function(data){
|
||||
var uri = window.location.toString();
|
||||
|
Loading…
x
Reference in New Issue
Block a user