Skip to content

Commit

Permalink
fix selector
Browse files Browse the repository at this point in the history
  • Loading branch information
joont92 committed Sep 20, 2020
1 parent 7c7e181 commit 82ae5e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function injectJs(srcFile) {
document.getElementsByTagName('head')[0].appendChild(scr);
}

var dsturl1 = "https://etk.srail.co.kr/hpg/hra/01/selectScheduleList.do?pageId=TK0101010000";
var dsturl1 = "https://etk.srail.kr/hpg/hra/01/selectScheduleList.do?pageId=TK0101010000";

if (document.URL.substring(0, dsturl1.length) == dsturl1) {

Expand All @@ -19,9 +19,9 @@ if (document.URL.substring(0, dsturl1.length) == dsturl1) {
console.log("first:" + firstSelected);

if (sessionStorage.getItem('macro') == "true") {
$("div.button").append('<a href="#" onclick="macrostop();" style="margin-left:5px;"><img src="' + chrome.extension.getURL('images/btn_stop.png') + '"></a>');
$("#search-list").append('<a href="#" onclick="macrostop();" style="margin-left:5px;"><img src="' + chrome.extension.getURL('images/btn_stop.png') + '"></a>');
} else {
$("div.button").append('<a href="#" onclick="macro();" style="margin-left:5px;"><img src="' + chrome.extension.getURL('images/btn_start.png') + '"></a>');
$("#search-list").append('<a href="#" onclick="macro();" style="margin-left:5px;"><img src="' + chrome.extension.getURL('images/btn_start.png') + '"></a>');
}

$("<style>")
Expand Down Expand Up @@ -69,17 +69,17 @@ if (document.URL.substring(0, dsturl1.length) == dsturl1) {

var succeed = false;
for (i = 1; i < rows.length; i++) {
var columns = $(rows[i]).children('td');
var columns = $(rows[i]).children('td');

var first = $(columns[5]);
var coach = $(columns[6]);
var coach = $(columns[6]);

if (coachSelected.indexOf(i+"") > -1) {
var coachSpecials = coach.children("a");
var coachSpecials = coach.children("a");
if (coachSpecials.length != 0) {
for (j = 0; j < coachSpecials.length; j++) {
name = $(coachSpecials[j]).attr('class');
if (name == 'button button-02') {
name = $(coachSpecials[j]).attr('class');
if (name == 'btn_small btn_burgundy_dark val_m wx90') {
$(coachSpecials[0])[0].click();
succeed = true;
break;
Expand All @@ -94,7 +94,7 @@ if (document.URL.substring(0, dsturl1.length) == dsturl1) {
if (firstSpecials.length != 0) {
for (j = 0; j < firstSpecials.length; j++) {
name = $(firstSpecials[j]).attr('class');
if (name == 'button button-02') {
if (name == 'btn_small btn_burgundy_dark val_m wx90') {
$(firstSpecials[0])[0].click();
succeed = true;
break;
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"description": "SRT 자동 예약 매크로",
"version": "1.0.1",
"permissions": [
"https://etk.srail.co.kr/"
"https://etk.srail.kr/"
],
"icons": {
"128": "images/icon128.png"
},
"content_scripts": [ {
"all_frames": true,
"js": ["jquery-1.11.0.min.js", "content.js"],
"matches": ["https://etk.srail.co.kr/*"],
"matches": ["https://etk.srail.kr/*"],
"run_at": "document_end"
}],
"background": {
Expand Down

0 comments on commit 82ae5e2

Please sign in to comment.