LOGIN / SIGN UP

public/javascripts/application.js
 
1 @@ -1,2 +1,61 @@
1 // Place your application-specific JavaScript functions and classes here
2 // This file is automatically included by javascript_include_tag :defaults
3 /**
4 * Function to toggle comments form adding comments to code commits.
5 */
6 function show_comment_form(form_id, path, line_no)
7 {
8 /* Get form */
9 line = document.getElementById(path + line_no);
10 form_div = document.getElementById(form_id);
11 form = document.getElementById(form_id + "_form");
12 if (! form_div) {
13 alert("form area with id " + form_id + " missing in document.");
14 return;
15 }
16
17 /* Move form into place. */
18 $(line).scrollTo();
19
20 /* Update form parameters. */
21 form.path.value = path;
22 form.line_no.value = line_no;
23
24 /* Show form. DISABLED FOR NOW */
25 form_div.style.display = "none";
26 }
27
28 function hide_comment_form(form_id)
29 {
30 /* Get form */
31 form_div = document.getElementById(form_id);
32 if (! form_div) {
33 alert("form area with id " + form_id + " missing in document.");
34 return;
35 }
36 form_div.style.display = "none";
37 }
38
39 /**
40 * Toggle multi-single select.
41 */
42 function toggle_multi_single(select_id, size)
43 {
44 select = document.getElementById(select_id);
45 if (select) {
46 select.multiple = ! select.multiple;
47 if (select.multiple) {
48 select.size = size;
49 select.remove(0);
50 select.name = select.name + '[]';
51 } else {
52 select.size = 1;
53 select.name = select.name.substring(0, select.name.length - 2);
54
55 var empty = document.createElement('option');
56 empty.text = '';
57 empty.value = '';
58
59 select.add(empty, select.options[0]);
60 }
61
62 }
63 }
...  

public/javascripts/septic.js
 
0 @@ -1,61 +0,0 @@
1 /**
2 * Function to toggle comments form adding comments to code commits.
3 */
4 function show_comment_form(form_id, path, line_no)
5 {
6 /* Get form */
7 line = document.getElementById(path + line_no);
8 form_div = document.getElementById(form_id);
9 form = document.getElementById(form_id + "_form");
10 if (! form_div) {
11 alert("form area with id " + form_id + " missing in document.");
12 return;
13 }
14
15 /* Move form into place. */
16 $(line).scrollTo();
17
18 /* Update form parameters. */
19 form.path.value = path;
20 form.line_no.value = line_no;
21
22 /* Show form. DISABLED FOR NOW */
23 form_div.style.display = "none";
24 }
25
26 function hide_comment_form(form_id)
27 {
28 /* Get form */
29 form_div = document.getElementById(form_id);
30 if (! form_div) {
31 alert("form area with id " + form_id + " missing in document.");
32 return;
33 }
34 form_div.style.display = "none";
35 }
36
37 /**
38 * Toggle multi-single select.
39 */
40 function toggle_multi_single(select_id, size)
41 {
42 select = document.getElementById(select_id);
43 if (select) {
44 select.multiple = ! select.multiple;
45 if (select.multiple) {
46 select.size = size;
47 select.remove(0);
48 select.name = select.name + '[]';
49 } else {
50 select.size = 1;
51 select.name = select.name.substring(0, select.name.length - 2);
52
53 var empty = document.createElement('option');
54 empty.text = '';
55 empty.value = '';
56
57 select.add(empty, select.options[0]);
58 }
59
60 }
61 }