|
@@ -38,6 +38,10 @@ function ResponseController()
|
38
|
38
|
open_connection_or_subscription_window();
|
39
|
39
|
}
|
40
|
40
|
}
|
|
41
|
+ else if (response.status === 'mustbeconnected')
|
|
42
|
+ {
|
|
43
|
+ open_connection_or_subscription_window(true);
|
|
44
|
+ }
|
41
|
45
|
}
|
42
|
46
|
|
43
|
47
|
this.execute = function(response, success_callback, failure_callback)
|
|
@@ -281,10 +285,11 @@ function JQueryJson(url, data, callback_success)
|
281
|
285
|
data: data,
|
282
|
286
|
success: function(response)
|
283
|
287
|
{
|
284
|
|
- if (response.status == 'mustbeconnected')
|
285
|
|
- {
|
286
|
|
- $(location).attr('href', url_home);
|
287
|
|
- }
|
|
288
|
+ window.ResponseController.execute(
|
|
289
|
+ response,
|
|
290
|
+ function(){},
|
|
291
|
+ function(){}
|
|
292
|
+ );
|
288
|
293
|
|
289
|
294
|
callback_success(response);
|
290
|
295
|
}
|
|
@@ -360,10 +365,11 @@ $(document).ready(function(){
|
360
|
365
|
var form = $('form[name="search"]');
|
361
|
366
|
|
362
|
367
|
$.getJSON(url_get_favorites_tags, function(response) {
|
363
|
|
- if (response.status == 'mustbeconnected')
|
364
|
|
- {
|
365
|
|
- $(location).attr('href', url_home);
|
366
|
|
- }
|
|
368
|
+ window.ResponseController.execute(
|
|
369
|
+ response,
|
|
370
|
+ function(){},
|
|
371
|
+ function(){}
|
|
372
|
+ );
|
367
|
373
|
|
368
|
374
|
var tags = [];
|
369
|
375
|
for (i in response.tags)
|
|
@@ -540,10 +546,11 @@ $(document).ready(function(){
|
540
|
546
|
link.addClass('loading');
|
541
|
547
|
|
542
|
548
|
$.getJSON($(this).attr('href'), function(response) {
|
543
|
|
- if (response.status == 'mustbeconnected')
|
544
|
|
- {
|
545
|
|
- $(location).attr('href', url_home);
|
546
|
|
- }
|
|
549
|
+ window.ResponseController.execute(
|
|
550
|
+ response,
|
|
551
|
+ function(){},
|
|
552
|
+ function(){}
|
|
553
|
+ );
|
547
|
554
|
|
548
|
555
|
var img = link.find('img');
|
549
|
556
|
link.attr('href', response.link_new_url);
|
|
@@ -615,10 +622,11 @@ $(document).ready(function(){
|
615
|
622
|
url: url,
|
616
|
623
|
data: data,
|
617
|
624
|
success: function(response) {
|
618
|
|
- if (response.status == 'mustbeconnected')
|
619
|
|
- {
|
620
|
|
- $(location).attr('href', url_home);
|
621
|
|
- }
|
|
625
|
+ window.ResponseController.execute(
|
|
626
|
+ response,
|
|
627
|
+ function(){},
|
|
628
|
+ function(){}
|
|
629
|
+ );
|
622
|
630
|
|
623
|
631
|
if (response.count)
|
624
|
632
|
{
|
|
@@ -661,10 +669,11 @@ $(document).ready(function(){
|
661
|
669
|
|
662
|
670
|
$('form[name="search"]').ajaxForm(function(response) {
|
663
|
671
|
|
664
|
|
- if (response.status == 'mustbeconnected')
|
665
|
|
- {
|
666
|
|
- $(location).attr('href', url_home);
|
667
|
|
- }
|
|
672
|
+ window.ResponseController.execute(
|
|
673
|
+ response,
|
|
674
|
+ function(){},
|
|
675
|
+ function(){}
|
|
676
|
+ );
|
668
|
677
|
|
669
|
678
|
$('ul.elements').html(response.html);
|
670
|
679
|
|
|
@@ -698,10 +707,11 @@ $(document).ready(function(){
|
698
|
707
|
var li = link.parents('li.element');
|
699
|
708
|
li.find('img.element_loader').show();
|
700
|
709
|
$.getJSON(link.attr('href'), function(response){
|
701
|
|
- if (response.status == 'mustbeconnected')
|
702
|
|
- {
|
703
|
|
- $(location).attr('href', url_home);
|
704
|
|
- }
|
|
710
|
+ window.ResponseController.execute(
|
|
711
|
+ response,
|
|
712
|
+ function(){},
|
|
713
|
+ function(){}
|
|
714
|
+ );
|
705
|
715
|
|
706
|
716
|
if (response.status == 'success')
|
707
|
717
|
{
|
|
@@ -741,10 +751,11 @@ $(document).ready(function(){
|
741
|
751
|
var li = link.parents('li.element');
|
742
|
752
|
li.find('img.element_loader').show();
|
743
|
753
|
$.getJSON(link.attr('href'), function(response){
|
744
|
|
- if (response.status == 'mustbeconnected')
|
745
|
|
- {
|
746
|
|
- $(location).attr('href', url_home);
|
747
|
|
- }
|
|
754
|
+ window.ResponseController.execute(
|
|
755
|
+ response,
|
|
756
|
+ function(){},
|
|
757
|
+ function(){}
|
|
758
|
+ );
|
748
|
759
|
|
749
|
760
|
if (response.status == 'success')
|
750
|
761
|
{
|
|
@@ -775,10 +786,11 @@ $(document).ready(function(){
|
775
|
786
|
|
776
|
787
|
$.getJSON($(this).attr('href'), function(response) {
|
777
|
788
|
|
778
|
|
- if (response.status == 'mustbeconnected')
|
779
|
|
- {
|
780
|
|
- $(location).attr('href', url_home);
|
781
|
|
- }
|
|
789
|
+ window.ResponseController.execute(
|
|
790
|
+ response,
|
|
791
|
+ function(){},
|
|
792
|
+ function(){}
|
|
793
|
+ );
|
782
|
794
|
|
783
|
795
|
// On prépare le tagBox
|
784
|
796
|
li.html(response.html);
|
|
@@ -801,10 +813,11 @@ $(document).ready(function(){
|
801
|
813
|
});
|
802
|
814
|
$('form[name="'+response.form_name+'"]').ajaxForm(function(response){
|
803
|
815
|
|
804
|
|
- if (response.status == 'mustbeconnected')
|
805
|
|
- {
|
806
|
|
- $(location).attr('href', url_home);
|
807
|
|
- }
|
|
816
|
+ window.ResponseController.execute(
|
|
817
|
+ response,
|
|
818
|
+ function(){},
|
|
819
|
+ function(){}
|
|
820
|
+ );
|
808
|
821
|
|
809
|
822
|
var li = $('li#'+response.dom_id);
|
810
|
823
|
|
|
@@ -1419,10 +1432,11 @@ $(document).ready(function(){
|
1419
|
1432
|
|
1420
|
1433
|
function element_add_proceed_data_apis(response)
|
1421
|
1434
|
{
|
1422
|
|
- if (response.status == 'mustbeconnected')
|
1423
|
|
- {
|
1424
|
|
- $(location).attr('href', url_home);
|
1425
|
|
- }
|
|
1435
|
+ window.ResponseController.execute(
|
|
1436
|
+ response,
|
|
1437
|
+ function(){},
|
|
1438
|
+ function(){}
|
|
1439
|
+ );
|
1426
|
1440
|
|
1427
|
1441
|
if (response.status == 'success')
|
1428
|
1442
|
{
|
|
@@ -1599,10 +1613,11 @@ $(document).ready(function(){
|
1599
|
1613
|
$('img.elements_more_loader').show();
|
1600
|
1614
|
$.getJSON($('input#get_elements_url').val()+'/'+array2json(tags_ids_for_filter), function(response){
|
1601
|
1615
|
|
1602
|
|
- if (response.status == 'mustbeconnected')
|
1603
|
|
- {
|
1604
|
|
- $(location).attr('href', url_home);
|
1605
|
|
- }
|
|
1616
|
+ window.ResponseController.execute(
|
|
1617
|
+ response,
|
|
1618
|
+ function(){},
|
|
1619
|
+ function(){}
|
|
1620
|
+ );
|
1606
|
1621
|
|
1607
|
1622
|
$('ul.elements').html(response.html);
|
1608
|
1623
|
|
|
@@ -1733,10 +1748,11 @@ $(document).ready(function(){
|
1733
|
1748
|
data: $('form[name="search"]').serialize(),
|
1734
|
1749
|
success: function(response){
|
1735
|
1750
|
|
1736
|
|
- if (response.status == 'mustbeconnected')
|
1737
|
|
- {
|
1738
|
|
- alert('pouet!');
|
1739
|
|
- }
|
|
1751
|
+ window.ResponseController.execute(
|
|
1752
|
+ response,
|
|
1753
|
+ function(){},
|
|
1754
|
+ function(){}
|
|
1755
|
+ );
|
1740
|
1756
|
|
1741
|
1757
|
if (response.status == 'success' && response.count)
|
1742
|
1758
|
{
|
|
@@ -1791,10 +1807,11 @@ $(document).ready(function(){
|
1791
|
1807
|
data: $('form[name="search"]').serialize(),
|
1792
|
1808
|
success: function(response){
|
1793
|
1809
|
|
1794
|
|
- if (response.status == 'mustbeconnected')
|
1795
|
|
- {
|
1796
|
|
- $(location).attr('href', url_home);
|
1797
|
|
- }
|
|
1810
|
+ window.ResponseController.execute(
|
|
1811
|
+ response,
|
|
1812
|
+ function(){},
|
|
1813
|
+ function(){}
|
|
1814
|
+ );
|
1798
|
1815
|
|
1799
|
1816
|
if (response.status == 'success')
|
1800
|
1817
|
{
|
|
@@ -1916,10 +1933,11 @@ $(document).ready(function(){
|
1916
|
1933
|
li_element.find('form.add_comment').show();
|
1917
|
1934
|
|
1918
|
1935
|
li_element.find('form.add_comment').ajaxForm(function(response) {
|
1919
|
|
- if (response.status == 'mustbeconnected')
|
1920
|
|
- {
|
1921
|
|
- $(location).attr('href', url_home);
|
1922
|
|
- }
|
|
1936
|
+ window.ResponseController.execute(
|
|
1937
|
+ response,
|
|
1938
|
+ function(){},
|
|
1939
|
+ function(){}
|
|
1940
|
+ );
|
1923
|
1941
|
|
1924
|
1942
|
li_element.find('img.comments_loader').hide();
|
1925
|
1943
|
|
|
@@ -1997,10 +2015,11 @@ $(document).ready(function(){
|
1997
|
2015
|
|
1998
|
2016
|
li.find('img.comment_loader').hide();
|
1999
|
2017
|
|
2000
|
|
- if (response.status == 'mustbeconnected')
|
2001
|
|
- {
|
2002
|
|
- $(location).attr('href', url_home);
|
2003
|
|
- }
|
|
2018
|
+ window.ResponseController.execute(
|
|
2019
|
+ response,
|
|
2020
|
+ function(){},
|
|
2021
|
+ function(){}
|
|
2022
|
+ );
|
2004
|
2023
|
|
2005
|
2024
|
if (response.status == 'success')
|
2006
|
2025
|
{
|
|
@@ -2040,10 +2059,11 @@ $(document).ready(function(){
|
2040
|
2059
|
|
2041
|
2060
|
$.getJSON($(this).attr('href'), function(response) {
|
2042
|
2061
|
|
2043
|
|
- if (response.status == 'mustbeconnected')
|
2044
|
|
- {
|
2045
|
|
- $(location).attr('href', url_home);
|
2046
|
|
- }
|
|
2062
|
+ window.ResponseController.execute(
|
|
2063
|
+ response,
|
|
2064
|
+ function(){},
|
|
2065
|
+ function(){}
|
|
2066
|
+ );
|
2047
|
2067
|
|
2048
|
2068
|
li.html(response.html);
|
2049
|
2069
|
// On rend ce formulaire ajaxFormable
|
|
@@ -2058,10 +2078,11 @@ $(document).ready(function(){
|
2058
|
2078
|
li = $('li#'+response.dom_id);
|
2059
|
2079
|
li.find('img.comment_loader').hide();
|
2060
|
2080
|
|
2061
|
|
- if (response.status == 'mustbeconnected')
|
2062
|
|
- {
|
2063
|
|
- $(location).attr('href', url_home);
|
2064
|
|
- }
|
|
2081
|
+ window.ResponseController.execute(
|
|
2082
|
+ response,
|
|
2083
|
+ function(){},
|
|
2084
|
+ function(){}
|
|
2085
|
+ );
|
2065
|
2086
|
|
2066
|
2087
|
if (response.status == 'success')
|
2067
|
2088
|
{
|
|
@@ -2124,10 +2145,11 @@ $(document).ready(function(){
|
2124
|
2145
|
|
2125
|
2146
|
$.getJSON(link.attr('href'), function(response){
|
2126
|
2147
|
|
2127
|
|
- if (response.status == 'mustbeconnected')
|
2128
|
|
- {
|
2129
|
|
- $(location).attr('href', url_home);
|
2130
|
|
- }
|
|
2148
|
+ window.ResponseController.execute(
|
|
2149
|
+ response,
|
|
2150
|
+ function(){},
|
|
2151
|
+ function(){}
|
|
2152
|
+ );
|
2131
|
2153
|
});
|
2132
|
2154
|
|
2133
|
2155
|
$('div.question').fadeOut();
|
|
@@ -2158,10 +2180,11 @@ $(document).ready(function(){
|
2158
|
2180
|
|
2159
|
2181
|
loader.hide();
|
2160
|
2182
|
|
2161
|
|
- if (response.status == 'mustbeconnected')
|
2162
|
|
- {
|
2163
|
|
- $(location).attr('href', url_home);
|
2164
|
|
- }
|
|
2183
|
+ window.ResponseController.execute(
|
|
2184
|
+ response,
|
|
2185
|
+ function(){},
|
|
2186
|
+ function(){}
|
|
2187
|
+ );
|
2165
|
2188
|
|
2166
|
2189
|
if (response.status == 'success')
|
2167
|
2190
|
{
|
|
@@ -2260,10 +2283,11 @@ $(document).ready(function(){
|
2260
|
2283
|
|
2261
|
2284
|
$.getJSON(link.attr('href'), function(response){
|
2262
|
2285
|
|
2263
|
|
- if (response.status == 'mustbeconnected')
|
2264
|
|
- {
|
2265
|
|
- $(location).attr('href', url_home);
|
2266
|
|
- }
|
|
2286
|
+ window.ResponseController.execute(
|
|
2287
|
+ response,
|
|
2288
|
+ function(){},
|
|
2289
|
+ function(){}
|
|
2290
|
+ );
|
2267
|
2291
|
|
2268
|
2292
|
if (response.status == 'success')
|
2269
|
2293
|
{
|
|
@@ -2326,10 +2350,11 @@ $(document).ready(function(){
|
2326
|
2350
|
});
|
2327
|
2351
|
$('form[name="'+response.form_name+'"]').ajaxForm(function(response){
|
2328
|
2352
|
|
2329
|
|
- if (response.status == 'mustbeconnected')
|
2330
|
|
- {
|
2331
|
|
- $(location).attr('href', url_home);
|
2332
|
|
- }
|
|
2353
|
+ window.ResponseController.execute(
|
|
2354
|
+ response,
|
|
2355
|
+ function(){},
|
|
2356
|
+ function(){}
|
|
2357
|
+ );
|
2333
|
2358
|
|
2334
|
2359
|
if (response.status == 'success')
|
2335
|
2360
|
{
|
|
@@ -2379,10 +2404,11 @@ $(document).ready(function(){
|
2379
|
2404
|
|
2380
|
2405
|
$.getJSON($(this).attr('href'), function(response) {
|
2381
|
2406
|
|
2382
|
|
- if (response.status == 'mustbeconnected')
|
2383
|
|
- {
|
2384
|
|
- $(location).attr('href', url_home);
|
2385
|
|
- }
|
|
2407
|
+ window.ResponseController.execute(
|
|
2408
|
+ response,
|
|
2409
|
+ function(){},
|
|
2410
|
+ function(){}
|
|
2411
|
+ );
|
2386
|
2412
|
|
2387
|
2413
|
li.find('img.element_loader').hide();
|
2388
|
2414
|
|
|
@@ -2406,10 +2432,11 @@ $(document).ready(function(){
|
2406
|
2432
|
|
2407
|
2433
|
$.getJSON($(this).attr('href'), function(response) {
|
2408
|
2434
|
|
2409
|
|
- if (response.status == 'mustbeconnected')
|
2410
|
|
- {
|
2411
|
|
- $(location).attr('href', url_home);
|
2412
|
|
- }
|
|
2435
|
+ window.ResponseController.execute(
|
|
2436
|
+ response,
|
|
2437
|
+ function(){},
|
|
2438
|
+ function(){}
|
|
2439
|
+ );
|
2413
|
2440
|
|
2414
|
2441
|
li.find('img.element_loader').hide();
|
2415
|
2442
|
|
|
@@ -2432,10 +2459,11 @@ $(document).ready(function(){
|
2432
|
2459
|
|
2433
|
2460
|
$.getJSON($(this).attr('href'), function(response) {
|
2434
|
2461
|
|
2435
|
|
- if (response.status == 'mustbeconnected')
|
2436
|
|
- {
|
2437
|
|
- $(location).attr('href', url_home);
|
2438
|
|
- }
|
|
2462
|
+ window.ResponseController.execute(
|
|
2463
|
+ response,
|
|
2464
|
+ function(){},
|
|
2465
|
+ function(){}
|
|
2466
|
+ );
|
2439
|
2467
|
|
2440
|
2468
|
li.find('img.element_loader').hide();
|
2441
|
2469
|
|
|
@@ -2497,10 +2525,11 @@ $(document).ready(function(){
|
2497
|
2525
|
$('div.question').fadeOut();
|
2498
|
2526
|
$.getJSON(link.attr('href'), function(response){
|
2499
|
2527
|
|
2500
|
|
- if (response.status == 'mustbeconnected')
|
2501
|
|
- {
|
2502
|
|
- $(location).attr('href', url_home);
|
2503
|
|
- }
|
|
2528
|
+ window.ResponseController.execute(
|
|
2529
|
+ response,
|
|
2530
|
+ function(){},
|
|
2531
|
+ function(){}
|
|
2532
|
+ );
|
2504
|
2533
|
|
2505
|
2534
|
// On affiche l'élément que si on voit que le formulaire est sur la page
|
2506
|
2535
|
// Sinon c'est qu'on est sur une page ou on a pas normalement la possibilité
|
|
@@ -2744,10 +2773,11 @@ $(document).ready(function(){
|
2744
|
2773
|
link = $(this);
|
2745
|
2774
|
$.getJSON(link.attr('href'), function(response) {
|
2746
|
2775
|
|
2747
|
|
- if (response.status == 'mustbeconnected')
|
2748
|
|
- {
|
2749
|
|
- $(location).attr('href', url_home);
|
2750
|
|
- }
|
|
2776
|
+ window.ResponseController.execute(
|
|
2777
|
+ response,
|
|
2778
|
+ function(){},
|
|
2779
|
+ function(){}
|
|
2780
|
+ );
|
2751
|
2781
|
|
2752
|
2782
|
if (response.status == 'success')
|
2753
|
2783
|
{
|
|
@@ -2796,10 +2826,11 @@ $(document).ready(function(){
|
2796
|
2826
|
var link = $(this);
|
2797
|
2827
|
$.getJSON($(this).attr('href'), function(response) {
|
2798
|
2828
|
|
2799
|
|
- if (response.status == 'mustbeconnected')
|
2800
|
|
- {
|
2801
|
|
- $(location).attr('href', url_home);
|
2802
|
|
- }
|
|
2829
|
+ window.ResponseController.execute(
|
|
2830
|
+ response,
|
|
2831
|
+ function(){},
|
|
2832
|
+ function(){}
|
|
2833
|
+ );
|
2803
|
2834
|
|
2804
|
2835
|
if (response.status == 'success')
|
2805
|
2836
|
{
|
|
@@ -2824,10 +2855,11 @@ $(document).ready(function(){
|
2824
|
2855
|
|
2825
|
2856
|
$.getJSON($(this).attr('href')+'/'+newtag, function(response) {
|
2826
|
2857
|
|
2827
|
|
- if (response.status == 'mustbeconnected')
|
2828
|
|
- {
|
2829
|
|
- $(location).attr('href', url_home);
|
2830
|
|
- }
|
|
2858
|
+ window.ResponseController.execute(
|
|
2859
|
+ response,
|
|
2860
|
+ function(){},
|
|
2861
|
+ function(){}
|
|
2862
|
+ );
|
2831
|
2863
|
|
2832
|
2864
|
if (response.status == 'error')
|
2833
|
2865
|
{
|
|
@@ -2878,10 +2910,11 @@ $(document).ready(function(){
|
2878
|
2910
|
var link = $(this);
|
2879
|
2911
|
$.getJSON($(this).attr('href'), function(response) {
|
2880
|
2912
|
|
2881
|
|
- if (response.status == 'mustbeconnected')
|
2882
|
|
- {
|
2883
|
|
- $(location).attr('href', url_home);
|
2884
|
|
- }
|
|
2913
|
+ window.ResponseController.execute(
|
|
2914
|
+ response,
|
|
2915
|
+ function(){},
|
|
2916
|
+ function(){}
|
|
2917
|
+ );
|
2885
|
2918
|
|
2886
|
2919
|
if (response.status == 'success')
|
2887
|
2920
|
{
|
|
@@ -3045,6 +3078,13 @@ $(document).ready(function(){
|
3045
|
3078
|
return false;
|
3046
|
3079
|
});
|
3047
|
3080
|
|
|
3081
|
+ /*
|
|
3082
|
+ * tour launch manually
|
|
3083
|
+ */
|
|
3084
|
+
|
|
3085
|
+ $('a#launch_tour').click(function(){
|
|
3086
|
+ window.start_visit_tour();
|
|
3087
|
+ });
|
3048
|
3088
|
|
3049
|
3089
|
|
3050
|
3090
|
});
|