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