Commit d393a503 by Prem Sichanugrist

Remove unused JavaScript on the page bottom

parent 59b45348
...@@ -11,9 +11,10 @@ class @Sequence ...@@ -11,9 +11,10 @@ class @Sequence
bind: -> bind: ->
@element.bind 'contentChanged', @toggleArrows @element.bind 'contentChanged', @toggleArrows
@$('#sequence-list a').click @goto @$('#sequence-list a').click @goto
@$('.sequence-nav li a').hover @navHover
buildNavigation: -> buildNavigation: ->
$.each @elements, (index, item) -> $.each @elements, (index, item) =>
link = $('<a>').attr class: "seq_#{item.type}_inactive", 'data-element': index + 1 link = $('<a>').attr class: "seq_#{item.type}_inactive", 'data-element': index + 1
title = $('<p>').html(item.title) title = $('<p>').html(item.title)
list_item = $('<li>').append(link.append(title)) list_item = $('<li>').append(link.append(title))
...@@ -45,6 +46,9 @@ class @Sequence ...@@ -45,6 +46,9 @@ class @Sequence
@position = new_position @position = new_position
@element.trigger 'contentChanged' @element.trigger 'contentChanged'
navHover: (event) =>
$(event.target).siblings().toggleClass("shown")
goto: (event) => goto: (event) =>
event.preventDefault() event.preventDefault()
new_position = $(event.target).data('element') new_position = $(event.target).data('element')
......
...@@ -7,12 +7,10 @@ ...@@ -7,12 +7,10 @@
</%block> </%block>
<%block name="js_extra"> <%block name="js_extra">
##Is there a reason this isn't in header_extra? Is it important that the javascript is at the bottom of the generated document?
<!-- TODO: http://docs.jquery.com/Plugins/Validation --> <!-- TODO: http://docs.jquery.com/Plugins/Validation -->
<script type="text/javascript"> <script type="text/javascript">
$(function() { document.write('\x3Cscript type="text/javascript" src="' +
${init} document.location.protocol + '//www.youtube.com/player_api">\x3C/script>');
});
</script> </script>
</%block> </%block>
......
...@@ -113,7 +113,6 @@ ...@@ -113,7 +113,6 @@
<script type="text/javascript" src="${static.url('js/jquery.leanModal.min.js')}"></script> <script type="text/javascript" src="${static.url('js/jquery.leanModal.min.js')}"></script>
<script type="text/javascript" src="${static.url('js/jquery.qtip.min.js')}"></script> <script type="text/javascript" src="${static.url('js/jquery.qtip.min.js')}"></script>
<script type="text/javascript" src="${static.url('js/jquery.cookie.js')}"></script> <script type="text/javascript" src="${static.url('js/jquery.cookie.js')}"></script>
<script type="text/javascript" src="${static.url('js/video_player.js')}"></script>
<script type="text/javascript" src="${static.url('js/schematic.js')}"></script> <script type="text/javascript" src="${static.url('js/schematic.js')}"></script>
<script type="text/javascript" src="${static.url('js/cktsim.js')}"></script> <script type="text/javascript" src="${static.url('js/cktsim.js')}"></script>
<script type="text/javascript" src="${static.url('js/jquery.scrollTo-1.4.2-min.js')}"></script> <script type="text/javascript" src="${static.url('js/jquery.scrollTo-1.4.2-min.js')}"></script>
...@@ -121,7 +120,6 @@ ...@@ -121,7 +120,6 @@
document.write('\x3Cscript type="text/javascript" src="' + document.write('\x3Cscript type="text/javascript" src="' +
document.location.protocol + '//www.youtube.com/player_api">\x3C/script>'); document.location.protocol + '//www.youtube.com/player_api">\x3C/script>');
</script> </script>
<%block name="js_extra"/> <%block name="js_extra"/>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment