@@ 18-85 (lines=68) @@ | ||
15 | $('select[name=individual_create]').altAutocomplete(); |
|
16 | }); |
|
17 | ||
18 | window.openTab = function (evt, tabName, screenshotsNr) { |
|
19 | // Declare all variables |
|
20 | var i, tabcontent, tablinks; |
|
21 | ||
22 | // Get all elements with class="tabcontent" and hide them |
|
23 | tabcontent = document.getElementsByClassName('tabcontent'); |
|
24 | for (i = 0; i < tabcontent.length; i++) { |
|
25 | tabcontent[i].style.display = 'none'; |
|
26 | } |
|
27 | ||
28 | // Get all elements with class="tablinks" and remove the class "active" |
|
29 | tablinks = document.getElementsByClassName('tablinks'); |
|
30 | for (i = 0; i < tablinks.length; i++) { |
|
31 | tablinks[i].className = tablinks[i].className.replace(' active', ''); |
|
32 | } |
|
33 | ||
34 | // Show the current tab, and add an "active" class to the button that opened the tab |
|
35 | document.getElementById(tabName).style.display = 'block'; |
|
36 | evt.currentTarget.className += ' active'; |
|
37 | ||
38 | // al the java code for the filling of the fields in the preview tab! |
|
39 | if (tabName === 'preview') { |
|
40 | // get the date field |
|
41 | var day = document.getElementsByName('Date_Day')[0].value; |
|
42 | document.getElementById('interview_preview_date').innerHTML = day; |
|
43 | document.getElementById('interview_preview_date').innerHTML += '-'; |
|
44 | var month = document.getElementsByName('Date_Month')[0].value; |
|
45 | document.getElementById('interview_preview_date').innerHTML += month; |
|
46 | document.getElementById('interview_preview_date').innerHTML += '-'; |
|
47 | var year = document.getElementsByName('Date_Year')[0].value; |
|
48 | document.getElementById('interview_preview_date').innerHTML += year; |
|
49 | ||
50 | var user = document.getElementById('member_select'); |
|
51 | var strUser = user.options[user.selectedIndex].text; |
|
52 | document.getElementById('interview_preview_user').innerHTML = strUser; |
|
53 | ||
54 | // Do all the preps for the intro text! |
|
55 | var intro = document.getElementsByName('textintro')[0].value; |
|
56 | intro = previewText(intro); |
|
57 | document.getElementById('interview_preview_intro').innerHTML = intro; |
|
58 | ||
59 | // Do all the preps for the chapters text! |
|
60 | var chapters = document.getElementsByName('textchapters')[0].value; |
|
61 | chapters = previewText(chapters); |
|
62 | document.getElementById('interview_preview_chapters').innerHTML = chapters; |
|
63 | ||
64 | // Do all the preps for the actual interview text! |
|
65 | var interview = document.getElementsByName('textfield')[0].value; |
|
66 | interview = previewText(interview); |
|
67 | document.getElementById('interview_preview_text').innerHTML = interview; |
|
68 | ||
69 | // get the screenshots data |
|
70 | for (i = 1; i <= screenshotsNr; i++) { |
|
71 | var string = 'comment_'; |
|
72 | var stringComment = string.concat(i); |
|
73 | var comment = document.getElementById(stringComment).value; |
|
74 | ||
75 | var string2 = 'preview_comment_'; |
|
76 | var stringPreviewComment = string2.concat(i); |
|
77 | document.getElementById(stringPreviewComment).innerHTML = comment; |
|
78 | ||
79 | var string3 = 'output_'; |
|
80 | var stringOutput2 = string3.concat(i); |
|
81 | var output2 = document.getElementById(stringOutput2); |
|
82 | output2.style.display = 'inline'; |
|
83 | } |
|
84 | } |
|
85 | } |
|
86 | ||
87 | // Delete the comments and the interview |
|
88 | window.deletecomment = function (str, str2) { |
@@ 93-155 (lines=63) @@ | ||
90 | $('select[name=members]').altAutocomplete(); |
|
91 | }); |
|
92 | ||
93 | window.openTab = function (evt, tabName, screenshotsNr) { |
|
94 | // Declare all variables |
|
95 | var i, tabcontent, tablinks; |
|
96 | ||
97 | // Get all elements with class="tabcontent" and hide them |
|
98 | tabcontent = document.getElementsByClassName('tabcontent'); |
|
99 | for (i = 0; i < tabcontent.length; i++) { |
|
100 | tabcontent[i].style.display = 'none'; |
|
101 | } |
|
102 | ||
103 | // Get all elements with class="tablinks" and remove the class "active" |
|
104 | tablinks = document.getElementsByClassName('tablinks'); |
|
105 | for (i = 0; i < tablinks.length; i++) { |
|
106 | tablinks[i].className = tablinks[i].className.replace(' active', ''); |
|
107 | } |
|
108 | ||
109 | // Show the current tab, and add an "active" class to the button that opened the tab |
|
110 | document.getElementById(tabName).style.display = 'block'; |
|
111 | evt.currentTarget.className += ' active'; |
|
112 | ||
113 | // al the java code for the filling of the fields in the preview tab! |
|
114 | if (tabName === 'preview') { |
|
115 | // get the date field |
|
116 | var day = document.getElementsByName('Date_Day')[0].value; |
|
117 | document.getElementById('article_preview_date').innerHTML = day; |
|
118 | document.getElementById('article_preview_date').innerHTML += '-'; |
|
119 | var month = document.getElementsByName('Date_Month')[0].value; |
|
120 | document.getElementById('article_preview_date').innerHTML += month; |
|
121 | document.getElementById('article_preview_date').innerHTML += '-'; |
|
122 | var year = document.getElementsByName('Date_Year')[0].value; |
|
123 | document.getElementById('article_preview_date').innerHTML += year; |
|
124 | ||
125 | var user = document.getElementById('member_select'); |
|
126 | var strUser = user.options[user.selectedIndex].text; |
|
127 | document.getElementById('article_preview_user').innerHTML = strUser; |
|
128 | ||
129 | // Do all the preps for the intro text! |
|
130 | var intro = document.getElementsByName('textintro')[0].value; |
|
131 | intro = previewText(intro); |
|
132 | document.getElementById('article_preview_intro').innerHTML = intro; |
|
133 | ||
134 | // Do all the preps for the actual article text! |
|
135 | var article = document.getElementsByName('textfield')[0].value; |
|
136 | article = previewText(article); |
|
137 | document.getElementById('article_preview_text').innerHTML = article; |
|
138 | ||
139 | // get the screenshots data |
|
140 | for (i = 1; i <= screenshotsNr; i++) { |
|
141 | var string = 'comment_'; |
|
142 | var stringComment = string.concat(i); |
|
143 | var comment = document.getElementById(stringComment).value; |
|
144 | ||
145 | var string2 = 'preview_comment_'; |
|
146 | var stringPreviewComment = string2.concat(i); |
|
147 | document.getElementById(stringPreviewComment).innerHTML = comment; |
|
148 | ||
149 | var string3 = 'output_'; |
|
150 | var stringOutput2 = string3.concat(i); |
|
151 | var output2 = document.getElementById(stringOutput2); |
|
152 | output2.style.display = 'inline'; |
|
153 | } |
|
154 | } |
|
155 | } |
|
156 | ||
157 | // Delete the comments and the article |
|
158 | window.deletecomment = function (str, str2) { |