|
@@ -5,23 +5,6 @@
|
5
|
5
|
*
|
6
|
6
|
*/
|
7
|
7
|
|
8
|
|
-// Controle du focus sur la page
|
9
|
|
-function onBlur() {
|
10
|
|
- document.body.className = 'blurred';
|
11
|
|
-}
|
12
|
|
-
|
13
|
|
-function onFocus(){
|
14
|
|
- document.body.className = 'focused';
|
15
|
|
-}
|
16
|
|
-
|
17
|
|
-if (/*@cc_on!@*/false) { // check for Internet Explorer
|
18
|
|
- document.onfocusin = onFocus;
|
19
|
|
- document.onfocusout = onBlur;
|
20
|
|
-} else {
|
21
|
|
- window.onfocus = onFocus;
|
22
|
|
- window.onblur = onBlur;
|
23
|
|
-}
|
24
|
|
-
|
25
|
8
|
// Messages flashs
|
26
|
9
|
var myMessages = ['info','warning','error','success']; // define the messages types
|
27
|
10
|
|
|
@@ -230,6 +213,22 @@ function explode (delimiter, string, limit) {
|
230
|
213
|
|
231
|
214
|
$(document).ready(function(){
|
232
|
215
|
|
|
216
|
+ // Controle du focus sur la page
|
|
217
|
+ function onBlur() {
|
|
218
|
+ document.body.className = 'blurred';
|
|
219
|
+ }
|
|
220
|
+
|
|
221
|
+ function onFocus(){
|
|
222
|
+ document.body.className = 'focused';
|
|
223
|
+ }
|
|
224
|
+
|
|
225
|
+ if (/*@cc_on!@*/false) { // check for Internet Explorer
|
|
226
|
+ document.onfocusin = onFocus;
|
|
227
|
+ document.onfocusout = onBlur;
|
|
228
|
+ } else {
|
|
229
|
+ window.onfocus = onFocus;
|
|
230
|
+ window.onblur = onBlur;
|
|
231
|
+ }
|
233
|
232
|
|
234
|
233
|
// Bouton de personalisation du filtre
|
235
|
234
|
// pour le moment ce ne sotn que des redirection vers des actions
|
|
@@ -312,14 +311,19 @@ $(document).ready(function(){
|
312
|
311
|
|
313
|
312
|
// Mise en favoris
|
314
|
313
|
$('a.favorite_link').live("click", function(){
|
315
|
|
- link = $(this);
|
316
|
|
- $.getJSON($(this).attr('href'), function(response) {
|
317
|
|
- img = link.find('img');
|
318
|
|
- link.attr('href', response.link_new_url);
|
319
|
|
- img.attr('src', response.img_new_src);
|
320
|
|
- img.attr('title', response.img_new_title);
|
321
|
|
- });
|
322
|
|
- return false;
|
|
314
|
+ link = $(this);
|
|
315
|
+ $.getJSON($(this).attr('href'), function(response) {
|
|
316
|
+ if (response.status == 'mustbeconnected')
|
|
317
|
+ {
|
|
318
|
+ $(location).attr('href', url_index);
|
|
319
|
+ }
|
|
320
|
+
|
|
321
|
+ img = link.find('img');
|
|
322
|
+ link.attr('href', response.link_new_url);
|
|
323
|
+ img.attr('src', response.img_new_src);
|
|
324
|
+ img.attr('title', response.img_new_title);
|
|
325
|
+ });
|
|
326
|
+ return false;
|
323
|
327
|
});
|
324
|
328
|
|
325
|
329
|
// Affichage du bouton Modifier et Supprimer
|
|
@@ -358,6 +362,11 @@ $(document).ready(function(){
|
358
|
362
|
}
|
359
|
363
|
$('img.elements_more_loader').show();
|
360
|
364
|
$.getJSON(link.attr('href')+'/'+id_last+'/'+invertcolor, function(response) {
|
|
365
|
+ if (response.status == 'mustbeconnected')
|
|
366
|
+ {
|
|
367
|
+ $(location).attr('href', url_index);
|
|
368
|
+ }
|
|
369
|
+
|
361
|
370
|
if (response.count)
|
362
|
371
|
{
|
363
|
372
|
$('ul.elements').append(response.html);
|
|
@@ -386,6 +395,11 @@ $(document).ready(function(){
|
386
|
395
|
|
387
|
396
|
$('form[name="search"]').ajaxForm(function(response) {
|
388
|
397
|
|
|
398
|
+ if (response.status == 'mustbeconnected')
|
|
399
|
+ {
|
|
400
|
+ $(location).attr('href', url_index);
|
|
401
|
+ }
|
|
402
|
+
|
389
|
403
|
$('ul.elements').html(response.html);
|
390
|
404
|
|
391
|
405
|
if (response.count)
|
|
@@ -418,6 +432,11 @@ $(document).ready(function(){
|
418
|
432
|
li = link.parent('td').parent('tr').parent().parent().parent('li.element');
|
419
|
433
|
li.find('img.element_loader').show();
|
420
|
434
|
$.getJSON(link.attr('href'), function(response){
|
|
435
|
+ if (response.status == 'mustbeconnected')
|
|
436
|
+ {
|
|
437
|
+ $(location).attr('href', url_index);
|
|
438
|
+ }
|
|
439
|
+
|
421
|
440
|
if (response.status == 'success')
|
422
|
441
|
{
|
423
|
442
|
li.remove();
|
|
@@ -458,6 +477,11 @@ $(document).ready(function(){
|
458
|
477
|
|
459
|
478
|
$.getJSON($(this).attr('href'), function(response) {
|
460
|
479
|
|
|
480
|
+ if (response.status == 'mustbeconnected')
|
|
481
|
+ {
|
|
482
|
+ $(location).attr('href', url_index);
|
|
483
|
+ }
|
|
484
|
+
|
461
|
485
|
// On prépare le tagBox
|
462
|
486
|
li.html(response.html);
|
463
|
487
|
|
|
@@ -476,6 +500,11 @@ $(document).ready(function(){
|
476
|
500
|
});
|
477
|
501
|
$('form[name="'+response.form_name+'"]').ajaxForm(function(response){
|
478
|
502
|
|
|
503
|
+ if (response.status == 'mustbeconnected')
|
|
504
|
+ {
|
|
505
|
+ $(location).attr('href', url_index);
|
|
506
|
+ }
|
|
507
|
+
|
479
|
508
|
if (response.status == 'success')
|
480
|
509
|
{
|
481
|
510
|
li.html(response.html);
|
|
@@ -567,6 +596,11 @@ $(document).ready(function(){
|
567
|
596
|
|
568
|
597
|
// Récupération des tags correspondants
|
569
|
598
|
$.getJSON('/app_dev.php/fr/search/tag/'+input.val()+'/'+ajax_query_timestamp, function(data) {
|
|
599
|
+ if (data.status == 'mustbeconnected')
|
|
600
|
+ {
|
|
601
|
+ $(location).attr('href', url_index);
|
|
602
|
+ }
|
|
603
|
+
|
570
|
604
|
// Ce contrôle permet de ne pas continuer si une requete
|
571
|
605
|
// ajax a été faite depuis.
|
572
|
606
|
if (data.timestamp == ajax_query_timestamp)
|
|
@@ -768,6 +802,11 @@ $(document).ready(function(){
|
768
|
802
|
$('form[name="add"]').find('img.tag_loader').show();
|
769
|
803
|
});
|
770
|
804
|
$('form[name="add"]').ajaxForm(function(response) {
|
|
805
|
+ if (response.status == 'mustbeconnected')
|
|
806
|
+ {
|
|
807
|
+ $(location).attr('href', url_index);
|
|
808
|
+ }
|
|
809
|
+
|
771
|
810
|
$('form[name="add"] img.tag_loader').hide();
|
772
|
811
|
if (response.status == 'success')
|
773
|
812
|
{
|
|
@@ -812,6 +851,11 @@ $(document).ready(function(){
|
812
|
851
|
$('img.elements_more_loader').show();
|
813
|
852
|
$.getJSON($('input#get_elements_url').val()+'/'+array2json(tags_ids), function(response){
|
814
|
853
|
|
|
854
|
+ if (response.status == 'mustbeconnected')
|
|
855
|
+ {
|
|
856
|
+ $(location).attr('href', url_index);
|
|
857
|
+ }
|
|
858
|
+
|
815
|
859
|
$('ul.elements').html(response.html);
|
816
|
860
|
|
817
|
861
|
if (response.count)
|