diff options
Diffstat (limited to 'mayor-orig/www/skin/classic/module-session/javascript')
3 files changed, 74 insertions, 0 deletions
diff --git a/mayor-orig/www/skin/classic/module-session/javascript/createAccount.jquery.min.js b/mayor-orig/www/skin/classic/module-session/javascript/createAccount.jquery.min.js new file mode 100644 index 00000000..1fa17a9c --- /dev/null +++ b/mayor-orig/www/skin/classic/module-session/javascript/createAccount.jquery.min.js @@ -0,0 +1,13 @@ +$(document).ready(function() { + $('#createAccount input[type=submit]').attr("disabled", "disabled"); + $('#createAccount').change(function(){ + $('input').removeClass('hiba'); + if ($('#createAccount input[name="userCn"]').val() == "") $('#createAccount input[name="userCn"]').addClass('hiba'); + if ($('#createAccount input[name="userAccount"]').val() == "") $('#createAccount input[name="userAccount"]').addClass('hiba'); + if ($('#createAccount input[name="userPassword"]').val() != $('#createAccount input[name="verification"]').val()) $('#createAccount input[name="verification"]').addClass('hiba'); +// ideiglegenes bekapcsolva + if ($('#createAccount input[name="mail"]').val() == "") $('#createAccount input[name="mail"]').addClass('hiba'); + if ($('#createAccount input.hiba').length == 0) + $('#createAccount input[type=submit]').removeAttr("disabled"); + }); +});
\ No newline at end of file diff --git a/mayor-orig/www/skin/classic/module-session/javascript/facebookConnect.jquery.min.js b/mayor-orig/www/skin/classic/module-session/javascript/facebookConnect.jquery.min.js new file mode 100644 index 00000000..94010747 --- /dev/null +++ b/mayor-orig/www/skin/classic/module-session/javascript/facebookConnect.jquery.min.js @@ -0,0 +1,31 @@ +$(document).ready(function() { + $('#grantFbAuth').submit(function() { // facebook + FB.getLoginStatus(function(response) { + if (response.status === 'connected') { + mayor_facebookconnect_redirect(); + } else if (response.status === 'not_authorized') { + FB.login(function(loginResponse) { + if (loginResponse.status=='connected') { + mayor_facebookconnect_redirect(); + } + }); + } else { + FB.login(function(loginResponse) { + if (loginResponse.status=='connected') { + mayor_facebookconnect_redirect(); + } + }); + } + },true); + return false; + }); + + var mayor_facebookconnect_redirect = function() { + var origUrl = $(location).attr('href'); + var pos = origUrl.indexOf("?"); + if (pos != -1) url = origUrl+'&action=grantFbAuth'; + else url = origUrl+'?action=grantFbAuth'; + window.location = url; + } + +});
\ No newline at end of file diff --git a/mayor-orig/www/skin/classic/module-session/javascript/googleapi.jquery.min.js b/mayor-orig/www/skin/classic/module-session/javascript/googleapi.jquery.min.js new file mode 100644 index 00000000..3c54f109 --- /dev/null +++ b/mayor-orig/www/skin/classic/module-session/javascript/googleapi.jquery.min.js @@ -0,0 +1,30 @@ +$(document).ready(function() { + if (typeof(GOOGLEAPI_CLIENT_ID)!=='undefined' && GOOGLEAPI_CLIENT_ID!='') { + gapi.load('auth2', function(){ + auth2 = gapi.auth2.init({ + client_id: GOOGLEAPI_CLIENT_ID, + cookiepolicy: 'single_host_origin', + }); + googleapiCheck(document.getElementById('googleapiCheckBtn')); + googleapiCheck(document.getElementById('googleapiGrantBtn')); + googleapiCheck(document.getElementById('googleapiRevokeBtn')); + }); + + function googleapiCheck(element) { + auth2.attachClickHandler(element, {}, + function(googleUser) { + // console.log(googleUser.getBasicProfile()); + var id_token = googleUser.getAuthResponse().id_token; + var origUrl = $(location).attr('href'); + var pos = origUrl.indexOf("?"); + if (pos != -1) url = origUrl+'&id_token='+id_token; + else url = origUrl+'?id_token='+id_token; + if (element.id == 'googleapiGrantBtn') url += '&action=googleapiGrant'; + if (element.id == 'googleapiRevokeBtn') url += '&action=googleapiRevoke'; + window.location = url; + }, function(error) { + // alert(JSON.stringify(error, undefined, 2)); + }); + } + } +}); |