Файл: mscasino/casino-0.1.js
Строк: 80
<?php
var app = {
duration: 3000,
rollRubies: function (uid, result) {
app.feedback(null);
var btn = $('#playTheGame');
btn.after('<span style="position:absolute; top: 0; left: 0; right:0; bottom: 0;" class="btnl" id="fakePlayTheGame">' + btn.html() + '</span>');
var ids = [];
$('.tablo').html('<span class="tabloimg"></span>');
for (var i = 0; i < 120 + result + 1; i++) {
ids.push(i % 10);
}
for (var i = 0; i < ids.length; i++) {
$('.tabloimg').append('<img width="220" height="146" style="display: block;" src="/img/casino/' + ids[i] + '.jpg">');
}
$(".tabloimg").stop().animate({
marginTop: '-' + ((120 + result) * 146)
}, this.duration, function() {
$('#fakePlayTheGame').detach();
$.ajax({
url: "/cs",
data: {
uid: uid
},
timeout: 1000,
type: "GET",
cache: false,
dataType: "text",
success: function(data) {
var arr = data.split('|');
if(arr.length == 2) {
$('#casino_jackPot').html(arr[1]);
$('#casino_rubies').html(arr[0]);
}
}
});
});
},
rollCoins: function (options, result) {
app.feedback(null);
var btn = $('#playTheGame');
btn.after('<span style="position:absolute; top: 0; left: 0; right:0; bottom: 0;" class="btnl" id="fakePlayTheGame">' + btn.html() + '</span>');
var ids = [];
$('.tablo').html('<span class="tabloimg"></span>');
for (var i = 0; i < options.length * 12 + result + 1; i++) {
ids.push(i % options.length);
}
for (var i = 0; i < ids.length; i++) {
html = options[ids[i]];
if(html == 'JACKPOT') {
html = '<img src="/img/casino/jackpot_coins.png" width="220" height="146" style="position: absolute; left:0; top:0;">';
} else if(ids[i] == 0) {
html = '<img src="/img/casino/0.jpg" width="220" height="146" style="position: absolute; left:0; top:0;">';
} else {
html = '<div style="font-family: Tahoma, Verdana, Arial, Sans-Serif; font-size: 36pt; font-weight: bold; color: white; position: absolute; left:0; right:0; top: 44px;">' + html + '</div>';
}
$('.tabloimg').append('<div style="position: relative"><img src="/img/casino/game_green_bg.jpg" width="220" height="146"><img width="220" height="146" style="display: block; position: absolute; top: 0;" src="/img/casino/coin.png">' + html + '</div>');
}
$(".tabloimg").stop().animate({
marginTop: '-' + ((options.length * 12 + result) * 146)
}, this.duration, function() {
$('#fakePlayTheGame').detach();
});
},
feedback: function(txt) {
if(txt)
$('#casinoFeedbackPanel').html('<div class="feedback">' + txt + '</div>');
else
$('#casinoFeedbackPanel').html('');
}
}
?>