blob: 86823a0372854de3b5de833b1638fafae0a35247 [file] [log] [blame]
Kit Lo3c7ce142013-03-02 18:22:40 -05001<script src="js/projectSourceLocations.js" type='text/javascript'></script>
Kit Lo3c7ce142013-03-02 18:22:40 -05002<div id="maincontent">
3<div id="midcolumn">
4<h1><?= $pageTitle ?></h1>
5<p>Use this form to define the project source locations. Any .properties or .js files except those listed in the plugin exclude patterns will be parsed and imported into Babel, allowing the community to translate the externalized strings.</p>
6<form name="form1" method="post">
7<table cellspacing=4 cellpadding=0 border=0>
8<tr>
9 <td style="color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td>
10</tr>
11<tr>
12 <td>Project:</td>
13 <td><select name="project_id" onchange="fnSetVersionList();" style="width:150px"><?php
kitlo1d027092018-04-19 17:44:07 -040014 while($myrow = mysqli_fetch_assoc($rs_project_list)) {
Kit Lo3c7ce142013-03-02 18:22:40 -050015 $selected = "";
16 if($myrow['project_id'] == $PROJECT_ID) {
17 $selected = 'selected="selected"';
18 }
19 echo "<option value='" . $myrow['project_id'] . "' $selected>" . $myrow['project_id'] . "</option>";
20 }
21 ?></select></td>
22 <td style="color:red;"><?= $GLOBALS['g_ERRSTRS'][1] ?></td>
23</tr>
24<tr>
25 <td>Release Version:</td>
26 <td><select name="version" onchange="fnUpdateFileList();" style="width:150px"></select> * Indicates project source locations present</td>
27 <td style="color:red;"><?= $GLOBALS['g_ERRSTRS'][4] ?></td>
28</tr>
29<tr>
30 <td>Release Train:</td>
31 <td><select name="train_id" style="width:150px"><?php
kitlo1d027092018-04-19 17:44:07 -040032 while($myrow = mysqli_fetch_assoc($rs_train_list)) {
Kit Lo3c7ce142013-03-02 18:22:40 -050033 $selected = "";
34 if($myrow['train_id'] == $TRAIN_ID) {
35 $selected = 'selected="selected"';
36 }
37 echo "<option value='" . $myrow['train_id'] . "' $selected>" . $myrow['train_id'] . "</option>";
38 }
39 ?></select></td>
40 <td></td>
41</tr>
42<tr>
43 <td colspan=3>Project Source Locations: (Git repository snapshot URLs, example: http://git.eclipse.org/c/platform/.../snapshot/R4_2.zip)</td>
44</tr>
45<tr>
46 <td colspan=3><textarea id="files-area" name="fileFld" onclick="fnClickTextFilesArea();" rows=5 cols="110"></textarea></td>
47</tr>
48<tr>
49 <td colspan=2>Plugin Exclude Patterns: (regular expressions, example: /^org\.junit\..*$/)</td>
50 <td style="color:red;"><?= $GLOBALS['g_ERRSTRS'][2] ?></td>
51</tr>
52<tr>
53 <td colspan=3><textarea id="patterns-area" name="patterns" onclick="fnClickTextPatternsArea();" rows="5" cols="110"></textarea></td>
54</tr>
55<tr>
56 <td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td>
57 <td></td>
58 <td></td>
59</tr>
60</table>
61</form>
Kit Loe9ea1f92013-06-20 09:45:54 -040062</div>
63<br class='clearing'>
64</div>
Kit Lo3c7ce142013-03-02 18:22:40 -050065<script language="javascript">
66 function fnSetVersionList() {
67 document.form1.version.options.length = 0;
68
69 if(typeof(versions[document.form1.project_id.value]) != "undefined") {
70 for(i = 0; i < versions[document.form1.project_id.value].length; i++) {
71 var opt = document.createElement("OPTION");
72 document.form1.version.options.add(opt);
73 document.form1.version.options[i].text = versions[document.form1.project_id.value][i];
74 document.form1.version.options[i].value = versions[document.form1.project_id.value][i];
75 if(versions[document.form1.project_id.value][i] == "<?= $VERSION ?>") {
76 document.form1.version.options[i].selected = "selected";
77 }
78 }
79 }
80 else {
81 var opt = document.createElement("OPTION");
82 document.form1.version.options.add(opt);
83 document.form1.version.options[0].text = "unspecified";
84 document.form1.version.options[0].value = "unspecified";
85 }
86
87 fnUpdateFileList();
88 }
89
90 function cleanVersion(_value) {
91 return _value.replace(/^\* /, "");
92 }
93
94 function fnClickTextFilesArea() {
Kit Loe9ea1f92013-06-20 09:45:54 -040095 if(document.form1.fileFld.value.substr(0,27) == "No project source locations") {
Kit Lo3c7ce142013-03-02 18:22:40 -050096 document.form1.fileFld.value = "";
97 }
98 }
99
100 function fnClickTextPatternsArea() {
101 if(document.form1.patterns.value.substr(0,26) == "No plugin exclude patterns") {
102 document.form1.patterns.value = "";
103 }
104 }
105
106 function fnUpdateFileList() {
107 var project_id = document.form1.project_id.value;
108 var version = cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value);
109 showProjectSourceLocations(project_id, version);
110 showPluginExcludePatterns(project_id, version);
111 fnSetTrain();
112 }
113
114 function fnSetTrain() {
Kit Lo3c7ce142013-03-02 18:22:40 -0500115 if(typeof(project_trains[document.form1.project_id.value][cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value)]) != "undefined") {
116 for(i = 0; i < document.form1.train_id.length; i++) {
117 document.form1.train_id.options[i].selected = "";
118 if(document.form1.train_id.options[i].value == project_trains[document.form1.project_id.value][cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value)]) {
119 document.form1.train_id.options[i].selected = "selected";
120 }
121 }
122 }
123 }
124
125<?php
126global $addon;
127echo $addon->callHook('validate_map_file_url');
128?>
129
130 var versions = new Array();
131
132<?php
133 $prev_project = "";
134 $count = 0;
kitlo1d027092018-04-19 17:44:07 -0400135 while($myrow = mysqli_fetch_assoc($rs_version_list)) {
Kit Lo3c7ce142013-03-02 18:22:40 -0500136 if($prev_project != $myrow['project_id']) {
137 if($count > 0) {
138 echo "];
139";
140 }
141 echo "versions['" . $myrow['project_id'] . "'] = [";
142 $count = 0;
143 }
144 if($count > 0) {
145 echo ",";
146 }
147 $str = "";
148 if($myrow['map_count'] > 0) {
149 $str = "* ";
150 }
151
152 echo "\"$str" . $myrow['version'] . "\"";
153 $count++;
154 $prev_project = $myrow['project_id'];
155 }
156 echo "];";
157 ?>
158
159
160 var project_trains = new Array();
161
162<?php
163 $prev_project = "";
164 $count = 0;
kitlo1d027092018-04-19 17:44:07 -0400165 while($myrow = mysqli_fetch_assoc($rs_train_project_list)) {
Kit Lo3c7ce142013-03-02 18:22:40 -0500166 if($prev_project != $myrow['project_id']) {
167 if($count > 0) {
168 echo "};
169";
170 }
171 echo "project_trains['" . $myrow['project_id'] . "'] = {";
172 $count = 0;
173 }
174 if($count > 0) {
175 echo ",";
176 }
177
178 echo "'" . $myrow['version'] . "' : '" . $myrow['train_id'] . "'";
179 $count++;
180 $prev_project = $myrow['project_id'];
181 }
182 echo "};";
183 ?>
184 fnSetVersionList();
185 </script>