mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
format: run prettify
This commit is contained in:
@@ -20,191 +20,356 @@ function generateMockUserCode(): string {
|
||||
function getRandomDate(): Date {
|
||||
const start = new Date();
|
||||
const end = new Date(start.getTime() + 60 * 24 * 60 * 60 * 1000); // 60 days from now
|
||||
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
|
||||
return new Date(
|
||||
start.getTime() + Math.random() * (end.getTime() - start.getTime()),
|
||||
);
|
||||
}
|
||||
|
||||
const contentConfig: ContentConfig = {
|
||||
lessonTitle: {
|
||||
selector: '.day h2',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.subjects); }
|
||||
lessonTitle: {
|
||||
selector: ".day h2",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.subjects);
|
||||
},
|
||||
},
|
||||
teacher: {
|
||||
selector: '.day h3:first-of-type',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.teachers); }
|
||||
teacher: {
|
||||
selector: ".day h3:first-of-type",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.teachers);
|
||||
},
|
||||
},
|
||||
classroom: {
|
||||
selector: '.day h3:last-of-type',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.classrooms); }
|
||||
classroom: {
|
||||
selector: ".day h3:last-of-type",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.classrooms);
|
||||
},
|
||||
},
|
||||
userName: {
|
||||
selector: '.userInfoName, .name',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.names); }
|
||||
userName: {
|
||||
selector: ".userInfoName, .name",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.names);
|
||||
},
|
||||
},
|
||||
userCode: {
|
||||
selector: '.userInfoText > .userInfoCode',
|
||||
action: (element) => { element.textContent = generateMockUserCode(); }
|
||||
userCode: {
|
||||
selector: ".userInfoText > .userInfoCode",
|
||||
action: (element) => {
|
||||
element.textContent = generateMockUserCode();
|
||||
},
|
||||
},
|
||||
assessmentTitle: {
|
||||
selector: '.upcoming-assessment .upcoming-assessment-title',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.assessmentTitles); }
|
||||
assessmentTitle: {
|
||||
selector: ".upcoming-assessment .upcoming-assessment-title",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.assessmentTitles);
|
||||
},
|
||||
},
|
||||
assessmentSubject: {
|
||||
selector: '.upcoming-assessment .upcoming-details h5',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.subjects); }
|
||||
assessmentSubject: {
|
||||
selector: ".upcoming-assessment .upcoming-details h5",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.subjects);
|
||||
},
|
||||
},
|
||||
noticeTitle: {
|
||||
selector: '.notice h3',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.notices); }
|
||||
noticeTitle: {
|
||||
selector: ".notice h3",
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.notices);
|
||||
},
|
||||
},
|
||||
noticeContent: {
|
||||
selector: '.notice .contents',
|
||||
action: (element) => { element.textContent = 'Content has been redacted for privacy.'; }
|
||||
noticeContent: {
|
||||
selector: ".notice .contents",
|
||||
action: (element) => {
|
||||
element.textContent = "Content has been redacted for privacy.";
|
||||
},
|
||||
},
|
||||
upcomingCheckboxes: {
|
||||
selector: '.upcoming-checkbox-container',
|
||||
action: (element) => { element.firstChild!.textContent = 'SUBJ'; }
|
||||
selector: ".upcoming-checkbox-container",
|
||||
action: (element) => {
|
||||
element.firstChild!.textContent = "SUBJ";
|
||||
},
|
||||
},
|
||||
dates: {
|
||||
selector: '.upcoming-date-title h5, input[type="date"]',
|
||||
dates: {
|
||||
selector: '.upcoming-date-title h5, input[type="date"]',
|
||||
action: (element) => {
|
||||
const randomDate = getRandomDate();
|
||||
if (element instanceof HTMLInputElement) {
|
||||
element.value = randomDate.toISOString().split('T')[0];
|
||||
element.value = randomDate.toISOString().split("T")[0];
|
||||
} else {
|
||||
element.textContent = randomDate.toLocaleDateString('en-US', { weekday: 'long', day: 'numeric', month: 'long' });
|
||||
element.textContent = randomDate.toLocaleDateString("en-US", {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
messageSubject: {
|
||||
selector: '[class*="MessageList__subject___"]',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.messages.subjects); }
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.messages.subjects);
|
||||
},
|
||||
},
|
||||
|
||||
messageSender: {
|
||||
selector: '[class*="MessageList__value___"]',
|
||||
action: (element) => { element.textContent = getRandomElement(mockData.messages.sender); }
|
||||
action: (element) => {
|
||||
element.textContent = getRandomElement(mockData.messages.sender);
|
||||
},
|
||||
},
|
||||
|
||||
messageRecipients: {
|
||||
selector: '[class*="MessageList__recipients___"] [class*="MessageList__value___"]',
|
||||
action: (element) => { element.textContent = 'Recipient(s) Redacted'; }
|
||||
selector:
|
||||
'[class*="MessageList__recipients___"] [class*="MessageList__value___"]',
|
||||
action: (element) => {
|
||||
element.textContent = "Recipient(s) Redacted";
|
||||
},
|
||||
},
|
||||
|
||||
messageDate: {
|
||||
selector: '[class*="MessageList__date___"]',
|
||||
action: (element) => { element.textContent = getRandomDate().toLocaleDateString('en-US', { weekday: 'long', day: 'numeric', month: 'long' }); }
|
||||
action: (element) => {
|
||||
element.textContent = getRandomDate().toLocaleDateString("en-US", {
|
||||
weekday: "long",
|
||||
day: "numeric",
|
||||
month: "long",
|
||||
});
|
||||
},
|
||||
},
|
||||
avatarImage: {
|
||||
selector: '[class*="Avatar__Avatar___"]',
|
||||
action: (element) => {
|
||||
action: (element) => {
|
||||
if (element instanceof HTMLElement) {
|
||||
element.style.removeProperty('background-image');
|
||||
element.firstChild!.firstChild!.textContent = getRandomElement(mockData.names)[0];
|
||||
element.style.removeProperty("background-image");
|
||||
element.firstChild!.firstChild!.textContent = getRandomElement(
|
||||
mockData.names,
|
||||
)[0];
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
notificationCount: {
|
||||
selector: '[class*="notifications__bubble___"]',
|
||||
action: (element) => { element.textContent = Math.floor(Math.random() * 100).toString(); }
|
||||
action: (element) => {
|
||||
element.textContent = Math.floor(Math.random() * 100).toString();
|
||||
},
|
||||
},
|
||||
schoolName: {
|
||||
selector: 'title',
|
||||
action: (element) => { element.textContent = 'School Portal'; }
|
||||
selector: "title",
|
||||
action: (element) => {
|
||||
element.textContent = "School Portal";
|
||||
},
|
||||
},
|
||||
documentNames: {
|
||||
selector: '.document td.title',
|
||||
action: (element) => { element.textContent = 'Document Name Redacted'; }
|
||||
selector: ".document td.title",
|
||||
action: (element) => {
|
||||
element.textContent = "Document Name Redacted";
|
||||
},
|
||||
},
|
||||
forumTopics: {
|
||||
selector: '#menu .sub ul li label',
|
||||
action: (element) => { element.textContent = 'Forum Topic Redacted'; }
|
||||
selector: "#menu .sub ul li label",
|
||||
action: (element) => {
|
||||
element.textContent = "Forum Topic Redacted";
|
||||
},
|
||||
},
|
||||
courseNames: {
|
||||
selector: '#menu .sub ul li[data-colour] label',
|
||||
action: (element) => { element.textContent = 'Course Name Redacted'; }
|
||||
selector: "#menu .sub ul li[data-colour] label",
|
||||
action: (element) => {
|
||||
element.textContent = "Course Name Redacted";
|
||||
},
|
||||
},
|
||||
yearGroups: {
|
||||
selector: '#menu .sub > ul > li > label',
|
||||
action: (element) => { element.textContent = 'Year Group Redacted'; }
|
||||
selector: "#menu .sub > ul > li > label",
|
||||
action: (element) => {
|
||||
element.textContent = "Year Group Redacted";
|
||||
},
|
||||
},
|
||||
newsArticleTitle: {
|
||||
selector: '.ArticleText a',
|
||||
action: (element) => { element.textContent = 'News Article Title Redacted'; }
|
||||
selector: ".ArticleText a",
|
||||
action: (element) => {
|
||||
element.textContent = "News Article Title Redacted";
|
||||
},
|
||||
},
|
||||
newsArticleContent: {
|
||||
selector: '.ArticleText p',
|
||||
action: (element) => { element.textContent = 'News Article Content Redacted'; }
|
||||
selector: ".ArticleText p",
|
||||
action: (element) => {
|
||||
element.textContent = "News Article Content Redacted";
|
||||
},
|
||||
},
|
||||
userHouse: {
|
||||
selector: '.userInfohouse',
|
||||
action: (element) => { element.textContent = 'House'; }
|
||||
}
|
||||
selector: ".userInfohouse",
|
||||
action: (element) => {
|
||||
element.textContent = "House";
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const mockData = {
|
||||
subjects: [
|
||||
"Mathematics", "English", "Science", "History", "Geography",
|
||||
"Art", "Music", "Physical Education", "Chemistry", "Physics",
|
||||
"Biology", "Economics", "Business Studies", "French", "Spanish",
|
||||
"Computer Science", "Literature", "Environmental Studies",
|
||||
"Political Science", "Sociology"
|
||||
"Mathematics",
|
||||
"English",
|
||||
"Science",
|
||||
"History",
|
||||
"Geography",
|
||||
"Art",
|
||||
"Music",
|
||||
"Physical Education",
|
||||
"Chemistry",
|
||||
"Physics",
|
||||
"Biology",
|
||||
"Economics",
|
||||
"Business Studies",
|
||||
"French",
|
||||
"Spanish",
|
||||
"Computer Science",
|
||||
"Literature",
|
||||
"Environmental Studies",
|
||||
"Political Science",
|
||||
"Sociology",
|
||||
],
|
||||
teachers: [
|
||||
"Mr. Smith", "Mrs. Johnson", "Ms. Williams", "Dr. Brown",
|
||||
"Mr. Davis", "Mrs. Miller", "Mr. Wilson", "Ms. Moore",
|
||||
"Dr. Taylor", "Mrs. Anderson", "Mr. Garcia", "Mrs. Martinez",
|
||||
"Ms. Thompson", "Dr. Lee", "Mr. Robinson", "Mrs. Hall",
|
||||
"Ms. White", "Dr. Clark", "Mr. Lewis", "Mrs. King"
|
||||
"Mr. Smith",
|
||||
"Mrs. Johnson",
|
||||
"Ms. Williams",
|
||||
"Dr. Brown",
|
||||
"Mr. Davis",
|
||||
"Mrs. Miller",
|
||||
"Mr. Wilson",
|
||||
"Ms. Moore",
|
||||
"Dr. Taylor",
|
||||
"Mrs. Anderson",
|
||||
"Mr. Garcia",
|
||||
"Mrs. Martinez",
|
||||
"Ms. Thompson",
|
||||
"Dr. Lee",
|
||||
"Mr. Robinson",
|
||||
"Mrs. Hall",
|
||||
"Ms. White",
|
||||
"Dr. Clark",
|
||||
"Mr. Lewis",
|
||||
"Mrs. King",
|
||||
],
|
||||
classrooms: [
|
||||
"A101", "B205", "C304", "D102", "E201",
|
||||
"F103", "G204", "H301", "I202", "J105",
|
||||
"K107", "L206", "M303", "N104", "O209"
|
||||
"A101",
|
||||
"B205",
|
||||
"C304",
|
||||
"D102",
|
||||
"E201",
|
||||
"F103",
|
||||
"G204",
|
||||
"H301",
|
||||
"I202",
|
||||
"J105",
|
||||
"K107",
|
||||
"L206",
|
||||
"M303",
|
||||
"N104",
|
||||
"O209",
|
||||
],
|
||||
names: [
|
||||
"John Doe", "Jane Smith", "Michael Johnson", "Emily Brown",
|
||||
"David Lee", "Sarah Davis", "Robert Wilson", "Lisa Taylor",
|
||||
"William Moore", "Jennifer Anderson", "Thomas Garcia",
|
||||
"Olivia Martinez", "Daniel Thompson", "Sophia Lee",
|
||||
"Matthew Robinson", "Ava Hall", "Jacob White",
|
||||
"Mia Clark", "James Lewis", "Lily King"
|
||||
"John Doe",
|
||||
"Jane Smith",
|
||||
"Michael Johnson",
|
||||
"Emily Brown",
|
||||
"David Lee",
|
||||
"Sarah Davis",
|
||||
"Robert Wilson",
|
||||
"Lisa Taylor",
|
||||
"William Moore",
|
||||
"Jennifer Anderson",
|
||||
"Thomas Garcia",
|
||||
"Olivia Martinez",
|
||||
"Daniel Thompson",
|
||||
"Sophia Lee",
|
||||
"Matthew Robinson",
|
||||
"Ava Hall",
|
||||
"Jacob White",
|
||||
"Mia Clark",
|
||||
"James Lewis",
|
||||
"Lily King",
|
||||
],
|
||||
assessmentTitles: [
|
||||
"Mid-term Exam", "Final Project", "Research Paper",
|
||||
"Oral Presentation", "Lab Report", "Essay",
|
||||
"Group Assignment", "Portfolio Review", "Quiz",
|
||||
"Practical Test", "Class Presentation",
|
||||
"Online Assessment", "Case Study", "Field Report",
|
||||
"Peer Review", "Coding Challenge", "Math Test",
|
||||
"Literary Analysis", "Debate", "Design Project"
|
||||
"Mid-term Exam",
|
||||
"Final Project",
|
||||
"Research Paper",
|
||||
"Oral Presentation",
|
||||
"Lab Report",
|
||||
"Essay",
|
||||
"Group Assignment",
|
||||
"Portfolio Review",
|
||||
"Quiz",
|
||||
"Practical Test",
|
||||
"Class Presentation",
|
||||
"Online Assessment",
|
||||
"Case Study",
|
||||
"Field Report",
|
||||
"Peer Review",
|
||||
"Coding Challenge",
|
||||
"Math Test",
|
||||
"Literary Analysis",
|
||||
"Debate",
|
||||
"Design Project",
|
||||
],
|
||||
notices: [
|
||||
"School Assembly", "Excursion Reminder", "Fundraising Event",
|
||||
"Parent-Teacher Meetings", "Sports Day", "Book Fair",
|
||||
"Career Day", "Music Concert", "Art Exhibition",
|
||||
"Science Fair", "Holiday Celebration", "Community Service Day",
|
||||
"Graduation Ceremony", "Award Ceremony", "Workshop",
|
||||
"Open House", "Seminar", "Club Meeting",
|
||||
"Field Trip", "Cultural Festival"
|
||||
"School Assembly",
|
||||
"Excursion Reminder",
|
||||
"Fundraising Event",
|
||||
"Parent-Teacher Meetings",
|
||||
"Sports Day",
|
||||
"Book Fair",
|
||||
"Career Day",
|
||||
"Music Concert",
|
||||
"Art Exhibition",
|
||||
"Science Fair",
|
||||
"Holiday Celebration",
|
||||
"Community Service Day",
|
||||
"Graduation Ceremony",
|
||||
"Award Ceremony",
|
||||
"Workshop",
|
||||
"Open House",
|
||||
"Seminar",
|
||||
"Club Meeting",
|
||||
"Field Trip",
|
||||
"Cultural Festival",
|
||||
],
|
||||
messages: {
|
||||
subjects: [
|
||||
"Mid-year Exams", "Science project due soon", "Mufti Day coming up!",
|
||||
"School Assembly", "Excursion Reminder", "Fundraising Event",
|
||||
"Parent-Teacher Meetings", "Sports Day", "Book Fair",
|
||||
"Career Day", "Music Concert", "Art Exhibition",
|
||||
"Science Fair", "Holiday Celebration", "Community Service Day",
|
||||
"Graduation Ceremony", "Award Ceremony", "Workshop",
|
||||
"Open House", "Seminar", "Club Meeting",
|
||||
"Field Trip", "Cultural Festival"
|
||||
"Mid-year Exams",
|
||||
"Science project due soon",
|
||||
"Mufti Day coming up!",
|
||||
"School Assembly",
|
||||
"Excursion Reminder",
|
||||
"Fundraising Event",
|
||||
"Parent-Teacher Meetings",
|
||||
"Sports Day",
|
||||
"Book Fair",
|
||||
"Career Day",
|
||||
"Music Concert",
|
||||
"Art Exhibition",
|
||||
"Science Fair",
|
||||
"Holiday Celebration",
|
||||
"Community Service Day",
|
||||
"Graduation Ceremony",
|
||||
"Award Ceremony",
|
||||
"Workshop",
|
||||
"Open House",
|
||||
"Seminar",
|
||||
"Club Meeting",
|
||||
"Field Trip",
|
||||
"Cultural Festival",
|
||||
],
|
||||
sender: [
|
||||
"Mr. Smith", "Mrs. Johnson", "Ms. Williams", "Dr. Brown",
|
||||
"Mr. Davis", "Mrs. Miller", "Mr. Wilson", "Ms. Moore",
|
||||
"Dr. Taylor", "Mrs. Anderson", "Mr. Garcia", "Mrs. Martinez",
|
||||
]
|
||||
}
|
||||
"Mr. Smith",
|
||||
"Mrs. Johnson",
|
||||
"Ms. Williams",
|
||||
"Dr. Brown",
|
||||
"Mr. Davis",
|
||||
"Mrs. Miller",
|
||||
"Mr. Wilson",
|
||||
"Ms. Moore",
|
||||
"Dr. Taylor",
|
||||
"Mrs. Anderson",
|
||||
"Mr. Garcia",
|
||||
"Mrs. Martinez",
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export default function hideSensitiveContent() {
|
||||
@@ -214,4 +379,4 @@ export default function hideSensitiveContent() {
|
||||
action(element);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user