50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
|
'use strict';
|
|||
|
|
|||
|
import * as sol from "../../solight/sol.js";
|
|||
|
|
|||
|
|
|||
|
const process_data = (scheduleFile) =>
|
|||
|
sol.processScheduleFile(scheduleFile);
|
|||
|
|
|||
|
|
|||
|
const event_modus_string = (event) => {
|
|||
|
const questionId = 1392;
|
|||
|
const answers = sol.eventAnswers(event);
|
|||
|
const answer = answers.filter(a => a.get('question') === questionId);
|
|||
|
const modus = answer.length > 0 ? answer[0].get('answer') : '???';
|
|||
|
return modus;
|
|||
|
};
|
|||
|
|
|||
|
|
|||
|
const trackIndexMap = new Map([
|
|||
|
['Andere', 0],
|
|||
|
['Ethik, Wissenschaft, Kultur & Gesellschaft', 1],
|
|||
|
['Recht & Politik', 2],
|
|||
|
['Digitale Selbstverteidigung', 3],
|
|||
|
['Netzwerke, Security, Hard- & Software', 4]]);
|
|||
|
|
|||
|
const track_index = (track) =>
|
|||
|
trackIndexMap.get(track);
|
|||
|
|
|||
|
|
|||
|
const person_names_concat = (persons) =>
|
|||
|
// persons.map(p => sol.personName(p)).join(', ');
|
|||
|
// persons.map(p => sol.personName(p)).join(' & ');
|
|||
|
persons.map(p => sol.personName(p)).join(' · ');
|
|||
|
|
|||
|
|
|||
|
const ndash_fix_regexp = RegExp('\\s+-\\s+');
|
|||
|
const ndash_fix_replacement = ' – ';
|
|||
|
|
|||
|
const fix_dash = (string) =>
|
|||
|
string.replace(ndash_fix_regexp, ndash_fix_replacement);
|
|||
|
|
|||
|
|
|||
|
export {
|
|||
|
process_data,
|
|||
|
event_modus_string,
|
|||
|
track_index,
|
|||
|
person_names_concat,
|
|||
|
fix_dash
|
|||
|
}
|