Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- 'use strict';
- function genCode() {
- var code = 'DMR-' + Math.floor(1000 + Math.random() * 9000);
- $('.verify-code span').append(code)
- }
- function verify(user, code) {
- $.get('https://www.habbo.com.br/api/public/users', {
- name: user,
- cache: false
- }).done(function (res) {
- if (res.motto.toUpperCase().indexOf(code) != -1) {
- $('#verify-user').remove();
- $('.submit-buttons').append('<input class="button1" type="submit" name="submit" value="Continuar">');
- return
- }
- $('.verify-motto').text('Código não encontrado. Tente novamente!');
- $('.verify-motto').css('background-color', '#E54732');
- return
- }).fail(function () {
- $('.verify-motto').text('Este usuário não existe. Tente novamente!');
- $('.verify-motto').css('background-color', '#E54732');
- return
- })
- }
- $(function () {
- if (_userdata["session_logged_in"] === 1) {
- return
- }
- if (!((/^\/register/i.test(location.pathname)) && (/^\?step\=2.*$/i.test(location.search)))) {
- return
- }
- var $fieldset = $('.submit-buttons');
- $fieldset.find('input').remove();
- $fieldset.append('<div id="verify-user">' + '<div class="verify-code">Coloque esse código na sua missão: <span></span></div>' + '<a href="javascript:void(0);" class="verify-motto">Verificar</a>' + '</div>');
- genCode();
- $('.verify-motto').on('click', function () {
- $(this).text('Verificando...');
- $(this).css('background-color', '#2e3133');
- var inputUser = $('#username_reg').val();
- var userCode = $('.verify-code span').text();
- verify(inputUser, userCode)
- });
- $('<style>', {
- 'text': ['#verify-user {', ' width: 70%;', ' margin: auto;', ' text-align: center;', '}', '', '.verify-code {', ' font-size: 18px;', ' margin-bottom: 20px;', ' background-color: #0062cc;', ' color: #fff;', ' padding: 10px;', '}', '', '.verify-code span {', ' font-weight: 700;', ' text-decoration: underline;', '}', '', '.verify-motto {', ' background-color: #5CCD5C;', ' color: #FFF!important;', ' border-radius: 3px;', ' box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.2), 0 1px 5px 0 rgba(0,0,0,0.12);', ' font-size: 15px;', ' padding: 10px 24px;', ' transition: ease .2s;', '}', '', '.verify-motto:hover {', ' -ms-filter: brightness(90%);', ' -webkit-filter: brightness(90%);', ' filter: brightness(90%);', ' background-color: #3abc3a;', '}'].join('')
- }).appendTo('head')
- })
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement