Mercurial > repos > yating-l > hubarchivecreator
annotate doc/_build/html/_static/websupport.js @ 72:2440ce10848b draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit a60f8496cccf4c5a07ba7d75876198eda997f07d
| author | yating-l | 
|---|---|
| date | Wed, 27 Sep 2017 15:34:20 -0400 | 
| parents | 4ced8f116509 | 
| children | 
| rev | line source | 
|---|---|
| 2 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 1 /* | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 2 * websupport.js | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 3 * ~~~~~~~~~~~~~ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 4 * | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 5 * sphinx.websupport utilities for all documentation. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 6 * | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 7 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 8 * :license: BSD, see LICENSE for details. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 9 * | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 10 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 11 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 12 (function($) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 13 $.fn.autogrow = function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 14 return this.each(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 15 var textarea = this; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 16 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 17 $.fn.autogrow.resize(textarea); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 18 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 19 $(textarea) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 20 .focus(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 21 textarea.interval = setInterval(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 22 $.fn.autogrow.resize(textarea); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 23 }, 500); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 24 }) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 25 .blur(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 26 clearInterval(textarea.interval); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 27 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 28 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 29 }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 30 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 31 $.fn.autogrow.resize = function(textarea) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 32 var lineHeight = parseInt($(textarea).css('line-height'), 10); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 33 var lines = textarea.value.split('\n'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 34 var columns = textarea.cols; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 35 var lineCount = 0; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 36 $.each(lines, function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 37 lineCount += Math.ceil(this.length / columns) || 1; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 38 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 39 var height = lineHeight * (lineCount + 1); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 40 $(textarea).css('height', height); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 41 }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 42 })(jQuery); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 43 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 44 (function($) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 45 var comp, by; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 46 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 47 function init() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 48 initEvents(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 49 initComparator(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 50 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 51 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 52 function initEvents() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 53 $(document).on("click", 'a.comment-close', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 54 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 55 hide($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 56 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 57 $(document).on("click", 'a.vote', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 58 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 59 handleVote($(this)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 60 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 61 $(document).on("click", 'a.reply', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 62 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 63 openReply($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 64 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 65 $(document).on("click", 'a.close-reply', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 66 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 67 closeReply($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 68 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 69 $(document).on("click", 'a.sort-option', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 70 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 71 handleReSort($(this)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 72 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 73 $(document).on("click", 'a.show-proposal', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 74 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 75 showProposal($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 76 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 77 $(document).on("click", 'a.hide-proposal', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 78 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 79 hideProposal($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 80 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 81 $(document).on("click", 'a.show-propose-change', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 82 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 83 showProposeChange($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 84 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 85 $(document).on("click", 'a.hide-propose-change', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 86 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 87 hideProposeChange($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 88 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 89 $(document).on("click", 'a.accept-comment', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 90 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 91 acceptComment($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 92 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 93 $(document).on("click", 'a.delete-comment', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 94 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 95 deleteComment($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 96 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 97 $(document).on("click", 'a.comment-markup', function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 98 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 99 toggleCommentMarkupBox($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 100 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 101 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 102 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 103 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 104 * Set comp, which is a comparator function used for sorting and | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 105 * inserting comments into the list. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 106 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 107 function setComparator() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 108 // If the first three letters are "asc", sort in ascending order | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 109 // and remove the prefix. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 110 if (by.substring(0,3) == 'asc') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 111 var i = by.substring(3); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 112 comp = function(a, b) { return a[i] - b[i]; }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 113 } else { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 114 // Otherwise sort in descending order. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 115 comp = function(a, b) { return b[by] - a[by]; }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 116 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 117 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 118 // Reset link styles and format the selected sort option. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 119 $('a.sel').attr('href', '#').removeClass('sel'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 120 $('a.by' + by).removeAttr('href').addClass('sel'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 121 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 122 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 123 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 124 * Create a comp function. If the user has preferences stored in | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 125 * the sortBy cookie, use those, otherwise use the default. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 126 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 127 function initComparator() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 128 by = 'rating'; // Default to sort by rating. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 129 // If the sortBy cookie is set, use that instead. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 130 if (document.cookie.length > 0) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 131 var start = document.cookie.indexOf('sortBy='); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 132 if (start != -1) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 133 start = start + 7; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 134 var end = document.cookie.indexOf(";", start); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 135 if (end == -1) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 136 end = document.cookie.length; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 137 by = unescape(document.cookie.substring(start, end)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 138 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 139 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 140 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 141 setComparator(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 142 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 143 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 144 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 145 * Show a comment div. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 146 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 147 function show(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 148 $('#ao' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 149 $('#ah' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 150 var context = $.extend({id: id}, opts); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 151 var popup = $(renderTemplate(popupTemplate, context)).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 152 popup.find('textarea[name="proposal"]').hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 153 popup.find('a.by' + by).addClass('sel'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 154 var form = popup.find('#cf' + id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 155 form.submit(function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 156 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 157 addComment(form); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 158 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 159 $('#s' + id).after(popup); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 160 popup.slideDown('fast', function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 161 getComments(id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 162 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 163 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 164 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 165 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 166 * Hide a comment div. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 167 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 168 function hide(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 169 $('#ah' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 170 $('#ao' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 171 var div = $('#sc' + id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 172 div.slideUp('fast', function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 173 div.remove(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 174 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 175 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 176 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 177 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 178 * Perform an ajax request to get comments for a node | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 179 * and insert the comments into the comments tree. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 180 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 181 function getComments(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 182 $.ajax({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 183 type: 'GET', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 184 url: opts.getCommentsURL, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 185 data: {node: id}, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 186 success: function(data, textStatus, request) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 187 var ul = $('#cl' + id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 188 var speed = 100; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 189 $('#cf' + id) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 190 .find('textarea[name="proposal"]') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 191 .data('source', data.source); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 192 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 193 if (data.comments.length === 0) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 194 ul.html('<li>No comments yet.</li>'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 195 ul.data('empty', true); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 196 } else { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 197 // If there are comments, sort them and put them in the list. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 198 var comments = sortComments(data.comments); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 199 speed = data.comments.length * 100; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 200 appendComments(comments, ul); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 201 ul.data('empty', false); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 202 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 203 $('#cn' + id).slideUp(speed + 200); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 204 ul.slideDown(speed); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 205 }, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 206 error: function(request, textStatus, error) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 207 showError('Oops, there was a problem retrieving the comments.'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 208 }, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 209 dataType: 'json' | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 210 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 211 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 212 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 213 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 214 * Add a comment via ajax and insert the comment into the comment tree. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 215 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 216 function addComment(form) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 217 var node_id = form.find('input[name="node"]').val(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 218 var parent_id = form.find('input[name="parent"]').val(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 219 var text = form.find('textarea[name="comment"]').val(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 220 var proposal = form.find('textarea[name="proposal"]').val(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 221 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 222 if (text == '') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 223 showError('Please enter a comment.'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 224 return; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 225 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 226 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 227 // Disable the form that is being submitted. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 228 form.find('textarea,input').attr('disabled', 'disabled'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 229 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 230 // Send the comment to the server. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 231 $.ajax({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 232 type: "POST", | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 233 url: opts.addCommentURL, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 234 dataType: 'json', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 235 data: { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 236 node: node_id, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 237 parent: parent_id, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 238 text: text, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 239 proposal: proposal | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 240 }, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 241 success: function(data, textStatus, error) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 242 // Reset the form. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 243 if (node_id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 244 hideProposeChange(node_id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 245 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 246 form.find('textarea') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 247 .val('') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 248 .add(form.find('input')) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 249 .removeAttr('disabled'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 250 var ul = $('#cl' + (node_id || parent_id)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 251 if (ul.data('empty')) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 252 $(ul).empty(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 253 ul.data('empty', false); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 254 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 255 insertComment(data.comment); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 256 var ao = $('#ao' + node_id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 257 ao.find('img').attr({'src': opts.commentBrightImage}); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 258 if (node_id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 259 // if this was a "root" comment, remove the commenting box | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 260 // (the user can get it back by reopening the comment popup) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 261 $('#ca' + node_id).slideUp(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 262 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 263 }, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 264 error: function(request, textStatus, error) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 265 form.find('textarea,input').removeAttr('disabled'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 266 showError('Oops, there was a problem adding the comment.'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 267 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 268 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 269 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 270 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 271 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 272 * Recursively append comments to the main comment list and children | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 273 * lists, creating the comment tree. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 274 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 275 function appendComments(comments, ul) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 276 $.each(comments, function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 277 var div = createCommentDiv(this); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 278 ul.append($(document.createElement('li')).html(div)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 279 appendComments(this.children, div.find('ul.comment-children')); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 280 // To avoid stagnating data, don't store the comments children in data. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 281 this.children = null; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 282 div.data('comment', this); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 283 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 284 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 285 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 286 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 287 * After adding a new comment, it must be inserted in the correct | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 288 * location in the comment tree. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 289 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 290 function insertComment(comment) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 291 var div = createCommentDiv(comment); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 292 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 293 // To avoid stagnating data, don't store the comments children in data. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 294 comment.children = null; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 295 div.data('comment', comment); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 296 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 297 var ul = $('#cl' + (comment.node || comment.parent)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 298 var siblings = getChildren(ul); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 299 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 300 var li = $(document.createElement('li')); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 301 li.hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 302 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 303 // Determine where in the parents children list to insert this comment. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 304 for(i=0; i < siblings.length; i++) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 305 if (comp(comment, siblings[i]) <= 0) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 306 $('#cd' + siblings[i].id) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 307 .parent() | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 308 .before(li.html(div)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 309 li.slideDown('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 310 return; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 311 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 312 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 313 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 314 // If we get here, this comment rates lower than all the others, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 315 // or it is the only comment in the list. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 316 ul.append(li.html(div)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 317 li.slideDown('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 318 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 319 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 320 function acceptComment(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 321 $.ajax({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 322 type: 'POST', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 323 url: opts.acceptCommentURL, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 324 data: {id: id}, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 325 success: function(data, textStatus, request) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 326 $('#cm' + id).fadeOut('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 327 $('#cd' + id).removeClass('moderate'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 328 }, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 329 error: function(request, textStatus, error) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 330 showError('Oops, there was a problem accepting the comment.'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 331 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 332 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 333 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 334 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 335 function deleteComment(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 336 $.ajax({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 337 type: 'POST', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 338 url: opts.deleteCommentURL, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 339 data: {id: id}, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 340 success: function(data, textStatus, request) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 341 var div = $('#cd' + id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 342 if (data == 'delete') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 343 // Moderator mode: remove the comment and all children immediately | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 344 div.slideUp('fast', function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 345 div.remove(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 346 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 347 return; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 348 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 349 // User mode: only mark the comment as deleted | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 350 div | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 351 .find('span.user-id:first') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 352 .text('[deleted]').end() | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 353 .find('div.comment-text:first') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 354 .text('[deleted]').end() | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 355 .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id + | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 356 ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 357 .remove(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 358 var comment = div.data('comment'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 359 comment.username = '[deleted]'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 360 comment.text = '[deleted]'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 361 div.data('comment', comment); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 362 }, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 363 error: function(request, textStatus, error) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 364 showError('Oops, there was a problem deleting the comment.'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 365 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 366 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 367 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 368 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 369 function showProposal(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 370 $('#sp' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 371 $('#hp' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 372 $('#pr' + id).slideDown('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 373 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 374 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 375 function hideProposal(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 376 $('#hp' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 377 $('#sp' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 378 $('#pr' + id).slideUp('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 379 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 380 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 381 function showProposeChange(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 382 $('#pc' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 383 $('#hc' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 384 var textarea = $('#pt' + id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 385 textarea.val(textarea.data('source')); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 386 $.fn.autogrow.resize(textarea[0]); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 387 textarea.slideDown('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 388 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 389 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 390 function hideProposeChange(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 391 $('#hc' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 392 $('#pc' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 393 var textarea = $('#pt' + id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 394 textarea.val('').removeAttr('disabled'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 395 textarea.slideUp('fast'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 396 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 397 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 398 function toggleCommentMarkupBox(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 399 $('#mb' + id).toggle(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 400 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 401 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 402 /** Handle when the user clicks on a sort by link. */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 403 function handleReSort(link) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 404 var classes = link.attr('class').split(/\s+/); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 405 for (var i=0; i<classes.length; i++) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 406 if (classes[i] != 'sort-option') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 407 by = classes[i].substring(2); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 408 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 409 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 410 setComparator(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 411 // Save/update the sortBy cookie. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 412 var expiration = new Date(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 413 expiration.setDate(expiration.getDate() + 365); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 414 document.cookie= 'sortBy=' + escape(by) + | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 415 ';expires=' + expiration.toUTCString(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 416 $('ul.comment-ul').each(function(index, ul) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 417 var comments = getChildren($(ul), true); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 418 comments = sortComments(comments); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 419 appendComments(comments, $(ul).empty()); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 420 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 421 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 422 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 423 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 424 * Function to process a vote when a user clicks an arrow. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 425 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 426 function handleVote(link) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 427 if (!opts.voting) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 428 showError("You'll need to login to vote."); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 429 return; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 430 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 431 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 432 var id = link.attr('id'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 433 if (!id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 434 // Didn't click on one of the voting arrows. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 435 return; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 436 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 437 // If it is an unvote, the new vote value is 0, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 438 // Otherwise it's 1 for an upvote, or -1 for a downvote. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 439 var value = 0; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 440 if (id.charAt(1) != 'u') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 441 value = id.charAt(0) == 'u' ? 1 : -1; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 442 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 443 // The data to be sent to the server. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 444 var d = { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 445 comment_id: id.substring(2), | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 446 value: value | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 447 }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 448 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 449 // Swap the vote and unvote links. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 450 link.hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 451 $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 452 .show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 453 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 454 // The div the comment is displayed in. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 455 var div = $('div#cd' + d.comment_id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 456 var data = div.data('comment'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 457 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 458 // If this is not an unvote, and the other vote arrow has | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 459 // already been pressed, unpress it. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 460 if ((d.value !== 0) && (data.vote === d.value * -1)) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 461 $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 462 $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 463 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 464 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 465 // Update the comments rating in the local data. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 466 data.rating += (data.vote === 0) ? d.value : (d.value - data.vote); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 467 data.vote = d.value; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 468 div.data('comment', data); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 469 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 470 // Change the rating text. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 471 div.find('.rating:first') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 472 .text(data.rating + ' point' + (data.rating == 1 ? '' : 's')); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 473 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 474 // Send the vote information to the server. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 475 $.ajax({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 476 type: "POST", | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 477 url: opts.processVoteURL, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 478 data: d, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 479 error: function(request, textStatus, error) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 480 showError('Oops, there was a problem casting that vote.'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 481 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 482 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 483 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 484 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 485 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 486 * Open a reply form used to reply to an existing comment. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 487 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 488 function openReply(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 489 // Swap out the reply link for the hide link | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 490 $('#rl' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 491 $('#cr' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 492 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 493 // Add the reply li to the children ul. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 494 var div = $(renderTemplate(replyTemplate, {id: id})).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 495 $('#cl' + id) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 496 .prepend(div) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 497 // Setup the submit handler for the reply form. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 498 .find('#rf' + id) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 499 .submit(function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 500 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 501 addComment($('#rf' + id)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 502 closeReply(id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 503 }) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 504 .find('input[type=button]') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 505 .click(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 506 closeReply(id); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 507 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 508 div.slideDown('fast', function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 509 $('#rf' + id).find('textarea').focus(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 510 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 511 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 512 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 513 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 514 * Close the reply form opened with openReply. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 515 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 516 function closeReply(id) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 517 // Remove the reply div from the DOM. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 518 $('#rd' + id).slideUp('fast', function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 519 $(this).remove(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 520 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 521 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 522 // Swap out the hide link for the reply link | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 523 $('#cr' + id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 524 $('#rl' + id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 525 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 526 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 527 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 528 * Recursively sort a tree of comments using the comp comparator. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 529 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 530 function sortComments(comments) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 531 comments.sort(comp); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 532 $.each(comments, function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 533 this.children = sortComments(this.children); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 534 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 535 return comments; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 536 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 537 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 538 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 539 * Get the children comments from a ul. If recursive is true, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 540 * recursively include childrens' children. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 541 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 542 function getChildren(ul, recursive) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 543 var children = []; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 544 ul.children().children("[id^='cd']") | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 545 .each(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 546 var comment = $(this).data('comment'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 547 if (recursive) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 548 comment.children = getChildren($(this).find('#cl' + comment.id), true); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 549 children.push(comment); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 550 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 551 return children; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 552 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 553 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 554 /** Create a div to display a comment in. */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 555 function createCommentDiv(comment) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 556 if (!comment.displayed && !opts.moderator) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 557 return $('<div class="moderate">Thank you! Your comment will show up ' | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 558 + 'once it is has been approved by a moderator.</div>'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 559 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 560 // Prettify the comment rating. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 561 comment.pretty_rating = comment.rating + ' point' + | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 562 (comment.rating == 1 ? '' : 's'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 563 // Make a class (for displaying not yet moderated comments differently) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 564 comment.css_class = comment.displayed ? '' : ' moderate'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 565 // Create a div for this comment. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 566 var context = $.extend({}, opts, comment); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 567 var div = $(renderTemplate(commentTemplate, context)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 568 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 569 // If the user has voted on this comment, highlight the correct arrow. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 570 if (comment.vote) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 571 var direction = (comment.vote == 1) ? 'u' : 'd'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 572 div.find('#' + direction + 'v' + comment.id).hide(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 573 div.find('#' + direction + 'u' + comment.id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 574 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 575 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 576 if (opts.moderator || comment.text != '[deleted]') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 577 div.find('a.reply').show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 578 if (comment.proposal_diff) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 579 div.find('#sp' + comment.id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 580 if (opts.moderator && !comment.displayed) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 581 div.find('#cm' + comment.id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 582 if (opts.moderator || (opts.username == comment.username)) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 583 div.find('#dc' + comment.id).show(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 584 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 585 return div; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 586 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 587 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 588 /** | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 589 * A simple template renderer. Placeholders such as <%id%> are replaced | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 590 * by context['id'] with items being escaped. Placeholders such as <#id#> | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 591 * are not escaped. | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 592 */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 593 function renderTemplate(template, context) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 594 var esc = $(document.createElement('div')); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 595 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 596 function handle(ph, escape) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 597 var cur = context; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 598 $.each(ph.split('.'), function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 599 cur = cur[this]; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 600 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 601 return escape ? esc.text(cur || "").html() : cur; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 602 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 603 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 604 return template.replace(/<([%#])([\w\.]*)\1>/g, function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 605 return handle(arguments[2], arguments[1] == '%' ? true : false); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 606 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 607 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 608 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 609 /** Flash an error message briefly. */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 610 function showError(message) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 611 $(document.createElement('div')).attr({'class': 'popup-error'}) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 612 .append($(document.createElement('div')) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 613 .attr({'class': 'error-message'}).text(message)) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 614 .appendTo('body') | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 615 .fadeIn("slow") | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 616 .delay(2000) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 617 .fadeOut("slow"); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 618 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 619 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 620 /** Add a link the user uses to open the comments popup. */ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 621 $.fn.comment = function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 622 return this.each(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 623 var id = $(this).attr('id').substring(1); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 624 var count = COMMENT_METADATA[id]; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 625 var title = count + ' comment' + (count == 1 ? '' : 's'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 626 var image = count > 0 ? opts.commentBrightImage : opts.commentImage; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 627 var addcls = count == 0 ? ' nocomment' : ''; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 628 $(this) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 629 .append( | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 630 $(document.createElement('a')).attr({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 631 href: '#', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 632 'class': 'sphinx-comment-open' + addcls, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 633 id: 'ao' + id | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 634 }) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 635 .append($(document.createElement('img')).attr({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 636 src: image, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 637 alt: 'comment', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 638 title: title | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 639 })) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 640 .click(function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 641 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 642 show($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 643 }) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 644 ) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 645 .append( | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 646 $(document.createElement('a')).attr({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 647 href: '#', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 648 'class': 'sphinx-comment-close hidden', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 649 id: 'ah' + id | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 650 }) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 651 .append($(document.createElement('img')).attr({ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 652 src: opts.closeCommentImage, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 653 alt: 'close', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 654 title: 'close' | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 655 })) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 656 .click(function(event) { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 657 event.preventDefault(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 658 hide($(this).attr('id').substring(2)); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 659 }) | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 660 ); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 661 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 662 }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 663 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 664 var opts = { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 665 processVoteURL: '/_process_vote', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 666 addCommentURL: '/_add_comment', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 667 getCommentsURL: '/_get_comments', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 668 acceptCommentURL: '/_accept_comment', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 669 deleteCommentURL: '/_delete_comment', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 670 commentImage: '/static/_static/comment.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 671 closeCommentImage: '/static/_static/comment-close.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 672 loadingImage: '/static/_static/ajax-loader.gif', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 673 commentBrightImage: '/static/_static/comment-bright.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 674 upArrow: '/static/_static/up.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 675 downArrow: '/static/_static/down.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 676 upArrowPressed: '/static/_static/up-pressed.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 677 downArrowPressed: '/static/_static/down-pressed.png', | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 678 voting: false, | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 679 moderator: false | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 680 }; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 681 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 682 if (typeof COMMENT_OPTIONS != "undefined") { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 683 opts = jQuery.extend(opts, COMMENT_OPTIONS); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 684 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 685 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 686 var popupTemplate = '\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 687 <div class="sphinx-comments" id="sc<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 688 <p class="sort-options">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 689 Sort by:\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 690 <a href="#" class="sort-option byrating">best rated</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 691 <a href="#" class="sort-option byascage">newest</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 692 <a href="#" class="sort-option byage">oldest</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 693 </p>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 694 <div class="comment-header">Comments</div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 695 <div class="comment-loading" id="cn<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 696 loading comments... <img src="<%loadingImage%>" alt="" /></div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 697 <ul id="cl<%id%>" class="comment-ul"></ul>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 698 <div id="ca<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 699 <p class="add-a-comment">Add a comment\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 700 (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 701 <div class="comment-markup-box" id="mb<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 702 reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 703 <code>``code``</code>, \ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 704 code blocks: <code>::</code> and an indented block after blank line</div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 705 <form method="post" id="cf<%id%>" class="comment-form" action="">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 706 <textarea name="comment" cols="80"></textarea>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 707 <p class="propose-button">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 708 <a href="#" id="pc<%id%>" class="show-propose-change">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 709 Propose a change ▹\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 710 </a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 711 <a href="#" id="hc<%id%>" class="hide-propose-change">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 712 Propose a change ▿\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 713 </a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 714 </p>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 715 <textarea name="proposal" id="pt<%id%>" cols="80"\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 716 spellcheck="false"></textarea>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 717 <input type="submit" value="Add comment" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 718 <input type="hidden" name="node" value="<%id%>" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 719 <input type="hidden" name="parent" value="" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 720 </form>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 721 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 722 </div>'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 723 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 724 var commentTemplate = '\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 725 <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 726 <div class="vote">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 727 <div class="arrow">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 728 <a href="#" id="uv<%id%>" class="vote" title="vote up">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 729 <img src="<%upArrow%>" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 730 </a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 731 <a href="#" id="uu<%id%>" class="un vote" title="vote up">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 732 <img src="<%upArrowPressed%>" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 733 </a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 734 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 735 <div class="arrow">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 736 <a href="#" id="dv<%id%>" class="vote" title="vote down">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 737 <img src="<%downArrow%>" id="da<%id%>" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 738 </a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 739 <a href="#" id="du<%id%>" class="un vote" title="vote down">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 740 <img src="<%downArrowPressed%>" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 741 </a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 742 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 743 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 744 <div class="comment-content">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 745 <p class="tagline comment">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 746 <span class="user-id"><%username%></span>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 747 <span class="rating"><%pretty_rating%></span>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 748 <span class="delta"><%time.delta%></span>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 749 </p>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 750 <div class="comment-text comment"><#text#></div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 751 <p class="comment-opts comment">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 752 <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 753 <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 754 <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 755 <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 756 <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 757 <span id="cm<%id%>" class="moderation hidden">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 758 <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 759 </span>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 760 </p>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 761 <pre class="proposal" id="pr<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 762 <#proposal_diff#>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 763 </pre>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 764 <ul class="comment-children" id="cl<%id%>"></ul>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 765 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 766 <div class="clearleft"></div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 767 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 768 </div>'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 769 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 770 var replyTemplate = '\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 771 <li>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 772 <div class="reply-div" id="rd<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 773 <form id="rf<%id%>">\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 774 <textarea name="comment" cols="80"></textarea>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 775 <input type="submit" value="Add reply" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 776 <input type="button" value="Cancel" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 777 <input type="hidden" name="parent" value="<%id%>" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 778 <input type="hidden" name="node" value="" />\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 779 </form>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 780 </div>\ | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 781 </li>'; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 782 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 783 $(document).ready(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 784 init(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 785 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 786 })(jQuery); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 787 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 788 $(document).ready(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 789 // add comment anchors for all paragraphs that are commentable | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 790 $('.sphinx-has-comment').comment(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 791 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 792 // highlight search words in search results | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 793 $("div.context").each(function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 794 var params = $.getQueryParameters(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 795 var terms = (params.q) ? params.q[0].split(/\s+/) : []; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 796 var result = $(this); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 797 $.each(terms, function() { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 798 result.highlightText(this.toLowerCase(), 'highlighted'); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 799 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 800 }); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 801 | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 802 // directly open comment window if requested | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 803 var anchor = document.location.hash; | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 804 if (anchor.substring(0, 9) == '#comment-') { | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 805 $('#ao' + anchor.substring(9)).click(); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 806 document.location.hash = '#s' + anchor.substring(9); | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 807 } | 
| 
4ced8f116509
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 23b12dd763c0235674988ebdf6a258afd1ad629a-dirty
 yating-l parents: diff
changeset | 808 }); | 
