diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-01-22 20:54:17 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-01-22 20:54:17 +0100 |
commit | 96fcb60c335a8985d0ebb8acec3af7c310edb70c (patch) | |
tree | cf1e1ccb801842cf4acc51c353bb481ede37d364 /src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js | |
parent | 124f8091cbb1e5cccd7972fa368f8e7c434e0e5b (diff) | |
parent | 30d81a47c689e1d7d963fcd3fd42af9958805e31 (diff) | |
download | wallabag-96fcb60c335a8985d0ebb8acec3af7c310edb70c.tar.gz wallabag-96fcb60c335a8985d0ebb8acec3af7c310edb70c.tar.zst wallabag-96fcb60c335a8985d0ebb8acec3af7c310edb70c.zip |
Merge pull request #1619 from wallabag/v2-themes-folder
Move public assets for themes
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js')
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js new file mode 100644 index 00000000..b933acd1 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js | |||
@@ -0,0 +1,83 @@ | |||
1 | $(document).ready(function() { | ||
2 | |||
3 | $("#search-form").hide(); | ||
4 | $("#bagit-form").hide(); | ||
5 | $("#filter-form").hide(); | ||
6 | |||
7 | //--------------------------------------------------------------------------- | ||
8 | // Toggle the "Search" popup in the sidebar | ||
9 | //--------------------------------------------------------------------------- | ||
10 | function toggleSearch() { | ||
11 | $("#search-form").toggle(); | ||
12 | $("#search").toggleClass("current"); | ||
13 | $("#search").toggleClass("active-current"); | ||
14 | $("#search-arrow").toggleClass("arrow-down"); | ||
15 | if ($("#search").hasClass("current")) { | ||
16 | $("#content").addClass("opacity03"); | ||
17 | } else { | ||
18 | $("#content").removeClass("opacity03"); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | //--------------------------------------------------------------------------- | ||
23 | // Toggle the "Filter" popup on entries list | ||
24 | //--------------------------------------------------------------------------- | ||
25 | function toggleFilter() { | ||
26 | $("#filter-form").toggle(); | ||
27 | } | ||
28 | |||
29 | //--------------------------------------------------------------------------- | ||
30 | // Toggle the "Save a Link" popup in the sidebar | ||
31 | //--------------------------------------------------------------------------- | ||
32 | function toggleBagit() { | ||
33 | $("#bagit-form").toggle(); | ||
34 | $("#bagit").toggleClass("current"); | ||
35 | $("#bagit").toggleClass("active-current"); | ||
36 | $("#bagit-arrow").toggleClass("arrow-down"); | ||
37 | if ($("#bagit").hasClass("current")) { | ||
38 | $("#content").addClass("opacity03"); | ||
39 | } else { | ||
40 | $("#content").removeClass("opacity03"); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | //--------------------------------------------------------------------------- | ||
45 | // Close all #links popups in the sidebar | ||
46 | //--------------------------------------------------------------------------- | ||
47 | function closePopups() { | ||
48 | $("#links .messages").hide(); | ||
49 | $("#links > li > a").removeClass("active-current"); | ||
50 | $("#links > li > a").removeClass("current"); | ||
51 | $("[id$=-arrow]").removeClass("arrow-down"); | ||
52 | $("#content").removeClass("opacity03"); | ||
53 | } | ||
54 | |||
55 | $("#search").click(function(){ | ||
56 | closePopups(); | ||
57 | toggleSearch(); | ||
58 | $("#searchfield").focus(); | ||
59 | }); | ||
60 | |||
61 | $("#filter").click(function(){ | ||
62 | closePopups(); | ||
63 | toggleFilter(); | ||
64 | }); | ||
65 | |||
66 | $("#bagit").click(function(){ | ||
67 | closePopups(); | ||
68 | toggleBagit(); | ||
69 | $("#plainurl").focus(); | ||
70 | }); | ||
71 | |||
72 | $("#search-form-close").click(function(){ | ||
73 | toggleSearch(); | ||
74 | }); | ||
75 | |||
76 | $("#filter-form-close").click(function(){ | ||
77 | toggleFilter(); | ||
78 | }); | ||
79 | |||
80 | $("#bagit-form-close").click(function(){ | ||
81 | toggleBagit(); | ||
82 | }); | ||
83 | }); | ||