2017-11-27 11:52:52 +01:00
|
|
|
var clientId = '1010962018903-glegmqudqtl1lub0150vacopbu06lgsg.apps.googleusercontent.com';
|
|
|
|
var scope = [
|
|
|
|
'profile',
|
|
|
|
'email'
|
|
|
|
].join(' ');
|
|
|
|
|
|
|
|
if(gapi.auth2 == undefined){
|
|
|
|
|
|
|
|
gapi.load('auth2', () => {
|
|
|
|
|
|
|
|
gapi.auth2.init({
|
|
|
|
client_id: clientId,
|
|
|
|
cookiepolicy: 'single_host_origin',
|
|
|
|
scope: scope
|
|
|
|
});
|
|
|
|
|
|
|
|
//RE-Render the button (due to known issues of google-button with angular's lifecycle)
|
|
|
|
gapi.signin2.render('googleBtn');
|
|
|
|
|
|
|
|
//var buttonElement = this.element.nativeElement.querySelector('#googleBtn');
|
|
|
|
//this.attachSignin(buttonElement);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-11-01 18:18:27 +01:00
|
|
|
|
|
|
|
var sign_out_google = (function() {
|
|
|
|
var auth2 = gapi.auth2.getAuthInstance();
|
|
|
|
auth2.signOut().then(function () {
|
2017-11-23 12:13:20 +01:00
|
|
|
console.log('User signed out from google.');
|
2017-11-01 18:18:27 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var simple_notifier = (function(type, title, message) {
|
2017-11-22 13:25:01 +01:00
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
$(".alert").remove();
|
|
|
|
}, 11000);
|
|
|
|
|
2017-11-01 18:18:27 +01:00
|
|
|
return notify(type, title, message, null, null, null, null, null, null, null, null, null, null);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function notify(type, title, message, delay, icon, url, target, allow_dismiss, offset_x, offset_y, animate_enter, animate_exit, newest_on_top){
|
|
|
|
|
|
|
|
var options = {};
|
|
|
|
if(icon!=null) options.icon = icon;
|
|
|
|
if(title!=null) options.title = title;
|
|
|
|
if(message!=null) options.message = message;
|
|
|
|
if(url!=null) options.url = url;
|
|
|
|
if(target!=null) options.target = target;
|
|
|
|
|
|
|
|
var settings = {};
|
|
|
|
if(type!=null) settings.type = type;
|
|
|
|
if(allow_dismiss!=null) settings.allow_dismiss = allow_dismiss;
|
2017-11-22 14:08:13 +01:00
|
|
|
settings.delay = 5;
|
2017-11-01 18:18:27 +01:00
|
|
|
if(delay!=null) settings.delay = delay;
|
|
|
|
|
|
|
|
return $.notify(options,settings, delay);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|