Code
$(window)
.load(function() {
function init_hclone() {
var path = window.location.pathname;
if (path == '/hotel') {
if ($('.habboclone-ext')
.length == 0) {
$('body')
.append('<div class="habboclone-ext"><input type="text" placeholder="User..."/> <select><option value="M">Male</option><option value="F">Female</option></select><input type="button" value="Clone"/>');
//<footer>Developed by <a href="http://twitter.com/DevJoaquin" target="_blank">@DevJoaquin</a></footer></div>');
$('.habboclone-ext > input[type="button"]')
.click(function() {
/* Habbo Look Clone - By @DevJoaquin (Joaquin A.) */
var user = $('.habboclone-ext > input[type="text"]')
.val(),
gender = $('.habboclone-ext > select')
.val();
if (!user || !gender) return;
$.get('/api/public/users', {
name: user
}, function(data) {
if (!data) return;
$.post('/api/user/look/save', {
figure: data.figureString,
gender: gender
}, function(resp) {
// alert('Changes saved!');
$('.habboclone-ext > input[type="text"]')
.val('');
console.log(resp);
});
});
});
}
} else {
$('.habboclone-ext')
.remove();
}
}
var observer = new MutationObserver(function(mutations, observer) {
init_hclone();
});
observer.observe(document, {
subtree: true,
attributes: true
});
});
Alles anzeigen
Du hast doch nicht einmal n Plan wie das Ding funktioniert...