Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1 | Rev 648 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 640
Línea 31... Línea 31...
31
}
31
}
Línea 32... Línea 32...
32
 
32
 
Línea 33... Línea 33...
33
$routeCheckSession = $this->url('check-session');
33
$routeCheckSession = $this->url('check-session');
34
 
34
 
35
$currentUser    = $this->currentUserHelper();
35
$currentUser    = $this->currentUserHelper();
36
if ($currentUser->hasIdentity()) {
36
// if ($currentUser->hasIdentity()) {
37
  $this->inlineScript()->captureStart();
37
//   $this->inlineScript()->captureStart();
38
  echo <<<EOT
38
//   echo <<<EOT
39
    jQuery( document ).ready(function( $ ) {
39
//     jQuery( document ).ready(function( $ ) {
40
        $.fn.checkSession = function() {
40
//         $.fn.checkSession = function() {
41
            $.ajax({
41
//             $.ajax({
42
                'dataType'  : 'json',
42
//                 'dataType'  : 'json',
43
                'accept'    : 'application/json',
43
//                 'accept'    : 'application/json',
44
                'method'    : 'get',
44
//                 'method'    : 'get',
45
                'url'       : '$routeCheckSession',
45
//                 'url'       : '$routeCheckSession',
46
            }).done(function(response) {
46
//             }).done(function(response) {
47
                if(response['success']) {
47
//                 if(response['success']) {
48
                    if(parseInt(response['data']['total_messages']) > 0) {
48
//                     if(parseInt(response['data']['total_messages']) > 0) {
49
                        $('#badge-inmail').html(response['data']['total_messages']);
49
//                         $('#badge-inmail').html(response['data']['total_messages']);
50
                        $('#badge-inmail').show();
50
//                         $('#badge-inmail').show();
51
                    } else {
51
//                     } else {
Línea 52... Línea 52...
52
                        $('#badge-inmail').hide();
52
//                         $('#badge-inmail').hide();
53
                    }
53
//                     }
54
 
54
 
55
                    if(parseInt(response['data']['total_messages']) > 0) {
55
//                     if(parseInt(response['data']['total_messages']) > 0) {
56
                        $('#badge-message').html(response['data']['total_messages']);
56
//                         $('#badge-message').html(response['data']['total_messages']);
57
                        $('#badge-message').show();
57
//                         $('#badge-message').show();
Línea 58... Línea 58...
58
                    } else {
58
//                     } else {
59
                        $('#badge-message').hide();
59
//                         $('#badge-message').hide();
60
                    }
60
//                     }
61
                    
61
                    
62
                    if(parseInt(response['data']['total_notifications']) > 0) {
62
//                     if(parseInt(response['data']['total_notifications']) > 0) {
63
                        $('#badge-notification').html(response['data']['total_notifications']);
63
//                         $('#badge-notification').html(response['data']['total_notifications']);
Línea 64... Línea 64...
64
                        $('#badge-notification').show();
64
//                         $('#badge-notification').show();
65
                    } else {
65
//                     } else {
66
                        $('#badge-notification').hide();
66
//                         $('#badge-notification').hide();
67
                    }
67
//                     }
68
                    
68
                    
69
                    
69
                    
70
    		    } else {
70
//     		    } else {
71
                    if(response['data']['url']) {
71
//                     if(response['data']['url']) {
72
                        window.location.href = response['data']['url'];
72
//                         window.location.href = response['data']['url'];
Línea 73... Línea 73...
73
                    } else {
73
//                     } else {
74
                        $.fn.showError(response['data']['message'])
74
//                         $.fn.showError(response['data']['message'])
75
                    }
75
//                     }
76
                }
76
//                 }
Línea 77... Línea 77...
77
            }).fail(function( jqXHR, textStatus, errorThrown) {
77
//             }).fail(function( jqXHR, textStatus, errorThrown) {
Línea 78... Línea 78...
78
            }).always(function() {
78
//             }).always(function() {
79
            
79
            
80
                setTimeout(function() {
80
//                 setTimeout(function() {
Línea 81... Línea 81...
81
                    $.fn.checkSession();
81
//                     $.fn.checkSession();
82
                }, 3000);
82
//                 }, 3000);
83
            })
83
//             })
84
            
84
            
85
        }
85
//         }
Línea 86... Línea 86...
86
        
86
        
Línea 87... Línea 87...
87
        setTimeout(function() {
87
//         setTimeout(function() {