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