]>
Commit | Line | Data |
---|---|---|
19f2f11e NL |
1 | $(document).ready(function() { |
2 | ||
3 | $("#search-form").hide(); | |
4 | $("#bagit-form").hide(); | |
d2fcbf5d | 5 | $("#filter-form").hide(); |
5ecdfcd0 | 6 | $("#download-form").hide(); |
19f2f11e NL |
7 | |
8 | //--------------------------------------------------------------------------- | |
9 | // Toggle the "Search" popup in the sidebar | |
10 | //--------------------------------------------------------------------------- | |
11 | function toggleSearch() { | |
12 | $("#search-form").toggle(); | |
13 | $("#search").toggleClass("current"); | |
14 | $("#search").toggleClass("active-current"); | |
15 | $("#search-arrow").toggleClass("arrow-down"); | |
16 | if ($("#search").hasClass("current")) { | |
17 | $("#content").addClass("opacity03"); | |
18 | } else { | |
19 | $("#content").removeClass("opacity03"); | |
20 | } | |
21 | } | |
22 | ||
d2fcbf5d JB |
23 | //--------------------------------------------------------------------------- |
24 | // Toggle the "Filter" popup on entries list | |
25 | //--------------------------------------------------------------------------- | |
26 | function toggleFilter() { | |
27 | $("#filter-form").toggle(); | |
28 | } | |
29 | ||
5ecdfcd0 TC |
30 | //--------------------------------------------------------------------------- |
31 | // Toggle the "Download" popup on entries list | |
32 | //--------------------------------------------------------------------------- | |
33 | function toggleDownload() { | |
34 | $("#download-form").toggle(); | |
35 | } | |
36 | ||
19f2f11e NL |
37 | //--------------------------------------------------------------------------- |
38 | // Toggle the "Save a Link" popup in the sidebar | |
39 | //--------------------------------------------------------------------------- | |
40 | function toggleBagit() { | |
41 | $("#bagit-form").toggle(); | |
42 | $("#bagit").toggleClass("current"); | |
43 | $("#bagit").toggleClass("active-current"); | |
44 | $("#bagit-arrow").toggleClass("arrow-down"); | |
45 | if ($("#bagit").hasClass("current")) { | |
46 | $("#content").addClass("opacity03"); | |
47 | } else { | |
48 | $("#content").removeClass("opacity03"); | |
49 | } | |
50 | } | |
51 | ||
52 | //--------------------------------------------------------------------------- | |
53 | // Close all #links popups in the sidebar | |
54 | //--------------------------------------------------------------------------- | |
55 | function closePopups() { | |
56 | $("#links .messages").hide(); | |
57 | $("#links > li > a").removeClass("active-current"); | |
58 | $("#links > li > a").removeClass("current"); | |
59 | $("[id$=-arrow]").removeClass("arrow-down"); | |
60 | $("#content").removeClass("opacity03"); | |
61 | } | |
62 | ||
63 | $("#search").click(function(){ | |
64 | closePopups(); | |
65 | toggleSearch(); | |
66 | $("#searchfield").focus(); | |
67 | }); | |
68 | ||
5ecdfcd0 | 69 | $(".filter-btn").click(function(){ |
d2fcbf5d JB |
70 | closePopups(); |
71 | toggleFilter(); | |
72 | }); | |
73 | ||
5ecdfcd0 TC |
74 | $(".download-btn").click(function(){ |
75 | closePopups(); | |
76 | toggleDownload(); | |
77 | }); | |
78 | ||
19f2f11e NL |
79 | $("#bagit").click(function(){ |
80 | closePopups(); | |
81 | toggleBagit(); | |
82 | $("#plainurl").focus(); | |
83 | }); | |
84 | ||
85 | $("#search-form-close").click(function(){ | |
86 | toggleSearch(); | |
87 | }); | |
88 | ||
d2fcbf5d JB |
89 | $("#filter-form-close").click(function(){ |
90 | toggleFilter(); | |
91 | }); | |
92 | ||
5ecdfcd0 TC |
93 | $("#download-form-close").click(function(){ |
94 | toggleDownload(); | |
95 | }); | |
96 | ||
19f2f11e NL |
97 | $("#bagit-form-close").click(function(){ |
98 | toggleBagit(); | |
99 | }); | |
19f2f11e | 100 | }); |