parent
6c93612737
commit
800ab0d9b7
34
index.html
34
index.html
|
@ -16,19 +16,43 @@
|
||||||
the middleware might not work as expected.</p>
|
the middleware might not work as expected.</p>
|
||||||
<br>
|
<br>
|
||||||
<form>
|
<form>
|
||||||
<label for="raplalink">Your RaPla Link</label>
|
<label for="coursename">Choose your course</label>
|
||||||
|
<select id="coursename" name="coursename">
|
||||||
|
<option value="-1" selected>Course</option>
|
||||||
|
<option value="TINF19B1">TINF19B1</option>
|
||||||
|
<option value="TINF19B2">TINF19B2</option>
|
||||||
|
<option value="TINF19B3">TINF19B3</option>
|
||||||
|
<option value="TINF19B4">TINF19B4</option>
|
||||||
|
<option value="TINF19B5">TINF19B5</option>
|
||||||
|
<option value="TINF20B1">TINF20B1</option>
|
||||||
|
<option value="TINF20B2">TINF20B2</option>
|
||||||
|
<option value="TINF20B3">TINF20B3</option>
|
||||||
|
<option value="TINF20B4">TINF20B4</option>
|
||||||
|
<option value="TINF20B5">TINF20B5</option>
|
||||||
|
</select><br>
|
||||||
|
<label for="raplalink">If your course is not in the list, provide your RaPla Link here:</label>
|
||||||
<input name="raplalink" id="raplalink" type="text"><br>
|
<input name="raplalink" id="raplalink" type="text"><br>
|
||||||
<label for="hideBlockers">Hide Blockers</label>
|
<label for="hideBlockers">Hide Blockers</label>
|
||||||
<input name="hideBlockers" id="hideBlockers" type="checkbox"><br>
|
<input name="hideBlockers" id="hideBlockers" type="checkbox"><br>
|
||||||
<label for="wahlmodul">Wahlmodul</label>
|
<label for="wahlmodul">Wahlmodul</label>
|
||||||
<select id="wahlmodul" name="wahlmodul">
|
<select id="wahlmodul" name="wahlmodul">
|
||||||
<option value="1">WM1</option>
|
<option value="" selected>Wahlmodul</option>
|
||||||
<option value="2">WM2</option>
|
<option value="1">ERP-Systeme</option>
|
||||||
|
<option value="2">Ethik für Informatiker</option>
|
||||||
|
<option value="3">Evolutionäre Algorithmen</option>
|
||||||
|
<option value="4">Forensik</option>
|
||||||
|
<option value="5">Kryptographische Verfahren</option>
|
||||||
|
<option value="6">Robotik</option>
|
||||||
|
<option value="7">Web-Services</option>
|
||||||
</select><br>
|
</select><br>
|
||||||
<label for="profilmodul">Profilmodul</label>
|
<label for="profilmodul">Profilmodul</label>
|
||||||
<select id="profilmodul" name="profilmodul">
|
<select id="profilmodul" name="profilmodul">
|
||||||
<option value="1">PM1</option>
|
<option value="" selected>Profilmodul</option>
|
||||||
<option value="2">PM2</option>
|
<option value="1">KI und BV</option>
|
||||||
|
<option value="2">Computergrafik</option>
|
||||||
|
<option value="3">KI und IS</option>
|
||||||
|
<option value="4">E-Business</option>
|
||||||
|
<option value="5">Netztechnik II</option>
|
||||||
</select><br>
|
</select><br>
|
||||||
<input type="button" id="submitBtn" value="Generate Link">
|
<input type="button" id="submitBtn" value="Generate Link">
|
||||||
</form>
|
</form>
|
||||||
|
|
52
scripts.js
52
scripts.js
|
@ -7,16 +7,46 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
function generateLink() {
|
function generateLink() {
|
||||||
let link = 'abc';
|
let selectedCourseFromPicker = $('#coursename').val().toString();
|
||||||
|
|
||||||
|
let raplaUser = '';
|
||||||
|
let raplaFile = '';
|
||||||
|
|
||||||
|
if (selectedCourseFromPicker === '-1') {
|
||||||
let providedRaPlaLink = $('#raplalink').val().toString();
|
let providedRaPlaLink = $('#raplalink').val().toString();
|
||||||
|
const url = new URL(providedRaPlaLink);
|
||||||
console.log(providedRaPlaLink);
|
raplaUser = url.searchParams.get('user');
|
||||||
|
raplaFile = url.searchParams.get('file');
|
||||||
const urlParams = new URLSearchParams(providedRaPlaLink);
|
} else {
|
||||||
|
let courseInfo = courseLinks[selectedCourseFromPicker];
|
||||||
console.log(urlParams.keys());
|
raplaUser = courseInfo.user;
|
||||||
|
raplaFile = courseInfo.file;
|
||||||
console.log(urlParams.get('b'));
|
}
|
||||||
|
|
||||||
$('#full-link').text(link);
|
let showBlockers = $('#hideBlockers').is(':checked') ? 0 : 1;
|
||||||
|
let selectedElectiveModule = $('#wahlmodul').val().toString();
|
||||||
|
let selectedProfileModule = $('#profilmodul').val().toString();
|
||||||
|
|
||||||
|
let base_url = 'https://api.plutodev.de/rapla-middleware'
|
||||||
|
|
||||||
|
base_url += '?user=' + raplaUser;
|
||||||
|
base_url += '&file=' + raplaFile;
|
||||||
|
base_url += '&blockers=' + showBlockers;
|
||||||
|
base_url += '&wahl=' + selectedElectiveModule;
|
||||||
|
base_url += '&pflicht=' + selectedProfileModule;
|
||||||
|
|
||||||
|
$('#full-link').text(base_url);
|
||||||
|
}
|
||||||
|
|
||||||
|
let courseLinks = {
|
||||||
|
'TINF19B1': {user: 'freudenmann', file: 'TINF19B1'},
|
||||||
|
'TINF19B2': {user: 'braun', file: 'TINF19B2'},
|
||||||
|
'TINF19B3': {user: 'vollmer', file: 'tinf19b3'},
|
||||||
|
'TINF19B4': {user: 'eisenbiegler', file: 'TINF19B4'},
|
||||||
|
'TINF19B5': {user: 'strand', file: 'TINF19B5'},
|
||||||
|
'TINF20B1': {user: 'freudenmann', file: 'TINF20B1'},
|
||||||
|
'TINF20B2': {user: 'braun', file: 'TINF20B2'},
|
||||||
|
'TINF20B3': {user: 'vollmer', file: 'tinf20b3'},
|
||||||
|
'TINF20B4': {user: 'eisenbiegler', file: 'TINF20B4'},
|
||||||
|
'TINF20B5': {user: 'strand', file: 'TINF20B5'}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
background-color: #191718;
|
||||||
|
color: #E0E5E9;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user