Skip to content

Commit

Permalink
Eliminate inline JavaScript, as there's no way to use it with any CSP.
Browse files Browse the repository at this point in the history
  • Loading branch information
bentley committed Jul 18, 2019
1 parent c86fc34 commit 7d69537
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
20 changes: 20 additions & 0 deletions public/javascripts/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$('#test_depends_link').click(function() {
$('#test-depends-list').slideToggle('fast', function() {
// ok
});
return(false);
});

$('#reverse_depends_link').click(function() {
$('#reverse-depends-list').slideToggle('fast', function() {
// ok
});
return(false);
});

$('#files_list_link').click(function() {
$('#files-list').slideToggle('fast', function() {
// ok
});
return(false);
});
1 change: 1 addition & 0 deletions views/layouts/main.tt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
<div id="footer">
<a href="/path/databases/ports-readmes-dancer">Ports Readmes</a>, powered by <a href="http://perldancer.org/">Dancer</a> <% dancer_version %>
</div>
<script type="text/javascript" src="//<% request.host %>/javascripts/script.js"></script>
24 changes: 0 additions & 24 deletions views/port.tt
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,6 @@ on <% b.arch | html %>:
<% END %>
</ul>
</div>
<script type="text/javascript">
$('#test_depends_link').click(function() {
$('#test-depends-list').slideToggle('fast', function() {
// ok
});
return(false);
});
</script>
<% END %>
<%IF reversedepends %>
<h3><a href="#" id="reverse_depends_link">Reverse dependencies</a></h3>
Expand All @@ -117,14 +109,6 @@ $('#test_depends_link').click(function() {
<% END %>
</ul>
</div>
<script type="text/javascript">
$('#reverse_depends_link').click(function() {
$('#reverse-depends-list').slideToggle('fast', function() {
// ok
});
return(false);
});
</script>
<% END %>
<% IF files %>
<h3><a href="#" id="files_list_link">Files</a></h3>
Expand All @@ -135,12 +119,4 @@ $('#reverse_depends_link').click(function() {
<% END %>
</ul>
</div>
<script type="text/javascript">
$('#files_list_link').click(function() {
$('#files-list').slideToggle('fast', function() {
// ok
});
return(false);
});
</script>
<% END %>

0 comments on commit 7d69537

Please sign in to comment.