Skip to content

Commit

Permalink
Update dbt240115, Display online classes
Browse files Browse the repository at this point in the history
  • Loading branch information
beomkm committed Jan 15, 2024
1 parent f434884 commit c60ccf2
Show file tree
Hide file tree
Showing 7 changed files with 810 additions and 812 deletions.
791 changes: 0 additions & 791 deletions dbt/dbt230721.jsd

This file was deleted.

786 changes: 786 additions & 0 deletions dbt/dbt240115.jsd

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script type="text/javascript" src="js/envcheck.js?v=5"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="libs/dhtmlx/codebase/dhtmlxgrid.js"></script>
<script type="text/javascript" src="dbt/dbt230721.jsd?v=1"></script>
<script type="text/javascript" src="dbt/dbt240115.jsd?v=3"></script>
<script type="text/javascript" src="js/util.js?v=4"></script>
<script type="text/javascript" src="js/canvas.js?v=3"></script>
<script type="text/javascript" src="js/index.js?v=5"></script>
Expand Down Expand Up @@ -70,8 +70,8 @@

<div id="header">
<img src="png/orange.png" width="140" height="auto">
<br/><b>데이터 갱신일 : 2023-07-24 08:00</b>
<br/><b><a href="https://www.koreatech.ac.kr/kor/CMS/NoticeMgr/view.do?mCode=MN233&post_seq=1161&board_id=16">[링크] 학사공지 바로가기</a></b>
<br/><b>데이터 갱신일 : 2024-01-15 22:40</b>
<br/><b><a href="https://www.koreatech.ac.kr/kor/CMS/NoticeMgr/view.do?mCode=MN233&post_seq=1289&board_id=16">[링크] 학사공지 바로가기</a></b>
</div>

<div id="gridBox">
Expand Down
4 changes: 0 additions & 4 deletions info.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<br/>
카카오톡 : <a href="http://plus.kakao.com/home/@hanpyo" target="_blank"> @hanpyo</a>
<br/>
페이스북 : <a href="https://www.facebook.com/hanpyonotice" target="_blank"> 바로가기</a>
<br/>
메일 : [email protected]
<br/>

<br/><b>Current Contributors</b>
<br/> - <a href="https://github.com/tibyte" target="_blank">@tibyte (Beomyeong Kim)</a>
Expand Down
2 changes: 1 addition & 1 deletion js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function drawCartList(ctx, db, list)
ctx.strokeStyle="#000000";
ctx.lineWidth=1.0;
ctx.strokeRect(xs, ys, W_C, height);
var text = sbj[D_KOR] + "\n" + sbj[D_CLS];
var text = (times[j][2] ? "(온)" : "") + sbj[D_KOR] + "\n" + sbj[D_CLS];
if(proFlag) text += " " + sbj[D_PRO];
drawTextBox(ctx, text, xs+2, ys+20, W_C-4);
}
Expand Down
15 changes: 9 additions & 6 deletions js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,18 @@ function mergeNum(arr)
if(arr.length == 0)
return [];

var result = [[arr[0],1]];
var prev = arr[0];
const times = arr.map(x => parseInt(x));
const isOnlines = arr.map(x => x.search("o") != -1);

for(var i=1; i<arr.length; i++) {
if(arr[i]-prev == 1)
var result = [[times[0], 1, isOnlines[0]]];
var prev = times[0];

for(var i=1; i<times.length; i++) {
if(times[i]-prev == 1)
++result[result.length-1][1];
else
result.push([arr[i], 1]);
prev = arr[i];
result.push([times[i], 1, isOnlines[i]]);
prev = times[i];
}
return result;
}
Expand Down
18 changes: 11 additions & 7 deletions tools/dbgen5_excel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@
"과목코드",
"교과목명",
"분반",
"수강신청\r\n가능학년",
"수강신청 가능학년",
"강의실",
"학\r\n점",
"설\r\n계",
// "학점",
// "설계",
"개설학부(과)",
"담당교수",
"수정\r\n정원",
// "수강정원",
// "수정\r\n정원",
"수강\r\n정원",
]

let subjectInfo = "[";
Expand All @@ -73,6 +73,10 @@
var unit = str.split(",");
let lastDay = "";
for(var j=0; j<unit.length; j++) {
let isOnline = false;
if(unit[j].search("(온라인)") != -1) {
isOnline = true;
}
unit[j] = unit[j].replaceAll("(온라인)", "");
if(unit[j].length == 8) {
var startStr = unit[j].substr(1,3);
Expand All @@ -81,7 +85,7 @@
var endTime = DAY_TIME[unit[j].charAt(0)] + 2*(parseInt(endStr.substr(0,2))-1) + AB_TIME[endStr.charAt(2)];

for(var k=startTime; k<=endTime; k++) {
subjectInfo += k + ",";
subjectInfo += `"${k}${(isOnline?"o":"")}"` + ",";
}
lastDay = unit[j].charAt(0);
}
Expand All @@ -92,18 +96,18 @@
let endTime = DAY_TIME[lastDay] + 2*(parseInt(endStr.substr(0,2))-1) + AB_TIME[endStr.charAt(2)];

for(let k=startTime; k<=endTime; k++) {
subjectInfo += k + ",";
subjectInfo += `"${k}${(isOnline?"o":"")}"` + ",";
}
}
else if (lastDay != "" && unit[j].length == 3) {
let startStr = unit[j].substr(0,3);
let startTime = DAY_TIME[lastDay] + 2*(parseInt(startStr.substr(0,2))-1) + AB_TIME[startStr.charAt(2)];
subjectInfo += startTime + ",";
subjectInfo += `"${startTime}${(isOnline?"o":"")}"` + ",";
}
else if(unit[j].length == 4) {
var startStr = unit[j].substr(1,3);
var startTime = DAY_TIME[unit[j].charAt(0)] + 2*(parseInt(startStr.substr(0,2))-1) + AB_TIME[startStr.charAt(2)];
subjectInfo += startTime + ",";
subjectInfo += `"${startTime}${(isOnline?"o":"")}"` + ",";
}
else {
console.log(row);
Expand Down

0 comments on commit c60ccf2

Please sign in to comment.