Guest User

Untitled

a guest
Jan 26th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.49 KB | None | 0 0
  1. // ==UserScript==
  2. // @name 2chDigitGayCaptcha
  3. // @description Цифровая капча для 2ch, с костылём
  4. // @include https://2ch.hk/*
  5. // @include http://2ch.hk/*
  6. // @version 1.0.4
  7. // @grant none
  8. // @namespace mynigga
  9. // ==/UserScript==
  10.  
  11. function inject(code)
  12. {
  13.   let script = document.createElement("script");
  14.   script.innerHTML = "(" + code.toSource() + ")();";
  15.   document.head.appendChild(script);
  16. }
  17.  
  18. function stuff() {
  19.   $(document).ready(function () {
  20.     window.requestCaptchaKey = window.requestCaptchaKey2ch;
  21.     window.loadCaptcha = window.loadCaptcha2ch;
  22.     window.CustomLoadCaptcha = function() {
  23.       $('input[name="2chaptcha_value"]').val('').focus();
  24.       loadCaptcha();
  25.       return false;
  26.     }
  27.     $('input[name="captcha_type"]').val('2chaptcha');
  28.     $('.captcha-box').empty()
  29.     .append('<div class="captcha-image captcha-reload-button" onclick="CustomLoadCaptcha();"></div>')
  30.     .append('<input name="2chaptcha_id" class="captcha-key" type="hidden">')
  31.     .append('<input name="2chaptcha_value" id="captcha-value" type="text" autocomplete="off" maxlength="6">');
  32.     $('#postform .captcha-image').attr('style','background: rgba(0,0,0,0.025); width: 221px; height: 91px;');
  33.     $('#postform textarea[name="comment"]').attr('tabindex','1');
  34.     $('#postform #captcha-value').attr('tabindex','2');
  35.     $('#qr-postform textarea[name="comment"]').attr('tabindex','3');
  36.     $('#qr-postform #captcha-value').attr('tabindex','4');
  37.   });
  38. }
  39.  
  40. inject(stuff);
Advertisement
Add Comment
Please, Sign In to add comment