$render[0]="alerta";
if($_POST['behavior_event']=='idle'){
$resposta='
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: true
, life: 6000
, escape: true
, keepAlive: false
, msgs: [{
summary: "Sem atividade."
, detail: "O usuário está inativo"
, severity: "warn"
, severityText: "Warning"
}]
});
</script>
';
}
if($_POST['behavior_event']=='active'){
$resposta='
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: true
, life: 6000
, escape: true
, keepAlive: false
, msgs: [{
summary: "Atividade detectada"
, detail: "O usuário está ativo"
, severity: "warn"
, severityText: "Warning"
}]
});
</script>
';
}
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: true
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("IdleMonitor", "widget_monitorar", {
id: "monitorar"
, timeout: 5000
, multiWindowSupport: false
, behaviors: {
active: function (ext, event) {
dc.ab({
s: "monitorar"
, e: "active"
, f: "formulario"
, p: "monitorar"
, u: "alerta"
}, ext);
}
, idle: function (ext, event) {
dc.ab({
s: "monitorar"
, e: "idle"
, f: "formulario"
, p: "monitorar"
, u: "alerta"
}, ext);
}
}
});