root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / sshkeys-wizard.js @ 1eb800de
History | View | Annotate | Download (1.5 kB)
1 | 57224c60 | Athina Bekakou | var wizard = $('#sshkeys-wizard'); |
---|---|---|---|
2 | e3de445d | Athina Bekakou | $(document).ready(function(){ |
3 | aafd8478 | Athina Bekakou | generateArea = wizard.find('.generate-key-area');
|
4 | aafd8478 | Athina Bekakou | generateBtn = wizard.find('.generate-key-btn');
|
5 | aafd8478 | Athina Bekakou | importArea = wizard.find('.import-key-area');
|
6 | aafd8478 | Athina Bekakou | importBtn = wizard.find('.import-key-btn');
|
7 | aafd8478 | Athina Bekakou | editBtn = wizard.find('.edit');
|
8 | aafd8478 | Athina Bekakou | importCloseBtn = importArea.find('.buttons a');
|
9 | aafd8478 | Athina Bekakou | generateCloseBtn = generateArea.find('.buttons a');
|
10 | aafd8478 | Athina Bekakou | |
11 | e3de445d | Athina Bekakou | generateBtn.click(function(e) {
|
12 | e3de445d | Athina Bekakou | e.preventDefault(); |
13 | aafd8478 | Athina Bekakou | if(!generateArea.is(':visible')) { |
14 | aafd8478 | Athina Bekakou | // set the right color to the buttons
|
15 | aafd8478 | Athina Bekakou | $(this).addClass('current'); |
16 | aafd8478 | Athina Bekakou | $(this).siblings('a').removeClass('current'); |
17 | aafd8478 | Athina Bekakou | |
18 | aafd8478 | Athina Bekakou | if(importArea.is(':visible')) { |
19 | aafd8478 | Athina Bekakou | importArea.stop().fadeOut(200, function() { |
20 | aafd8478 | Athina Bekakou | generateArea.stop().slideDown(); |
21 | aafd8478 | Athina Bekakou | }); |
22 | aafd8478 | Athina Bekakou | } |
23 | aafd8478 | Athina Bekakou | else {
|
24 | aafd8478 | Athina Bekakou | generateArea.stop().slideDown(); |
25 | aafd8478 | Athina Bekakou | } |
26 | e3de445d | Athina Bekakou | } |
27 | e3de445d | Athina Bekakou | }); |
28 | aafd8478 | Athina Bekakou | |
29 | e3de445d | Athina Bekakou | importBtn.click(function(e) {
|
30 | e3de445d | Athina Bekakou | e.preventDefault(); |
31 | aafd8478 | Athina Bekakou | if(!importArea.is(':visible')) { |
32 | aafd8478 | Athina Bekakou | // set the right color to the buttons
|
33 | aafd8478 | Athina Bekakou | $(this).addClass('current'); |
34 | aafd8478 | Athina Bekakou | $(this).siblings('a').removeClass('current'); |
35 | e3de445d | Athina Bekakou | |
36 | aafd8478 | Athina Bekakou | if(generateArea.is(':visible')) { |
37 | aafd8478 | Athina Bekakou | generateArea.stop().fadeOut(200, function() { |
38 | aafd8478 | Athina Bekakou | importArea.stop().slideDown(); |
39 | aafd8478 | Athina Bekakou | }); |
40 | aafd8478 | Athina Bekakou | } |
41 | aafd8478 | Athina Bekakou | else {
|
42 | aafd8478 | Athina Bekakou | importArea.stop().slideDown(); |
43 | aafd8478 | Athina Bekakou | } |
44 | e3de445d | Athina Bekakou | } |
45 | aafd8478 | Athina Bekakou | }); |
46 | aafd8478 | Athina Bekakou | |
47 | aafd8478 | Athina Bekakou | importCloseBtn.click(function(e) {
|
48 | aafd8478 | Athina Bekakou | e.preventDefault(); |
49 | aafd8478 | Athina Bekakou | e.stopPropagation(); |
50 | aafd8478 | Athina Bekakou | importArea.slideUp(); |
51 | aafd8478 | Athina Bekakou | importBtn.removeClass('current');
|
52 | aafd8478 | Athina Bekakou | }); |
53 | aafd8478 | Athina Bekakou | |
54 | aafd8478 | Athina Bekakou | generateCloseBtn.click(function(e) {
|
55 | aafd8478 | Athina Bekakou | e.preventDefault(); |
56 | aafd8478 | Athina Bekakou | e.stopPropagation(); |
57 | aafd8478 | Athina Bekakou | generateArea.slideUp(); |
58 | aafd8478 | Athina Bekakou | generateBtn.removeClass('current');
|
59 | aafd8478 | Athina Bekakou | }); |
60 | e3de445d | Athina Bekakou | }) |