-
Notifications
You must be signed in to change notification settings - Fork 1
/
CopyItem.js
57 lines (50 loc) · 1.66 KB
/
CopyItem.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
let defaults={
gcMaxTweak:true,
gcFilterTweak:true,
gcScrollBarTweak:true,
dbAddDownloadAll:true,
dlAssignmentsShowAll:true,
userShowAll:true,
needsGradingShowAll:true,
poolQuestionsShowAll:true,
gradeQuestionsShowAll:true,
fixPaste:true,
addDisableUsers:true,
hideRemoveUsers:true,
gcEnableDisableUsers:true,
gcEnableScrollOnTable:true,
gradingAddStudentIDs:true,
gradeDetailsShowJumpTo:true,
gcHoverAddedDate:true,
gcCopyUsernames:true,
gcDeleteUsers:true,
gcHideBulkUsers:true,
copyItemSearchCourses:true,
addCourseSwitch:true,
gcCopyUsernamesDel:'; ',
gcHScrollSensitivity:100,
gcVScrollSensitivity:100
};
browser.storage.sync.get(defaults).then(function(options){
/*
*/
var script = document.createElement("script");
if(options.gradingAddStudentIDs){
script.innerHTML = `
jQuery(document).ready(()=>{
let select2Script = document.createElement("script");
let select2Css = document.createElement("link");
select2Script.type="text/javascript";
select2Script.src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js";
select2Css.href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css";
select2Css.rel="stylesheet";
document.head.appendChild(select2Script);
document.head.appendChild(select2Css);
select2Script.onload = ()=>{
jQuery("#destCourse").chosen();
}
});
`;
}
document.body.appendChild(script);
});