view.tpl 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <div id="learning_path_main" style="width:100%; height: 100%;">
  2. {% if is_allowed_to_edit %}
  3. <div class="row">
  4. <div id="learning_path_breadcrumb_zone" class="col-md-12">
  5. {{ breadcrumb }}
  6. </div>
  7. </div>
  8. {% endif %}
  9. <button id="touch-button" class="btn-touch"></button>
  10. <div class="container-fluid">
  11. <div class="row">
  12. <div id="learning_path_left_zone" class="sidebar-scorm">
  13. {% if gamification_mode == 1 %}
  14. <div class="row">
  15. <div class="col-xs-8">
  16. {% if gamification_stars > 0 %}
  17. {% for i in 1..gamification_stars %}
  18. <i class="fa fa-star fa-2x"></i>
  19. {% endfor %}
  20. {% endif %}
  21. {% if gamification_stars < 4 %}
  22. {% for i in 1..4 - gamification_stars %}
  23. <i class="fa fa-star-o fa-2x"></i>
  24. {% endfor %}
  25. {% endif %}
  26. </div>
  27. <div class="col-xs-4 text-right">
  28. {{ "XPoints"|get_lang|format(gamification_points) }}
  29. </div>
  30. </div>
  31. <div class="row">
  32. <div class="col-xs-12 navegation-bar" id="lp_navigation_elem">
  33. <div id="progress_bar">
  34. {{ progress_bar }}
  35. </div>
  36. </div>
  37. </div>
  38. {% else %}
  39. <div id="scorm-info" class="panel panel-default">
  40. <div class="panel-heading">
  41. <a id="ui-option">
  42. <i id="icon-down" class="fa fa-chevron-down hidden"></i>
  43. <i id="icon-up" class="fa fa-chevron-up"></i>
  44. </a>
  45. </div>
  46. {# Author image preview #}
  47. <div id="panel-scorm" class="panel-body">
  48. <a href="{{ button_home_url }}" class="btn btn-primary btn-block" target="_self" onclick="javascript: window.parent.API.save_asset();">
  49. <i class="fa fa-home"></i> {{ button_home_text }}
  50. </a>
  51. <div class="image-avatar">
  52. <div class="row">
  53. {% if lp_author == '' %}
  54. <div class="col-md-12">
  55. {{ lp_preview_image }}
  56. </div>
  57. {% else %}
  58. <div class="col-md-4">
  59. {{ lp_preview_image }}
  60. </div>
  61. <div class="col-md-8">
  62. <div class="description-autor"> {{ lp_author }} </div>
  63. </div>
  64. {% endif %}
  65. </div>
  66. </div>
  67. <div id="progress_bar">
  68. {{ progress_bar }}
  69. </div>
  70. <div id="lp_navigation_elem" class="navegation-bar">
  71. {{ navigation_bar }}
  72. </div>
  73. {% if show_audio_player %}
  74. <div id="lp_media_file">
  75. {{ media_player }}
  76. </div>
  77. {% endif %}
  78. </div>
  79. </div>
  80. {% endif %}
  81. {# TOC layout #}
  82. <div id="toc_id" class="scorm-body" name="toc_name">
  83. <div class="scorm-title"> <i class="fa fa-book"></i> {{ lp_title_scorm }}</div>
  84. <div id="learning_path_toc" class="scorm-list">
  85. {{ lp_html_toc }}
  86. </div>
  87. </div>
  88. {# end TOC layout #}
  89. </div>
  90. {# end left zone #}
  91. {# <div id="hide_bar" class="scorm-toggle" style="display:inline-block; width: 25px; height: 1000px;"></div> #}
  92. {# right zone #}
  93. <div id="learning_path_right_zone" style="height:100%" class="content-scorm">
  94. {% if lp_mode == 'fullscreen' %}
  95. <iframe id="content_id_blank" name="content_name_blank" src="blank.php" border="0" frameborder="0" style="width: 100%; height: 100%" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
  96. {% else %}
  97. <iframe id="content_id" name="content_name" src="{{ iframe_src }}" border="0" frameborder="0" style="display: block; width: 100%; height: 100%" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>
  98. {% endif %}
  99. </div>
  100. {# end right Zone #}
  101. {{ navigation_bar_bottom }}
  102. </div>
  103. </div>
  104. </div>
  105. <script>
  106. // Resize right and left pane to full height (HUB 20-05-2010).
  107. var updateContentHeight = function () {
  108. document.body.style.overflow = 'hidden';
  109. var IE = window.navigator.appName.match(/microsoft/i);
  110. /* Identified new height */
  111. var heightControl = $('#control-bottom').height();
  112. var heightBreadcrumb = ($('#learning_path_breadcrumb_zone').height()) ? $('#learning_path_breadcrumb_zone').height() : 0;
  113. var heightScormInfo = $('#scorm-info').height();
  114. var heightTop = heightScormInfo + 100;
  115. //heightTop = (heightTop > 300)? heightTop : 300;
  116. var innerHeight = $(window).height();
  117. if (innerHeight <= 640) {
  118. $('#inner_lp_toc').css('height', innerHeight - heightTop + "px");
  119. $('#content_id').css('height', innerHeight - heightControl + "px");
  120. } else {
  121. $('#inner_lp_toc').css('height', innerHeight - heightBreadcrumb - heightTop + "px");
  122. $('#content_id').css('height', innerHeight - heightControl + "px");
  123. }
  124. //var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
  125. // Loads the glossary library.
  126. {% if glossary_extra_tools in glossary_tool_availables %}
  127. {% if show_glossary_in_documents == 'ismanual' %}
  128. $.frameReady(
  129. function(){
  130. // $("<div>I am a div courses</div>").prependTo("body");
  131. },
  132. "top.content_name",
  133. {
  134. load: [
  135. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
  136. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  137. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  138. { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"}
  139. ]
  140. }
  141. );
  142. {% elseif show_glossary_in_documents == 'isautomatic' %}
  143. $.frameReady(
  144. function(){
  145. // $("<div>I am a div courses</div>").prependTo("body");
  146. },
  147. "top.content_name",
  148. {
  149. load: [
  150. { type:"script", id:"_fr1", src:"{{ jquery_web_path }}"},
  151. { type:"script", id:"_fr4", src:"{{ jquery_ui_js_web_path }}"},
  152. { type:"stylesheet", id:"_fr5", src:"{{ jquery_ui_css_web_path }}"},
  153. { type:"script", id:"_fr2", src:"{{ _p.web_lib }}javascript/jquery.highlight.js"}
  154. ]
  155. }
  156. );
  157. {% endif %}
  158. {% endif %}
  159. };
  160. $(document).ready(function() {
  161. updateContentHeight();
  162. $('#touch-button').children().click(function(){
  163. updateContentHeight();
  164. });
  165. $(window).resize(function() {
  166. updateContentHeight();
  167. });
  168. });
  169. window.onload = updateContentHeight();
  170. window.onresize = updateContentHeight();
  171. $(document).ready(function(){
  172. $("#icon-down").click(function(){
  173. $("#icon-up").removeClass("hidden");
  174. $(this).addClass("hidden");
  175. $('#panel-scorm').slideDown("slow",function(){
  176. updateContentHeight();
  177. });
  178. });
  179. $("#icon-up").click(function(){
  180. $("#icon-down").removeClass("hidden");
  181. $(this).addClass("hidden");
  182. $('#panel-scorm').slideUp("slow",function(){
  183. updateContentHeight();
  184. });
  185. });
  186. });
  187. </script>