Skip to content

Commit d0a7b0a

Browse files
committed
추천인 보기 추가
1 parent 75f4e4b commit d0a7b0a

File tree

5 files changed

+109
-1
lines changed

5 files changed

+109
-1
lines changed

css/mbs.css

+24
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,30 @@ table[width="660"] td[width="510"][height="50"]{padding-top:10px;}
6060
table[width="660"] td[width="510"][height="50"] td a {margin:0 5px;}
6161

6262
/* view */
63+
td.D11[width="117"] {width:70px !important;}
64+
td.D11[width="117"] > a {display:none;}
65+
td.D11[width="117"] #recom_pop {display:none;}
66+
td.D11[width="76"] {text-align:right;}
67+
#viewVoter {float:right;padding:4px 10px 3px;color:#666;background:#fff;border-width:1px;border-style:solid;border-color:#e6e6e6 #ddd #bcbcbc;border-radius:3px;background-image:-webkit-linear-gradient(top,#fff,#f3f3f3 94%, #fff);box-shadow:0 1px 1px rgba(0,0,0,.02);font-family:Dotum;letter-spacing:-1px;text-shadow:0 1px 0 #fff;cursor:pointer;}
68+
#voterList {display:none;position:absolute;top:35px;z-index:100;right:5px;padding:3px;width:170px;background:#fff;border:1px solid #ffa500;border-radius:5px;box-shadow:rgba(0,0,0,.1) 1px 1px 1px;cursor:default;}
69+
#voterList.show {display:block;}
70+
#voterList .voterListHead {position:relative;padding:5px;margin-bottom:3px;border-bottom:1px solid #ddd;}
71+
#voterList .voterListHead h3 {color:#5a5a5a;}
72+
#voterList ol {min-height:50px;max-height:300px;overflow-x:hidden;overflow-y:auto;padding:3px 0;counter-reset:item;}
73+
#voterList ol:empty {text-align:center;}
74+
#voterList ol:empty:before {content:"";width:10px;height:10px;position:relative;margin:13px auto 0;display:inline-block;-webkit-animation:rotateit .5s linear infinite;border:2px solid #ccc;border-top-color:#888;border-radius:50%;}
75+
#voterList ol::-webkit-scrollbar {width:8px;}
76+
#voterList ol::-webkit-scrollbar-button {display:none;}
77+
#voterList ol::-webkit-scrollbar-thumb {background:#f6f6f6;margin:3px;border-radius:3px;border:1px solid #ddd;}
78+
#voterList li {position:relative;padding:1px 5px 1px 30px !important;color:#666;word-break:break-all;white-space:pre-wrap;}
79+
#voterList li:before {width:22px;position:absolute;left:0;content:counter(item);counter-increment:item;display:inline-block;text-align:right;}
80+
#voterList li:hover {background-color:#fafafa;}
81+
#voterList li.blockUser {color:#fe4100;}
82+
#voterList li.emptyMsg {padding:13px 0 0 !important;text-align:center;color:#999;letter-spacing:-1px;}
83+
#voterList li.emptyMsg:before {display:none;}
84+
#voterList li.emptyMsg:hover {background:none;}
85+
#voterListClose {position:absolute;top:4px;right:3px;display:block;width:15px;height:15px;overflow:hidden;text-indent:-9999px;background:url('chrome-extension://__MSG_@@extension_id__/images/close_thin.png') no-repeat 50% 50%;cursor:pointer;}
86+
6387
td[width="687"] > table[width="702"]:nth-child(4) td[height="44"] {border-top:1px solid #ccc;border-bottom:1px solid #eee;}
6488
#container > table[width="980"] > tbody > tr[valign=top] > td[width="687"] > table[width="702"]:nth-child(4) > tbody > tr:nth-child(3) > td[background] {padding-top:5px;background:#f8f8f8 !important;border:1px solid #eee; !important;}
6589
td[width="687"] > table[width="702"] > tbody > tr:nth-child(3) table[width="702"] {width:100% !important;}

images/close_thin.png

1.12 KB
Loading

javascripts/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ chrome.extension.sendMessage({action:'width'}, function(response) {
1313

1414
//user toolbox remove
1515
doc.onclick = function(){
16-
var userMenu = doc.querySelectorAll('div[id^="nik_"]');
16+
var userMenu = doc.querySelectorAll('div[id^="nik_"], #voterList');
1717
for (var i = 0, userMenuLen = userMenu.length; i < userMenuLen; i++){
1818
userMenu[i].style.display = 'none';
1919
}

javascripts/mbs.js

+83
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,89 @@ chrome.extension.sendMessage({action:'mbs'}, function(response) {
483483
}
484484
}
485485
commentUser();
486+
487+
// View voter
488+
(function viewVoter(){
489+
var voterGroud = doc.querySelector('td.D11[width="117"]');
490+
491+
var child;
492+
while (child = voterGroud.lastChild) {
493+
voterGroud.removeChild(child);
494+
}
495+
496+
var voterListFrag = doc.createDocumentFragment();
497+
498+
var viewVoterBtn = doc.createElement('span');
499+
viewVoterBtn.id = 'viewVoter';
500+
viewVoterBtn.innerText = '추천인 보기';
501+
502+
var voterList = doc.createElement('div');
503+
voterList.id = 'voterList';
504+
voterList.style.display = 'none';
505+
voterList.addEventListener('click',function(e){
506+
e.stopPropagation();
507+
});
508+
509+
var voterListHead = doc.createElement('header');
510+
voterListHead.className = 'voterListHead';
511+
512+
var voterListHeadding = doc.createElement('h3');
513+
voterListHeadding.innerText = '추천한 사람들';
514+
515+
var voterListClose = doc.createElement('span');
516+
voterListClose.id = 'voterListClose';
517+
voterListClose.innerText = 'X';
518+
voterListClose.addEventListener('click', function(){
519+
voterList.style.display = 'none';
520+
});
521+
522+
var voterOl = doc.createElement('ol');
523+
524+
voterListHead.appendChild(voterListHeadding);
525+
voterListHead.appendChild(voterListClose);
526+
voterList.appendChild(voterListHead);
527+
voterList.appendChild(voterOl);
528+
529+
voterListFrag.appendChild(viewVoterBtn);
530+
voterListFrag.appendChild(voterList);
531+
532+
voterGroud.appendChild(voterListFrag);
533+
534+
viewVoterBtn.addEventListener('click', function(e){
535+
e.stopPropagation();
536+
if (voterOl.childElementCount == 0) {
537+
$.ajax({
538+
type: 'GET',
539+
url: 'http://mlbpark.donga.com/mbs/articleVoteList.php?bbs='+ mbsC +'&article_id=' + mbsIdx,
540+
async: true,
541+
cache: false,
542+
success: function(data){
543+
if(data === ''){
544+
var emptyMsg = doc.createElement('li');
545+
emptyMsg.className = 'emptyMsg';
546+
emptyMsg.innerText = '아직 추천한 사람이 없습니다';
547+
voterOl.appendChild(emptyMsg);
548+
} else {
549+
voterOl.innerHTML = data;
550+
if (opt_userBlock == '1') {
551+
var voterListLi = voterOl.querySelectorAll('li');
552+
for(var x = 0, len = voterListLi.length; x < len; x++){
553+
var t = voterListLi[x];
554+
for (var i = 0; i < opt_userBlockKeywordsLen; i++) {
555+
if(t.innerText === opt_userBlockKeywords[i]){
556+
t.className = 'blockUser';
557+
break;
558+
}
559+
}
560+
}
561+
}
562+
}
563+
}
564+
});
565+
}
566+
voterList.style.display = 'block';
567+
});
568+
}());
486569
}
487570

488571
//text URL replacement

manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"images/btn_reply.png",
122122
"images/check.png",
123123
"images/close.png",
124+
"images/close_thin.png",
124125
"images/cmtLoader.gif",
125126
"images/comment.png",
126127
"images/icon.png",

0 commit comments

Comments
 (0)