Custom Styles Kaskus

custom tampilan kaskus + bukan Quick Reply

  1. // ==UserScript==
  2. // @name Custom Styles Kaskus
  3. // @description custom tampilan kaskus + bukan Quick Reply
  4. // @author ndi
  5. // @version 1.3.2
  6. // @compatible Greasemonkey
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
  8. // @grant GM_addStyle
  9. // @include *.kaskus.co.id/*
  10. // @exclude *.kaskus.co.id
  11. // @exclude *.kaskus.co.id/
  12. // @exclude *.kaskus.co.id/forum
  13. // @exclude *.kaskus.co.id/myforum
  14. // @exclude *.kaskus.co.id/fjb
  15. // @exclude *infokost.kaskus.co.id/
  16. // @exclude *.kaskus.co.id/group
  17. // @namespace https://greasyfork.org/en/scripts/7732-custom-styles-kaskus
  18. // ==/UserScript==
  19.  
  20. $(function(){
  21. var tom = $('a.btn:contains("Post Reply"), a.btn:contains("Reply")');
  22. var lin = tom.attr('href');
  23. var mg = document.createElement('div');
  24. mg.setAttribute('id','form-replei');
  25. document.body.appendChild(mg);
  26. mg.innerHTML = ''
  27. +'<div class="repl">'
  28. +'<a class="tutup thumbnail-close" style="position:relative"></a>'
  29. +'<iframe id="fram" scrolling="auto" name="myFram" src="'+lin+'"></iframe>'
  30. +'</div>';
  31.  
  32. GM_addStyle(''
  33. //kuik replei
  34. +'#form-replei{display:none;width:100%;height:100%;background:rgba(0,0,0,0.6);position:fixed; top:0;z-index:999;overflow:hidden}'
  35. +'.repl{width:700px;height:550px;margin:30px auto 0;background:#e4e4e4}'
  36. +'.tutup{float:right;top:0;right:0;cursor:pointer;}'
  37. +'#fram{width:100%;height:100%;border:0}'
  38. //kaskus
  39. +'body{background:#e3e3e3}'
  40. +'.navbar{background:#eee;border-bottom:1px solid #fff}'
  41. +'.related-thread, .sidebar-wrap,.ads-lb-wrap{display:none;}'
  42. +'.main-content{width:100%}'
  43. +'.container{width:1024px !important}'
  44. +'.user-control-stick{width:1024px}'
  45. +'.post-entry td.icon{width:50px}'
  46. +'body.response #thread_post_list .row.nor-post .postlist .entry-body{width:890px}'
  47. +'body.response #thread_post_list .row.nor-post .postlist .author{width:130px}'
  48. +'body.response #thread_post_list .row.nor-post .postlist .author figure{width:110px;height:110px}'
  49. +'body.response #thread_post_list .row.nor-post .postlist .user-avatar{width:110px;height:110px;border:0}'
  50. +'body.response #thread_post_list .row.nor-post .postlist .author .photo{max-width:110px;max-height:110px}'
  51. );
  52.  
  53. tom.delay(1000).removeAttr('href');
  54. $('.listing-table .post-title a').attr('target','_blank');//open thread new tab
  55. $('.tutup').click(function(){$('#form-replei').css('display','none');});
  56.  
  57. $(document).keypress('z',function (e) {
  58. if(e.ctrlKey){
  59. tom.click();
  60. return false;
  61. }
  62. });
  63.  
  64. tom.click(function(e){
  65. e.preventDefault();
  66. csss();
  67. var ifr = $('#fram').contents();
  68. ifr.find('textarea#reply-messsage').focus();
  69. var ifra = ifr.find('#button-reply');
  70.  
  71. ifra.click(function(){
  72. var set = setInterval(function(){
  73. var reff = $('#fram').contents().find('.message a').attr('href');
  74. if (reff.length){
  75. top.location.href=''+reff+'';
  76. clearInterval(set);
  77. }
  78. else {
  79. csss();
  80. var ifr = $('#fram').contents();
  81. ifr.find('input#recaptcha_response_field').focus();
  82. }
  83. },2000);
  84. })
  85.  
  86. });
  87.  
  88. function csss(){
  89. var ifr = $('#fram').contents(),
  90. fg2 = ifr.find('.form-group:nth-child(2)'),
  91. fg3 = ifr.find('.form-group:nth-child(3)'),
  92. fg4 = ifr.find('.form-group:nth-child(4)'),
  93. fg5 = ifr.find('.form-group:nth-child(5)'),
  94. fgac = ifr.find('.actions');
  95. $('#form-replei').show();
  96. ifr.find('body').css('overflow-x','hidden');
  97. ifr.find(' #main .row:nth-child(-n+2), #feedback, .sidebar, .form-group:nth-child(3),.form-group:nth-child(4), .form-group:nth-child(n+7), .form-group:last-child, hr').css('display','none');
  98. ifr.find('header,.site-footer ,#preview-post,#floating_notice').remove();
  99. ifr.find('.reply-form, .main').css({'margin':'0','width':'680px','margin-left':'5px'});
  100. ifr.find('.main-content').css({'width':'680px'});
  101. ifr.find('.form-group').css('margin','0 0 5px');
  102. var txtLen = ifr.find('#txtLen').hasClass('Len');
  103. if(!txtLen){
  104. ifr.find('#txtLen').addClass('Len');
  105. ifr.find('#txtLen').after('<ul class="ul"><li class="smili"></li><li class="uplod"></li></ul>');
  106. ifr.find('.ul').css({'height':'20px','float':'right','list-style-type':'none'});
  107. ifr.find('.smili').addClass('btn-orange').text('Smiley').css({'margin':'5px 5px 0 0','padding':'0 5px','float':'left','cursor':'pointer'});
  108. ifr.find('.uplod').addClass('btn-orange').text('Upload').css({'margin-top':'5px','padding':'0 5px','float':'left','cursor':'pointer'})
  109. ifr.find('.smili').click(function(){
  110. ifr.find('html,body').animate({scrollTop:550});
  111. fg3.toggle();
  112. ifr.find('.opensmilies').css('right','40px').after('<div class="thumbnail-close smil" style="margin-right:10px;margin-top:10px;cursor:pointer" title="close smiley"/>');
  113. ifr.find('.smil').click(function(){fg3.css('display','none')});
  114. });
  115. ifr.find('.uplod').click(function(){
  116. var liUpd = ifr.find('.form-group:nth-child(4) .control-label,.form-group:nth-child(4) .col-xs-10');
  117. ifr.find('html,body').animate({scrollTop:550});
  118. fg4.toggle();
  119. fg4.css('padding','10px');
  120. ifr.find('.form-group:nth-child(4)').html('<div id="upd"/>');
  121. ifr.find('#upd').append(liUpd);
  122. ifr.find('.form-group:nth-child(4) .col-xs-10').prepend('<div class="thumbnail-close tupUpl" style="margin-right:5px;margin-top:5px;cursor:pointer" title="close uploader"/>')
  123. ifr.find('#upd').css({'border':'1px solid #d4d4d4','padding':'5px','overflow':'hidden'});
  124. ifr.find('.tupUpl').click(function(){fg4.css('display','none')});
  125. });
  126. }
  127. }
  128. //end
  129. })();