Bastien Sevajol 11 anni fa
parent
commit
e6a9b8c68a

+ 111 - 2
web/bundles/muzichcore/css/main.css Vedi File

@@ -517,7 +517,7 @@ ul.element_tags .button
517 517
 
518 518
 }
519 519
 
520
-a.button.element_tag, ul.tagbox li.tag, ul.search_tag_list li, ul#favorite_tags li, ul.tags_cloud li
520
+a.button.element_tag, ul.tagbox li.tag, ul.search_tag_list li, ul#favorite_tags li, ul.tags_cloud li, a.button.tag_to_favorites
521 521
 {
522 522
   padding: 6px;
523 523
   border: none;
@@ -557,6 +557,14 @@ li.element a.tag_to_favorites, li.element img.tag_to_favorites
557 557
   margin-right: 4px;
558 558
 }
559 559
 
560
+li.element a.tag_to_favorites.out
561
+{
562
+  margin-left: -3px;
563
+  margin-left: 0px;
564
+  margin-bottom: -5px;
565
+  padding: 5px;
566
+}
567
+
560 568
 img.tag_to_favorites
561 569
 {
562 570
   margin-bottom: -1px;
@@ -2254,6 +2262,11 @@ ul.playlist_elements li.playlist_element ul.elements li.element
2254 2262
   border-top: none;
2255 2263
 }
2256 2264
 
2265
+ul.playlist_elements li.playlist_element div.actions.fixwidth
2266
+{
2267
+  width: 65px;
2268
+}
2269
+
2257 2270
 a.button img
2258 2271
 {
2259 2272
   float: left;
@@ -2431,7 +2444,7 @@ form.playlist_edit input[type="submit"]
2431 2444
 
2432 2445
 div.playlists_prompt
2433 2446
 {
2434
-  z-index: 100001;
2447
+  z-index: 100003;
2435 2448
 }
2436 2449
 
2437 2450
 a.all_network
@@ -2459,6 +2472,102 @@ div#tags_prompt_search p.help_notags span
2459 2472
   width: 480px;
2460 2473
 }
2461 2474
 
2475
+.iframe #main_content
2476
+{
2477
+  min-height: available;
2478
+  position: static;
2479
+  width: 560px;
2480
+}
2481
+
2482
+.iframe #content
2483
+{
2484
+  display: block;
2485
+  margin-left: auto;
2486
+  margin-right: auto;
2487
+  width: 100%;
2488
+  padding-bottom: 0px;
2489
+}
2490
+
2491
+.iframe #main.content
2492
+{
2493
+  float: none;
2494
+  width: 100%;
2495
+  margin-right: 0px;
2496
+}
2497
+
2498
+.iframe #mainbox.nicebox
2499
+{
2500
+  border: none;
2501
+  box-shadow: none;
2502
+  padding: 25px;
2503
+}
2504
+
2505
+.iframe input#element_add_name, .iframe div#tags_prompt_add input.tag_prompt
2506
+{
2507
+  width: 400px;
2508
+}
2509
+
2510
+.iframe div#add_url_title, div.element_title 
2511
+{
2512
+  width: 75%;
2513
+}
2514
+
2515
+.iframe div#form_add_second_part input[type="submit"]
2516
+{
2517
+  margin-right: 20px;
2518
+}
2519
+
2520
+.iframe #tags_prompt_add
2521
+{
2522
+  width: 100%;
2523
+}
2524
+
2525
+div#share_from_message
2526
+{
2527
+  font-weight: bold;
2528
+  padding: 15px;
2529
+  font-size: 115%;
2530
+}
2531
+
2532
+div.social_buttons ul
2533
+{
2534
+  list-style-type: none;
2535
+  margin-left: 0;
2536
+}
2537
+
2538
+div.social_buttons ul li
2539
+{
2540
+  display : inline;
2541
+  margin-left: 5px;
2542
+  float:left;
2543
+}
2544
+
2545
+div.social_buttons ul li.googleplus {
2546
+    margin-left: -25px;
2547
+}
2548
+
2549
+a.button.toplist:visited
2550
+{
2551
+  color: white;
2552
+}
2553
+
2554
+a.button.toplist
2555
+{
2556
+  float: right;
2557
+}
2558
+
2559
+div.private_links form div.inputs
2560
+{
2561
+  float: right;
2562
+}
2563
+
2564
+div.private_links textarea
2565
+{
2566
+  height: 60px;
2567
+  width: 435px;
2568
+}
2569
+
2570
+
2462 2571
 /*
2463 2572
 *
2464 2573
 *

+ 2 - 7
web/bundles/muzichcore/css/old.css Vedi File

@@ -934,7 +934,7 @@ a.more
934 934
 	position: fixed; left: 0; top: 0;
935 935
 	width: 100%; height: 100%;
936 936
 	opacity: .80;
937
-	z-index: 9999;
937
+	z-index: 100001;
938 938
 }
939 939
 .popin_block{
940 940
 	background: #fff;
@@ -944,7 +944,7 @@ a.more
944 944
 	font-size: 1.2em;
945 945
 	position: fixed;
946 946
 	top: 50%; left: 50%;
947
-	z-index: 99999;
947
+	z-index: 100002;
948 948
 	/*--Les différentes définitions de Box Shadow en CSS3--*/
949 949
 	-webkit-box-shadow: 0px 0px 20px #000;
950 950
 	-moz-box-shadow: 0px 0px 20px #000;
@@ -1099,11 +1099,6 @@ div.comments_loader
1099 1099
   margin-right: 4px;
1100 1100
 }*/
1101 1101
 
1102
-li.element a.element_tag_large_for_fav
1103
-{
1104
-  padding-right: 15px;
1105
-}
1106
-
1107 1102
 /*li.element a.element_tag_large_for_fav_still
1108 1103
 {
1109 1104
   padding-right: 15px;

+ 1 - 0
web/bundles/muzichcore/js/autoplay.js Vedi File

@@ -81,6 +81,7 @@ function Autoplay()
81 81
       if (response.status == 'success')
82 82
       {
83 83
         $('li#autoplay_element_container').html(response.data);
84
+        refresh_social_buttons(true);
84 85
       }
85 86
       else
86 87
       {

+ 179 - 20
web/bundles/muzichcore/js/muzich.js Vedi File

@@ -23,7 +23,7 @@ function hideAllMessages()
23 23
 
24 24
 function ResponseController()
25 25
 {
26
-  var propagate = function(response)
26
+  var propagate = function(response, after_login_success_callback)
27 27
   {
28 28
     if (response.status === 'error')
29 29
     {
@@ -35,18 +35,19 @@ function ResponseController()
35 35
       }
36 36
       else if (response.error === 'UserNotConnected')
37 37
       {
38
-        open_connection_or_subscription_window();
38
+        open_connection_or_subscription_window(false, {}, after_login_success_callback);
39 39
       }
40 40
     }
41 41
     else if (response.status === 'mustbeconnected')
42 42
     {
43
-      open_connection_or_subscription_window(true);
43
+      open_connection_or_subscription_window(true, {}, after_login_success_callback);
44 44
     }
45
-  }
45
+  };
46 46
   
47
-  this.execute = function(response, success_callback, failure_callback)
47
+  this.execute = function(response, success_callback, failure_callback, after_login_success_callback)
48 48
   {
49
-    propagate(response);
49
+    propagate(response, after_login_success_callback);
50
+    
50 51
     if (response.status === 'success')
51 52
     {
52 53
       success_callback(response);
@@ -55,7 +56,7 @@ function ResponseController()
55 56
     {
56 57
       failure_callback(response);
57 58
     }
58
-  }
59
+  };
59 60
 }
60 61
 
61 62
 window.ResponseController = new ResponseController();
@@ -635,6 +636,8 @@ $(document).ready(function(){
635 636
           if (response.count)
636 637
           {
637 638
             $('ul.elements').append(response.html);
639
+            refresh_social_buttons();
640
+            
638 641
             $('img.elements_more_loader').hide();
639 642
             recolorize_element_list();
640 643
             
@@ -685,6 +688,7 @@ $(document).ready(function(){
685 688
       );
686 689
     
687 690
     $('ul.elements').html(response.html);
691
+    refresh_social_buttons();
688 692
     
689 693
     if (response.count)
690 694
      {
@@ -1252,7 +1256,7 @@ $(document).ready(function(){
1252 1256
   });
1253 1257
   
1254 1258
   // Selection Réseau global / Mon réseau
1255
-  $('a.all_network, a.my_network').live('click', function(){
1259
+  $('ul#tabs_tag_search_buttons a.all_network, ul#tabs_tag_search_buttons  a.my_network').live('click', function(){
1256 1260
     
1257 1261
     if ($('form[name="search"]').length)
1258 1262
     {
@@ -1282,6 +1286,7 @@ $(document).ready(function(){
1282 1286
     {
1283 1287
       $('form[name="add"]').find('ul.error_list').remove();
1284 1288
       $('ul.elements').prepend(response.html);
1289
+      refresh_social_buttons();
1285 1290
       $('form[name="add"] input[type="text"]').val('');
1286 1291
       
1287 1292
       if ($('form[name="search"]').length)
@@ -1320,6 +1325,17 @@ $(document).ready(function(){
1320 1325
       
1321 1326
       form_add_hide_errors();
1322 1327
       
1328
+      // Dans le cas d'un ajout depuis l'extérieur (iframe)
1329
+      if ($('form[name="add"] input[name="shared_from"]').val() === "1")
1330
+      {
1331
+        var elements = $('<ul class="elements"></ul>')
1332
+        elements.prepend(response.html);
1333
+        $('div#share_from_content').append(elements);
1334
+        $('div#share_from_message').text(response.message);
1335
+        $('form[name="add"]').append($('<input type="hidden" name="shared_from_finished" id="shared_from_finished" value="1" />'));
1336
+        refresh_social_buttons();
1337
+      }
1338
+      
1323 1339
       return true;
1324 1340
     }
1325 1341
     else if (response.status == 'error')
@@ -1540,11 +1556,25 @@ $(document).ready(function(){
1540 1556
   });
1541 1557
   $('form[name="add"]').ajaxForm(function(response) {
1542 1558
     
1559
+    var callback_login = function(){ 
1560
+      $('#form_add_loader').show();
1561
+      JQueryJson(url_csrf, {}, function(response){
1562
+        if (response.status == 'success')
1563
+        {
1564
+          $('form[name="add"] input[name="element_add[_token]"]').val(response.data);
1565
+          $('form[name="add"]').submit();
1566
+          $('#form_add_loader').hide();
1567
+        }
1568
+      });
1569
+    };
1570
+    
1571
+    
1543 1572
     $('form[name="add"] img.tag_loader').hide();
1544 1573
     window.ResponseController.execute(
1545 1574
       response,
1546 1575
       function(){},
1547
-      function(){}
1576
+      function(){},
1577
+      callback_login
1548 1578
     );
1549 1579
     
1550 1580
       // Si on en est a la première étape la réponse sera des données récupérés auprès
@@ -1626,6 +1656,7 @@ $(document).ready(function(){
1626 1656
       );
1627 1657
       
1628 1658
       $('ul.elements').html(response.html);
1659
+      refresh_social_buttons();
1629 1660
       
1630 1661
       if (response.count)
1631 1662
        {
@@ -1732,7 +1763,7 @@ $(document).ready(function(){
1732 1763
   
1733 1764
   function check_new_elements()
1734 1765
   {
1735
-    if ($('ul.elements li').length)
1766
+    if ($('ul.elements li').length && $('ul.elements').data('context') === 'home')
1736 1767
     {
1737 1768
       // Si l'utilisateur a quitté la page on reporte le check
1738 1769
       if ($('body.blurred').length)
@@ -1832,6 +1863,7 @@ $(document).ready(function(){
1832 1863
           }
1833 1864
 
1834 1865
           $('ul.elements').prepend(response.html);
1866
+          refresh_social_buttons();
1835 1867
           recolorize_element_list();
1836 1868
         }
1837 1869
 
@@ -1939,10 +1971,23 @@ $(document).ready(function(){
1939 1971
       li_element.find('form.add_comment').show();
1940 1972
       
1941 1973
       li_element.find('form.add_comment').ajaxForm(function(response) {
1974
+        
1942 1975
         window.ResponseController.execute(
1943 1976
         response,
1944 1977
         function(){},
1945
-        function(){}
1978
+        function(){},
1979
+        function(){
1980
+  
1981
+          JQueryJson(url_csrf, {}, function(response){
1982
+            if (response.status === 'success')
1983
+            {
1984
+              li_element.find('form.add_comment').attr('action', str_replace('unknown', response.data, li_element.find('form.add_comment').attr('action')));
1985
+              li_element.find('form.add_comment').submit();
1986
+            }
1987
+          });
1988
+          scrollTo(li_element);
1989
+  
1990
+        }
1946 1991
       );
1947 1992
 
1948 1993
         li_element.find('img.comments_loader').hide();
@@ -2159,6 +2204,7 @@ $(document).ready(function(){
2159 2204
       });
2160 2205
       
2161 2206
       $('div.question').fadeOut();
2207
+      $('a.tag_to_favorites').removeClass('mustBeDisplayed');
2162 2208
       return false;
2163 2209
     },
2164 2210
     onOpen: function(link){
@@ -2166,10 +2212,7 @@ $(document).ready(function(){
2166 2212
       li.find('a.tag_to_favorites').addClass('mustBeDisplayed');
2167 2213
     },
2168 2214
     onClose: function(link){
2169
-      var li = link.parents('li.element_tag');
2170
-      li.find('a.tag_to_favorites').removeClass('mustBeDisplayed');
2171
-      li.find('a.element_tag').removeClass('element_tag_large_for_fav');
2172
-      li.find('a.tag_to_favorites').hide();
2215
+      $('a.tag_to_favorites').removeClass('mustBeDisplayed');
2173 2216
     }
2174 2217
   });
2175 2218
   
@@ -2568,6 +2611,12 @@ $(document).ready(function(){
2568 2611
     $(this).hide();
2569 2612
   });
2570 2613
   
2614
+  $('a.display_all_cloud_tag').click(function(){
2615
+    $(this).parents('ul.tags_cloud').find('li').show();
2616
+    $(this).parent().remove();
2617
+    return false;
2618
+  });
2619
+  
2571 2620
   $('input#cloud_tags_filter').keyup(function(){
2572 2621
     var search_string = $(this).val();
2573 2622
     
@@ -3009,7 +3058,9 @@ $(document).ready(function(){
3009 3058
     * MUSTBECONNECTED links
3010 3059
     */
3011 3060
    
3012
-    $('a.mustbeconnected').live('click', function(){open_connection_or_subscription_window();});
3061
+    $('a.mustbeconnected').live('click', function(){
3062
+      open_connection_or_subscription_window();
3063
+    });
3013 3064
     $('a.mustbeconnected').off('click').on('click',function(){
3014 3065
       open_connection_or_subscription_window();
3015 3066
     });
@@ -3141,9 +3192,16 @@ $(document).ready(function(){
3141 3192
           function(){}
3142 3193
         );
3143 3194
 
3195
+        line.find('img.loader').hide();
3144 3196
         if (response.status === 'success')
3145 3197
         {
3146 3198
           line.find('div.content_opened').html('<ul class="elements">' + response.data + '</ul>');
3199
+          refresh_social_buttons();
3200
+        }
3201
+        else
3202
+        if (response.status === 'error')
3203
+        {
3204
+          line.find('div.content_opened').html(response.message);
3147 3205
         }
3148 3206
       });
3149 3207
     }
@@ -3271,7 +3329,17 @@ $(document).ready(function(){
3271 3329
       $.getJSON(link.attr('href'), function(response) {
3272 3330
         window.ResponseController.execute(
3273 3331
           response,
3274
-          function(){},
3332
+          function(response){
3333
+            
3334
+            if (response.data.element_remove_links.length)
3335
+            {
3336
+              for (index in response.data.element_remove_links)
3337
+              {
3338
+                $($('ul.playlist_elements li.playlist_element').get(index)).find('a.remove_element').attr('href', response.data.element_remove_links[index]);
3339
+              }
3340
+            }
3341
+            
3342
+          },
3275 3343
           function(){}
3276 3344
         );
3277 3345
       });
@@ -3318,8 +3386,56 @@ $(document).ready(function(){
3318 3386
     window.sidebar_topsticked = true;
3319 3387
   }
3320 3388
   
3389
+  /*
3390
+   * Playlist private links lien privés
3391
+   * 
3392
+   */
3393
+  
3394
+  $('a.open_playlist_private_links').click(function(){
3395
+    $('div.private_links').slideDown();
3396
+  });
3397
+  
3398
+  $('div.private_links input.cancel').click(function(){
3399
+    $('div.private_links').slideUp();
3400
+  });
3401
+  
3402
+  
3403
+  /*
3404
+   * SOCIAL BUTTONS
3405
+   * 
3406
+   */
3407
+  
3408
+  refresh_social_buttons();
3409
+  
3321 3410
 });
3322 3411
 
3412
+var facebook_like_rendereds = new Array();
3413
+var facebook_like_rendereds_autoplay = new Array();
3414
+
3415
+function refresh_social_buttons(autoplay)
3416
+{
3417
+  proceed_facebook_like_buttons(autoplay);
3418
+  gapi.plusone.go();
3419
+  twttr.widgets.load();
3420
+}
3421
+
3422
+function proceed_facebook_like_buttons(autoplay)
3423
+{
3424
+  $('ul.elements li.element, ul#autoplay_element li.element').each(function(){
3425
+    
3426
+    if ( ($.inArray($(this).get(0), facebook_like_rendereds) === -1 && !autoplay) || ($.inArray($(this).get(0), facebook_like_rendereds_autoplay) === -1 && autoplay))
3427
+    {
3428
+      FB.XFBML.parse($(this).get(0));
3429
+    }
3430
+    
3431
+    if (!autoplay)
3432
+      facebook_like_rendereds.push($(this).get(0));
3433
+    if (autoplay)
3434
+      facebook_like_rendereds_autoplay.push($(this).get(0));
3435
+  });
3436
+  
3437
+}
3438
+
3323 3439
 function open_ajax_popin(url, callback, data)
3324 3440
 {
3325 3441
   if (!popin_opened)
@@ -3349,7 +3465,7 @@ function open_ajax_popin(url, callback, data)
3349 3465
   }
3350 3466
 }
3351 3467
 
3352
-function open_connection_or_subscription_window(open_login_part, data)
3468
+function open_connection_or_subscription_window(open_login_part, data, login_success_callback)
3353 3469
 {
3354 3470
   if (window_login_or_subscription_opened == false)
3355 3471
   {
@@ -3378,7 +3494,16 @@ function open_connection_or_subscription_window(open_login_part, data)
3378 3494
         $('div.login form').find('img.loader').hide();
3379 3495
         if (response.status == 'success')
3380 3496
         {
3381
-          $(location).attr('href', response.data.redirect_url);
3497
+          if (login_success_callback)
3498
+          {
3499
+            $('a#helpbox_close').click();
3500
+            login_success_callback();
3501
+            reload_top_and_side();
3502
+          }
3503
+          else
3504
+          {
3505
+            $(location).attr('href', response.data.redirect_url);
3506
+          }
3382 3507
         }
3383 3508
         else if (response.status == 'error')
3384 3509
         {
@@ -3395,7 +3520,16 @@ function open_connection_or_subscription_window(open_login_part, data)
3395 3520
         $('div.register form.fos_user_registration_register').find('img.loader').hide();
3396 3521
         if (response.status == 'success')
3397 3522
         {
3398
-          $(location).attr('href', url_home);
3523
+          if (login_success_callback)
3524
+          {
3525
+            $('a#helpbox_close').click();
3526
+            login_success_callback();
3527
+            reload_top_and_side();
3528
+          }
3529
+          else
3530
+          {
3531
+            $(location).attr('href', url_home);
3532
+          }
3399 3533
         }
3400 3534
         else if (response.status == 'error')
3401 3535
         {
@@ -3408,6 +3542,8 @@ function open_connection_or_subscription_window(open_login_part, data)
3408 3542
       
3409 3543
     }, data);
3410 3544
   }
3545
+  
3546
+  $('div.playlists_prompt').remove();
3411 3547
 }
3412 3548
 
3413 3549
 function close_popin()
@@ -3441,4 +3577,27 @@ function sidebar_fix_to_bottom_finish()
3441 3577
       $('.sidebar').css('bottom', '')
3442 3578
     });
3443 3579
   }
3580
+}
3581
+
3582
+function reload_top_and_side()
3583
+{
3584
+  JQueryJson(url_reload_top_and_side, {}, function(response){
3585
+    if (response.status == 'success')
3586
+    {
3587
+      if ($('div#header'))
3588
+      {
3589
+        $('div#header').html(response.data.top);
3590
+      }
3591
+        
3592
+      if ($('aside#sidebar div.sidebar'))
3593
+      {
3594
+        $('aside#sidebar div.sidebar').html(response.data.right);
3595
+      }
3596
+    }
3597
+  });
3598
+}
3599
+
3600
+function scrollTo(element)
3601
+{
3602
+  $('html, body').animate({ scrollTop: element.offset().top }, 'fast');
3444 3603
 }

+ 4 - 5
web/bundles/muzichcore/js/player/SoundCloudPlayer.js Vedi File

@@ -30,8 +30,7 @@ function SoundCloudPlayer(ref_id, object_for_player, finish_callback, autoplay)
30 30
     }
31 31
     else
32 32
     {
33
-      // On gère la lecture auto difframment: rappel: si on supprime une iframe l'api SC ne la trouve plus et bug
34
-      $('#autoplay').append('<iframe id="'+_iframe_id+'" src="http://w.soundcloud.com/player/?url='
33
+      $('#autoplay_player_soundcloud').append('<iframe id="'+_iframe_id+'" src="http://w.soundcloud.com/player/?url='
35 34
         +_ref_id+'&show_artwork=false&auto_play=true" width="100%" '
36 35
         +'height="350" scrolling="no" frameborder="no"></iframe>');
37 36
     }
@@ -93,13 +92,13 @@ function SoundCloudPlayer(ref_id, object_for_player, finish_callback, autoplay)
93 92
   
94 93
   this.destroy = function(force)
95 94
   {
96
-    if (_player)
95
+    if (_player && !_autoplay)
97 96
     {
98
-      _player.pause();
97
+      _object_for_player.html('');
99 98
     }
100 99
     if (_autoplay || force)
101 100
     {
102
-      $('#'+_iframe_id).hide();
101
+      $('#autoplay_player_soundcloud').html('');
103 102
     }
104 103
   }
105 104