3 ******* JQuery for the MySlice [Local] account buttons *********************
6 Mohammed Yasin Rahman <mohammed-yasin.rahman@lip6.fr>
7 Copyright 2013, UPMC Sorbonne Universités / LIP6
11 jQuery(document).ready(function(){
12 // jquery functionalities of different buttons [Edit, Cancel, Upload]
14 jQuery("#edit_name").click(function(){
16 jQuery("#span_name").show();
17 jQuery("#nameval").hide();
18 jQuery("#edit_name").hide();
19 // enforcing when one edit is clicked the rest will not work at same time
20 jQuery("#span_pass").hide();
21 jQuery("#edit_pass").show();
22 jQuery("#passval").show();
23 jQuery("#span_aff").hide();
24 jQuery("#edit_aff").show();
25 jQuery("#affval").show();
26 jQuery("#span_email").hide();
27 jQuery("#edit_email").show();
28 jQuery("#emailval").show();
29 jQuery("#span_upload").hide();
30 jQuery("#keyval").show();
31 jQuery("#dl_file").show();
32 jQuery("#upload_file").show();
34 jQuery("#cancel_name_change").click(function(){
36 jQuery("#span_name").hide();
37 jQuery("#nameval").show();
38 jQuery("#edit_name").show();
43 jQuery("#edit_pass").click(function(){
45 jQuery("#span_pass").show();
46 jQuery("#passval").hide();
47 jQuery("#edit_pass").hide();
48 // enforcing when one edit is clicked the rest will not work at same time
49 jQuery("#span_name").hide();
50 jQuery("#edit_name").show();
51 jQuery("#nameval").show();
52 jQuery("#span_aff").hide();
53 jQuery("#edit_aff").show();
54 jQuery("#affval").show();
55 jQuery("#span_email").hide();
56 jQuery("#edit_email").show();
57 jQuery("#emailval").show();
58 jQuery("#span_upload").hide();
59 jQuery("#keyval").show();
60 jQuery("#dl_file").show();
61 jQuery("#upload_file").show();
63 jQuery("#cancel_pass_change").click(function(){
65 jQuery("#span_pass").hide();
66 jQuery("#passval").show();
67 jQuery("#edit_pass").show();
69 // both password should be same
70 jQuery("#editForm").validate({
76 required: true, equalTo: "#password"
81 jQuery("#edit_aff").click(function(){
83 jQuery("#span_aff").show();
84 jQuery("#affval").hide();
85 jQuery("#edit_aff").hide();
86 // enforcing when one edit is clicked the rest will not work at same time
87 jQuery("#span_pass").hide();
88 jQuery("#edit_pass").show();
89 jQuery("#passval").show();
90 jQuery("#span_name").hide();
91 jQuery("#edit_name").show();
92 jQuery("#nameval").show();
93 jQuery("#span_email").hide();
94 jQuery("#edit_email").show();
95 jQuery("#emailval").show();
96 jQuery("#span_upload").hide();
97 jQuery("#keyval").show();
98 jQuery("#dl_file").show();
99 jQuery("#upload_file").show();
101 jQuery("#cancel_aff_change").click(function(){
103 jQuery("#span_aff").hide();
104 jQuery("#affval").show();
105 jQuery("#edit_aff").show();
108 /* edit email will be done by PI if needed
109 jQuery("#edit_email").click(function(){
111 jQuery("#span_email").show();
112 jQuery("#emailval").hide();
113 jQuery("#edit_email").hide();
114 // enforcing when one edit is clicked the rest will not work at same time
115 jQuery("#span_pass").hide();
116 jQuery("#edit_pass").show();
117 jQuery("#passval").show();
118 jQuery("#span_aff").hide();
119 jQuery("#edit_aff").show();
120 jQuery("#affval").show();
121 jQuery("#span_name").hide();
122 jQuery("#edit_name").show();
123 jQuery("#nameval").show();
124 jQuery("#span_upload").hide();
125 jQuery("#keyval").show();
126 jQuery("#dl_file").show();
127 jQuery("#upload_file").show();
129 jQuery("#cancel_email_change").click(function(){
131 jQuery("#span_email").hide();
132 jQuery("#emailval").show();
133 jQuery("#edit_email").show();
136 jQuery("#upload_file").click(function(){
138 jQuery("#span_upload").show();
139 jQuery("#dl_file").hide();
140 jQuery("#upload_file").hide();
141 jQuery("#keyval").hide();
142 // enforcing when one edit is clicked the rest will not work at same time
143 jQuery("#span_name").hide();
144 jQuery("#edit_name").show();
145 jQuery("#nameval").show();
146 jQuery("#span_pass").hide();
147 jQuery("#edit_pass").show();
148 jQuery("#passval").show();
149 jQuery("#span_aff").hide();
150 jQuery("#edit_aff").show();
151 jQuery("#affval").show();
152 jQuery("#span_email").hide();
153 jQuery("#edit_email").show();
154 jQuery("#emailval").show();
156 jQuery("#cancel_upload").click(function(){
158 jQuery("#span_upload").hide();
159 jQuery("#keyval").show();
160 jQuery("#dl_file").show();
161 jQuery("#upload_file").show();
165 // alert box for the "Generate new Key Pair button"
166 function myFunction()
168 alert("You have requested to generate new key pairs. Please download and save the new keypairs after receiving the success message.");
171 function emailAlert()
173 alert("To edit email please contact the administratior. You will be redirected to the support page now");
174 window.location.href = "/portal/contact/";
179 alert("To edit affiliation please contact the administratior. You will be redirected to the support page now");
180 window.location.href = "/portal/contact/";
183 // alert having ok or cancel option
184 function show_confirm()
186 var r=confirm("Press a button!");
189 alert("You pressed OK!");
193 alert("You pressed Cancel!");