1$(document).ready(function () { 2 var isSearched=false; 3 setTimeout(function(){ 4 var tabs = $('.predefined_amounts_tabs'); 5 var items = $('.predefined_amounts_tabs').find('a').length; 6 var selector = $(".predefined_amounts_tabs").find(".predefined_amount_selector"); 7 var activeItem = tabs.find('.active'); 8 var activeWidth = activeItem.innerWidth(); 9 $(".predefined_amount_selector").css({ 10 "left": activeItem.position.left + "px", 11 "width": "46px" 12 }); 13 14 15 $(".predefined_amounts_tabs_challange").on("click", "a", function () { 16 $('.predefined_amounts_tabs_challange a').removeClass("active"); 17 $(this).addClass('active'); 18 var activeWidth = $(this).innerWidth(); 19 var itemPos = $(this).position(); 20 $(".predefined_amount_selector_challange").css({ 21 "left": itemPos.left + "px", 22 "width": activeWidth + "px" 23 }); 24 }); 25 26 $(".predefined_amounts_tabs_duration").on("click", "a", function () { 27 $('.predefined_amounts_tabs_duration a').removeClass("active"); 28 $(this).addClass('active'); 29 var activeWidth = $(this).innerWidth(); 30 var itemPos = $(this).position(); 31 $(".predefined_amount_selector_duration").css({ 32 "left": itemPos.left + "px", 33 "width": activeWidth + "px" 34 }); 35 }); 36 37 $(".predefined_type_tabs_challange").on("click", "a", function () { 38 $('.predefined_type_tabs_challange a').removeClass("active"); 39 $(this).addClass('active'); 40 var activeWidth = $(this).innerWidth(); 41 var itemPos = $(this).position(); 42 $(".predefined_type_selector_challange").css({ 43 "left": itemPos.left + "px", 44 "width": activeWidth + "px" 45 }); 46 }); 47 48 show_hide_challange_payouts() 49 $.validator.addMethod('balance_check', function (value, element) { 50 var current_balance = $('#account_balance').val(); 51 if (value <= parseFloat(current_balance)) { 52 return true; 53 } else { 54 return false; 55 } 56 }); 57 $('#challenge_user').on('keyup', function () { 58 $( "#hid_challenge_user" ).val(''); 59 keyword = $( "#challenge_user" ).val() 60 if (keyword!='') { 61 isSearched=false; 62 $.ajax({ 63 type: "POST", 64 url: $("#hid_site_url").val() + "components/root/search-user", 65 data: {"keyword":keyword, "include_us": 0, "type": "duel"}, 66 success: function (response) { 67 isSearched=false; 68 var u_id = $('#hid_user_id').val(); 69 var list = '<ul class="usr_list" style="overflow-x:hidden; width:298px;">'; 70 71 var default_image = ''; 72 if (current_client_id == 8) { 73 default_image = $("#hid_assets_url").val() + 'images/gamehub_gamers_default_pic.png'; 74 } else { 75 default_image = $("#hid_assets_url").val() + 'images/default-profile-img2.png'; 76 } 77 78 response.forEach(e=>{ 79 if (e.id !== u_id) { 80 if (e.online_status == 1) { 81 if (e.user_radar_status == 1) { 82 if (e.shield_status == 1) { 83 if (e.user_already_in_duel == 1) { 84 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; filter:hue-rotate(255deg) saturate(12); margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span><img src="' + $("#hid_assets_url").val() + 'images/armoury/unlocks/shield.png" style="width:25px; height:25px; margin-top:-3px;"></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 85 } else { 86 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span><img src="' + $("#hid_assets_url").val() + 'images/armoury/unlocks/shield.png" style="width:25px; height:25px; margin-top:-3px;"></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 87 } 88 } else { 89 if (e.user_already_in_duel == 1) { 90 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; filter:hue-rotate(255deg) saturate(12); margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 91 } else { 92 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 93 } 94 } 95 } else { 96 if (e.user_already_in_duel == 1) { 97 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; filter:hue-rotate(255deg) saturate(12); margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 98 } else { 99 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 100 } 101 } 102 } else { 103 if (e.user_radar_status == 1) { 104 if (e.shield_status == 1) { 105 if (e.user_already_in_duel == 1) { 106 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; filter:hue-rotate(255deg) saturate(12); margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span><img src="' + $("#hid_assets_url").val() + 'images/armoury/unlocks/shield.png" style="width:25px; height:25px; margin-top:-3px;"></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 107 } else { 108 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span><img src="' + $("#hid_assets_url").val() +'images/armoury/unlocks/shield.png" style="width:25px; height:25px; margin-top:-3px;"></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 109 } 110 } else { 111 if (e.user_already_in_duel == 1) { 112 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; filter:hue-rotate(255deg) saturate(12); margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 113 } else { 114 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 115 } 116 } 117 } else { 118 if (e.user_already_in_duel == 1) { 119 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px; filter:hue-rotate(255deg) saturate(12); margin-right:5px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 120 } else { 121 list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + default_image + '\';" style="width:25px; height:25px; border-radius:10px"><span style="margin-left:5px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:5px;" src="' + e.level_image + '"/><span style="margin-left:5px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 122 } 123 } 124 } 125 } 126 }) 127 list+='</ul>' 128 document.querySelector('#user-data').innerHTML=list; 129 // console.log(list); 130 131 } 132 }); 133 // var regd = new RegExp('^'+keyword.toLowerCase()) 134 // const filteredData=players_list.filter(el=>regd.test(el.name)) 135 // // console.log('data',filteredData) 136 // var u_id = $('#hid_user_id').val(); 137 138 // var list='<ul class="usr_list" style="overflow-x:hidden; width:298px;">'; 139 // var online_img = '<img src="<?= ASSETS_URL . "images/online.png" ?>" style="width:8px; height:8px;" />'; 140 141 // filteredData.forEach((e,i)=>{ 142 // if(e.id !== u_id){ 143 // if (e.online_status == 1) { 144 // list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + $("#hid_assets_url").val() + 'images/online.png" style="width:8px; height:8px;" /><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + $("#hid_assets_url").val() + 'images/default-profile-img2.png\';" style="width:30px;height:30px; border-radius:10px"><span style="margin-left:10px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:10px;" src="' + e.level_image + '"/><span style="margin-left:10px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 145 // } else { 146 // list += '<li onclick="slct_usr(\'' + e.id + '\',\'' + e.name + '\')"><span style="width:55%;"><img src="' + e.profile_pic + '" alt="avatar" onerror="this.onerror=null;this.src=\'' + $("#hid_assets_url").val() + 'images/default-profile-img2.png\';" style="width:30px;height:30px; border-radius:10px"><span style="margin-left:10px;">' + e.name.toUpperCase() + '</span></span><span style="width:45%; float:right;"><img style="width:20px;height:20px; margin-left:10px;" src="' + e.level_image + '"/><span style="m
146argin-left:10px; vertical-align:sub;">XP' + ' ' + e.xp_points + '</span></span></li>' 147 // } 148 // } 149 // }) 150 // list+='</ul>' 151 // document.querySelector('#user-data').innerHTML=list; 152 }else{ 153 document.querySelector('#user-data').innerHTML='<ul class="usr_list"></ul>'; 154 } 155 }); 156 157 $('#challenge_target_points').on('change', function () { 158 target = $( "#challenge_target_points option:selected" ).text(); 159 // console.log(target); 160 change_msg(); 161 }); 162 163 // $('#target_duration').on('change', function () { 164 // target = $( "#target_duration option:selected" ).text(); 165 // // console.log(target); 166 // change_msg(); 167 // }); 168 // account_current_balance 169 $("#stake_amount").on('keyup change', function () { 170 show_hide_challange_payouts(); 171 }); 172 173 }, 1000); 174 175 $('#challenge_game').on('change', function () { 176 game = document.querySelector("#challenge_game").value; 177 $('#challenge_game').attr("placeholder", ' '); 178 change_msg(); 179 }); 180 181 change_msg(); 182 183}); 184 185var user='an opponent'; 186var amt = '$1.90'; 187var target='1 min'; 188var game = 'a game'; 189 190function load_challange_amount(amount) { 191 $("#stake_amount").val(amount); 192 show_hide_challange_payouts(); 193} 194 195function load_challange_duration(duration,time_format) { 196 $("#target_duration").val(time_format); 197 target = duration+' min'; 198 change_msg(); 199} 200 201function load_type_challange(type){ 202 $("#challenge_mode").val(type); 203 if (type == 'T') { 204 $("#rduration").css('display','block'); 205 $("#tpoint").css('display','none'); 206 }else{ 207 $("#rduration").css('display','none'); 208 $("#tpoint").css('display','block'); 209 } 210 211} 212 213function slct_usr(id,name){ 214 $( "#hid_challenge_user" ).val(id); 215 $( "#challenge_user" ).val(name); 216 document.querySelector('#user-data').innerHTML='<ul class="usr_list"></ul>'; 217 user = name; 218 // console.log(user); 219 change_msg(); 220} 221 222function update_challenge_minimize_number(long_num) { 223 if (long_num >= 10000 && long_num < 1000000) { 224 format = (long_num / 1000).toFixed(2) + 'K'; 225 } else if (long_num >= 1000000 && long_num < 1000000000) { 226 format = (long_num / 1000000).toFixed(2) + 'M'; 227 } else if (long_num >= 1000000000) { 228 format = (long_num / 1000000000).toFixed(2) + 'B'; 229 }else { 230 format = long_num.toFixed(2); 231 } 232 return format; 233} 234 235function show_hide_challange_payouts() { 236 if ($("#stake_amount").val() != '' && parseFloat($("#stake_amount").val()) == $("#stake_amount").val()) { 237 var target_percent = parseFloat(90); 238 var payout_amount, profit_amount, stake_amount; 239 stake_amount = parseFloat($("#stake_amount").val() * amounts_multiplier); 240 // console.log('stake_amount: ', stake_amount); 241 payout_amount = parseFloat(parseFloat((target_percent / 100) * stake_amount) + stake_amount).toFixed(5); 242 profit_amount = (((target_percent / 100) * stake_amount)).toFixed(5); 243 244 var minimize_payout_amount = update_challenge_minimize_number(parseFloat(payout_amount)); 245 $("#profit_amount1").text(parseFloat(profit_amount).toFixed(2)); 246 $("#payout_amount1").text(minimize_payout_amount); 247 248 $("#payout_percent1").text(target_percent + "%"); 249 amt = update_challenge_minimize_number(parseFloat(payout_amount)); 250 change_msg(); 251 $(".init_hide_payouts").show(); 252 } else { 253 $("#profit_amount1").text("N/A"); 254 $("#payout_amount1").text("N/A"); 255 $("#payout_percent1").text("N/A"); 256 } 257} 258 259function change_msg(){ 260 // console.log(user); 261 var new_msg = msg.replace(/an opponent/, user); 262 var new_msg = new_msg.replace(/1 minute/, target); 263 var new_msg = new_msg.replace(/\$1.90/, cursymbol + amt); 264 var new_msg = new_msg.replace(/a game/, game); 265 $('#chalange_text_id').html(new_msg); 266 if (status == 1) { 267 var first_part = header_msg.split("on ")[1]; 268 var new_header_msg = header_msg.replace(first_part, game); 269 $('#challenge_modal_header_name').text(new_header_msg); 270 } 271 272}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.