|
|
@ -876,7 +876,18 @@
|
|
|
|
fontname: 'Ubuntu',
|
|
|
|
fontname: 'Ubuntu',
|
|
|
|
fontcolor: '#ff9818',
|
|
|
|
fontcolor: '#ff9818',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var logo = $(linkTag).parents('.game-li').eq(0).find('.img-box').children('img')[0]
|
|
|
|
|
|
|
|
|
|
|
|
var logo = null;
|
|
|
|
|
|
|
|
var logoSrc = $(linkTag).parents('.game-li').eq(0).find('.img-box').children('img').attr('src');
|
|
|
|
|
|
|
|
console.log(isImg(logoSrc));
|
|
|
|
|
|
|
|
if (isImg(logoSrc)) {
|
|
|
|
|
|
|
|
logo = $(linkTag).parents('.game-li').eq(0).find('.img-box').children('img')[0]
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
var img = document.createElement('img');
|
|
|
|
|
|
|
|
img.src = '__IMG__/game_icon.png';
|
|
|
|
|
|
|
|
logo = img;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$('#game_link_ercode').empty().qrcode(options);
|
|
|
|
$('#game_link_ercode').empty().qrcode(options);
|
|
|
|
$("#game_link_ercode canvas")[0].getContext('2d').drawImage(logo, (qrcodeWidth - logoWidth) / 2, (qrcodeHeight - logoHeight) / 2, logoWidth, logoHeight);
|
|
|
|
$("#game_link_ercode canvas")[0].getContext('2d').drawImage(logo, (qrcodeWidth - logoWidth) / 2, (qrcodeHeight - logoHeight) / 2, logoWidth, logoHeight);
|
|
|
|
|
|
|
|
|
|
|
@ -896,6 +907,15 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isImg(src) {
|
|
|
|
|
|
|
|
var img = new Image();
|
|
|
|
|
|
|
|
img.src = src;
|
|
|
|
|
|
|
|
if (img.width > 0 || img.height > 0) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var clipboard = new ClipboardJS('#clipboard-btn', {
|
|
|
|
var clipboard = new ClipboardJS('#clipboard-btn', {
|
|
|
|
text: function(trigger) {
|
|
|
|
text: function(trigger) {
|
|
|
|
return trigger.getAttribute('data-text');
|
|
|
|
return trigger.getAttribute('data-text');
|
|
|
|