@@ -483,6 +483,89 @@ chrome.extension.sendMessage({action:'mbs'}, function(response) {
483
483
}
484
484
}
485
485
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
+ } ( ) ) ;
486
569
}
487
570
488
571
//text URL replacement
0 commit comments