From 30d81a47c689e1d7d963fcd3fd42af9958805e31 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 22 Jan 2016 13:45:10 +0100 Subject: Move public assets for themes So they can be installed using the `assets:install` command and there'll no longer symlink in the repo They moved from `web/themes/...` to `bundles/wallabagcore/themes/...` --- .../Resources/public/themes/baggy/js/popupForm.js | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js (limited to 'src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js') 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 @@ +$(document).ready(function() { + + $("#search-form").hide(); + $("#bagit-form").hide(); + $("#filter-form").hide(); + + //--------------------------------------------------------------------------- + // Toggle the "Search" popup in the sidebar + //--------------------------------------------------------------------------- + function toggleSearch() { + $("#search-form").toggle(); + $("#search").toggleClass("current"); + $("#search").toggleClass("active-current"); + $("#search-arrow").toggleClass("arrow-down"); + if ($("#search").hasClass("current")) { + $("#content").addClass("opacity03"); + } else { + $("#content").removeClass("opacity03"); + } + } + + //--------------------------------------------------------------------------- + // Toggle the "Filter" popup on entries list + //--------------------------------------------------------------------------- + function toggleFilter() { + $("#filter-form").toggle(); + } + + //--------------------------------------------------------------------------- + // Toggle the "Save a Link" popup in the sidebar + //--------------------------------------------------------------------------- + function toggleBagit() { + $("#bagit-form").toggle(); + $("#bagit").toggleClass("current"); + $("#bagit").toggleClass("active-current"); + $("#bagit-arrow").toggleClass("arrow-down"); + if ($("#bagit").hasClass("current")) { + $("#content").addClass("opacity03"); + } else { + $("#content").removeClass("opacity03"); + } + } + + //--------------------------------------------------------------------------- + // Close all #links popups in the sidebar + //--------------------------------------------------------------------------- + function closePopups() { + $("#links .messages").hide(); + $("#links > li > a").removeClass("active-current"); + $("#links > li > a").removeClass("current"); + $("[id$=-arrow]").removeClass("arrow-down"); + $("#content").removeClass("opacity03"); + } + + $("#search").click(function(){ + closePopups(); + toggleSearch(); + $("#searchfield").focus(); + }); + + $("#filter").click(function(){ + closePopups(); + toggleFilter(); + }); + + $("#bagit").click(function(){ + closePopups(); + toggleBagit(); + $("#plainurl").focus(); + }); + + $("#search-form-close").click(function(){ + toggleSearch(); + }); + + $("#filter-form-close").click(function(){ + toggleFilter(); + }); + + $("#bagit-form-close").click(function(){ + toggleBagit(); + }); +}); -- cgit v1.2.3