mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
plusgoogle.com youtube js
This commit is contained in:
parent
b505f7c8ff
commit
2d0134759c
1 changed files with 24 additions and 7 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
var is_first_time = true;
|
||||||
|
|
||||||
function submitEditForm(){
|
function submitEditForm(){
|
||||||
$("#youtube_settings").submit(function (event) {
|
$("#youtube_settings").submit(function (event) {
|
||||||
|
|
||||||
|
@ -21,6 +23,16 @@ function submitEditForm(){
|
||||||
$('#email-error').show();
|
$('#email-error').show();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
else(!validateEmailIsNotGooglePlus(email)){
|
||||||
|
|
||||||
|
$('#email').addClass('error_form');
|
||||||
|
if(is_first_time){
|
||||||
|
$('#email').addClass('error_form');
|
||||||
|
$('#email-google-plus-error').show();
|
||||||
|
is_first_time = false;
|
||||||
|
event.preventDefault()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
localStorage.setItem("status_token", $.trim($('#status_token').val()));
|
localStorage.setItem("status_token", $.trim($('#status_token').val()));
|
||||||
localStorage.setItem("lbry_channel_name_sync", $.trim($('#channel-name').val()));
|
localStorage.setItem("lbry_channel_name_sync", $.trim($('#channel-name').val()));
|
||||||
|
@ -57,5 +69,10 @@ function validateLBRYName(lbry_channel_name){
|
||||||
|
|
||||||
function validateYoutubeChannelUrl(youtube_channel_url){
|
function validateYoutubeChannelUrl(youtube_channel_url){
|
||||||
var re = /^UC[A-Za-z0-9_-]{22}$/;
|
var re = /^UC[A-Za-z0-9_-]{22}$/;
|
||||||
return re.test(youtube_channel_url)
|
return re.test(youtube_channel_url);
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateEmailIsNotGooglePlus(email){
|
||||||
|
var re = /^[A-Za-z0-9._%+-]+@(?!plusgoogle.com)[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/+g;
|
||||||
|
return re.test(email);
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue