home.html.twig 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. {% autoescape false %}
  2. <script>
  3. $(document).ready(function(){
  4. window.start_visit_tour = function()
  5. {
  6. jQuery.aSimpleTour({
  7. data : [
  8. {
  9. element: '#elements_list',
  10. tooltip : {{ 'help_tour.home.elements.tooltip'|trans({}, 'text') }},
  11. position : 'T',
  12. text : {{ 'help_tour.home.elements.tour'|trans({}, 'text') }},
  13. tooltipCallback : function(){ $('#tabs_tag_search_no_tags').trigger('click'); }
  14. },
  15. {
  16. element: 'ul.elements li:first td.element_thumbnail',
  17. text : {{ 'help_tour.home.element.tour'|trans({}, 'text') }},
  18. tooltip: {{ 'help_tour.home.element.play'|trans({}, 'text') }},
  19. position : 'R'
  20. },
  21. {
  22. element: 'ul.elements li:first ul.element_links_actions',
  23. text : {{ 'help_tour.home.element.tour'|trans({}, 'text') }},
  24. tooltip: {{ 'help_tour.home.element.actions'|trans({}, 'text') }},
  25. position : 'L'
  26. },
  27. {
  28. element: 'ul.elements li:first ul.element_thumb_actions',
  29. text : {{ 'help_tour.home.element.tour'|trans({}, 'text') }},
  30. tooltip: {{ 'help_tour.home.element.likefav'|trans({}, 'text') }},
  31. position : 'R'
  32. },
  33. {
  34. element: 'div#tags_prompt_search',
  35. text : {{ 'help_tour.home.filters.tour'|trans({}, 'text') }},
  36. tooltip: {{ 'help_tour.home.filters.tags'|trans({}, 'text') }},
  37. position : 'T'
  38. },
  39. {
  40. element: 'a#link_all_network',
  41. text : {{ 'help_tour.home.network.tour'|trans({}, 'text') }},
  42. tooltip: {{ 'help_tour.home.network.public'|trans({}, 'text') }},
  43. position : 'B'
  44. },
  45. {
  46. element: 'a#link_my_network',
  47. text : {{ 'help_tour.home.network.tour'|trans({}, 'text') }},
  48. tooltip: {{ 'help_tour.home.network.private'|trans({}, 'text') }},
  49. position : 'B'
  50. },
  51. {
  52. element: '#header_menu li a#link_playlist',
  53. text : {{ 'help_tour.home.network.tour'|trans({}, 'text') }},
  54. tooltip: {{ 'help_tour.home.network.playlist'|trans({}, 'text') }},
  55. position : 'B'
  56. },
  57. {
  58. element: '#mainbox',
  59. text : {{ 'help_tour.home.addelement.tour'|trans({}, 'text') }},
  60. tooltip: {{ 'help_tour.home.addelement.url'|trans({}, 'text') }},
  61. position : 'T',
  62. tooltipCallback : function(){
  63. $('#element_add_link').trigger('click');
  64. $('#element_add_url').val('http://www.jamendo.com/fr/list/a114042/falling-apart');
  65. }
  66. },
  67. {
  68. element: '#mainbox',
  69. text : {{ 'help_tour.home.addelement.tour'|trans({}, 'text') }},
  70. tooltip: {{ 'help_tour.home.addelement.form'|trans({}, 'text') }},
  71. position : 'T',
  72. tooltipCallback : function(){
  73. $('#element_add_url').val('http://www.jamendo.com/fr/list/a114042/falling-apart');
  74. $('#form_add_first_part input[type="submit"]').trigger('click');
  75. }
  76. },
  77. {
  78. element: '#header_logo',
  79. tooltip : {{ 'help_tour.home.end.go'|trans({}, 'text') }},
  80. text : {{ 'help_tour.home.end.tour'|trans({}, 'text') }}
  81. }
  82. ],
  83. controlsPosition : 'TR',
  84. welcomeMessage : {{ 'help_tour.home.welcome.tour'|trans({}, 'text') }},
  85. tooltipColors: { 'color' : 'black', 'backgroud' : ''},
  86. controlsColors: { 'color' : 'black', 'backgroud' : ''},
  87. buttons : {
  88. next: '{{ 'help_tour.buttons.next'|trans({}, 'text') }}',
  89. prev: '{{ 'help_tour.buttons.prev'|trans({}, 'text') }}',
  90. start: '{{ 'help_tour.buttons.start'|trans({}, 'text') }}',
  91. end: '{% if app.user %}{{ 'help_tour.buttons.end'|trans({}, 'text') }}{% else %}{{ 'help_tour.buttons.close'|trans({}, 'text') }}{% endif %}'
  92. },
  93. endCallback: function(){
  94. {% if app.user %}
  95. $('#element_add_close_link').trigger('click');
  96. JQueryJson("{{ path('user_hide_help', {
  97. 'help_id' : 'home',
  98. 'token' : app.user.getPersonalHash('updateHelpAction')
  99. }) }}", {}, $.noop);
  100. {% else %}
  101. $('#element_add_close_link').trigger('click');
  102. {% endif %}
  103. }
  104. }
  105. );
  106. }
  107. {% if start %}
  108. window.start_visit_tour();
  109. {% endif %}
  110. });
  111. </script>
  112. {% endautoescape %}