aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes/default/js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/js')
-rw-r--r--themes/default/js/popupForm.js61
-rwxr-xr-xthemes/default/js/saveLink.js34
2 files changed, 77 insertions, 18 deletions
diff --git a/themes/default/js/popupForm.js b/themes/default/js/popupForm.js
index a32e6e70..d233e600 100644
--- a/themes/default/js/popupForm.js
+++ b/themes/default/js/popupForm.js
@@ -1,21 +1,72 @@
1$(document).ready(function() { 1$(document).ready(function() {
2 2
3 $("#search-form").hide(); 3 $("#search-form").hide();
4 $("#bagit-form").hide();
4 5
5 function closeSearch() { 6 //---------------------------------------------------------------------------
7 // Toggle the "Search" popup in the sidebar
8 //---------------------------------------------------------------------------
9 function toggleSearch() {
6 $("#search-form").toggle(); 10 $("#search-form").toggle();
7 $("#search").toggleClass("current"); 11 $("#search").toggleClass("current");
12 $("#search").toggleClass("active-current");
8 $("#search-arrow").toggleClass("arrow-down"); 13 $("#search-arrow").toggleClass("arrow-down");
14 if ($("#search").hasClass("current")) {
15 $("#content").addClass("opacity03");
16 } else {
17 $("#content").removeClass("opacity03");
18 }
19 }
20
21 //---------------------------------------------------------------------------
22 // Toggle the "Save a Link" popup in the sidebar
23 //---------------------------------------------------------------------------
24 function toggleBagit() {
25 $("#bagit-form").toggle();
26 $("#bagit").toggleClass("current");
27 $("#bagit").toggleClass("active-current");
28 $("#bagit-arrow").toggleClass("arrow-down");
29 if ($("#bagit").hasClass("current")) {
30 $("#content").addClass("opacity03");
31 } else {
32 $("#content").removeClass("opacity03");
33 }
34 }
35
36 //---------------------------------------------------------------------------
37 // Close all #links popups in the sidebar
38 //---------------------------------------------------------------------------
39 function closePopups() {
40 $("#links .messages").hide();
41 $("#links > li > a").removeClass("active-current");
42 $("#links > li > a").removeClass("current");
43 $("[id$=-arrow]").removeClass("arrow-down");
44 $("#content").removeClass("opacity03");
9 } 45 }
10 46
11 $("#search").click(function(){ 47 $("#search").click(function(){
12 closeSearch(); 48 closePopups();
13 $('#searchfield').focus(); 49 toggleSearch();
50 $("#searchfield").focus();
51 });
52
53 $("#bagit").click(function(){
54 closePopups();
55 toggleBagit();
56 $("#plainurl").focus();
14 }); 57 });
15 58
16 $("#search-form-close").click(function(){ 59 $("#search-form-close").click(function(){
17 closeSearch(); 60 toggleSearch();
61 });
62
63 $("#bagit-form-close").click(function(){
64 toggleBagit();
18 }); 65 });
19 66
67 // $("#").click(function(){
68 // toggleSearch();
69 // });
70
20 71
21}); \ No newline at end of file 72});
diff --git a/themes/default/js/saveLink.js b/themes/default/js/saveLink.js
index 6dbce97e..a7acd84c 100755
--- a/themes/default/js/saveLink.js
+++ b/themes/default/js/saveLink.js
@@ -13,7 +13,7 @@ $.fn.ready(function() {
13 13
14 $bagit.toggleClass("active-current"); 14 $bagit.toggleClass("active-current");
15 15
16 //only if bagiti link is not presented on page 16 //only if bag-it link is not presented on page
17 if ( $bagit.length === 0 ) { 17 if ( $bagit.length === 0 ) {
18 if ( event !== 'undefined' && event ) { 18 if ( event !== 'undefined' && event ) {
19 $bagitForm.css( {position:"absolute", top:event.pageY, left:event.pageX-200}); 19 $bagitForm.css( {position:"absolute", top:event.pageY, left:event.pageX-200});
@@ -23,6 +23,11 @@ $.fn.ready(function() {
23 } 23 }
24 } 24 }
25 25
26 if ($("#search-form").length != 0) {
27 $("#search").removeClass("current");
28 $("#search-arrow").removeClass("arrow-down");
29 $("#search-form").hide();
30 }
26 $bagitForm.toggle(); 31 $bagitForm.toggle();
27 $('#content').toggleClass("opacity03"); 32 $('#content').toggleClass("opacity03");
28 if (url !== 'undefined' && url) { 33 if (url !== 'undefined' && url) {
@@ -31,18 +36,21 @@ $.fn.ready(function() {
31 $('#plainurl').focus(); 36 $('#plainurl').focus();
32 } 37 }
33 38
34 39 //---------------------------------------------------------------------------
35 $bagit.click(function(){ 40 // These two functions are now taken care of in popupForm.js
36 $bagit.toggleClass("current"); 41 //---------------------------------------------------------------------------
37 $("#bagit-arrow").toggleClass("arrow-down"); 42
38 toggleSaveLinkForm(); 43 // $bagit.click(function(){
39 }); 44 // $bagit.toggleClass("current");
40 45 // $("#bagit-arrow").toggleClass("arrow-down");
41 $("#bagit-form-close").click(function(){ 46 // toggleSaveLinkForm();
42 $bagit.removeClass("current"); 47 // });
43 $("#bagit-arrow").removeClass("arrow-down"); 48
44 toggleSaveLinkForm(); 49 // $("#bagit-form-close").click(function(){
45 }); 50 // $bagit.removeClass("current");
51 // $("#bagit-arrow").removeClass("arrow-down");
52 // toggleSaveLinkForm();
53 // });
46 54
47 55
48 //send "bag it link" form request via ajax 56 //send "bag it link" form request via ajax