add
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,833 @@
|
||||
var userid = parseInt($('#userid').val());
|
||||
var login_token = $('#login_token').val();
|
||||
var table_id = parseInt($('#table_id').val());
|
||||
var game_id = parseInt($('#game_id').val());
|
||||
var account = $('#account').val();
|
||||
var number_tab_id;
|
||||
var ludan;
|
||||
var isCBoot = false;
|
||||
var isopentime = false;
|
||||
var num = 0;
|
||||
var card_info=[];
|
||||
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?table_id="+table_id+"&account="+account+"&connect=space&userid="+userid+"&login_token="+login_token,{transports: ['websocket']});
|
||||
websocket.on('reconnecting', (timeout) => {
|
||||
//触发重连
|
||||
layer.msg('服务断开,正在重新连接...', {
|
||||
icon: 16,
|
||||
shade: 0.6,
|
||||
time:0,
|
||||
});
|
||||
});
|
||||
websocket.on('reconnect', (timeout) => {
|
||||
//重连成功
|
||||
layer.closeAll();
|
||||
layer.msg('服务重新连接成功');
|
||||
});
|
||||
//事件 发送*******************************************************************************************************************
|
||||
var startBet = function(){
|
||||
websocket.emit('startBet',{table_id : table_id, number_tab_id : number_tab_id});
|
||||
};
|
||||
var endBet = function (){
|
||||
websocket.emit('endBet',{table_id : table_id, number_tab_id : number_tab_id});
|
||||
};
|
||||
var resetNumberTab = function(){
|
||||
isCBoot = true;
|
||||
var betStatus = $("#number_tab_status").val();
|
||||
if(betStatus == 1 || betStatus == 2){
|
||||
layer.confirm(lang.is_reset_number,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
websocket.emit('resetNumberTab',{table_id : table_id});
|
||||
isCBoot = false;
|
||||
layer.close(index);
|
||||
$('#dice_item_1 img').attr("src", '/static/handle/img/dice0.png');
|
||||
$('#dice_item_2 img').attr("src", '/static/handle/img/dice0.png');
|
||||
$('#dice_item_3 img').attr("src", '/static/handle/img/dice0.png');
|
||||
hideDiceBox();
|
||||
},function(index){
|
||||
isCBoot = false;
|
||||
});
|
||||
}else{
|
||||
layer.msg(lang.reset_number_fail);
|
||||
}
|
||||
};
|
||||
var changeBoot = function(){
|
||||
isCBoot = true;
|
||||
var betStatus = $("#number_tab_status").val();
|
||||
if(betStatus == 0 || betStatus == 3){
|
||||
layer.confirm(lang.is_to_boot,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
websocket.emit('changeBoot',{table_id : table_id});
|
||||
isCBoot = false;
|
||||
layer.close(index);
|
||||
},function(index){
|
||||
isCBoot = false;
|
||||
});
|
||||
}else{
|
||||
layer.msg(lang.change_boot_false);
|
||||
}
|
||||
};
|
||||
var resetBoot = function(){
|
||||
layer.confirm(lang.is_to_balance,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
websocket.emit('resetBoot',{table_id : table_id});
|
||||
layer.close(index);
|
||||
});
|
||||
};
|
||||
var opening = function(){
|
||||
$('.control-box .btn-box2 span').removeClass('on');
|
||||
let result = $('#dice_result').val();
|
||||
websocket.emit('openingDice',{table_id : table_id, number_tab_id : number_tab_id, result : result});
|
||||
};
|
||||
// 骰宝显示
|
||||
var showDiceBox = function (){
|
||||
$('#dice_box').fadeIn();
|
||||
}
|
||||
var hideDiceBox = function (){
|
||||
$('#dice_box').addClass('flicker');
|
||||
$('#dice_box').fadeOut(2400,'linear',function(){
|
||||
$('#dice_result').val("");
|
||||
$('#dice_box').removeClass('flicker');
|
||||
$('#dice_item_1 img').attr("src", '/static/handle/img/dice0.png');
|
||||
$('#dice_item_2 img').attr("src", '/static/handle/img/dice0.png');
|
||||
$('#dice_item_3 img').attr("src", '/static/handle/img/dice0.png');
|
||||
});
|
||||
}
|
||||
//事件 发送*******************************************************************************************************************
|
||||
//事件返回*********************************************************************************************************************
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if (data.table_id === table_id) {
|
||||
if(data.status === true){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
waybillFunc();
|
||||
}else{
|
||||
layer.msg(lang[data.msg],{time:0});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
websocket.on('RepeatedEntry',function(data){
|
||||
websocket.close();
|
||||
layer.msg(lang[data.msg]);
|
||||
setTimeout(function (){
|
||||
window.location.href='/login/logout';
|
||||
},2000);
|
||||
});
|
||||
websocket.on('startBet',function(data){
|
||||
if(data.status === true && data.table_id === table_id){
|
||||
mp3List = ['start.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('sendScanResult',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
if(game_id == 1 || game_id == 2){
|
||||
Flop(data);
|
||||
}else if(game_id==4||game_id==5){
|
||||
if(data.round.position == 0){
|
||||
flop_position(data);
|
||||
}else{
|
||||
flop_card(data);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('resetNumberTab',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
$(".begincard .box").animate({"opacity":"0"},function(){
|
||||
$(".begincard").fadeOut();
|
||||
|
||||
$(".table-info .nobegin-tip").fadeIn();
|
||||
$('.box1').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$('.box2').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$('.box3').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$('.box4').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$(".begincard .box .list .card").removeClass("begin")
|
||||
$(".begincard .card .topleft").html("")
|
||||
$(".begincard .card .bottomright").html("")
|
||||
$(".list .card .face").css("background-image","")
|
||||
$(".begincard .list .draw .rotate").css("display",'none');
|
||||
});
|
||||
card_info=[];
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('changeBoot',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
// clearBetAmount();
|
||||
waybillFunc();
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('resetBoot',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
waybillFunc();
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('startBetCountDown',function(data){
|
||||
if(data.status == true && data.table_id == table_id){
|
||||
countDown(data.count_down);
|
||||
}
|
||||
});
|
||||
websocket.on('endBet',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
mp3List = ['stop_2.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
if(game_id == 4 || game_id == 5){
|
||||
$(".banker_result").html('');
|
||||
$(".player_1_result").html('');
|
||||
$(".player_2_result").html('');
|
||||
$(".player_3_result").html('');
|
||||
}
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('openingDice',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
waybillFunc();
|
||||
hideDiceBox();
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
//事件返回*********************************************************************************************************************
|
||||
|
||||
//启动执行
|
||||
$(function(){
|
||||
getLang();
|
||||
//视频处理
|
||||
$("#video-iframe").attr("src",player+'?url='+flvUrl);
|
||||
$(document).keydown(function (e){
|
||||
if(e.keyCode == 13){
|
||||
|
||||
var cookieValue = $.cookie("enter_time");
|
||||
if(!cookieValue){
|
||||
$.cookie("enter_time", 1, { expires: 1/86400*3 });
|
||||
}else{
|
||||
layer.msg('Please hold on');
|
||||
return false
|
||||
}
|
||||
|
||||
if(isCBoot == true){
|
||||
$('.layui-layer-btn0').click();
|
||||
isCBoot = false;
|
||||
}else{
|
||||
//var keycode = $('#keycode').val();
|
||||
var numberTabStatus = $('#number_tab_status').val();
|
||||
//if(keycode == '6'){
|
||||
if (numberTabStatus == 0) {
|
||||
if(!isopentime){
|
||||
var is_rob = $('#is_rob').val();
|
||||
if(is_rob == 1){
|
||||
startRob();
|
||||
}else{
|
||||
startBet();
|
||||
}
|
||||
$('#keycode').val('');
|
||||
}else{
|
||||
layer.msg("请稍等!");
|
||||
}
|
||||
}else if (numberTabStatus == 2) {
|
||||
opening();
|
||||
}
|
||||
}
|
||||
}
|
||||
//开局
|
||||
if(e.keyCode == 111){
|
||||
$('#keycode').val('6');
|
||||
}
|
||||
//修改当前状态
|
||||
if(e.keyCode == 109){
|
||||
$('#update_ludan').toggle();
|
||||
}
|
||||
//换靴
|
||||
if(e.keyCode == 107){
|
||||
changeBoot();
|
||||
$('#keycode').val('');
|
||||
}
|
||||
//退出登录
|
||||
if(e.keyCode == 106){
|
||||
if(table_type == 1){
|
||||
cutout();
|
||||
$('#keycode').val('');
|
||||
}else{
|
||||
if(bet_type == 2){
|
||||
cutout();
|
||||
$('#keycode').val('');
|
||||
}else{
|
||||
loginout();
|
||||
$('#keycode').val('');
|
||||
}
|
||||
}
|
||||
}
|
||||
//取消
|
||||
if(e.keyCode == 110){
|
||||
$('.layui-layer-btn1').click();
|
||||
}
|
||||
// 停止倒计时
|
||||
if(e.keyCode == 96){
|
||||
if(game_id == 5 || game_id == 4){
|
||||
var number_rob_status=$("#number_rob_status").val();
|
||||
var number_tab_status=$("#number_tab_status").val();
|
||||
if((number_rob_status==1&&number_tab_status==0)||(number_rob_status==2&&number_tab_status==0)){
|
||||
endRob();
|
||||
}else{
|
||||
endBet();
|
||||
}
|
||||
}else{
|
||||
endBet();
|
||||
}
|
||||
}
|
||||
// 骰宝结果选择
|
||||
if (game_id == 7){
|
||||
console.log(e.keyCode);
|
||||
if (e.keyCode == 97 || e.keyCode == 98 || e.keyCode == 99 || e.keyCode == 100 || e.keyCode == 101 || e.keyCode == 102){
|
||||
var num = 0;
|
||||
switch (e.keyCode){
|
||||
case 97:
|
||||
num = 1;
|
||||
break;
|
||||
case 98:
|
||||
num = 2;
|
||||
break;
|
||||
case 99:
|
||||
num = 3;
|
||||
break;
|
||||
case 100:
|
||||
num = 4;
|
||||
break;
|
||||
case 101:
|
||||
num = 5;
|
||||
break;
|
||||
case 102:
|
||||
num = 6;
|
||||
break;
|
||||
}
|
||||
if (num > 0){
|
||||
var resultString = $('#dice_result').val();
|
||||
var resultArray = [];
|
||||
if (resultString != ''){
|
||||
resultArray = resultString.split(",");
|
||||
}
|
||||
if (resultArray.length < 3){
|
||||
resultArray.push(num);
|
||||
if (resultArray.length == 1){
|
||||
$('#dice_item_1 img').attr("src", '/static/handle/img/dice'+num+'.png');
|
||||
} else if (resultArray.length == 2) {
|
||||
$('#dice_item_2 img').attr("src", '/static/handle/img/dice'+num+'.png');
|
||||
} else if (resultArray.length == 3){
|
||||
$('#dice_item_3 img').attr("src", '/static/handle/img/dice'+num+'.png');
|
||||
}
|
||||
$('#dice_result').val(resultArray.join(","));
|
||||
}
|
||||
}
|
||||
} else if (e.keyCode == 109){
|
||||
$('#dice_result').val('');
|
||||
$('#dice_item_1 img').attr("src", '/static/handle/img/dice0.png');
|
||||
$('#dice_item_2 img').attr("src", '/static/handle/img/dice0.png');
|
||||
$('#dice_item_3 img').attr("src", '/static/handle/img/dice0.png');
|
||||
}
|
||||
}
|
||||
})
|
||||
$(window).resize(function(){
|
||||
init(ludan);
|
||||
})
|
||||
audio.addEventListener("ended", nextAudio);
|
||||
getTime();
|
||||
// 日期
|
||||
setInterval(function(){
|
||||
getTime();
|
||||
}, 1000);
|
||||
// 侧栏控台
|
||||
$(".control-box").hover(function(){
|
||||
$(".control-box").stop().animate({right:"0"})
|
||||
},function(){
|
||||
$(".control-box").stop().animate({right:"-410px"})
|
||||
})
|
||||
// 多语言切换
|
||||
$('#language').change(function(){
|
||||
var language = $('#language').val();
|
||||
if(language == "cn" || language == "tw" || language == "en"){
|
||||
$.get("/index/lang?lang="+language,function(data){
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
$("#confirm_update_ludan").click(function (){
|
||||
retreated();
|
||||
});
|
||||
$("#cancel_update_ludan").click(function (){
|
||||
$('#update_ludan').hide();
|
||||
});
|
||||
// 色碟方法
|
||||
$('.toning-result-num').click(function () {
|
||||
$('#toning_result').val(parseInt($(this).html()));
|
||||
$(this).addClass("active").siblings().removeClass("active");
|
||||
})
|
||||
})
|
||||
function loginout(){
|
||||
isCBoot = true;
|
||||
layer.confirm(lang.is_to_logout,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
window.location.href='/login/logout';
|
||||
isCBoot = false;
|
||||
layer.close(index);
|
||||
},function(index){
|
||||
isCBoot = false;
|
||||
});
|
||||
}
|
||||
//获取当前语言包
|
||||
function getLang(){
|
||||
$.ajax({
|
||||
url:"/index/get_lang",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
async:false,
|
||||
success:function(data){
|
||||
if(data.status === 1){
|
||||
lang = data.lang;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//倒计时
|
||||
function countDown(time) {
|
||||
$(".countdown .num").html(time)
|
||||
$(".countdown").css({"opacity":1,"display":"block"});
|
||||
$(".countdown .grab-count").addClass("count-active");
|
||||
if(time == 10){
|
||||
mp3List = ['time_tip_10.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
}
|
||||
if(time < 9 && time > 0){
|
||||
mp3List = ['time.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
}
|
||||
if(time<=0){
|
||||
mp3List = ['stop_2.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//播放声音
|
||||
function audioMp3(mp3List){
|
||||
var mp3=new Object();
|
||||
mp3.mp3List=mp3List;
|
||||
mp3.url="/static/handle/mp3/";
|
||||
mp3.auto_play=false;
|
||||
mp3.loop=false;
|
||||
mp3.Play=function(){
|
||||
audio.src=this.url+this.mp3List[0];
|
||||
audio.play();
|
||||
}
|
||||
mp3.Muted=function(){
|
||||
audio.muted ? audio.muted = false : audio.muted = true;
|
||||
}
|
||||
mp3.volumeAdd=function(){
|
||||
if(audio.volume.toFixed(1)>=1){
|
||||
audio.volume=1
|
||||
}else{
|
||||
audio.volume = audio.volume + 0.1;
|
||||
}
|
||||
}
|
||||
mp3.volumeMinus=function(){
|
||||
if(audio.volume.toFixed(1)<=0){
|
||||
audio.volume=0
|
||||
}else{
|
||||
audio.volume = audio.volume - 0.1;
|
||||
}
|
||||
}
|
||||
return mp3;
|
||||
}
|
||||
function Flop(data){
|
||||
var whichpoker='',pokerindex='',pokercard='';
|
||||
if(data.status==true){
|
||||
var which = data.round.position;
|
||||
if(game_id == 1){
|
||||
switch(which){
|
||||
case 11:
|
||||
whichpoker='player-card';
|
||||
pokerindex=1;
|
||||
card_info["player_2"]=data.round.number;
|
||||
break;
|
||||
case 12:
|
||||
whichpoker='player-card';
|
||||
pokerindex=0;
|
||||
card_info["player_1"]=data.round.number;
|
||||
break;
|
||||
case 13:
|
||||
whichpoker='player-card';
|
||||
pokerindex=2;
|
||||
card_info["player_3"]=data.round.number;
|
||||
break;
|
||||
case 21:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=1;
|
||||
card_info["banker_2"]=data.round.number;
|
||||
break;
|
||||
case 22:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=0;
|
||||
card_info["banker_1"]=data.round.number;
|
||||
break;
|
||||
case 23:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=2;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
switch(which){
|
||||
case 11:
|
||||
whichpoker='player-card';
|
||||
pokerindex=0;
|
||||
card_info["player_1"]=data.round.number;
|
||||
break;
|
||||
case 21:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=0;
|
||||
card_info["banker_1"]=data.round.number;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pokercard = data.round.card;
|
||||
var $poker = $('.begincard '+'.'+ whichpoker+' .card');
|
||||
var pokersrc="/static/handle/faces/"+pokercard+".svg";
|
||||
if(pokercard<200){
|
||||
var color="#000"
|
||||
}else if(pokercard<300){
|
||||
var color="#f13b3d"
|
||||
}else if(pokercard<400){
|
||||
var color="#000"
|
||||
}else if(pokercard<500){
|
||||
var color="#f13b3d"
|
||||
}
|
||||
if(data.round.number == 1){
|
||||
data.round.number = "A";
|
||||
}
|
||||
if(data.round.number == 11){
|
||||
data.round.number = "J";
|
||||
}
|
||||
if(data.round.number == 12){
|
||||
data.round.number = "Q";
|
||||
}
|
||||
if(data.round.number == 13){
|
||||
data.round.number = "K";
|
||||
}
|
||||
$poker.eq(pokerindex).find(".topleft").html(data.round.number);
|
||||
$poker.eq(pokerindex).find(".bottomright").html(data.round.number);
|
||||
$poker.eq(pokerindex).find(".topleft").css("color",color);
|
||||
$poker.eq(pokerindex).find(".bottomright").css("color",color);
|
||||
|
||||
if(pokerindex==2){
|
||||
$('.begincard '+'.'+ whichpoker +' .draw .rotate').css("display","inline-block");
|
||||
$poker.eq(pokerindex).addClass("begin");
|
||||
$poker.eq(pokerindex).find(".face").css("background-image","url("+pokersrc+")");
|
||||
$(".begincard .banker-card .draw .text").css("text-align","left");
|
||||
$(".begincard .player-card .draw .text").css("text-align","right");
|
||||
}else{
|
||||
$poker.eq(pokerindex).addClass("begin");
|
||||
$poker.eq(pokerindex).find(".face").css("background-image","url("+pokersrc+")");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 桌子状态
|
||||
var setBetStatus = function (BetStatus){
|
||||
$('#number_tab_status').val(BetStatus.bet_status);
|
||||
if(BetStatus.bet_status==2){
|
||||
$('.nobegin-tip').html("");
|
||||
$('#show-status-span').html("");
|
||||
showDiceBox();
|
||||
}else if(BetStatus.bet_status==1){
|
||||
$('.nobegin-tip').html(lang[BetStatus.bet_msg]);
|
||||
$('#show-status-span').html("");
|
||||
}else{
|
||||
$('.nobegin-tip').html(lang[BetStatus.bet_msg]);
|
||||
$('#show-status-span').html("");
|
||||
}
|
||||
};
|
||||
// 获取桌子数据
|
||||
var setNumberInfo = function (round){
|
||||
number_tab_id = round.number_tab_id
|
||||
$('#boot_num').html(round.boot_num);
|
||||
$('#number').html(round.number_tab_number);
|
||||
$('#boot_id').val(round.boot_id);
|
||||
};
|
||||
//修改或者删除录单后从新获取number
|
||||
var getNumber = function (){
|
||||
var query = new Object();
|
||||
query.number_tab_id = number_tab_id;
|
||||
$.ajax({
|
||||
url:"/index/get_number",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:query,
|
||||
async:false,
|
||||
success:function(data){
|
||||
if(data.status == 1){
|
||||
$('#number').html(data.data);
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
function nextAudio(){
|
||||
num+=1
|
||||
if(num<mp3List.length){
|
||||
audio.src="/static/handle/mp3/"+mp3List[num];
|
||||
audio.play();
|
||||
}else{
|
||||
audio.pause();
|
||||
audio.currentTime = 0.0;
|
||||
num=0;
|
||||
}
|
||||
}
|
||||
function getTime() {
|
||||
var today = new Date();
|
||||
var h = today.getHours();
|
||||
var minute = today.getMinutes()
|
||||
var s = today.getSeconds();
|
||||
if (h < 10) {
|
||||
h = "0" + h;
|
||||
}
|
||||
if (minute < 10) {
|
||||
minute = "0" + minute;
|
||||
}
|
||||
if (s < 10) {
|
||||
s = "0" + s;
|
||||
}
|
||||
if(lang.lang == 'en-us'){
|
||||
var strDate = new Date();
|
||||
strDate = strDate.toDateString()
|
||||
strDate += " " + h + ":" + minute + ":" + s;
|
||||
}else if(lang.lang == 'zh-cn'){
|
||||
var strDate = (" " + today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日" + h + ":" + minute + ":" + s);
|
||||
}else if(lang.lang == 'zh-tw'){
|
||||
var strDate = (" " + today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日" + h + ":" + minute + ":" + s);
|
||||
}
|
||||
var n_day = today.getDay();
|
||||
switch (n_day) {
|
||||
case 0:
|
||||
var week = lang.sunday;
|
||||
break;
|
||||
case 1:
|
||||
var week = lang.monday;
|
||||
break;
|
||||
case 2:
|
||||
var week = lang.tuesday;
|
||||
break;
|
||||
case 3:
|
||||
var week = lang.wednesday;
|
||||
break;
|
||||
case 4:
|
||||
var week = lang.thursday;
|
||||
break;
|
||||
case 5:
|
||||
var week = lang.friday;
|
||||
break;
|
||||
case 6:
|
||||
var week = lang.saturday;
|
||||
break;
|
||||
case 7:
|
||||
var week = lang.sunday;
|
||||
break;
|
||||
}
|
||||
$('.date .weekend').html(week);
|
||||
$('.date .time').html(strDate);
|
||||
}
|
||||
|
||||
// 骰宝
|
||||
const diceSpriteSrc = `/static/handle/img/sprite.png`;
|
||||
// 请求所有路单数据,执行画布刷新
|
||||
function waybillFunc(){
|
||||
var data = new Object;
|
||||
data.boot_id = $('#boot_id').val();
|
||||
data.game_id = game_id;
|
||||
var url = "/index/waybill_dice";
|
||||
$.ajax({
|
||||
url:url,
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:data,
|
||||
success:function(data){
|
||||
ludan = data.waybill;
|
||||
init(ludan);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init(data) {
|
||||
const getPixelRatio = (context) => {
|
||||
const backingStore =
|
||||
context.backingStorePixelRatio ||
|
||||
context.webkitBackingStorePixelRatio ||
|
||||
context.mozBackingStorePixelRatio ||
|
||||
context.msBackingStorePixelRatio ||
|
||||
context.oBackingStorePixelRatio ||
|
||||
context.backingStorePixelRatio ||
|
||||
1;
|
||||
return (window.devicePixelRatio || 1) / backingStore;
|
||||
};
|
||||
const ctb = document.getElementById("canvas").getContext("2d"),
|
||||
dpr = getPixelRatio(ctb),
|
||||
height = canvas.clientHeight,
|
||||
width = canvas.clientWidth,
|
||||
rows = 6;
|
||||
const unit = (height / rows) * dpr,
|
||||
cols = parseInt(width / (unit / dpr));
|
||||
canvas.setAttribute("width", unit * cols);
|
||||
canvas.setAttribute("height", unit * rows);
|
||||
DiceWaybill(data, ctb, unit, rows, cols);
|
||||
}
|
||||
|
||||
function DiceWaybill(data, ctb, unit, rows, cols) {
|
||||
ctb.clearRect(0, 0, unit * (cols + 1), unit * (rows + 1));
|
||||
const sprite = new Image();
|
||||
// sprite.crossOrigin = "anonymous";
|
||||
sprite.src = diceSpriteSrc;
|
||||
let diceWidth = 0,
|
||||
diceHeight = 0,
|
||||
spriteArray = [];
|
||||
sprite.onload = () => {
|
||||
diceWidth = sprite.width / 2;
|
||||
diceHeight = sprite.height / 6;
|
||||
spriteArray = {
|
||||
dice_1: [0, 0],
|
||||
dice_2: [0, 1],
|
||||
dice_3: [0, 2],
|
||||
dice_odd: [0, 3],
|
||||
dice_even: [0, 4],
|
||||
dice_triplet: [0, 5],
|
||||
dice_4: [1, 0],
|
||||
dice_5: [1, 1],
|
||||
dice_6: [1, 2],
|
||||
dice_small: [1, 3],
|
||||
dice_big: [1, 4],
|
||||
dice_num: [1, 5],
|
||||
};
|
||||
inputData(data);
|
||||
drawLine();
|
||||
};
|
||||
|
||||
function inputData(data) {
|
||||
// 数据截取
|
||||
let newData = [];
|
||||
const L = data.length;
|
||||
const Tab = cols - 1;
|
||||
if (L <= Tab) {
|
||||
newData = data;
|
||||
} else {
|
||||
newData = data.slice(L - Tab, L);
|
||||
}
|
||||
// 绘制图标
|
||||
newData.forEach((v, i) => {
|
||||
const totle = v[0] + v[1] + v[2];
|
||||
drawIcon(i, 0, "icon", v[0]);
|
||||
drawIcon(i, 1, "icon", v[1]);
|
||||
drawIcon(i, 2, "icon", v[2]);
|
||||
drawIcon(i, 3, "num", totle);
|
||||
if ((v[0] == v[1]) && (v[1] == v[2])) {
|
||||
drawIcon(i, 4, "icon", "triplet");
|
||||
drawIcon(i, 5, "icon", "triplet");
|
||||
} else {
|
||||
if (totle >= 11) {
|
||||
drawIcon(i, 4, "icon", "big");
|
||||
} else {
|
||||
drawIcon(i, 4, "icon", "small");
|
||||
}
|
||||
if (totle % 2 == 0) {
|
||||
drawIcon(i, 5, "icon", "even");
|
||||
} else {
|
||||
drawIcon(i, 5, "icon", "odd");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function drawIcon(x, y, type, text) {
|
||||
if (type == "icon") {
|
||||
const position = spriteArray[`dice_${text}`];
|
||||
ctb.drawImage(
|
||||
sprite,
|
||||
position[0] * diceWidth,
|
||||
position[1] * diceHeight,
|
||||
diceWidth,
|
||||
diceHeight,
|
||||
unit * x + unit * 0.05,
|
||||
unit * y + (unit / diceWidth) * diceHeight * 0.05,
|
||||
unit * 0.9,
|
||||
(unit / diceWidth) * diceHeight * 0.9
|
||||
);
|
||||
} else if (type == "num") {
|
||||
const position = spriteArray[`dice_num`];
|
||||
ctb.drawImage(
|
||||
sprite,
|
||||
position[0] * diceWidth,
|
||||
position[1] * diceHeight,
|
||||
diceWidth,
|
||||
diceHeight,
|
||||
unit * x + unit * 0.05,
|
||||
unit * y + (unit / diceWidth) * diceHeight * 0.05,
|
||||
unit * 0.9,
|
||||
(unit / diceWidth) * diceHeight * 0.9
|
||||
);
|
||||
ctb.font = unit * 0.58 + "px Arial";
|
||||
ctb.fillStyle = "#fff";
|
||||
ctb.textAlign = "center";
|
||||
ctb.textBaseline = "middle";
|
||||
ctb.fillText(text, unit * (x + 0.45), unit * (y + 0.55));
|
||||
}
|
||||
}
|
||||
function drawLine() {
|
||||
const CanvasWidht = unit * cols;
|
||||
const CanvasHeight = unit * rows;
|
||||
ctb.lineWidth = 1;
|
||||
ctb.strokeStyle = "#deded9";
|
||||
ctb.beginPath();
|
||||
for (let i = 0; i <= rows; i++) {
|
||||
ctb.moveTo(0, unit * i);
|
||||
ctb.lineTo(CanvasWidht, unit * i);
|
||||
}
|
||||
for (let j = 0; j <= cols; j++) {
|
||||
ctb.moveTo(unit * j, 0);
|
||||
ctb.lineTo(unit * j, CanvasHeight);
|
||||
}
|
||||
ctb.closePath();
|
||||
ctb.stroke();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,808 @@
|
||||
var userid = parseInt($('#userid').val());
|
||||
var login_token = $('#login_token').val();
|
||||
var table_id = parseInt($('#table_id').val());
|
||||
var game_id = parseInt($('#game_id').val());
|
||||
var account = $('#account').val();
|
||||
var number_tab_id;
|
||||
var ludan;
|
||||
var isCBoot = false;
|
||||
var isopentime = false;
|
||||
var num = 0;
|
||||
var card_info=[];
|
||||
|
||||
var websocket = io(websocketProtocol+"://"+websocketUrl+"/?table_id="+table_id+"&account="+account+"&connect=space&userid="+userid+"&login_token="+login_token,{transports: ['websocket']});
|
||||
websocket.on('reconnecting', (timeout) => {
|
||||
//触发重连
|
||||
layer.msg('服务断开,正在重新连接...', {
|
||||
icon: 16,
|
||||
shade: 0.6,
|
||||
time:0,
|
||||
});
|
||||
});
|
||||
websocket.on('reconnect', (timeout) => {
|
||||
//重连成功
|
||||
layer.closeAll();
|
||||
layer.msg('服务重新连接成功');
|
||||
});
|
||||
//事件 发送*******************************************************************************************************************
|
||||
var startBet = function(){
|
||||
websocket.emit('startBet',{table_id : table_id, number_tab_id : number_tab_id});
|
||||
};
|
||||
var endBet = function (){
|
||||
websocket.emit('endBet',{table_id : table_id, number_tab_id : number_tab_id});
|
||||
};
|
||||
var resetNumberTab = function(){
|
||||
isCBoot = true;
|
||||
var betStatus = $("#number_tab_status").val();
|
||||
if(betStatus == 1 || betStatus == 2){
|
||||
layer.confirm(lang.is_reset_number,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
websocket.emit('resetNumberTab',{table_id : table_id});
|
||||
isCBoot = false;
|
||||
layer.close(index);
|
||||
$('.roulette-result-num').html('');
|
||||
hideRouletteBox();
|
||||
},function(index){
|
||||
isCBoot = false;
|
||||
});
|
||||
}else{
|
||||
layer.msg(lang.reset_number_fail);
|
||||
}
|
||||
};
|
||||
var changeBoot = function(){
|
||||
isCBoot = true;
|
||||
var betStatus = $("#number_tab_status").val();
|
||||
if(betStatus == 0 || betStatus == 3){
|
||||
layer.confirm(lang.is_to_boot,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
websocket.emit('changeBoot',{table_id : table_id});
|
||||
isCBoot = false;
|
||||
layer.close(index);
|
||||
},function(index){
|
||||
isCBoot = false;
|
||||
});
|
||||
}else{
|
||||
layer.msg(lang.change_boot_false);
|
||||
}
|
||||
};
|
||||
var resetBoot = function(){
|
||||
layer.confirm(lang.is_to_balance,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
websocket.emit('resetBoot',{table_id : table_id});
|
||||
layer.close(index);
|
||||
});
|
||||
};
|
||||
var opening = function(){
|
||||
let result = $('#roulette_result').val();
|
||||
websocket.emit('openingRoulette',{table_id : table_id, number_tab_id : number_tab_id, result : result});
|
||||
};
|
||||
// 骰宝显示
|
||||
var showDRouletteBox = function (){
|
||||
$('#roulette_result').val('');
|
||||
$('.roulette-result-num').html('')
|
||||
$('#roulette_result_box').fadeIn();
|
||||
}
|
||||
var hideRouletteBox = function (){
|
||||
$('#roulette_result_box').addClass('flicker').fadeOut(2400,'linear',function(){
|
||||
$('#roulette_result_box').removeClass('flicker');
|
||||
$('.roulette-result-num').html('')
|
||||
});
|
||||
}
|
||||
//事件 发送*******************************************************************************************************************
|
||||
//事件返回*********************************************************************************************************************
|
||||
websocket.on('onlineLogin',function(data){
|
||||
if (data.table_id === table_id) {
|
||||
if(data.status === true){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
waybillFunc();
|
||||
if (data.round.number_tab_status.bet_status != undefined && data.round.number_tab_status.bet_status == 2){
|
||||
}
|
||||
}else{
|
||||
layer.msg(lang[data.msg],{time:0});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
websocket.on('RepeatedEntry',function(data){
|
||||
websocket.close();
|
||||
layer.msg(lang[data.msg]);
|
||||
setTimeout(function (){
|
||||
window.location.href='/login/logout';
|
||||
},2000);
|
||||
});
|
||||
websocket.on('startBet',function(data){
|
||||
if(data.status === true && data.table_id === table_id){
|
||||
mp3List = ['start.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('resetNumberTab',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
$(".begincard .box").animate({"opacity":"0"},function(){
|
||||
$(".begincard").fadeOut();
|
||||
|
||||
$(".table-info .nobegin-tip").fadeIn();
|
||||
$('.box1').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$('.box2').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$('.box3').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$('.box4').css("background-color","rgba(0, 0, 0, 0.5)");
|
||||
$(".begincard .box .list .card").removeClass("begin")
|
||||
$(".begincard .card .topleft").html("")
|
||||
$(".begincard .card .bottomright").html("")
|
||||
$(".list .card .face").css("background-image","")
|
||||
$(".begincard .list .draw .rotate").css("display",'none');
|
||||
});
|
||||
card_info=[];
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('changeBoot',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
clearBetAmount();
|
||||
waybillFunc();
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('resetBoot',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
waybillFunc();
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('startBetCountDown',function(data){
|
||||
if(data.status == true && data.table_id == table_id){
|
||||
countDown(data.count_down);
|
||||
}
|
||||
});
|
||||
websocket.on('endBet',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
mp3List = ['stop_2.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
websocket.on('openingRoulette',function(data){
|
||||
if(data.status === true && data.table_id == table_id){
|
||||
setNumberInfo(data.round);
|
||||
setBetStatus(data.round.number_tab_status);
|
||||
waybillFunc();
|
||||
hideRouletteBox();
|
||||
}else{
|
||||
if (data.table_id != undefined && data.table_id == table_id) {
|
||||
$('.roulette-result-num').html('')
|
||||
layer.msg(lang[data.msg]);
|
||||
}
|
||||
}
|
||||
});
|
||||
//事件返回*********************************************************************************************************************
|
||||
|
||||
//启动执行
|
||||
$(function(){
|
||||
getLang();
|
||||
//视频处理
|
||||
$("#video-iframe").attr("src",player+'?url='+flvUrl);
|
||||
$(document).keydown(function (e){
|
||||
if(e.keyCode == 13){
|
||||
|
||||
var cookieValue = $.cookie("enter_time");
|
||||
if(!cookieValue){
|
||||
$.cookie("enter_time", 1, { expires: 1/86400*3 });
|
||||
}else{
|
||||
layer.msg('Please hold on');
|
||||
return false
|
||||
}
|
||||
|
||||
if(isCBoot == true){
|
||||
$('.layui-layer-btn0').click();
|
||||
isCBoot = false;
|
||||
}else{
|
||||
//var keycode = $('#keycode').val();
|
||||
var numberTabStatus = $('#number_tab_status').val();
|
||||
//if(keycode == '6'){
|
||||
if (numberTabStatus == 0) {
|
||||
if(!isopentime){
|
||||
var is_rob = $('#is_rob').val();
|
||||
if(is_rob == 1){
|
||||
startRob();
|
||||
}else{
|
||||
startBet();
|
||||
}
|
||||
$('#keycode').val('');
|
||||
}else{
|
||||
layer.msg("请稍等!");
|
||||
}
|
||||
}else if (numberTabStatus == 2) {
|
||||
var result = $('#roulette_result').val();
|
||||
if(result.length == 0){
|
||||
return false;
|
||||
}
|
||||
opening();
|
||||
}
|
||||
}
|
||||
}
|
||||
//开局
|
||||
if(e.keyCode == 111){
|
||||
$('#keycode').val('6');
|
||||
}
|
||||
//修改当前状态
|
||||
if(e.keyCode == 109){
|
||||
$('#update_ludan').toggle();
|
||||
}
|
||||
//换靴
|
||||
if(e.keyCode == 107){
|
||||
changeBoot();
|
||||
$('#keycode').val('');
|
||||
}
|
||||
//退出登录
|
||||
if(e.keyCode == 106){
|
||||
if(table_type == 1){
|
||||
cutout();
|
||||
$('#keycode').val('');
|
||||
}else{
|
||||
if(bet_type == 2){
|
||||
cutout();
|
||||
$('#keycode').val('');
|
||||
}else{
|
||||
loginout();
|
||||
$('#keycode').val('');
|
||||
}
|
||||
}
|
||||
}
|
||||
//取消
|
||||
if(e.keyCode == 110){
|
||||
$('.layui-layer-btn1').click();
|
||||
}
|
||||
// 停止倒计时
|
||||
if(e.keyCode == 96){
|
||||
if(game_id == 5 || game_id == 4){
|
||||
var number_rob_status=$("#number_rob_status").val();
|
||||
var number_tab_status=$("#number_tab_status").val();
|
||||
if((number_rob_status==1&&number_tab_status==0)||(number_rob_status==2&&number_tab_status==0)){
|
||||
endRob();
|
||||
}else{
|
||||
endBet();
|
||||
}
|
||||
}else{
|
||||
endBet();
|
||||
}
|
||||
}
|
||||
// 骰宝结果选择
|
||||
if (game_id == 8){
|
||||
if (e.keyCode == 96 || e.keyCode == 97 || e.keyCode == 98 || e.keyCode == 99 || e.keyCode == 100 || e.keyCode == 101 || e.keyCode == 102 || e.keyCode == 103 || e.keyCode == 104 || e.keyCode == 105){
|
||||
var num = '';
|
||||
switch (e.keyCode){
|
||||
case 96:
|
||||
num = 0;
|
||||
break;
|
||||
case 97:
|
||||
num = 1;
|
||||
break;
|
||||
case 98:
|
||||
num = 2;
|
||||
break;
|
||||
case 99:
|
||||
num = 3;
|
||||
break;
|
||||
case 100:
|
||||
num = 4;
|
||||
break;
|
||||
case 101:
|
||||
num = 5;
|
||||
break;
|
||||
case 102:
|
||||
num = 6;
|
||||
break;
|
||||
case 103:
|
||||
num = 7;
|
||||
break;
|
||||
case 104:
|
||||
num = 8;
|
||||
break;
|
||||
case 105:
|
||||
num = 9;
|
||||
break;
|
||||
}
|
||||
if (num >= 0){
|
||||
var word = $('.roulette-result-num').html()
|
||||
if(word.length >= 2){
|
||||
return false
|
||||
}
|
||||
$('.roulette-result-num').append(num)
|
||||
var word = $('.roulette-result-num').html()
|
||||
$('#roulette_result').val(word)
|
||||
}
|
||||
} else if (e.keyCode == 109){
|
||||
$('.roulette-result-num').html('')
|
||||
$('#roulette_result').val('');
|
||||
}
|
||||
}
|
||||
})
|
||||
$(window).resize(function(){
|
||||
requestData(ludan);
|
||||
})
|
||||
audio.addEventListener("ended", nextAudio);
|
||||
getTime();
|
||||
// 日期
|
||||
setInterval(function(){
|
||||
getTime();
|
||||
}, 1000);
|
||||
// 侧栏控台
|
||||
$(".control-box").hover(function(){
|
||||
$(".control-box").stop().animate({right:"0"})
|
||||
},function(){
|
||||
$(".control-box").stop().animate({right:"-410px"})
|
||||
})
|
||||
// 多语言切换
|
||||
$('#language').change(function(){
|
||||
var language = $('#language').val();
|
||||
if(language == "cn" || language == "tw" || language == "en"){
|
||||
$.get("/index/lang?lang="+language,function(data){
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
$("#confirm_update_ludan").click(function (){
|
||||
retreated();
|
||||
});
|
||||
$("#cancel_update_ludan").click(function (){
|
||||
$('#update_ludan').hide();
|
||||
});
|
||||
// 色碟方法
|
||||
$('.toning-result-num').click(function () {
|
||||
$('#toning_result').val(parseInt($(this).html()));
|
||||
$(this).addClass("active").siblings().removeClass("active");
|
||||
})
|
||||
})
|
||||
function loginout(){
|
||||
isCBoot = true;
|
||||
layer.confirm(lang.is_to_logout,{btn: [lang.confirm,lang.cancel],title:lang.message}, function(index){
|
||||
window.location.href='/login/logout';
|
||||
isCBoot = false;
|
||||
layer.close(index);
|
||||
},function(index){
|
||||
isCBoot = false;
|
||||
});
|
||||
}
|
||||
//获取当前语言包
|
||||
function getLang(){
|
||||
$.ajax({
|
||||
url:"/index/get_lang",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
async:false,
|
||||
success:function(data){
|
||||
if(data.status === 1){
|
||||
lang = data.lang;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//倒计时
|
||||
function countDown(time) {
|
||||
$(".countdown .num").html(time)
|
||||
$(".countdown").css({"opacity":1,"display":"block"});
|
||||
$(".countdown .grab-count").addClass("count-active");
|
||||
if(time == 10){
|
||||
mp3List = ['time_tip_10.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
}
|
||||
if(time < 9 && time > 0){
|
||||
mp3List = ['time.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
}
|
||||
if(time<=0){
|
||||
mp3List = ['stop_2.mp3'];
|
||||
audioMp3(mp3List).Play();
|
||||
$(".countdown").css({"opacity":0,"display":"none"});
|
||||
$(".countdown .grab-count").removeClass("count-active");
|
||||
return;
|
||||
}
|
||||
}
|
||||
//播放声音
|
||||
function audioMp3(mp3List){
|
||||
var mp3=new Object();
|
||||
mp3.mp3List=mp3List;
|
||||
mp3.url="/static/handle/mp3/";
|
||||
mp3.auto_play=false;
|
||||
mp3.loop=false;
|
||||
mp3.Play=function(){
|
||||
audio.src=this.url+this.mp3List[0];
|
||||
audio.play();
|
||||
}
|
||||
mp3.Muted=function(){
|
||||
audio.muted ? audio.muted = false : audio.muted = true;
|
||||
}
|
||||
mp3.volumeAdd=function(){
|
||||
if(audio.volume.toFixed(1)>=1){
|
||||
audio.volume=1
|
||||
}else{
|
||||
audio.volume = audio.volume + 0.1;
|
||||
}
|
||||
}
|
||||
mp3.volumeMinus=function(){
|
||||
if(audio.volume.toFixed(1)<=0){
|
||||
audio.volume=0
|
||||
}else{
|
||||
audio.volume = audio.volume - 0.1;
|
||||
}
|
||||
}
|
||||
return mp3;
|
||||
}
|
||||
function Flop(data){
|
||||
var whichpoker='',pokerindex='',pokercard='';
|
||||
if(data.status==true){
|
||||
var which = data.round.position;
|
||||
if(game_id == 1){
|
||||
switch(which){
|
||||
case 11:
|
||||
whichpoker='player-card';
|
||||
pokerindex=1;
|
||||
card_info["player_2"]=data.round.number;
|
||||
break;
|
||||
case 12:
|
||||
whichpoker='player-card';
|
||||
pokerindex=0;
|
||||
card_info["player_1"]=data.round.number;
|
||||
break;
|
||||
case 13:
|
||||
whichpoker='player-card';
|
||||
pokerindex=2;
|
||||
card_info["player_3"]=data.round.number;
|
||||
break;
|
||||
case 21:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=1;
|
||||
card_info["banker_2"]=data.round.number;
|
||||
break;
|
||||
case 22:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=0;
|
||||
card_info["banker_1"]=data.round.number;
|
||||
break;
|
||||
case 23:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=2;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
switch(which){
|
||||
case 11:
|
||||
whichpoker='player-card';
|
||||
pokerindex=0;
|
||||
card_info["player_1"]=data.round.number;
|
||||
break;
|
||||
case 21:
|
||||
whichpoker='banker-card';
|
||||
pokerindex=0;
|
||||
card_info["banker_1"]=data.round.number;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pokercard = data.round.card;
|
||||
var $poker = $('.begincard '+'.'+ whichpoker+' .card');
|
||||
var pokersrc="/static/handle/faces/"+pokercard+".svg";
|
||||
if(pokercard<200){
|
||||
var color="#000"
|
||||
}else if(pokercard<300){
|
||||
var color="#f13b3d"
|
||||
}else if(pokercard<400){
|
||||
var color="#000"
|
||||
}else if(pokercard<500){
|
||||
var color="#f13b3d"
|
||||
}
|
||||
if(data.round.number == 1){
|
||||
data.round.number = "A";
|
||||
}
|
||||
if(data.round.number == 11){
|
||||
data.round.number = "J";
|
||||
}
|
||||
if(data.round.number == 12){
|
||||
data.round.number = "Q";
|
||||
}
|
||||
if(data.round.number == 13){
|
||||
data.round.number = "K";
|
||||
}
|
||||
$poker.eq(pokerindex).find(".topleft").html(data.round.number);
|
||||
$poker.eq(pokerindex).find(".bottomright").html(data.round.number);
|
||||
$poker.eq(pokerindex).find(".topleft").css("color",color);
|
||||
$poker.eq(pokerindex).find(".bottomright").css("color",color);
|
||||
|
||||
if(pokerindex==2){
|
||||
$('.begincard '+'.'+ whichpoker +' .draw .rotate').css("display","inline-block");
|
||||
$poker.eq(pokerindex).addClass("begin");
|
||||
$poker.eq(pokerindex).find(".face").css("background-image","url("+pokersrc+")");
|
||||
$(".begincard .banker-card .draw .text").css("text-align","left");
|
||||
$(".begincard .player-card .draw .text").css("text-align","right");
|
||||
}else{
|
||||
$poker.eq(pokerindex).addClass("begin");
|
||||
$poker.eq(pokerindex).find(".face").css("background-image","url("+pokersrc+")");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 桌子状态
|
||||
var setBetStatus = function (BetStatus){
|
||||
$('#number_tab_status').val(BetStatus.bet_status);
|
||||
if(BetStatus.bet_status==2){
|
||||
$('.nobegin-tip').html("");
|
||||
$('#show-status-span').html("");
|
||||
showDRouletteBox();
|
||||
}else if(BetStatus.bet_status==1){
|
||||
$('.nobegin-tip').html(lang[BetStatus.bet_msg]);
|
||||
$('#show-status-span').html("");
|
||||
}else{
|
||||
$('.nobegin-tip').html(lang[BetStatus.bet_msg]);
|
||||
$('#show-status-span').html("");
|
||||
}
|
||||
};
|
||||
// 获取桌子数据
|
||||
var setNumberInfo = function (round){
|
||||
number_tab_id = round.number_tab_id
|
||||
$('#boot_num').html(round.boot_num);
|
||||
$('#number').html(round.number_tab_number);
|
||||
$('#boot_id').val(round.boot_id);
|
||||
};
|
||||
//修改或者删除录单后从新获取number
|
||||
var getNumber = function (){
|
||||
var query = new Object();
|
||||
query.number_tab_id = number_tab_id;
|
||||
$.ajax({
|
||||
url:"/index/get_number",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:query,
|
||||
async:false,
|
||||
success:function(data){
|
||||
if(data.status == 1){
|
||||
$('#number').html(data.data);
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
function nextAudio(){
|
||||
num+=1
|
||||
if(num<mp3List.length){
|
||||
audio.src="/static/handle/mp3/"+mp3List[num];
|
||||
audio.play();
|
||||
}else{
|
||||
audio.pause();
|
||||
audio.currentTime = 0.0;
|
||||
num=0;
|
||||
}
|
||||
}
|
||||
function getTime() {
|
||||
var today = new Date();
|
||||
var h = today.getHours();
|
||||
var minute = today.getMinutes()
|
||||
var s = today.getSeconds();
|
||||
if (h < 10) {
|
||||
h = "0" + h;
|
||||
}
|
||||
if (minute < 10) {
|
||||
minute = "0" + minute;
|
||||
}
|
||||
if (s < 10) {
|
||||
s = "0" + s;
|
||||
}
|
||||
if(lang.lang == 'en-us'){
|
||||
var strDate = new Date();
|
||||
strDate = strDate.toDateString()
|
||||
strDate += " " + h + ":" + minute + ":" + s;
|
||||
}else if(lang.lang == 'zh-cn'){
|
||||
var strDate = (" " + today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日" + h + ":" + minute + ":" + s);
|
||||
}else if(lang.lang == 'zh-tw'){
|
||||
var strDate = (" " + today.getFullYear() + "年" + (today.getMonth() + 1) + "月" + today.getDate() + "日" + h + ":" + minute + ":" + s);
|
||||
}
|
||||
var n_day = today.getDay();
|
||||
switch (n_day) {
|
||||
case 0:
|
||||
var week = lang.sunday;
|
||||
break;
|
||||
case 1:
|
||||
var week = lang.monday;
|
||||
break;
|
||||
case 2:
|
||||
var week = lang.tuesday;
|
||||
break;
|
||||
case 3:
|
||||
var week = lang.wednesday;
|
||||
break;
|
||||
case 4:
|
||||
var week = lang.thursday;
|
||||
break;
|
||||
case 5:
|
||||
var week = lang.friday;
|
||||
break;
|
||||
case 6:
|
||||
var week = lang.saturday;
|
||||
break;
|
||||
case 7:
|
||||
var week = lang.sunday;
|
||||
break;
|
||||
}
|
||||
$('.date .weekend').html(week);
|
||||
$('.date .time').html(strDate);
|
||||
}
|
||||
|
||||
// 骰宝
|
||||
const diceSpriteSrc = `/static/handle/img/sprite.png`;
|
||||
// 请求所有路单数据,执行画布刷新
|
||||
function waybillFunc(){
|
||||
var data = new Object;
|
||||
data.boot_id = $('#boot_id').val();
|
||||
data.game_id = game_id;
|
||||
var url = "/index/waybill_roulette";
|
||||
$.ajax({
|
||||
url:url,
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:data,
|
||||
success:function(data){
|
||||
ludan = data;
|
||||
requestData(ludan);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function requestData(data,ask,askroad){
|
||||
var ask=ask||false;
|
||||
var askroad=askroad||{
|
||||
"askshowroad":false,
|
||||
"askbigRoad":false,
|
||||
"askbigEyeRoad":false,
|
||||
"askpathway":false,
|
||||
"askroach":false,
|
||||
};
|
||||
bigH=$(".canvas-box.big").height();
|
||||
bigW=$(".canvas-box.big").width();
|
||||
// 计算单位
|
||||
unitbig=bigH/6;
|
||||
// 计算列个数
|
||||
colbig=Math.floor(bigW/unitbig);
|
||||
console.log(data)
|
||||
CanvasTableRoulette("#canvas3",unitbig,6,colbig,data,ask,askroad);
|
||||
}
|
||||
|
||||
function CanvasTableRoulette(Id,unit,rows,cols,data,ask,askroad){
|
||||
var width=unit*cols,
|
||||
height=unit*rows;
|
||||
|
||||
$(Id).attr("width",width)
|
||||
$(Id).attr("height",height)
|
||||
var canvasId=$(Id);
|
||||
var ctb=canvasId[0].getContext('2d');
|
||||
ctb.lineWidth = 1;//线条宽度
|
||||
ctb.strokeStyle = "#919191";//线条颜色
|
||||
ctb.beginPath();
|
||||
ctb.moveTo(0, 0.5);
|
||||
ctb.lineTo(width, 0.5);
|
||||
for (var i = 0; i <= rows; i++) {
|
||||
ctb.moveTo(0, unit*i);
|
||||
ctb.lineTo(width, unit*i);
|
||||
}
|
||||
ctb.closePath()
|
||||
ctb.stroke();
|
||||
ctb.beginPath();
|
||||
ctb.moveTo(0.5, 0);
|
||||
ctb.lineTo(0.5, height);
|
||||
for (var j = 1; j <= cols; j++) {
|
||||
ctb.moveTo(unit*j,0);
|
||||
ctb.lineTo(unit*j,height);
|
||||
}
|
||||
ctb.closePath()
|
||||
ctb.stroke();
|
||||
if(data.status){
|
||||
switch(true){
|
||||
// 判断是否滚动
|
||||
case Id=="#canvas3":
|
||||
var showRoad=data.waybill;
|
||||
|
||||
if(showRoad!=''){
|
||||
var roadType="showWay"
|
||||
cutRoad(roadType,ctb,unit,showRoad,cols,ask,askroad.askshowroad);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 前端路单数据截取
|
||||
function cutRoad(roadType,ctb,unit,roadData,cols,ask,askroad){
|
||||
var L=roadData.length;
|
||||
var new_roadData=[];
|
||||
var Tab=0
|
||||
if(roadType=="showWay"||roadType=="bigWay"){
|
||||
if(ask&&askroad){
|
||||
Tab=cols;
|
||||
}else{
|
||||
Tab=cols-1;
|
||||
}
|
||||
}else{
|
||||
if(ask&&askroad){
|
||||
Tab=cols-1;
|
||||
}else{
|
||||
Tab=cols-2;
|
||||
}
|
||||
}
|
||||
var start_x=cols/2+0.25;
|
||||
if(L>=1){
|
||||
var last_x=roadData[L-1].show_x
|
||||
if(last_x>Tab){
|
||||
var cut=last_x-Tab
|
||||
$.each(roadData,function(i,v){
|
||||
if(v.show_x>cut){
|
||||
new_roadData.push(v)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
new_roadData=roadData;
|
||||
cut=0;
|
||||
}
|
||||
}else{
|
||||
new_roadData=roadData;
|
||||
cut=0;
|
||||
}
|
||||
$.each(new_roadData,function(i,v){
|
||||
if(roadType=="showWay"){
|
||||
SoloPath(ctb,unit,v.show_x-cut,v.show_y,v.result)
|
||||
}
|
||||
})
|
||||
}
|
||||
function SoloPath(ctb,unit,x,y,type){
|
||||
ctb.beginPath();
|
||||
ctb.lineWidth = 0.5;
|
||||
ctb.strokeStyle = "#000";
|
||||
var radius=unit/2||0;
|
||||
var black = ['2','4','6','8','10','11','13','15','17','20','22','24','26','28','29','31','33','35'];
|
||||
var red = ['1','3','5','7','9','12','14','16','18','19','21','23','25','27','30','32','34','36'];
|
||||
var fonts=type;
|
||||
if($.inArray(type,black) != -1){
|
||||
var color='#636363';
|
||||
ctb.strokeStyle = "#636363";
|
||||
}
|
||||
if($.inArray(type,red) != -1){
|
||||
var color='#f54f42';
|
||||
ctb.strokeStyle = "#f54f42";
|
||||
}
|
||||
if(type == 0){
|
||||
var color='#5db646';
|
||||
ctb.strokeStyle = "#5db646";
|
||||
}
|
||||
ctb.arc(radius+unit*(x-1), radius+unit*(y-1), unit*0.45, 0, Math.PI * 2);
|
||||
ctb.fillStyle=color;
|
||||
ctb.fill();
|
||||
ctb.font=unit*0.67+"px Arial";
|
||||
ctb.fillStyle ="#fff" ; // 颜色
|
||||
ctb.textAlign = 'center';
|
||||
ctb.textBaseline = 'middle';
|
||||
ctb.fillText(fonts,radius+unit*(x-1),radius+unit*(y-1));
|
||||
ctb.stroke();
|
||||
|
||||
}
|
||||
+2
File diff suppressed because one or more lines are too long
+3092
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,114 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2006, 2014 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD (Register as an anonymous module)
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (arguments.length > 1 && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setMilliseconds(t.getMilliseconds() + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {},
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
cookies = document.cookie ? document.cookie.split('; ') : [],
|
||||
i = 0,
|
||||
l = cookies.length;
|
||||
|
||||
for (; i < l; i++) {
|
||||
var parts = cookies[i].split('='),
|
||||
name = decode(parts.shift()),
|
||||
cookie = parts.join('=');
|
||||
|
||||
if (key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
|
||||
}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
|
||||
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 701 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d(function(n,t){return n<<t|n>>>32-t}(d(d(t,n),d(e,u)),o),r)}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function i(n,t){var r,e,o,u,c;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;var f=1732584193,i=-271733879,a=-1732584194,h=271733878;for(r=0;r<n.length;r+=16)i=m(i=m(i=m(i=m(i=v(i=v(i=v(i=v(i=g(i=g(i=g(i=g(i=l(i=l(i=l(i=l(o=i,a=l(u=a,h=l(c=h,f=l(e=f,i,a,h,n[r],7,-680876936),i,a,n[r+1],12,-389564586),f,i,n[r+2],17,606105819),h,f,n[r+3],22,-1044525330),a=l(a,h=l(h,f=l(f,i,a,h,n[r+4],7,-176418897),i,a,n[r+5],12,1200080426),f,i,n[r+6],17,-1473231341),h,f,n[r+7],22,-45705983),a=l(a,h=l(h,f=l(f,i,a,h,n[r+8],7,1770035416),i,a,n[r+9],12,-1958414417),f,i,n[r+10],17,-42063),h,f,n[r+11],22,-1990404162),a=l(a,h=l(h,f=l(f,i,a,h,n[r+12],7,1804603682),i,a,n[r+13],12,-40341101),f,i,n[r+14],17,-1502002290),h,f,n[r+15],22,1236535329),a=g(a,h=g(h,f=g(f,i,a,h,n[r+1],5,-165796510),i,a,n[r+6],9,-1069501632),f,i,n[r+11],14,643717713),h,f,n[r],20,-373897302),a=g(a,h=g(h,f=g(f,i,a,h,n[r+5],5,-701558691),i,a,n[r+10],9,38016083),f,i,n[r+15],14,-660478335),h,f,n[r+4],20,-405537848),a=g(a,h=g(h,f=g(f,i,a,h,n[r+9],5,568446438),i,a,n[r+14],9,-1019803690),f,i,n[r+3],14,-187363961),h,f,n[r+8],20,1163531501),a=g(a,h=g(h,f=g(f,i,a,h,n[r+13],5,-1444681467),i,a,n[r+2],9,-51403784),f,i,n[r+7],14,1735328473),h,f,n[r+12],20,-1926607734),a=v(a,h=v(h,f=v(f,i,a,h,n[r+5],4,-378558),i,a,n[r+8],11,-2022574463),f,i,n[r+11],16,1839030562),h,f,n[r+14],23,-35309556),a=v(a,h=v(h,f=v(f,i,a,h,n[r+1],4,-1530992060),i,a,n[r+4],11,1272893353),f,i,n[r+7],16,-155497632),h,f,n[r+10],23,-1094730640),a=v(a,h=v(h,f=v(f,i,a,h,n[r+13],4,681279174),i,a,n[r],11,-358537222),f,i,n[r+3],16,-722521979),h,f,n[r+6],23,76029189),a=v(a,h=v(h,f=v(f,i,a,h,n[r+9],4,-640364487),i,a,n[r+12],11,-421815835),f,i,n[r+15],16,530742520),h,f,n[r+2],23,-995338651),a=m(a,h=m(h,f=m(f,i,a,h,n[r],6,-198630844),i,a,n[r+7],10,1126891415),f,i,n[r+14],15,-1416354905),h,f,n[r+5],21,-57434055),a=m(a,h=m(h,f=m(f,i,a,h,n[r+12],6,1700485571),i,a,n[r+3],10,-1894986606),f,i,n[r+10],15,-1051523),h,f,n[r+1],21,-2054922799),a=m(a,h=m(h,f=m(f,i,a,h,n[r+8],6,1873313359),i,a,n[r+15],10,-30611744),f,i,n[r+6],15,-1560198380),h,f,n[r+13],21,1309151649),a=m(a,h=m(h,f=m(f,i,a,h,n[r+4],6,-145523070),i,a,n[r+11],10,-1120210379),f,i,n[r+2],15,718787259),h,f,n[r+9],21,-343485551),f=d(f,e),i=d(i,o),a=d(a,u),h=d(h,c);return[f,i,a,h]}function a(n){var t,r="",e=32*n.length;for(t=0;t<e;t+=8)r+=String.fromCharCode(n[t>>5]>>>t%32&255);return r}function h(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t<r.length;t+=1)r[t]=0;var e=8*n.length;for(t=0;t<e;t+=8)r[t>>5]|=(255&n.charCodeAt(t/8))<<t%32;return r}function e(n){var t,r,e="0123456789abcdef",o="";for(r=0;r<n.length;r+=1)t=n.charCodeAt(r),o+=e.charAt(t>>>4&15)+e.charAt(15&t);return o}function r(n){return unescape(encodeURIComponent(n))}function o(n){return function(n){return a(i(h(n),8*n.length))}(r(n))}function u(n,t){return function(n,t){var r,e,o=h(n),u=[],c=[];for(u[15]=c[15]=void 0,16<o.length&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):function(n,t){return e(u(n,t))}(t,n):r?o(n):function(n){return e(o(n))}(n)}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this);
|
||||
//# sourceMappingURL=md5.min.js.map
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user